@harbour-enterprises/superdoc 0.17.3 → 0.18.0-next.10

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 (98) hide show
  1. package/dist/chunks/{PdfViewer-B5bEH-lD.cjs → PdfViewer-DKOAmiXw.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-P3OSs9iX.es.js → PdfViewer-OIo9wAyq.es.js} +1 -1
  3. package/dist/chunks/{index-CHQbeTTv.es.js → index-DEONStGL.es.js} +4 -3
  4. package/dist/chunks/{index-LZjTD5KG.cjs → index-cCWdcGrV.cjs} +4 -3
  5. package/dist/chunks/{super-editor.es-C-nn3bMY.es.js → super-editor.es-Cx5l8JEt.es.js} +4350 -3412
  6. package/dist/chunks/{super-editor.es-D8CRzfwC.cjs → super-editor.es-DyAWPYYh.cjs} +4349 -3411
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/index.d.ts +2 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-Bcg2-svq.js → converter-5WOzOHZb.js} +4396 -3862
  12. package/dist/super-editor/chunks/{docx-zipper-X-fYIxPZ.js → docx-zipper-CP-vEy49.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-D4fBb3em.js → editor-CCOqTxyv.js} +454 -42
  14. package/dist/super-editor/chunks/{toolbar-C6KdVRS2.js → toolbar-DjjHAttK.js} +2 -2
  15. package/dist/super-editor/converter.es.js +3 -2
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/src/core/commands/insertContent.d.ts +4 -4
  20. package/dist/super-editor/src/core/helpers/contentProcessor.d.ts +13 -0
  21. package/dist/super-editor/src/core/helpers/htmlSanitizer.d.ts +8 -0
  22. package/dist/super-editor/src/core/helpers/importHtml.d.ts +3 -2
  23. package/dist/super-editor/src/core/helpers/importMarkdown.d.ts +2 -1
  24. package/dist/super-editor/src/core/helpers/index.d.ts +1 -0
  25. package/dist/super-editor/src/core/super-converter/docx-helpers/get-default-style-definition.d.ts +1 -0
  26. package/dist/super-editor/src/core/super-converter/docx-helpers/index.d.ts +1 -0
  27. package/dist/super-editor/src/core/super-converter/exporter.d.ts +19 -2
  28. package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +2 -1
  29. package/dist/super-editor/src/core/super-converter/v2/importer/index.d.ts +2 -0
  30. package/dist/super-editor/src/core/super-converter/v2/importer/lineBreakImporter.d.ts +3 -5
  31. package/dist/super-editor/src/core/super-converter/v2/importer/paragraphNodeImporter.d.ts +3 -63
  32. package/dist/super-editor/src/core/super-converter/v2/importer/tabImporter.d.ts +2 -1
  33. package/dist/super-editor/src/core/super-converter/v2/importer/tableImporter.d.ts +17 -6
  34. package/dist/super-editor/src/core/super-converter/v2/importer/types/index.d.ts +73 -0
  35. package/dist/super-editor/src/core/super-converter/v2/types/index.d.ts +8 -0
  36. package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +9 -0
  37. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/index.d.ts +2 -0
  38. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-clear.d.ts +4 -0
  39. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-line-break-type.d.ts +4 -0
  40. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/br-translator.d.ts +7 -0
  41. package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/index.d.ts +1 -0
  42. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/index.d.ts +2 -0
  43. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-del.d.ts +4 -0
  44. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-p.d.ts +4 -0
  45. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-r-default.d.ts +4 -0
  46. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-r-pr.d.ts +4 -0
  47. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-r.d.ts +4 -0
  48. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w14-para-id.d.ts +4 -0
  49. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w14-text-id.d.ts +4 -0
  50. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/index.d.ts +1 -0
  51. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/legacy-handle-paragraph-node.d.ts +1 -0
  52. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/w-p-helpers.d.ts +6 -0
  53. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/index.d.ts +1 -0
  54. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/p-translator.d.ts +7 -0
  55. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/index.d.ts +2 -0
  56. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-leader.d.ts +4 -0
  57. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-pos.d.ts +4 -0
  58. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-size.d.ts +4 -0
  59. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/index.d.ts +1 -0
  60. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/tab-translator.d.ts +7 -0
  61. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/legacy-handle-table-cell-node.d.ts +9 -0
  62. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/translate-table-cell.d.ts +17 -0
  63. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/index.d.ts +1 -0
  64. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/tc-translator.d.ts +6 -0
  65. package/dist/super-editor/src/core/super-converter/v3/node-translator/index.d.ts +1 -0
  66. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +203 -0
  67. package/dist/super-editor/src/extensions/block-node/block-node.d.ts +27 -4
  68. package/dist/super-editor/src/extensions/color/color.d.ts +1 -1
  69. package/dist/super-editor/src/extensions/dropcursor/dropcursor.d.ts +5 -0
  70. package/dist/super-editor/src/extensions/gapcursor/gapcursor.d.ts +5 -0
  71. package/dist/super-editor/src/extensions/image/image.d.ts +5 -0
  72. package/dist/super-editor/src/extensions/image/imageHelpers/getFileOpener.d.ts +1 -1
  73. package/dist/super-editor/src/extensions/image/imageHelpers/handleImageUpload.d.ts +1 -1
  74. package/dist/super-editor/src/extensions/image/imageHelpers/imagePlaceholderPlugin.d.ts +2 -3
  75. package/dist/super-editor/src/extensions/image/imageHelpers/imagePositionPlugin.d.ts +1 -2
  76. package/dist/super-editor/src/extensions/image/imageHelpers/processUploadedImage.d.ts +2 -5
  77. package/dist/super-editor/src/extensions/image/imageHelpers/startImageUpload.d.ts +18 -3
  78. package/dist/super-editor/src/extensions/linked-styles/helpers.d.ts +4 -6
  79. package/dist/super-editor/src/extensions/linked-styles/linked-styles.d.ts +29 -0
  80. package/dist/super-editor/src/extensions/linked-styles/plugin.d.ts +4 -2
  81. package/dist/super-editor/src/extensions/paragraph/paragraph.d.ts +2 -2
  82. package/dist/super-editor/src/extensions/text-align/text-align.d.ts +9 -0
  83. package/dist/super-editor/src/extensions/text-indent/text-indent.d.ts +19 -0
  84. package/dist/super-editor/src/extensions/text-transform/text-transform.d.ts +5 -0
  85. package/dist/super-editor/src/index.d.ts +2 -1
  86. package/dist/super-editor/src/tests/export/export-helpers/export-helpers.d.ts +1 -0
  87. package/dist/super-editor/super-editor.es.js +24 -18
  88. package/dist/super-editor/toolbar.es.js +2 -2
  89. package/dist/super-editor.cjs +2 -1
  90. package/dist/super-editor.es.js +2 -1
  91. package/dist/superdoc.cjs +3 -2
  92. package/dist/superdoc.es.js +3 -2
  93. package/dist/superdoc.umd.js +4488 -3549
  94. package/dist/superdoc.umd.js.map +1 -1
  95. package/package.json +1 -1
  96. package/dist/super-editor/src/core/super-converter/v2/handlers/index.d.ts +0 -1
  97. package/dist/super-editor/src/extensions/field-annotation/field-annotation-marks-impl.d.ts +0 -5
  98. /package/dist/super-editor/src/{extensions/document-attributes → core/super-converter/v3/handlers/types}/index.d.ts +0 -0
@@ -0,0 +1,203 @@
1
+ export type TranslatorTypes = string;
2
+ /**
3
+ * @enum {string}
4
+ */
5
+ export const TranslatorTypes: Readonly<{
6
+ NODE: "node";
7
+ ATTRIBUTE: "attribute";
8
+ }>;
9
+ /**
10
+ * @typedef {keyof typeof TranslatorTypes} TranslatorTypeKey
11
+ * @typedef {typeof TranslatorTypes[TranslatorTypeKey]} TranslatorType
12
+ * @typedef {string} XmlNodeName
13
+ * @typedef {string} SuperDocNodeOrKeyName
14
+ */
15
+ /**
16
+ * @typedef {Object} AttrConfig
17
+ * @property {string} xmlName - The name of the attribute in OOXML
18
+ * @property {string} sdName - The name of the attribute in SuperDoc
19
+ * @property {Function} [encode] - Function to encode the attribute from OOXML to SuperDoc
20
+ * @property {Function} [decode] - Function to decode the attribute from SuperDoc to OOXML
21
+ */
22
+ /** @typedef {import('../../v2/importer/types').NodeHandlerParams} SCEncoderConfig */
23
+ /** @typedef {import('../../v2/types').SuperDocNode} SCEncoderResult */
24
+ /** @typedef {{ node: { attrs?: any, marks?: any[], type: string }, children?: any[] }} SCDecoderConfig */
25
+ /** @typedef {{ name: string, elements: any[] }} SCDecoderResult */
26
+ /**
27
+ * @callback NodeTranslatorEncodeFn
28
+ * @param {SCEncoderConfig} params
29
+ * @param {EncodedAttributes} [encodedAttrs]
30
+ * @returns {import('../../v2/types').SuperDocNode}
31
+ */
32
+ /**
33
+ * @callback NodeTranslatorDecodeFn
34
+ * @param {SCDecoderConfig} params
35
+ * @param {DecodedAttributes} [decodedAttrs]
36
+ * @returns {import('../../v2/types').OpenXmlNode}
37
+ */
38
+ /** @callback MatchesEncodeFn @param {any[]} nodes @param {any} [ctx] @returns {boolean} */
39
+ /** @callback MatchesDecodeFn @param {any} node @param {any} [ctx] @returns {boolean} */
40
+ /**
41
+ * @typedef {Object} EncodedAttributes
42
+ */
43
+ /**
44
+ * @typedef {Object} DecodedAttributes
45
+ */
46
+ /**
47
+ * @typedef {Object} NodeTranslatorConfig
48
+ * @property {string} xmlName - The name of the node in OOXML
49
+ * @property {string} sdNodeOrKeyName - The name of the node in SuperDoc
50
+ * @property {TranslatorType} [type="node"] - The type of the translator.
51
+ * @property {NodeTranslatorEncodeFn} encode - The function to encode the data.
52
+ * @property {NodeTranslatorDecodeFn} [decode] - The function to decode the data.
53
+ * @property {number} [priority] - The priority of the handler.
54
+ * @property {AttrConfig[]} [attributes] - Attribute handlers list.
55
+ * @property {MatchesEncodeFn} [matchesEncode] - The function to check if the handler can encode the data.
56
+ * @property {MatchesDecodeFn} [matchesDecode] - The function to check if the handler can decode the data.
57
+ */
58
+ export class NodeTranslator {
59
+ /** @type {typeof TranslatorTypes} */
60
+ static translatorTypes: typeof TranslatorTypes;
61
+ /**
62
+ * Create a new NodeTranslator instance from a configuration object.
63
+ * @param {NodeTranslatorConfig} config - The configuration object.
64
+ * @returns {NodeTranslator} The created NodeTranslator instance.
65
+ */
66
+ static from(config: NodeTranslatorConfig): NodeTranslator;
67
+ /**
68
+ * @param {string} xmlName
69
+ * @param {string} sdNodeOrKeyName
70
+ * @param {NodeTranslatorEncodeFn} encode
71
+ * @param {NodeTranslatorDecodeFn} decode
72
+ * @param {number} [priority]
73
+ * @param {MatchesEncodeFn} [matchesEncode]
74
+ * @param {MatchesDecodeFn} [matchesDecode]
75
+ * @param {AttrConfig[]} [attributes]
76
+ */
77
+ constructor(xmlName: string, sdNodeOrKeyName: string, encode: NodeTranslatorEncodeFn, decode: NodeTranslatorDecodeFn, priority?: number, matchesEncode?: MatchesEncodeFn, matchesDecode?: MatchesDecodeFn, attributes?: AttrConfig[]);
78
+ /** @type {string} */
79
+ xmlName: string;
80
+ /** @type {string} */
81
+ sdNodeOrKeyName: string;
82
+ /** @type {number} */
83
+ priority: number;
84
+ /** @type {NodeTranslatorEncodeFn} */
85
+ encodeFn: NodeTranslatorEncodeFn;
86
+ /** @type {NodeTranslatorDecodeFn} */
87
+ decodeFn: NodeTranslatorDecodeFn;
88
+ /** @type {MatchesEncodeFn} */
89
+ matchesEncode: MatchesEncodeFn;
90
+ /** @type {MatchesDecodeFn} */
91
+ matchesDecode: MatchesDecodeFn;
92
+ /** @type {AttrConfig[]} */
93
+ attributes: AttrConfig[];
94
+ /**
95
+ * Encode the attributes for the node.
96
+ * @param {SCEncoderConfig} params
97
+ * @returns {Object} Encoded attributes object.
98
+ */
99
+ encodeAttributes(params: SCEncoderConfig): any;
100
+ /**
101
+ * Decode the attributes for the node.
102
+ * @param {SCDecoderConfig} params
103
+ * @returns {Object} Decoded attributes object.
104
+ */
105
+ decodeAttributes(params: SCDecoderConfig): any;
106
+ /**
107
+ * Decode the attributes for the node.
108
+ * @param {SCDecoderConfig} params
109
+ * @returns {Object} Decoded attributes object.
110
+ */
111
+ decode(params: SCDecoderConfig): any;
112
+ /**
113
+ * Encode the attributes for the node.
114
+ * @param {SCEncoderConfig} params
115
+ * @returns {Object} Encoded attributes object.
116
+ */
117
+ encode(params: SCEncoderConfig): any;
118
+ /**
119
+ * Convert the NodeTranslator instance to a string representation.
120
+ * @returns {string} - The string representation of the NodeTranslator instance.
121
+ */
122
+ toString(): string;
123
+ }
124
+ export type TranslatorTypeKey = keyof typeof TranslatorTypes;
125
+ export type TranslatorType = (typeof TranslatorTypes)[TranslatorTypeKey];
126
+ export type XmlNodeName = string;
127
+ export type SuperDocNodeOrKeyName = string;
128
+ export type AttrConfig = {
129
+ /**
130
+ * - The name of the attribute in OOXML
131
+ */
132
+ xmlName: string;
133
+ /**
134
+ * - The name of the attribute in SuperDoc
135
+ */
136
+ sdName: string;
137
+ /**
138
+ * - Function to encode the attribute from OOXML to SuperDoc
139
+ */
140
+ encode?: Function;
141
+ /**
142
+ * - Function to decode the attribute from SuperDoc to OOXML
143
+ */
144
+ decode?: Function;
145
+ };
146
+ export type SCEncoderConfig = import("../../v2/importer/types").NodeHandlerParams;
147
+ export type SCEncoderResult = import("../../v2/types").SuperDocNode;
148
+ export type SCDecoderConfig = {
149
+ node: {
150
+ attrs?: any;
151
+ marks?: any[];
152
+ type: string;
153
+ };
154
+ children?: any[];
155
+ };
156
+ export type SCDecoderResult = {
157
+ name: string;
158
+ elements: any[];
159
+ };
160
+ export type NodeTranslatorEncodeFn = (params: SCEncoderConfig, encodedAttrs?: EncodedAttributes) => import("../../v2/types").SuperDocNode;
161
+ export type NodeTranslatorDecodeFn = (params: SCDecoderConfig, decodedAttrs?: DecodedAttributes) => import("../../v2/types").OpenXmlNode;
162
+ export type MatchesEncodeFn = (nodes: any[], ctx?: any) => boolean;
163
+ export type MatchesDecodeFn = (node: any, ctx?: any) => boolean;
164
+ export type EncodedAttributes = any;
165
+ export type DecodedAttributes = any;
166
+ export type NodeTranslatorConfig = {
167
+ /**
168
+ * - The name of the node in OOXML
169
+ */
170
+ xmlName: string;
171
+ /**
172
+ * - The name of the node in SuperDoc
173
+ */
174
+ sdNodeOrKeyName: string;
175
+ /**
176
+ * - The type of the translator.
177
+ */
178
+ type?: TranslatorType;
179
+ /**
180
+ * - The function to encode the data.
181
+ */
182
+ encode: NodeTranslatorEncodeFn;
183
+ /**
184
+ * - The function to decode the data.
185
+ */
186
+ decode?: NodeTranslatorDecodeFn;
187
+ /**
188
+ * - The priority of the handler.
189
+ */
190
+ priority?: number;
191
+ /**
192
+ * - Attribute handlers list.
193
+ */
194
+ attributes?: AttrConfig[];
195
+ /**
196
+ * - The function to check if the handler can encode the data.
197
+ */
198
+ matchesEncode?: MatchesEncodeFn;
199
+ /**
200
+ * - The function to check if the handler can decode the data.
201
+ */
202
+ matchesDecode?: MatchesDecodeFn;
203
+ };
@@ -1,8 +1,31 @@
1
1
  export const BlockNodePluginKey: PluginKey<any>;
2
+ /**
3
+ * Block node information object
4
+ * @typedef {Object} BlockNodeInfo
5
+ * @property {Object} node - The block node
6
+ * @property {number} pos - Position in the document
7
+ */
8
+ /**
9
+ * @module BlockNode
10
+ * @sidebarTitle Block Node
11
+ * @snippetPath /snippets/extensions/block-node.mdx
12
+ */
2
13
  export const BlockNode: Extension;
3
- export function nodeAllowsSdBlockIdAttr(node: import("prosemirror-model").Node): boolean;
4
- export function nodeNeedsSdBlockId(node: import("prosemirror-model").Node): boolean;
5
- export function checkForNewBlockNodesInTrs(transactions: readonly Transaction[]): boolean;
14
+ export function nodeAllowsSdBlockIdAttr(node: any): boolean;
15
+ export function nodeNeedsSdBlockId(node: any): boolean;
16
+ export function checkForNewBlockNodesInTrs(transactions: ArrayLike<any>): boolean;
17
+ /**
18
+ * Block node information object
19
+ */
20
+ export type BlockNodeInfo = {
21
+ /**
22
+ * - The block node
23
+ */
24
+ node: any;
25
+ /**
26
+ * - Position in the document
27
+ */
28
+ pos: number;
29
+ };
6
30
  import { PluginKey } from 'prosemirror-state';
7
31
  import { Extension } from '@core/Extension.js';
8
- import { Transaction } from 'prosemirror-state';
@@ -5,7 +5,7 @@
5
5
  */
6
6
  /**
7
7
  * @module Color
8
- * @sidebarTitle Text Color
8
+ * @sidebarTitle Color
9
9
  * @snippetPath /snippets/extensions/color.mdx
10
10
  */
11
11
  export const Color: Extension;
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @module DropCursor
3
+ * @sidebarTitle Drop Cursor
4
+ * @snippetPath /snippets/extensions/dropcursor.mdx
5
+ */
1
6
  export const DropCursor: Extension;
2
7
  import { Extension } from '@core/index.js';
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @module Gapcursor
3
+ * @sidebarTitle Gap Cursor
4
+ * @snippetPath /snippets/extensions/gapcursor.mdx
5
+ */
1
6
  export const Gapcursor: Extension;
2
7
  import { Extension } from '@core/index.js';
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @module Image
3
+ * @sidebarTitle Image
4
+ * @snippetPath /snippets/extensions/image.mdx
5
+ */
1
6
  export const Image: Node;
2
7
  import { Node } from '@core/index.js';
@@ -1 +1 @@
1
- export function getFileOpener(): () => Promise<any>;
1
+ export function getFileOpener(): Function;
@@ -1 +1 @@
1
- export function handleImageUpload(file: any): Promise<any>;
1
+ export function handleImageUpload(file: File): Promise<string>;
@@ -1,6 +1,5 @@
1
1
  export const ImagePlaceholderPluginKey: PluginKey<any>;
2
- export function ImagePlaceholderPlugin(): Plugin<DecorationSet>;
3
- export function findPlaceholder(state: any, id: any): any;
2
+ export function ImagePlaceholderPlugin(): Plugin;
3
+ export function findPlaceholder(state: any, id: string): number | null;
4
4
  import { PluginKey } from 'prosemirror-state';
5
- import { DecorationSet } from 'prosemirror-view';
6
5
  import { Plugin } from 'prosemirror-state';
@@ -1,5 +1,4 @@
1
1
  export function ImagePositionPlugin({ editor }: {
2
2
  editor: any;
3
- }): Plugin<DecorationSet>;
4
- import { DecorationSet } from 'prosemirror-view';
3
+ }): Plugin;
5
4
  import { Plugin } from 'prosemirror-state';
@@ -1,5 +1,2 @@
1
- export function processUploadedImage(fileData: string | File, editor: any): Promise<string | File>;
2
- export function getAllowedImageDimensions(width: any, height: any, editor: any): {
3
- width: any;
4
- height: any;
5
- };
1
+ export function processUploadedImage(fileData: string | File, editor: any): Promise<string | any>;
2
+ export function getAllowedImageDimensions(width: number, height: number, editor: any): any;
@@ -1,12 +1,27 @@
1
+ /**
2
+ * Uploads an image and inserts it into the document
3
+ * @category Helper
4
+ * @param {Object} params - Upload parameters
5
+ * @param {Object} params.editor - Editor instance
6
+ * @param {Object} params.view - Editor view
7
+ * @param {File} params.file - Processed image file
8
+ * @param {Object} params.size - Image dimensions
9
+ * @param {Function} params.uploadHandler - Function to handle the upload
10
+ * @returns {Promise<void>}
11
+ * @example
12
+ * await uploadImage({ editor, view, file, size, uploadHandler });
13
+ * @note Shows placeholder during upload
14
+ * @note Handles collaboration mode image sharing
15
+ */
1
16
  export function uploadImage({ editor, view, file, size, uploadHandler }: {
2
17
  editor: any;
3
18
  view: any;
4
- file: any;
19
+ file: File;
5
20
  size: any;
6
- uploadHandler: any;
21
+ uploadHandler: Function;
7
22
  }): Promise<void>;
8
23
  export function startImageUpload({ editor, view, file }: {
9
24
  editor: any;
10
25
  view: any;
11
- file: any;
26
+ file: File;
12
27
  }): Promise<void>;
@@ -1,9 +1,7 @@
1
- export function getLinkedStyle(styleId: string, styles?: any): any;
1
+ export function getLinkedStyle(styleId: string, styles?: any[]): any;
2
2
  export function getSpacingStyle(spacing: any): any;
3
3
  export function getSpacingStyleString(spacing: any): string;
4
- export function getMarksStyle(attrs: any): string;
5
- export function getQuickFormatList(editor: import("../../core/Editor.js").Editor): any[];
4
+ export function getMarksStyle(attrs: any[]): string;
5
+ export function getQuickFormatList(editor: any): any[];
6
6
  export function generateLinkedStyleString(linkedStyle: any, basedOnStyle: any, node: any, parent: any, includeSpacing?: boolean): string;
7
- export function applyLinkedStyleToTransaction(tr: Transaction, editor: Editor, style: {
8
- id: string;
9
- }): boolean;
7
+ export function applyLinkedStyleToTransaction(tr: any, editor: any, style: any): boolean;
@@ -1,2 +1,31 @@
1
+ /**
2
+ * Style definition from Word document
3
+ * @typedef {Object} LinkedStyle
4
+ * @property {string} id - Style ID (e.g., 'Heading1', 'Normal')
5
+ * @property {string} type - Style type ('paragraph' or 'character')
6
+ * @property {Object} definition - Style definition from Word
7
+ */
8
+ /**
9
+ * @module LinkedStyles
10
+ * @sidebarTitle Linked Styles
11
+ * @snippetPath /snippets/extensions/linked-styles.mdx
12
+ */
1
13
  export const LinkedStyles: Extension;
14
+ /**
15
+ * Style definition from Word document
16
+ */
17
+ export type LinkedStyle = {
18
+ /**
19
+ * - Style ID (e.g., 'Heading1', 'Normal')
20
+ */
21
+ id: string;
22
+ /**
23
+ * - Style type ('paragraph' or 'character')
24
+ */
25
+ type: string;
26
+ /**
27
+ * - Style definition from Word
28
+ */
29
+ definition: any;
30
+ };
2
31
  import { Extension } from '@core/Extension.js';
@@ -1,4 +1,6 @@
1
+ /**
2
+ * Plugin key for accessing linked styles state
3
+ */
1
4
  export const LinkedStylesPluginKey: PluginKey<any>;
2
- export function createLinkedStylesPlugin(editor: any): Plugin<any>;
5
+ export function createLinkedStylesPlugin(editor: any): any;
3
6
  import { PluginKey } from 'prosemirror-state';
4
- import { Plugin } from 'prosemirror-state';
@@ -1,2 +1,2 @@
1
- export const Paragraph: Node;
2
- import { Node } from '@core/index.js';
1
+ export const Paragraph: OxmlNode;
2
+ import { OxmlNode } from '@core/index.js';
@@ -1,2 +1,11 @@
1
+ /**
2
+ * @module TextAlign
3
+ * @sidebarTitle Text Align
4
+ * @snippetPath /snippets/extensions/text-align.mdx
5
+ * @shortcut Mod-Shift-l | setTextAlign('left') | Align text left
6
+ * @shortcut Mod-Shift-e | setTextAlign('center') | Align text center
7
+ * @shortcut Mod-Shift-r | setTextAlign('right') | Align text right
8
+ * @shortcut Mod-Shift-j | setTextAlign('justify') | Justify text
9
+ */
1
10
  export const TextAlign: Extension;
2
11
  import { Extension } from '@core/index.js';
@@ -1,2 +1,21 @@
1
+ /**
2
+ * Text indent configuration
3
+ * @typedef {Object} IndentConfig
4
+ * @property {string} indent - Indent value with unit (e.g., '0.5in', '1cm')
5
+ */
6
+ /**
7
+ * @module TextIndent
8
+ * @sidebarTitle Text Indent
9
+ * @snippetPath /snippets/extensions/text-indent.mdx
10
+ */
1
11
  export const TextIndent: Extension;
12
+ /**
13
+ * Text indent configuration
14
+ */
15
+ export type IndentConfig = {
16
+ /**
17
+ * - Indent value with unit (e.g., '0.5in', '1cm')
18
+ */
19
+ indent: string;
20
+ };
2
21
  import { Extension } from '@core/index.js';
@@ -1,2 +1,7 @@
1
+ /**
2
+ * @module TextTransform
3
+ * @sidebarTitle Text Transform
4
+ * @snippetPath /snippets/extensions/text-transform.mdx
5
+ */
1
6
  export const TextTransform: Extension;
2
7
  import { Extension } from '@core/index.js';
@@ -14,6 +14,7 @@ import { getStarterExtensions } from './extensions/index.js';
14
14
  import { getRichTextExtensions } from './extensions/index.js';
15
15
  import { createZip } from './core/super-converter/zipper.js';
16
16
  import { getAllowedImageDimensions } from './extensions/image/imageHelpers/processUploadedImage.js';
17
+ import { registeredHandlers } from './core/super-converter/v3/handlers/index.js';
17
18
  export namespace Extensions {
18
19
  export { Node };
19
20
  export { Attribute };
@@ -28,4 +29,4 @@ import { Attribute } from '@core/index.js';
28
29
  import { Extension } from '@core/Extension.js';
29
30
  import { Plugin } from 'prosemirror-state';
30
31
  import { Mark } from '@core/Mark.js';
31
- export { SuperConverter, DocxZipper, SuperToolbar, Editor, SuperEditor, SuperInput, BasicUpload, Toolbar, AIWriter, SlashMenu, helpers, fieldAnnotationHelpers, trackChangesHelpers, AnnotatorHelpers, SectionHelpers, getMarksFromSelection, getActiveFormatting, getStarterExtensions, getRichTextExtensions, createZip, getAllowedImageDimensions, TrackChangesBasePluginKey, CommentsPluginKey };
32
+ export { SuperConverter, DocxZipper, SuperToolbar, Editor, SuperEditor, SuperInput, BasicUpload, Toolbar, AIWriter, SlashMenu, helpers, fieldAnnotationHelpers, trackChangesHelpers, AnnotatorHelpers, SectionHelpers, getMarksFromSelection, getActiveFormatting, getStarterExtensions, getRichTextExtensions, createZip, getAllowedImageDimensions, registeredHandlers, TrackChangesBasePluginKey, CommentsPluginKey };
@@ -5,3 +5,4 @@ export function getExportedResultForAnnotations(isFinalDoc: any): Promise<{
5
5
  result: any;
6
6
  params: any;
7
7
  }>;
8
+ export function getExportedResultWithDocContent(content: Array<any>, baseName?: string): Promise<any>;
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
- import { aw as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, az as vClickOutside, y as findParentNode, aA as getActiveFormatting, aq as isInTable, aB as readFromClipboard, aC as handleClipboardPaste, aD as getFileObject, a as Plugin } from "./chunks/converter-Bcg2-svq.js";
13
- import { aE, a4, d, a1 } from "./chunks/converter-Bcg2-svq.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-D4fBb3em.js";
15
- import { k, C, l, T, i, m, j } from "./chunks/editor-D4fBb3em.js";
12
+ import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, q as getMarkRange, aA as vClickOutside, z as findParentNode, aB as getActiveFormatting, ar as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as translator, aG as translator$1, aH as translator$2, a as Plugin } from "./chunks/converter-5WOzOHZb.js";
13
+ import { aI, a5, d, a2 } from "./chunks/converter-5WOzOHZb.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-CCOqTxyv.js";
15
+ import { k, C, l, T, i, m, j } from "./chunks/editor-CCOqTxyv.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-C6KdVRS2.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DjjHAttK.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-X-fYIxPZ.js";
19
+ import { D } from "./chunks/docx-zipper-CP-vEy49.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -80,7 +80,7 @@ function requireEventemitter3() {
80
80
  if (listeners.fn) return 1;
81
81
  return listeners.length;
82
82
  };
83
- EventEmitter2.prototype.emit = function emit(event, a12, a2, a3, a42, a5) {
83
+ EventEmitter2.prototype.emit = function emit(event, a1, a22, a3, a4, a52) {
84
84
  var evt = prefix ? prefix + event : event;
85
85
  if (!this._events[evt]) return false;
86
86
  var listeners = this._events[evt], len = arguments.length, args, i2;
@@ -90,15 +90,15 @@ function requireEventemitter3() {
90
90
  case 1:
91
91
  return listeners.fn.call(listeners.context), true;
92
92
  case 2:
93
- return listeners.fn.call(listeners.context, a12), true;
93
+ return listeners.fn.call(listeners.context, a1), true;
94
94
  case 3:
95
- return listeners.fn.call(listeners.context, a12, a2), true;
95
+ return listeners.fn.call(listeners.context, a1, a22), true;
96
96
  case 4:
97
- return listeners.fn.call(listeners.context, a12, a2, a3), true;
97
+ return listeners.fn.call(listeners.context, a1, a22, a3), true;
98
98
  case 5:
99
- return listeners.fn.call(listeners.context, a12, a2, a3, a42), true;
99
+ return listeners.fn.call(listeners.context, a1, a22, a3, a4), true;
100
100
  case 6:
101
- return listeners.fn.call(listeners.context, a12, a2, a3, a42, a5), true;
101
+ return listeners.fn.call(listeners.context, a1, a22, a3, a4, a52), true;
102
102
  }
103
103
  for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
104
104
  args[i2 - 1] = arguments[i2];
@@ -113,13 +113,13 @@ function requireEventemitter3() {
113
113
  listeners[i2].fn.call(listeners[i2].context);
114
114
  break;
115
115
  case 2:
116
- listeners[i2].fn.call(listeners[i2].context, a12);
116
+ listeners[i2].fn.call(listeners[i2].context, a1);
117
117
  break;
118
118
  case 3:
119
- listeners[i2].fn.call(listeners[i2].context, a12, a2);
119
+ listeners[i2].fn.call(listeners[i2].context, a1, a22);
120
120
  break;
121
121
  case 4:
122
- listeners[i2].fn.call(listeners[i2].context, a12, a2, a3);
122
+ listeners[i2].fn.call(listeners[i2].context, a1, a22, a3);
123
123
  break;
124
124
  default:
125
125
  if (!args) for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
@@ -4597,6 +4597,11 @@ const _sfc_main = {
4597
4597
  }
4598
4598
  };
4599
4599
  const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
4600
+ const registeredHandlers = Object.freeze({
4601
+ "w:br": translator$2,
4602
+ "w:tab": translator$1,
4603
+ "w:p": translator
4604
+ });
4600
4605
  const Extensions = {
4601
4606
  Node,
4602
4607
  Attribute,
@@ -4607,14 +4612,14 @@ const Extensions = {
4607
4612
  export {
4608
4613
  AIWriter,
4609
4614
  k as AnnotatorHelpers,
4610
- aE as BasicUpload,
4615
+ aI as BasicUpload,
4611
4616
  C as CommentsPluginKey,
4612
4617
  D as DocxZipper,
4613
4618
  Editor,
4614
4619
  Extensions,
4615
4620
  l as SectionHelpers,
4616
4621
  _sfc_main$4 as SlashMenu,
4617
- a4 as SuperConverter,
4622
+ a5 as SuperConverter,
4618
4623
  SuperEditor,
4619
4624
  SuperInput,
4620
4625
  SuperToolbar,
@@ -4627,6 +4632,7 @@ export {
4627
4632
  d as getMarksFromSelection,
4628
4633
  getRichTextExtensions,
4629
4634
  getStarterExtensions,
4630
- a1 as helpers,
4635
+ a2 as helpers,
4636
+ registeredHandlers,
4631
4637
  j as trackChangesHelpers
4632
4638
  };
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-C6KdVRS2.js";
3
- import "./chunks/editor-D4fBb3em.js";
2
+ import { T } from "./chunks/toolbar-DjjHAttK.js";
3
+ import "./chunks/editor-CCOqTxyv.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-D8CRzfwC.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DyAWPYYh.cjs");
4
4
  require("./chunks/vue-DWle4Cai.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -25,4 +25,5 @@ exports.getMarksFromSelection = superEditor_es.getMarksFromSelection;
25
25
  exports.getRichTextExtensions = superEditor_es.getRichTextExtensions;
26
26
  exports.getStarterExtensions = superEditor_es.getStarterExtensions;
27
27
  exports.helpers = superEditor_es.helpers;
28
+ exports.registeredHandlers = superEditor_es.registeredHandlers;
28
29
  exports.trackChangesHelpers = superEditor_es.index;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, q } from "./chunks/super-editor.es-C-nn3bMY.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-Cx5l8JEt.es.js";
2
2
  import "./chunks/vue-CXxsqYcP.es.js";
3
3
  export {
4
4
  A as AIWriter,
@@ -24,5 +24,6 @@ export {
24
24
  n as getRichTextExtensions,
25
25
  o as getStarterExtensions,
26
26
  p as helpers,
27
+ r as registeredHandlers,
27
28
  q as trackChangesHelpers
28
29
  };
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-D8CRzfwC.cjs");
4
- const superdoc = require("./chunks/index-LZjTD5KG.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-DyAWPYYh.cjs");
4
+ const superdoc = require("./chunks/index-cCWdcGrV.cjs");
5
5
  require("./chunks/vue-DWle4Cai.cjs");
6
6
  require("./chunks/jszip-b7l8QkfH.cjs");
7
7
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -13,6 +13,7 @@ exports.SuperConverter = superEditor_es.SuperConverter;
13
13
  exports.createZip = superEditor_es.createZip;
14
14
  exports.fieldAnnotationHelpers = superEditor_es.index$1;
15
15
  exports.getRichTextExtensions = superEditor_es.getRichTextExtensions;
16
+ exports.registeredHandlers = superEditor_es.registeredHandlers;
16
17
  exports.superEditorHelpers = superEditor_es.helpers;
17
18
  exports.trackChangesHelpers = superEditor_es.index;
18
19
  exports.DOCX = superdoc.DOCX;
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, p, q } from "./chunks/super-editor.es-C-nn3bMY.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-CHQbeTTv.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-Cx5l8JEt.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-DEONStGL.es.js";
3
3
  import "./chunks/vue-CXxsqYcP.es.js";
4
4
  import "./chunks/jszip-B8KIZSNe.es.js";
5
5
  import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -19,6 +19,7 @@ export {
19
19
  j as fieldAnnotationHelpers,
20
20
  l as getFileObject,
21
21
  n as getRichTextExtensions,
22
+ r as registeredHandlers,
22
23
  p as superEditorHelpers,
23
24
  q as trackChangesHelpers
24
25
  };