@fibery/prosemirror-schema 4.22.0 → 4.23.0

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 (79) hide show
  1. package/lib/index.d.ts +10 -10
  2. package/lib/index.js +9 -31
  3. package/lib/src/attr-constraints.d.ts +15 -12
  4. package/lib/src/attr-constraints.js +128 -168
  5. package/lib/src/block-id-utils.d.ts +10 -7
  6. package/lib/src/block-id-utils.js +16 -39
  7. package/lib/src/create-schema.d.ts +16 -15
  8. package/lib/src/create-schema.js +204 -249
  9. package/lib/src/marks/code.d.ts +5 -2
  10. package/lib/src/marks/code.js +10 -10
  11. package/lib/src/marks/em.d.ts +5 -2
  12. package/lib/src/marks/em.js +19 -16
  13. package/lib/src/marks/hint-query.d.ts +5 -2
  14. package/lib/src/marks/hint-query.js +19 -22
  15. package/lib/src/marks/link.d.ts +5 -2
  16. package/lib/src/marks/link.js +40 -36
  17. package/lib/src/marks/linked-highlight.d.ts +9 -7
  18. package/lib/src/marks/linked-highlight.js +38 -51
  19. package/lib/src/marks/strike.d.ts +5 -2
  20. package/lib/src/marks/strike.js +6 -6
  21. package/lib/src/marks/strong.d.ts +5 -2
  22. package/lib/src/marks/strong.js +29 -29
  23. package/lib/src/marks/text-background-color.d.ts +15 -12
  24. package/lib/src/marks/text-background-color.js +63 -81
  25. package/lib/src/marks/underline.d.ts +5 -2
  26. package/lib/src/marks/underline.js +6 -6
  27. package/lib/src/nodes/callout.d.ts +29 -26
  28. package/lib/src/nodes/callout.js +55 -58
  29. package/lib/src/nodes/check-item.d.ts +13 -10
  30. package/lib/src/nodes/check-item.js +32 -33
  31. package/lib/src/nodes/check-list.d.ts +14 -11
  32. package/lib/src/nodes/check-list.js +23 -30
  33. package/lib/src/nodes/code-block.d.ts +5 -2
  34. package/lib/src/nodes/code-block.js +70 -101
  35. package/lib/src/nodes/column.d.ts +5 -2
  36. package/lib/src/nodes/column.js +28 -34
  37. package/lib/src/nodes/columns.d.ts +5 -2
  38. package/lib/src/nodes/columns.js +34 -36
  39. package/lib/src/nodes/emoji.d.ts +28 -26
  40. package/lib/src/nodes/emoji.js +38 -47
  41. package/lib/src/nodes/entity.d.ts +18 -16
  42. package/lib/src/nodes/entity.js +48 -49
  43. package/lib/src/nodes/fibery-view.d.ts +5 -2
  44. package/lib/src/nodes/fibery-view.js +38 -42
  45. package/lib/src/nodes/file.d.ts +37 -34
  46. package/lib/src/nodes/file.js +41 -40
  47. package/lib/src/nodes/heading.d.ts +6 -3
  48. package/lib/src/nodes/heading.js +57 -33
  49. package/lib/src/nodes/image-block.d.ts +5 -2
  50. package/lib/src/nodes/image-block.js +43 -42
  51. package/lib/src/nodes/important.d.ts +5 -2
  52. package/lib/src/nodes/important.js +14 -10
  53. package/lib/src/nodes/math-display.d.ts +5 -2
  54. package/lib/src/nodes/math-display.js +14 -15
  55. package/lib/src/nodes/math-inline.d.ts +5 -2
  56. package/lib/src/nodes/math-inline.js +14 -15
  57. package/lib/src/nodes/media.d.ts +6 -3
  58. package/lib/src/nodes/media.js +52 -68
  59. package/lib/src/nodes/mention.d.ts +12 -9
  60. package/lib/src/nodes/mention.js +36 -37
  61. package/lib/src/nodes/note.d.ts +5 -2
  62. package/lib/src/nodes/note.js +14 -10
  63. package/lib/src/nodes/paragraph.d.ts +5 -2
  64. package/lib/src/nodes/paragraph.js +32 -26
  65. package/lib/src/nodes/table-nodes.d.ts +5 -2
  66. package/lib/src/nodes/table-nodes.js +16 -20
  67. package/lib/src/nodes/types/inline-content.d.ts +10 -8
  68. package/lib/src/nodes/types/inline-content.js +0 -2
  69. package/lib/src/nodes/types/text.d.ts +7 -4
  70. package/lib/src/nodes/types/text.js +0 -2
  71. package/lib/src/nodes/video.d.ts +7 -4
  72. package/lib/src/nodes/video.js +49 -54
  73. package/lib/src/resizable-node-attrs.d.ts +29 -26
  74. package/lib/src/resizable-node-attrs.js +23 -34
  75. package/lib/src/transcription-node-attrs.d.ts +10 -7
  76. package/lib/src/transcription-node-attrs.js +8 -8
  77. package/lib/test-helpers/index.d.ts +7 -4
  78. package/lib/test-helpers/index.js +11 -15
  79. package/package.json +11 -4
@@ -1,251 +1,206 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Basic = exports.createSchema = void 0;
4
- const prosemirror_model_1 = require("prosemirror-model");
5
- const prosemirror_schema_basic_1 = require("prosemirror-schema-basic");
6
- const prosemirror_schema_list_1 = require("prosemirror-schema-list");
7
- const code_1 = require("./marks/code");
8
- const em_1 = require("./marks/em");
9
- const hint_query_1 = require("./marks/hint-query");
10
- const link_1 = require("./marks/link");
11
- const linked_highlight_1 = require("./marks/linked-highlight");
12
- const strike_1 = require("./marks/strike");
13
- const strong_1 = require("./marks/strong");
14
- const text_background_color_1 = require("./marks/text-background-color");
15
- const underline_1 = require("./marks/underline");
16
- const callout_1 = require("./nodes/callout");
17
- const check_item_1 = require("./nodes/check-item");
18
- const check_list_1 = require("./nodes/check-list");
19
- const code_block_1 = require("./nodes/code-block");
20
- const column_1 = require("./nodes/column");
21
- const columns_1 = require("./nodes/columns");
22
- const emoji_1 = require("./nodes/emoji");
23
- const entity_1 = require("./nodes/entity");
24
- const fibery_view_1 = require("./nodes/fibery-view");
25
- const file_1 = require("./nodes/file");
26
- const heading_1 = require("./nodes/heading");
27
- const image_block_1 = require("./nodes/image-block");
28
- const important_1 = require("./nodes/important");
29
- const math_display_1 = require("./nodes/math-display");
30
- const math_inline_1 = require("./nodes/math-inline");
31
- const media_1 = require("./nodes/media");
32
- const mention_1 = require("./nodes/mention");
33
- const note_1 = require("./nodes/note");
34
- const paragraph_1 = require("./nodes/paragraph");
35
- const table_nodes_1 = require("./nodes/table-nodes");
36
- const video_1 = require("./nodes/video");
37
- const createSchema = ({ sharedColorGenerator = null, headingToDOM = null, mediaToDom = null, isImageBlockEnabled = false, fiberyViewEnabled = false, emojiOptions, } = {}) => {
38
- prosemirror_schema_basic_1.nodes.code_block = code_block_1.code_block;
39
- prosemirror_schema_basic_1.nodes.paragraph = paragraph_1.paragraph;
40
- prosemirror_schema_basic_1.nodes.heading = (0, heading_1.makeHeading)({ headingToDOM });
41
- const base = new prosemirror_model_1.Schema({
42
- nodes: prosemirror_schema_basic_1.nodes,
43
- marks: {
44
- link: link_1.link,
45
- em: em_1.em,
46
- strong: strong_1.strong,
47
- code: code_1.code,
48
- linkedhighlight: (0, linked_highlight_1.makeLinkedHighlight)({ sharedColorGenerator }),
49
- linkedhighlightentity: (0, linked_highlight_1.makeLinkedHighlightEntity)({ sharedColorGenerator }),
50
- },
51
- });
52
- const customNodes = {
53
- note: note_1.note,
54
- important: important_1.important,
55
- entity: entity_1.entity,
56
- mention: mention_1.mention,
57
- media: (0, media_1.makeMedia)({ mediaToDom }),
58
- check_item: check_item_1.check_item,
59
- check_list: check_list_1.check_list,
60
- video: video_1.video,
61
- file: file_1.file,
62
- emoji: (0, emoji_1.makeEmoji)(emojiOptions),
63
- callout: (0, callout_1.makeCallout)(emojiOptions),
64
- columns: columns_1.columns,
65
- column: column_1.column,
66
- math_display: math_display_1.math_display,
67
- math_inline: math_inline_1.math_inline,
68
- };
69
- let actualNodes = (0, prosemirror_schema_list_1.addListNodes)(base.spec.nodes, "paragraph block*", "block")
70
- .append({ ...table_nodes_1.tableNodes })
71
- .append(customNodes);
72
- if (fiberyViewEnabled) {
73
- actualNodes = actualNodes.append({ fiberyView: fibery_view_1.fiberyView });
74
- }
75
- if (isImageBlockEnabled) {
76
- actualNodes = actualNodes.addToStart("imageBlock", image_block_1.imageBlock);
77
- }
78
- else {
79
- actualNodes = actualNodes.addToEnd("imageBlock", image_block_1.imageBlock);
80
- }
81
- actualNodes = actualNodes.update("doc", {
82
- content: `(block | columns)+`,
83
- });
84
- // prosemirror-tables@1.7.0+ added validate constraints to cell attrs
85
- // (colspan, rowspan, colwidth). Legacy Fibery documents may not satisfy
86
- // these validators. Drop all validators so those documents can still be parsed.
87
- for (const cellType of ["table_cell", "table_header"]) {
88
- const cellSpec = actualNodes.get(cellType);
89
- const attrsWithoutValidate = {};
90
- for (const [key, attrSpec] of Object.entries(cellSpec.attrs ?? {})) {
91
- const { validate: _, ...rest } = attrSpec;
92
- attrsWithoutValidate[key] = rest;
93
- }
94
- actualNodes = actualNodes.update(cellType, {
95
- ...cellSpec,
96
- attrs: attrsWithoutValidate,
97
- });
98
- }
99
- // prosemirror-schema-list@1.5.0+ added validate:"number" to the order attr,
100
- // which rejects legacy documents where order was stored as null. Drop the
101
- // validator so those documents can still be parsed.
102
- const orderedListSpec = actualNodes.get("ordered_list");
103
- actualNodes = actualNodes.update("ordered_list", {
104
- ...orderedListSpec,
105
- attrs: { order: { default: 1 } },
106
- });
107
- const listItemSpec = actualNodes.get("list_item");
108
- actualNodes = actualNodes.update("list_item", {
109
- ...listItemSpec,
110
- attrs: {
111
- ...listItemSpec.attrs,
112
- state: { default: null },
113
- id: { default: null },
114
- },
115
- parseDOM: [
116
- {
117
- tag: "li[data-check-item-state]",
118
- getAttrs: (dom) => {
119
- const el = dom;
120
- const state = el.getAttribute("data-check-item-state");
121
- // Strip the "[] "/"[x] " text prefix added by the clipboard serializer so
122
- // it doesn't appear as document content when pasting back into Fibery.
123
- // getAttrs runs before ProseMirror walks the children, so mutation is safe.
124
- const firstBlock = el.firstChild;
125
- if (firstBlock !== null && firstBlock.nodeType === 1 /* ELEMENT_NODE */) {
126
- const firstText = firstBlock.firstChild;
127
- if (firstText !== null && firstText.nodeType === 3 /* TEXT_NODE */) {
128
- const text = firstText.textContent ?? "";
129
- if (text.startsWith("[ ] ") || text.startsWith("[x] ")) {
130
- const rest = text.slice(4);
131
- if (rest) {
132
- firstText.textContent = rest;
133
- }
134
- else {
135
- firstBlock.removeChild(firstText);
136
- }
137
- }
138
- }
139
- }
140
- return {
141
- state: state === "TODO" || state === "DONE" ? state : null,
142
- id: el.getAttribute("data-list-item-id") ?? null,
143
- };
144
- },
145
- },
146
- {
147
- tag: "li",
148
- getAttrs: (dom) => {
149
- const el = dom;
150
- const firstChild = el.firstChild;
151
- if (firstChild === null) {
152
- return false;
153
- }
154
- // Support pasting from external editors that output [ ] / [x] as text
155
- // without data-check-item-state. Check text directly in <li> or inside
156
- // the first block element (e.g. <p>).
157
- let textNode = null;
158
- let textParent = null;
159
- if (firstChild.nodeType === 3 /* TEXT_NODE */) {
160
- textNode = firstChild;
161
- textParent = el;
162
- }
163
- else if (firstChild.nodeType === 1 /* ELEMENT_NODE */ && firstChild.firstChild?.nodeType === 3) {
164
- textNode = firstChild.firstChild;
165
- textParent = firstChild;
166
- }
167
- if (textNode === null) {
168
- return false;
169
- }
170
- const text = textNode.textContent ?? "";
171
- const state = text.startsWith("[ ] ") ? "TODO" : text.startsWith("[x] ") ? "DONE" : null;
172
- if (state === null) {
173
- return false;
174
- }
175
- const rest = text.slice(4);
176
- if (rest) {
177
- textNode.textContent = rest;
178
- }
179
- else {
180
- textParent.removeChild(textNode);
181
- }
182
- return { state, id: null };
183
- },
184
- },
185
- { tag: "li" },
186
- ],
187
- toDOM(node) {
188
- const { state, id } = node.attrs;
189
- const attrs = {};
190
- if (state) {
191
- attrs["data-check-item-state"] = state;
192
- }
193
- if (id) {
194
- attrs["data-list-item-id"] = id;
195
- }
196
- return Object.keys(attrs).length ? ["li", attrs, 0] : ["li", 0];
197
- },
198
- });
199
- // Every block node carries a unified "id" attr so blocks are addressable in
200
- // collaborative editing and block-level APIs. paragraph/heading/code_block
201
- // declare it in their own specs (mirrored into the deprecated "guid");
202
- // check_list/check_item/columns/fiberyView/list_item already have "id".
203
- // toDOM/parseDOM are deliberately left untouched here so pasted HTML never
204
- // carries an id and cannot introduce duplicates.
205
- const blocksNeedingId = [
206
- "blockquote",
207
- "horizontal_rule",
208
- "bullet_list",
209
- "ordered_list",
210
- "table",
211
- "table_row",
212
- "table_cell",
213
- "table_header",
214
- "note",
215
- "important",
216
- "callout",
217
- "media",
218
- "video",
219
- "imageBlock",
220
- "math_display",
221
- "column",
222
- ];
223
- for (const name of blocksNeedingId) {
224
- const spec = actualNodes.get(name);
225
- actualNodes = actualNodes.update(name, {
226
- ...spec,
227
- attrs: { ...spec.attrs, id: { default: null } },
228
- });
229
- }
230
- return new prosemirror_model_1.Schema({
231
- nodes: actualNodes,
232
- marks: base.spec.marks
233
- .addToEnd("strike", strike_1.strike)
234
- .addToEnd("underline", underline_1.underline)
235
- .addToEnd("hintQuery", hint_query_1.hintQuery)
236
- // We leave mark key as "highlight" only because we don't want to do migration.
237
- // "TextBackgroundColor" term is used everywhere through codebase.
238
- .addToEnd("highlight", text_background_color_1.textBackgroundColor),
239
- });
1
+ import { code } from "./marks/code.js";
2
+ import { em } from "./marks/em.js";
3
+ import { hintQuery } from "./marks/hint-query.js";
4
+ import { link } from "./marks/link.js";
5
+ import { makeLinkedHighlight, makeLinkedHighlightEntity } from "./marks/linked-highlight.js";
6
+ import { strike } from "./marks/strike.js";
7
+ import { strong } from "./marks/strong.js";
8
+ import { textBackgroundColor } from "./marks/text-background-color.js";
9
+ import { underline } from "./marks/underline.js";
10
+ import { makeCallout } from "./nodes/callout.js";
11
+ import { check_item } from "./nodes/check-item.js";
12
+ import { check_list } from "./nodes/check-list.js";
13
+ import { code_block } from "./nodes/code-block.js";
14
+ import { column } from "./nodes/column.js";
15
+ import { columns } from "./nodes/columns.js";
16
+ import { makeEmoji } from "./nodes/emoji.js";
17
+ import { entity } from "./nodes/entity.js";
18
+ import { fiberyView } from "./nodes/fibery-view.js";
19
+ import { file } from "./nodes/file.js";
20
+ import { makeHeading } from "./nodes/heading.js";
21
+ import { imageBlock } from "./nodes/image-block.js";
22
+ import { important } from "./nodes/important.js";
23
+ import { math_display } from "./nodes/math-display.js";
24
+ import { math_inline } from "./nodes/math-inline.js";
25
+ import { makeMedia } from "./nodes/media.js";
26
+ import { mention } from "./nodes/mention.js";
27
+ import { note } from "./nodes/note.js";
28
+ import { paragraph } from "./nodes/paragraph.js";
29
+ import { tableNodes } from "./nodes/table-nodes.js";
30
+ import { video } from "./nodes/video.js";
31
+ import { Schema } from "prosemirror-model";
32
+ import { marks, nodes } from "prosemirror-schema-basic";
33
+ import { addListNodes } from "prosemirror-schema-list";
34
+ //#region src/create-schema.ts
35
+ 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,
41
+ marks: {
42
+ link,
43
+ em,
44
+ strong,
45
+ code,
46
+ linkedhighlight: makeLinkedHighlight({ sharedColorGenerator }),
47
+ linkedhighlightentity: makeLinkedHighlightEntity({ sharedColorGenerator })
48
+ }
49
+ });
50
+ const customNodes = {
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: makeCallout(emojiOptions),
62
+ columns,
63
+ column,
64
+ math_display,
65
+ math_inline
66
+ };
67
+ let actualNodes = addListNodes(base.spec.nodes, "paragraph block*", "block").append({ ...tableNodes }).append(customNodes);
68
+ if (fiberyViewEnabled) actualNodes = actualNodes.append({ fiberyView });
69
+ if (isImageBlockEnabled) actualNodes = actualNodes.addToStart("imageBlock", imageBlock);
70
+ else actualNodes = actualNodes.addToEnd("imageBlock", imageBlock);
71
+ actualNodes = actualNodes.update("doc", { content: `(block | columns)+` });
72
+ for (const cellType of ["table_cell", "table_header"]) {
73
+ const cellSpec = actualNodes.get(cellType);
74
+ const attrsWithoutValidate = {};
75
+ for (const [key, attrSpec] of Object.entries(cellSpec.attrs ?? {})) {
76
+ const { validate: _, ...rest } = attrSpec;
77
+ attrsWithoutValidate[key] = rest;
78
+ }
79
+ actualNodes = actualNodes.update(cellType, {
80
+ ...cellSpec,
81
+ attrs: attrsWithoutValidate
82
+ });
83
+ }
84
+ const orderedListSpec = actualNodes.get("ordered_list");
85
+ actualNodes = actualNodes.update("ordered_list", {
86
+ ...orderedListSpec,
87
+ attrs: { order: { default: 1 } }
88
+ });
89
+ const listItemSpec = actualNodes.get("list_item");
90
+ actualNodes = actualNodes.update("list_item", {
91
+ ...listItemSpec,
92
+ attrs: {
93
+ ...listItemSpec.attrs,
94
+ state: { default: null },
95
+ id: { default: null }
96
+ },
97
+ parseDOM: [
98
+ {
99
+ tag: "li[data-check-item-state]",
100
+ getAttrs: (dom) => {
101
+ const el = dom;
102
+ const state = el.getAttribute("data-check-item-state");
103
+ const firstBlock = el.firstChild;
104
+ if (firstBlock !== null && firstBlock.nodeType === 1) {
105
+ const firstText = firstBlock.firstChild;
106
+ if (firstText !== null && firstText.nodeType === 3) {
107
+ const text = firstText.textContent ?? "";
108
+ if (text.startsWith("[ ] ") || text.startsWith("[x] ")) {
109
+ const rest = text.slice(4);
110
+ if (rest) firstText.textContent = rest;
111
+ else firstBlock.removeChild(firstText);
112
+ }
113
+ }
114
+ }
115
+ return {
116
+ state: state === "TODO" || state === "DONE" ? state : null,
117
+ id: el.getAttribute("data-list-item-id") ?? null
118
+ };
119
+ }
120
+ },
121
+ {
122
+ tag: "li",
123
+ getAttrs: (dom) => {
124
+ const el = dom;
125
+ const firstChild = el.firstChild;
126
+ if (firstChild === null) return false;
127
+ let textNode = null;
128
+ let textParent = null;
129
+ if (firstChild.nodeType === 3) {
130
+ textNode = firstChild;
131
+ textParent = el;
132
+ } else if (firstChild.nodeType === 1 && firstChild.firstChild?.nodeType === 3) {
133
+ textNode = firstChild.firstChild;
134
+ textParent = firstChild;
135
+ }
136
+ if (textNode === null) return false;
137
+ const text = textNode.textContent ?? "";
138
+ const state = text.startsWith("[ ] ") ? "TODO" : text.startsWith("[x] ") ? "DONE" : null;
139
+ if (state === null) return false;
140
+ const rest = text.slice(4);
141
+ if (rest) textNode.textContent = rest;
142
+ else textParent.removeChild(textNode);
143
+ return {
144
+ state,
145
+ id: null
146
+ };
147
+ }
148
+ },
149
+ { tag: "li" }
150
+ ],
151
+ toDOM(node) {
152
+ const { state, id } = node.attrs;
153
+ const attrs = {};
154
+ if (state) attrs["data-check-item-state"] = state;
155
+ if (id) attrs["data-list-item-id"] = id;
156
+ return Object.keys(attrs).length ? [
157
+ "li",
158
+ attrs,
159
+ 0
160
+ ] : ["li", 0];
161
+ }
162
+ });
163
+ for (const name of [
164
+ "blockquote",
165
+ "horizontal_rule",
166
+ "bullet_list",
167
+ "ordered_list",
168
+ "table",
169
+ "table_row",
170
+ "table_cell",
171
+ "table_header",
172
+ "note",
173
+ "important",
174
+ "callout",
175
+ "media",
176
+ "video",
177
+ "imageBlock",
178
+ "math_display",
179
+ "column"
180
+ ]) {
181
+ const spec = actualNodes.get(name);
182
+ actualNodes = actualNodes.update(name, {
183
+ ...spec,
184
+ attrs: {
185
+ ...spec.attrs,
186
+ id: { default: null }
187
+ }
188
+ });
189
+ }
190
+ return new Schema({
191
+ nodes: actualNodes,
192
+ marks: base.spec.marks.addToEnd("strike", strike).addToEnd("underline", underline).addToEnd("hintQuery", hintQuery).addToEnd("highlight", textBackgroundColor)
193
+ });
240
194
  };
241
- exports.createSchema = createSchema;
242
- exports.Basic = {
243
- nodes: prosemirror_schema_basic_1.nodes,
244
- marks: prosemirror_schema_basic_1.marks,
245
- fibery: {
246
- link: link_1.link,
247
- strike: strike_1.strike,
248
- underline: underline_1.underline,
249
- textBackgroundColor: text_background_color_1.textBackgroundColor,
250
- },
195
+ const Basic = {
196
+ nodes,
197
+ marks,
198
+ fibery: {
199
+ link,
200
+ strike,
201
+ underline,
202
+ textBackgroundColor
203
+ }
251
204
  };
205
+ //#endregion
206
+ export { Basic, createSchema };
@@ -1,5 +1,8 @@
1
- import type { MarkSpec } from "prosemirror-model";
1
+ import { MarkSpec } from "prosemirror-model";
2
+ //#region src/marks/code.d.ts
2
3
  /**
3
4
  Code font mark. Represented as a `<code>` element.
4
5
  */
5
- export declare const code: MarkSpec;
6
+ declare const code: MarkSpec;
7
+ //#endregion
8
+ export { code };
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.code = void 0;
1
+ //#region src/marks/code.ts
4
2
  const codeDOM = ["code", 0];
5
3
  /**
6
- Code font mark. Represented as a `<code>` element.
7
- */
8
- exports.code = {
9
- parseDOM: [{ tag: "code" }],
10
- toDOM() {
11
- return codeDOM;
12
- },
4
+ Code font mark. Represented as a `<code>` element.
5
+ */
6
+ const code = {
7
+ parseDOM: [{ tag: "code" }],
8
+ toDOM() {
9
+ return codeDOM;
10
+ }
13
11
  };
12
+ //#endregion
13
+ export { code };
@@ -1,6 +1,9 @@
1
- import type { MarkSpec } from "prosemirror-model";
1
+ import { MarkSpec } from "prosemirror-model";
2
+ //#region src/marks/em.d.ts
2
3
  /**
3
4
  An emphasis mark. Rendered as an `<em>` element. Has parse rules
4
5
  that also match `<i>` and `font-style: italic`.
5
6
  */
6
- export declare const em: MarkSpec;
7
+ declare const em: MarkSpec;
8
+ //#endregion
9
+ export { em };
@@ -1,19 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.em = void 0;
1
+ //#region src/marks/em.ts
4
2
  const emDOM = ["em", 0];
5
3
  /**
6
- An emphasis mark. Rendered as an `<em>` element. Has parse rules
7
- that also match `<i>` and `font-style: italic`.
8
- */
9
- exports.em = {
10
- parseDOM: [
11
- { tag: "i" },
12
- { tag: "em" },
13
- { style: "font-style=italic" },
14
- { style: "font-style=normal", clearMark: (m) => m.type.name === "em" },
15
- ],
16
- toDOM() {
17
- return emDOM;
18
- },
4
+ An emphasis mark. Rendered as an `<em>` element. Has parse rules
5
+ that also match `<i>` and `font-style: italic`.
6
+ */
7
+ const em = {
8
+ parseDOM: [
9
+ { tag: "i" },
10
+ { tag: "em" },
11
+ { style: "font-style=italic" },
12
+ {
13
+ style: "font-style=normal",
14
+ clearMark: (m) => m.type.name === "em"
15
+ }
16
+ ],
17
+ toDOM() {
18
+ return emDOM;
19
+ }
19
20
  };
21
+ //#endregion
22
+ export { em };
@@ -1,2 +1,5 @@
1
- import type { MarkSpec } from "prosemirror-model";
2
- export declare const hintQuery: MarkSpec;
1
+ import { MarkSpec } from "prosemirror-model";
2
+ //#region src/marks/hint-query.d.ts
3
+ declare const hintQuery: MarkSpec;
4
+ //#endregion
5
+ export { hintQuery };
@@ -1,23 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hintQuery = void 0;
4
- exports.hintQuery = {
5
- excludes: "searchQuery",
6
- inclusive: true,
7
- group: "searchQuery",
8
- attrs: {
9
- trigger: { default: "" },
10
- guid: { default: "" },
11
- },
12
- parseDOM: [{ tag: "span[data-hint-query]" }],
13
- toDOM(node) {
14
- return [
15
- "span",
16
- {
17
- "data-hint-query": "true",
18
- "data-trigger": node.attrs.trigger,
19
- "data-guid": node.attrs.guid,
20
- },
21
- ];
22
- },
1
+ //#region src/marks/hint-query.ts
2
+ const hintQuery = {
3
+ excludes: "searchQuery",
4
+ inclusive: true,
5
+ group: "searchQuery",
6
+ attrs: {
7
+ trigger: { default: "" },
8
+ guid: { default: "" }
9
+ },
10
+ parseDOM: [{ tag: "span[data-hint-query]" }],
11
+ toDOM(node) {
12
+ return ["span", {
13
+ "data-hint-query": "true",
14
+ "data-trigger": node.attrs.trigger,
15
+ "data-guid": node.attrs.guid
16
+ }];
17
+ }
23
18
  };
19
+ //#endregion
20
+ export { hintQuery };
@@ -1,7 +1,10 @@
1
- import type { MarkSpec } from "prosemirror-model";
1
+ import { MarkSpec } from "prosemirror-model";
2
+ //#region src/marks/link.d.ts
2
3
  /**
3
4
  A link. Has `href` and `title` attributes. `title`
4
5
  defaults to the empty string. Rendered and parsed as an `<a>`
5
6
  element.
6
7
  */
7
- export declare const link: MarkSpec;
8
+ declare const link: MarkSpec;
9
+ //#endregion
10
+ export { link };