@uva-glass/component-library 1.64.6 → 1.64.7
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.
- package/dist/{Lexical.prod-CFhL_6Md.js → Lexical.prod-DeeCy7Xd.js} +260 -255
- package/dist/Lexical.prod-DeeCy7Xd.js.map +1 -0
- package/dist/{LexicalClipboard.prod-BsGZ_U-F.js → LexicalClipboard.prod-CayrMfkI.js} +26 -26
- package/dist/LexicalClipboard.prod-CayrMfkI.js.map +1 -0
- package/dist/{LexicalLink.prod-DOD0hvjh.js → LexicalLink.prod-Biaqry-c.js} +5 -5
- package/dist/{LexicalLink.prod-DOD0hvjh.js.map → LexicalLink.prod-Biaqry-c.js.map} +1 -1
- package/dist/{LexicalList.prod-C66L7HSr.js → LexicalList.prod-Uk8UObU7.js} +17 -17
- package/dist/{LexicalList.prod-C66L7HSr.js.map → LexicalList.prod-Uk8UObU7.js.map} +1 -1
- package/dist/{LexicalSelection.prod-mI1PjnKs.js → LexicalSelection.prod-C1TEIGhq.js} +4 -4
- package/dist/{LexicalSelection.prod-mI1PjnKs.js.map → LexicalSelection.prod-C1TEIGhq.js.map} +1 -1
- package/dist/{LexicalTable.prod-Dg8eGg1m.js → LexicalTable.prod-hx6rW3fc.js} +85 -85
- package/dist/{LexicalTable.prod-Dg8eGg1m.js.map → LexicalTable.prod-hx6rW3fc.js.map} +1 -1
- package/dist/{LexicalUtils.prod-0Sd05E-o.js → LexicalUtils.prod-CCjlRAc-.js} +10 -10
- package/dist/{LexicalUtils.prod-0Sd05E-o.js.map → LexicalUtils.prod-CCjlRAc-.js.map} +1 -1
- package/dist/{TablePlugin-ChuaCSFq.js → TablePlugin-BbiBRjod.js} +4 -4
- package/dist/{TablePlugin-ChuaCSFq.js.map → TablePlugin-BbiBRjod.js.map} +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +9 -9
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +21 -21
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +6 -6
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +10 -10
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +3 -3
- package/dist/components/RteEditor/Plugins/index.js +1 -1
- package/dist/components/RteEditor/RteEditor.js +94 -94
- package/dist/components/RteEditor/helpers.js +8 -8
- package/dist/components/index.js +1 -1
- package/dist/{helpers-CnEW_8nD.js → helpers-CgzuKnuq.js} +7 -7
- package/dist/{helpers-CnEW_8nD.js.map → helpers-CgzuKnuq.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/dist/Lexical.prod-CFhL_6Md.js.map +0 -1
- package/dist/LexicalClipboard.prod-BsGZ_U-F.js.map +0 -1
package/dist/{LexicalSelection.prod-mI1PjnKs.js.map → LexicalSelection.prod-C1TEIGhq.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LexicalSelection.prod-mI1PjnKs.js","sources":["../node_modules/@lexical/selection/LexicalSelection.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{$isTextNode as e,$getCharacterOffsets as t,$isElementNode as n,$isRootNode as l,$getNodeByKey as o,$getPreviousSelection as r,$createTextNode as s,$isRangeSelection as i,$isTokenOrSegmented as c,$getRoot as f,$isRootOrShadowRoot as u,$hasAncestor as g,$isLeafNode as a,$setSelection as d,$getAdjacentNode as p,$isDecoratorNode as h,$isLineBreakNode as y}from\"lexical\";export{$cloneWithProperties}from\"lexical\";function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var T=m((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 x=new Map;function S(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function v(e){const t=e.parentNode;if(null==t)throw new Error(\"Should never happen\");return[t,Array.from(t.childNodes).indexOf(e)]}function C(t,n,l,o,r){const s=n.getKey(),i=o.getKey(),c=document.createRange();let f=t.getElementByKey(s),u=t.getElementByKey(i),g=l,a=r;if(e(n)&&(f=S(f)),e(o)&&(u=S(u)),void 0===n||void 0===o||null===f||null===u)return null;\"BR\"===f.nodeName&&([f,g]=v(f)),\"BR\"===u.nodeName&&([u,a]=v(u));const d=f.firstChild;f===u&&null!=d&&\"BR\"===d.nodeName&&0===g&&0===a&&(a=1);try{c.setStart(f,g),c.setEnd(u,a)}catch(e){return null}return!c.collapsed||g===a&&s===i||(c.setStart(u,a),c.setEnd(f,g)),c}function P(e,t){const n=e.getRootElement();if(null===n)return[];const l=n.getBoundingClientRect(),o=getComputedStyle(n),r=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=Array.from(t.getClientRects());let i,c=s.length;s.sort(((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n}));for(let e=0;e<c;e++){const t=s[e],n=i&&i.top<=t.top&&i.top+i.height>t.top&&i.left+i.width>t.left,o=t.width+r===l.width;n||o?(s.splice(e--,1),c--):i=t}return s}function w(e){const t={};if(!e)return t;const n=e.split(\";\");for(const e of n)if(\"\"!==e){const[n,l]=e.split(/:([^]+)/);n&&l&&(t[n.trim()]=l.trim())}return t}function N(e){let t=x.get(e);return void 0===t&&(t=w(e),x.set(e,t)),t}function E(e){let t=\"\";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}function F(e,n){const l=e.getStartEndPoints();if(n.isSelected(e)&&!n.isSegmented()&&!n.isToken()&&null!==l){const[o,r]=l,s=e.isBackward(),i=o.getNode(),c=r.getNode(),f=n.is(i),u=n.is(c);if(f||u){const[l,o]=t(e),r=i.is(c),f=n.is(s?c:i),u=n.is(s?i:c);let g,a=0;if(r)a=l>o?o:l,g=l>o?l:o;else if(f){a=s?o:l,g=void 0}else if(u){a=0,g=s?l:o}return n.__text=n.__text.slice(a,g),n}}return n}function K(e){if(\"text\"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return n(t)||T(177),e.offset===t.getChildrenSize()}function I(t,c,f){let u=c.getNode(),g=f;if(n(u)){const e=u.getDescendantByIndex(c.offset);null!==e&&(u=e)}for(;g>0&&null!==u;){if(n(u)){const e=u.getLastDescendant();null!==e&&(u=e)}let f=u.getPreviousSibling(),a=0;if(null===f){let e=u.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){f=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,f=t)}let d=u.getTextContent();\"\"===d&&n(u)&&!u.isInline()&&(d=\"\\n\\n\");const p=d.length;if(!e(u)||g>=p){const e=u.getParent();u.remove(),null==e||0!==e.getChildrenSize()||l(e)||e.remove(),g-=p+a,u=f}else{const n=u.getKey(),l=t.getEditorState().read((()=>{const t=o(n);return e(t)&&t.isSimpleText()?t.getTextContent():null})),f=p-g,a=d.slice(0,f);if(null!==l&&l!==d){const e=r();let t=u;if(u.isSimpleText())u.setTextContent(l);else{const e=s(l);u.replace(e),t=e}if(i(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(u.isSimpleText()){const e=c.key===n;let t=c.offset;t<g&&(t=p);const l=e?t-g:0,o=e?t:f;if(e&&0===l){const[e]=u.splitText(l,o);e.remove()}else{const[,e]=u.splitText(l,o);e.remove()}}else{const e=s(a);u.replace(e)}g=0}}}function O(e){const t=e.getStyle(),n=w(t);x.set(t,n)}function B(e,t){const n=N(\"getStyle\"in e?e.getStyle():e.style),l=Object.entries(t).reduce(((t,[l,o])=>(\"function\"==typeof o?t[l]=o(n[l],e):null===o?delete t[l]:t[l]=o,t)),{...n}||{}),o=E(l);e.setStyle(o),x.set(o,l)}function k(t,n){const l=t.getNodes(),o=l.length,r=t.getStartEndPoints();if(null===r)return;const[s,f]=r,u=o-1;let g=l[0],a=l[u];if(t.isCollapsed()&&i(t))return void B(t,n);const d=g.getTextContent().length,p=f.offset;let h=s.offset;const y=s.isBefore(f);let m=y?h:p,T=y?p:h;const x=y?s.type:f.type,S=y?f.type:s.type,v=y?f.key:s.key;if(e(g)&&m===d){const t=g.getNextSibling();e(t)&&(h=0,m=0,g=t)}if(1===l.length){if(e(g)&&g.canHaveFormat()){if(m=\"element\"===x?0:h>p?p:h,T=\"element\"===S?d:h>p?h:p,m===T)return;if(c(g)||0===m&&T===d)B(g,n),g.select(m,T);else{const e=g.splitText(m,T),t=0===m?e[0]:e[1];B(t,n),t.select(0,T-m)}}}else{if(e(g)&&m<g.getTextContentSize()&&g.canHaveFormat()&&(0===m||c(g)||(g=g.splitText(m)[1],m=0,y?s.set(g.getKey(),m,\"text\"):f.set(g.getKey(),m,\"text\")),B(g,n)),e(a)&&a.canHaveFormat()){const e=a.getTextContent().length;a.__key!==v&&0!==T&&(T=e),T===e||c(a)||([a]=a.splitText(T)),0===T&&\"element\"!==S||B(a,n)}for(let t=1;t<u;t++){const o=l[t],r=o.getKey();e(o)&&o.canHaveFormat()&&r!==g.getKey()&&r!==a.getKey()&&!o.isToken()&&B(o,n)}}}function b(e,t){if(null===e)return;const l=e.getStartEndPoints(),o=l?l[0]:null;if(null!==o&&\"root\"===o.key){const e=t(),n=f(),l=n.getFirstChild();return void(l?l.replace(e,!0):n.append(e))}const r=e.getNodes(),s=null!==o&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(o.getNode(),W);s&&-1===r.indexOf(s)&&r.push(s);for(let e=0;e<r.length;e++){const l=r[e];if(!W(l))continue;n(l)||T(178);const o=t();o.setFormat(l.getFormatType()),o.setIndent(l.getIndent()),l.replace(o,!0)}}function R(e){return e.getNode().isAttached()}function _(e){let t=e;for(;null!==t&&!u(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function z(e,t,n=null){const l=e.getStartEndPoints(),o=l?l[0]:null,r=e.getNodes(),s=r.length;if(null!==o&&(0===s||1===s&&\"element\"===o.type&&0===o.getNode().getChildrenSize())){const e=\"text\"===o.type?o.getNode().getParentOrThrow():o.getNode(),l=e.getChildren();let r=t();return r.setFormat(e.getFormatType()),r.setIndent(e.getIndent()),l.forEach((e=>r.append(e))),n&&(r=n.append(r)),void e.replace(r)}let i=null,c=[];for(let l=0;l<s;l++){const o=r[l];u(o)?(A(e,c,c.length,t,n),c=[],i=o):null===i||null!==i&&g(o,i)?c.push(o):(A(e,c,c.length,t,n),c=[o])}A(e,c,c.length,t,n)}function A(e,t,l,o,s=null){if(0===t.length)return;const c=t[0],f=new Map,g=[];let p=n(c)?c:c.getParentOrThrow();p.isInline()&&(p=p.getParentOrThrow());let h=!1;for(;null!==p;){const e=p.getPreviousSibling();if(null!==e){p=e,h=!0;break}if(p=p.getParentOrThrow(),u(p))break}const y=new Set;for(let e=0;e<l;e++){const l=t[e];n(l)&&0===l.getChildrenSize()&&y.add(l.getKey())}const m=new Set;for(let e=0;e<l;e++){const l=t[e];let r=l.getParent();if(null!==r&&r.isInline()&&(r=r.getParent()),null!==r&&a(l)&&!m.has(l.getKey())){const e=r.getKey();if(void 0===f.get(e)){const t=o();t.setFormat(r.getFormatType()),t.setIndent(r.getIndent()),g.push(t),f.set(e,t),r.getChildren().forEach((e=>{t.append(e),m.add(e.getKey()),n(e)&&e.getChildrenKeys().forEach((e=>m.add(e)))})),_(r)}}else if(y.has(l.getKey())){n(l)||T(179);const e=o();e.setFormat(l.getFormatType()),e.setIndent(l.getIndent()),g.push(e),l.remove(!0)}}if(null!==s)for(let e=0;e<g.length;e++){const t=g[e];s.append(t)}let x=null;if(u(p))if(h)if(null!==s)p.insertAfter(s);else for(let e=g.length-1;e>=0;e--){const t=g[e];p.insertAfter(t)}else{const e=p.getFirstChild();if(n(e)&&(p=e),null===e)if(s)p.append(s);else for(let e=0;e<g.length;e++){const t=g[e];p.append(t),x=t}else if(null!==s)e.insertBefore(s);else for(let t=0;t<g.length;t++){const n=g[t];e.insertBefore(n),x=n}}else if(s)p.insertAfter(s);else for(let e=g.length-1;e>=0;e--){const t=g[e];p.insertAfter(t),x=t}const S=r();i(S)&&R(S.anchor)&&R(S.focus)?d(S.clone()):null!==x?x.selectEnd():e.dirty=!0}function L(e,t){const l=p(e.focus,t);return h(l)&&!l.isIsolated()||n(l)&&!l.isInline()&&!l.canBeEmpty()}function D(e,t,n,l){e.modify(t?\"extend\":\"move\",n,l)}function M(e){const t=e.anchor.getNode();return\"rtl\"===(l(t)?t:t.getParentOrThrow()).getDirection()}function $(e,t,n){const l=M(e);D(e,t,n?!l:l,\"character\")}function H(t){const l=t.anchor,o=t.focus,r=l.getNode().getTopLevelElementOrThrow().getParentOrThrow();let s=r.getFirstDescendant(),i=r.getLastDescendant(),c=\"element\",f=\"element\",u=0;e(s)?c=\"text\":n(s)||null===s||(s=s.getParentOrThrow()),e(i)?(f=\"text\",u=i.getTextContentSize()):n(i)||null===i||(i=i.getParentOrThrow()),s&&i&&(l.set(s.getKey(),0,c),o.set(i.getKey(),u,f))}function j(e,t,n){const l=N(e.getStyle());return null!==l&&l[t]||n}function U(t,n,l=\"\"){let o=null;const r=t.getNodes(),s=t.anchor,c=t.focus,f=t.isBackward(),u=f?c.offset:s.offset,g=f?c.getNode():s.getNode();if(i(t)&&t.isCollapsed()&&\"\"!==t.style){const e=N(t.style);if(null!==e&&n in e)return e[n]}for(let t=0;t<r.length;t++){const s=r[t];if((0===t||0!==u||!s.is(g))&&e(s)){const e=j(s,n,l);if(null===o)o=e;else if(o!==e){o=\"\";break}}}return null===o?l:o}function W(t){if(h(t))return!1;if(!n(t)||u(t))return!1;const l=t.getFirstChild(),o=null===l||y(l)||e(l)||l.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&o}const X=I;export{O as $addNodeStyle,U as $getSelectionStyleValueForProperty,K as $isAtNodeEnd,M as $isParentElementRTL,D as $moveCaretSelection,$ as $moveCharacter,k as $patchStyleText,H as $selectAll,b as $setBlocksType,L as $shouldOverrideDefaultCharacterSelection,F as $sliceSelectedTextNodeContent,I as $trimTextContentFromAnchor,z as $wrapNodes,C as createDOMRange,P as createRectsFromDOMRange,E as getCSSFromStyleObject,N as getStyleObjectFromCSS,X as trimTextContentFromAnchor};\n"],"names":["m","e","T","x","w","n","F","l","o","r","s","i","c","f","u","t","g","a","O","b","W","L","p","h","D","M","$","y"],"mappings":";AAQia,SAASA,EAAEC,GAAE;AAAC,SAAOA,KAAGA,EAAE,cAAY,OAAO,UAAU,eA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ASF,IAAAA,EAAEE,CAAC,KAAGL,EAAE,GAAG;AAAE,UAAM,IAAE,EAAG;AAAC,MAAE,UAAUK,EAAE,cAAe,CAAA,GAAE,EAAE,UAAUA,EAAE,UAAS,CAAE,GAAEA,EAAE,QAAQ,GAAE,EAAE;AAAA,EAAC;AAAC;AAAmtE,SAASc,EAAEpB,GAAE,GAAE;AAAC,QAAMM,IAAEe,EAAErB,EAAE,OAAM,CAAC;AAAE,SAAOsB,EAAEhB,CAAC,KAAG,CAACA,EAAE,WAAU,KAAIF,EAAEE,CAAC,KAAG,CAACA,EAAE,SAAQ,KAAI,CAACA,EAAE,WAAU;AAAE;AAAC,SAASiB,EAAEvB,GAAE,GAAEI,GAAEE,GAAE;AAAC,EAAAN,EAAE,OAAO,IAAE,WAAS,QAAOI,GAAEE,CAAC;AAAC;AAAC,SAASkB,EAAExB,GAAE;AAAC,QAAM,IAAEA,EAAE,OAAO,QAAO;AAAG,UAAeM,EAAE,CAAC,IAAE,IAAE,EAAE,iBAAkB,GAAE,aAAc,MAApD;AAAoD;AAAC,SAASmB,EAAEzB,GAAE,GAAEI,GAAE;AAAC,QAAME,IAAEkB,EAAExB,CAAC;AAAE,EAAAuB,EAAEvB,GAAE,GAAEI,IAAE,CAACE,IAAEA,GAAE,WAAW;AAAC;AAA6zB,SAASa,EAAEL,GAAE;AAAkB,MAAdQ,EAAER,CAAC,KAAc,CAACV,EAAEU,CAAC,KAAGD,EAAEC,CAAC,EAAE,QAAM;AAAG,QAAMR,IAAEQ,EAAE,cAAa,GAAGP,IAASD,MAAP,QAAUoB,EAAEpB,CAAC,KAAGN,EAAEM,CAAC,KAAGA,EAAE,SAAU;AAAC,SAAM,CAACQ,EAAE,SAAU,KAAOA,EAAE,WAAY,MAAnB,MAAqBP;AAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"LexicalSelection.prod-C1TEIGhq.js","sources":["../node_modules/@lexical/selection/LexicalSelection.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{$isTextNode as e,$getCharacterOffsets as t,$isElementNode as n,$isRootNode as l,$getNodeByKey as o,$getPreviousSelection as r,$createTextNode as s,$isRangeSelection as i,$isTokenOrSegmented as c,$getRoot as f,$isRootOrShadowRoot as u,$hasAncestor as g,$isLeafNode as a,$setSelection as d,$getAdjacentNode as p,$isDecoratorNode as h,$isLineBreakNode as y}from\"lexical\";export{$cloneWithProperties}from\"lexical\";function m(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,\"default\")?e.default:e}var T=m((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 x=new Map;function S(e){let t=e;for(;null!=t;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function v(e){const t=e.parentNode;if(null==t)throw new Error(\"Should never happen\");return[t,Array.from(t.childNodes).indexOf(e)]}function C(t,n,l,o,r){const s=n.getKey(),i=o.getKey(),c=document.createRange();let f=t.getElementByKey(s),u=t.getElementByKey(i),g=l,a=r;if(e(n)&&(f=S(f)),e(o)&&(u=S(u)),void 0===n||void 0===o||null===f||null===u)return null;\"BR\"===f.nodeName&&([f,g]=v(f)),\"BR\"===u.nodeName&&([u,a]=v(u));const d=f.firstChild;f===u&&null!=d&&\"BR\"===d.nodeName&&0===g&&0===a&&(a=1);try{c.setStart(f,g),c.setEnd(u,a)}catch(e){return null}return!c.collapsed||g===a&&s===i||(c.setStart(u,a),c.setEnd(f,g)),c}function P(e,t){const n=e.getRootElement();if(null===n)return[];const l=n.getBoundingClientRect(),o=getComputedStyle(n),r=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=Array.from(t.getClientRects());let i,c=s.length;s.sort(((e,t)=>{const n=e.top-t.top;return Math.abs(n)<=3?e.left-t.left:n}));for(let e=0;e<c;e++){const t=s[e],n=i&&i.top<=t.top&&i.top+i.height>t.top&&i.left+i.width>t.left,o=t.width+r===l.width;n||o?(s.splice(e--,1),c--):i=t}return s}function w(e){const t={};if(!e)return t;const n=e.split(\";\");for(const e of n)if(\"\"!==e){const[n,l]=e.split(/:([^]+)/);n&&l&&(t[n.trim()]=l.trim())}return t}function N(e){let t=x.get(e);return void 0===t&&(t=w(e),x.set(e,t)),t}function E(e){let t=\"\";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}function F(e,n){const l=e.getStartEndPoints();if(n.isSelected(e)&&!n.isSegmented()&&!n.isToken()&&null!==l){const[o,r]=l,s=e.isBackward(),i=o.getNode(),c=r.getNode(),f=n.is(i),u=n.is(c);if(f||u){const[l,o]=t(e),r=i.is(c),f=n.is(s?c:i),u=n.is(s?i:c);let g,a=0;if(r)a=l>o?o:l,g=l>o?l:o;else if(f){a=s?o:l,g=void 0}else if(u){a=0,g=s?l:o}return n.__text=n.__text.slice(a,g),n}}return n}function K(e){if(\"text\"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return n(t)||T(177),e.offset===t.getChildrenSize()}function I(t,c,f){let u=c.getNode(),g=f;if(n(u)){const e=u.getDescendantByIndex(c.offset);null!==e&&(u=e)}for(;g>0&&null!==u;){if(n(u)){const e=u.getLastDescendant();null!==e&&(u=e)}let f=u.getPreviousSibling(),a=0;if(null===f){let e=u.getParentOrThrow(),t=e.getPreviousSibling();for(;null===t;){if(e=e.getParent(),null===e){f=null;break}t=e.getPreviousSibling()}null!==e&&(a=e.isInline()?0:2,f=t)}let d=u.getTextContent();\"\"===d&&n(u)&&!u.isInline()&&(d=\"\\n\\n\");const p=d.length;if(!e(u)||g>=p){const e=u.getParent();u.remove(),null==e||0!==e.getChildrenSize()||l(e)||e.remove(),g-=p+a,u=f}else{const n=u.getKey(),l=t.getEditorState().read((()=>{const t=o(n);return e(t)&&t.isSimpleText()?t.getTextContent():null})),f=p-g,a=d.slice(0,f);if(null!==l&&l!==d){const e=r();let t=u;if(u.isSimpleText())u.setTextContent(l);else{const e=s(l);u.replace(e),t=e}if(i(e)&&e.isCollapsed()){const n=e.anchor.offset;t.select(n,n)}}else if(u.isSimpleText()){const e=c.key===n;let t=c.offset;t<g&&(t=p);const l=e?t-g:0,o=e?t:f;if(e&&0===l){const[e]=u.splitText(l,o);e.remove()}else{const[,e]=u.splitText(l,o);e.remove()}}else{const e=s(a);u.replace(e)}g=0}}}function O(e){const t=e.getStyle(),n=w(t);x.set(t,n)}function B(e,t){const n=N(\"getStyle\"in e?e.getStyle():e.style),l=Object.entries(t).reduce(((t,[l,o])=>(\"function\"==typeof o?t[l]=o(n[l],e):null===o?delete t[l]:t[l]=o,t)),{...n}||{}),o=E(l);e.setStyle(o),x.set(o,l)}function k(t,n){const l=t.getNodes(),o=l.length,r=t.getStartEndPoints();if(null===r)return;const[s,f]=r,u=o-1;let g=l[0],a=l[u];if(t.isCollapsed()&&i(t))return void B(t,n);const d=g.getTextContent().length,p=f.offset;let h=s.offset;const y=s.isBefore(f);let m=y?h:p,T=y?p:h;const x=y?s.type:f.type,S=y?f.type:s.type,v=y?f.key:s.key;if(e(g)&&m===d){const t=g.getNextSibling();e(t)&&(h=0,m=0,g=t)}if(1===l.length){if(e(g)&&g.canHaveFormat()){if(m=\"element\"===x?0:h>p?p:h,T=\"element\"===S?d:h>p?h:p,m===T)return;if(c(g)||0===m&&T===d)B(g,n),g.select(m,T);else{const e=g.splitText(m,T),t=0===m?e[0]:e[1];B(t,n),t.select(0,T-m)}}}else{if(e(g)&&m<g.getTextContentSize()&&g.canHaveFormat()&&(0===m||c(g)||(g=g.splitText(m)[1],m=0,y?s.set(g.getKey(),m,\"text\"):f.set(g.getKey(),m,\"text\")),B(g,n)),e(a)&&a.canHaveFormat()){const e=a.getTextContent().length;a.__key!==v&&0!==T&&(T=e),T===e||c(a)||([a]=a.splitText(T)),0===T&&\"element\"!==S||B(a,n)}for(let t=1;t<u;t++){const o=l[t],r=o.getKey();e(o)&&o.canHaveFormat()&&r!==g.getKey()&&r!==a.getKey()&&!o.isToken()&&B(o,n)}}}function b(e,t){if(null===e)return;const l=e.getStartEndPoints(),o=l?l[0]:null;if(null!==o&&\"root\"===o.key){const e=t(),n=f(),l=n.getFirstChild();return void(l?l.replace(e,!0):n.append(e))}const r=e.getNodes(),s=null!==o&&function(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}(o.getNode(),W);s&&-1===r.indexOf(s)&&r.push(s);for(let e=0;e<r.length;e++){const l=r[e];if(!W(l))continue;n(l)||T(178);const o=t();o.setFormat(l.getFormatType()),o.setIndent(l.getIndent()),l.replace(o,!0)}}function R(e){return e.getNode().isAttached()}function _(e){let t=e;for(;null!==t&&!u(t);){const e=t.getLatest(),n=t.getParent();0===e.getChildrenSize()&&t.remove(!0),t=n}}function z(e,t,n=null){const l=e.getStartEndPoints(),o=l?l[0]:null,r=e.getNodes(),s=r.length;if(null!==o&&(0===s||1===s&&\"element\"===o.type&&0===o.getNode().getChildrenSize())){const e=\"text\"===o.type?o.getNode().getParentOrThrow():o.getNode(),l=e.getChildren();let r=t();return r.setFormat(e.getFormatType()),r.setIndent(e.getIndent()),l.forEach((e=>r.append(e))),n&&(r=n.append(r)),void e.replace(r)}let i=null,c=[];for(let l=0;l<s;l++){const o=r[l];u(o)?(A(e,c,c.length,t,n),c=[],i=o):null===i||null!==i&&g(o,i)?c.push(o):(A(e,c,c.length,t,n),c=[o])}A(e,c,c.length,t,n)}function A(e,t,l,o,s=null){if(0===t.length)return;const c=t[0],f=new Map,g=[];let p=n(c)?c:c.getParentOrThrow();p.isInline()&&(p=p.getParentOrThrow());let h=!1;for(;null!==p;){const e=p.getPreviousSibling();if(null!==e){p=e,h=!0;break}if(p=p.getParentOrThrow(),u(p))break}const y=new Set;for(let e=0;e<l;e++){const l=t[e];n(l)&&0===l.getChildrenSize()&&y.add(l.getKey())}const m=new Set;for(let e=0;e<l;e++){const l=t[e];let r=l.getParent();if(null!==r&&r.isInline()&&(r=r.getParent()),null!==r&&a(l)&&!m.has(l.getKey())){const e=r.getKey();if(void 0===f.get(e)){const t=o();t.setFormat(r.getFormatType()),t.setIndent(r.getIndent()),g.push(t),f.set(e,t),r.getChildren().forEach((e=>{t.append(e),m.add(e.getKey()),n(e)&&e.getChildrenKeys().forEach((e=>m.add(e)))})),_(r)}}else if(y.has(l.getKey())){n(l)||T(179);const e=o();e.setFormat(l.getFormatType()),e.setIndent(l.getIndent()),g.push(e),l.remove(!0)}}if(null!==s)for(let e=0;e<g.length;e++){const t=g[e];s.append(t)}let x=null;if(u(p))if(h)if(null!==s)p.insertAfter(s);else for(let e=g.length-1;e>=0;e--){const t=g[e];p.insertAfter(t)}else{const e=p.getFirstChild();if(n(e)&&(p=e),null===e)if(s)p.append(s);else for(let e=0;e<g.length;e++){const t=g[e];p.append(t),x=t}else if(null!==s)e.insertBefore(s);else for(let t=0;t<g.length;t++){const n=g[t];e.insertBefore(n),x=n}}else if(s)p.insertAfter(s);else for(let e=g.length-1;e>=0;e--){const t=g[e];p.insertAfter(t),x=t}const S=r();i(S)&&R(S.anchor)&&R(S.focus)?d(S.clone()):null!==x?x.selectEnd():e.dirty=!0}function L(e,t){const l=p(e.focus,t);return h(l)&&!l.isIsolated()||n(l)&&!l.isInline()&&!l.canBeEmpty()}function D(e,t,n,l){e.modify(t?\"extend\":\"move\",n,l)}function M(e){const t=e.anchor.getNode();return\"rtl\"===(l(t)?t:t.getParentOrThrow()).getDirection()}function $(e,t,n){const l=M(e);D(e,t,n?!l:l,\"character\")}function H(t){const l=t.anchor,o=t.focus,r=l.getNode().getTopLevelElementOrThrow().getParentOrThrow();let s=r.getFirstDescendant(),i=r.getLastDescendant(),c=\"element\",f=\"element\",u=0;e(s)?c=\"text\":n(s)||null===s||(s=s.getParentOrThrow()),e(i)?(f=\"text\",u=i.getTextContentSize()):n(i)||null===i||(i=i.getParentOrThrow()),s&&i&&(l.set(s.getKey(),0,c),o.set(i.getKey(),u,f))}function j(e,t,n){const l=N(e.getStyle());return null!==l&&l[t]||n}function U(t,n,l=\"\"){let o=null;const r=t.getNodes(),s=t.anchor,c=t.focus,f=t.isBackward(),u=f?c.offset:s.offset,g=f?c.getNode():s.getNode();if(i(t)&&t.isCollapsed()&&\"\"!==t.style){const e=N(t.style);if(null!==e&&n in e)return e[n]}for(let t=0;t<r.length;t++){const s=r[t];if((0===t||0!==u||!s.is(g))&&e(s)){const e=j(s,n,l);if(null===o)o=e;else if(o!==e){o=\"\";break}}}return null===o?l:o}function W(t){if(h(t))return!1;if(!n(t)||u(t))return!1;const l=t.getFirstChild(),o=null===l||y(l)||e(l)||l.isInline();return!t.isInline()&&!1!==t.canBeEmpty()&&o}const X=I;export{O as $addNodeStyle,U as $getSelectionStyleValueForProperty,K as $isAtNodeEnd,M as $isParentElementRTL,D as $moveCaretSelection,$ as $moveCharacter,k as $patchStyleText,H as $selectAll,b as $setBlocksType,L as $shouldOverrideDefaultCharacterSelection,F as $sliceSelectedTextNodeContent,I as $trimTextContentFromAnchor,z as $wrapNodes,C as createDOMRange,P as createRectsFromDOMRange,E as getCSSFromStyleObject,N as getStyleObjectFromCSS,X as trimTextContentFromAnchor};\n"],"names":["m","e","T","x","w","n","F","l","o","r","s","i","c","f","u","t","g","a","O","b","W","L","p","h","D","M","$","y"],"mappings":";AAQia,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,QAAM,IAAE,IAAI;AAAgB,IAAE,OAAO,QAAOA,CAAC;AAAE,WAAQ,IAAE,GAAE,IAAE,UAAU,QAAO,IAAI,GAAE,OAAO,KAAI,UAAU,CAAC,CAAC;AAAE,QAAM,MAAM,2BAA2BA,C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E,OAAM,CAAC;AAAE,SAAOsB,EAAEhB,CAAC,KAAG,CAACA,EAAE,WAAU,KAAIF,EAAEE,CAAC,KAAG,CAACA,EAAE,SAAQ,KAAI,CAACA,EAAE,WAAU;AAAE;AAAC,SAASiB,EAAEvB,GAAE,GAAEI,GAAEE,GAAE;AAAC,EAAAN,EAAE,OAAO,IAAE,WAAS,QAAOI,GAAEE,CAAC;AAAC;AAAC,SAASkB,EAAExB,GAAE;AAAC,QAAM,IAAEA,EAAE,OAAO,QAAO;AAAG,UAAeM,EAAE,CAAC,IAAE,IAAE,EAAE,iBAAkB,GAAE,aAAc,MAApD;AAAoD;AAAC,SAASmB,EAAEzB,GAAE,GAAEI,GAAE;AAAC,QAAME,IAAEkB,EAAExB,CAAC;AAAE,EAAAuB,EAAEvB,GAAE,GAAEI,IAAE,CAACE,IAAEA,GAAE,WAAW;AAAC;AAA6zB,SAASa,EAAEL,GAAE;AAAkB,MAAdQ,EAAER,CAAC,KAAc,CAACV,EAAEU,CAAC,KAAGD,EAAEC,CAAC,EAAE,QAAM;AAAG,QAAMR,IAAEQ,EAAE,cAAa,GAAGP,IAASD,MAAP,QAAUoB,EAAEpB,CAAC,KAAGN,EAAEM,CAAC,KAAGA,EAAE,SAAU;AAAC,SAAM,CAACQ,EAAE,SAAU,KAAOA,EAAE,WAAY,MAAnB,MAAqBP;AAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { W as V, o as y, j as
|
|
2
|
-
import { k as Et,
|
|
3
|
-
import { O as Ie, L as ze } from "./LexicalClipboard.prod-
|
|
1
|
+
import { W as V, o as y, j as Kt, u as ge } from "./LexicalUtils.prod-CCjlRAc-.js";
|
|
2
|
+
import { k as Et, z as et, b as M, G as fe, h as pt, g as $t, d as Mt, I as me, T as Nt, f as G, e as pe, i as ft, P as ne, j as Yt, a as H, R as B, $ as xt, l as Ce, U as X, B as Se, m as be, O as we, n as _e, N as ye, q as Ne, r as xe, t as tt, F as q, v as St, s as ve, o as Te, c as ke, E as Fe, A as Re, W as oe, u as Oe, S as Ke, w as Ee, x as $e, y as Me, D as Ae, H as re, J as Pe, L as He, M as Be, Q as Ct, V as Le, X as De, Y as We } from "./Lexical.prod-DeeCy7Xd.js";
|
|
3
|
+
import { O as Ie, L as ze } from "./LexicalClipboard.prod-CayrMfkI.js";
|
|
4
4
|
const At = /^(\d+(?:\.\d+)?)px$/, Y = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 };
|
|
5
5
|
class at extends Et {
|
|
6
6
|
static getType() {
|
|
@@ -145,7 +145,7 @@ class bt extends Et {
|
|
|
145
145
|
return new bt(t.__height, t.__key);
|
|
146
146
|
}
|
|
147
147
|
static importDOM() {
|
|
148
|
-
return { tr: (t) => ({ conversion:
|
|
148
|
+
return { tr: (t) => ({ conversion: Ue, priority: 0 }) };
|
|
149
149
|
}
|
|
150
150
|
static importJSON(t) {
|
|
151
151
|
return Bt(t.height);
|
|
@@ -179,7 +179,7 @@ class bt extends Et {
|
|
|
179
179
|
return !1;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Ue(n) {
|
|
183
183
|
const t = n;
|
|
184
184
|
let e;
|
|
185
185
|
return At.test(t.style.height) && (e = parseFloat(t.style.height)), { node: Bt(e) };
|
|
@@ -214,8 +214,8 @@ function le(n) {
|
|
|
214
214
|
throw new Error("Expected table cell to be inside of table row.");
|
|
215
215
|
}
|
|
216
216
|
function qe(n) {
|
|
217
|
-
const t = y(n, (e) =>
|
|
218
|
-
if (
|
|
217
|
+
const t = y(n, (e) => K(e));
|
|
218
|
+
if (K(t)) return t;
|
|
219
219
|
throw new Error("Expected table cell to be inside of table.");
|
|
220
220
|
}
|
|
221
221
|
function dn(n) {
|
|
@@ -237,11 +237,11 @@ function fn(n, t) {
|
|
|
237
237
|
}
|
|
238
238
|
return n;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
const [o, l, i] =
|
|
240
|
+
function J(n, t, e) {
|
|
241
|
+
const [o, l, i] = Je(n, t, e);
|
|
242
242
|
return l === null && w(207), i === null && w(208), [o, l, i];
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Je(n, t, e) {
|
|
245
245
|
const o = [];
|
|
246
246
|
let l = null, i = null;
|
|
247
247
|
function r(d) {
|
|
@@ -279,7 +279,7 @@ function rt(n) {
|
|
|
279
279
|
const e = t.getParent();
|
|
280
280
|
L(e) || w(149);
|
|
281
281
|
const o = e.getParent();
|
|
282
|
-
return
|
|
282
|
+
return K(o) || w(210), [t, e, o];
|
|
283
283
|
}
|
|
284
284
|
function kt(n, t, e) {
|
|
285
285
|
let o = Math.min(t.startColumn, e.startColumn), l = Math.min(t.startRow, e.startRow), i = Math.max(t.startColumn + t.cell.__colSpan - 1, e.startColumn + e.cell.__colSpan - 1), r = Math.max(t.startRow + t.cell.__rowSpan - 1, e.startRow + e.cell.__rowSpan - 1), c = o, d = l, f = o, s = l;
|
|
@@ -311,7 +311,7 @@ function kt(n, t, e) {
|
|
|
311
311
|
}
|
|
312
312
|
return { maxColumn: i, maxRow: r, minColumn: o, minRow: l };
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function Ut(n) {
|
|
315
315
|
const [t, , e] = rt(n), o = e.getChildren(), l = o.length, i = o[0].getChildren().length, r = new Array(l);
|
|
316
316
|
for (let c = 0; c < l; c++) r[c] = new Array(i);
|
|
317
317
|
for (let c = 0; c < l; c++) {
|
|
@@ -334,7 +334,7 @@ function qt(n) {
|
|
|
334
334
|
const u = a.getParent();
|
|
335
335
|
L(u) || w(239, f);
|
|
336
336
|
const h = u.getParent();
|
|
337
|
-
return
|
|
337
|
+
return K(h) || w(240, f), [s, a, u, h];
|
|
338
338
|
});
|
|
339
339
|
return l.is(d) || w(241), { anchorCell: e, anchorNode: t, anchorRow: o, anchorTable: l, focusCell: r, focusNode: i, focusRow: c, focusTable: d };
|
|
340
340
|
}
|
|
@@ -358,7 +358,7 @@ class wt {
|
|
|
358
358
|
this._cachedNodes = t;
|
|
359
359
|
}
|
|
360
360
|
is(t) {
|
|
361
|
-
return
|
|
361
|
+
return R(t) && this.tableKey === t.tableKey && this.anchor.is(t.anchor) && this.focus.is(t.focus);
|
|
362
362
|
}
|
|
363
363
|
set(t, e, o) {
|
|
364
364
|
this.dirty = this.dirty || t !== this.tableKey || e !== this.anchor.key || o !== this.focus.key, this.tableKey = t, this.anchor.key = e, this.focus.key = o, this._cachedNodes = null;
|
|
@@ -390,9 +390,9 @@ class wt {
|
|
|
390
390
|
M(e) || w(151), Le(e.select(0, e.getChildrenSize())).insertNodes(t);
|
|
391
391
|
}
|
|
392
392
|
getShape() {
|
|
393
|
-
const { anchorCell: t, focusCell: e } = qt(this), o =
|
|
393
|
+
const { anchorCell: t, focusCell: e } = qt(this), o = Ut(t);
|
|
394
394
|
o === null && w(153);
|
|
395
|
-
const l =
|
|
395
|
+
const l = Ut(e);
|
|
396
396
|
l === null && w(155);
|
|
397
397
|
const i = Math.min(o.columnIndex, l.columnIndex), r = Math.max(o.columnIndex + o.colSpan - 1, l.columnIndex + l.colSpan - 1), c = Math.min(o.rowIndex, l.rowIndex), d = Math.max(o.rowIndex + o.rowSpan - 1, l.rowIndex + l.rowSpan - 1);
|
|
398
398
|
return { fromX: Math.min(i, r), fromY: Math.min(c, d), toX: Math.max(i, r), toY: Math.max(c, d) };
|
|
@@ -412,7 +412,7 @@ class wt {
|
|
|
412
412
|
}
|
|
413
413
|
return this.getNodes();
|
|
414
414
|
}
|
|
415
|
-
const [r, c, d] =
|
|
415
|
+
const [r, c, d] = J(e, o, l), { minColumn: f, maxColumn: s, minRow: a, maxRow: u } = kt(r, c, d), h = /* @__PURE__ */ new Map([[e.getKey(), e]]);
|
|
416
416
|
let g = null;
|
|
417
417
|
for (let m = a; m <= u; m++) for (let C = f; C <= s; C++) {
|
|
418
418
|
const { cell: b } = r[m][C], O = b.getParent();
|
|
@@ -434,10 +434,10 @@ class wt {
|
|
|
434
434
|
return e;
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function R(n) {
|
|
438
438
|
return n instanceof wt;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Jt() {
|
|
441
441
|
const n = Ct("root", 0, "element"), t = Ct("root", 0, "element");
|
|
442
442
|
return new wt("root", n, t);
|
|
443
443
|
}
|
|
@@ -450,7 +450,7 @@ function Ve(n, t) {
|
|
|
450
450
|
}
|
|
451
451
|
function Ge(n, t = ne()) {
|
|
452
452
|
const e = ft(n);
|
|
453
|
-
|
|
453
|
+
K(e) || w(231, n);
|
|
454
454
|
const o = nt(e, t.getElementByKey(n));
|
|
455
455
|
return o === null && w(232, n), { tableElement: o, tableNode: e };
|
|
456
456
|
}
|
|
@@ -496,7 +496,7 @@ class Qe {
|
|
|
496
496
|
}
|
|
497
497
|
$enableHighlightStyle() {
|
|
498
498
|
const t = this.editor, { tableElement: e } = this.$lookup();
|
|
499
|
-
|
|
499
|
+
Kt(e, t._config.theme.tableSelection), e.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1;
|
|
500
500
|
}
|
|
501
501
|
$disableHighlightStyle() {
|
|
502
502
|
const { tableElement: t } = this.$lookup();
|
|
@@ -534,10 +534,10 @@ class Qe {
|
|
|
534
534
|
if (i === this.focusX && r === this.focusY) return !1;
|
|
535
535
|
} else this.isHighlightingCells = !0, this.$disableHighlightStyle();
|
|
536
536
|
if (this.focusX = i, this.focusY = r, this.isHighlightingCells) {
|
|
537
|
-
const c =
|
|
537
|
+
const c = Rt(l, t.elem);
|
|
538
538
|
if (this.tableSelection != null && this.anchorCellNodeKey != null && c !== null) return this.focusCellNodeKey = c.getKey(), this.tableSelection = function(d, f, s) {
|
|
539
539
|
d.getKey(), f.getKey(), s.getKey();
|
|
540
|
-
const a = B(), u =
|
|
540
|
+
const a = B(), u = R(a) ? a.clone() : Jt();
|
|
541
541
|
return u.set(d.getKey(), f.getKey(), s.getKey()), u;
|
|
542
542
|
}(l, this.$getAnchorTableCellOrThrow(), c), q(this.tableSelection), o.dispatchCommand(tt, void 0), ut(o, this.table, this.tableSelection), !0;
|
|
543
543
|
}
|
|
@@ -559,16 +559,16 @@ class Qe {
|
|
|
559
559
|
}
|
|
560
560
|
$setAnchorCellForSelection(t) {
|
|
561
561
|
this.isHighlightingCells = !1, this.anchorCell = t, this.anchorX = t.x, this.anchorY = t.y;
|
|
562
|
-
const { tableNode: e } = this.$lookup(), o =
|
|
562
|
+
const { tableNode: e } = this.$lookup(), o = Rt(e, t.elem);
|
|
563
563
|
if (o !== null) {
|
|
564
564
|
const l = o.getKey();
|
|
565
|
-
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() :
|
|
565
|
+
this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : Jt(), this.anchorCellNodeKey = l;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
$formatCells(t) {
|
|
569
569
|
const e = B();
|
|
570
|
-
|
|
571
|
-
const o =
|
|
570
|
+
R(e) || w(236);
|
|
571
|
+
const o = Re(), l = o.anchor, i = o.focus, r = e.getNodes().filter(S);
|
|
572
572
|
r.length > 0 || w(237);
|
|
573
573
|
const c = r[0].getFirstChild(), d = oe(c) ? c.getFormatFlags(t, null) : null;
|
|
574
574
|
r.forEach((f) => {
|
|
@@ -577,9 +577,9 @@ class Qe {
|
|
|
577
577
|
}
|
|
578
578
|
$clearText() {
|
|
579
579
|
const { editor: t } = this, e = ft(this.tableNodeKey);
|
|
580
|
-
if (!
|
|
580
|
+
if (!K(e)) throw new Error("Expected TableNode.");
|
|
581
581
|
const o = B();
|
|
582
|
-
|
|
582
|
+
R(o) || w(11);
|
|
583
583
|
const l = o.getNodes().filter(S);
|
|
584
584
|
l.length !== this.table.columns * this.table.rows ? (l.forEach((i) => {
|
|
585
585
|
if (M(i)) {
|
|
@@ -607,7 +607,7 @@ function lt(n, t) {
|
|
|
607
607
|
}
|
|
608
608
|
return null;
|
|
609
609
|
}
|
|
610
|
-
const Ze = [[
|
|
610
|
+
const Ze = [[Ke, "down"], [Ee, "up"], [$e, "backward"], [Me, "forward"]], tn = [Ae, re, Pe], en = [He, Be];
|
|
611
611
|
function mn(n, t, e, o) {
|
|
612
612
|
const l = e.getRootElement(), i = Lt(e);
|
|
613
613
|
l !== null && i !== null || w(246);
|
|
@@ -621,9 +621,9 @@ function mn(n, t, e, o) {
|
|
|
621
621
|
const a = vt(s.target);
|
|
622
622
|
a !== null && e.update(() => {
|
|
623
623
|
const u = Yt();
|
|
624
|
-
if (je && s.shiftKey && j(u, n) && (H(u) ||
|
|
624
|
+
if (je && s.shiftKey && j(u, n) && (H(u) || R(u))) {
|
|
625
625
|
const h = u.anchor.getNode(), g = lt(n, u.anchor.getNode());
|
|
626
|
-
g ? (r.$setAnchorCellForSelection(it(r, g)), r.$setFocusCellForSelection(a),
|
|
626
|
+
g ? (r.$setAnchorCellForSelection(it(r, g)), r.$setFocusCellForSelection(a), U(s)) : (n.isBefore(h) ? n.selectStart() : n.selectEnd()).anchor.set(u.anchor.key, u.anchor.offset, u.anchor.type);
|
|
627
627
|
} else r.$setAnchorCellForSelection(a);
|
|
628
628
|
}), (() => {
|
|
629
629
|
if (r.isSelecting) return;
|
|
@@ -643,22 +643,22 @@ function mn(n, t, e, o) {
|
|
|
643
643
|
}, r.listenerOptions), i.addEventListener("mousedown", (s) => {
|
|
644
644
|
s.button === 0 && e.update(() => {
|
|
645
645
|
const a = B(), u = s.target;
|
|
646
|
-
|
|
646
|
+
R(a) && a.tableKey === r.tableNodeKey && l.contains(u) && r.$clearHighlight();
|
|
647
647
|
});
|
|
648
648
|
}, r.listenerOptions);
|
|
649
649
|
for (const [s, a] of Ze) r.listenersToRemove.add(e.registerCommand(s, (u) => ae(e, u, a, n, r), xt));
|
|
650
650
|
r.listenersToRemove.add(e.registerCommand(Ce, (s) => {
|
|
651
651
|
const a = B();
|
|
652
|
-
if (
|
|
652
|
+
if (R(a)) {
|
|
653
653
|
const u = lt(n, a.focus.getNode());
|
|
654
|
-
if (u !== null) return
|
|
654
|
+
if (u !== null) return U(s), u.selectEnd(), !0;
|
|
655
655
|
}
|
|
656
656
|
return !1;
|
|
657
657
|
}, xt));
|
|
658
658
|
const d = (s) => () => {
|
|
659
659
|
const a = B();
|
|
660
660
|
if (!j(a, n)) return !1;
|
|
661
|
-
if (
|
|
661
|
+
if (R(a)) return r.$clearText(), !0;
|
|
662
662
|
if (H(a)) {
|
|
663
663
|
if (!S(lt(n, a.anchor.getNode()))) return !1;
|
|
664
664
|
const u = a.anchor.getNode(), h = a.focus.getNode(), g = n.isParentOf(u), p = n.isParentOf(h);
|
|
@@ -672,19 +672,19 @@ function mn(n, t, e, o) {
|
|
|
672
672
|
for (const s of tn) r.listenersToRemove.add(e.registerCommand(s, d(s), X));
|
|
673
673
|
const f = (s) => {
|
|
674
674
|
const a = B();
|
|
675
|
-
if (!
|
|
675
|
+
if (!R(a) && !H(a)) return !1;
|
|
676
676
|
const u = n.isParentOf(a.anchor.getNode());
|
|
677
677
|
if (u !== n.isParentOf(a.focus.getNode())) {
|
|
678
678
|
const h = u ? "anchor" : "focus", g = u ? "focus" : "anchor", { key: p, offset: m, type: C } = a[g];
|
|
679
679
|
return n[a[h].isBefore(a[g]) ? "selectPrevious" : "selectNext"]()[g].set(p, m, C), !1;
|
|
680
680
|
}
|
|
681
|
-
return !!
|
|
681
|
+
return !!R(a) && (s && (s.preventDefault(), s.stopPropagation()), r.$clearText(), !0);
|
|
682
682
|
};
|
|
683
683
|
for (const s of en) r.listenersToRemove.add(e.registerCommand(s, f, X));
|
|
684
684
|
return r.listenersToRemove.add(e.registerCommand(Se, (s) => {
|
|
685
685
|
const a = B();
|
|
686
686
|
if (a) {
|
|
687
|
-
if (!
|
|
687
|
+
if (!R(a) && !H(a)) return !1;
|
|
688
688
|
Ie(e, ge(s, ClipboardEvent) ? s : null, ze(a));
|
|
689
689
|
const u = f(s);
|
|
690
690
|
return H(a) ? (a.removeText(), !0) : u;
|
|
@@ -693,7 +693,7 @@ function mn(n, t, e, o) {
|
|
|
693
693
|
}, X)), r.listenersToRemove.add(e.registerCommand(be, (s) => {
|
|
694
694
|
const a = B();
|
|
695
695
|
if (!j(a, n)) return !1;
|
|
696
|
-
if (
|
|
696
|
+
if (R(a)) return r.$formatCells(s), !0;
|
|
697
697
|
if (H(a)) {
|
|
698
698
|
const u = y(a.anchor.getNode(), (h) => S(h));
|
|
699
699
|
if (!S(u)) return !1;
|
|
@@ -701,10 +701,10 @@ function mn(n, t, e, o) {
|
|
|
701
701
|
return !1;
|
|
702
702
|
}, X)), r.listenersToRemove.add(e.registerCommand(we, (s) => {
|
|
703
703
|
const a = B();
|
|
704
|
-
if (!
|
|
704
|
+
if (!R(a) || !j(a, n)) return !1;
|
|
705
705
|
const u = a.anchor.getNode(), h = a.focus.getNode();
|
|
706
706
|
if (!S(u) || !S(h)) return !1;
|
|
707
|
-
const [g, p, m] =
|
|
707
|
+
const [g, p, m] = J(n, u, h), C = Math.max(p.startRow + p.cell.__rowSpan - 1, m.startRow + m.cell.__rowSpan - 1), b = Math.max(p.startColumn + p.cell.__colSpan - 1, m.startColumn + m.cell.__colSpan - 1), O = Math.min(p.startRow, m.startRow), E = Math.min(p.startColumn, m.startColumn), $ = /* @__PURE__ */ new Set();
|
|
708
708
|
for (let N = O; N <= C; N++) for (let k = E; k <= b; k++) {
|
|
709
709
|
const v = g[N][k].cell;
|
|
710
710
|
if ($.has(v)) continue;
|
|
@@ -719,7 +719,7 @@ function mn(n, t, e, o) {
|
|
|
719
719
|
}, X)), r.listenersToRemove.add(e.registerCommand(_e, (s) => {
|
|
720
720
|
const a = B();
|
|
721
721
|
if (!j(a, n)) return !1;
|
|
722
|
-
if (
|
|
722
|
+
if (R(a)) return r.$clearHighlight(), !1;
|
|
723
723
|
if (H(a)) {
|
|
724
724
|
const u = y(a.anchor.getNode(), (h) => S(h));
|
|
725
725
|
if (!S(u)) return !1;
|
|
@@ -733,7 +733,7 @@ function mn(n, t, e, o) {
|
|
|
733
733
|
const a = B();
|
|
734
734
|
if (!H(a) || !a.isCollapsed() || !j(a, n)) return !1;
|
|
735
735
|
const u = gt(a.anchor.getNode());
|
|
736
|
-
return !(u === null || !n.is(mt(u))) && (
|
|
736
|
+
return !(u === null || !n.is(mt(u))) && (U(s), function(h, g) {
|
|
737
737
|
const p = g === "next" ? "getNextSibling" : "getPreviousSibling", m = g === "next" ? "getFirstChild" : "getLastChild", C = h[p]();
|
|
738
738
|
if (M(C)) return C.selectEnd();
|
|
739
739
|
const b = y(h, L);
|
|
@@ -742,14 +742,14 @@ function mn(n, t, e, o) {
|
|
|
742
742
|
const $ = E[m]();
|
|
743
743
|
if (M($)) return $.selectEnd();
|
|
744
744
|
}
|
|
745
|
-
const O = y(b,
|
|
745
|
+
const O = y(b, K);
|
|
746
746
|
O === null && w(248), g === "next" ? O.selectNext() : O.selectPrevious();
|
|
747
747
|
}(u, s.shiftKey ? "previous" : "next"), !0);
|
|
748
748
|
}, X)), r.listenersToRemove.add(e.registerCommand(Ne, (s) => n.isSelected(), xt)), r.listenersToRemove.add(e.registerCommand(xe, (s) => {
|
|
749
|
-
const { nodes: a, selection: u } = s, h = u.getStartEndPoints(), g =
|
|
750
|
-
if (a.length !== 1 || !
|
|
751
|
-
const [m] = h, C = a[0], b = C.getChildren(), O = C.getFirstChildOrThrow().getChildrenSize(), E = C.getChildrenSize(), $ = y(m.getNode(), (x) => S(x)), N = $ && y($, (x) => L(x)), k = N && y(N, (x) =>
|
|
752
|
-
if (!S($) || !L(N) || !
|
|
749
|
+
const { nodes: a, selection: u } = s, h = u.getStartEndPoints(), g = R(u), p = H(u) && y(u.anchor.getNode(), (x) => S(x)) !== null && y(u.focus.getNode(), (x) => S(x)) !== null || g;
|
|
750
|
+
if (a.length !== 1 || !K(a[0]) || !p || h === null) return !1;
|
|
751
|
+
const [m] = h, C = a[0], b = C.getChildren(), O = C.getFirstChildOrThrow().getChildrenSize(), E = C.getChildrenSize(), $ = y(m.getNode(), (x) => S(x)), N = $ && y($, (x) => L(x)), k = N && y(N, (x) => K(x));
|
|
752
|
+
if (!S($) || !L(N) || !K(k)) return !1;
|
|
753
753
|
const v = N.getIndexWithinParent(), _ = Math.min(k.getChildrenSize() - 1, v + E - 1), T = $.getIndexWithinParent(), F = Math.min(N.getChildrenSize() - 1, T + O - 1), A = Math.min(T, F), P = Math.min(v, _), W = Math.max(T, F), D = Math.max(v, _), z = k.getChildren();
|
|
754
754
|
let I = 0;
|
|
755
755
|
for (let x = P; x <= D; x++) {
|
|
@@ -776,7 +776,7 @@ function mn(n, t, e, o) {
|
|
|
776
776
|
const s = B(), a = Yt(), u = r.getAndClearNextFocus();
|
|
777
777
|
if (u !== null) {
|
|
778
778
|
const { focusCell: h } = u;
|
|
779
|
-
if (
|
|
779
|
+
if (R(s) && s.tableKey === r.tableNodeKey) return (h.x !== r.focusX || h.y !== r.focusY) && (r.$setFocusCellForSelection(h), !0);
|
|
780
780
|
if (h !== r.anchorCell && j(s, n)) return r.$setFocusCellForSelection(h), !0;
|
|
781
781
|
}
|
|
782
782
|
if (r.getAndClearShouldCheckSelection() && H(a) && H(s) && s.isCollapsed()) {
|
|
@@ -791,15 +791,15 @@ function mn(n, t, e, o) {
|
|
|
791
791
|
if ($) {
|
|
792
792
|
const v = s.clone();
|
|
793
793
|
if (E) {
|
|
794
|
-
const [_] =
|
|
794
|
+
const [_] = J(n, b, b), T = _[0][0].cell, F = _[_.length - 1].at(-1).cell;
|
|
795
795
|
v.focus.set(k ? T.getKey() : F.getKey(), k ? T.getChildrenSize() : F.getChildrenSize(), "element");
|
|
796
796
|
} else if (O) {
|
|
797
|
-
const [_] =
|
|
797
|
+
const [_] = J(n, C, C), T = _[0][0].cell, F = _[_.length - 1].at(-1).cell;
|
|
798
798
|
v.anchor.set(k ? F.getKey() : T.getKey(), k ? F.getChildrenSize() : 0, "element");
|
|
799
799
|
}
|
|
800
800
|
q(v), Gt(e, r);
|
|
801
801
|
} else N && (C.is(b) || (r.$setAnchorCellForSelection(it(r, C)), r.$setFocusCellForSelection(it(r, b), !0)));
|
|
802
|
-
} else if (s &&
|
|
802
|
+
} else if (s && R(s) && s.is(a) && s.tableKey === n.getKey()) {
|
|
803
803
|
const h = St(i);
|
|
804
804
|
if (h && h.anchorNode && h.focusNode) {
|
|
805
805
|
const g = G(h.focusNode), p = g && !n.isParentOf(g), m = G(h.anchorNode), C = m && n.isParentOf(m);
|
|
@@ -809,7 +809,7 @@ function mn(n, t, e, o) {
|
|
|
809
809
|
}
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
|
-
return s && !s.is(a) && (
|
|
812
|
+
return s && !s.is(a) && (R(s) || R(a)) && r.tableSelection && !r.tableSelection.is(a) ? (R(s) && s.tableKey === r.tableNodeKey ? r.$updateTableTableSelection(s) : !R(s) && R(a) && a.tableKey === r.tableNodeKey && r.$updateTableTableSelection(null), !1) : (r.hasHijackedSelectionStyles && !n.isSelected() ? function(h, g) {
|
|
813
813
|
g.$enableHighlightStyle(), Dt(g.table, (p) => {
|
|
814
814
|
const m = p.elem;
|
|
815
815
|
p.highlighted = !1, ie(h, p), m.getAttribute("style") || m.removeAttribute("style");
|
|
@@ -958,7 +958,7 @@ function on(n, t, e, o, l) {
|
|
|
958
958
|
return n.$setAnchorCellForSelection(E), n.$setFocusCellForSelection($, !0), !0;
|
|
959
959
|
}
|
|
960
960
|
function j(n, t) {
|
|
961
|
-
if (H(n) ||
|
|
961
|
+
if (H(n) || R(n)) {
|
|
962
962
|
const e = t.isParentOf(n.anchor.getNode()), o = t.isParentOf(n.focus.getNode());
|
|
963
963
|
return e && o;
|
|
964
964
|
}
|
|
@@ -975,15 +975,15 @@ function ie(n, t) {
|
|
|
975
975
|
const e = t.elem;
|
|
976
976
|
S(G(e)) || w(131);
|
|
977
977
|
const o = n._config.theme;
|
|
978
|
-
|
|
978
|
+
Kt(e, o.tableCellSelected);
|
|
979
979
|
}
|
|
980
980
|
function gt(n) {
|
|
981
981
|
const t = y(n, S);
|
|
982
982
|
return S(t) ? t : null;
|
|
983
983
|
}
|
|
984
984
|
function mt(n) {
|
|
985
|
-
const t = y(n,
|
|
986
|
-
return
|
|
985
|
+
const t = y(n, K);
|
|
986
|
+
return K(t) ? t : null;
|
|
987
987
|
}
|
|
988
988
|
function ae(n, t, e, o, l) {
|
|
989
989
|
if ((e === "up" || e === "down") && function(r) {
|
|
@@ -1004,13 +1004,13 @@ function ae(n, t, e, o, l) {
|
|
|
1004
1004
|
}(i.focus.getNode());
|
|
1005
1005
|
if (!r) return !1;
|
|
1006
1006
|
const c = r.getPreviousSibling();
|
|
1007
|
-
return !!
|
|
1007
|
+
return !!K(c) && (U(t), t.shiftKey ? i.focus.set(c.getParentOrThrow().getKey(), c.getIndexWithinParent(), "element") : c.selectEnd(), !0);
|
|
1008
1008
|
}
|
|
1009
1009
|
if (t.shiftKey && (e === "up" || e === "down")) {
|
|
1010
1010
|
const r = i.focus.getNode();
|
|
1011
1011
|
if (!i.isCollapsed() && (e === "up" && !i.isBackward() || e === "down" && i.isBackward())) {
|
|
1012
|
-
let c = y(r, (u) =>
|
|
1013
|
-
if (S(c) && (c = y(c,
|
|
1012
|
+
let c = y(r, (u) => K(u));
|
|
1013
|
+
if (S(c) && (c = y(c, K)), c !== o || !c) return !1;
|
|
1014
1014
|
const d = e === "down" ? c.getNextSibling() : c.getPreviousSibling();
|
|
1015
1015
|
if (!d) return !1;
|
|
1016
1016
|
let f = 0;
|
|
@@ -1018,7 +1018,7 @@ function ae(n, t, e, o, l) {
|
|
|
1018
1018
|
let s = d;
|
|
1019
1019
|
e === "up" && M(d) && (s = d.getLastChild() || d, f = pt(s) ? s.getTextContentSize() : 0);
|
|
1020
1020
|
const a = i.clone();
|
|
1021
|
-
return a.focus.set(s.getKey(), f, pt(s) ? "text" : "element"), q(a),
|
|
1021
|
+
return a.focus.set(s.getKey(), f, pt(s) ? "text" : "element"), q(a), U(t), !0;
|
|
1022
1022
|
}
|
|
1023
1023
|
if (ke(r)) {
|
|
1024
1024
|
const c = e === "up" ? i.getNodes()[i.getNodes().length - 1] : i.getNodes()[0];
|
|
@@ -1032,13 +1032,13 @@ function ae(n, t, e, o, l) {
|
|
|
1032
1032
|
}
|
|
1033
1033
|
{
|
|
1034
1034
|
let c = y(r, (f) => M(f) && !f.isInline());
|
|
1035
|
-
if (S(c) && (c = y(c,
|
|
1035
|
+
if (S(c) && (c = y(c, K)), !c) return !1;
|
|
1036
1036
|
const d = e === "down" ? c.getNextSibling() : c.getPreviousSibling();
|
|
1037
|
-
if (
|
|
1037
|
+
if (K(d) && l.tableNodeKey === d.getKey()) {
|
|
1038
1038
|
const f = d.getFirstDescendant(), s = d.getLastDescendant();
|
|
1039
1039
|
if (!f || !s) return !1;
|
|
1040
1040
|
const [a] = rt(f), [u] = rt(s), h = i.clone();
|
|
1041
|
-
return h.focus.set((e === "up" ? a : u).getKey(), e === "up" ? 0 : u.getChildrenSize(), "element"),
|
|
1041
|
+
return h.focus.set((e === "up" ? a : u).getKey(), e === "up" ? 0 : u.getChildrenSize(), "element"), U(t), q(h), !0;
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
@@ -1067,7 +1067,7 @@ function ae(n, t, e, o, l) {
|
|
|
1067
1067
|
return _ === "text" && W && (A === "backward" ? P.getPreviousSibling() === null : P.getNextSibling() === null);
|
|
1068
1068
|
}($, N, k, v);
|
|
1069
1069
|
}(C, b, O, e) && function($, N, k, v, _) {
|
|
1070
|
-
const [T, F] =
|
|
1070
|
+
const [T, F] = J(v, k, k);
|
|
1071
1071
|
if (!function(P, W, D) {
|
|
1072
1072
|
const z = P[0][0], I = P[P.length - 1][P[0].length - 1], { startColumn: x, startRow: ot } = W;
|
|
1073
1073
|
return D === "backward" ? x === z.startColumn && ot === z.startRow : x === I.startColumn && ot === I.startRow;
|
|
@@ -1076,9 +1076,9 @@ function ae(n, t, e, o, l) {
|
|
|
1076
1076
|
const z = y(P, (x) => M(x) && !x.isInline());
|
|
1077
1077
|
if (!z) return;
|
|
1078
1078
|
const I = W === "backward" ? z.getPreviousSibling() : z.getNextSibling();
|
|
1079
|
-
return I &&
|
|
1079
|
+
return I && K(I) ? I : W === "backward" ? D.getPreviousSibling() : D.getNextSibling();
|
|
1080
1080
|
}(N, _, v);
|
|
1081
|
-
return !A ||
|
|
1081
|
+
return !A || K(A) ? !1 : (U($), _ === "backward" ? A.selectEnd() : A.selectStart(), !0);
|
|
1082
1082
|
}(t, O, d, o, e);
|
|
1083
1083
|
}
|
|
1084
1084
|
const a = n.getElementByKey(d.__key), u = n.getElementByKey(r.key);
|
|
@@ -1096,7 +1096,7 @@ function ae(n, t, e, o, l) {
|
|
|
1096
1096
|
if (p == null) return !1;
|
|
1097
1097
|
const m = p.getBoundingClientRect();
|
|
1098
1098
|
if (e === "up" ? m.top > h.top - h.height : h.bottom + h.height > m.bottom) {
|
|
1099
|
-
|
|
1099
|
+
U(t);
|
|
1100
1100
|
const C = o.getCordsFromCellNode(d, l.table);
|
|
1101
1101
|
if (!t.shiftKey) return nn(l, o, C.x, C.y, e);
|
|
1102
1102
|
{
|
|
@@ -1105,22 +1105,22 @@ function ae(n, t, e, o, l) {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
return !0;
|
|
1107
1107
|
}
|
|
1108
|
-
} else if (
|
|
1108
|
+
} else if (R(i)) {
|
|
1109
1109
|
const { anchor: r, focus: c } = i, d = y(r.getNode(), S), f = y(c.getNode(), S), [s] = i.getNodes();
|
|
1110
|
-
|
|
1110
|
+
K(s) || w(251);
|
|
1111
1111
|
const a = nt(s, n.getElementByKey(s.getKey()));
|
|
1112
|
-
if (!S(d) || !S(f) || !
|
|
1112
|
+
if (!S(d) || !S(f) || !K(s) || a == null) return !1;
|
|
1113
1113
|
l.$updateTableTableSelection(i);
|
|
1114
1114
|
const u = st(s, a), h = o.getCordsFromCellNode(d, u), g = o.getDOMCellFromCordsOrThrow(h.x, h.y, u);
|
|
1115
|
-
if (l.$setAnchorCellForSelection(g),
|
|
1116
|
-
const [p, m, C] =
|
|
1115
|
+
if (l.$setAnchorCellForSelection(g), U(t), t.shiftKey) {
|
|
1116
|
+
const [p, m, C] = J(o, d, f);
|
|
1117
1117
|
return on(l, p, m, C, e);
|
|
1118
1118
|
}
|
|
1119
1119
|
return f.selectEnd(), !0;
|
|
1120
1120
|
}
|
|
1121
1121
|
return !1;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function U(n) {
|
|
1124
1124
|
n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation();
|
|
1125
1125
|
}
|
|
1126
1126
|
function Qt(n, t, e) {
|
|
@@ -1136,16 +1136,16 @@ function Zt(n, t, e) {
|
|
|
1136
1136
|
if (!i || !r || !c || !r.contains(i) || c.contains(i)) return;
|
|
1137
1137
|
const d = y(t.anchor.getNode(), (b) => S(b));
|
|
1138
1138
|
if (!d) return;
|
|
1139
|
-
const f = y(d, (b) =>
|
|
1140
|
-
if (!
|
|
1141
|
-
const [s, a] =
|
|
1139
|
+
const f = y(d, (b) => K(b));
|
|
1140
|
+
if (!K(f) || !f.is(e)) return;
|
|
1141
|
+
const [s, a] = J(e, d, d), u = s[0][0], h = s[s.length - 1][s[0].length - 1], { startRow: g, startColumn: p } = a, m = g === u.startRow && p === u.startColumn, C = g === h.startRow && p === h.startColumn;
|
|
1142
1142
|
return m ? "first" : C ? "last" : void 0;
|
|
1143
1143
|
}
|
|
1144
1144
|
function it(n, t) {
|
|
1145
1145
|
const { tableNode: e } = n.$lookup(), o = e.getCordsFromCellNode(t, n.table);
|
|
1146
1146
|
return e.getDOMCellFromCordsOrThrow(o.x, o.y, n.table);
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Rt(n, t, e) {
|
|
1149
1149
|
return lt(n, G(t, e));
|
|
1150
1150
|
}
|
|
1151
1151
|
function te(n, t, e, o) {
|
|
@@ -1159,7 +1159,7 @@ function te(n, t, e, o) {
|
|
|
1159
1159
|
l.replaceChildren(...i);
|
|
1160
1160
|
}
|
|
1161
1161
|
function ee(n, t, e) {
|
|
1162
|
-
e ? (V(n, t.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (
|
|
1162
|
+
e ? (V(n, t.theme.tableRowStriping), n.setAttribute("data-lexical-row-striping", "true")) : (Kt(n, t.theme.tableRowStriping), n.removeAttribute("data-lexical-row-striping"));
|
|
1163
1163
|
}
|
|
1164
1164
|
const Ot = /* @__PURE__ */ new WeakSet();
|
|
1165
1165
|
function ce(n = ne()) {
|
|
@@ -1238,7 +1238,7 @@ class _t extends Et {
|
|
|
1238
1238
|
if (r != null) for (let c = 0; c < r.length; c++) {
|
|
1239
1239
|
const d = r[c];
|
|
1240
1240
|
if (d == null) continue;
|
|
1241
|
-
const { elem: f } = d, s =
|
|
1241
|
+
const { elem: f } = d, s = Rt(this, f);
|
|
1242
1242
|
if (s !== null && t.is(s)) return { x: c, y: i };
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
@@ -1308,15 +1308,15 @@ function rn(n) {
|
|
|
1308
1308
|
function Wt() {
|
|
1309
1309
|
return $t(new _t());
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function K(n) {
|
|
1312
1312
|
return n instanceof _t;
|
|
1313
1313
|
}
|
|
1314
1314
|
export {
|
|
1315
|
-
|
|
1315
|
+
Je as B,
|
|
1316
1316
|
un as C,
|
|
1317
1317
|
pn as F,
|
|
1318
1318
|
rt as H,
|
|
1319
|
-
|
|
1319
|
+
J as P,
|
|
1320
1320
|
hn as S,
|
|
1321
1321
|
Ge as X,
|
|
1322
1322
|
le as _,
|
|
@@ -1335,4 +1335,4 @@ export {
|
|
|
1335
1335
|
qe as w,
|
|
1336
1336
|
gn as y
|
|
1337
1337
|
};
|
|
1338
|
-
//# sourceMappingURL=LexicalTable.prod-
|
|
1338
|
+
//# sourceMappingURL=LexicalTable.prod-hx6rW3fc.js.map
|