react-next-editor-js 0.1.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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +877 -0
  3. package/dist/chunk-3QWXTDLY.cjs +486 -0
  4. package/dist/chunk-3QWXTDLY.cjs.map +1 -0
  5. package/dist/chunk-5F6SPYCN.cjs +180 -0
  6. package/dist/chunk-5F6SPYCN.cjs.map +1 -0
  7. package/dist/chunk-6NTSXJX4.js +174 -0
  8. package/dist/chunk-6NTSXJX4.js.map +1 -0
  9. package/dist/chunk-7VYJDBH7.js +261 -0
  10. package/dist/chunk-7VYJDBH7.js.map +1 -0
  11. package/dist/chunk-DBSFCCBG.cjs +1712 -0
  12. package/dist/chunk-DBSFCCBG.cjs.map +1 -0
  13. package/dist/chunk-EFE6RHDL.cjs +4 -0
  14. package/dist/chunk-EFE6RHDL.cjs.map +1 -0
  15. package/dist/chunk-G6YRIEK4.js +3 -0
  16. package/dist/chunk-G6YRIEK4.js.map +1 -0
  17. package/dist/chunk-GFNFJ3FL.cjs +119 -0
  18. package/dist/chunk-GFNFJ3FL.cjs.map +1 -0
  19. package/dist/chunk-IG2YLUFW.js +114 -0
  20. package/dist/chunk-IG2YLUFW.js.map +1 -0
  21. package/dist/chunk-JQXTWLHL.js +176 -0
  22. package/dist/chunk-JQXTWLHL.js.map +1 -0
  23. package/dist/chunk-NJCEHQV3.cjs +454 -0
  24. package/dist/chunk-NJCEHQV3.cjs.map +1 -0
  25. package/dist/chunk-O4GTLC3T.js +478 -0
  26. package/dist/chunk-O4GTLC3T.js.map +1 -0
  27. package/dist/chunk-ODHABIIC.cjs +82 -0
  28. package/dist/chunk-ODHABIIC.cjs.map +1 -0
  29. package/dist/chunk-PZ5AY32C.js +9 -0
  30. package/dist/chunk-PZ5AY32C.js.map +1 -0
  31. package/dist/chunk-Q7SFCCGT.cjs +11 -0
  32. package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
  33. package/dist/chunk-QIUIYBCZ.js +80 -0
  34. package/dist/chunk-QIUIYBCZ.js.map +1 -0
  35. package/dist/chunk-QROUNVQK.js +450 -0
  36. package/dist/chunk-QROUNVQK.js.map +1 -0
  37. package/dist/chunk-T6FR37IC.js +41 -0
  38. package/dist/chunk-T6FR37IC.js.map +1 -0
  39. package/dist/chunk-TI44I654.cjs +265 -0
  40. package/dist/chunk-TI44I654.cjs.map +1 -0
  41. package/dist/chunk-TXPLBAH5.cjs +47 -0
  42. package/dist/chunk-TXPLBAH5.cjs.map +1 -0
  43. package/dist/chunk-U3O54IYI.cjs +187 -0
  44. package/dist/chunk-U3O54IYI.cjs.map +1 -0
  45. package/dist/chunk-VLC7SZMT.js +1669 -0
  46. package/dist/chunk-VLC7SZMT.js.map +1 -0
  47. package/dist/core/index.cjs +232 -0
  48. package/dist/core/index.cjs.map +1 -0
  49. package/dist/core/index.d.cts +122 -0
  50. package/dist/core/index.d.ts +122 -0
  51. package/dist/core/index.js +7 -0
  52. package/dist/core/index.js.map +1 -0
  53. package/dist/defaults-EQD5QKCU.js +4 -0
  54. package/dist/defaults-EQD5QKCU.js.map +1 -0
  55. package/dist/defaults-MLYXD2BG.cjs +49 -0
  56. package/dist/defaults-MLYXD2BG.cjs.map +1 -0
  57. package/dist/docx-BUrf4PFj.d.ts +49 -0
  58. package/dist/docx-DLfSdvXm.d.cts +49 -0
  59. package/dist/docx-LDETXV3L.js +5 -0
  60. package/dist/docx-LDETXV3L.js.map +1 -0
  61. package/dist/docx-N2LKIOK3.cjs +14 -0
  62. package/dist/docx-N2LKIOK3.cjs.map +1 -0
  63. package/dist/export/index.cjs +54 -0
  64. package/dist/export/index.cjs.map +1 -0
  65. package/dist/export/index.d.cts +60 -0
  66. package/dist/export/index.d.ts +60 -0
  67. package/dist/export/index.js +9 -0
  68. package/dist/export/index.js.map +1 -0
  69. package/dist/html-5BXJPQU3.js +7 -0
  70. package/dist/html-5BXJPQU3.js.map +1 -0
  71. package/dist/html-KU2KHLRF.cjs +24 -0
  72. package/dist/html-KU2KHLRF.cjs.map +1 -0
  73. package/dist/import/index.cjs +15 -0
  74. package/dist/import/index.cjs.map +1 -0
  75. package/dist/import/index.d.cts +37 -0
  76. package/dist/import/index.d.ts +37 -0
  77. package/dist/import/index.js +6 -0
  78. package/dist/import/index.js.map +1 -0
  79. package/dist/index.cjs +1035 -0
  80. package/dist/index.cjs.map +1 -0
  81. package/dist/index.d.cts +248 -0
  82. package/dist/index.d.ts +248 -0
  83. package/dist/index.js +885 -0
  84. package/dist/index.js.map +1 -0
  85. package/dist/persistence/index.cjs +37 -0
  86. package/dist/persistence/index.cjs.map +1 -0
  87. package/dist/persistence/index.d.cts +279 -0
  88. package/dist/persistence/index.d.ts +279 -0
  89. package/dist/persistence/index.js +4 -0
  90. package/dist/persistence/index.js.map +1 -0
  91. package/dist/sanitize-7IZ-SW1f.d.ts +361 -0
  92. package/dist/sanitize-CvmgqbsA.d.cts +361 -0
  93. package/dist/server/index.cjs +400 -0
  94. package/dist/server/index.cjs.map +1 -0
  95. package/dist/server/index.d.cts +229 -0
  96. package/dist/server/index.d.ts +229 -0
  97. package/dist/server/index.js +390 -0
  98. package/dist/server/index.js.map +1 -0
  99. package/dist/styles.css +680 -0
  100. package/dist/types-B4z0Quvv.d.cts +193 -0
  101. package/dist/types-B4z0Quvv.d.ts +193 -0
  102. package/package.json +183 -0
@@ -0,0 +1,122 @@
1
+ export { B as BuildPluginsOptions, C as CommandSet, a as CreateEditorStateOptions, D as DEFAULT_COLOR_PALETTE, b as DEFAULT_FEATURES, c as DEFAULT_FONT_FAMILIES, d as DEFAULT_FONT_SIZES, e as DEFAULT_PAGE, f as DEFAULT_STRINGS, g as DEFAULT_TOOLBAR_GROUPS, h as DocumentStats, E as EditorCommand, i as EditorContent, I as INDENT_STEP_EM, j as ImageAttrs, L as LinkAttrs, M as MAX_INDENT, P as PAGE_DIMENSIONS_MM, k as PaginationGeometry, l as PaginationOptions, T as TextAlign, m as blockAttrs, n as blockDOMAttrs, o as buildPlugins, p as buildSchema, q as changeIndent, r as clampIndent, s as countDocument, t as createCommands, u as createDoc, v as createEditorState, w as createTableNode, x as defaultEnabled, y as defaultSchema, z as editingCommands, A as getActiveMarkAttrs, F as insertImage, G as insertTable, H as isBlockActive, J as isInNode, K as isMarkActive, N as isTextAlign, O as isTextblockAttrActive, Q as paginationKey, R as paginationPlugin, S as preloadSanitizer, U as readBlockAttrs, V as removeLink, W as resolvePageDimensions, X as sanitizeHtml, Y as sanitizeHtmlSync, Z as sanitizeImageSrc, _ as sanitizeUrl, $ as setLink, a0 as setMark, a1 as setTextblockAttr, a2 as themeToCssVars, a3 as unsetMark } from '../sanitize-CvmgqbsA.cjs';
2
+ import { NodeSpec, Node, MarkSpec, Schema } from 'prosemirror-model';
3
+ export { D as DocumentJSON, E as EditorMode, a as EditorStrings, F as FeatureFlags, P as PageConfig, b as PageSize, S as SaveStatus, T as ThemeTokens, c as ToolbarConfig, d as ToolbarItemId } from '../types-B4z0Quvv.cjs';
4
+ import { Command, Plugin } from 'prosemirror-state';
5
+ export { splitListItem } from 'prosemirror-schema-list';
6
+ import 'prosemirror-view';
7
+
8
+ /**
9
+ * Node specifications. Each is a self-contained {@link NodeSpec}. The schema is
10
+ * assembled from these by {@link buildSchema} according to the enabled feature
11
+ * flags, so disabling a feature removes its node entirely and the document can
12
+ * never contain it (F-10.2, F-11.5).
13
+ */
14
+ declare const doc: NodeSpec;
15
+ declare const text: NodeSpec;
16
+ declare const paragraph: NodeSpec;
17
+ declare const heading: NodeSpec;
18
+ declare const blockquote: NodeSpec;
19
+ declare const horizontal_rule: NodeSpec;
20
+ /** Custom manual page break (F-3.5). An atom that renders as a non-editable break. */
21
+ declare const page_break: NodeSpec;
22
+ declare const hard_break: NodeSpec;
23
+ declare const image: NodeSpec;
24
+ /** List item, with an optional `checked` attribute powering task lists (F-2.8). */
25
+ declare const list_item: NodeSpec;
26
+ declare const bullet_list: NodeSpec;
27
+ declare const ordered_list: NodeSpec;
28
+ /** Return the text alignment attribute of a block node, if any. */
29
+ declare function nodeAlign(node: Node): string | null;
30
+
31
+ declare const nodes_blockquote: typeof blockquote;
32
+ declare const nodes_bullet_list: typeof bullet_list;
33
+ declare const nodes_doc: typeof doc;
34
+ declare const nodes_hard_break: typeof hard_break;
35
+ declare const nodes_heading: typeof heading;
36
+ declare const nodes_horizontal_rule: typeof horizontal_rule;
37
+ declare const nodes_image: typeof image;
38
+ declare const nodes_list_item: typeof list_item;
39
+ declare const nodes_nodeAlign: typeof nodeAlign;
40
+ declare const nodes_ordered_list: typeof ordered_list;
41
+ declare const nodes_page_break: typeof page_break;
42
+ declare const nodes_paragraph: typeof paragraph;
43
+ declare const nodes_text: typeof text;
44
+ declare namespace nodes {
45
+ export { nodes_blockquote as blockquote, nodes_bullet_list as bullet_list, nodes_doc as doc, nodes_hard_break as hard_break, nodes_heading as heading, nodes_horizontal_rule as horizontal_rule, nodes_image as image, nodes_list_item as list_item, nodes_nodeAlign as nodeAlign, nodes_ordered_list as ordered_list, nodes_page_break as page_break, nodes_paragraph as paragraph, nodes_text as text };
46
+ }
47
+
48
+ /**
49
+ * Mark specifications. Each is a self-contained {@link MarkSpec} with parse and
50
+ * serialize rules. Marks that carry style (font, size, colors) are attribute
51
+ * marks; their `toDOM` emits inline styles only — never active content — and
52
+ * their `parseDOM` reads from the corresponding CSS property so pasted content
53
+ * round-trips (F-4.2, F-11.4).
54
+ */
55
+ declare const strong: MarkSpec;
56
+ declare const em: MarkSpec;
57
+ declare const underline: MarkSpec;
58
+ declare const strikethrough: MarkSpec;
59
+ declare const superscript: MarkSpec;
60
+ declare const subscript: MarkSpec;
61
+ declare const code: MarkSpec;
62
+ declare const link: MarkSpec;
63
+ declare const fontFamily: MarkSpec;
64
+ declare const fontSize: MarkSpec;
65
+ declare const textColor: MarkSpec;
66
+ declare const highlight: MarkSpec;
67
+
68
+ declare const marks_code: typeof code;
69
+ declare const marks_em: typeof em;
70
+ declare const marks_fontFamily: typeof fontFamily;
71
+ declare const marks_fontSize: typeof fontSize;
72
+ declare const marks_highlight: typeof highlight;
73
+ declare const marks_link: typeof link;
74
+ declare const marks_strikethrough: typeof strikethrough;
75
+ declare const marks_strong: typeof strong;
76
+ declare const marks_subscript: typeof subscript;
77
+ declare const marks_superscript: typeof superscript;
78
+ declare const marks_textColor: typeof textColor;
79
+ declare const marks_underline: typeof underline;
80
+ declare namespace marks {
81
+ export { marks_code as code, marks_em as em, marks_fontFamily as fontFamily, marks_fontSize as fontSize, marks_highlight as highlight, marks_link as link, marks_strikethrough as strikethrough, marks_strong as strong, marks_subscript as subscript, marks_superscript as superscript, marks_textColor as textColor, marks_underline as underline };
82
+ }
83
+
84
+ /**
85
+ * Clear character and paragraph formatting across the selection (F-1.8):
86
+ * removes all inline marks, resets alignment/indent/line-height, and converts
87
+ * headings back to normal paragraphs. Node sizes are unchanged so the iteration
88
+ * over the original document stays position-stable.
89
+ */
90
+ declare function clearFormatting(schema: Schema): Command;
91
+
92
+ /**
93
+ * Markdown-style input rules (F-4.x convenience): typing `# `, `> `, `- `, `1. `
94
+ * etc. transforms the current block. Rules are added only for nodes present in
95
+ * the schema, and typography rules (smart quotes, ellipsis, em-dash) are always
96
+ * safe to include.
97
+ */
98
+ declare function buildInputRules(schema: Schema): Plugin;
99
+
100
+ /**
101
+ * Build the editor keymaps (F-4.3). Returns two plugins: the custom bindings
102
+ * (formatting, structure) and the ProseMirror base keymap, in that priority
103
+ * order. Bindings reference only commands whose nodes/marks exist in the schema.
104
+ */
105
+ declare function buildKeymapPlugins(schema: Schema): Plugin[];
106
+
107
+ /**
108
+ * Show placeholder text in an empty document (F-4.7). Adds a node decoration
109
+ * carrying the placeholder as a `data-placeholder` attribute, which the
110
+ * stylesheet renders as ghost text. Purely decorative — never mutates the doc.
111
+ */
112
+ declare function placeholderPlugin(text: string): Plugin;
113
+
114
+ /**
115
+ * Make task-list checkboxes interactive. Clicking the rendered checkbox toggles
116
+ * the `checked` attribute of the enclosing `list_item`. Implemented via a DOM
117
+ * mousedown handler so it works without a custom node view. No-op when the
118
+ * editor is not editable.
119
+ */
120
+ declare function taskListPlugin(schema: Schema): Plugin;
121
+
122
+ export { buildInputRules, buildKeymapPlugins, clearFormatting, marks as markSpecs, nodes as nodeSpecs, placeholderPlugin, taskListPlugin };
@@ -0,0 +1,122 @@
1
+ export { B as BuildPluginsOptions, C as CommandSet, a as CreateEditorStateOptions, D as DEFAULT_COLOR_PALETTE, b as DEFAULT_FEATURES, c as DEFAULT_FONT_FAMILIES, d as DEFAULT_FONT_SIZES, e as DEFAULT_PAGE, f as DEFAULT_STRINGS, g as DEFAULT_TOOLBAR_GROUPS, h as DocumentStats, E as EditorCommand, i as EditorContent, I as INDENT_STEP_EM, j as ImageAttrs, L as LinkAttrs, M as MAX_INDENT, P as PAGE_DIMENSIONS_MM, k as PaginationGeometry, l as PaginationOptions, T as TextAlign, m as blockAttrs, n as blockDOMAttrs, o as buildPlugins, p as buildSchema, q as changeIndent, r as clampIndent, s as countDocument, t as createCommands, u as createDoc, v as createEditorState, w as createTableNode, x as defaultEnabled, y as defaultSchema, z as editingCommands, A as getActiveMarkAttrs, F as insertImage, G as insertTable, H as isBlockActive, J as isInNode, K as isMarkActive, N as isTextAlign, O as isTextblockAttrActive, Q as paginationKey, R as paginationPlugin, S as preloadSanitizer, U as readBlockAttrs, V as removeLink, W as resolvePageDimensions, X as sanitizeHtml, Y as sanitizeHtmlSync, Z as sanitizeImageSrc, _ as sanitizeUrl, $ as setLink, a0 as setMark, a1 as setTextblockAttr, a2 as themeToCssVars, a3 as unsetMark } from '../sanitize-7IZ-SW1f.js';
2
+ import { NodeSpec, Node, MarkSpec, Schema } from 'prosemirror-model';
3
+ export { D as DocumentJSON, E as EditorMode, a as EditorStrings, F as FeatureFlags, P as PageConfig, b as PageSize, S as SaveStatus, T as ThemeTokens, c as ToolbarConfig, d as ToolbarItemId } from '../types-B4z0Quvv.js';
4
+ import { Command, Plugin } from 'prosemirror-state';
5
+ export { splitListItem } from 'prosemirror-schema-list';
6
+ import 'prosemirror-view';
7
+
8
+ /**
9
+ * Node specifications. Each is a self-contained {@link NodeSpec}. The schema is
10
+ * assembled from these by {@link buildSchema} according to the enabled feature
11
+ * flags, so disabling a feature removes its node entirely and the document can
12
+ * never contain it (F-10.2, F-11.5).
13
+ */
14
+ declare const doc: NodeSpec;
15
+ declare const text: NodeSpec;
16
+ declare const paragraph: NodeSpec;
17
+ declare const heading: NodeSpec;
18
+ declare const blockquote: NodeSpec;
19
+ declare const horizontal_rule: NodeSpec;
20
+ /** Custom manual page break (F-3.5). An atom that renders as a non-editable break. */
21
+ declare const page_break: NodeSpec;
22
+ declare const hard_break: NodeSpec;
23
+ declare const image: NodeSpec;
24
+ /** List item, with an optional `checked` attribute powering task lists (F-2.8). */
25
+ declare const list_item: NodeSpec;
26
+ declare const bullet_list: NodeSpec;
27
+ declare const ordered_list: NodeSpec;
28
+ /** Return the text alignment attribute of a block node, if any. */
29
+ declare function nodeAlign(node: Node): string | null;
30
+
31
+ declare const nodes_blockquote: typeof blockquote;
32
+ declare const nodes_bullet_list: typeof bullet_list;
33
+ declare const nodes_doc: typeof doc;
34
+ declare const nodes_hard_break: typeof hard_break;
35
+ declare const nodes_heading: typeof heading;
36
+ declare const nodes_horizontal_rule: typeof horizontal_rule;
37
+ declare const nodes_image: typeof image;
38
+ declare const nodes_list_item: typeof list_item;
39
+ declare const nodes_nodeAlign: typeof nodeAlign;
40
+ declare const nodes_ordered_list: typeof ordered_list;
41
+ declare const nodes_page_break: typeof page_break;
42
+ declare const nodes_paragraph: typeof paragraph;
43
+ declare const nodes_text: typeof text;
44
+ declare namespace nodes {
45
+ export { nodes_blockquote as blockquote, nodes_bullet_list as bullet_list, nodes_doc as doc, nodes_hard_break as hard_break, nodes_heading as heading, nodes_horizontal_rule as horizontal_rule, nodes_image as image, nodes_list_item as list_item, nodes_nodeAlign as nodeAlign, nodes_ordered_list as ordered_list, nodes_page_break as page_break, nodes_paragraph as paragraph, nodes_text as text };
46
+ }
47
+
48
+ /**
49
+ * Mark specifications. Each is a self-contained {@link MarkSpec} with parse and
50
+ * serialize rules. Marks that carry style (font, size, colors) are attribute
51
+ * marks; their `toDOM` emits inline styles only — never active content — and
52
+ * their `parseDOM` reads from the corresponding CSS property so pasted content
53
+ * round-trips (F-4.2, F-11.4).
54
+ */
55
+ declare const strong: MarkSpec;
56
+ declare const em: MarkSpec;
57
+ declare const underline: MarkSpec;
58
+ declare const strikethrough: MarkSpec;
59
+ declare const superscript: MarkSpec;
60
+ declare const subscript: MarkSpec;
61
+ declare const code: MarkSpec;
62
+ declare const link: MarkSpec;
63
+ declare const fontFamily: MarkSpec;
64
+ declare const fontSize: MarkSpec;
65
+ declare const textColor: MarkSpec;
66
+ declare const highlight: MarkSpec;
67
+
68
+ declare const marks_code: typeof code;
69
+ declare const marks_em: typeof em;
70
+ declare const marks_fontFamily: typeof fontFamily;
71
+ declare const marks_fontSize: typeof fontSize;
72
+ declare const marks_highlight: typeof highlight;
73
+ declare const marks_link: typeof link;
74
+ declare const marks_strikethrough: typeof strikethrough;
75
+ declare const marks_strong: typeof strong;
76
+ declare const marks_subscript: typeof subscript;
77
+ declare const marks_superscript: typeof superscript;
78
+ declare const marks_textColor: typeof textColor;
79
+ declare const marks_underline: typeof underline;
80
+ declare namespace marks {
81
+ export { marks_code as code, marks_em as em, marks_fontFamily as fontFamily, marks_fontSize as fontSize, marks_highlight as highlight, marks_link as link, marks_strikethrough as strikethrough, marks_strong as strong, marks_subscript as subscript, marks_superscript as superscript, marks_textColor as textColor, marks_underline as underline };
82
+ }
83
+
84
+ /**
85
+ * Clear character and paragraph formatting across the selection (F-1.8):
86
+ * removes all inline marks, resets alignment/indent/line-height, and converts
87
+ * headings back to normal paragraphs. Node sizes are unchanged so the iteration
88
+ * over the original document stays position-stable.
89
+ */
90
+ declare function clearFormatting(schema: Schema): Command;
91
+
92
+ /**
93
+ * Markdown-style input rules (F-4.x convenience): typing `# `, `> `, `- `, `1. `
94
+ * etc. transforms the current block. Rules are added only for nodes present in
95
+ * the schema, and typography rules (smart quotes, ellipsis, em-dash) are always
96
+ * safe to include.
97
+ */
98
+ declare function buildInputRules(schema: Schema): Plugin;
99
+
100
+ /**
101
+ * Build the editor keymaps (F-4.3). Returns two plugins: the custom bindings
102
+ * (formatting, structure) and the ProseMirror base keymap, in that priority
103
+ * order. Bindings reference only commands whose nodes/marks exist in the schema.
104
+ */
105
+ declare function buildKeymapPlugins(schema: Schema): Plugin[];
106
+
107
+ /**
108
+ * Show placeholder text in an empty document (F-4.7). Adds a node decoration
109
+ * carrying the placeholder as a `data-placeholder` attribute, which the
110
+ * stylesheet renders as ghost text. Purely decorative — never mutates the doc.
111
+ */
112
+ declare function placeholderPlugin(text: string): Plugin;
113
+
114
+ /**
115
+ * Make task-list checkboxes interactive. Clicking the rendered checkbox toggles
116
+ * the `checked` attribute of the enclosing `list_item`. Implemented via a DOM
117
+ * mousedown handler so it works without a custom node view. No-op when the
118
+ * editor is not editable.
119
+ */
120
+ declare function taskListPlugin(schema: Schema): Plugin;
121
+
122
+ export { buildInputRules, buildKeymapPlugins, clearFormatting, marks as markSpecs, nodes as nodeSpecs, placeholderPlugin, taskListPlugin };
@@ -0,0 +1,7 @@
1
+ export { INDENT_STEP_EM, MAX_INDENT, blockAttrs, blockDOMAttrs, buildInputRules, buildKeymapPlugins, buildPlugins, buildSchema, changeIndent, clampIndent, clearFormatting, countDocument, createCommands, createDoc, createEditorState, createTableNode, defaultEnabled, defaultSchema, editingCommands, getActiveMarkAttrs, insertImage, insertTable, isBlockActive, isInNode, isMarkActive, isTextAlign, isTextblockAttrActive, marks_exports as markSpecs, nodes_exports as nodeSpecs, paginationKey, paginationPlugin, placeholderPlugin, readBlockAttrs, removeLink, setLink, setMark, setTextblockAttr, splitListItem, taskListPlugin, unsetMark } from '../chunk-VLC7SZMT.js';
2
+ import '../chunk-T6FR37IC.js';
3
+ export { preloadSanitizer, sanitizeHtml, sanitizeHtmlSync, sanitizeImageSrc, sanitizeUrl } from '../chunk-6NTSXJX4.js';
4
+ export { DEFAULT_COLOR_PALETTE, DEFAULT_FEATURES, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_PAGE, DEFAULT_STRINGS, DEFAULT_TOOLBAR_GROUPS, PAGE_DIMENSIONS_MM, resolvePageDimensions, themeToCssVars } from '../chunk-JQXTWLHL.js';
5
+ import '../chunk-PZ5AY32C.js';
6
+ //# sourceMappingURL=index.js.map
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,4 @@
1
+ export { DEFAULT_COLOR_PALETTE, DEFAULT_FEATURES, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_PAGE, DEFAULT_STRINGS, DEFAULT_TOOLBAR_GROUPS, PAGE_DIMENSIONS_MM, resolvePageDimensions, themeToCssVars } from './chunk-JQXTWLHL.js';
2
+ import './chunk-PZ5AY32C.js';
3
+ //# sourceMappingURL=defaults-EQD5QKCU.js.map
4
+ //# sourceMappingURL=defaults-EQD5QKCU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"defaults-EQD5QKCU.js"}
@@ -0,0 +1,49 @@
1
+ 'use strict';
2
+
3
+ var chunkU3O54IYI_cjs = require('./chunk-U3O54IYI.cjs');
4
+ require('./chunk-Q7SFCCGT.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "DEFAULT_COLOR_PALETTE", {
9
+ enumerable: true,
10
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_COLOR_PALETTE; }
11
+ });
12
+ Object.defineProperty(exports, "DEFAULT_FEATURES", {
13
+ enumerable: true,
14
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_FEATURES; }
15
+ });
16
+ Object.defineProperty(exports, "DEFAULT_FONT_FAMILIES", {
17
+ enumerable: true,
18
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_FONT_FAMILIES; }
19
+ });
20
+ Object.defineProperty(exports, "DEFAULT_FONT_SIZES", {
21
+ enumerable: true,
22
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_FONT_SIZES; }
23
+ });
24
+ Object.defineProperty(exports, "DEFAULT_PAGE", {
25
+ enumerable: true,
26
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_PAGE; }
27
+ });
28
+ Object.defineProperty(exports, "DEFAULT_STRINGS", {
29
+ enumerable: true,
30
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_STRINGS; }
31
+ });
32
+ Object.defineProperty(exports, "DEFAULT_TOOLBAR_GROUPS", {
33
+ enumerable: true,
34
+ get: function () { return chunkU3O54IYI_cjs.DEFAULT_TOOLBAR_GROUPS; }
35
+ });
36
+ Object.defineProperty(exports, "PAGE_DIMENSIONS_MM", {
37
+ enumerable: true,
38
+ get: function () { return chunkU3O54IYI_cjs.PAGE_DIMENSIONS_MM; }
39
+ });
40
+ Object.defineProperty(exports, "resolvePageDimensions", {
41
+ enumerable: true,
42
+ get: function () { return chunkU3O54IYI_cjs.resolvePageDimensions; }
43
+ });
44
+ Object.defineProperty(exports, "themeToCssVars", {
45
+ enumerable: true,
46
+ get: function () { return chunkU3O54IYI_cjs.themeToCssVars; }
47
+ });
48
+ //# sourceMappingURL=defaults-MLYXD2BG.cjs.map
49
+ //# sourceMappingURL=defaults-MLYXD2BG.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"defaults-MLYXD2BG.cjs"}
@@ -0,0 +1,49 @@
1
+ import { D as DocumentJSON, P as PageConfig } from './types-B4z0Quvv.js';
2
+ import * as DocxNamespace from 'docx';
3
+
4
+ /**
5
+ * Options governing plain-text conversion (F-6.20). Defaults follow the
6
+ * documented structure rules: blocks separated by blank lines, list items on
7
+ * their own lines, table cells tab-delimited, images replaced by alt text,
8
+ * links rendered as their text.
9
+ */
10
+ interface TextConversionOptions {
11
+ /** Append the URL after link text as " (url)". Default false. */
12
+ includeLinkUrls?: boolean;
13
+ /** Replacement for images: 'alt' uses alt text, 'omit' drops them. Default 'alt'. */
14
+ images?: 'alt' | 'omit';
15
+ /** Newline sequence. Default '\n'. */
16
+ newline?: string;
17
+ }
18
+ /**
19
+ * Convert a ProseMirror document (JSON) to plain text (F-6.18). Pure and
20
+ * isomorphic: identical output in the browser and on the server (F-6.19).
21
+ */
22
+ declare function documentToText(doc: DocumentJSON, options?: TextConversionOptions): string;
23
+
24
+ /**
25
+ * Isomorphic DOCX serializer (§8.3). Walks the document JSON and emits OOXML via
26
+ * the `docx` library, which runs in both the browser (Blob) and Node
27
+ * (Buffer/Stream). A per-node mapping is used so custom nodes can register their
28
+ * own conversion (F-6.16, F-10.14). The `docx` module is imported lazily so it
29
+ * stays out of the initial bundle (NF-2) and remains optional.
30
+ */
31
+ /** A converter for a custom node type, returning docx block elements. */
32
+ type DocxNodeConverter = (node: DocumentJSON, ctx: DocxContext) => unknown[];
33
+ interface DocxExportOptions {
34
+ page?: PageConfig;
35
+ title?: string;
36
+ /** Custom node converters keyed by node type name (extension mapping). */
37
+ nodeConverters?: Record<string, DocxNodeConverter>;
38
+ }
39
+ interface DocxContext {
40
+ serializeBlocks: (nodes: DocumentJSON[]) => unknown[];
41
+ docx: DocxModule;
42
+ }
43
+ type DocxModule = typeof DocxNamespace;
44
+ /** Serialize a document to a DOCX Blob for client-side download (F-6.1, F-6.6). */
45
+ declare function documentToDocxBlob(doc: DocumentJSON, options?: DocxExportOptions): Promise<Blob>;
46
+ /** Serialize a document to a DOCX Buffer for server-side storage (F-6.10). */
47
+ declare function documentToDocxBuffer(doc: DocumentJSON, options?: DocxExportOptions): Promise<Buffer>;
48
+
49
+ export { type DocxContext as D, type TextConversionOptions as T, type DocxExportOptions as a, type DocxNodeConverter as b, documentToDocxBuffer as c, documentToDocxBlob as d, documentToText as e };
@@ -0,0 +1,49 @@
1
+ import { D as DocumentJSON, P as PageConfig } from './types-B4z0Quvv.cjs';
2
+ import * as DocxNamespace from 'docx';
3
+
4
+ /**
5
+ * Options governing plain-text conversion (F-6.20). Defaults follow the
6
+ * documented structure rules: blocks separated by blank lines, list items on
7
+ * their own lines, table cells tab-delimited, images replaced by alt text,
8
+ * links rendered as their text.
9
+ */
10
+ interface TextConversionOptions {
11
+ /** Append the URL after link text as " (url)". Default false. */
12
+ includeLinkUrls?: boolean;
13
+ /** Replacement for images: 'alt' uses alt text, 'omit' drops them. Default 'alt'. */
14
+ images?: 'alt' | 'omit';
15
+ /** Newline sequence. Default '\n'. */
16
+ newline?: string;
17
+ }
18
+ /**
19
+ * Convert a ProseMirror document (JSON) to plain text (F-6.18). Pure and
20
+ * isomorphic: identical output in the browser and on the server (F-6.19).
21
+ */
22
+ declare function documentToText(doc: DocumentJSON, options?: TextConversionOptions): string;
23
+
24
+ /**
25
+ * Isomorphic DOCX serializer (§8.3). Walks the document JSON and emits OOXML via
26
+ * the `docx` library, which runs in both the browser (Blob) and Node
27
+ * (Buffer/Stream). A per-node mapping is used so custom nodes can register their
28
+ * own conversion (F-6.16, F-10.14). The `docx` module is imported lazily so it
29
+ * stays out of the initial bundle (NF-2) and remains optional.
30
+ */
31
+ /** A converter for a custom node type, returning docx block elements. */
32
+ type DocxNodeConverter = (node: DocumentJSON, ctx: DocxContext) => unknown[];
33
+ interface DocxExportOptions {
34
+ page?: PageConfig;
35
+ title?: string;
36
+ /** Custom node converters keyed by node type name (extension mapping). */
37
+ nodeConverters?: Record<string, DocxNodeConverter>;
38
+ }
39
+ interface DocxContext {
40
+ serializeBlocks: (nodes: DocumentJSON[]) => unknown[];
41
+ docx: DocxModule;
42
+ }
43
+ type DocxModule = typeof DocxNamespace;
44
+ /** Serialize a document to a DOCX Blob for client-side download (F-6.1, F-6.6). */
45
+ declare function documentToDocxBlob(doc: DocumentJSON, options?: DocxExportOptions): Promise<Blob>;
46
+ /** Serialize a document to a DOCX Buffer for server-side storage (F-6.10). */
47
+ declare function documentToDocxBuffer(doc: DocumentJSON, options?: DocxExportOptions): Promise<Buffer>;
48
+
49
+ export { type DocxContext as D, type TextConversionOptions as T, type DocxExportOptions as a, type DocxNodeConverter as b, documentToDocxBuffer as c, documentToDocxBlob as d, documentToText as e };
@@ -0,0 +1,5 @@
1
+ export { importDocx } from './chunk-QIUIYBCZ.js';
2
+ import './chunk-6NTSXJX4.js';
3
+ import './chunk-PZ5AY32C.js';
4
+ //# sourceMappingURL=docx-LDETXV3L.js.map
5
+ //# sourceMappingURL=docx-LDETXV3L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"docx-LDETXV3L.js"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var chunkODHABIIC_cjs = require('./chunk-ODHABIIC.cjs');
4
+ require('./chunk-5F6SPYCN.cjs');
5
+ require('./chunk-Q7SFCCGT.cjs');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "importDocx", {
10
+ enumerable: true,
11
+ get: function () { return chunkODHABIIC_cjs.importDocx; }
12
+ });
13
+ //# sourceMappingURL=docx-N2LKIOK3.cjs.map
14
+ //# sourceMappingURL=docx-N2LKIOK3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"docx-N2LKIOK3.cjs"}
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ var chunkGFNFJ3FL_cjs = require('../chunk-GFNFJ3FL.cjs');
4
+ var chunkNJCEHQV3_cjs = require('../chunk-NJCEHQV3.cjs');
5
+ var chunkTI44I654_cjs = require('../chunk-TI44I654.cjs');
6
+ require('../chunk-TXPLBAH5.cjs');
7
+ require('../chunk-5F6SPYCN.cjs');
8
+ require('../chunk-U3O54IYI.cjs');
9
+ require('../chunk-Q7SFCCGT.cjs');
10
+
11
+
12
+
13
+ Object.defineProperty(exports, "downloadBlob", {
14
+ enumerable: true,
15
+ get: function () { return chunkGFNFJ3FL_cjs.downloadBlob; }
16
+ });
17
+ Object.defineProperty(exports, "downloadText", {
18
+ enumerable: true,
19
+ get: function () { return chunkGFNFJ3FL_cjs.downloadText; }
20
+ });
21
+ Object.defineProperty(exports, "exportDocument", {
22
+ enumerable: true,
23
+ get: function () { return chunkGFNFJ3FL_cjs.exportDocument; }
24
+ });
25
+ Object.defineProperty(exports, "printDocumentToPdf", {
26
+ enumerable: true,
27
+ get: function () { return chunkGFNFJ3FL_cjs.printDocumentToPdf; }
28
+ });
29
+ Object.defineProperty(exports, "documentToDocxBlob", {
30
+ enumerable: true,
31
+ get: function () { return chunkNJCEHQV3_cjs.documentToDocxBlob; }
32
+ });
33
+ Object.defineProperty(exports, "documentToDocxBuffer", {
34
+ enumerable: true,
35
+ get: function () { return chunkNJCEHQV3_cjs.documentToDocxBuffer; }
36
+ });
37
+ Object.defineProperty(exports, "documentToText", {
38
+ enumerable: true,
39
+ get: function () { return chunkNJCEHQV3_cjs.documentToText; }
40
+ });
41
+ Object.defineProperty(exports, "buildPrintDocument", {
42
+ enumerable: true,
43
+ get: function () { return chunkTI44I654_cjs.buildPrintDocument; }
44
+ });
45
+ Object.defineProperty(exports, "documentToHtml", {
46
+ enumerable: true,
47
+ get: function () { return chunkTI44I654_cjs.documentToHtml; }
48
+ });
49
+ Object.defineProperty(exports, "printStylesheet", {
50
+ enumerable: true,
51
+ get: function () { return chunkTI44I654_cjs.printStylesheet; }
52
+ });
53
+ //# sourceMappingURL=index.cjs.map
54
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,60 @@
1
+ import { T as TextConversionOptions } from '../docx-DLfSdvXm.cjs';
2
+ export { D as DocxContext, a as DocxExportOptions, b as DocxNodeConverter, d as documentToDocxBlob, c as documentToDocxBuffer, e as documentToText } from '../docx-DLfSdvXm.cjs';
3
+ import { D as DocumentJSON, P as PageConfig } from '../types-B4z0Quvv.cjs';
4
+ import 'docx';
5
+
6
+ /** Serialize a document (JSON) to an HTML fragment (the document body content). */
7
+ declare function documentToHtml(doc: DocumentJSON): string;
8
+ /** Print-oriented stylesheet matching the on-screen document surface. */
9
+ declare function printStylesheet(page: PageConfig): string;
10
+ /**
11
+ * Build a complete, standalone HTML document for PDF rendering — used by both
12
+ * the client print path and the server headless-browser renderer so output is
13
+ * consistent (F-6.4, F-6.11).
14
+ */
15
+ declare function buildPrintDocument(doc: DocumentJSON, page: PageConfig, title?: string): string;
16
+
17
+ interface PdfPrintOptions {
18
+ page?: PageConfig;
19
+ title?: string;
20
+ }
21
+ /**
22
+ * Client-side PDF export via the browser's print-to-PDF (§8.4). Renders the
23
+ * shared print HTML (matching the on-screen document and the server renderer)
24
+ * into a hidden iframe and invokes print. Vector output with selectable text,
25
+ * works fully offline, no server round-trip (F-6.3, F-6.4, NF-8).
26
+ *
27
+ * Resolves once printing has been initiated. The user chooses "Save as PDF" in
28
+ * the browser's print dialog.
29
+ */
30
+ declare function printDocumentToPdf(doc: DocumentJSON, options?: PdfPrintOptions): Promise<void>;
31
+
32
+ /**
33
+ * Trigger a client-side file download without a server round-trip (F-6.6).
34
+ * Browser-only; throws a clear error if called without a DOM.
35
+ */
36
+ declare function downloadBlob(blob: Blob, filename: string): void;
37
+ /** Convenience: download a UTF-8 text string as a file. */
38
+ declare function downloadText(text: string, filename: string, mime?: string): void;
39
+
40
+ /**
41
+ * Export pipeline (§5.6). Shared, isomorphic converters from document JSON to
42
+ * plain text, HTML, DOCX and (client) PDF — the same code powers interactive
43
+ * download and the programmatic API so output is consistent (F-6.7, F-6.11).
44
+ */
45
+
46
+ /** Supported export target formats. */
47
+ type ExportFormat = 'docx' | 'pdf' | 'txt' | 'html';
48
+ /**
49
+ * High-level interactive export helper used by the toolbar/host: convert the
50
+ * given document to the requested format and trigger a client download (DOCX,
51
+ * TXT) or open the print dialog (PDF). Returns once the action has started.
52
+ */
53
+ declare function exportDocument(doc: DocumentJSON, format: ExportFormat, options?: {
54
+ filename?: string;
55
+ page?: PageConfig;
56
+ title?: string;
57
+ text?: TextConversionOptions;
58
+ }): Promise<void>;
59
+
60
+ export { type ExportFormat, type PdfPrintOptions, TextConversionOptions, buildPrintDocument, documentToHtml, downloadBlob, downloadText, exportDocument, printDocumentToPdf, printStylesheet };
@@ -0,0 +1,60 @@
1
+ import { T as TextConversionOptions } from '../docx-BUrf4PFj.js';
2
+ export { D as DocxContext, a as DocxExportOptions, b as DocxNodeConverter, d as documentToDocxBlob, c as documentToDocxBuffer, e as documentToText } from '../docx-BUrf4PFj.js';
3
+ import { D as DocumentJSON, P as PageConfig } from '../types-B4z0Quvv.js';
4
+ import 'docx';
5
+
6
+ /** Serialize a document (JSON) to an HTML fragment (the document body content). */
7
+ declare function documentToHtml(doc: DocumentJSON): string;
8
+ /** Print-oriented stylesheet matching the on-screen document surface. */
9
+ declare function printStylesheet(page: PageConfig): string;
10
+ /**
11
+ * Build a complete, standalone HTML document for PDF rendering — used by both
12
+ * the client print path and the server headless-browser renderer so output is
13
+ * consistent (F-6.4, F-6.11).
14
+ */
15
+ declare function buildPrintDocument(doc: DocumentJSON, page: PageConfig, title?: string): string;
16
+
17
+ interface PdfPrintOptions {
18
+ page?: PageConfig;
19
+ title?: string;
20
+ }
21
+ /**
22
+ * Client-side PDF export via the browser's print-to-PDF (§8.4). Renders the
23
+ * shared print HTML (matching the on-screen document and the server renderer)
24
+ * into a hidden iframe and invokes print. Vector output with selectable text,
25
+ * works fully offline, no server round-trip (F-6.3, F-6.4, NF-8).
26
+ *
27
+ * Resolves once printing has been initiated. The user chooses "Save as PDF" in
28
+ * the browser's print dialog.
29
+ */
30
+ declare function printDocumentToPdf(doc: DocumentJSON, options?: PdfPrintOptions): Promise<void>;
31
+
32
+ /**
33
+ * Trigger a client-side file download without a server round-trip (F-6.6).
34
+ * Browser-only; throws a clear error if called without a DOM.
35
+ */
36
+ declare function downloadBlob(blob: Blob, filename: string): void;
37
+ /** Convenience: download a UTF-8 text string as a file. */
38
+ declare function downloadText(text: string, filename: string, mime?: string): void;
39
+
40
+ /**
41
+ * Export pipeline (§5.6). Shared, isomorphic converters from document JSON to
42
+ * plain text, HTML, DOCX and (client) PDF — the same code powers interactive
43
+ * download and the programmatic API so output is consistent (F-6.7, F-6.11).
44
+ */
45
+
46
+ /** Supported export target formats. */
47
+ type ExportFormat = 'docx' | 'pdf' | 'txt' | 'html';
48
+ /**
49
+ * High-level interactive export helper used by the toolbar/host: convert the
50
+ * given document to the requested format and trigger a client download (DOCX,
51
+ * TXT) or open the print dialog (PDF). Returns once the action has started.
52
+ */
53
+ declare function exportDocument(doc: DocumentJSON, format: ExportFormat, options?: {
54
+ filename?: string;
55
+ page?: PageConfig;
56
+ title?: string;
57
+ text?: TextConversionOptions;
58
+ }): Promise<void>;
59
+
60
+ export { type ExportFormat, type PdfPrintOptions, TextConversionOptions, buildPrintDocument, documentToHtml, downloadBlob, downloadText, exportDocument, printDocumentToPdf, printStylesheet };
@@ -0,0 +1,9 @@
1
+ export { downloadBlob, downloadText, exportDocument, printDocumentToPdf } from '../chunk-IG2YLUFW.js';
2
+ export { documentToDocxBlob, documentToDocxBuffer, documentToText } from '../chunk-QROUNVQK.js';
3
+ export { buildPrintDocument, documentToHtml, printStylesheet } from '../chunk-7VYJDBH7.js';
4
+ import '../chunk-T6FR37IC.js';
5
+ import '../chunk-6NTSXJX4.js';
6
+ import '../chunk-JQXTWLHL.js';
7
+ import '../chunk-PZ5AY32C.js';
8
+ //# sourceMappingURL=index.js.map
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,7 @@
1
+ export { buildPrintDocument, documentToHtml, printStylesheet } from './chunk-7VYJDBH7.js';
2
+ import './chunk-T6FR37IC.js';
3
+ import './chunk-6NTSXJX4.js';
4
+ import './chunk-JQXTWLHL.js';
5
+ import './chunk-PZ5AY32C.js';
6
+ //# sourceMappingURL=html-5BXJPQU3.js.map
7
+ //# sourceMappingURL=html-5BXJPQU3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"html-5BXJPQU3.js"}