Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-inclu.../js/dist
File: annotations.js
/******/ (() => { // webpackBootstrap
[0] Fix | Delete
/******/ "use strict";
[1] Fix | Delete
/******/ // The require scope
[2] Fix | Delete
/******/ var __webpack_require__ = {};
[3] Fix | Delete
/******/
[4] Fix | Delete
/************************************************************************/
[5] Fix | Delete
/******/ /* webpack/runtime/define property getters */
[6] Fix | Delete
/******/ (() => {
[7] Fix | Delete
/******/ // define getter functions for harmony exports
[8] Fix | Delete
/******/ __webpack_require__.d = (exports, definition) => {
[9] Fix | Delete
/******/ for(var key in definition) {
[10] Fix | Delete
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
[11] Fix | Delete
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
[12] Fix | Delete
/******/ }
[13] Fix | Delete
/******/ }
[14] Fix | Delete
/******/ };
[15] Fix | Delete
/******/ })();
[16] Fix | Delete
/******/
[17] Fix | Delete
/******/ /* webpack/runtime/hasOwnProperty shorthand */
[18] Fix | Delete
/******/ (() => {
[19] Fix | Delete
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
[20] Fix | Delete
/******/ })();
[21] Fix | Delete
/******/
[22] Fix | Delete
/******/ /* webpack/runtime/make namespace object */
[23] Fix | Delete
/******/ (() => {
[24] Fix | Delete
/******/ // define __esModule on exports
[25] Fix | Delete
/******/ __webpack_require__.r = (exports) => {
[26] Fix | Delete
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
[27] Fix | Delete
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
[28] Fix | Delete
/******/ }
[29] Fix | Delete
/******/ Object.defineProperty(exports, '__esModule', { value: true });
[30] Fix | Delete
/******/ };
[31] Fix | Delete
/******/ })();
[32] Fix | Delete
/******/
[33] Fix | Delete
/************************************************************************/
[34] Fix | Delete
var __webpack_exports__ = {};
[35] Fix | Delete
// ESM COMPAT FLAG
[36] Fix | Delete
__webpack_require__.r(__webpack_exports__);
[37] Fix | Delete
[38] Fix | Delete
// EXPORTS
[39] Fix | Delete
__webpack_require__.d(__webpack_exports__, {
[40] Fix | Delete
store: () => (/* reexport */ store)
[41] Fix | Delete
});
[42] Fix | Delete
[43] Fix | Delete
// NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
[44] Fix | Delete
var selectors_namespaceObject = {};
[45] Fix | Delete
__webpack_require__.r(selectors_namespaceObject);
[46] Fix | Delete
__webpack_require__.d(selectors_namespaceObject, {
[47] Fix | Delete
__experimentalGetAllAnnotationsForBlock: () => (__experimentalGetAllAnnotationsForBlock),
[48] Fix | Delete
__experimentalGetAnnotations: () => (__experimentalGetAnnotations),
[49] Fix | Delete
__experimentalGetAnnotationsForBlock: () => (__experimentalGetAnnotationsForBlock),
[50] Fix | Delete
__experimentalGetAnnotationsForRichText: () => (__experimentalGetAnnotationsForRichText)
[51] Fix | Delete
});
[52] Fix | Delete
[53] Fix | Delete
// NAMESPACE OBJECT: ./node_modules/@wordpress/annotations/build-module/store/actions.js
[54] Fix | Delete
var actions_namespaceObject = {};
[55] Fix | Delete
__webpack_require__.r(actions_namespaceObject);
[56] Fix | Delete
__webpack_require__.d(actions_namespaceObject, {
[57] Fix | Delete
__experimentalAddAnnotation: () => (__experimentalAddAnnotation),
[58] Fix | Delete
__experimentalRemoveAnnotation: () => (__experimentalRemoveAnnotation),
[59] Fix | Delete
__experimentalRemoveAnnotationsBySource: () => (__experimentalRemoveAnnotationsBySource),
[60] Fix | Delete
__experimentalUpdateAnnotationRange: () => (__experimentalUpdateAnnotationRange)
[61] Fix | Delete
});
[62] Fix | Delete
[63] Fix | Delete
;// CONCATENATED MODULE: external ["wp","richText"]
[64] Fix | Delete
const external_wp_richText_namespaceObject = window["wp"]["richText"];
[65] Fix | Delete
;// CONCATENATED MODULE: external ["wp","i18n"]
[66] Fix | Delete
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
[67] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/constants.js
[68] Fix | Delete
/**
[69] Fix | Delete
* The identifier for the data store.
[70] Fix | Delete
*
[71] Fix | Delete
* @type {string}
[72] Fix | Delete
*/
[73] Fix | Delete
const STORE_NAME = 'core/annotations';
[74] Fix | Delete
[75] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/annotation.js
[76] Fix | Delete
/**
[77] Fix | Delete
* WordPress dependencies
[78] Fix | Delete
*/
[79] Fix | Delete
[80] Fix | Delete
[81] Fix | Delete
const FORMAT_NAME = 'core/annotation';
[82] Fix | Delete
const ANNOTATION_ATTRIBUTE_PREFIX = 'annotation-text-';
[83] Fix | Delete
/**
[84] Fix | Delete
* Internal dependencies
[85] Fix | Delete
*/
[86] Fix | Delete
[87] Fix | Delete
[88] Fix | Delete
/**
[89] Fix | Delete
* Applies given annotations to the given record.
[90] Fix | Delete
*
[91] Fix | Delete
* @param {Object} record The record to apply annotations to.
[92] Fix | Delete
* @param {Array} annotations The annotation to apply.
[93] Fix | Delete
* @return {Object} A record with the annotations applied.
[94] Fix | Delete
*/
[95] Fix | Delete
function applyAnnotations(record, annotations = []) {
[96] Fix | Delete
annotations.forEach(annotation => {
[97] Fix | Delete
let {
[98] Fix | Delete
start,
[99] Fix | Delete
end
[100] Fix | Delete
} = annotation;
[101] Fix | Delete
if (start > record.text.length) {
[102] Fix | Delete
start = record.text.length;
[103] Fix | Delete
}
[104] Fix | Delete
if (end > record.text.length) {
[105] Fix | Delete
end = record.text.length;
[106] Fix | Delete
}
[107] Fix | Delete
const className = ANNOTATION_ATTRIBUTE_PREFIX + annotation.source;
[108] Fix | Delete
const id = ANNOTATION_ATTRIBUTE_PREFIX + annotation.id;
[109] Fix | Delete
record = (0,external_wp_richText_namespaceObject.applyFormat)(record, {
[110] Fix | Delete
type: FORMAT_NAME,
[111] Fix | Delete
attributes: {
[112] Fix | Delete
className,
[113] Fix | Delete
id
[114] Fix | Delete
}
[115] Fix | Delete
}, start, end);
[116] Fix | Delete
});
[117] Fix | Delete
return record;
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
/**
[121] Fix | Delete
* Removes annotations from the given record.
[122] Fix | Delete
*
[123] Fix | Delete
* @param {Object} record Record to remove annotations from.
[124] Fix | Delete
* @return {Object} The cleaned record.
[125] Fix | Delete
*/
[126] Fix | Delete
function removeAnnotations(record) {
[127] Fix | Delete
return removeFormat(record, 'core/annotation', 0, record.text.length);
[128] Fix | Delete
}
[129] Fix | Delete
[130] Fix | Delete
/**
[131] Fix | Delete
* Retrieves the positions of annotations inside an array of formats.
[132] Fix | Delete
*
[133] Fix | Delete
* @param {Array} formats Formats with annotations in there.
[134] Fix | Delete
* @return {Object} ID keyed positions of annotations.
[135] Fix | Delete
*/
[136] Fix | Delete
function retrieveAnnotationPositions(formats) {
[137] Fix | Delete
const positions = {};
[138] Fix | Delete
formats.forEach((characterFormats, i) => {
[139] Fix | Delete
characterFormats = characterFormats || [];
[140] Fix | Delete
characterFormats = characterFormats.filter(format => format.type === FORMAT_NAME);
[141] Fix | Delete
characterFormats.forEach(format => {
[142] Fix | Delete
let {
[143] Fix | Delete
id
[144] Fix | Delete
} = format.attributes;
[145] Fix | Delete
id = id.replace(ANNOTATION_ATTRIBUTE_PREFIX, '');
[146] Fix | Delete
if (!positions.hasOwnProperty(id)) {
[147] Fix | Delete
positions[id] = {
[148] Fix | Delete
start: i
[149] Fix | Delete
};
[150] Fix | Delete
}
[151] Fix | Delete
[152] Fix | Delete
// Annotations refer to positions between characters.
[153] Fix | Delete
// Formats refer to the character themselves.
[154] Fix | Delete
// So we need to adjust for that here.
[155] Fix | Delete
positions[id].end = i + 1;
[156] Fix | Delete
});
[157] Fix | Delete
});
[158] Fix | Delete
return positions;
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
/**
[162] Fix | Delete
* Updates annotations in the state based on positions retrieved from RichText.
[163] Fix | Delete
*
[164] Fix | Delete
* @param {Array} annotations The annotations that are currently applied.
[165] Fix | Delete
* @param {Array} positions The current positions of the given annotations.
[166] Fix | Delete
* @param {Object} actions
[167] Fix | Delete
* @param {Function} actions.removeAnnotation Function to remove an annotation from the state.
[168] Fix | Delete
* @param {Function} actions.updateAnnotationRange Function to update an annotation range in the state.
[169] Fix | Delete
*/
[170] Fix | Delete
function updateAnnotationsWithPositions(annotations, positions, {
[171] Fix | Delete
removeAnnotation,
[172] Fix | Delete
updateAnnotationRange
[173] Fix | Delete
}) {
[174] Fix | Delete
annotations.forEach(currentAnnotation => {
[175] Fix | Delete
const position = positions[currentAnnotation.id];
[176] Fix | Delete
// If we cannot find an annotation, delete it.
[177] Fix | Delete
if (!position) {
[178] Fix | Delete
// Apparently the annotation has been removed, so remove it from the state:
[179] Fix | Delete
// Remove...
[180] Fix | Delete
removeAnnotation(currentAnnotation.id);
[181] Fix | Delete
return;
[182] Fix | Delete
}
[183] Fix | Delete
const {
[184] Fix | Delete
start,
[185] Fix | Delete
end
[186] Fix | Delete
} = currentAnnotation;
[187] Fix | Delete
if (start !== position.start || end !== position.end) {
[188] Fix | Delete
updateAnnotationRange(currentAnnotation.id, position.start, position.end);
[189] Fix | Delete
}
[190] Fix | Delete
});
[191] Fix | Delete
}
[192] Fix | Delete
const annotation = {
[193] Fix | Delete
name: FORMAT_NAME,
[194] Fix | Delete
title: (0,external_wp_i18n_namespaceObject.__)('Annotation'),
[195] Fix | Delete
tagName: 'mark',
[196] Fix | Delete
className: 'annotation-text',
[197] Fix | Delete
attributes: {
[198] Fix | Delete
className: 'class',
[199] Fix | Delete
id: 'id'
[200] Fix | Delete
},
[201] Fix | Delete
edit() {
[202] Fix | Delete
return null;
[203] Fix | Delete
},
[204] Fix | Delete
__experimentalGetPropsForEditableTreePreparation(select, {
[205] Fix | Delete
richTextIdentifier,
[206] Fix | Delete
blockClientId
[207] Fix | Delete
}) {
[208] Fix | Delete
return {
[209] Fix | Delete
annotations: select(STORE_NAME).__experimentalGetAnnotationsForRichText(blockClientId, richTextIdentifier)
[210] Fix | Delete
};
[211] Fix | Delete
},
[212] Fix | Delete
__experimentalCreatePrepareEditableTree({
[213] Fix | Delete
annotations
[214] Fix | Delete
}) {
[215] Fix | Delete
return (formats, text) => {
[216] Fix | Delete
if (annotations.length === 0) {
[217] Fix | Delete
return formats;
[218] Fix | Delete
}
[219] Fix | Delete
let record = {
[220] Fix | Delete
formats,
[221] Fix | Delete
text
[222] Fix | Delete
};
[223] Fix | Delete
record = applyAnnotations(record, annotations);
[224] Fix | Delete
return record.formats;
[225] Fix | Delete
};
[226] Fix | Delete
},
[227] Fix | Delete
__experimentalGetPropsForEditableTreeChangeHandler(dispatch) {
[228] Fix | Delete
return {
[229] Fix | Delete
removeAnnotation: dispatch(STORE_NAME).__experimentalRemoveAnnotation,
[230] Fix | Delete
updateAnnotationRange: dispatch(STORE_NAME).__experimentalUpdateAnnotationRange
[231] Fix | Delete
};
[232] Fix | Delete
},
[233] Fix | Delete
__experimentalCreateOnChangeEditableValue(props) {
[234] Fix | Delete
return formats => {
[235] Fix | Delete
const positions = retrieveAnnotationPositions(formats);
[236] Fix | Delete
const {
[237] Fix | Delete
removeAnnotation,
[238] Fix | Delete
updateAnnotationRange,
[239] Fix | Delete
annotations
[240] Fix | Delete
} = props;
[241] Fix | Delete
updateAnnotationsWithPositions(annotations, positions, {
[242] Fix | Delete
removeAnnotation,
[243] Fix | Delete
updateAnnotationRange
[244] Fix | Delete
});
[245] Fix | Delete
};
[246] Fix | Delete
}
[247] Fix | Delete
};
[248] Fix | Delete
[249] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/format/index.js
[250] Fix | Delete
/**
[251] Fix | Delete
* WordPress dependencies
[252] Fix | Delete
*/
[253] Fix | Delete
[254] Fix | Delete
[255] Fix | Delete
/**
[256] Fix | Delete
* Internal dependencies
[257] Fix | Delete
*/
[258] Fix | Delete
[259] Fix | Delete
const {
[260] Fix | Delete
name: format_name,
[261] Fix | Delete
...settings
[262] Fix | Delete
} = annotation;
[263] Fix | Delete
(0,external_wp_richText_namespaceObject.registerFormatType)(format_name, settings);
[264] Fix | Delete
[265] Fix | Delete
;// CONCATENATED MODULE: external ["wp","hooks"]
[266] Fix | Delete
const external_wp_hooks_namespaceObject = window["wp"]["hooks"];
[267] Fix | Delete
;// CONCATENATED MODULE: external ["wp","data"]
[268] Fix | Delete
const external_wp_data_namespaceObject = window["wp"]["data"];
[269] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/block/index.js
[270] Fix | Delete
/**
[271] Fix | Delete
* WordPress dependencies
[272] Fix | Delete
*/
[273] Fix | Delete
[274] Fix | Delete
[275] Fix | Delete
[276] Fix | Delete
/**
[277] Fix | Delete
* Internal dependencies
[278] Fix | Delete
*/
[279] Fix | Delete
[280] Fix | Delete
/**
[281] Fix | Delete
* Adds annotation className to the block-list-block component.
[282] Fix | Delete
*
[283] Fix | Delete
* @param {Object} OriginalComponent The original BlockListBlock component.
[284] Fix | Delete
* @return {Object} The enhanced component.
[285] Fix | Delete
*/
[286] Fix | Delete
const addAnnotationClassName = OriginalComponent => {
[287] Fix | Delete
return (0,external_wp_data_namespaceObject.withSelect)((select, {
[288] Fix | Delete
clientId,
[289] Fix | Delete
className
[290] Fix | Delete
}) => {
[291] Fix | Delete
const annotations = select(STORE_NAME).__experimentalGetAnnotationsForBlock(clientId);
[292] Fix | Delete
return {
[293] Fix | Delete
className: annotations.map(annotation => {
[294] Fix | Delete
return 'is-annotated-by-' + annotation.source;
[295] Fix | Delete
}).concat(className).filter(Boolean).join(' ')
[296] Fix | Delete
};
[297] Fix | Delete
})(OriginalComponent);
[298] Fix | Delete
};
[299] Fix | Delete
(0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/annotations', addAnnotationClassName);
[300] Fix | Delete
[301] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/reducer.js
[302] Fix | Delete
/**
[303] Fix | Delete
* Filters an array based on the predicate, but keeps the reference the same if
[304] Fix | Delete
* the array hasn't changed.
[305] Fix | Delete
*
[306] Fix | Delete
* @param {Array} collection The collection to filter.
[307] Fix | Delete
* @param {Function} predicate Function that determines if the item should stay
[308] Fix | Delete
* in the array.
[309] Fix | Delete
* @return {Array} Filtered array.
[310] Fix | Delete
*/
[311] Fix | Delete
function filterWithReference(collection, predicate) {
[312] Fix | Delete
const filteredCollection = collection.filter(predicate);
[313] Fix | Delete
return collection.length === filteredCollection.length ? collection : filteredCollection;
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
/**
[317] Fix | Delete
* Creates a new object with the same keys, but with `callback()` called as
[318] Fix | Delete
* a transformer function on each of the values.
[319] Fix | Delete
*
[320] Fix | Delete
* @param {Object} obj The object to transform.
[321] Fix | Delete
* @param {Function} callback The function to transform each object value.
[322] Fix | Delete
* @return {Array} Transformed object.
[323] Fix | Delete
*/
[324] Fix | Delete
const mapValues = (obj, callback) => Object.entries(obj).reduce((acc, [key, value]) => ({
[325] Fix | Delete
...acc,
[326] Fix | Delete
[key]: callback(value)
[327] Fix | Delete
}), {});
[328] Fix | Delete
[329] Fix | Delete
/**
[330] Fix | Delete
* Verifies whether the given annotations is a valid annotation.
[331] Fix | Delete
*
[332] Fix | Delete
* @param {Object} annotation The annotation to verify.
[333] Fix | Delete
* @return {boolean} Whether the given annotation is valid.
[334] Fix | Delete
*/
[335] Fix | Delete
function isValidAnnotationRange(annotation) {
[336] Fix | Delete
return typeof annotation.start === 'number' && typeof annotation.end === 'number' && annotation.start <= annotation.end;
[337] Fix | Delete
}
[338] Fix | Delete
[339] Fix | Delete
/**
[340] Fix | Delete
* Reducer managing annotations.
[341] Fix | Delete
*
[342] Fix | Delete
* @param {Object} state The annotations currently shown in the editor.
[343] Fix | Delete
* @param {Object} action Dispatched action.
[344] Fix | Delete
*
[345] Fix | Delete
* @return {Array} Updated state.
[346] Fix | Delete
*/
[347] Fix | Delete
function annotations(state = {}, action) {
[348] Fix | Delete
var _state$blockClientId;
[349] Fix | Delete
switch (action.type) {
[350] Fix | Delete
case 'ANNOTATION_ADD':
[351] Fix | Delete
const blockClientId = action.blockClientId;
[352] Fix | Delete
const newAnnotation = {
[353] Fix | Delete
id: action.id,
[354] Fix | Delete
blockClientId,
[355] Fix | Delete
richTextIdentifier: action.richTextIdentifier,
[356] Fix | Delete
source: action.source,
[357] Fix | Delete
selector: action.selector,
[358] Fix | Delete
range: action.range
[359] Fix | Delete
};
[360] Fix | Delete
if (newAnnotation.selector === 'range' && !isValidAnnotationRange(newAnnotation.range)) {
[361] Fix | Delete
return state;
[362] Fix | Delete
}
[363] Fix | Delete
const previousAnnotationsForBlock = (_state$blockClientId = state?.[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : [];
[364] Fix | Delete
return {
[365] Fix | Delete
...state,
[366] Fix | Delete
[blockClientId]: [...previousAnnotationsForBlock, newAnnotation]
[367] Fix | Delete
};
[368] Fix | Delete
case 'ANNOTATION_REMOVE':
[369] Fix | Delete
return mapValues(state, annotationsForBlock => {
[370] Fix | Delete
return filterWithReference(annotationsForBlock, annotation => {
[371] Fix | Delete
return annotation.id !== action.annotationId;
[372] Fix | Delete
});
[373] Fix | Delete
});
[374] Fix | Delete
case 'ANNOTATION_UPDATE_RANGE':
[375] Fix | Delete
return mapValues(state, annotationsForBlock => {
[376] Fix | Delete
let hasChangedRange = false;
[377] Fix | Delete
const newAnnotations = annotationsForBlock.map(annotation => {
[378] Fix | Delete
if (annotation.id === action.annotationId) {
[379] Fix | Delete
hasChangedRange = true;
[380] Fix | Delete
return {
[381] Fix | Delete
...annotation,
[382] Fix | Delete
range: {
[383] Fix | Delete
start: action.start,
[384] Fix | Delete
end: action.end
[385] Fix | Delete
}
[386] Fix | Delete
};
[387] Fix | Delete
}
[388] Fix | Delete
return annotation;
[389] Fix | Delete
});
[390] Fix | Delete
return hasChangedRange ? newAnnotations : annotationsForBlock;
[391] Fix | Delete
});
[392] Fix | Delete
case 'ANNOTATION_REMOVE_SOURCE':
[393] Fix | Delete
return mapValues(state, annotationsForBlock => {
[394] Fix | Delete
return filterWithReference(annotationsForBlock, annotation => {
[395] Fix | Delete
return annotation.source !== action.source;
[396] Fix | Delete
});
[397] Fix | Delete
});
[398] Fix | Delete
}
[399] Fix | Delete
return state;
[400] Fix | Delete
}
[401] Fix | Delete
/* harmony default export */ const reducer = (annotations);
[402] Fix | Delete
[403] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/annotations/build-module/store/selectors.js
[404] Fix | Delete
/**
[405] Fix | Delete
* WordPress dependencies
[406] Fix | Delete
*/
[407] Fix | Delete
[408] Fix | Delete
[409] Fix | Delete
/**
[410] Fix | Delete
* Shared reference to an empty array for cases where it is important to avoid
[411] Fix | Delete
* returning a new array reference on every invocation, as in a connected or
[412] Fix | Delete
* other pure component which performs `shouldComponentUpdate` check on props.
[413] Fix | Delete
* This should be used as a last resort, since the normalized data should be
[414] Fix | Delete
* maintained by the reducer result in state.
[415] Fix | Delete
*
[416] Fix | Delete
* @type {Array}
[417] Fix | Delete
*/
[418] Fix | Delete
const EMPTY_ARRAY = [];
[419] Fix | Delete
[420] Fix | Delete
/**
[421] Fix | Delete
* Returns the annotations for a specific client ID.
[422] Fix | Delete
*
[423] Fix | Delete
* @param {Object} state Editor state.
[424] Fix | Delete
* @param {string} clientId The ID of the block to get the annotations for.
[425] Fix | Delete
*
[426] Fix | Delete
* @return {Array} The annotations applicable to this block.
[427] Fix | Delete
*/
[428] Fix | Delete
const __experimentalGetAnnotationsForBlock = (0,external_wp_data_namespaceObject.createSelector)((state, blockClientId) => {
[429] Fix | Delete
var _state$blockClientId;
[430] Fix | Delete
return ((_state$blockClientId = state?.[blockClientId]) !== null && _state$blockClientId !== void 0 ? _state$blockClientId : []).filter(annotation => {
[431] Fix | Delete
return annotation.selector === 'block';
[432] Fix | Delete
});
[433] Fix | Delete
}, (state, blockClientId) => {
[434] Fix | Delete
var _state$blockClientId2;
[435] Fix | Delete
return [(_state$blockClientId2 = state?.[blockClientId]) !== null && _state$blockClientId2 !== void 0 ? _state$blockClientId2 : EMPTY_ARRAY];
[436] Fix | Delete
});
[437] Fix | Delete
function __experimentalGetAllAnnotationsForBlock(state, blockClientId) {
[438] Fix | Delete
var _state$blockClientId3;
[439] Fix | Delete
return (_state$blockClientId3 = state?.[blockClientId]) !== null && _state$blockClientId3 !== void 0 ? _state$blockClientId3 : EMPTY_ARRAY;
[440] Fix | Delete
}
[441] Fix | Delete
[442] Fix | Delete
/**
[443] Fix | Delete
* Returns the annotations that apply to the given RichText instance.
[444] Fix | Delete
*
[445] Fix | Delete
* Both a blockClientId and a richTextIdentifier are required. This is because
[446] Fix | Delete
* a block might have multiple `RichText` components. This does mean that every
[447] Fix | Delete
* block needs to implement annotations itself.
[448] Fix | Delete
*
[449] Fix | Delete
* @param {Object} state Editor state.
[450] Fix | Delete
* @param {string} blockClientId The client ID for the block.
[451] Fix | Delete
* @param {string} richTextIdentifier Unique identifier that identifies the given RichText.
[452] Fix | Delete
* @return {Array} All the annotations relevant for the `RichText`.
[453] Fix | Delete
*/
[454] Fix | Delete
const __experimentalGetAnnotationsForRichText = (0,external_wp_data_namespaceObject.createSelector)((state, blockClientId, richTextIdentifier) => {
[455] Fix | Delete
var _state$blockClientId4;
[456] Fix | Delete
return ((_state$blockClientId4 = state?.[blockClientId]) !== null && _state$blockClientId4 !== void 0 ? _state$blockClientId4 : []).filter(annotation => {
[457] Fix | Delete
return annotation.selector === 'range' && richTextIdentifier === annotation.richTextIdentifier;
[458] Fix | Delete
}).map(annotation => {
[459] Fix | Delete
const {
[460] Fix | Delete
range,
[461] Fix | Delete
...other
[462] Fix | Delete
} = annotation;
[463] Fix | Delete
return {
[464] Fix | Delete
...range,
[465] Fix | Delete
...other
[466] Fix | Delete
};
[467] Fix | Delete
});
[468] Fix | Delete
}, (state, blockClientId) => {
[469] Fix | Delete
var _state$blockClientId5;
[470] Fix | Delete
return [(_state$blockClientId5 = state?.[blockClientId]) !== null && _state$blockClientId5 !== void 0 ? _state$blockClientId5 : EMPTY_ARRAY];
[471] Fix | Delete
});
[472] Fix | Delete
[473] Fix | Delete
/**
[474] Fix | Delete
* Returns all annotations in the editor state.
[475] Fix | Delete
*
[476] Fix | Delete
* @param {Object} state Editor state.
[477] Fix | Delete
* @return {Array} All annotations currently applied.
[478] Fix | Delete
*/
[479] Fix | Delete
function __experimentalGetAnnotations(state) {
[480] Fix | Delete
return Object.values(state).flat();
[481] Fix | Delete
}
[482] Fix | Delete
[483] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/native.js
[484] Fix | Delete
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
[485] Fix | Delete
/* harmony default export */ const esm_browser_native = ({
[486] Fix | Delete
randomUUID
[487] Fix | Delete
});
[488] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js
[489] Fix | Delete
// Unique ID creation requires a high quality random # generator. In the browser we therefore
[490] Fix | Delete
// require the crypto API and do not support built-in fallback to lower quality random number
[491] Fix | Delete
// generators (like Math.random()).
[492] Fix | Delete
let getRandomValues;
[493] Fix | Delete
const rnds8 = new Uint8Array(16);
[494] Fix | Delete
function rng() {
[495] Fix | Delete
// lazy load so that environments that need to polyfill have a chance to do so
[496] Fix | Delete
if (!getRandomValues) {
[497] Fix | Delete
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
[498] Fix | Delete
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function