Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
'components-color-edit__hidden-control': !isShowingControls
[23500] Fix | Delete
}),
[23501] Fix | Delete
icon: library_close["a" /* default */],
[23502] Fix | Delete
label: Object(external_wp_i18n_["__"])('Remove color'),
[23503] Fix | Delete
onClick: onRemove
[23504] Fix | Delete
})), Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[23505] Fix | Delete
className: classnames_default()({
[23506] Fix | Delete
'components-color-edit__hidden-control': !isShowingControls
[23507] Fix | Delete
}),
[23508] Fix | Delete
icon: isShowingAdvancedPanel ? chevron_up["a" /* default */] : chevron_down["a" /* default */],
[23509] Fix | Delete
label: Object(external_wp_i18n_["__"])('Additional color settings'),
[23510] Fix | Delete
onClick: function onClick() {
[23511] Fix | Delete
if (isShowingAdvancedPanel) {
[23512] Fix | Delete
setIsFocused(false);
[23513] Fix | Delete
}
[23514] Fix | Delete
[23515] Fix | Delete
setIsShowingAdvancedPanel(!isShowingAdvancedPanel);
[23516] Fix | Delete
},
[23517] Fix | Delete
"aria-expanded": isShowingAdvancedPanel
[23518] Fix | Delete
})), onCancel && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[23519] Fix | Delete
className: "components-color-edit__cancel-button",
[23520] Fix | Delete
onClick: onCancel
[23521] Fix | Delete
}, Object(external_wp_i18n_["__"])('Cancel')), isShowingAdvancedPanel && Object(external_wp_element_["createElement"])(text_control, {
[23522] Fix | Delete
className: "components-color-edit__slug-input",
[23523] Fix | Delete
onChange: function onChange(newSlug) {
[23524] Fix | Delete
return _onChange({
[23525] Fix | Delete
color: color,
[23526] Fix | Delete
slug: newSlug,
[23527] Fix | Delete
name: name
[23528] Fix | Delete
});
[23529] Fix | Delete
},
[23530] Fix | Delete
label: Object(external_wp_i18n_["__"])('Slug'),
[23531] Fix | Delete
value: slug
[23532] Fix | Delete
}));
[23533] Fix | Delete
}
[23534] Fix | Delete
[23535] Fix | Delete
function ColorInserter(_ref4) {
[23536] Fix | Delete
var onInsert = _ref4.onInsert,
[23537] Fix | Delete
onCancel = _ref4.onCancel;
[23538] Fix | Delete
[23539] Fix | Delete
var _useState9 = Object(external_wp_element_["useState"])({
[23540] Fix | Delete
color: '#fff',
[23541] Fix | Delete
name: '',
[23542] Fix | Delete
slug: ''
[23543] Fix | Delete
}),
[23544] Fix | Delete
_useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2),
[23545] Fix | Delete
color = _useState10[0],
[23546] Fix | Delete
setColor = _useState10[1];
[23547] Fix | Delete
[23548] Fix | Delete
return Object(external_wp_element_["createElement"])(ColorOption, {
[23549] Fix | Delete
color: color.color,
[23550] Fix | Delete
name: color.name,
[23551] Fix | Delete
slug: color.slug,
[23552] Fix | Delete
onChange: setColor,
[23553] Fix | Delete
confirmLabel: Object(external_wp_i18n_["__"])('Save'),
[23554] Fix | Delete
onConfirm: function onConfirm() {
[23555] Fix | Delete
return onInsert(color);
[23556] Fix | Delete
},
[23557] Fix | Delete
isEditingNameOnMount: true,
[23558] Fix | Delete
isEditingColorOnMount: true,
[23559] Fix | Delete
onCancel: onCancel
[23560] Fix | Delete
});
[23561] Fix | Delete
}
[23562] Fix | Delete
[23563] Fix | Delete
function ColorEdit(_ref5) {
[23564] Fix | Delete
var colors = _ref5.colors,
[23565] Fix | Delete
_onChange2 = _ref5.onChange,
[23566] Fix | Delete
emptyUI = _ref5.emptyUI,
[23567] Fix | Delete
immutableColorSlugs = _ref5.immutableColorSlugs,
[23568] Fix | Delete
_ref5$canReset = _ref5.canReset,
[23569] Fix | Delete
canReset = _ref5$canReset === void 0 ? true : _ref5$canReset;
[23570] Fix | Delete
[23571] Fix | Delete
var _useState11 = Object(external_wp_element_["useState"])(false),
[23572] Fix | Delete
_useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2),
[23573] Fix | Delete
isInsertingColor = _useState12[0],
[23574] Fix | Delete
setIsInsertingColor = _useState12[1];
[23575] Fix | Delete
[23576] Fix | Delete
return Object(external_wp_element_["createElement"])(base_control, null, Object(external_wp_element_["createElement"])("fieldset", null, Object(external_wp_element_["createElement"])("div", {
[23577] Fix | Delete
className: "components-color-edit__label-and-insert-container"
[23578] Fix | Delete
}, 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 */], {
[23579] Fix | Delete
onClick: function onClick() {
[23580] Fix | Delete
setIsInsertingColor(true);
[23581] Fix | Delete
},
[23582] Fix | Delete
className: "components-color-edit__insert-button",
[23583] Fix | Delete
icon: plus["a" /* default */]
[23584] Fix | Delete
})), Object(external_wp_element_["createElement"])("div", null, !Object(external_lodash_["isEmpty"])(colors) && colors.map(function (color, index) {
[23585] Fix | Delete
return Object(external_wp_element_["createElement"])(ColorOption, {
[23586] Fix | Delete
key: index,
[23587] Fix | Delete
color: color.color,
[23588] Fix | Delete
name: color.name,
[23589] Fix | Delete
slug: color.slug,
[23590] Fix | Delete
immutableColorSlugs: immutableColorSlugs,
[23591] Fix | Delete
onChange: function onChange(newColor) {
[23592] Fix | Delete
_onChange2(colors.map(function (currentColor, currentIndex) {
[23593] Fix | Delete
if (currentIndex === index) {
[23594] Fix | Delete
return newColor;
[23595] Fix | Delete
}
[23596] Fix | Delete
[23597] Fix | Delete
return currentColor;
[23598] Fix | Delete
}));
[23599] Fix | Delete
},
[23600] Fix | Delete
onRemove: function onRemove() {
[23601] Fix | Delete
_onChange2(colors.filter(function (_currentColor, currentIndex) {
[23602] Fix | Delete
if (currentIndex === index) {
[23603] Fix | Delete
return false;
[23604] Fix | Delete
}
[23605] Fix | Delete
[23606] Fix | Delete
return true;
[23607] Fix | Delete
}));
[23608] Fix | Delete
}
[23609] Fix | Delete
});
[23610] Fix | Delete
}), isInsertingColor && Object(external_wp_element_["createElement"])(ColorInserter, {
[23611] Fix | Delete
onInsert: function onInsert(newColor) {
[23612] Fix | Delete
setIsInsertingColor(false);
[23613] Fix | Delete
[23614] Fix | Delete
_onChange2([].concat(Object(toConsumableArray["a" /* default */])(colors || []), [newColor]));
[23615] Fix | Delete
},
[23616] Fix | Delete
onCancel: function onCancel() {
[23617] Fix | Delete
return setIsInsertingColor(false);
[23618] Fix | Delete
}
[23619] Fix | Delete
}), !isInsertingColor && Object(external_lodash_["isEmpty"])(colors) && emptyUI), !!canReset && Object(external_wp_element_["createElement"])(build_module_button["a" /* default */], {
[23620] Fix | Delete
isSmall: true,
[23621] Fix | Delete
isSecondary: true,
[23622] Fix | Delete
className: "components-color-edit__reset-button",
[23623] Fix | Delete
onClick: function onClick() {
[23624] Fix | Delete
return _onChange2();
[23625] Fix | Delete
}
[23626] Fix | Delete
}, Object(external_wp_i18n_["__"])('Reset'))));
[23627] Fix | Delete
}
[23628] Fix | Delete
[23629] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-indicator/index.js
[23630] Fix | Delete
[23631] Fix | Delete
[23632] Fix | Delete
[23633] Fix | Delete
[23634] Fix | Delete
/**
[23635] Fix | Delete
* External dependencies
[23636] Fix | Delete
*/
[23637] Fix | Delete
[23638] Fix | Delete
[23639] Fix | Delete
var color_indicator_ColorIndicator = function ColorIndicator(_ref) {
[23640] Fix | Delete
var className = _ref.className,
[23641] Fix | Delete
colorValue = _ref.colorValue,
[23642] Fix | Delete
props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "colorValue"]);
[23643] Fix | Delete
[23644] Fix | Delete
return Object(external_wp_element_["createElement"])("span", Object(esm_extends["a" /* default */])({
[23645] Fix | Delete
className: classnames_default()('component-color-indicator', className),
[23646] Fix | Delete
style: {
[23647] Fix | Delete
background: colorValue
[23648] Fix | Delete
}
[23649] Fix | Delete
}, props));
[23650] Fix | Delete
};
[23651] Fix | Delete
[23652] Fix | Delete
/* harmony default export */ var color_indicator = (color_indicator_ColorIndicator);
[23653] Fix | Delete
[23654] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/color-palette/index.js
[23655] Fix | Delete
[23656] Fix | Delete
[23657] Fix | Delete
/**
[23658] Fix | Delete
* External dependencies
[23659] Fix | Delete
*/
[23660] Fix | Delete
[23661] Fix | Delete
[23662] Fix | Delete
/**
[23663] Fix | Delete
* WordPress dependencies
[23664] Fix | Delete
*/
[23665] Fix | Delete
[23666] Fix | Delete
[23667] Fix | Delete
[23668] Fix | Delete
/**
[23669] Fix | Delete
* Internal dependencies
[23670] Fix | Delete
*/
[23671] Fix | Delete
[23672] Fix | Delete
[23673] Fix | Delete
[23674] Fix | Delete
function ColorPalette(_ref) {
[23675] Fix | Delete
var _ref$clearable = _ref.clearable,
[23676] Fix | Delete
clearable = _ref$clearable === void 0 ? true : _ref$clearable,
[23677] Fix | Delete
className = _ref.className,
[23678] Fix | Delete
colors = _ref.colors,
[23679] Fix | Delete
_ref$disableCustomCol = _ref.disableCustomColors,
[23680] Fix | Delete
disableCustomColors = _ref$disableCustomCol === void 0 ? false : _ref$disableCustomCol,
[23681] Fix | Delete
onChange = _ref.onChange,
[23682] Fix | Delete
value = _ref.value;
[23683] Fix | Delete
var clearColor = Object(external_wp_element_["useCallback"])(function () {
[23684] Fix | Delete
return onChange(undefined);
[23685] Fix | Delete
}, [onChange]);
[23686] Fix | Delete
var colorOptions = Object(external_wp_element_["useMemo"])(function () {
[23687] Fix | Delete
return Object(external_lodash_["map"])(colors, function (_ref2) {
[23688] Fix | Delete
var color = _ref2.color,
[23689] Fix | Delete
name = _ref2.name;
[23690] Fix | Delete
return Object(external_wp_element_["createElement"])(CircularOptionPicker.Option, {
[23691] Fix | Delete
key: color,
[23692] Fix | Delete
isSelected: value === color,
[23693] Fix | Delete
selectedIconProps: value === color ? {
[23694] Fix | Delete
fill: tinycolor_default.a.mostReadable(color, ['#000', '#fff']).toHexString()
[23695] Fix | Delete
} : {},
[23696] Fix | Delete
tooltipText: name || // translators: %s: color hex code e.g: "#f00".
[23697] Fix | Delete
Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color),
[23698] Fix | Delete
style: {
[23699] Fix | Delete
backgroundColor: color,
[23700] Fix | Delete
color: color
[23701] Fix | Delete
},
[23702] Fix | Delete
onClick: value === color ? clearColor : function () {
[23703] Fix | Delete
return onChange(color);
[23704] Fix | Delete
},
[23705] Fix | Delete
"aria-label": name ? // translators: %s: The name of the color e.g: "vivid red".
[23706] Fix | Delete
Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color: %s'), name) : // translators: %s: color hex code e.g: "#f00".
[23707] Fix | Delete
Object(external_wp_i18n_["sprintf"])(Object(external_wp_i18n_["__"])('Color code: %s'), color)
[23708] Fix | Delete
});
[23709] Fix | Delete
});
[23710] Fix | Delete
}, [colors, value, onChange, clearColor]);
[23711] Fix | Delete
[23712] Fix | Delete
var renderCustomColorPicker = function renderCustomColorPicker() {
[23713] Fix | Delete
return Object(external_wp_element_["createElement"])(color_picker_ColorPicker, {
[23714] Fix | Delete
color: value,
[23715] Fix | Delete
onChangeComplete: function onChangeComplete(color) {
[23716] Fix | Delete
return onChange(color.hex);
[23717] Fix | Delete
},
[23718] Fix | Delete
disableAlpha: true
[23719] Fix | Delete
});
[23720] Fix | Delete
};
[23721] Fix | Delete
[23722] Fix | Delete
return Object(external_wp_element_["createElement"])(CircularOptionPicker, {
[23723] Fix | Delete
className: className,
[23724] Fix | Delete
options: colorOptions,
[23725] Fix | Delete
actions: Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, !disableCustomColors && Object(external_wp_element_["createElement"])(CircularOptionPicker.DropdownLinkAction, {
[23726] Fix | Delete
dropdownProps: {
[23727] Fix | Delete
renderContent: renderCustomColorPicker,
[23728] Fix | Delete
contentClassName: 'components-color-palette__picker'
[23729] Fix | Delete
},
[23730] Fix | Delete
buttonProps: {
[23731] Fix | Delete
'aria-label': Object(external_wp_i18n_["__"])('Custom color picker')
[23732] Fix | Delete
},
[23733] Fix | Delete
linkText: Object(external_wp_i18n_["__"])('Custom color')
[23734] Fix | Delete
}), !!clearable && Object(external_wp_element_["createElement"])(CircularOptionPicker.ButtonAction, {
[23735] Fix | Delete
onClick: clearColor
[23736] Fix | Delete
}, Object(external_wp_i18n_["__"])('Clear')))
[23737] Fix | Delete
});
[23738] Fix | Delete
}
[23739] Fix | Delete
[23740] Fix | Delete
// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close-small.js
[23741] Fix | Delete
var close_small = __webpack_require__("bWcr");
[23742] Fix | Delete
[23743] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/token-input.js
[23744] Fix | Delete
[23745] Fix | Delete
[23746] Fix | Delete
[23747] Fix | Delete
[23748] Fix | Delete
[23749] Fix | Delete
[23750] Fix | Delete
[23751] Fix | Delete
[23752] Fix | Delete
[23753] Fix | Delete
[23754] Fix | Delete
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); }; }
[23755] Fix | Delete
[23756] Fix | Delete
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; } }
[23757] Fix | Delete
[23758] Fix | Delete
/**
[23759] Fix | Delete
* External dependencies
[23760] Fix | Delete
*/
[23761] Fix | Delete
[23762] Fix | Delete
/**
[23763] Fix | Delete
* WordPress dependencies
[23764] Fix | Delete
*/
[23765] Fix | Delete
[23766] Fix | Delete
[23767] Fix | Delete
[23768] Fix | Delete
var token_input_TokenInput = /*#__PURE__*/function (_Component) {
[23769] Fix | Delete
Object(inherits["a" /* default */])(TokenInput, _Component);
[23770] Fix | Delete
[23771] Fix | Delete
var _super = token_input_createSuper(TokenInput);
[23772] Fix | Delete
[23773] Fix | Delete
function TokenInput() {
[23774] Fix | Delete
var _this;
[23775] Fix | Delete
[23776] Fix | Delete
Object(classCallCheck["a" /* default */])(this, TokenInput);
[23777] Fix | Delete
[23778] Fix | Delete
_this = _super.apply(this, arguments);
[23779] Fix | Delete
_this.onChange = _this.onChange.bind(Object(assertThisInitialized["a" /* default */])(_this));
[23780] Fix | Delete
_this.bindInput = _this.bindInput.bind(Object(assertThisInitialized["a" /* default */])(_this));
[23781] Fix | Delete
return _this;
[23782] Fix | Delete
}
[23783] Fix | Delete
[23784] Fix | Delete
Object(createClass["a" /* default */])(TokenInput, [{
[23785] Fix | Delete
key: "focus",
[23786] Fix | Delete
value: function focus() {
[23787] Fix | Delete
this.input.focus();
[23788] Fix | Delete
}
[23789] Fix | Delete
}, {
[23790] Fix | Delete
key: "hasFocus",
[23791] Fix | Delete
value: function hasFocus() {
[23792] Fix | Delete
return this.input === this.input.ownerDocument.activeElement;
[23793] Fix | Delete
}
[23794] Fix | Delete
}, {
[23795] Fix | Delete
key: "bindInput",
[23796] Fix | Delete
value: function bindInput(ref) {
[23797] Fix | Delete
this.input = ref;
[23798] Fix | Delete
}
[23799] Fix | Delete
}, {
[23800] Fix | Delete
key: "onChange",
[23801] Fix | Delete
value: function onChange(event) {
[23802] Fix | Delete
this.props.onChange({
[23803] Fix | Delete
value: event.target.value
[23804] Fix | Delete
});
[23805] Fix | Delete
}
[23806] Fix | Delete
}, {
[23807] Fix | Delete
key: "render",
[23808] Fix | Delete
value: function render() {
[23809] Fix | Delete
var _this$props = this.props,
[23810] Fix | Delete
value = _this$props.value,
[23811] Fix | Delete
isExpanded = _this$props.isExpanded,
[23812] Fix | Delete
instanceId = _this$props.instanceId,
[23813] Fix | Delete
selectedSuggestionIndex = _this$props.selectedSuggestionIndex,
[23814] Fix | Delete
className = _this$props.className,
[23815] Fix | Delete
props = Object(objectWithoutProperties["a" /* default */])(_this$props, ["value", "isExpanded", "instanceId", "selectedSuggestionIndex", "className"]);
[23816] Fix | Delete
[23817] Fix | Delete
var size = value ? value.length + 1 : 0;
[23818] Fix | Delete
return Object(external_wp_element_["createElement"])("input", Object(esm_extends["a" /* default */])({
[23819] Fix | Delete
ref: this.bindInput,
[23820] Fix | Delete
id: "components-form-token-input-".concat(instanceId),
[23821] Fix | Delete
type: "text"
[23822] Fix | Delete
}, props, {
[23823] Fix | Delete
value: value || '',
[23824] Fix | Delete
onChange: this.onChange,
[23825] Fix | Delete
size: size,
[23826] Fix | Delete
className: classnames_default()(className, 'components-form-token-field__input'),
[23827] Fix | Delete
autoComplete: "off",
[23828] Fix | Delete
role: "combobox",
[23829] Fix | Delete
"aria-expanded": isExpanded,
[23830] Fix | Delete
"aria-autocomplete": "list",
[23831] Fix | Delete
"aria-owns": isExpanded ? "components-form-token-suggestions-".concat(instanceId) : undefined,
[23832] Fix | Delete
"aria-activedescendant": selectedSuggestionIndex !== -1 ? "components-form-token-suggestions-".concat(instanceId, "-").concat(selectedSuggestionIndex) : undefined,
[23833] Fix | Delete
"aria-describedby": "components-form-token-suggestions-howto-".concat(instanceId)
[23834] Fix | Delete
}));
[23835] Fix | Delete
}
[23836] Fix | Delete
}]);
[23837] Fix | Delete
[23838] Fix | Delete
return TokenInput;
[23839] Fix | Delete
}(external_wp_element_["Component"]);
[23840] Fix | Delete
[23841] Fix | Delete
/* harmony default export */ var token_input = (token_input_TokenInput);
[23842] Fix | Delete
[23843] Fix | Delete
// EXTERNAL MODULE: ./node_modules/dom-scroll-into-view/lib/index.js
[23844] Fix | Delete
var lib = __webpack_require__("9Do8");
[23845] Fix | Delete
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
[23846] Fix | Delete
[23847] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/form-token-field/suggestions-list.js
[23848] Fix | Delete
[23849] Fix | Delete
[23850] Fix | Delete
[23851] Fix | Delete
[23852] Fix | Delete
[23853] Fix | Delete
[23854] Fix | Delete
[23855] Fix | Delete
[23856] Fix | Delete
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); }; }
[23857] Fix | Delete
[23858] Fix | Delete
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; } }
[23859] Fix | Delete
[23860] Fix | Delete
/**
[23861] Fix | Delete
* External dependencies
[23862] Fix | Delete
*/
[23863] Fix | Delete
[23864] Fix | Delete
[23865] Fix | Delete
[23866] Fix | Delete
/**
[23867] Fix | Delete
* WordPress dependencies
[23868] Fix | Delete
*/
[23869] Fix | Delete
[23870] Fix | Delete
[23871] Fix | Delete
[23872] Fix | Delete
[23873] Fix | Delete
var suggestions_list_SuggestionsList = /*#__PURE__*/function (_Component) {
[23874] Fix | Delete
Object(inherits["a" /* default */])(SuggestionsList, _Component);
[23875] Fix | Delete
[23876] Fix | Delete
var _super = suggestions_list_createSuper(SuggestionsList);
[23877] Fix | Delete
[23878] Fix | Delete
function SuggestionsList() {
[23879] Fix | Delete
var _this;
[23880] Fix | Delete
[23881] Fix | Delete
Object(classCallCheck["a" /* default */])(this, SuggestionsList);
[23882] Fix | Delete
[23883] Fix | Delete
_this = _super.apply(this, arguments);
[23884] Fix | Delete
_this.handleMouseDown = _this.handleMouseDown.bind(Object(assertThisInitialized["a" /* default */])(_this));
[23885] Fix | Delete
_this.bindList = _this.bindList.bind(Object(assertThisInitialized["a" /* default */])(_this));
[23886] Fix | Delete
return _this;
[23887] Fix | Delete
}
[23888] Fix | Delete
[23889] Fix | Delete
Object(createClass["a" /* default */])(SuggestionsList, [{
[23890] Fix | Delete
key: "componentDidUpdate",
[23891] Fix | Delete
value: function componentDidUpdate() {
[23892] Fix | Delete
var _this2 = this;
[23893] Fix | Delete
[23894] Fix | Delete
// only have to worry about scrolling selected suggestion into view
[23895] Fix | Delete
// when already expanded
[23896] Fix | Delete
if (this.props.selectedIndex > -1 && this.props.scrollIntoView) {
[23897] Fix | Delete
this.scrollingIntoView = true;
[23898] Fix | Delete
lib_default()(this.list.children[this.props.selectedIndex], this.list, {
[23899] Fix | Delete
onlyScrollIfNeeded: true
[23900] Fix | Delete
});
[23901] Fix | Delete
this.props.setTimeout(function () {
[23902] Fix | Delete
_this2.scrollingIntoView = false;
[23903] Fix | Delete
}, 100);
[23904] Fix | Delete
}
[23905] Fix | Delete
}
[23906] Fix | Delete
}, {
[23907] Fix | Delete
key: "bindList",
[23908] Fix | Delete
value: function bindList(ref) {
[23909] Fix | Delete
this.list = ref;
[23910] Fix | Delete
}
[23911] Fix | Delete
}, {
[23912] Fix | Delete
key: "handleHover",
[23913] Fix | Delete
value: function handleHover(suggestion) {
[23914] Fix | Delete
var _this3 = this;
[23915] Fix | Delete
[23916] Fix | Delete
return function () {
[23917] Fix | Delete
if (!_this3.scrollingIntoView) {
[23918] Fix | Delete
_this3.props.onHover(suggestion);
[23919] Fix | Delete
}
[23920] Fix | Delete
};
[23921] Fix | Delete
}
[23922] Fix | Delete
}, {
[23923] Fix | Delete
key: "handleClick",
[23924] Fix | Delete
value: function handleClick(suggestion) {
[23925] Fix | Delete
var _this4 = this;
[23926] Fix | Delete
[23927] Fix | Delete
return function () {
[23928] Fix | Delete
_this4.props.onSelect(suggestion);
[23929] Fix | Delete
};
[23930] Fix | Delete
}
[23931] Fix | Delete
}, {
[23932] Fix | Delete
key: "handleMouseDown",
[23933] Fix | Delete
value: function handleMouseDown(e) {
[23934] Fix | Delete
// By preventing default here, we will not lose focus of <input> when clicking a suggestion
[23935] Fix | Delete
e.preventDefault();
[23936] Fix | Delete
}
[23937] Fix | Delete
}, {
[23938] Fix | Delete
key: "computeSuggestionMatch",
[23939] Fix | Delete
value: function computeSuggestionMatch(suggestion) {
[23940] Fix | Delete
var match = this.props.displayTransform(this.props.match || '').toLocaleLowerCase();
[23941] Fix | Delete
[23942] Fix | Delete
if (match.length === 0) {
[23943] Fix | Delete
return null;
[23944] Fix | Delete
}
[23945] Fix | Delete
[23946] Fix | Delete
suggestion = this.props.displayTransform(suggestion);
[23947] Fix | Delete
var indexOfMatch = suggestion.toLocaleLowerCase().indexOf(match);
[23948] Fix | Delete
return {
[23949] Fix | Delete
suggestionBeforeMatch: suggestion.substring(0, indexOfMatch),
[23950] Fix | Delete
suggestionMatch: suggestion.substring(indexOfMatch, indexOfMatch + match.length),
[23951] Fix | Delete
suggestionAfterMatch: suggestion.substring(indexOfMatch + match.length)
[23952] Fix | Delete
};
[23953] Fix | Delete
}
[23954] Fix | Delete
}, {
[23955] Fix | Delete
key: "render",
[23956] Fix | Delete
value: function render() {
[23957] Fix | Delete
var _this5 = this;
[23958] Fix | Delete
[23959] Fix | Delete
// We set `tabIndex` here because otherwise Firefox sets focus on this
[23960] Fix | Delete
// div when tabbing off of the input in `TokenField` -- not really sure
[23961] Fix | Delete
// why, since usually a div isn't focusable by default
[23962] Fix | Delete
// TODO does this still apply now that it's a <ul> and not a <div>?
[23963] Fix | Delete
return Object(external_wp_element_["createElement"])("ul", {
[23964] Fix | Delete
ref: this.bindList,
[23965] Fix | Delete
className: "components-form-token-field__suggestions-list",
[23966] Fix | Delete
id: "components-form-token-suggestions-".concat(this.props.instanceId),
[23967] Fix | Delete
role: "listbox"
[23968] Fix | Delete
}, Object(external_lodash_["map"])(this.props.suggestions, function (suggestion, index) {
[23969] Fix | Delete
var match = _this5.computeSuggestionMatch(suggestion);
[23970] Fix | Delete
[23971] Fix | Delete
var classeName = classnames_default()('components-form-token-field__suggestion', {
[23972] Fix | Delete
'is-selected': index === _this5.props.selectedIndex
[23973] Fix | Delete
});
[23974] Fix | Delete
/* eslint-disable jsx-a11y/click-events-have-key-events */
[23975] Fix | Delete
[23976] Fix | Delete
return Object(external_wp_element_["createElement"])("li", {
[23977] Fix | Delete
id: "components-form-token-suggestions-".concat(_this5.props.instanceId, "-").concat(index),
[23978] Fix | Delete
role: "option",
[23979] Fix | Delete
className: classeName,
[23980] Fix | Delete
key: _this5.props.displayTransform(suggestion),
[23981] Fix | Delete
onMouseDown: _this5.handleMouseDown,
[23982] Fix | Delete
onClick: _this5.handleClick(suggestion),
[23983] Fix | Delete
onMouseEnter: _this5.handleHover(suggestion),
[23984] Fix | Delete
"aria-selected": index === _this5.props.selectedIndex
[23985] Fix | Delete
}, match ? Object(external_wp_element_["createElement"])("span", {
[23986] Fix | Delete
"aria-label": _this5.props.displayTransform(suggestion)
[23987] Fix | Delete
}, match.suggestionBeforeMatch, Object(external_wp_element_["createElement"])("strong", {
[23988] Fix | Delete
className: "components-form-token-field__suggestion-match"
[23989] Fix | Delete
}, match.suggestionMatch), match.suggestionAfterMatch) : _this5.props.displayTransform(suggestion));
[23990] Fix | Delete
/* eslint-enable jsx-a11y/click-events-have-key-events */
[23991] Fix | Delete
}));
[23992] Fix | Delete
}
[23993] Fix | Delete
}]);
[23994] Fix | Delete
[23995] Fix | Delete
return SuggestionsList;
[23996] Fix | Delete
}(external_wp_element_["Component"]);
[23997] Fix | Delete
[23998] Fix | Delete
suggestions_list_SuggestionsList.defaultProps = {
[23999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function