@threadlabs/looma 0.53.12 → 0.53.14

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/docs/catalog.json CHANGED
@@ -780,7 +780,7 @@
780
780
  ],
781
781
  "schemaVersion": 1,
782
782
  "package": "@threadlabs/looma",
783
- "version": "0.53.12",
783
+ "version": "0.53.14",
784
784
  "groups": [
785
785
  {
786
786
  "id": "layout",
@@ -1,5 +1,6 @@
1
1
  import { Extension, Mark, Node, markInputRule, markPasteRule, mergeAttributes } from "@tiptap/core";
2
2
  import { Plugin } from "@tiptap/pm/state";
3
+ import { DOMParser } from "@tiptap/pm/model";
3
4
  import { closeHistory, history, redo, undo } from "@tiptap/pm/history";
4
5
  //#region src/editor/extensions/input-rule-history.ts
5
6
  /**
@@ -45,6 +46,23 @@ var LoomaInputRuleHistory = Extension.create({
45
46
  }
46
47
  });
47
48
  //#endregion
49
+ //#region src/editor/extensions/dom-readback.ts
50
+ var EditorDOMParser = class extends DOMParser {
51
+ parse(node, options) {
52
+ return super.parse(node, options?.preserveWhitespace === true ? {
53
+ ...options,
54
+ preserveWhitespace: "full"
55
+ } : options);
56
+ }
57
+ };
58
+ var LoomaDOMReadback = Extension.create({
59
+ name: "loomaDOMReadback",
60
+ addProseMirrorPlugins() {
61
+ const { schema, rules } = DOMParser.fromSchema(this.editor.schema);
62
+ return [new Plugin({ props: { domParser: new EditorDOMParser(schema, rules) } })];
63
+ }
64
+ });
65
+ //#endregion
48
66
  //#region ../../node_modules/.pnpm/@tiptap+extension-document@2.27.2_@tiptap+core@2.27.2_@tiptap+pm@2.27.2_/node_modules/@tiptap/extension-document/dist/index.js
49
67
  /**
50
68
  * The default document node which represents the top level node of the editor.
@@ -435,4 +453,4 @@ var Code = Mark.create({
435
453
  }
436
454
  });
437
455
  //#endregion
438
- export { Bold as a, Document as c, Italic as i, LoomaInputRuleHistory as l, History as n, Text as o, HardBreak as r, Paragraph as s, Code as t };
456
+ export { Bold as a, Document as c, Italic as i, LoomaDOMReadback as l, History as n, Text as o, HardBreak as r, Paragraph as s, Code as t, LoomaInputRuleHistory as u };