@fibery/prosemirror-schema 4.19.0-next.0 → 4.19.0-next.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.
Files changed (46) hide show
  1. package/lib/index.d.ts +4 -4
  2. package/lib/index.js +4 -15
  3. package/lib/src/create-schema.d.ts +1 -1
  4. package/lib/src/create-schema.js +81 -85
  5. package/lib/src/marks/code.js +1 -4
  6. package/lib/src/marks/em.js +1 -4
  7. package/lib/src/marks/hint-query.js +1 -4
  8. package/lib/src/marks/link.js +1 -4
  9. package/lib/src/marks/linked-highlight.js +2 -7
  10. package/lib/src/marks/strike.js +1 -4
  11. package/lib/src/marks/strong.js +1 -4
  12. package/lib/src/marks/text-background-color.js +1 -4
  13. package/lib/src/marks/underline.js +1 -4
  14. package/lib/src/nodes/callout.d.ts +1 -1
  15. package/lib/src/nodes/callout.js +1 -4
  16. package/lib/src/nodes/check-item.d.ts +1 -1
  17. package/lib/src/nodes/check-item.js +3 -6
  18. package/lib/src/nodes/check-list.d.ts +1 -1
  19. package/lib/src/nodes/check-list.js +3 -6
  20. package/lib/src/nodes/code-block.js +7 -10
  21. package/lib/src/nodes/column.js +1 -4
  22. package/lib/src/nodes/columns.js +5 -8
  23. package/lib/src/nodes/emoji.d.ts +2 -2
  24. package/lib/src/nodes/emoji.js +1 -5
  25. package/lib/src/nodes/entity.js +1 -4
  26. package/lib/src/nodes/fibery-view.js +5 -8
  27. package/lib/src/nodes/file.d.ts +2 -2
  28. package/lib/src/nodes/file.js +3 -6
  29. package/lib/src/nodes/heading.js +3 -7
  30. package/lib/src/nodes/image-block.js +5 -8
  31. package/lib/src/nodes/important.js +1 -4
  32. package/lib/src/nodes/math-display.js +1 -4
  33. package/lib/src/nodes/math-inline.js +1 -4
  34. package/lib/src/nodes/media.js +5 -9
  35. package/lib/src/nodes/mention.js +1 -4
  36. package/lib/src/nodes/note.js +1 -4
  37. package/lib/src/nodes/paragraph.js +3 -6
  38. package/lib/src/nodes/table-nodes.js +2 -5
  39. package/lib/src/nodes/types/inline-content.d.ts +3 -3
  40. package/lib/src/nodes/types/inline-content.js +1 -2
  41. package/lib/src/nodes/types/text.js +1 -2
  42. package/lib/src/nodes/video.js +14 -17
  43. package/lib/src/resizable-node-attrs.js +7 -13
  44. package/lib/src/transcription-node-attrs.js +1 -4
  45. package/lib/test-helpers/index.js +8 -14
  46. package/package.json +2 -1
package/lib/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { defaultHeight, defaultWidth } from "./src/resizable-node-attrs";
1
+ export { defaultHeight, defaultWidth } from "./src/resizable-node-attrs.js";
2
2
  export { Node, Schema } from "prosemirror-model";
3
- export { createSchema, Basic } from "./src/create-schema";
4
- export { DEFAULT_VIDEO_WIDTH, DEFAULT_VIDEO_HEIGHT } from "./src/nodes/video";
5
- export type { EmojiOptions } from "./src/nodes/emoji";
3
+ export { createSchema, Basic } from "./src/create-schema.js";
4
+ export { DEFAULT_VIDEO_WIDTH, DEFAULT_VIDEO_HEIGHT } from "./src/nodes/video.js";
5
+ export type { EmojiOptions } from "./src/nodes/emoji.js";
package/lib/index.js CHANGED
@@ -1,15 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_VIDEO_HEIGHT = exports.DEFAULT_VIDEO_WIDTH = exports.Basic = exports.createSchema = exports.Schema = exports.Node = exports.defaultWidth = exports.defaultHeight = void 0;
4
- var resizable_node_attrs_1 = require("./src/resizable-node-attrs");
5
- Object.defineProperty(exports, "defaultHeight", { enumerable: true, get: function () { return resizable_node_attrs_1.defaultHeight; } });
6
- Object.defineProperty(exports, "defaultWidth", { enumerable: true, get: function () { return resizable_node_attrs_1.defaultWidth; } });
7
- var prosemirror_model_1 = require("prosemirror-model");
8
- Object.defineProperty(exports, "Node", { enumerable: true, get: function () { return prosemirror_model_1.Node; } });
9
- Object.defineProperty(exports, "Schema", { enumerable: true, get: function () { return prosemirror_model_1.Schema; } });
10
- var create_schema_1 = require("./src/create-schema");
11
- Object.defineProperty(exports, "createSchema", { enumerable: true, get: function () { return create_schema_1.createSchema; } });
12
- Object.defineProperty(exports, "Basic", { enumerable: true, get: function () { return create_schema_1.Basic; } });
13
- var video_1 = require("./src/nodes/video");
14
- Object.defineProperty(exports, "DEFAULT_VIDEO_WIDTH", { enumerable: true, get: function () { return video_1.DEFAULT_VIDEO_WIDTH; } });
15
- Object.defineProperty(exports, "DEFAULT_VIDEO_HEIGHT", { enumerable: true, get: function () { return video_1.DEFAULT_VIDEO_HEIGHT; } });
1
+ export { defaultHeight, defaultWidth } from "./src/resizable-node-attrs.js";
2
+ export { Node, Schema } from "prosemirror-model";
3
+ export { createSchema, Basic } from "./src/create-schema.js";
4
+ export { DEFAULT_VIDEO_WIDTH, DEFAULT_VIDEO_HEIGHT } from "./src/nodes/video.js";
@@ -1,6 +1,6 @@
1
1
  import type { Node } from "prosemirror-model";
2
2
  import { Schema, type NodeSpec, type MarkSpec } from "prosemirror-model";
3
- import type { EmojiOptions } from "./nodes/emoji";
3
+ import type { EmojiOptions } from "./nodes/emoji.js";
4
4
  type Params = {
5
5
  isImageBlockEnabled?: boolean;
6
6
  fiberyViewEnabled?: boolean;
@@ -1,83 +1,80 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Basic = exports.createSchema = void 0;
4
- const prosemirror_suggest_changes_1 = require("@handlewithcare/prosemirror-suggest-changes");
5
- const prosemirror_model_1 = require("prosemirror-model");
6
- const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
7
- const prosemirror_schema_list_1 = require("prosemirror-schema-list");
8
- const code_1 = require("./marks/code");
9
- const em_1 = require("./marks/em");
10
- const hint_query_1 = require("./marks/hint-query");
11
- const link_1 = require("./marks/link");
12
- const linked_highlight_1 = require("./marks/linked-highlight");
13
- const strike_1 = require("./marks/strike");
14
- const strong_1 = require("./marks/strong");
15
- const text_background_color_1 = require("./marks/text-background-color");
16
- const underline_1 = require("./marks/underline");
17
- const callout_1 = require("./nodes/callout");
18
- const check_item_1 = require("./nodes/check-item");
19
- const check_list_1 = require("./nodes/check-list");
20
- const code_block_1 = require("./nodes/code-block");
21
- const column_1 = require("./nodes/column");
22
- const columns_1 = require("./nodes/columns");
23
- const emoji_1 = require("./nodes/emoji");
24
- const entity_1 = require("./nodes/entity");
25
- const fibery_view_1 = require("./nodes/fibery-view");
26
- const file_1 = require("./nodes/file");
27
- const heading_1 = require("./nodes/heading");
28
- const image_block_1 = require("./nodes/image-block");
29
- const important_1 = require("./nodes/important");
30
- const math_display_1 = require("./nodes/math-display");
31
- const math_inline_1 = require("./nodes/math-inline");
32
- const media_1 = require("./nodes/media");
33
- const mention_1 = require("./nodes/mention");
34
- const note_1 = require("./nodes/note");
35
- const paragraph_1 = require("./nodes/paragraph");
36
- const table_nodes_1 = require("./nodes/table-nodes");
37
- const video_1 = require("./nodes/video");
38
- const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaToDom = null, isImageBlockEnabled = false, fiberyViewEnabled = false, emojiOptions, } = {}) => {
39
- prosemirror_schema_basic_1.nodes.code_block = code_block_1.code_block;
40
- prosemirror_schema_basic_1.nodes.paragraph = paragraph_1.paragraph;
41
- prosemirror_schema_basic_1.nodes.heading = (0, heading_1.makeHeading)({ headingToDOM });
42
- const base = new prosemirror_model_1.Schema({
43
- nodes: prosemirror_schema_basic_1.nodes,
1
+ import { deletion, insertion, modification } from "@handlewithcare/prosemirror-suggest-changes";
2
+ import { Schema } from "prosemirror-model";
3
+ import { marks, nodes } from "prosemirror-schema-basic";
4
+ import { addListNodes } from "prosemirror-schema-list";
5
+ import { code } from "./marks/code.js";
6
+ import { em } from "./marks/em.js";
7
+ import { hintQuery } from "./marks/hint-query.js";
8
+ import { link } from "./marks/link.js";
9
+ import { makeLinkedHighlight, makeLinkedHighlightEntity } from "./marks/linked-highlight.js";
10
+ import { strike } from "./marks/strike.js";
11
+ import { strong } from "./marks/strong.js";
12
+ import { textBackgroundColor } from "./marks/text-background-color.js";
13
+ import { underline } from "./marks/underline.js";
14
+ import { callout } from "./nodes/callout.js";
15
+ import { check_item } from "./nodes/check-item.js";
16
+ import { check_list } from "./nodes/check-list.js";
17
+ import { code_block } from "./nodes/code-block.js";
18
+ import { column } from "./nodes/column.js";
19
+ import { columns } from "./nodes/columns.js";
20
+ import { makeEmoji } from "./nodes/emoji.js";
21
+ import { entity } from "./nodes/entity.js";
22
+ import { fiberyView } from "./nodes/fibery-view.js";
23
+ import { file } from "./nodes/file.js";
24
+ import { makeHeading } from "./nodes/heading.js";
25
+ import { imageBlock } from "./nodes/image-block.js";
26
+ import { important } from "./nodes/important.js";
27
+ import { math_display } from "./nodes/math-display.js";
28
+ import { math_inline } from "./nodes/math-inline.js";
29
+ import { makeMedia } from "./nodes/media.js";
30
+ import { mention } from "./nodes/mention.js";
31
+ import { note } from "./nodes/note.js";
32
+ import { paragraph } from "./nodes/paragraph.js";
33
+ import { tableNodes } from "./nodes/table-nodes.js";
34
+ import { video } from "./nodes/video.js";
35
+ export const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaToDom = null, isImageBlockEnabled = false, fiberyViewEnabled = false, emojiOptions, } = {}) => {
36
+ nodes.code_block = code_block;
37
+ nodes.paragraph = paragraph;
38
+ nodes.heading = makeHeading({ headingToDOM });
39
+ const base = new Schema({
40
+ nodes,
44
41
  marks: {
45
- link: link_1.link,
46
- em: em_1.em,
47
- strong: strong_1.strong,
48
- code: code_1.code,
49
- linkedhighlight: (0, linked_highlight_1.makeLinkedHighlight)({ sharedColorGenerator }),
50
- linkedhighlightentity: (0, linked_highlight_1.makeLinkedHighlightEntity)({ sharedColorGenerator }),
42
+ link,
43
+ em,
44
+ strong,
45
+ code,
46
+ linkedhighlight: makeLinkedHighlight({ sharedColorGenerator }),
47
+ linkedhighlightentity: makeLinkedHighlightEntity({ sharedColorGenerator }),
51
48
  },
52
49
  });
53
50
  const customNodes = {
54
- note: note_1.note,
55
- important: important_1.important,
56
- entity: entity_1.entity,
57
- mention: mention_1.mention,
58
- media: (0, media_1.makeMedia)({ mediaToDom }),
59
- check_item: check_item_1.check_item,
60
- check_list: check_list_1.check_list,
61
- video: video_1.video,
62
- file: file_1.file,
63
- emoji: (0, emoji_1.makeEmoji)(emojiOptions),
64
- callout: callout_1.callout,
65
- columns: columns_1.columns,
66
- column: column_1.column,
67
- math_display: math_display_1.math_display,
68
- math_inline: math_inline_1.math_inline,
51
+ note,
52
+ important,
53
+ entity,
54
+ mention,
55
+ media: makeMedia({ mediaToDom }),
56
+ check_item,
57
+ check_list,
58
+ video,
59
+ file,
60
+ emoji: makeEmoji(emojiOptions),
61
+ callout,
62
+ columns,
63
+ column,
64
+ math_display,
65
+ math_inline,
69
66
  };
70
- let actualNodes = (0, prosemirror_schema_list_1.addListNodes)(base.spec.nodes, "paragraph block*", "block")
71
- .append({ ...table_nodes_1.tableNodes })
67
+ let actualNodes = addListNodes(base.spec.nodes, "paragraph block*", "block")
68
+ .append({ ...tableNodes })
72
69
  .append(customNodes);
73
70
  if (fiberyViewEnabled) {
74
- actualNodes = actualNodes.append({ fiberyView: fibery_view_1.fiberyView });
71
+ actualNodes = actualNodes.append({ fiberyView });
75
72
  }
76
73
  if (isImageBlockEnabled) {
77
- actualNodes = actualNodes.addToStart("imageBlock", image_block_1.imageBlock);
74
+ actualNodes = actualNodes.addToStart("imageBlock", imageBlock);
78
75
  }
79
76
  else {
80
- actualNodes = actualNodes.addToEnd("imageBlock", image_block_1.imageBlock);
77
+ actualNodes = actualNodes.addToEnd("imageBlock", imageBlock);
81
78
  }
82
79
  actualNodes = actualNodes.update("doc", {
83
80
  content: `(block | columns)+`,
@@ -183,28 +180,27 @@ const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaT
183
180
  return Object.keys(attrs).length ? ["li", attrs, 0] : ["li", 0];
184
181
  },
185
182
  });
186
- return new prosemirror_model_1.Schema({
183
+ return new Schema({
187
184
  nodes: actualNodes,
188
185
  marks: base.spec.marks
189
- .addToEnd("strike", strike_1.strike)
190
- .addToEnd("underline", underline_1.underline)
191
- .addToEnd("hintQuery", hint_query_1.hintQuery)
186
+ .addToEnd("strike", strike)
187
+ .addToEnd("underline", underline)
188
+ .addToEnd("hintQuery", hintQuery)
192
189
  // We leave mark key as "highlight" only because we don't want to do migration.
193
190
  // "TextBackgroundColor" term is used everywhere through codebase.
194
- .addToEnd("highlight", text_background_color_1.textBackgroundColor)
195
- .addToEnd("insertion", prosemirror_suggest_changes_1.insertion)
196
- .addToEnd("deletion", prosemirror_suggest_changes_1.deletion)
197
- .addToEnd("modification", prosemirror_suggest_changes_1.modification),
191
+ .addToEnd("highlight", textBackgroundColor)
192
+ .addToEnd("insertion", insertion)
193
+ .addToEnd("deletion", deletion)
194
+ .addToEnd("modification", modification),
198
195
  });
199
196
  };
200
- exports.createSchema = createSchema;
201
- exports.Basic = {
202
- nodes: prosemirror_schema_basic_1.nodes,
203
- marks: prosemirror_schema_basic_1.marks,
197
+ export const Basic = {
198
+ nodes,
199
+ marks,
204
200
  fibery: {
205
- link: link_1.link,
206
- strike: strike_1.strike,
207
- underline: underline_1.underline,
208
- textBackgroundColor: text_background_color_1.textBackgroundColor,
201
+ link,
202
+ strike,
203
+ underline,
204
+ textBackgroundColor,
209
205
  },
210
206
  };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.code = void 0;
4
1
  const codeDOM = ["code", 0];
5
2
  /**
6
3
  Code font mark. Represented as a `<code>` element.
7
4
  */
8
- exports.code = {
5
+ export const code = {
9
6
  parseDOM: [{ tag: "code" }],
10
7
  toDOM() {
11
8
  return codeDOM;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.em = void 0;
4
1
  const emDOM = ["em", 0];
5
2
  /**
6
3
  An emphasis mark. Rendered as an `<em>` element. Has parse rules
7
4
  that also match `<i>` and `font-style: italic`.
8
5
  */
9
- exports.em = {
6
+ export const em = {
10
7
  parseDOM: [
11
8
  { tag: "i" },
12
9
  { tag: "em" },
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hintQuery = void 0;
4
- exports.hintQuery = {
1
+ export const hintQuery = {
5
2
  excludes: "searchQuery",
6
3
  inclusive: true,
7
4
  group: "searchQuery",
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.link = void 0;
4
1
  const httpRegex = /^[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_+.~#?&/=]*$/;
5
2
  /**
6
3
  A link. Has `href` and `title` attributes. `title`
7
4
  defaults to the empty string. Rendered and parsed as an `<a>`
8
5
  element.
9
6
  */
10
- exports.link = {
7
+ export const link = {
11
8
  attrs: {
12
9
  href: {},
13
10
  title: { default: null },
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeLinkedHighlightEntity = exports.makeLinkedHighlight = void 0;
4
1
  const hyphenatePascal = (str) => str
5
2
  .replace(/([a-z])([A-Z])/g, "$1-$2")
6
3
  .replace(/([A-Z]{2})[a-z]/, "$1-")
@@ -48,13 +45,11 @@ const createMark = (markType, sharedColorGenerator) => {
48
45
  },
49
46
  };
50
47
  };
51
- const makeLinkedHighlight = ({ sharedColorGenerator }) => {
48
+ export const makeLinkedHighlight = ({ sharedColorGenerator }) => {
52
49
  // @ts-expect-error todo: fix this
53
50
  return createMark("linkedhighlight", sharedColorGenerator);
54
51
  };
55
- exports.makeLinkedHighlight = makeLinkedHighlight;
56
- const makeLinkedHighlightEntity = ({ sharedColorGenerator }) => {
52
+ export const makeLinkedHighlightEntity = ({ sharedColorGenerator }) => {
57
53
  // @ts-expect-error todo: fix this
58
54
  return createMark("linkedhighlightentity", sharedColorGenerator);
59
55
  };
60
- exports.makeLinkedHighlightEntity = makeLinkedHighlightEntity;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.strike = void 0;
4
- exports.strike = {
1
+ export const strike = {
5
2
  parseDOM: [{ tag: "strike" }, { style: "text-decoration=line-through" }],
6
3
  toDOM: () => ["strike"],
7
4
  };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.strong = void 0;
4
1
  const strongDOM = ["strong", 0];
5
2
  /**
6
3
  A strong mark. Rendered as `<strong>`, parse rules also match
7
4
  `<b>` and `font-weight: bold`.
8
5
  */
9
- exports.strong = {
6
+ export const strong = {
10
7
  parseDOM: [
11
8
  { tag: "strong" },
12
9
  // This works around a Google Docs misbehavior where
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.textBackgroundColor = void 0;
4
1
  var ColorToken;
5
2
  (function (ColorToken) {
6
3
  ColorToken["Yellow"] = "YELLOW";
@@ -51,7 +48,7 @@ const getClassName = (bgColorToken, fgColorToken) => {
51
48
  .filter(Boolean)
52
49
  .join(` `);
53
50
  };
54
- exports.textBackgroundColor = {
51
+ export const textBackgroundColor = {
55
52
  attrs: {
56
53
  guid: { default: "" },
57
54
  color: { default: undefined },
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.underline = void 0;
4
- exports.underline = {
1
+ export const underline = {
5
2
  parseDOM: [{ tag: "u" }, { style: "text-decoration=underline" }],
6
3
  toDOM: () => ["u"],
7
4
  };
@@ -21,7 +21,7 @@ export declare const callout: {
21
21
  icon: string | null;
22
22
  };
23
23
  }[];
24
- toDOM(node: import("../..").Node): [string, {
24
+ toDOM(node: import("prosemirror-model").Node): [string, {
25
25
  "data-callout-node": string;
26
26
  "data-color": any;
27
27
  "data-icon-type": any;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.callout = void 0;
4
1
  const nodeType = "data-callout-node";
5
- exports.callout = {
2
+ export const callout = {
6
3
  attrs: {
7
4
  color: { default: "#199EE3" },
8
5
  iconType: { default: "icon" },
@@ -1,5 +1,5 @@
1
1
  import type { NodeSpec } from "prosemirror-model";
2
- import type { Inline } from "./types/inline-content";
2
+ import type { Inline } from "./types/inline-content.js";
3
3
  export interface CheckItemDefinition {
4
4
  type: "check_item";
5
5
  content?: Array<Inline>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.check_item = void 0;
4
- const uuid_1 = require("uuid");
5
- exports.check_item = {
1
+ import { v4 as uuidv4 } from "uuid";
2
+ export const check_item = {
6
3
  content: "inline*",
7
4
  defining: true,
8
5
  selectable: true,
@@ -18,7 +15,7 @@ exports.check_item = {
18
15
  // also used by list-item we need to make sure that we run this parser first.
19
16
  priority: 100,
20
17
  getAttrs: (dom) => ({
21
- id: (0, uuid_1.v4)(),
18
+ id: uuidv4(),
22
19
  state: dom.getAttribute("data-check-item-state"),
23
20
  }),
24
21
  },
@@ -1,5 +1,5 @@
1
1
  import type { NodeSpec } from "prosemirror-model";
2
- import type { CheckItemDefinition } from "./check-item";
2
+ import type { CheckItemDefinition } from "./check-item.js";
3
3
  export interface CheckListContent extends Array<CheckItemDefinition | CheckListDefinition> {
4
4
  0: CheckItemDefinition;
5
5
  }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.check_list = void 0;
4
- const uuid_1 = require("uuid");
5
- exports.check_list = {
1
+ import { v4 as uuidv4 } from "uuid";
2
+ export const check_list = {
6
3
  group: "block",
7
4
  defining: true,
8
5
  selectable: true,
@@ -17,7 +14,7 @@ exports.check_list = {
17
14
  // also used by ordered-list we need to make sure that we run this parser first.
18
15
  priority: 100,
19
16
  getAttrs: () => ({
20
- id: (0, uuid_1.v4)(),
17
+ id: uuidv4(),
21
18
  }),
22
19
  },
23
20
  ],
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.code_block = void 0;
4
- const uuid_1 = require("uuid");
5
- const resizable_node_attrs_1 = require("../resizable-node-attrs");
1
+ import { v4 } from "uuid";
2
+ import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
6
3
  const getLanguageFromEditorStyle = (dom) => {
7
4
  return dom.getAttribute("data-language") || undefined;
8
5
  };
@@ -38,7 +35,7 @@ const removeLastNewLine = (dom) => {
38
35
  }
39
36
  return dom;
40
37
  };
41
- exports.code_block = {
38
+ export const code_block = {
42
39
  content: "text*",
43
40
  marks: "linkedhighlightentity linkedhighlight",
44
41
  group: "block",
@@ -50,7 +47,7 @@ exports.code_block = {
50
47
  language: { default: null },
51
48
  wrapCode: { default: false },
52
49
  mode: { default: "split" },
53
- ...(0, resizable_node_attrs_1.createDefaultAttrs)(),
50
+ ...createDefaultAttrs(),
54
51
  },
55
52
  parseDOM: [
56
53
  {
@@ -58,7 +55,7 @@ exports.code_block = {
58
55
  preserveWhitespace: "full",
59
56
  getAttrs: (domNode) => {
60
57
  const dom = domNode;
61
- const guid = dom.getAttribute("data-guid") || (0, uuid_1.v4)();
58
+ const guid = dom.getAttribute("data-guid") || v4();
62
59
  const language = getLanguageFromBitbucketStyle(dom.parentElement) ||
63
60
  getLanguageFromEditorStyle(dom.parentElement) ||
64
61
  getLanguageFromCode(dom) ||
@@ -66,7 +63,7 @@ exports.code_block = {
66
63
  const wrapCodeAttr = dom.getAttribute("data-wrap-code");
67
64
  const wrapCode = wrapCodeAttr === "true";
68
65
  removeLastNewLine(dom);
69
- return { guid, language, wrapCode, mode: dom.getAttribute("data-mode") || "split", ...(0, resizable_node_attrs_1.createParseDomAttrs)(dom) };
66
+ return { guid, language, wrapCode, mode: dom.getAttribute("data-mode") || "split", ...createParseDomAttrs(dom) };
70
67
  },
71
68
  },
72
69
  // Handle GitHub/Gist paste
@@ -92,7 +89,7 @@ exports.code_block = {
92
89
  "data-guid": guid,
93
90
  "data-wrap-code": node.attrs.wrapCode || false,
94
91
  "data-mode": node.attrs.mode || "split",
95
- ...(0, resizable_node_attrs_1.createToDomAttrs)(node.attrs),
92
+ ...createToDomAttrs(node.attrs),
96
93
  },
97
94
  0,
98
95
  ],
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.column = void 0;
4
- exports.column = {
1
+ export const column = {
5
2
  content: "block+",
6
3
  selectable: true,
7
4
  draggable: false,
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.columns = void 0;
4
- const resizable_node_attrs_1 = require("../resizable-node-attrs");
5
- exports.columns = {
1
+ import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
2
+ export const columns = {
6
3
  content: "column+",
7
4
  selectable: true,
8
5
  draggable: false,
9
6
  attrs: {
10
7
  id: { default: "" },
11
- ...(0, resizable_node_attrs_1.createDefaultAttrs)(),
8
+ ...createDefaultAttrs(),
12
9
  },
13
10
  parseDOM: [
14
11
  {
15
12
  tag: "div.fibery-columns-node",
16
13
  getAttrs: (domNode) => {
17
14
  const dom = domNode;
18
- return (0, resizable_node_attrs_1.createParseDomAttrs)(dom);
15
+ return createParseDomAttrs(dom);
19
16
  },
20
17
  },
21
18
  ],
@@ -30,7 +27,7 @@ exports.columns = {
30
27
  const attrs = {
31
28
  class: "fibery-columns-node",
32
29
  style: `display: grid; gap: 46px; grid-template-columns: ${gridTemplateColumns}`,
33
- ...(0, resizable_node_attrs_1.createToDomAttrs)(node.attrs),
30
+ ...createToDomAttrs(node.attrs),
34
31
  };
35
32
  return ["div", attrs, 0];
36
33
  },
@@ -16,14 +16,14 @@ export declare const makeEmoji: ({ getEmoji }?: EmojiOptions) => {
16
16
  group: string;
17
17
  selectable: false;
18
18
  draggable: false;
19
- leafText: (node: import("../..").Node) => any;
19
+ leafText: (node: import("prosemirror-model").Node) => any;
20
20
  parseDOM: {
21
21
  tag: string;
22
22
  getAttrs(domNode: HTMLElement): {
23
23
  code: string;
24
24
  };
25
25
  }[];
26
- toDOM(node: import("../..").Node): [string, {
26
+ toDOM(node: import("prosemirror-model").Node): [string, {
27
27
  "data-emoji-node": string;
28
28
  "data-emoji-code": any;
29
29
  }, any];
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeEmoji = void 0;
4
1
  const typeAttr = "data-emoji-node";
5
2
  const codeAttr = "data-emoji-code";
6
3
  const defaultOptions = {
@@ -8,7 +5,7 @@ const defaultOptions = {
8
5
  return;
9
6
  },
10
7
  };
11
- const makeEmoji = ({ getEmoji } = defaultOptions) => ({
8
+ export const makeEmoji = ({ getEmoji } = defaultOptions) => ({
12
9
  attrs: {
13
10
  code: {},
14
11
  },
@@ -48,4 +45,3 @@ const makeEmoji = ({ getEmoji } = defaultOptions) => ({
48
45
  return ["span", attrs, emoji ? emoji.native || `:${emoji.shortNames[0]}:` : code];
49
46
  },
50
47
  });
51
- exports.makeEmoji = makeEmoji;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.entity = void 0;
4
- exports.entity = {
1
+ export const entity = {
5
2
  inline: true,
6
3
  group: "inline",
7
4
  selectable: false,
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fiberyView = void 0;
4
- const resizable_node_attrs_1 = require("../resizable-node-attrs");
5
- exports.fiberyView = {
1
+ import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
2
+ export const fiberyView = {
6
3
  inline: false,
7
4
  group: "block",
8
5
  selectable: true,
@@ -10,7 +7,7 @@ exports.fiberyView = {
10
7
  draggable: false,
11
8
  attrs: {
12
9
  id: { default: "" },
13
- ...(0, resizable_node_attrs_1.createDefaultAttrs)(),
10
+ ...createDefaultAttrs(),
14
11
  },
15
12
  parseDOM: [
16
13
  {
@@ -19,7 +16,7 @@ exports.fiberyView = {
19
16
  const dom = domNode;
20
17
  return {
21
18
  id: dom.getAttribute("data-view-id"),
22
- ...(0, resizable_node_attrs_1.createParseDomAttrs)(dom),
19
+ ...createParseDomAttrs(dom),
23
20
  };
24
21
  },
25
22
  },
@@ -29,7 +26,7 @@ exports.fiberyView = {
29
26
  const attrs = {
30
27
  "data-view-id": id,
31
28
  contenteditable: "false",
32
- ...(0, resizable_node_attrs_1.createToDomAttrs)(node.attrs),
29
+ ...createToDomAttrs(node.attrs),
33
30
  };
34
31
  return ["div", attrs, ""];
35
32
  },
@@ -18,7 +18,7 @@ export declare const file: {
18
18
  group: string;
19
19
  selectable: false;
20
20
  draggable: false;
21
- leafText: (node: import("../..").Node) => any;
21
+ leafText: (node: import("prosemirror-model").Node) => any;
22
22
  parseDOM: {
23
23
  tag: string;
24
24
  getAttrs(domNode: HTMLElement): {
@@ -28,7 +28,7 @@ export declare const file: {
28
28
  type: string | null;
29
29
  };
30
30
  }[];
31
- toDOM(node: import("../..").Node): [string, {
31
+ toDOM(node: import("prosemirror-model").Node): [string, {
32
32
  "data-file-href": any;
33
33
  "data-size": any;
34
34
  "data-type": any;
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.file = void 0;
4
- const transcription_node_attrs_1 = require("../transcription-node-attrs");
5
- exports.file = {
1
+ import { createDefaultAttrs } from "../transcription-node-attrs.js";
2
+ export const file = {
6
3
  attrs: {
7
4
  src: {},
8
5
  title: { default: "Untitled" },
9
6
  size: {},
10
7
  type: {},
11
- ...(0, transcription_node_attrs_1.createDefaultAttrs)(),
8
+ ...createDefaultAttrs(),
12
9
  },
13
10
  inline: true,
14
11
  group: "inline",
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeHeading = void 0;
4
- const uuid_1 = require("uuid");
1
+ import { v4 } from "uuid";
5
2
  const parseGuid = (dom) => {
6
- return dom.getAttribute("guid") || (0, uuid_1.v4)();
3
+ return dom.getAttribute("guid") || v4();
7
4
  };
8
5
  const makeGetAttrs = (level) => (dom) => ({ level, guid: parseGuid(dom) });
9
- const makeHeading = ({ headingToDOM }) => ({
6
+ export const makeHeading = ({ headingToDOM }) => ({
10
7
  content: "inline*",
11
8
  group: "block",
12
9
  attrs: {
@@ -30,4 +27,3 @@ const makeHeading = ({ headingToDOM }) => ({
30
27
  return ["h" + node.attrs.level, { guid }, 0];
31
28
  },
32
29
  });
33
- exports.makeHeading = makeHeading;
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.imageBlock = void 0;
4
- const resizable_node_attrs_1 = require("../resizable-node-attrs");
5
- exports.imageBlock = {
1
+ import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
2
+ export const imageBlock = {
6
3
  attrs: {
7
4
  src: {},
8
5
  alt: { default: null },
9
6
  title: { default: null },
10
7
  size: { default: null },
11
8
  type: { default: null },
12
- ...(0, resizable_node_attrs_1.createDefaultAttrs)(),
9
+ ...createDefaultAttrs(),
13
10
  },
14
11
  inline: false,
15
12
  group: "block",
@@ -25,7 +22,7 @@ exports.imageBlock = {
25
22
  src: dom.getAttribute("src"),
26
23
  title: dom.getAttribute("title"),
27
24
  alt: dom.getAttribute("alt"),
28
- ...(0, resizable_node_attrs_1.createParseDomAttrs)(dom),
25
+ ...createParseDomAttrs(dom),
29
26
  };
30
27
  },
31
28
  },
@@ -36,7 +33,7 @@ exports.imageBlock = {
36
33
  src,
37
34
  alt,
38
35
  title,
39
- ...(0, resizable_node_attrs_1.createToDomAttrs)(node.attrs),
36
+ ...createToDomAttrs(node.attrs),
40
37
  };
41
38
  return ["div", {}, ["img", attrs]];
42
39
  },
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.important = void 0;
4
- exports.important = {
1
+ export const important = {
5
2
  content: "inline*",
6
3
  group: "block",
7
4
  parseDOM: [{ tag: "div.fibery-important" }],
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.math_display = void 0;
4
- exports.math_display = {
1
+ export const math_display = {
5
2
  // important!
6
3
  group: "block math",
7
4
  content: "text*", // important!
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.math_inline = void 0;
4
- exports.math_inline = {
1
+ export const math_inline = {
5
2
  // important!
6
3
  group: "inline math",
7
4
  content: "text*", // important!
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeMedia = void 0;
4
- const resizable_node_attrs_1 = require("../resizable-node-attrs");
1
+ import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
5
2
  function toBoolean(attr) {
6
3
  if (typeof attr === "boolean") {
7
4
  return attr;
@@ -23,7 +20,7 @@ function toNumberOrNull(value) {
23
20
  const parsed = parseFloat(value);
24
21
  return isNaN(parsed) ? null : parsed;
25
22
  }
26
- const makeMedia = ({ mediaToDom }) => ({
23
+ export const makeMedia = ({ mediaToDom }) => ({
27
24
  inline: false,
28
25
  attrs: {
29
26
  url: {},
@@ -36,7 +33,7 @@ const makeMedia = ({ mediaToDom }) => ({
36
33
  aspectRatio: {
37
34
  default: null,
38
35
  },
39
- ...(0, resizable_node_attrs_1.createDefaultAttrs)(),
36
+ ...createDefaultAttrs(),
40
37
  },
41
38
  group: "block",
42
39
  draggable: true,
@@ -50,7 +47,7 @@ const makeMedia = ({ mediaToDom }) => ({
50
47
  dynamicContent: htmlElement.getAttribute("data-dynamic-content") !== "false",
51
48
  aspectRatio: toNumberOrNull(htmlElement.getAttribute("data-aspect-ratio")),
52
49
  compatibleMode: toBoolean(htmlElement.getAttribute("data-compatible-mode")),
53
- ...(0, resizable_node_attrs_1.createParseDomAttrs)(htmlElement),
50
+ ...createParseDomAttrs(htmlElement),
54
51
  };
55
52
  },
56
53
  },
@@ -66,9 +63,8 @@ const makeMedia = ({ mediaToDom }) => ({
66
63
  "data-dynamic-content": typeof dynamicContent === "boolean" ? String(dynamicContent) : "false",
67
64
  "data-aspect-ratio": aspectRatio,
68
65
  contenteditable: "false",
69
- ...(0, resizable_node_attrs_1.createToDomAttrs)(node),
66
+ ...createToDomAttrs(node),
70
67
  };
71
68
  return ["div", attrs, url];
72
69
  },
73
70
  });
74
- exports.makeMedia = makeMedia;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mention = void 0;
4
- exports.mention = {
1
+ export const mention = {
5
2
  inline: true,
6
3
  group: "inline",
7
4
  selectable: false,
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.note = void 0;
4
- exports.note = {
1
+ export const note = {
5
2
  content: "inline*",
6
3
  group: "block",
7
4
  toDOM() {
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.paragraph = void 0;
4
- const uuid_1 = require("uuid");
5
- exports.paragraph = {
1
+ import { v4 } from "uuid";
2
+ export const paragraph = {
6
3
  content: "inline*",
7
4
  group: "block",
8
5
  attrs: {
@@ -12,7 +9,7 @@ exports.paragraph = {
12
9
  {
13
10
  tag: "p",
14
11
  getAttrs: (dom) => ({
15
- guid: dom.getAttribute("data-guid") || (0, uuid_1.v4)(),
12
+ guid: dom.getAttribute("data-guid") || v4(),
16
13
  }),
17
14
  },
18
15
  ],
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tableNodes = void 0;
4
- const prosemirror_tables_1 = require("prosemirror-tables");
5
- exports.tableNodes = (0, prosemirror_tables_1.tableNodes)({
1
+ import { tableNodes as prosemirrorTableNodes } from "prosemirror-tables";
2
+ export const tableNodes = prosemirrorTableNodes({
6
3
  tableGroup: "block",
7
4
  cellContent: "block+",
8
5
  cellAttributes: {
@@ -1,6 +1,6 @@
1
- import type { EntityDefinition as Entity } from "../entity";
2
- import type { MentionDefinition as Mention } from "../mention";
3
- import type { TextDefinition as Text } from "./text";
1
+ import type { EntityDefinition as Entity } from "../entity.js";
2
+ import type { MentionDefinition as Mention } from "../mention.js";
3
+ import type { TextDefinition as Text } from "./text.js";
4
4
  interface MarksObject<T> {
5
5
  marks?: Array<T>;
6
6
  }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.video = exports.DEFAULT_VIDEO_HEIGHT = exports.DEFAULT_VIDEO_WIDTH = void 0;
4
- const resizable_node_attrs_1 = require("../resizable-node-attrs");
5
- const transcription_node_attrs_1 = require("../transcription-node-attrs");
6
- exports.DEFAULT_VIDEO_WIDTH = 400;
7
- exports.DEFAULT_VIDEO_HEIGHT = 200;
8
- exports.video = {
1
+ import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
2
+ import { createDefaultAttrs as createTranscriptionDefaultAttrs } from "../transcription-node-attrs.js";
3
+ export const DEFAULT_VIDEO_WIDTH = 400;
4
+ export const DEFAULT_VIDEO_HEIGHT = 200;
5
+ export const video = {
9
6
  inline: false,
10
7
  attrs: {
11
8
  src: {},
12
9
  type: {},
13
- width: { default: exports.DEFAULT_VIDEO_WIDTH },
14
- height: { default: exports.DEFAULT_VIDEO_HEIGHT },
10
+ width: { default: DEFAULT_VIDEO_WIDTH },
11
+ height: { default: DEFAULT_VIDEO_HEIGHT },
15
12
  title: { default: "" },
16
13
  alignment: { default: ":alignment/block-center" },
17
- ...(0, resizable_node_attrs_1.createDefaultAttrs)(),
18
- ...(0, transcription_node_attrs_1.createDefaultAttrs)(),
14
+ ...createDefaultAttrs(),
15
+ ...createTranscriptionDefaultAttrs(),
19
16
  },
20
17
  group: "block",
21
18
  draggable: true,
@@ -27,16 +24,16 @@ exports.video = {
27
24
  return {
28
25
  src: dom.getAttribute("src"),
29
26
  type: dom.getAttribute("type"),
30
- width: Number(dom.getAttribute("width")) || exports.DEFAULT_VIDEO_WIDTH,
31
- height: Number(dom.getAttribute("height")) || exports.DEFAULT_VIDEO_HEIGHT,
27
+ width: Number(dom.getAttribute("width")) || DEFAULT_VIDEO_WIDTH,
28
+ height: Number(dom.getAttribute("height")) || DEFAULT_VIDEO_HEIGHT,
32
29
  title: dom.getAttribute("title"),
33
- ...(0, resizable_node_attrs_1.createParseDomAttrs)(dom),
30
+ ...createParseDomAttrs(dom),
34
31
  };
35
32
  },
36
33
  },
37
34
  ],
38
35
  toDOM(node) {
39
- const { src, type, width = exports.DEFAULT_VIDEO_WIDTH, height = exports.DEFAULT_VIDEO_HEIGHT, title } = node.attrs;
36
+ const { src, type, width = DEFAULT_VIDEO_WIDTH, height = DEFAULT_VIDEO_HEIGHT, title } = node.attrs;
40
37
  return [
41
38
  "video",
42
39
  {
@@ -48,7 +45,7 @@ exports.video = {
48
45
  playsinline: "",
49
46
  controls: "",
50
47
  preload: "metadata",
51
- ...(0, resizable_node_attrs_1.createToDomAttrs)(node.attrs),
48
+ ...createToDomAttrs(node.attrs),
52
49
  },
53
50
  ];
54
51
  },
@@ -1,18 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultWidth = exports.defaultHeight = void 0;
4
- exports.createDefaultAttrs = createDefaultAttrs;
5
- exports.createParseDomAttrs = createParseDomAttrs;
6
- exports.createToDomAttrs = createToDomAttrs;
7
- exports.defaultHeight = 400;
8
- exports.defaultWidth = 900;
9
- function createDefaultAttrs() {
1
+ export const defaultHeight = 400;
2
+ export const defaultWidth = 900;
3
+ export function createDefaultAttrs() {
10
4
  return {
11
5
  nodeHeight: {
12
- default: exports.defaultHeight,
6
+ default: defaultHeight,
13
7
  },
14
8
  nodeWidth: {
15
- default: exports.defaultWidth,
9
+ default: defaultWidth,
16
10
  },
17
11
  nodePageWidth: {
18
12
  default: true,
@@ -22,7 +16,7 @@ function createDefaultAttrs() {
22
16
  },
23
17
  };
24
18
  }
25
- function createParseDomAttrs(dom) {
19
+ export function createParseDomAttrs(dom) {
26
20
  return {
27
21
  nodeHeight: dom.getAttribute("data-node-height"),
28
22
  nodeWidth: dom.getAttribute("data-node-width"),
@@ -30,7 +24,7 @@ function createParseDomAttrs(dom) {
30
24
  nodeFullWidth: dom.getAttribute("data-node-full-width"),
31
25
  };
32
26
  }
33
- function createToDomAttrs({ nodeHeight, nodeWidth, nodePageWidth, nodeFullWidth }) {
27
+ export function createToDomAttrs({ nodeHeight, nodeWidth, nodePageWidth, nodeFullWidth }) {
34
28
  return {
35
29
  "data-node-height": nodeHeight,
36
30
  "data-node-width": nodeWidth,
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDefaultAttrs = createDefaultAttrs;
4
- function createDefaultAttrs() {
1
+ export function createDefaultAttrs() {
5
2
  return {
6
3
  transcription: {
7
4
  default: { status: "IDLE", userId: "", inserted: false },
@@ -1,21 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toHTML = exports.toDOM = exports.fromHTML = void 0;
4
- const prosemirror_model_1 = require("prosemirror-model");
5
- const fromHTML = (html, schema, options) => {
1
+ import { DOMParser, DOMSerializer, Fragment } from "prosemirror-model";
2
+ export const fromHTML = (html, schema, options) => {
6
3
  const el = document.createElement("div");
7
4
  el.innerHTML = html;
8
- return prosemirror_model_1.DOMParser.fromSchema(schema).parse(el, options);
5
+ return DOMParser.fromSchema(schema).parse(el, options);
9
6
  };
10
- exports.fromHTML = fromHTML;
11
- const toDOM = (node, schema) => {
12
- const serializer = prosemirror_model_1.DOMSerializer.fromSchema(schema);
13
- return serializer.serializeFragment(prosemirror_model_1.Fragment.from(node));
7
+ export const toDOM = (node, schema) => {
8
+ const serializer = DOMSerializer.fromSchema(schema);
9
+ return serializer.serializeFragment(Fragment.from(node));
14
10
  };
15
- exports.toDOM = toDOM;
16
- const toHTML = (node, schema) => {
11
+ export const toHTML = (node, schema) => {
17
12
  const el = document.createElement("div");
18
- el.appendChild((0, exports.toDOM)(node, schema));
13
+ el.appendChild(toDOM(node, schema));
19
14
  return el.innerHTML;
20
15
  };
21
- exports.toHTML = toHTML;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@fibery/prosemirror-schema",
3
- "version": "4.19.0-next.0",
3
+ "version": "4.19.0-next.2",
4
4
  "private": false,
5
5
  "description": "Fibery prosemirror schema",
6
6
  "files": [
7
7
  "/lib"
8
8
  ],
9
+ "type": "module",
9
10
  "main": "./lib/index.js",
10
11
  "exports": {
11
12
  ".": {