@lexical/dragon 0.36.2-nightly.20250930.0 → 0.36.2

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.
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/extension"),t=require("lexical");function n(e){const n=window.location.origin,o=o=>{if(o.origin!==n)return;const i=e.getRootElement();if(document.activeElement!==i)return;const s=o.data;if("string"==typeof s){let n;try{n=JSON.parse(s)}catch(e){return}if(n&&"nuanria_messaging"===n.protocol&&"request"===n.type){const i=n.payload;if(i&&"makeChanges"===i.functionId){const n=i.args;if(n){const[i,s,a,r,d]=n;e.update((()=>{const e=t.$getSelection();if(t.$isRangeSelection(e)){const n=e.anchor;let c=n.getNode(),g=0,l=0;if(t.$isTextNode(c)&&i>=0&&s>=0&&(g=i,l=i+s,e.setTextNodeRange(c,g,c,l)),g===l&&""===a||(e.insertRawText(a),c=n.getNode()),t.$isTextNode(c)){g=r,l=r+d;const t=c.getTextContentSize();g=g>t?t:g,l=l>t?t:l,e.setTextNodeRange(c,g,c,l)}o.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",o,!0),()=>{window.removeEventListener("message",o,!0)}}const o=t.defineExtension({build:(t,n,o)=>e.namedSignals(n),config:t.safeCast({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(t,o,i)=>e.effect((()=>i.getOutput().disabled.value?void 0:n(t)))});exports.DragonExtension=o,exports.registerDragonSupport=n;
9
+ "use strict";var e=require("@lexical/extension"),t=require("lexical");function n(e){const n=window.location.origin,o=o=>{if(o.origin!==n)return;const i=e.getRootElement();if(document.activeElement!==i)return;const s=o.data;if("string"==typeof s){let n;try{n=JSON.parse(s)}catch(e){return}if(n&&"nuanria_messaging"===n.protocol&&"request"===n.type){const i=n.payload;if(i&&"makeChanges"===i.functionId){const n=i.args;if(n){const[i,s,a,r,d]=n;e.update(()=>{const e=t.$getSelection();if(t.$isRangeSelection(e)){const n=e.anchor;let c=n.getNode(),g=0,l=0;if(t.$isTextNode(c)&&i>=0&&s>=0&&(g=i,l=i+s,e.setTextNodeRange(c,g,c,l)),g===l&&""===a||(e.insertRawText(a),c=n.getNode()),t.$isTextNode(c)){g=r,l=r+d;const t=c.getTextContentSize();g=g>t?t:g,l=l>t?t:l,e.setTextNodeRange(c,g,c,l)}o.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",o,!0),()=>{window.removeEventListener("message",o,!0)}}const o=t.defineExtension({build:(t,n,o)=>e.namedSignals(n),config:t.safeCast({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(t,o,i)=>e.effect(()=>i.getOutput().disabled.value?void 0:n(t))});exports.DragonExtension=o,exports.registerDragonSupport=n;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{effect as e,namedSignals as t}from"@lexical/extension";import{defineExtension as n,safeCast as o,$getSelection as i,$isRangeSelection as a,$isTextNode as r}from"lexical";function s(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const s=n.data;if("string"==typeof s){let t;try{t=JSON.parse(s)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const o=t.payload;if(o&&"makeChanges"===o.functionId){const t=o.args;if(t){const[o,s,d,c,g]=t;e.update((()=>{const e=i();if(a(e)){const t=e.anchor;let i=t.getNode(),a=0,l=0;if(r(i)&&o>=0&&s>=0&&(a=o,l=o+s,e.setTextNodeRange(i,a,i,l)),a===l&&""===d||(e.insertRawText(d),i=t.getNode()),r(i)){a=c,l=c+g;const t=i.getTextContentSize();a=a>t?t:a,l=l>t?t:l,e.setTextNodeRange(i,a,i,l)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const d=n({build:(e,n,o)=>t(n),config:o({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(t,n,o)=>e((()=>o.getOutput().disabled.value?void 0:s(t)))});export{d as DragonExtension,s as registerDragonSupport};
9
+ import{effect as e,namedSignals as t}from"@lexical/extension";import{defineExtension as n,safeCast as o,$getSelection as i,$isRangeSelection as a,$isTextNode as r}from"lexical";function s(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const o=e.getRootElement();if(document.activeElement!==o)return;const s=n.data;if("string"==typeof s){let t;try{t=JSON.parse(s)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const o=t.payload;if(o&&"makeChanges"===o.functionId){const t=o.args;if(t){const[o,s,d,c,g]=t;e.update(()=>{const e=i();if(a(e)){const t=e.anchor;let i=t.getNode(),a=0,l=0;if(r(i)&&o>=0&&s>=0&&(a=o,l=o+s,e.setTextNodeRange(i,a,i,l)),a===l&&""===d||(e.insertRawText(d),i=t.getNode()),r(i)){a=c,l=c+g;const t=i.getTextContentSize();a=a>t?t:a,l=l>t?t:l,e.setTextNodeRange(i,a,i,l)}n.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}const d=n({build:(e,n,o)=>t(n),config:o({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(t,n,o)=>e(()=>o.getOutput().disabled.value?void 0:s(t))});export{d as DragonExtension,s as registerDragonSupport};
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "accessibility"
10
10
  ],
11
11
  "license": "MIT",
12
- "version": "0.36.2-nightly.20250930.0",
12
+ "version": "0.36.2",
13
13
  "main": "LexicalDragon.js",
14
14
  "types": "index.d.ts",
15
15
  "repository": {
@@ -37,7 +37,7 @@
37
37
  }
38
38
  },
39
39
  "dependencies": {
40
- "@lexical/extension": "0.36.2-nightly.20250930.0",
41
- "lexical": "0.36.2-nightly.20250930.0"
40
+ "@lexical/extension": "0.36.2",
41
+ "lexical": "0.36.2"
42
42
  }
43
43
  }