@es-joy/jsoe 0.28.1 → 0.28.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@es-joy/jsoe",
3
- "version": "0.28.1",
3
+ "version": "0.28.2",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./src/index.js",
@@ -35,6 +35,7 @@ const zodexToStructuredCloningTypeMap = new Map([
35
35
  ['string', 'string'],
36
36
  ['date', 'date'],
37
37
  ['file', 'file'],
38
+ ['symbol', 'symbol'],
38
39
  ['undefined', 'undef'],
39
40
  ['void', 'undef'],
40
41
  ['null', 'null'],
@@ -613,11 +613,22 @@ export async function openRawEditorDialog ({
613
613
  ['div', {class: editorClass}]
614
614
  ];
615
615
 
616
+ // `dialogs.js`'s default `remove` behavior detaches the `<dialog>` from
617
+ // the document on close, but never tears down the `EditorView` mounted
618
+ // into it; left as-is, every "Edit raw"/"View raw" use leaks a live
619
+ // `EditorView` (and its internal `ResizeObserver`/DOM observers) bound
620
+ // to an already-detached subtree. Destroy it alongside the dialog.
621
+ const close = () => {
622
+ view.destroy();
623
+ };
624
+
616
625
  const dialog = readonly
617
626
  // @ts-expect-error TS bug
618
- ? dialogs.makeCancelDialog({children})
627
+ ? dialogs.makeCancelDialog({children, close})
619
628
  : dialogs.makeSubmitDialog({
620
629
  submitText: 'Save',
630
+ // @ts-expect-error TS bug
631
+ close,
621
632
  async submit ({dialog: dlg}) {
622
633
  const text = view.state.doc.toString();
623
634
  showError(dlg, '');
@@ -652,7 +663,6 @@ export async function openRawEditorDialog ({
652
663
  }
653
664
  dlg.close();
654
665
  },
655
- // @ts-expect-error TS bug
656
666
  children
657
667
  });
658
668
 
package/tsconfig.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "outDir": "dist"
17
17
  },
18
18
  "include": ["src/**/*.js", "typings/sceditor.d.ts", "typings/json-6.d.ts"],
19
- "exclude": ["node_modules", "src/deepEqual.js", "src/formats/schema.js", "./src/index.ts", "./dist/**/*.js"]
19
+ "exclude": ["node_modules", "src/deepEqual.js"]
20
20
  }