Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
key: "onSuggestionSelected",
[33500] Fix | Delete
value: function onSuggestionSelected(suggestion) {
[33501] Fix | Delete
this.addNewToken(suggestion);
[33502] Fix | Delete
}
[33503] Fix | Delete
}, {
[33504] Fix | Delete
key: "onInputChange",
[33505] Fix | Delete
value: function onInputChange(event) {
[33506] Fix | Delete
var text = event.value;
[33507] Fix | Delete
var separator = this.props.tokenizeOnSpace ? /[ ,\t]+/ : /[,\t]+/;
[33508] Fix | Delete
var items = text.split(separator);
[33509] Fix | Delete
var tokenValue = Object(external_lodash_["last"])(items) || '';
[33510] Fix | Delete
[33511] Fix | Delete
if (items.length > 1) {
[33512] Fix | Delete
this.addNewTokens(items.slice(0, -1));
[33513] Fix | Delete
}
[33514] Fix | Delete
[33515] Fix | Delete
this.setState({
[33516] Fix | Delete
incompleteTokenValue: tokenValue
[33517] Fix | Delete
}, this.updateSuggestions);
[33518] Fix | Delete
this.props.onInputChange(tokenValue);
[33519] Fix | Delete
}
[33520] Fix | Delete
}, {
[33521] Fix | Delete
key: "handleDeleteKey",
[33522] Fix | Delete
value: function handleDeleteKey(deleteToken) {
[33523] Fix | Delete
var preventDefault = false;
[33524] Fix | Delete
[33525] Fix | Delete
if (this.input.hasFocus() && this.isInputEmpty()) {
[33526] Fix | Delete
deleteToken();
[33527] Fix | Delete
preventDefault = true;
[33528] Fix | Delete
}
[33529] Fix | Delete
[33530] Fix | Delete
return preventDefault;
[33531] Fix | Delete
}
[33532] Fix | Delete
}, {
[33533] Fix | Delete
key: "handleLeftArrowKey",
[33534] Fix | Delete
value: function handleLeftArrowKey() {
[33535] Fix | Delete
var preventDefault = false;
[33536] Fix | Delete
[33537] Fix | Delete
if (this.isInputEmpty()) {
[33538] Fix | Delete
this.moveInputBeforePreviousToken();
[33539] Fix | Delete
preventDefault = true;
[33540] Fix | Delete
}
[33541] Fix | Delete
[33542] Fix | Delete
return preventDefault;
[33543] Fix | Delete
}
[33544] Fix | Delete
}, {
[33545] Fix | Delete
key: "handleRightArrowKey",
[33546] Fix | Delete
value: function handleRightArrowKey() {
[33547] Fix | Delete
var preventDefault = false;
[33548] Fix | Delete
[33549] Fix | Delete
if (this.isInputEmpty()) {
[33550] Fix | Delete
this.moveInputAfterNextToken();
[33551] Fix | Delete
preventDefault = true;
[33552] Fix | Delete
}
[33553] Fix | Delete
[33554] Fix | Delete
return preventDefault;
[33555] Fix | Delete
}
[33556] Fix | Delete
}, {
[33557] Fix | Delete
key: "handleUpArrowKey",
[33558] Fix | Delete
value: function handleUpArrowKey() {
[33559] Fix | Delete
var _this2 = this;
[33560] Fix | Delete
[33561] Fix | Delete
this.setState(function (state, props) {
[33562] Fix | Delete
return {
[33563] Fix | Delete
selectedSuggestionIndex: (state.selectedSuggestionIndex === 0 ? _this2.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length : state.selectedSuggestionIndex) - 1,
[33564] Fix | Delete
selectedSuggestionScroll: true
[33565] Fix | Delete
};
[33566] Fix | Delete
});
[33567] Fix | Delete
return true; // preventDefault
[33568] Fix | Delete
}
[33569] Fix | Delete
}, {
[33570] Fix | Delete
key: "handleDownArrowKey",
[33571] Fix | Delete
value: function handleDownArrowKey() {
[33572] Fix | Delete
var _this3 = this;
[33573] Fix | Delete
[33574] Fix | Delete
this.setState(function (state, props) {
[33575] Fix | Delete
return {
[33576] Fix | Delete
selectedSuggestionIndex: (state.selectedSuggestionIndex + 1) % _this3.getMatchingSuggestions(state.incompleteTokenValue, props.suggestions, props.value, props.maxSuggestions, props.saveTransform).length,
[33577] Fix | Delete
selectedSuggestionScroll: true
[33578] Fix | Delete
};
[33579] Fix | Delete
});
[33580] Fix | Delete
return true; // preventDefault
[33581] Fix | Delete
}
[33582] Fix | Delete
}, {
[33583] Fix | Delete
key: "handleEscapeKey",
[33584] Fix | Delete
value: function handleEscapeKey(event) {
[33585] Fix | Delete
this.setState({
[33586] Fix | Delete
incompleteTokenValue: event.target.value,
[33587] Fix | Delete
isExpanded: false,
[33588] Fix | Delete
selectedSuggestionIndex: -1,
[33589] Fix | Delete
selectedSuggestionScroll: false
[33590] Fix | Delete
});
[33591] Fix | Delete
return true; // preventDefault
[33592] Fix | Delete
}
[33593] Fix | Delete
}, {
[33594] Fix | Delete
key: "handleCommaKey",
[33595] Fix | Delete
value: function handleCommaKey() {
[33596] Fix | Delete
if (this.inputHasValidValue()) {
[33597] Fix | Delete
this.addNewToken(this.state.incompleteTokenValue);
[33598] Fix | Delete
}
[33599] Fix | Delete
[33600] Fix | Delete
return true; // preventDefault
[33601] Fix | Delete
}
[33602] Fix | Delete
}, {
[33603] Fix | Delete
key: "moveInputToIndex",
[33604] Fix | Delete
value: function moveInputToIndex(index) {
[33605] Fix | Delete
this.setState(function (state, props) {
[33606] Fix | Delete
return {
[33607] Fix | Delete
inputOffsetFromEnd: props.value.length - Math.max(index, -1) - 1
[33608] Fix | Delete
};
[33609] Fix | Delete
});
[33610] Fix | Delete
}
[33611] Fix | Delete
}, {
[33612] Fix | Delete
key: "moveInputBeforePreviousToken",
[33613] Fix | Delete
value: function moveInputBeforePreviousToken() {
[33614] Fix | Delete
this.setState(function (state, props) {
[33615] Fix | Delete
return {
[33616] Fix | Delete
inputOffsetFromEnd: Math.min(state.inputOffsetFromEnd + 1, props.value.length)
[33617] Fix | Delete
};
[33618] Fix | Delete
});
[33619] Fix | Delete
}
[33620] Fix | Delete
}, {
[33621] Fix | Delete
key: "moveInputAfterNextToken",
[33622] Fix | Delete
value: function moveInputAfterNextToken() {
[33623] Fix | Delete
this.setState(function (state) {
[33624] Fix | Delete
return {
[33625] Fix | Delete
inputOffsetFromEnd: Math.max(state.inputOffsetFromEnd - 1, 0)
[33626] Fix | Delete
};
[33627] Fix | Delete
});
[33628] Fix | Delete
}
[33629] Fix | Delete
}, {
[33630] Fix | Delete
key: "deleteTokenBeforeInput",
[33631] Fix | Delete
value: function deleteTokenBeforeInput() {
[33632] Fix | Delete
var index = this.getIndexOfInput() - 1;
[33633] Fix | Delete
[33634] Fix | Delete
if (index > -1) {
[33635] Fix | Delete
this.deleteToken(this.props.value[index]);
[33636] Fix | Delete
}
[33637] Fix | Delete
}
[33638] Fix | Delete
}, {
[33639] Fix | Delete
key: "deleteTokenAfterInput",
[33640] Fix | Delete
value: function deleteTokenAfterInput() {
[33641] Fix | Delete
var index = this.getIndexOfInput();
[33642] Fix | Delete
[33643] Fix | Delete
if (index < this.props.value.length) {
[33644] Fix | Delete
this.deleteToken(this.props.value[index]); // update input offset since it's the offset from the last token
[33645] Fix | Delete
[33646] Fix | Delete
this.moveInputToIndex(index);
[33647] Fix | Delete
}
[33648] Fix | Delete
}
[33649] Fix | Delete
}, {
[33650] Fix | Delete
key: "addCurrentToken",
[33651] Fix | Delete
value: function addCurrentToken() {
[33652] Fix | Delete
var preventDefault = false;
[33653] Fix | Delete
var selectedSuggestion = this.getSelectedSuggestion();
[33654] Fix | Delete
[33655] Fix | Delete
if (selectedSuggestion) {
[33656] Fix | Delete
this.addNewToken(selectedSuggestion);
[33657] Fix | Delete
preventDefault = true;
[33658] Fix | Delete
} else if (this.inputHasValidValue()) {
[33659] Fix | Delete
this.addNewToken(this.state.incompleteTokenValue);
[33660] Fix | Delete
preventDefault = true;
[33661] Fix | Delete
}
[33662] Fix | Delete
[33663] Fix | Delete
return preventDefault;
[33664] Fix | Delete
}
[33665] Fix | Delete
}, {
[33666] Fix | Delete
key: "addNewTokens",
[33667] Fix | Delete
value: function addNewTokens(tokens) {
[33668] Fix | Delete
var _this4 = this;
[33669] Fix | Delete
[33670] Fix | Delete
var tokensToAdd = Object(external_lodash_["uniq"])(tokens.map(this.props.saveTransform).filter(Boolean).filter(function (token) {
[33671] Fix | Delete
return !_this4.valueContainsToken(token);
[33672] Fix | Delete
}));
[33673] Fix | Delete
[33674] Fix | Delete
if (tokensToAdd.length > 0) {
[33675] Fix | Delete
var newValue = Object(external_lodash_["clone"])(this.props.value);
[33676] Fix | Delete
newValue.splice.apply(newValue, [this.getIndexOfInput(), 0].concat(tokensToAdd));
[33677] Fix | Delete
this.props.onChange(newValue);
[33678] Fix | Delete
}
[33679] Fix | Delete
}
[33680] Fix | Delete
}, {
[33681] Fix | Delete
key: "addNewToken",
[33682] Fix | Delete
value: function addNewToken(token) {
[33683] Fix | Delete
this.addNewTokens([token]);
[33684] Fix | Delete
this.props.speak(this.props.messages.added, 'assertive');
[33685] Fix | Delete
this.setState({
[33686] Fix | Delete
incompleteTokenValue: '',
[33687] Fix | Delete
selectedSuggestionIndex: -1,
[33688] Fix | Delete
selectedSuggestionScroll: false,
[33689] Fix | Delete
isExpanded: false
[33690] Fix | Delete
});
[33691] Fix | Delete
[33692] Fix | Delete
if (this.state.isActive) {
[33693] Fix | Delete
this.input.focus();
[33694] Fix | Delete
}
[33695] Fix | Delete
}
[33696] Fix | Delete
}, {
[33697] Fix | Delete
key: "deleteToken",
[33698] Fix | Delete
value: function deleteToken(token) {
[33699] Fix | Delete
var _this5 = this;
[33700] Fix | Delete
[33701] Fix | Delete
var newTokens = this.props.value.filter(function (item) {
[33702] Fix | Delete
return _this5.getTokenValue(item) !== _this5.getTokenValue(token);
[33703] Fix | Delete
});
[33704] Fix | Delete
this.props.onChange(newTokens);
[33705] Fix | Delete
this.props.speak(this.props.messages.removed, 'assertive');
[33706] Fix | Delete
}
[33707] Fix | Delete
}, {
[33708] Fix | Delete
key: "getTokenValue",
[33709] Fix | Delete
value: function getTokenValue(token) {
[33710] Fix | Delete
if ('object' === Object(esm_typeof["a" /* default */])(token)) {
[33711] Fix | Delete
return token.value;
[33712] Fix | Delete
}
[33713] Fix | Delete
[33714] Fix | Delete
return token;
[33715] Fix | Delete
}
[33716] Fix | Delete
}, {
[33717] Fix | Delete
key: "getMatchingSuggestions",
[33718] Fix | Delete
value: function getMatchingSuggestions() {
[33719] Fix | Delete
var searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.incompleteTokenValue;
[33720] Fix | Delete
var suggestions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.props.suggestions;
[33721] Fix | Delete
var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.props.value;
[33722] Fix | Delete
var maxSuggestions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.props.maxSuggestions;
[33723] Fix | Delete
var saveTransform = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.props.saveTransform;
[33724] Fix | Delete
var match = saveTransform(searchValue);
[33725] Fix | Delete
var startsWithMatch = [];
[33726] Fix | Delete
var containsMatch = [];
[33727] Fix | Delete
[33728] Fix | Delete
if (match.length === 0) {
[33729] Fix | Delete
suggestions = Object(external_lodash_["difference"])(suggestions, value);
[33730] Fix | Delete
} else {
[33731] Fix | Delete
match = match.toLocaleLowerCase();
[33732] Fix | Delete
Object(external_lodash_["each"])(suggestions, function (suggestion) {
[33733] Fix | Delete
var index = suggestion.toLocaleLowerCase().indexOf(match);
[33734] Fix | Delete
[33735] Fix | Delete
if (value.indexOf(suggestion) === -1) {
[33736] Fix | Delete
if (index === 0) {
[33737] Fix | Delete
startsWithMatch.push(suggestion);
[33738] Fix | Delete
} else if (index > 0) {
[33739] Fix | Delete
containsMatch.push(suggestion);
[33740] Fix | Delete
}
[33741] Fix | Delete
}
[33742] Fix | Delete
});
[33743] Fix | Delete
suggestions = startsWithMatch.concat(containsMatch);
[33744] Fix | Delete
}
[33745] Fix | Delete
[33746] Fix | Delete
return Object(external_lodash_["take"])(suggestions, maxSuggestions);
[33747] Fix | Delete
}
[33748] Fix | Delete
}, {
[33749] Fix | Delete
key: "getSelectedSuggestion",
[33750] Fix | Delete
value: function getSelectedSuggestion() {
[33751] Fix | Delete
if (this.state.selectedSuggestionIndex !== -1) {
[33752] Fix | Delete
return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex];
[33753] Fix | Delete
}
[33754] Fix | Delete
}
[33755] Fix | Delete
}, {
[33756] Fix | Delete
key: "valueContainsToken",
[33757] Fix | Delete
value: function valueContainsToken(token) {
[33758] Fix | Delete
var _this6 = this;
[33759] Fix | Delete
[33760] Fix | Delete
return Object(external_lodash_["some"])(this.props.value, function (item) {
[33761] Fix | Delete
return _this6.getTokenValue(token) === _this6.getTokenValue(item);
[33762] Fix | Delete
});
[33763] Fix | Delete
}
[33764] Fix | Delete
}, {
[33765] Fix | Delete
key: "getIndexOfInput",
[33766] Fix | Delete
value: function getIndexOfInput() {
[33767] Fix | Delete
return this.props.value.length - this.state.inputOffsetFromEnd;
[33768] Fix | Delete
}
[33769] Fix | Delete
}, {
[33770] Fix | Delete
key: "isInputEmpty",
[33771] Fix | Delete
value: function isInputEmpty() {
[33772] Fix | Delete
return this.state.incompleteTokenValue.length === 0;
[33773] Fix | Delete
}
[33774] Fix | Delete
}, {
[33775] Fix | Delete
key: "inputHasValidValue",
[33776] Fix | Delete
value: function inputHasValidValue() {
[33777] Fix | Delete
return this.props.saveTransform(this.state.incompleteTokenValue).length > 0;
[33778] Fix | Delete
}
[33779] Fix | Delete
}, {
[33780] Fix | Delete
key: "updateSuggestions",
[33781] Fix | Delete
value: function updateSuggestions() {
[33782] Fix | Delete
var resetSelectedSuggestion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
[33783] Fix | Delete
var incompleteTokenValue = this.state.incompleteTokenValue;
[33784] Fix | Delete
var inputHasMinimumChars = incompleteTokenValue.trim().length > 1;
[33785] Fix | Delete
var matchingSuggestions = this.getMatchingSuggestions(incompleteTokenValue);
[33786] Fix | Delete
var hasMatchingSuggestions = matchingSuggestions.length > 0;
[33787] Fix | Delete
var newState = {
[33788] Fix | Delete
isExpanded: inputHasMinimumChars && hasMatchingSuggestions
[33789] Fix | Delete
};
[33790] Fix | Delete
[33791] Fix | Delete
if (resetSelectedSuggestion) {
[33792] Fix | Delete
newState.selectedSuggestionIndex = -1;
[33793] Fix | Delete
newState.selectedSuggestionScroll = false;
[33794] Fix | Delete
}
[33795] Fix | Delete
[33796] Fix | Delete
this.setState(newState);
[33797] Fix | Delete
[33798] Fix | Delete
if (inputHasMinimumChars) {
[33799] Fix | Delete
var debouncedSpeak = this.props.debouncedSpeak;
[33800] Fix | Delete
var message = hasMatchingSuggestions ? Object(external_wp_i18n_["sprintf"])(
[33801] Fix | Delete
/* translators: %d: number of results. */
[33802] Fix | Delete
Object(external_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', matchingSuggestions.length), matchingSuggestions.length) : Object(external_wp_i18n_["__"])('No results.');
[33803] Fix | Delete
debouncedSpeak(message, 'assertive');
[33804] Fix | Delete
}
[33805] Fix | Delete
}
[33806] Fix | Delete
}, {
[33807] Fix | Delete
key: "renderTokensAndInput",
[33808] Fix | Delete
value: function renderTokensAndInput() {
[33809] Fix | Delete
var components = Object(external_lodash_["map"])(this.props.value, this.renderToken);
[33810] Fix | Delete
components.splice(this.getIndexOfInput(), 0, this.renderInput());
[33811] Fix | Delete
return components;
[33812] Fix | Delete
}
[33813] Fix | Delete
}, {
[33814] Fix | Delete
key: "renderToken",
[33815] Fix | Delete
value: function renderToken(token, index, tokens) {
[33816] Fix | Delete
var value = this.getTokenValue(token);
[33817] Fix | Delete
var status = token.status ? token.status : undefined;
[33818] Fix | Delete
var termPosition = index + 1;
[33819] Fix | Delete
var termsCount = tokens.length;
[33820] Fix | Delete
return Object(external_wp_element_["createElement"])(Token, {
[33821] Fix | Delete
key: 'token-' + value,
[33822] Fix | Delete
value: value,
[33823] Fix | Delete
status: status,
[33824] Fix | Delete
title: token.title,
[33825] Fix | Delete
displayTransform: this.props.displayTransform,
[33826] Fix | Delete
onClickRemove: this.onTokenClickRemove,
[33827] Fix | Delete
isBorderless: token.isBorderless || this.props.isBorderless,
[33828] Fix | Delete
onMouseEnter: token.onMouseEnter,
[33829] Fix | Delete
onMouseLeave: token.onMouseLeave,
[33830] Fix | Delete
disabled: 'error' !== status && this.props.disabled,
[33831] Fix | Delete
messages: this.props.messages,
[33832] Fix | Delete
termsCount: termsCount,
[33833] Fix | Delete
termPosition: termPosition
[33834] Fix | Delete
});
[33835] Fix | Delete
}
[33836] Fix | Delete
}, {
[33837] Fix | Delete
key: "renderInput",
[33838] Fix | Delete
value: function renderInput() {
[33839] Fix | Delete
var _this$props2 = this.props,
[33840] Fix | Delete
autoCapitalize = _this$props2.autoCapitalize,
[33841] Fix | Delete
autoComplete = _this$props2.autoComplete,
[33842] Fix | Delete
maxLength = _this$props2.maxLength,
[33843] Fix | Delete
value = _this$props2.value,
[33844] Fix | Delete
instanceId = _this$props2.instanceId;
[33845] Fix | Delete
var props = {
[33846] Fix | Delete
instanceId: instanceId,
[33847] Fix | Delete
autoCapitalize: autoCapitalize,
[33848] Fix | Delete
autoComplete: autoComplete,
[33849] Fix | Delete
ref: this.bindInput,
[33850] Fix | Delete
key: 'input',
[33851] Fix | Delete
disabled: this.props.disabled,
[33852] Fix | Delete
value: this.state.incompleteTokenValue,
[33853] Fix | Delete
onBlur: this.onBlur,
[33854] Fix | Delete
isExpanded: this.state.isExpanded,
[33855] Fix | Delete
selectedSuggestionIndex: this.state.selectedSuggestionIndex
[33856] Fix | Delete
};
[33857] Fix | Delete
[33858] Fix | Delete
if (!(maxLength && value.length >= maxLength)) {
[33859] Fix | Delete
props = form_token_field_objectSpread(form_token_field_objectSpread({}, props), {}, {
[33860] Fix | Delete
onChange: this.onInputChange
[33861] Fix | Delete
});
[33862] Fix | Delete
}
[33863] Fix | Delete
[33864] Fix | Delete
return Object(external_wp_element_["createElement"])(token_input, props);
[33865] Fix | Delete
}
[33866] Fix | Delete
}, {
[33867] Fix | Delete
key: "render",
[33868] Fix | Delete
value: function render() {
[33869] Fix | Delete
var _this$props3 = this.props,
[33870] Fix | Delete
disabled = _this$props3.disabled,
[33871] Fix | Delete
_this$props3$label = _this$props3.label,
[33872] Fix | Delete
label = _this$props3$label === void 0 ? Object(external_wp_i18n_["__"])('Add item') : _this$props3$label,
[33873] Fix | Delete
instanceId = _this$props3.instanceId,
[33874] Fix | Delete
className = _this$props3.className;
[33875] Fix | Delete
var isExpanded = this.state.isExpanded;
[33876] Fix | Delete
var classes = classnames_default()(className, 'components-form-token-field__input-container', {
[33877] Fix | Delete
'is-active': this.state.isActive,
[33878] Fix | Delete
'is-disabled': disabled
[33879] Fix | Delete
});
[33880] Fix | Delete
var tokenFieldProps = {
[33881] Fix | Delete
className: 'components-form-token-field',
[33882] Fix | Delete
tabIndex: '-1'
[33883] Fix | Delete
};
[33884] Fix | Delete
var matchingSuggestions = this.getMatchingSuggestions();
[33885] Fix | Delete
[33886] Fix | Delete
if (!disabled) {
[33887] Fix | Delete
tokenFieldProps = Object.assign({}, tokenFieldProps, {
[33888] Fix | Delete
onKeyDown: this.onKeyDown,
[33889] Fix | Delete
onKeyPress: this.onKeyPress,
[33890] Fix | Delete
onFocus: this.onFocus
[33891] Fix | Delete
});
[33892] Fix | Delete
} // Disable reason: There is no appropriate role which describes the
[33893] Fix | Delete
// input container intended accessible usability.
[33894] Fix | Delete
// TODO: Refactor click detection to use blur to stop propagation.
[33895] Fix | Delete
[33896] Fix | Delete
/* eslint-disable jsx-a11y/no-static-element-interactions */
[33897] Fix | Delete
[33898] Fix | Delete
[33899] Fix | Delete
return Object(external_wp_element_["createElement"])("div", tokenFieldProps, Object(external_wp_element_["createElement"])("label", {
[33900] Fix | Delete
htmlFor: "components-form-token-input-".concat(instanceId),
[33901] Fix | Delete
className: "components-form-token-field__label"
[33902] Fix | Delete
}, label), Object(external_wp_element_["createElement"])("div", {
[33903] Fix | Delete
ref: this.bindTokensAndInput,
[33904] Fix | Delete
className: classes,
[33905] Fix | Delete
tabIndex: "-1",
[33906] Fix | Delete
onMouseDown: this.onContainerTouched,
[33907] Fix | Delete
onTouchStart: this.onContainerTouched
[33908] Fix | Delete
}, this.renderTokensAndInput(), isExpanded && Object(external_wp_element_["createElement"])(suggestions_list, {
[33909] Fix | Delete
instanceId: instanceId,
[33910] Fix | Delete
match: this.props.saveTransform(this.state.incompleteTokenValue),
[33911] Fix | Delete
displayTransform: this.props.displayTransform,
[33912] Fix | Delete
suggestions: matchingSuggestions,
[33913] Fix | Delete
selectedIndex: this.state.selectedSuggestionIndex,
[33914] Fix | Delete
scrollIntoView: this.state.selectedSuggestionScroll,
[33915] Fix | Delete
onHover: this.onSuggestionHovered,
[33916] Fix | Delete
onSelect: this.onSuggestionSelected
[33917] Fix | Delete
})), Object(external_wp_element_["createElement"])("p", {
[33918] Fix | Delete
id: "components-form-token-suggestions-howto-".concat(instanceId),
[33919] Fix | Delete
className: "components-form-token-field__help"
[33920] Fix | Delete
}, this.props.tokenizeOnSpace ? Object(external_wp_i18n_["__"])('Separate with commas, spaces, or the Enter key.') : Object(external_wp_i18n_["__"])('Separate with commas or the Enter key.')));
[33921] Fix | Delete
/* eslint-enable jsx-a11y/no-static-element-interactions */
[33922] Fix | Delete
}
[33923] Fix | Delete
}], [{
[33924] Fix | Delete
key: "getDerivedStateFromProps",
[33925] Fix | Delete
value: function getDerivedStateFromProps(props, state) {
[33926] Fix | Delete
if (!props.disabled || !state.isActive) {
[33927] Fix | Delete
return null;
[33928] Fix | Delete
}
[33929] Fix | Delete
[33930] Fix | Delete
return {
[33931] Fix | Delete
isActive: false,
[33932] Fix | Delete
incompleteTokenValue: ''
[33933] Fix | Delete
};
[33934] Fix | Delete
}
[33935] Fix | Delete
}]);
[33936] Fix | Delete
[33937] Fix | Delete
return FormTokenField;
[33938] Fix | Delete
}(external_wp_element_["Component"]);
[33939] Fix | Delete
[33940] Fix | Delete
form_token_field_FormTokenField.defaultProps = {
[33941] Fix | Delete
suggestions: Object.freeze([]),
[33942] Fix | Delete
maxSuggestions: 100,
[33943] Fix | Delete
value: Object.freeze([]),
[33944] Fix | Delete
displayTransform: external_lodash_["identity"],
[33945] Fix | Delete
saveTransform: function saveTransform(token) {
[33946] Fix | Delete
return token.trim();
[33947] Fix | Delete
},
[33948] Fix | Delete
onChange: function onChange() {},
[33949] Fix | Delete
onInputChange: function onInputChange() {},
[33950] Fix | Delete
isBorderless: false,
[33951] Fix | Delete
disabled: false,
[33952] Fix | Delete
tokenizeOnSpace: false,
[33953] Fix | Delete
messages: {
[33954] Fix | Delete
added: Object(external_wp_i18n_["__"])('Item added.'),
[33955] Fix | Delete
removed: Object(external_wp_i18n_["__"])('Item removed.'),
[33956] Fix | Delete
remove: Object(external_wp_i18n_["__"])('Remove item')
[33957] Fix | Delete
}
[33958] Fix | Delete
};
[33959] Fix | Delete
/* harmony default export */ var form_token_field = (with_spoken_messages(Object(external_wp_compose_["withInstanceId"])(form_token_field_FormTokenField)));
[33960] Fix | Delete
[33961] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/constants.js
[33962] Fix | Delete
var COLOR_POPOVER_PROPS = {
[33963] Fix | Delete
className: 'components-custom-gradient-picker__color-picker-popover',
[33964] Fix | Delete
position: 'top'
[33965] Fix | Delete
};
[33966] Fix | Delete
var GRADIENT_MARKERS_WIDTH = 18;
[33967] Fix | Delete
var INSERT_POINT_WIDTH = 23;
[33968] Fix | Delete
var MINIMUM_ABSOLUTE_LEFT_POSITION = 5;
[33969] Fix | Delete
var MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT = 10;
[33970] Fix | Delete
var MINIMUM_DISTANCE_BETWEEN_POINTS = 0;
[33971] Fix | Delete
var MINIMUM_SIGNIFICANT_MOVE = 5;
[33972] Fix | Delete
var KEYBOARD_CONTROL_POINT_VARIATION = MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_POINT;
[33973] Fix | Delete
var MINIMUM_DISTANCE_BETWEEN_INSERTER_AND_MARKER = (INSERT_POINT_WIDTH + GRADIENT_MARKERS_WIDTH) / 2;
[33974] Fix | Delete
[33975] Fix | Delete
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/custom-gradient-bar/utils.js
[33976] Fix | Delete
[33977] Fix | Delete
[33978] Fix | Delete
function utils_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
[33979] Fix | Delete
[33980] Fix | Delete
function utils_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { utils_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { utils_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
[33981] Fix | Delete
[33982] Fix | Delete
/**
[33983] Fix | Delete
* Internal dependencies
[33984] Fix | Delete
*/
[33985] Fix | Delete
[33986] Fix | Delete
/**
[33987] Fix | Delete
* Control point for the gradient bar.
[33988] Fix | Delete
*
[33989] Fix | Delete
* @typedef {Object} ControlPoint
[33990] Fix | Delete
* @property {string} color Color of the control point.
[33991] Fix | Delete
* @property {number} position Integer position of the control point as a percentage.
[33992] Fix | Delete
*/
[33993] Fix | Delete
[33994] Fix | Delete
/**
[33995] Fix | Delete
* Color as parsed from the gradient by gradient-parser.
[33996] Fix | Delete
*
[33997] Fix | Delete
* @typedef {Object} Color
[33998] Fix | Delete
* @property {string} r Red component.
[33999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function