From fe0341462e8c8681bb7ff20380974022578e15b0 Mon Sep 17 00:00:00 2001 From: jorostoyanov Date: Tue, 7 May 2019 15:38:53 +0300 Subject: [PATCH] Add bundles --- build/bundle.css | 30 ++++++++++++++++++++++++++---- build/bundle.js | 2 +- build/bundle.min.css | 2 +- build/bundle.min.js | 2 +- languages/carbon-field-icon-ui.pot | 10 +++++----- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/build/bundle.css b/build/bundle.css index a53da66..1e3735a 100644 --- a/build/bundle.css +++ b/build/bundle.css @@ -10,6 +10,8 @@ border: 1px dashed #ccc; margin-right: 10px; flex: 0 0 150px; } + .cf-container-widget .cf-icon-preview { + flex: 0 0 100px; } @media screen and (max-width: 768px) { .cf-icon-preview { flex: 1 0 auto; @@ -24,16 +26,27 @@ margin: auto; min-height: 100px; justify-content: center; - align-items: center; } + align-items: center; + text-align: center; } + .cf-container-widget .cf-icon-preview__canvas { + line-height: 20px; + min-height: 60px; } .cf-icon-preview__canvas i { font-size: 64px; line-height: 100px; } + .cf-container-widget .cf-icon-preview__canvas i { + line-height: 60px; } .cf-icon-preview__canvas i.dashicons-before:before { font-size: 64px; line-height: 100px; width: auto; height: auto; } + .cf-container-widget .cf-icon-preview__canvas i.dashicons-before:before { + line-height: 80px; } + +.cf-icon-preview__canvas img { + width: 64px; } .cf-icon-preview__label { width: 100%; @@ -82,6 +95,11 @@ text-align: center; } .cf-icon-switcher__options-list__item:hover, .cf-icon-switcher__options-list__item--selected { background: #eee; } + .cf-container-user-meta .cf-icon-switcher__options-list__item, + .cf-container-term-meta .cf-icon-switcher__options-list__item { + flex: 0 0 25%; } + .cf-container-widget .cf-icon-switcher__options-list__item { + flex: 0 0 33.33333%; } @media screen and (max-width: 1400px) { .cf-icon-switcher__options-list__item { flex: 0 0 25%; } } @@ -98,10 +116,13 @@ align-items: center; justify-content: center; } -.cf-icon-switcher__options-list i { +.cf-icon-switcher__options-list i, +.cf-icon-switcher__options-list img { width: 24px; - color: #73777c; margin-bottom: 10px; } + +.cf-icon-switcher__options-list i { + color: #73777c; } .cf-icon-switcher__options-list i:before { font-size: 20px; } @@ -134,7 +155,8 @@ line-height: 18px; border-radius: 0; border: 0 !important; - box-shadow: none !important; } + box-shadow: none !important; + width: auto !important; } .cf-icon-search__clear { margin-right: 5px !important; diff --git a/build/bundle.js b/build/bundle.js index ca939e4..0b612e6 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -205,7 +205,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _car /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(__webpack_provided_wp_dot_element) {/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\nvar IconField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(IconField, _Component);\n\n function IconField() {\n var _getPrototypeOf2;\n\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IconField);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, (_getPrototypeOf2 = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(IconField)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"state\", {\n isFocused: false,\n searchTerm: '',\n chosenIcon: null,\n iconClass: '',\n availableOptions: []\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"handleClick\", function (e) {\n if (_this.popup.contains(e.target)) {\n return;\n }\n\n _this.closeList();\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"handleChange\", function (_ref) {\n var provider = _ref.provider,\n value = _ref.value;\n var _this$props = _this.props,\n id = _this$props.id,\n onChange = _this$props.onChange;\n onChange(id, {\n value: value,\n provider: provider,\n icon: value\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"handleButtonClearClick\", function (e) {\n var _this$props2 = _this.props,\n id = _this$props2.id,\n onChange = _this$props2.onChange;\n\n _this.setState({\n searchTerm: '',\n iconClass: '',\n chosenIcon: null\n });\n\n onChange(id, {\n value: '',\n icon: '',\n provider: ''\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onIconChange\", function (value) {\n var options = _this.props.field.options;\n var valueObject = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"first\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"filter\"])(options, function (option) {\n return option.value === value;\n }));\n\n if (valueObject && valueObject.value === '') {\n valueObject = null;\n }\n\n _this.setState({\n searchTerm: valueObject ? valueObject.value : '',\n iconClass: valueObject ? valueObject.class : '',\n chosenIcon: valueObject\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"openList\", function () {\n _this.setState({\n isFocused: true\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"closeList\", function () {\n _this.setState({\n isFocused: false\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onFocusInput\", function (e) {\n e.preventDefault();\n\n _this.setState({\n isFocused: true\n });\n\n _this.searchInput.focus();\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onOptionSelect\", function (option) {\n _this.handleChange(option);\n\n _this.onIconChange(option.value);\n\n _this.closeList();\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onSearchTermChange\", function (e) {\n var field = _this.props.field;\n var options = field.options;\n var searchTerm = e.target.value;\n var availableOptions = searchTerm ? Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"filter\"])(options, function (option) {\n var compareTo = [option.value, option.name].concat(option.search_terms).map(function (searchTerm) {\n return searchTerm.toLowerCase();\n });\n var match = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"some\"])(compareTo, function (metadata) {\n return metadata.indexOf(searchTerm.toLowerCase()) !== -1;\n });\n return match;\n }) : options;\n\n _this.setState({\n searchTerm: searchTerm,\n availableOptions: availableOptions\n });\n });\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IconField, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n document.addEventListener('mousedown', this.handleClick, false);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('mousedown', this.handleClick, false);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n field = _this$props3.field,\n value = _this$props3.value;\n var options = field.options;\n var availableOptions = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"filter\"])(options, function (option) {\n var compareTo = [option.value, option.name].concat(option.search_terms).map(function (searchTerm) {\n return searchTerm.toLowerCase();\n });\n var match = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"some\"])(compareTo, function (metadata) {\n return metadata.indexOf(_this2.state.searchTerm.toLowerCase()) !== -1;\n });\n return match;\n });\n this.onIconChange(value.value);\n this.setState({\n searchTerm: value ? value.icon : '',\n availableOptions: availableOptions\n });\n }\n /**\n * Handles document click.\n *\n * @param {Event} e\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Renders the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this3 = this;\n\n var _this$props4 = this.props,\n name = _this$props4.name,\n value = _this$props4.value;\n var openList = this.openList,\n onSearchTermChange = this.onSearchTermChange;\n var _this$state = this.state,\n iconClass = _this$state.iconClass,\n isFocused = _this$state.isFocused,\n searchTerm = _this$state.searchTerm,\n availableOptions = _this$state.availableOptions,\n chosenIcon = _this$state.chosenIcon;\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-wrapper\"\n }, __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[provider]\"),\n value: value.provider,\n readOnly: true\n }), __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[icon]\"),\n value: value.icon,\n readOnly: true\n }), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-preview\"\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-preview__canvas\"\n }, chosenIcon ? __webpack_provided_wp_dot_element.createElement(\"i\", {\n className: iconClass\n }) : __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-icon-preview__canvas-label\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('No icon selected', 'carbon-field-icon-ui'))), __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"text\",\n className: \"cf-icon-preview__label\",\n value: chosenIcon ? chosenIcon.name : '',\n readOnly: true\n })), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-switcher\",\n ref: function ref(popup) {\n return _this3.popup = popup;\n }\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()({\n 'cf-icon-search': true,\n 'cf-icon-search--focused': isFocused,\n 'dashicons-before': true,\n 'dashicons-search': true\n })\n }, __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"text\",\n onFocus: openList,\n onChange: onSearchTermChange,\n value: searchTerm,\n className: \"cf-icon-search__input\",\n placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Search icon ...', 'carbon-field-icon-ui'),\n ref: function ref(searchInput) {\n return _this3.searchInput = searchInput;\n }\n }), __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-icon-search__clear button button-small\",\n onClick: this.handleButtonClearClick\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Clear', 'carbon-field-icon-ui'))), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()({\n 'cf-icon-switcher__options': true,\n 'cf-icon-switcher__options--opened': isFocused\n })\n }, __webpack_provided_wp_dot_element.createElement(\"ul\", {\n className: \"cf-icon-switcher__options-list\"\n }, availableOptions.length ? availableOptions.map(function (option) {\n return __webpack_provided_wp_dot_element.createElement(\"li\", {\n key: option.value,\n className: \"cf-icon-switcher__options-list__item cf-icon-switcher__options-list__item--\".concat(option.value)\n }, __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n onClick: function onClick() {\n _this3.onOptionSelect(option);\n },\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()({\n 'active': option.value === value\n })\n }, __webpack_provided_wp_dot_element.createElement(\"i\", {\n className: option.class,\n dangerouslySetInnerHTML: {\n __html: option.contents\n }\n }), __webpack_provided_wp_dot_element.createElement(\"span\", null, option.name)));\n }) : __webpack_provided_wp_dot_element.createElement(\"li\", {\n key: \"no-results\",\n className: \"cf-icon-switcher__options-list__item cf-icon-switcher__options-list__item--no-results\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('No results found', 'carbon-field-icon-ui'))))));\n }\n }]);\n\n return IconField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__[\"Component\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (IconField);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\")))\n\n//# sourceURL=webpack:///./src/main.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(__webpack_provided_wp_dot_element) {/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! classnames */ \"classnames\");\n/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\");\n/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/i18n */ \"@wordpress/i18n\");\n/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__);\n\n\n\n\n\n\n\n\n/**\n * External dependencies.\n */\n\n\n\n\n\nvar IconField =\n/*#__PURE__*/\nfunction (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(IconField, _Component);\n\n function IconField() {\n var _getPrototypeOf2;\n\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, IconField);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, (_getPrototypeOf2 = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(IconField)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"state\", {\n isFocused: false,\n searchTerm: '',\n chosenIcon: null,\n iconClass: '',\n availableOptions: []\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"handleClick\", function (e) {\n if (_this.popup.contains(e.target)) {\n return;\n }\n\n _this.closeList();\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"handleChange\", function (_ref) {\n var provider = _ref.provider,\n value = _ref.value;\n var _this$props = _this.props,\n id = _this$props.id,\n onChange = _this$props.onChange;\n onChange(id, {\n value: value,\n provider: provider,\n icon: value\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"handleButtonClearClick\", function (e) {\n var _this$props2 = _this.props,\n id = _this$props2.id,\n onChange = _this$props2.onChange;\n\n _this.setState({\n searchTerm: '',\n iconClass: '',\n chosenIcon: null\n });\n\n onChange(id, {\n value: '',\n icon: '',\n provider: ''\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onIconChange\", function (value) {\n var options = _this.props.field.options;\n var valueObject = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"first\"])(Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"filter\"])(options, function (option) {\n return option.value === value;\n }));\n\n if (valueObject && valueObject.value === '') {\n valueObject = null;\n }\n\n _this.setState({\n searchTerm: valueObject ? valueObject.value : '',\n iconClass: valueObject ? valueObject.class : '',\n chosenIcon: valueObject\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"openList\", function () {\n _this.setState({\n isFocused: true\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"closeList\", function () {\n _this.setState({\n isFocused: false\n });\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onFocusInput\", function (e) {\n e.preventDefault();\n\n _this.setState({\n isFocused: true\n });\n\n _this.searchInput.focus();\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onOptionSelect\", function (option) {\n _this.handleChange(option);\n\n _this.onIconChange(option.value);\n\n _this.closeList();\n });\n\n _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_6___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this)), \"onSearchTermChange\", function (e) {\n var field = _this.props.field;\n var options = field.options;\n var searchTerm = e.target.value;\n var availableOptions = searchTerm ? Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"filter\"])(options, function (option) {\n var compareTo = [option.value, option.name].concat(option.search_terms).map(function (searchTerm) {\n return searchTerm.toLowerCase();\n });\n var match = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"some\"])(compareTo, function (metadata) {\n return metadata.indexOf(searchTerm.toLowerCase()) !== -1;\n });\n return match;\n }) : options;\n\n _this.setState({\n searchTerm: searchTerm,\n availableOptions: availableOptions\n });\n });\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(IconField, [{\n key: \"componentWillMount\",\n value: function componentWillMount() {\n document.addEventListener('mousedown', this.handleClick, false);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n document.removeEventListener('mousedown', this.handleClick, false);\n }\n /**\n * Lifecycle hook.\n *\n * @return {void}\n */\n\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n var _this$props3 = this.props,\n field = _this$props3.field,\n value = _this$props3.value;\n var options = field.options;\n var availableOptions = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"filter\"])(options, function (option) {\n var compareTo = [option.value, option.name].concat(option.search_terms).map(function (searchTerm) {\n return searchTerm.toLowerCase();\n });\n var match = Object(lodash__WEBPACK_IMPORTED_MODULE_7__[\"some\"])(compareTo, function (metadata) {\n return metadata.indexOf(_this2.state.searchTerm.toLowerCase()) !== -1;\n });\n return match;\n });\n this.onIconChange(value.value);\n this.setState({\n searchTerm: value ? value.icon : '',\n availableOptions: availableOptions\n });\n }\n /**\n * Handles document click.\n *\n * @param {Event} e\n * @return {void}\n */\n\n }, {\n key: \"render\",\n\n /**\n * Renders the component.\n *\n * @return {Object}\n */\n value: function render() {\n var _this3 = this;\n\n var _this$props4 = this.props,\n name = _this$props4.name,\n value = _this$props4.value;\n var openList = this.openList,\n onSearchTermChange = this.onSearchTermChange;\n var _this$state = this.state,\n iconClass = _this$state.iconClass,\n isFocused = _this$state.isFocused,\n searchTerm = _this$state.searchTerm,\n availableOptions = _this$state.availableOptions,\n chosenIcon = _this$state.chosenIcon;\n var iconPreview;\n\n if (chosenIcon && chosenIcon.icon) {\n iconPreview = __webpack_provided_wp_dot_element.createElement(\"img\", {\n src: chosenIcon.icon\n });\n } else {\n iconPreview = __webpack_provided_wp_dot_element.createElement(\"i\", {\n className: iconClass\n });\n }\n\n return __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-wrapper\"\n }, __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[provider]\"),\n value: value.provider,\n readOnly: true\n }), __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"hidden\",\n name: \"\".concat(name, \"[icon]\"),\n value: value.icon,\n readOnly: true\n }), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-preview\"\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-preview__canvas\"\n }, chosenIcon ? iconPreview : __webpack_provided_wp_dot_element.createElement(\"span\", {\n className: \"cf-icon-preview__canvas-label\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('No icon selected', 'carbon-field-icon-ui'))), __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"text\",\n className: \"cf-icon-preview__label\",\n value: chosenIcon ? chosenIcon.name : '',\n readOnly: true\n })), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: \"cf-icon-switcher\",\n ref: function ref(popup) {\n return _this3.popup = popup;\n }\n }, __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()({\n 'cf-icon-search': true,\n 'cf-icon-search--focused': isFocused,\n 'dashicons-before': true,\n 'dashicons-search': true\n })\n }, __webpack_provided_wp_dot_element.createElement(\"input\", {\n type: \"text\",\n onFocus: openList,\n onChange: onSearchTermChange,\n value: searchTerm,\n className: \"cf-icon-search__input\",\n placeholder: Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Search icon ...', 'carbon-field-icon-ui'),\n ref: function ref(searchInput) {\n return _this3.searchInput = searchInput;\n }\n }), __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n className: \"cf-icon-search__clear button button-small\",\n onClick: this.handleButtonClearClick\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('Clear', 'carbon-field-icon-ui'))), __webpack_provided_wp_dot_element.createElement(\"div\", {\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()({\n 'cf-icon-switcher__options': true,\n 'cf-icon-switcher__options--opened': isFocused\n })\n }, __webpack_provided_wp_dot_element.createElement(\"ul\", {\n className: \"cf-icon-switcher__options-list\"\n }, availableOptions.length ? availableOptions.map(function (option) {\n return __webpack_provided_wp_dot_element.createElement(\"li\", {\n key: option.value,\n className: \"cf-icon-switcher__options-list__item cf-icon-switcher__options-list__item--\".concat(option.value)\n }, __webpack_provided_wp_dot_element.createElement(\"button\", {\n type: \"button\",\n onClick: function onClick() {\n _this3.onOptionSelect(option);\n },\n className: classnames__WEBPACK_IMPORTED_MODULE_8___default()({\n 'active': option.value === value\n })\n }, option.icon ? __webpack_provided_wp_dot_element.createElement(\"img\", {\n src: option.icon,\n className: option.class\n }) : __webpack_provided_wp_dot_element.createElement(\"i\", {\n className: option.class,\n dangerouslySetInnerHTML: {\n __html: option.contents\n }\n }), __webpack_provided_wp_dot_element.createElement(\"span\", null, option.name)));\n }) : __webpack_provided_wp_dot_element.createElement(\"li\", {\n key: \"no-results\",\n className: \"cf-icon-switcher__options-list__item cf-icon-switcher__options-list__item--no-results\"\n }, Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_10__[\"__\"])('No results found', 'carbon-field-icon-ui'))))));\n }\n }]);\n\n return IconField;\n}(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__[\"Component\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (IconField);\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! @wordpress/element */ \"@wordpress/element\")))\n\n//# sourceURL=webpack:///./src/main.js?"); /***/ }), diff --git a/build/bundle.min.css b/build/bundle.min.css index c5c1d86..05a12c5 100644 --- a/build/bundle.min.css +++ b/build/bundle.min.css @@ -1 +1 @@ -.cf-icon-wrapper{display:flex;flex-direction:row;flex-wrap:wrap}.cf-icon-preview{border:1px dashed #ccc;margin-right:10px;flex:0 0 150px}@media screen and (max-width:768px){.cf-icon-preview{flex:1 0 auto;margin-right:0;margin-bottom:10px}}.cf-icon-preview__canvas{display:flex;border:0;background:0;padding:15px;margin:auto;min-height:100px;justify-content:center;align-items:center}.cf-icon-preview__canvas i{font-size:64px;line-height:100px}.cf-icon-preview__canvas i.dashicons-before:before{font-size:64px;line-height:100px;width:auto;height:auto}.cf-icon-preview__label{width:100%;margin:0}.cf-icon-switcher{flex:1;position:relative}.cf-icon-switcher__options{display:none;position:absolute;left:0;top:35px;z-index:10;width:100%;max-height:250px;overflow-y:auto;background:#fff;border:1px solid #e5e5e5;border-top:0 solid #e5e5e5;box-shadow:0 2px 5px 0 rgba(0,0,0,.15)}.cf-icon-switcher__options--opened{display:block}@media screen and (max-width:768px){.cf-icon-switcher__options{top:42px}}.cf-icon-switcher__options-list{display:flex;flex-direction:row;flex-wrap:wrap;margin:0}.cf-icon-switcher__options-list__item{display:block;border:1px solid #eee;margin:0;flex:0 0 12.5%;word-break:break-word;box-sizing:border-box}.cf-icon-switcher__options-list__item--no-results{padding:8px;flex:0 0 100%;text-align:center}.cf-icon-switcher__options-list__item--selected,.cf-icon-switcher__options-list__item:hover{background:#eee}@media screen and (max-width:1400px){.cf-icon-switcher__options-list__item{flex:0 0 25%}}.cf-icon-switcher__options-list button{border:0;background:0;width:100%;height:100%;padding:10px 0;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}.cf-icon-switcher__options-list i{width:24px;color:#73777c;margin-bottom:10px}.cf-icon-switcher__options-list i:before{font-size:20px}.cf-icon-search{position:relative;width:100%;border-spacing:0;margin:0;z-index:1;padding:5px 0;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);display:flex;flex-direction:row}.cf-icon-search:before{position:absolute;left:8px;top:50%;margin-top:-10px;color:#73777c;pointer-events:none}.cf-icon-search__input{flex:1 0 auto;margin:0 0 0 32px;font-size:13px;line-height:18px;border-radius:0;border:0!important;box-shadow:none!important}.cf-icon-search__clear{margin-right:5px!important;margin-bottom:0!important} \ No newline at end of file +.cf-icon-wrapper{display:flex;flex-direction:row;flex-wrap:wrap}.cf-icon-preview{border:1px dashed #ccc;margin-right:10px;flex:0 0 150px}.cf-container-widget .cf-icon-preview{flex:0 0 100px}@media screen and (max-width:768px){.cf-icon-preview{flex:1 0 auto;margin-right:0;margin-bottom:10px}}.cf-icon-preview__canvas{display:flex;border:0;background:0;padding:15px;margin:auto;min-height:100px;justify-content:center;align-items:center;text-align:center}.cf-container-widget .cf-icon-preview__canvas{line-height:20px;min-height:60px}.cf-icon-preview__canvas i{font-size:64px;line-height:100px}.cf-container-widget .cf-icon-preview__canvas i{line-height:60px}.cf-icon-preview__canvas i.dashicons-before:before{font-size:64px;line-height:100px;width:auto;height:auto}.cf-container-widget .cf-icon-preview__canvas i.dashicons-before:before{line-height:80px}.cf-icon-preview__canvas img{width:64px}.cf-icon-preview__label{width:100%;margin:0}.cf-icon-switcher{flex:1;position:relative}.cf-icon-switcher__options{display:none;position:absolute;left:0;top:35px;z-index:10;width:100%;max-height:250px;overflow-y:auto;background:#fff;border:1px solid #e5e5e5;border-top:0 solid #e5e5e5;box-shadow:0 2px 5px 0 rgba(0,0,0,.15)}.cf-icon-switcher__options--opened{display:block}@media screen and (max-width:768px){.cf-icon-switcher__options{top:42px}}.cf-icon-switcher__options-list{display:flex;flex-direction:row;flex-wrap:wrap;margin:0}.cf-icon-switcher__options-list__item{display:block;border:1px solid #eee;margin:0;flex:0 0 12.5%;word-break:break-word;box-sizing:border-box}.cf-icon-switcher__options-list__item--no-results{padding:8px;flex:0 0 100%;text-align:center}.cf-icon-switcher__options-list__item--selected,.cf-icon-switcher__options-list__item:hover{background:#eee}.cf-container-term-meta .cf-icon-switcher__options-list__item,.cf-container-user-meta .cf-icon-switcher__options-list__item{flex:0 0 25%}.cf-container-widget .cf-icon-switcher__options-list__item{flex:0 0 33.33333%}@media screen and (max-width:1400px){.cf-icon-switcher__options-list__item{flex:0 0 25%}}.cf-icon-switcher__options-list button{border:0;background:0;width:100%;height:100%;padding:10px 0;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center}.cf-icon-switcher__options-list i,.cf-icon-switcher__options-list img{width:24px;margin-bottom:10px}.cf-icon-switcher__options-list i{color:#73777c}.cf-icon-switcher__options-list i:before{font-size:20px}.cf-icon-search{position:relative;width:100%;border-spacing:0;margin:0;z-index:1;padding:5px 0;border:1px solid #ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);display:flex;flex-direction:row}.cf-icon-search:before{position:absolute;left:8px;top:50%;margin-top:-10px;color:#73777c;pointer-events:none}.cf-icon-search__input{flex:1 0 auto;margin:0 0 0 32px;font-size:13px;line-height:18px;border-radius:0;border:0!important;box-shadow:none!important;width:auto!important}.cf-icon-search__clear{margin-right:5px!important;margin-bottom:0!important} \ No newline at end of file diff --git a/build/bundle.min.js b/build/bundle.min.js index d5c0d11..2ff751d 100644 --- a/build/bundle.min.js +++ b/build/bundle.min.js @@ -1 +1 @@ -!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:o})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(o,r,function(n){return e[n]}.bind(null,r));return o},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=13)}([function(e,n){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,n){e.exports=function(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}},function(e,n){e.exports=cf.vendor.lodash},function(e,n){e.exports=cf.vendor["@wordpress/i18n"]},function(e,n){e.exports=cf.vendor.classnames},function(e,n){e.exports=cf.vendor["@wordpress/element"]},function(e,n){e.exports=cf.core},function(e,n,t){"use strict";(function(e){var o=t(8),r=t.n(o),c=t(9),i=t.n(c),a=t(10),s=t.n(a),u=t(11),l=t.n(u),f=t(12),p=t.n(f),m=t(0),d=t.n(m),h=t(1),v=t.n(h),b=t(2),y=t(4),_=t.n(y),O=t(5),w=t(3),C=function(n){function t(){var e,n;r()(this,t);for(var o=arguments.length,c=new Array(o),i=0;i