'components-color-edit__hidden-control': !isShowingControls
icon: library_close["a" /* default */],
label: Object(external_wp_i18n_["__"])('Remove color'),
})), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: classnames_default()({
'components-color-edit__hidden-control': !isShowingControls
icon: isShowingAdvancedPanel ? chevron_up["a" /* default */] : chevron_down["a" /* default */],
label: Object(external_wp_i18n_["__"])('Additional color settings'),
onClick: function onClick() {
if (isShowingAdvancedPanel) {
setIsShowingAdvancedPanel(!isShowingAdvancedPanel);
"aria-expanded": isShowingAdvancedPanel
})), onCancel && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-color-edit__cancel-button",
}, Object(external_wp_i18n_["__"])('Cancel')), isShowingAdvancedPanel && Object(external_wp_element_["createElement"])(text_control, {
className: "components-color-edit__slug-input",
onChange: function onChange(newSlug) {
label: Object(external_wp_i18n_["__"])('Slug'),
function ColorInserter(_ref4) {
var onInsert = _ref4.onInsert,
onCancel = _ref4.onCancel;
var _useState9 = Object(external_wp_element_["useState"])({
_useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2),
setColor = _useState10[1];
return Object(external_wp_element_["createElement"])(ColorOption, {
confirmLabel: Object(external_wp_i18n_["__"])('Save'),
onConfirm: function onConfirm() {
isEditingNameOnMount: true,
isEditingColorOnMount: true,
function ColorEdit(_ref5) {
var colors = _ref5.colors,
_onChange2 = _ref5.onChange,
immutableColorSlugs = _ref5.immutableColorSlugs,
_ref5$canReset = _ref5.canReset,
canReset = _ref5$canReset === void 0 ? true : _ref5$canReset;
var _useState11 = Object(external_wp_element_["useState"])(false),
_useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2),
isInsertingColor = _useState12[0],
setIsInsertingColor = _useState12[1];
return Object(external_wp_element_["createElement"])(base_control, null, Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("div", {
className: "components-color-edit__label-and-insert-container"
}, Object(external_wp_element_["createElement"])("legend", null, Object(external_wp_element_["createElement"])("div", null, Object(external_wp_element_["createElement"])(base_control.VisualLabel, null, Object(external_wp_i18n_["__"])('Color palette')))), !isInsertingColor && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
onClick: function onClick() {
setIsInsertingColor(true);
className: "components-color-edit__insert-button",
icon: plus["a" /* default */]
})), Object(external_wp_element_["createElement"])("div", null, !Object(external_lodash_["isEmpty"])(colors) && colors.map(function (color, index) {
return Object(external_wp_element_["createElement"])(ColorOption, {
immutableColorSlugs: immutableColorSlugs,
onChange: function onChange(newColor) {
_onChange2(colors.map(function (currentColor, currentIndex) {
if (currentIndex === index) {
onRemove: function onRemove() {
_onChange2(colors.filter(function (_currentColor, currentIndex) {
if (currentIndex === index) {
}), isInsertingColor && Object(external_wp_element_["createElement"])(ColorInserter, {
onInsert: function onInsert(newColor) {
setIsInsertingColor(false);
_onChange2([].concat(Object(toConsumableArray["a" /* default */])(colors || []), [newColor]));
onCancel: function onCancel() {
return setIsInsertingColor(false);
}), !isInsertingColor && Object(external_lodash_["isEmpty"])(colors) && emptyUI), !!canReset && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
className: "components-color-edit__reset-button",
onClick: function onClick() {
}, Object(external_wp_i18n_["__"])('Reset'))));
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js
var color_indicator_ColorIndicator = function ColorIndicator(_ref) {
var className = _ref.className,
colorValue = _ref.colorValue,
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "colorValue"]);
return Object(external_wp_element_["createElement"])("span", Object(esm_extends["a" /* default */])({
className: classnames_default()('component-color-indicator', className),
/* harmony default export */ var color_indicator = (color_indicator_ColorIndicator);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-palette/index.js
function ColorPalette(_ref) {
var _ref$clearable = _ref.clearable,
clearable = _ref$clearable === void 0 ? true : _ref$clearable,
className = _ref.className,
_ref$disableCustomCol = _ref.disableCustomColors,
disableCustomColors = _ref$disableCustomCol === void 0 ? false : _ref$disableCustomCol,
onChange = _ref.onChange,
var clearColor = Object(external_wp_element_["useCallback"])(function () {
return onChange(undefined);
var colorOptions = Object(external_wp_element_["useMemo"])(function () {
return Object(external_lodash_["map"])(colors, function (_ref2) {
return Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, {
isSelected: value === color,
selectedIconProps: value === color ? {
fill: tinycolor_default.a.mostReadable(color, ['#000', '#fff']).toHexString()
tooltipText: name || // translators: %s: color hex code e.g: "#f00".
Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color),
onClick: value === color ? clearColor : function () {
"aria-label": name ? // translators: %s: The name of the color e.g: "vivid red".
Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00".
Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color)
}, [colors, value, onChange, clearColor]);
var renderCustomColorPicker = function renderCustomColorPicker() {
return Object(external_wp_element_["createElement"])(color_picker_ColorPicker, {
onChangeComplete: function onChangeComplete(color) {
return onChange(color.hex);
return Object(external_wp_element_["createElement"])(CircularOptionPicker, {
actions: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !disableCustomColors && Object(external_wp_element_["createElement"])(CircularOptionPicker.DropdownLinkAction, {
renderContent: renderCustomColorPicker,
contentClassName: 'components-color-palette__picker'
'aria-label': Object(external_wp_i18n_["__"])('Custom color picker')
linkText: Object(external_wp_i18n_["__"])('Custom color')
}), !!clearable && Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, {
}, Object(external_wp_i18n_["__"])('Clear')))
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
var close_small = __webpack_require__("bWcr");
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js
function token_input_createSuper(Derived) { var hasNativeReflectConstruct = token_input_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function token_input_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var token_input_TokenInput = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(TokenInput, _Component);
var _super = token_input_createSuper(TokenInput);
Object(classCallCheck["a" /* default */])(this, TokenInput);
_this = _super.apply(this, arguments);
_this.onChange = _this.onChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindInput = _this.bindInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
Object(createClass["a" /* default */])(TokenInput, [{
value: function focus() {
value: function hasFocus() {
return this.input === this.input.ownerDocument.activeElement;
value: function bindInput(ref) {
value: function onChange(event) {
value: event.target.value
value: function render() {
var _this$props = this.props,
value = _this$props.value,
isExpanded = _this$props.isExpanded,
instanceId = _this$props.instanceId,
selectedSuggestionIndex = _this$props.selectedSuggestionIndex,
className = _this$props.className,
props = Object(objectWithoutProperties["a" /* default */])(_this$props, ["value", "isExpanded", "instanceId", "selectedSuggestionIndex", "className"]);
var size = value ? value.length + 1 : 0;
return Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
id: "components-form-token-input-".concat(instanceId),
className: classnames_default()(className, 'components-form-token-field__input'),
"aria-expanded": isExpanded,
"aria-autocomplete": "list",
"aria-owns": isExpanded ? "components-form-token-suggestions-".concat(instanceId) : undefined,
"aria-activedescendant": selectedSuggestionIndex !== -1 ? "components-form-token-suggestions-".concat(instanceId, "-").concat(selectedSuggestionIndex) : undefined,
"aria-describedby": "components-form-token-suggestions-howto-".concat(instanceId)
}(external_wp_element_["Component"]);
/* harmony default export */ var token_input = (token_input_TokenInput);
// EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js
var lib = __webpack_require__("9Do8");
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js
function suggestions_list_createSuper(Derived) { var hasNativeReflectConstruct = suggestions_list_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; }
function suggestions_list_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
var suggestions_list_SuggestionsList = /*#__PURE__*/function (_Component) {
Object(inherits["a" /* default */])(SuggestionsList, _Component);
var _super = suggestions_list_createSuper(SuggestionsList);
function SuggestionsList() {
Object(classCallCheck["a" /* default */])(this, SuggestionsList);
_this = _super.apply(this, arguments);
_this.handleMouseDown = _this.handleMouseDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
_this.bindList = _this.bindList.bind(Object(assertThisInitialized["a" /* default */])(_this));
Object(createClass["a" /* default */])(SuggestionsList, [{
key: "componentDidUpdate",
value: function componentDidUpdate() {
// only have to worry about scrolling selected suggestion into view
if (this.props.selectedIndex > -1 && this.props.scrollIntoView) {
this.scrollingIntoView = true;
lib_default()(this.list.children[this.props.selectedIndex], this.list, {
this.props.setTimeout(function () {
_this2.scrollingIntoView = false;
value: function bindList(ref) {
value: function handleHover(suggestion) {
if (!_this3.scrollingIntoView) {
_this3.props.onHover(suggestion);
value: function handleClick(suggestion) {
_this4.props.onSelect(suggestion);
value: function handleMouseDown(e) {
// By preventing default here, we will not lose focus of <input> when clicking a suggestion
key: "computeSuggestionMatch",
value: function computeSuggestionMatch(suggestion) {
var match = this.props.displayTransform(this.props.match || '').toLocaleLowerCase();
if (match.length === 0) {
suggestion = this.props.displayTransform(suggestion);
var indexOfMatch = suggestion.toLocaleLowerCase().indexOf(match);
suggestionBeforeMatch: suggestion.substring(0, indexOfMatch),
suggestionMatch: suggestion.substring(indexOfMatch, indexOfMatch + match.length),
suggestionAfterMatch: suggestion.substring(indexOfMatch + match.length)
value: function render() {
// We set `tabIndex` here because otherwise Firefox sets focus on this
// div when tabbing off of the input in `TokenField` -- not really sure
// why, since usually a div isn't focusable by default
// TODO does this still apply now that it's a <ul> and not a <div>?
return Object(external_wp_element_["createElement"])("ul", {
className: "components-form-token-field__suggestions-list",
id: "components-form-token-suggestions-".concat(this.props.instanceId),
}, Object(external_lodash_["map"])(this.props.suggestions, function (suggestion, index) {
var match = _this5.computeSuggestionMatch(suggestion);
var classeName = classnames_default()('components-form-token-field__suggestion', {
'is-selected': index === _this5.props.selectedIndex
/* eslint-disable jsx-a11y/click-events-have-key-events */
return Object(external_wp_element_["createElement"])("li", {
id: "components-form-token-suggestions-".concat(_this5.props.instanceId, "-").concat(index),
key: _this5.props.displayTransform(suggestion),
onMouseDown: _this5.handleMouseDown,
onClick: _this5.handleClick(suggestion),
onMouseEnter: _this5.handleHover(suggestion),
"aria-selected": index === _this5.props.selectedIndex
}, match ? Object(external_wp_element_["createElement"])("span", {
"aria-label": _this5.props.displayTransform(suggestion)
}, match.suggestionBeforeMatch, Object(external_wp_element_["createElement"])("strong", {
className: "components-form-token-field__suggestion-match"
}, match.suggestionMatch), match.suggestionAfterMatch) : _this5.props.displayTransform(suggestion));
/* eslint-enable jsx-a11y/click-events-have-key-events */
}(external_wp_element_["Component"]);
suggestions_list_SuggestionsList.defaultProps = {