@uva-glass/component-library 1.52.0 → 1.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/{Lexical.prod-DSsdOWxu.js → Lexical.prod-zUeT_jIr.js} +253 -246
  2. package/dist/Lexical.prod-zUeT_jIr.js.map +1 -0
  3. package/dist/LexicalUtils.prod-DtRifALg.js +64 -0
  4. package/dist/LexicalUtils.prod-DtRifALg.js.map +1 -0
  5. package/dist/ListPlugin-CxyYg2bv.js +588 -0
  6. package/dist/ListPlugin-CxyYg2bv.js.map +1 -0
  7. package/dist/RteEditor.module--4R0Ql6Y.js +26 -0
  8. package/dist/RteEditor.module--4R0Ql6Y.js.map +1 -0
  9. package/dist/assets/RteEditor.css +1 -1
  10. package/dist/assets/useFlyout.css +1 -0
  11. package/dist/components/Buttons/Button.stories.js +1 -1
  12. package/dist/components/Buttons/Button.stories.js.map +1 -1
  13. package/dist/components/Buttons/LinkButton.stories.js +5 -5
  14. package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
  15. package/dist/components/Buttons/MenuButton.stories.js +10 -10
  16. package/dist/components/Buttons/MenuButton.stories.js.map +1 -1
  17. package/dist/components/HorizontalList/HorizontalList.stories.js +1 -1
  18. package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
  19. package/dist/components/Icon/Icon.d.ts +1 -1
  20. package/dist/components/Icon/Icon.js.map +1 -1
  21. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +2 -2
  22. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +6 -0
  23. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +98 -0
  24. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -0
  25. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +8 -0
  26. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +7 -0
  27. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -0
  28. package/dist/components/RteEditor/Plugins/LinkPlugin/index.d.ts +1 -0
  29. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +5 -0
  30. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js.map +1 -0
  31. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +3 -3
  32. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  33. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +6 -0
  34. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +33 -28
  35. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  36. package/dist/components/RteEditor/Plugins/index.js +1 -1
  37. package/dist/components/RteEditor/RteEditor.js +532 -457
  38. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  39. package/dist/components/RteEditor/RteEditor.stories.js +1 -1
  40. package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
  41. package/dist/components/RteEditor/UvaTheme/UvaTheme.d.ts +1 -0
  42. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +5 -4
  43. package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
  44. package/dist/components/RteEditor/hooks/index.d.ts +1 -0
  45. package/dist/components/RteEditor/hooks/index.js +5 -0
  46. package/dist/components/RteEditor/hooks/index.js.map +1 -0
  47. package/dist/components/RteEditor/hooks/useFlyout.d.ts +12 -0
  48. package/dist/components/RteEditor/hooks/useFlyout.js +45 -0
  49. package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -0
  50. package/dist/helpers-DpGAANJ8.js +365 -0
  51. package/dist/helpers-DpGAANJ8.js.map +1 -0
  52. package/package.json +14 -14
  53. package/dist/Lexical.prod-DSsdOWxu.js.map +0 -1
  54. package/dist/ListPlugin-Bu2AbCDB.js +0 -643
  55. package/dist/ListPlugin-Bu2AbCDB.js.map +0 -1
  56. package/dist/RteEditor.module-RkKUrkOO.js +0 -21
  57. package/dist/RteEditor.module-RkKUrkOO.js.map +0 -1
@@ -0,0 +1,64 @@
1
+ import { y as o, w as l } from "./Lexical.prod-zUeT_jIr.js";
2
+ function c(t) {
3
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
4
+ }
5
+ var s = c(function(t) {
6
+ const e = new URLSearchParams();
7
+ e.append("code", t);
8
+ for (let n = 1; n < arguments.length; n++) e.append("v", arguments[n]);
9
+ throw Error(`Minified Lexical error #${t}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
10
+ });
11
+ const r = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, a = r && "documentMode" in document ? document.documentMode : null;
12
+ !(!r || !("InputEvent" in window) || a) && "getTargetRanges" in new window.InputEvent("input");
13
+ function i(...t) {
14
+ const e = [];
15
+ for (const n of t) if (n && typeof n == "string") for (const [u] of n.matchAll(/\S+/g)) e.push(u);
16
+ return e;
17
+ }
18
+ function m(...t) {
19
+ return () => {
20
+ for (let e = t.length - 1; e >= 0; e--) t[e]();
21
+ t.length = 0;
22
+ };
23
+ }
24
+ function p(t, ...e) {
25
+ const n = i(...e);
26
+ n.length > 0 && t.classList.add(...n);
27
+ }
28
+ function g(t, ...e) {
29
+ const n = i(...e);
30
+ n.length > 0 && t.classList.remove(...n);
31
+ }
32
+ function w(t, e) {
33
+ let n = t;
34
+ for (; n != null; ) {
35
+ if (n instanceof e) return n;
36
+ n = n.getParent();
37
+ }
38
+ return null;
39
+ }
40
+ function h(t) {
41
+ const e = f(t, (n) => o(n) && !n.isInline());
42
+ return o(e) || s(4, t.__key), e;
43
+ }
44
+ const f = (t, e) => {
45
+ let n = t;
46
+ for (; n !== l() && n != null; ) {
47
+ if (e(n)) return n;
48
+ n = n.getParent();
49
+ }
50
+ return null;
51
+ };
52
+ function v(t, e) {
53
+ return t !== null && Object.getPrototypeOf(t).constructor.name === e.name;
54
+ }
55
+ export {
56
+ p as $,
57
+ m as L,
58
+ g as U,
59
+ w as Z,
60
+ h as e,
61
+ v as i,
62
+ f as t
63
+ };
64
+ //# sourceMappingURL=LexicalUtils.prod-DtRifALg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LexicalUtils.prod-DtRifALg.js","sources":["../node_modules/@lexical/utils/LexicalUtils.prod.mjs"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$getSelection as e,$isRangeSelection as t,TextNode as n,$getRoot as o,$isElementNode as r,$cloneWithProperties as l,$setSelection as i,$getPreviousSelection as s,$isRootOrShadowRoot as u,$isTextNode as c,$splitNode as f,$createParagraphNode as a}from\"lexical\";export{$splitNode,isBlockDomNode,isHTMLAnchorElement,isHTMLElement,isInlineDomNode}from\"lexical\";import{createRectsFromDOMRange as d}from\"@lexical/selection\";function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var p=g((function(e){const t=new URLSearchParams;t.append(\"code\",e);for(let e=1;e<arguments.length;e++)t.append(\"v\",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const h=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,m=h&&\"documentMode\"in document?document.documentMode:null,v=h&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),y=h&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),w=!(!h||!(\"InputEvent\"in window)||m)&&\"getTargetRanges\"in new window.InputEvent(\"input\"),E=h&&/Version\\/[\\d.]+.*Safari/.test(navigator.userAgent),P=h&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,S=h&&/Android/.test(navigator.userAgent),x=h&&/^(?=.*Chrome).*/i.test(navigator.userAgent),A=h&&S&&x,N=h&&/AppleWebKit\\/[\\d.]+/.test(navigator.userAgent)&&!x;function b(...e){const t=[];for(const n of e)if(n&&\"string\"==typeof n)for(const[e]of n.matchAll(/\\S+/g))t.push(e);return t}function L(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function T(e){return`${e}px`}const M={attributes:!0,characterData:!0,childList:!0,subtree:!0};function C(e,t,n){let o=null,r=null,l=null,i=[];const s=document.createElement(\"div\");function u(){null===o&&p(182),null===r&&p(183);const{left:l,top:u}=o.getBoundingClientRect(),c=r,f=d(e,t);s.isConnected||c.append(s);let a=!1;for(let e=0;e<f.length;e++){const t=f[e],n=i[e]||document.createElement(\"div\"),o=n.style;\"absolute\"!==o.position&&(o.position=\"absolute\",a=!0);const r=T(t.left-l);o.left!==r&&(o.left=r,a=!0);const c=T(t.top-u);o.top!==c&&(n.style.top=c,a=!0);const d=T(t.width);o.width!==d&&(n.style.width=d,a=!0);const g=T(t.height);o.height!==g&&(n.style.height=g,a=!0),n.parentNode!==s&&(s.append(n),a=!0),i[e]=n}for(;i.length>f.length;)i.pop();a&&n(i)}function c(){r=null,o=null,null!==l&&l.disconnect(),l=null,s.remove();for(const e of i)e.remove();i=[]}const f=e.registerRootListener((function t(){const n=e.getRootElement();if(null===n)return c();const i=n.parentElement;if(!(i instanceof HTMLElement))return c();c(),o=n,r=i,l=new MutationObserver((n=>{const l=e.getRootElement(),i=l&&l.parentElement;if(l!==o||i!==r)return t();for(const e of n)if(!s.contains(e.target))return u()})),l.observe(i,M),u()}));return()=>{f(),c()}}function B(o,r){let l=null,i=null,s=null,u=null,c=()=>{};function f(f){f.read((()=>{const f=e();if(!t(f))return l=null,i=null,s=null,u=null,c(),void(c=()=>{});const{anchor:a,focus:d}=f,g=a.getNode(),h=g.getKey(),m=a.offset,v=d.getNode(),y=v.getKey(),w=d.offset,E=o.getElementByKey(h),P=o.getElementByKey(y),S=null===l||null===E||m!==i||h!==l.getKey()||g!==l&&(!(l instanceof n)||g.updateDOM(l,E,o._config)),x=null===s||null===P||w!==u||y!==s.getKey()||v!==s&&(!(s instanceof n)||v.updateDOM(s,P,o._config));if(S||x){const e=o.getElementByKey(a.getNode().getKey()),t=o.getElementByKey(d.getNode().getKey());if(null!==e&&null!==t&&\"SPAN\"===e.tagName&&\"SPAN\"===t.tagName){const n=document.createRange();let l,i,s,u;d.isBefore(a)?(l=t,i=d.offset,s=e,u=a.offset):(l=e,i=a.offset,s=t,u=d.offset);const f=l.firstChild;null===f&&p(181);const g=s.firstChild;null===g&&p(181),n.setStart(f,i),n.setEnd(g,u),c(),c=C(o,n,(e=>{for(const t of e){const e=t.style;\"Highlight\"!==e.background&&(e.background=\"Highlight\"),\"HighlightText\"!==e.color&&(e.color=\"HighlightText\"),\"-1\"!==e.zIndex&&(e.zIndex=\"-1\"),\"none\"!==e.pointerEvents&&(e.pointerEvents=\"none\"),e.marginTop!==T(-1.5)&&(e.marginTop=T(-1.5)),e.paddingTop!==T(4)&&(e.paddingTop=T(4)),e.paddingBottom!==T(0)&&(e.paddingBottom=T(0))}void 0!==r&&r(e)}))}}l=g,i=m,s=v,u=w}))}return f(o.getEditorState()),L(o.registerUpdateListener((({editorState:e})=>f(e))),c,(()=>{c()}))}const _=w,K=h,O=S,R=A,I=v,H=N,z=x,D=y,k=P,F=E;function $(e,...t){const n=b(...t);n.length>0&&e.classList.add(...n)}function U(e,...t){const n=b(...t);n.length>0&&e.classList.remove(...n)}function W(e,t){for(const n of t)if(e.type.startsWith(n))return!0;return!1}function j(e,t){const n=e[Symbol.iterator]();return new Promise(((e,o)=>{const r=[],l=()=>{const{done:i,value:s}=n.next();if(i)return e(r);const u=new FileReader;u.addEventListener(\"error\",o),u.addEventListener(\"load\",(()=>{const e=u.result;\"string\"==typeof e&&r.push({file:s,result:e}),l()})),W(s,t)?u.readAsDataURL(s):l()};l()}))}function V(e,t){return Array.from(J(e,t))}const q={done:!0,value:void 0},G=e=>({done:!1,value:e});function J(e,t){const n=(e||o()).getLatest(),l=X(n),i=t;let s=n,u=l,c=!0;const f={next(){if(null===s)return q;if(c)return c=!1,G({depth:u,node:s});if(s===i)return q;if(r(s)&&s.getChildrenSize()>0)s=s.getFirstChild(),u++;else{let e;[s,e]=Q(s)||[null,0],u+=e,null==i&&u<=l&&(s=null)}return null===s?q:G({depth:u,node:s})},[Symbol.iterator]:()=>f};return f}function Q(e){let t=e,n=null,o=0;for(;null===n&&null!==t;)n=t.getNextSibling(),null===n?(t=t.getParent(),o--):t=n;return null===t?null:[t,o]}function X(e){let t=e,n=0;for(;null!==(t=t.getParent());)n++;return n}function Y(e){let t=e;if(r(t)&&t.getChildrenSize()>0)t=t.getLastChild();else{let e=null;for(;null===e&&null!==t;)e=t.getPreviousSibling(),t=null===e?t.getParent():e}return t}function Z(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function ee(e){const t=te(e,(e=>r(e)&&!e.isInline()));return r(t)||p(4,e.__key),t}const te=(e,t)=>{let n=e;for(;n!==o()&&null!=n;){if(t(n))return n;n=n.getParent()}return null};function ne(e,t,n,o){const r=e=>e instanceof t;return e.registerNodeTransform(t,(e=>{const t=(e=>{const t=e.getChildren();for(let e=0;e<t.length;e++){const n=t[e];if(r(n))return null}let n=e,o=e;for(;null!==n;)if(o=n,n=n.getParent(),r(n))return{child:o,parent:n};return null})(e);if(null!==t){const{child:r,parent:l}=t;if(r.is(e)){o(l,e);const t=r.getNextSiblings(),i=t.length;if(l.insertAfter(r),0!==i){const e=n(l);r.insertAfter(e);for(let n=0;n<i;n++)e.append(t[n])}l.canBeEmpty()||0!==l.getChildrenSize()||l.remove()}}}))}function oe(e,t){const n=new Map,o=e._pendingEditorState;for(const[e,o]of t._nodeMap)n.set(e,l(o));o&&(o._nodeMap=n),e._dirtyType=2;const r=t._selection;i(null===r?null:r.clone())}function re(n){const r=e()||s();if(t(r)){const{focus:e}=r,t=e.getNode(),o=e.offset;if(u(t)){const e=t.getChildAtIndex(o);null==e?t.append(n):e.insertBefore(n),n.selectNext()}else{let e,r;c(t)?(e=t.getParentOrThrow(),r=t.getIndexWithinParent(),o>0&&(r+=1,t.splitText(o))):(e=t,r=o);const[,l]=f(e,r);l.insertBefore(n),l.selectStart()}}else{if(null!=r){const e=r.getNodes();e[e.length-1].getTopLevelElementOrThrow().insertAfter(n)}else{o().append(n)}const e=a();n.insertAfter(e),e.select()}return n.getLatest()}function le(e,t){const n=t();return e.replace(n),n.append(e),n}function ie(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function se(e,t){const n=[];for(let o=0;o<e.length;o++){const r=t(e[o]);null!==r&&n.push(r)}return n}function ue(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function ce(e){if(D)return 1;let t=1;for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue(\"zoom\")),e=e.parentElement;return t}function fe(e){return null!==e._parentEditor}export{V as $dfs,J as $dfsIterator,se as $filter,te as $findMatchingParent,X as $getDepth,ee as $getNearestBlockElementAncestorOrThrow,Z as $getNearestNodeOfType,Y as $getNextRightPreorderNode,Q as $getNextSiblingOrParentSibling,ue as $insertFirst,re as $insertNodeToNearestRoot,fe as $isEditorIsNestedEditor,oe as $restoreEditorState,le as $wrapNodeInElement,_ as CAN_USE_BEFORE_INPUT,K as CAN_USE_DOM,O as IS_ANDROID,R as IS_ANDROID_CHROME,I as IS_APPLE,H as IS_APPLE_WEBKIT,z as IS_CHROME,D as IS_FIREFOX,k as IS_IOS,F as IS_SAFARI,$ as addClassNamesToElement,ce as calculateZoomLevel,W as isMimeType,B as markSelection,j as mediaFileReader,L as mergeRegister,ie as objectKlassEquals,C as positionNodeOnRange,ne as registerNestedElementResolver,U as removeClassNamesFromElement};\n"],"names":["g","e","p","t","h","m","b","L","$","U","Z","ee","te","r","o","ie"],"mappings":";AAQya,SAASA,EAAEC,GAAE;AAAC,SAAOA,KAAGA,EAAE,cAAY,OAAO,UAAU,eAAe,KAAKA,GAAE,SAAS,IAAEA,EAAE,UAAQA;AAAC;AAAC,IAAIC,IAAEF,EAAG,SAASC,GAAE;AAAC,QAAME,IAAE,IAAI;AAAgB,EAAAA,EAAE,OAAO,QAAOF,CAAC;AAAE,WAAQA,IAAE,GAAEA,IAAE,UAAU,QAAOA,IAAI,CAAAE,EAAE,OAAO,KAAI,UAAUF,CAAC,CAAC;AAAE,QAAM,MAAM,2BAA2BA,CAAC,0CAA0CE,CAAC,gHAAgH;AAAC,CAAC;AAAQ,MAACC,IAAe,OAAO,SAApB,OAAqC,OAAO,aAAhB,UAAmC,OAAO,SAAS,kBAAzB,QAAuCC,IAAED,KAAG,kBAAiB,WAAS,SAAS,eAAa;AAA8H,EAAE,CAACA,KAAG,EAAE,gBAAe,WAASC,MAAI,qBAAoB,IAAI,OAAO,WAAW,OAAO;AAA6R,SAASC,KAAKL,GAAE;AAAC,QAAME,IAAE,CAAE;AAAC,aAAU,KAAKF,EAAE,KAAG,KAAa,OAAO,KAAjB,SAAmB,YAAS,CAACA,CAAC,KAAI,EAAE,SAAS,MAAM,EAAE,CAAAE,EAAE,KAAKF,CAAC;AAAE,SAAOE;AAAC;AAAC,SAASI,KAAKN,GAAE;AAAC,SAAM,MAAI;AAAC,aAAQE,IAAEF,EAAE,SAAO,GAAEE,KAAG,GAAEA,IAAI,CAAAF,EAAEE,CAAC;AAAI,IAAAF,EAAE,SAAO;AAAA,EAAC;AAAC;AAAuoF,SAASO,EAAEP,MAAKE,GAAE;AAAC,QAAM,IAAEG,EAAE,GAAGH,CAAC;AAAE,IAAE,SAAO,KAAGF,EAAE,UAAU,IAAI,GAAG,CAAC;AAAC;AAAC,SAASQ,EAAER,MAAKE,GAAE;AAAC,QAAM,IAAEG,EAAE,GAAGH,CAAC;AAAE,IAAE,SAAO,KAAGF,EAAE,UAAU,OAAO,GAAG,CAAC;AAAC;AAA6tC,SAASS,EAAET,GAAEE,GAAE;AAAC,MAAI,IAAEF;AAAE,SAAW,KAAN,QAAS;AAAC,QAAG,aAAaE,EAAE,QAAO;AAAE,QAAE,EAAE,UAAW;AAAA,EAAA;AAAC,SAAO;AAAI;AAAC,SAASQ,EAAGV,GAAE;AAAC,QAAME,IAAES,EAAGX,GAAG,CAAAA,MAAGY,EAAEZ,CAAC,KAAG,CAACA,EAAE,SAAU,CAAA;AAAG,SAAOY,EAAEV,CAAC,KAAGD,EAAE,GAAED,EAAE,KAAK,GAAEE;AAAC;AAAM,MAACS,IAAG,CAACX,GAAEE,MAAI;AAAC,MAAI,IAAEF;AAAE,SAAK,MAAIa,EAAC,KAAU,KAAN,QAAS;AAAC,QAAGX,EAAE,CAAC,EAAE,QAAO;AAAE,QAAE,EAAE,UAAS;AAAA,EAAE;AAAC,SAAO;AAAI;AAA+vC,SAASY,EAAGd,GAAEE,GAAE;AAAC,SAAcF,MAAP,QAAU,OAAO,eAAeA,CAAC,EAAE,YAAY,SAAOE,EAAE;AAAI;","x_google_ignoreList":[0]}
@@ -0,0 +1,588 @@
1
+ import { jsx as A } from "react/jsx-runtime";
2
+ import { p as J, y, P as F, F as R, m as P, f as j, v as Z, o as nt, t as w, a as rt, L as k, I, b as N, _ as q, u as it } from "./Lexical.prod-zUeT_jIr.js";
3
+ import { U as Y, $ as G, L as st, Z as ot } from "./LexicalUtils.prod-DtRifALg.js";
4
+ import { useState as ct } from "react";
5
+ import { c as lt } from "./clsx-OuTLNxxd.js";
6
+ import { Icon as at } from "./components/Icon/Icon.js";
7
+ import { s as b } from "./RteEditor.module--4R0Ql6Y.js";
8
+ function ut(r) {
9
+ return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
10
+ }
11
+ var p = ut(function(r) {
12
+ const t = new URLSearchParams();
13
+ t.append("code", r);
14
+ for (let e = 1; e < arguments.length; e++) t.append("v", arguments[e]);
15
+ throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
16
+ });
17
+ function ht(r) {
18
+ let t = 1, e = r.getParent();
19
+ for (; e != null; ) {
20
+ if (h(e)) {
21
+ const n = e.getParent();
22
+ if (a(n)) {
23
+ t++, e = n.getParent();
24
+ continue;
25
+ }
26
+ p(40);
27
+ }
28
+ return t;
29
+ }
30
+ return t;
31
+ }
32
+ function O(r) {
33
+ let t = r.getParent();
34
+ a(t) || p(40);
35
+ let e = t;
36
+ for (; e !== null; ) e = e.getParent(), a(e) && (t = e);
37
+ return t;
38
+ }
39
+ function H(r) {
40
+ let t = [];
41
+ const e = r.getChildren().filter(h);
42
+ for (let n = 0; n < e.length; n++) {
43
+ const i = e[n], s = i.getFirstChild();
44
+ a(s) ? t = t.concat(H(s)) : t.push(i);
45
+ }
46
+ return t;
47
+ }
48
+ function m(r) {
49
+ return h(r) && a(r.getFirstChild());
50
+ }
51
+ function D(r) {
52
+ return f().append(r);
53
+ }
54
+ function Q(r, t) {
55
+ return h(r) && (t.length === 0 || t.length === 1 && r.is(t[0]) && r.getChildrenSize() === 0);
56
+ }
57
+ function B(r, t) {
58
+ r.update(() => {
59
+ const e = I();
60
+ if (e !== null) {
61
+ const n = e.getNodes();
62
+ if (P(e)) {
63
+ const s = e.getStartEndPoints();
64
+ s === null && p(143);
65
+ const [o] = s, c = o.getNode(), l = c.getParent();
66
+ if (Q(c, n)) {
67
+ const u = d(t);
68
+ if (N(l)) {
69
+ c.replace(u);
70
+ const g = f();
71
+ y(c) && (g.setFormat(c.getFormatType()), g.setIndent(c.getIndent())), u.append(g);
72
+ } else if (h(c)) {
73
+ const g = c.getParentOrThrow();
74
+ v(u, g.getChildren()), g.replace(u);
75
+ }
76
+ return;
77
+ }
78
+ }
79
+ const i = /* @__PURE__ */ new Set();
80
+ for (let s = 0; s < n.length; s++) {
81
+ const o = n[s];
82
+ if (!y(o) || !o.isEmpty() || h(o) || i.has(o.getKey())) {
83
+ if (q(o)) {
84
+ let c = o.getParent();
85
+ for (; c != null; ) {
86
+ const l = c.getKey();
87
+ if (a(c)) {
88
+ if (!i.has(l)) {
89
+ const u = d(t);
90
+ v(u, c.getChildren()), c.replace(u), i.add(l);
91
+ }
92
+ break;
93
+ }
94
+ {
95
+ const u = c.getParent();
96
+ if (N(u) && !i.has(l)) {
97
+ i.add(l), $(c, t);
98
+ break;
99
+ }
100
+ c = u;
101
+ }
102
+ }
103
+ }
104
+ } else $(o, t);
105
+ }
106
+ }
107
+ });
108
+ }
109
+ function v(r, t) {
110
+ r.splice(r.getChildrenSize(), 0, t);
111
+ }
112
+ function $(r, t) {
113
+ if (a(r)) return r;
114
+ const e = r.getPreviousSibling(), n = r.getNextSibling(), i = f();
115
+ if (i.setFormat(r.getFormatType()), i.setIndent(r.getIndent()), v(i, r.getChildren()), a(e) && t === e.getListType()) return e.append(i), r.remove(), a(n) && t === n.getListType() && (v(e, n.getChildren()), n.remove()), e;
116
+ if (a(n) && t === n.getListType()) return n.getFirstChildOrThrow().insertBefore(i), r.remove(), n;
117
+ {
118
+ const s = d(t);
119
+ return s.append(i), r.replace(s), s;
120
+ }
121
+ }
122
+ function E(r, t) {
123
+ const e = r.getLastChild(), n = t.getFirstChild();
124
+ e && n && m(e) && m(n) && (E(e.getFirstChild(), n.getFirstChild()), n.remove());
125
+ const i = t.getChildren();
126
+ i.length > 0 && r.append(...i), t.remove();
127
+ }
128
+ function gt(r) {
129
+ r.update(() => {
130
+ const t = I();
131
+ if (P(t)) {
132
+ const e = /* @__PURE__ */ new Set(), n = t.getNodes(), i = t.anchor.getNode();
133
+ if (Q(i, n)) e.add(O(i));
134
+ else for (let s = 0; s < n.length; s++) {
135
+ const o = n[s];
136
+ if (q(o)) {
137
+ const c = ot(o, C);
138
+ c != null && e.add(O(c));
139
+ }
140
+ }
141
+ for (const s of e) {
142
+ let o = s;
143
+ const c = H(s);
144
+ for (const l of c) {
145
+ const u = F();
146
+ v(u, l.getChildren()), o.insertAfter(u), o = u, l.__key === t.anchor.key && t.anchor.set(u.getKey(), 0, "element"), l.__key === t.focus.key && t.focus.set(u.getKey(), 0, "element"), l.remove();
147
+ }
148
+ s.remove();
149
+ }
150
+ }
151
+ });
152
+ }
153
+ function dt(r) {
154
+ const t = /* @__PURE__ */ new Set();
155
+ if (m(r) || t.has(r.getKey())) return;
156
+ const e = r.getParent(), n = r.getNextSibling(), i = r.getPreviousSibling();
157
+ if (m(n) && m(i)) {
158
+ const s = i.getFirstChild();
159
+ if (a(s)) {
160
+ s.append(r);
161
+ const o = n.getFirstChild();
162
+ a(o) && (v(s, o.getChildren()), n.remove(), t.add(n.getKey()));
163
+ }
164
+ } else if (m(n)) {
165
+ const s = n.getFirstChild();
166
+ if (a(s)) {
167
+ const o = s.getFirstChild();
168
+ o !== null && o.insertBefore(r);
169
+ }
170
+ } else if (m(i)) {
171
+ const s = i.getFirstChild();
172
+ a(s) && s.append(r);
173
+ } else if (a(e)) {
174
+ const s = f(), o = d(e.getListType());
175
+ s.append(o), o.append(r), i ? i.insertAfter(s) : n ? n.insertBefore(s) : e.append(s);
176
+ }
177
+ }
178
+ function ft(r) {
179
+ if (m(r)) return;
180
+ const t = r.getParent(), e = t ? t.getParent() : void 0;
181
+ if (a(e ? e.getParent() : void 0) && h(e) && a(t)) {
182
+ const n = t ? t.getFirstChild() : void 0, i = t ? t.getLastChild() : void 0;
183
+ if (r.is(n)) e.insertBefore(r), t.isEmpty() && e.remove();
184
+ else if (r.is(i)) e.insertAfter(r), t.isEmpty() && e.remove();
185
+ else {
186
+ const s = t.getListType(), o = f(), c = d(s);
187
+ o.append(c), r.getPreviousSiblings().forEach((g) => c.append(g));
188
+ const l = f(), u = d(s);
189
+ l.append(u), v(u, r.getNextSiblings()), e.insertBefore(o), e.insertAfter(l), e.replace(r);
190
+ }
191
+ }
192
+ }
193
+ function pt() {
194
+ const r = I();
195
+ if (!P(r) || !r.isCollapsed()) return !1;
196
+ const t = r.anchor.getNode();
197
+ if (!h(t) || t.getChildrenSize() !== 0) return !1;
198
+ const e = O(t), n = t.getParent();
199
+ a(n) || p(40);
200
+ const i = n.getParent();
201
+ let s;
202
+ if (N(i)) s = F(), e.insertAfter(s);
203
+ else {
204
+ if (!h(i)) return !1;
205
+ s = f(), i.insertAfter(s);
206
+ }
207
+ s.select();
208
+ const o = t.getNextSiblings();
209
+ if (o.length > 0) {
210
+ const c = d(n.getListType());
211
+ if (R(s)) s.insertAfter(c);
212
+ else {
213
+ const l = f();
214
+ l.append(c), s.insertAfter(l);
215
+ }
216
+ o.forEach((l) => {
217
+ l.remove(), c.append(l);
218
+ });
219
+ }
220
+ return function(c) {
221
+ let l = c;
222
+ for (; l.getNextSibling() == null && l.getPreviousSibling() == null; ) {
223
+ const u = l.getParent();
224
+ if (u == null || !h(l) && !a(l)) break;
225
+ l = u;
226
+ }
227
+ l.remove();
228
+ }(t), !0;
229
+ }
230
+ function T(...r) {
231
+ const t = [];
232
+ for (const e of r) if (e && typeof e == "string") for (const [n] of e.matchAll(/\S+/g)) t.push(n);
233
+ return t;
234
+ }
235
+ class C extends J {
236
+ static getType() {
237
+ return "listitem";
238
+ }
239
+ static clone(t) {
240
+ return new C(t.__value, t.__checked, t.__key);
241
+ }
242
+ constructor(t, e, n) {
243
+ super(n), this.__value = t === void 0 ? 1 : t, this.__checked = e;
244
+ }
245
+ createDOM(t) {
246
+ const e = document.createElement("li"), n = this.getParent();
247
+ return a(n) && n.getListType() === "check" && W(e, this, null), e.value = this.__value, K(e, t.theme, this), e;
248
+ }
249
+ updateDOM(t, e, n) {
250
+ const i = this.getParent();
251
+ return a(i) && i.getListType() === "check" && W(e, this, t), e.value = this.__value, K(e, n.theme, this), !1;
252
+ }
253
+ static transform() {
254
+ return (t) => {
255
+ if (h(t) || p(144), t.__checked == null) return;
256
+ const e = t.getParent();
257
+ a(e) && e.getListType() !== "check" && t.getChecked() != null && t.setChecked(void 0);
258
+ };
259
+ }
260
+ static importDOM() {
261
+ return { li: () => ({ conversion: mt, priority: 0 }) };
262
+ }
263
+ static importJSON(t) {
264
+ const e = f();
265
+ return e.setChecked(t.checked), e.setValue(t.value), e.setFormat(t.format), e.setDirection(t.direction), e;
266
+ }
267
+ exportDOM(t) {
268
+ const e = this.createDOM(t._config);
269
+ return e.style.textAlign = this.getFormatType(), { element: e };
270
+ }
271
+ exportJSON() {
272
+ return { ...super.exportJSON(), checked: this.getChecked(), type: "listitem", value: this.getValue(), version: 1 };
273
+ }
274
+ append(...t) {
275
+ for (let e = 0; e < t.length; e++) {
276
+ const n = t[e];
277
+ if (y(n) && this.canMergeWith(n)) {
278
+ const i = n.getChildren();
279
+ this.append(...i), n.remove();
280
+ } else super.append(n);
281
+ }
282
+ return this;
283
+ }
284
+ replace(t, e) {
285
+ if (h(t)) return super.replace(t);
286
+ this.setIndent(0);
287
+ const n = this.getParentOrThrow();
288
+ if (!a(n)) return t;
289
+ if (n.__first === this.getKey()) n.insertBefore(t);
290
+ else if (n.__last === this.getKey()) n.insertAfter(t);
291
+ else {
292
+ const i = d(n.getListType());
293
+ let s = this.getNextSibling();
294
+ for (; s; ) {
295
+ const o = s;
296
+ s = s.getNextSibling(), i.append(o);
297
+ }
298
+ n.insertAfter(t), t.insertAfter(i);
299
+ }
300
+ return e && (y(t) || p(139), this.getChildren().forEach((i) => {
301
+ t.append(i);
302
+ })), this.remove(), n.getChildrenSize() === 0 && n.remove(), t;
303
+ }
304
+ insertAfter(t, e = !0) {
305
+ const n = this.getParentOrThrow();
306
+ if (a(n) || p(39), h(t)) return super.insertAfter(t, e);
307
+ const i = this.getNextSiblings();
308
+ if (n.insertAfter(t, e), i.length !== 0) {
309
+ const s = d(n.getListType());
310
+ i.forEach((o) => s.append(o)), t.insertAfter(s, e);
311
+ }
312
+ return t;
313
+ }
314
+ remove(t) {
315
+ const e = this.getPreviousSibling(), n = this.getNextSibling();
316
+ super.remove(t), e && n && m(e) && m(n) && (E(e.getFirstChild(), n.getFirstChild()), n.remove());
317
+ }
318
+ insertNewAfter(t, e = !0) {
319
+ const n = f(this.__checked == null && void 0);
320
+ return this.insertAfter(n, e), n;
321
+ }
322
+ collapseAtStart(t) {
323
+ const e = F();
324
+ this.getChildren().forEach((o) => e.append(o));
325
+ const n = this.getParentOrThrow(), i = n.getParentOrThrow(), s = h(i);
326
+ if (n.getChildrenSize() === 1) if (s) n.remove(), i.select();
327
+ else {
328
+ n.insertBefore(e), n.remove();
329
+ const o = t.anchor, c = t.focus, l = e.getKey();
330
+ o.type === "element" && o.getNode().is(this) && o.set(l, o.offset, "element"), c.type === "element" && c.getNode().is(this) && c.set(l, c.offset, "element");
331
+ }
332
+ else n.insertBefore(e), this.remove();
333
+ return !0;
334
+ }
335
+ getValue() {
336
+ return this.getLatest().__value;
337
+ }
338
+ setValue(t) {
339
+ this.getWritable().__value = t;
340
+ }
341
+ getChecked() {
342
+ const t = this.getLatest();
343
+ let e;
344
+ const n = this.getParent();
345
+ return a(n) && (e = n.getListType()), e === "check" ? !!t.__checked : void 0;
346
+ }
347
+ setChecked(t) {
348
+ this.getWritable().__checked = t;
349
+ }
350
+ toggleChecked() {
351
+ this.setChecked(!this.__checked);
352
+ }
353
+ getIndent() {
354
+ const t = this.getParent();
355
+ if (t === null) return this.getLatest().__indent;
356
+ let e = t.getParentOrThrow(), n = 0;
357
+ for (; h(e); ) e = e.getParentOrThrow().getParentOrThrow(), n++;
358
+ return n;
359
+ }
360
+ setIndent(t) {
361
+ typeof t != "number" && p(117), (t = Math.floor(t)) >= 0 || p(199);
362
+ let e = this.getIndent();
363
+ for (; e !== t; ) e < t ? (dt(this), e++) : (ft(this), e--);
364
+ return this;
365
+ }
366
+ canInsertAfter(t) {
367
+ return h(t);
368
+ }
369
+ canReplaceWith(t) {
370
+ return h(t);
371
+ }
372
+ canMergeWith(t) {
373
+ return R(t) || h(t);
374
+ }
375
+ extractWithChild(t, e) {
376
+ if (!P(e)) return !1;
377
+ const n = e.anchor.getNode(), i = e.focus.getNode();
378
+ return this.isParentOf(n) && this.isParentOf(i) && this.getTextContent().length === e.getTextContent().length;
379
+ }
380
+ isParentRequired() {
381
+ return !0;
382
+ }
383
+ createParentElementNode() {
384
+ return d("bullet");
385
+ }
386
+ canMergeWhenEmpty() {
387
+ return !0;
388
+ }
389
+ }
390
+ function K(r, t, e) {
391
+ const n = [], i = [], s = t.list, o = s ? s.listitem : void 0;
392
+ let c;
393
+ if (s && s.nested && (c = s.nested.listitem), o !== void 0 && n.push(...T(o)), s) {
394
+ const l = e.getParent(), u = a(l) && l.getListType() === "check", g = e.getChecked();
395
+ u && !g || i.push(s.listitemUnchecked), u && g || i.push(s.listitemChecked), u && n.push(g ? s.listitemChecked : s.listitemUnchecked);
396
+ }
397
+ if (c !== void 0) {
398
+ const l = T(c);
399
+ e.getChildren().some((u) => a(u)) ? n.push(...l) : i.push(...l);
400
+ }
401
+ i.length > 0 && Y(r, ...i), n.length > 0 && G(r, ...n);
402
+ }
403
+ function W(r, t, e, n) {
404
+ a(t.getFirstChild()) ? (r.removeAttribute("role"), r.removeAttribute("tabIndex"), r.removeAttribute("aria-checked")) : (r.setAttribute("role", "checkbox"), r.setAttribute("tabIndex", "-1"), e && t.__checked === e.__checked || r.setAttribute("aria-checked", t.getChecked() ? "true" : "false"));
405
+ }
406
+ function mt(r) {
407
+ if (r.classList.contains("task-list-item")) {
408
+ for (const e of r.children) if (e.tagName === "INPUT") return _t(e);
409
+ }
410
+ const t = r.getAttribute("aria-checked");
411
+ return { node: f(t === "true" || t !== "false" && void 0) };
412
+ }
413
+ function _t(r) {
414
+ return r.getAttribute("type") !== "checkbox" ? { node: null } : { node: f(r.hasAttribute("checked")) };
415
+ }
416
+ function f(r) {
417
+ return j(new C(void 0, r));
418
+ }
419
+ function h(r) {
420
+ return r instanceof C;
421
+ }
422
+ class L extends J {
423
+ static getType() {
424
+ return "list";
425
+ }
426
+ static clone(t) {
427
+ const e = t.__listType || V[t.__tag];
428
+ return new L(e, t.__start, t.__key);
429
+ }
430
+ constructor(t, e, n) {
431
+ super(n);
432
+ const i = V[t] || t;
433
+ this.__listType = i, this.__tag = i === "number" ? "ol" : "ul", this.__start = e;
434
+ }
435
+ getTag() {
436
+ return this.__tag;
437
+ }
438
+ setListType(t) {
439
+ const e = this.getWritable();
440
+ e.__listType = t, e.__tag = t === "number" ? "ol" : "ul";
441
+ }
442
+ getListType() {
443
+ return this.__listType;
444
+ }
445
+ getStart() {
446
+ return this.__start;
447
+ }
448
+ createDOM(t, e) {
449
+ const n = this.__tag, i = document.createElement(n);
450
+ return this.__start !== 1 && i.setAttribute("start", String(this.__start)), i.__lexicalListType = this.__listType, U(i, t.theme, this), i;
451
+ }
452
+ updateDOM(t, e, n) {
453
+ return t.__tag !== this.__tag || (U(e, n.theme, this), !1);
454
+ }
455
+ static transform() {
456
+ return (t) => {
457
+ a(t) || p(163), function(e) {
458
+ const n = e.getNextSibling();
459
+ a(n) && e.getListType() === n.getListType() && E(e, n);
460
+ }(t), function(e) {
461
+ const n = e.getListType() !== "check";
462
+ let i = e.getStart();
463
+ for (const s of e.getChildren()) h(s) && (s.getValue() !== i && s.setValue(i), n && s.getLatest().__checked != null && s.setChecked(void 0), a(s.getFirstChild()) || i++);
464
+ }(t);
465
+ };
466
+ }
467
+ static importDOM() {
468
+ return { ol: () => ({ conversion: z, priority: 0 }), ul: () => ({ conversion: z, priority: 0 }) };
469
+ }
470
+ static importJSON(t) {
471
+ const e = d(t.listType, t.start);
472
+ return e.setFormat(t.format), e.setIndent(t.indent), e.setDirection(t.direction), e;
473
+ }
474
+ exportDOM(t) {
475
+ const { element: e } = super.exportDOM(t);
476
+ return e && Z(e) && (this.__start !== 1 && e.setAttribute("start", String(this.__start)), this.__listType === "check" && e.setAttribute("__lexicalListType", "check")), { element: e };
477
+ }
478
+ exportJSON() {
479
+ return { ...super.exportJSON(), listType: this.getListType(), start: this.getStart(), tag: this.getTag(), type: "list", version: 1 };
480
+ }
481
+ canBeEmpty() {
482
+ return !1;
483
+ }
484
+ canIndent() {
485
+ return !1;
486
+ }
487
+ append(...t) {
488
+ for (let e = 0; e < t.length; e++) {
489
+ const n = t[e];
490
+ if (h(n)) super.append(n);
491
+ else {
492
+ const i = f();
493
+ if (a(n)) i.append(n);
494
+ else if (y(n)) {
495
+ const s = nt(n.getTextContent());
496
+ i.append(s);
497
+ } else i.append(n);
498
+ super.append(i);
499
+ }
500
+ }
501
+ return this;
502
+ }
503
+ extractWithChild(t) {
504
+ return h(t);
505
+ }
506
+ }
507
+ function U(r, t, e) {
508
+ const n = [], i = [], s = t.list;
509
+ if (s !== void 0) {
510
+ const o = s[`${e.__tag}Depth`] || [], c = ht(e) - 1, l = c % o.length, u = o[l], g = s[e.__tag];
511
+ let S;
512
+ const x = s.nested, M = s.checklist;
513
+ if (x !== void 0 && x.list && (S = x.list), g !== void 0 && n.push(g), M !== void 0 && e.__listType === "check" && n.push(M), u !== void 0) {
514
+ n.push(...T(u));
515
+ for (let _ = 0; _ < o.length; _++) _ !== l && i.push(e.__tag + _);
516
+ }
517
+ if (S !== void 0) {
518
+ const _ = T(S);
519
+ c > 1 ? n.push(..._) : i.push(..._);
520
+ }
521
+ }
522
+ i.length > 0 && Y(r, ...i), n.length > 0 && G(r, ...n);
523
+ }
524
+ function vt(r) {
525
+ const t = [];
526
+ for (let e = 0; e < r.length; e++) {
527
+ const n = r[e];
528
+ if (h(n)) {
529
+ t.push(n);
530
+ const i = n.getChildren();
531
+ i.length > 1 && i.forEach((s) => {
532
+ a(s) && t.push(D(s));
533
+ });
534
+ } else t.push(D(n));
535
+ }
536
+ return t;
537
+ }
538
+ function z(r) {
539
+ const t = r.nodeName.toLowerCase();
540
+ let e = null;
541
+ return t === "ol" ? e = d("number", r.start) : t === "ul" && (e = function(n) {
542
+ if (n.getAttribute("__lexicallisttype") === "check" || n.classList.contains("contains-task-list")) return !0;
543
+ for (const i of n.childNodes) if (Z(i) && i.hasAttribute("aria-checked")) return !0;
544
+ return !1;
545
+ }(r) ? d("check") : d("bullet")), { after: vt, node: e };
546
+ }
547
+ const V = { ol: "number", ul: "bullet" };
548
+ function d(r, t = 1) {
549
+ return j(new L(r, t));
550
+ }
551
+ function a(r) {
552
+ return r instanceof L;
553
+ }
554
+ const X = w(), tt = w(), et = w();
555
+ function At(r) {
556
+ return st(r.registerCommand(tt, () => (B(r, "number"), !0), k), r.registerCommand(X, () => (B(r, "bullet"), !0), k), r.registerCommand(et, () => (gt(r), !0), k), r.registerCommand(rt, () => !!pt(), k));
557
+ }
558
+ const bt = {
559
+ bullet: "FormatUnorderedList",
560
+ number: "FormatOrderedLists"
561
+ }, yt = ["bullet", "number"], Nt = ({ isOList: r = !1, isUList: t = !1 }) => {
562
+ const [e] = it(), [n, i] = ct("paragraph"), s = (o) => {
563
+ o === "number" && n !== "number" ? (e.dispatchCommand(tt, void 0), i("number")) : o === "bullet" && n !== "bullet" ? (e.dispatchCommand(X, void 0), i("bullet")) : (e.dispatchCommand(et, void 0), i("paragraph"));
564
+ };
565
+ return /* @__PURE__ */ A("div", { className: b["editor__toolbar-button-group"], children: yt.map((o) => /* @__PURE__ */ A(
566
+ "button",
567
+ {
568
+ onClick: () => s(o),
569
+ className: lt(
570
+ b["editor__toolbar-button"],
571
+ b[`editor__toolbar-button--${o}`],
572
+ o === "bullet" && t && b["editor__toolbar-button--active"],
573
+ o === "number" && r && b["editor__toolbar-button--active"]
574
+ ),
575
+ "aria-label": `Format ${o}`,
576
+ children: /* @__PURE__ */ A(at, { name: bt[o], size: 20 })
577
+ },
578
+ o
579
+ )) });
580
+ };
581
+ export {
582
+ C as D,
583
+ a as H,
584
+ L as J,
585
+ Nt as L,
586
+ At as Z
587
+ };
588
+ //# sourceMappingURL=ListPlugin-CxyYg2bv.js.map