summaryrefslogtreecommitdiffstats
path: root/wp-includes/js/dist/annotations.min.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:51:22 +0000
commitfc0a79914946dac00ccd51b1aacffe267de7210e (patch)
tree1403384efbfe8f8776ff60aaa40f7d535c02c822 /wp-includes/js/dist/annotations.min.js
parentReleasing progress-linux version 6.5.5+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.tar.xz
wordpress-fc0a79914946dac00ccd51b1aacffe267de7210e.zip
Merging upstream version 6.6.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-includes/js/dist/annotations.min.js')
-rw-r--r--wp-includes/js/dist/annotations.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/wp-includes/js/dist/annotations.min.js b/wp-includes/js/dist/annotations.min.js
index 8661d7f..8af9556 100644
--- a/wp-includes/js/dist/annotations.min.js
+++ b/wp-includes/js/dist/annotations.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>G});var n={};e.r(n),e.d(n,{__experimentalGetAllAnnotationsForBlock:()=>N,__experimentalGetAnnotations:()=>O,__experimentalGetAnnotationsForBlock:()=>T,__experimentalGetAnnotationsForRichText:()=>b});var r={};e.r(r),e.d(r,{__experimentalAddAnnotation:()=>S,__experimentalRemoveAnnotation:()=>C,__experimentalRemoveAnnotationsBySource:()=>F,__experimentalUpdateAnnotationRange:()=>P});const o=window.wp.richText,a=window.wp.i18n,i="core/annotations",l="core/annotation",c="annotation-text-";const s={name:l,title:(0,a.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit:()=>null,__experimentalGetPropsForEditableTreePreparation:(e,{richTextIdentifier:t,blockClientId:n})=>({annotations:e(i).__experimentalGetAnnotationsForRichText(n,t)}),__experimentalCreatePrepareEditableTree:({annotations:e})=>(t,n)=>{if(0===e.length)return t;let r={formats:t,text:n};return r=function(e,t=[]){return t.forEach((t=>{let{start:n,end:r}=t;n>e.text.length&&(n=e.text.length),r>e.text.length&&(r=e.text.length);const a=c+t.source,i=c+t.id;e=(0,o.applyFormat)(e,{type:l,attributes:{className:a,id:i}},n,r)})),e}(r,e),r.formats},__experimentalGetPropsForEditableTreeChangeHandler:e=>({removeAnnotation:e(i).__experimentalRemoveAnnotation,updateAnnotationRange:e(i).__experimentalUpdateAnnotationRange}),__experimentalCreateOnChangeEditableValue:e=>t=>{const n=function(e){const t={};return e.forEach(((e,n)=>{(e=(e=e||[]).filter((e=>e.type===l))).forEach((e=>{let{id:r}=e.attributes;r=r.replace(c,""),t.hasOwnProperty(r)||(t[r]={start:n}),t[r].end=n+1}))})),t}(t),{removeAnnotation:r,updateAnnotationRange:o,annotations:a}=e;!function(e,t,{removeAnnotation:n,updateAnnotationRange:r}){e.forEach((e=>{const o=t[e.id];if(!o)return void n(e.id);const{start:a,end:i}=e;a===o.start&&i===o.end||r(e.id,o.start,o.end)}))}(a,n,{removeAnnotation:r,updateAnnotationRange:o})}},{name:u,...d}=s;(0,o.registerFormatType)(u,d);const p=window.wp.hooks,f=window.wp.data;function m(e,t){const n=e.filter(t);return e.length===n.length?e:n}(0,p.addFilter)("editor.BlockListBlock","core/annotations",(e=>(0,f.withSelect)(((e,{clientId:t,className:n})=>({className:e(i).__experimentalGetAnnotationsForBlock(t).map((e=>"is-annotated-by-"+e.source)).concat(n).filter(Boolean).join(" ")})))(e)));const g=(e,t)=>Object.entries(e).reduce(((e,[n,r])=>({...e,[n]:t(r)})),{});const h=function(e={},t){var n;switch(t.type){case"ANNOTATION_ADD":const r=t.blockClientId,o={id:t.id,blockClientId:r,richTextIdentifier:t.richTextIdentifier,source:t.source,selector:t.selector,range:t.range};if("range"===o.selector&&!function(e){return"number"==typeof e.start&&"number"==typeof e.end&&e.start<=e.end}(o.range))return e;const a=null!==(n=e?.[r])&&void 0!==n?n:[];return{...e,[r]:[...a,o]};case"ANNOTATION_REMOVE":return g(e,(e=>m(e,(e=>e.id!==t.annotationId))));case"ANNOTATION_UPDATE_RANGE":return g(e,(e=>{let n=!1;const r=e.map((e=>e.id===t.annotationId?(n=!0,{...e,range:{start:t.start,end:t.end}}):e));return n?r:e}));case"ANNOTATION_REMOVE_SOURCE":return g(e,(e=>m(e,(e=>e.source!==t.source))))}return e};var _={};function A(e){return[e]}function v(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function y(e,t){var n,r=t||A;function o(){n=new WeakMap}function a(){var t,o,a,i,l,c=arguments.length;for(i=new Array(c),a=0;a<c;a++)i[a]=arguments[a];for(t=function(e){var t,r,o,a,i,l=n,c=!0;for(t=0;t<e.length;t++){if(!(i=r=e[t])||"object"!=typeof i){c=!1;break}l.has(r)?l=l.get(r):(o=new WeakMap,l.set(r,o),l=o)}return l.has(_)||((a=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=c,l.set(_,a)),l.get(_)}(l=r.apply(null,i)),t.isUniqueByDependants||(t.lastDependants&&!v(l,t.lastDependants,0)&&t.clear(),t.lastDependants=l),o=t.head;o;){if(v(o.args,i,1))return o!==t.head&&(o.prev.next=o.next,o.next&&(o.next.prev=o.prev),o.next=t.head,o.prev=null,t.head.prev=o,t.head=o),o.val;o=o.next}return o={val:e.apply(null,i)},i[0]=null,o.args=i,t.head&&(t.head.prev=o,o.next=t.head),t.head=o,o.val}return a.getDependants=r,a.clear=o,o(),a}const x=[],T=y(((e,t)=>{var n;return(null!==(n=e?.[t])&&void 0!==n?n:[]).filter((e=>"block"===e.selector))}),((e,t)=>{var n;return[null!==(n=e?.[t])&&void 0!==n?n:x]}));function N(e,t){var n;return null!==(n=e?.[t])&&void 0!==n?n:x}const b=y(((e,t,n)=>{var r;return(null!==(r=e?.[t])&&void 0!==r?r:[]).filter((e=>"range"===e.selector&&n===e.richTextIdentifier)).map((e=>{const{range:t,...n}=e;return{...t,...n}}))}),((e,t)=>{var n;return[null!==(n=e?.[t])&&void 0!==n?n:x]}));function O(e){return Object.values(e).flat()}const I={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let w;const E=new Uint8Array(16);function R(){if(!w&&(w="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!w))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return w(E)}const U=[];for(let e=0;e<256;++e)U.push((e+256).toString(16).slice(1));function D(e,t=0){return U[e[t+0]]+U[e[t+1]]+U[e[t+2]]+U[e[t+3]]+"-"+U[e[t+4]]+U[e[t+5]]+"-"+U[e[t+6]]+U[e[t+7]]+"-"+U[e[t+8]]+U[e[t+9]]+"-"+U[e[t+10]]+U[e[t+11]]+U[e[t+12]]+U[e[t+13]]+U[e[t+14]]+U[e[t+15]]}const k=function(e,t,n){if(I.randomUUID&&!t&&!e)return I.randomUUID();const r=(e=e||{}).random||(e.rng||R)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return D(r)};function S({blockClientId:e,richTextIdentifier:t=null,range:n=null,selector:r="range",source:o="default",id:a=k()}){const i={type:"ANNOTATION_ADD",id:a,blockClientId:e,richTextIdentifier:t,source:o,selector:r};return"range"===r&&(i.range=n),i}function C(e){return{type:"ANNOTATION_REMOVE",annotationId:e}}function P(e,t,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:e,start:t,end:n}}function F(e){return{type:"ANNOTATION_REMOVE_SOURCE",source:e}}const G=(0,f.createReduxStore)(i,{reducer:h,selectors:n,actions:r});(0,f.register)(G),(window.wp=window.wp||{}).annotations=t})(); \ No newline at end of file
+(()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{store:()=>C});var n={};t.r(n),t.d(n,{__experimentalGetAllAnnotationsForBlock:()=>x,__experimentalGetAnnotations:()=>N,__experimentalGetAnnotationsForBlock:()=>y,__experimentalGetAnnotationsForRichText:()=>T});var r={};t.r(r),t.d(r,{__experimentalAddAnnotation:()=>R,__experimentalRemoveAnnotation:()=>U,__experimentalRemoveAnnotationsBySource:()=>k,__experimentalUpdateAnnotationRange:()=>S});const o=window.wp.richText,a=window.wp.i18n,i="core/annotations",c="core/annotation",l="annotation-text-";const s={name:c,title:(0,a.__)("Annotation"),tagName:"mark",className:"annotation-text",attributes:{className:"class",id:"id"},edit:()=>null,__experimentalGetPropsForEditableTreePreparation:(t,{richTextIdentifier:e,blockClientId:n})=>({annotations:t(i).__experimentalGetAnnotationsForRichText(n,e)}),__experimentalCreatePrepareEditableTree:({annotations:t})=>(e,n)=>{if(0===t.length)return e;let r={formats:e,text:n};return r=function(t,e=[]){return e.forEach((e=>{let{start:n,end:r}=e;n>t.text.length&&(n=t.text.length),r>t.text.length&&(r=t.text.length);const a=l+e.source,i=l+e.id;t=(0,o.applyFormat)(t,{type:c,attributes:{className:a,id:i}},n,r)})),t}(r,t),r.formats},__experimentalGetPropsForEditableTreeChangeHandler:t=>({removeAnnotation:t(i).__experimentalRemoveAnnotation,updateAnnotationRange:t(i).__experimentalUpdateAnnotationRange}),__experimentalCreateOnChangeEditableValue:t=>e=>{const n=function(t){const e={};return t.forEach(((t,n)=>{(t=(t=t||[]).filter((t=>t.type===c))).forEach((t=>{let{id:r}=t.attributes;r=r.replace(l,""),e.hasOwnProperty(r)||(e[r]={start:n}),e[r].end=n+1}))})),e}(e),{removeAnnotation:r,updateAnnotationRange:o,annotations:a}=t;!function(t,e,{removeAnnotation:n,updateAnnotationRange:r}){t.forEach((t=>{const o=e[t.id];if(!o)return void n(t.id);const{start:a,end:i}=t;a===o.start&&i===o.end||r(t.id,o.start,o.end)}))}(a,n,{removeAnnotation:r,updateAnnotationRange:o})}},{name:d,...u}=s;(0,o.registerFormatType)(d,u);const p=window.wp.hooks,m=window.wp.data;function f(t,e){const n=t.filter(e);return t.length===n.length?t:n}(0,p.addFilter)("editor.BlockListBlock","core/annotations",(t=>(0,m.withSelect)(((t,{clientId:e,className:n})=>({className:t(i).__experimentalGetAnnotationsForBlock(e).map((t=>"is-annotated-by-"+t.source)).concat(n).filter(Boolean).join(" ")})))(t)));const _=(t,e)=>Object.entries(t).reduce(((t,[n,r])=>({...t,[n]:e(r)})),{});const A=function(t={},e){var n;switch(e.type){case"ANNOTATION_ADD":const r=e.blockClientId,o={id:e.id,blockClientId:r,richTextIdentifier:e.richTextIdentifier,source:e.source,selector:e.selector,range:e.range};if("range"===o.selector&&!function(t){return"number"==typeof t.start&&"number"==typeof t.end&&t.start<=t.end}(o.range))return t;const a=null!==(n=t?.[r])&&void 0!==n?n:[];return{...t,[r]:[...a,o]};case"ANNOTATION_REMOVE":return _(t,(t=>f(t,(t=>t.id!==e.annotationId))));case"ANNOTATION_UPDATE_RANGE":return _(t,(t=>{let n=!1;const r=t.map((t=>t.id===e.annotationId?(n=!0,{...t,range:{start:e.start,end:e.end}}):t));return n?r:t}));case"ANNOTATION_REMOVE_SOURCE":return _(t,(t=>f(t,(t=>t.source!==e.source))))}return t},g=[],y=(0,m.createSelector)(((t,e)=>{var n;return(null!==(n=t?.[e])&&void 0!==n?n:[]).filter((t=>"block"===t.selector))}),((t,e)=>{var n;return[null!==(n=t?.[e])&&void 0!==n?n:g]}));function x(t,e){var n;return null!==(n=t?.[e])&&void 0!==n?n:g}const T=(0,m.createSelector)(((t,e,n)=>{var r;return(null!==(r=t?.[e])&&void 0!==r?r:[]).filter((t=>"range"===t.selector&&n===t.richTextIdentifier)).map((t=>{const{range:e,...n}=t;return{...e,...n}}))}),((t,e)=>{var n;return[null!==(n=t?.[e])&&void 0!==n?n:g]}));function N(t){return Object.values(t).flat()}const h={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let O;const b=new Uint8Array(16);function I(){if(!O&&(O="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!O))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(b)}const v=[];for(let t=0;t<256;++t)v.push((t+256).toString(16).slice(1));function w(t,e=0){return v[t[e+0]]+v[t[e+1]]+v[t[e+2]]+v[t[e+3]]+"-"+v[t[e+4]]+v[t[e+5]]+"-"+v[t[e+6]]+v[t[e+7]]+"-"+v[t[e+8]]+v[t[e+9]]+"-"+v[t[e+10]]+v[t[e+11]]+v[t[e+12]]+v[t[e+13]]+v[t[e+14]]+v[t[e+15]]}const E=function(t,e,n){if(h.randomUUID&&!e&&!t)return h.randomUUID();const r=(t=t||{}).random||(t.rng||I)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return w(r)};function R({blockClientId:t,richTextIdentifier:e=null,range:n=null,selector:r="range",source:o="default",id:a=E()}){const i={type:"ANNOTATION_ADD",id:a,blockClientId:t,richTextIdentifier:e,source:o,selector:r};return"range"===r&&(i.range=n),i}function U(t){return{type:"ANNOTATION_REMOVE",annotationId:t}}function S(t,e,n){return{type:"ANNOTATION_UPDATE_RANGE",annotationId:t,start:e,end:n}}function k(t){return{type:"ANNOTATION_REMOVE_SOURCE",source:t}}const C=(0,m.createReduxStore)(i,{reducer:A,selectors:n,actions:r});(0,m.register)(C),(window.wp=window.wp||{}).annotations=e})(); \ No newline at end of file