@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.
- package/dist/chunks/{PdfViewer-B5bEH-lD.cjs → PdfViewer-DKOAmiXw.cjs} +1 -1
- package/dist/chunks/{PdfViewer-P3OSs9iX.es.js → PdfViewer-OIo9wAyq.es.js} +1 -1
- package/dist/chunks/{index-CHQbeTTv.es.js → index-DEONStGL.es.js} +4 -3
- package/dist/chunks/{index-LZjTD5KG.cjs → index-cCWdcGrV.cjs} +4 -3
- package/dist/chunks/{super-editor.es-C-nn3bMY.es.js → super-editor.es-Cx5l8JEt.es.js} +4350 -3412
- package/dist/chunks/{super-editor.es-D8CRzfwC.cjs → super-editor.es-DyAWPYYh.cjs} +4349 -3411
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Bcg2-svq.js → converter-5WOzOHZb.js} +4396 -3862
- package/dist/super-editor/chunks/{docx-zipper-X-fYIxPZ.js → docx-zipper-CP-vEy49.js} +1 -1
- package/dist/super-editor/chunks/{editor-D4fBb3em.js → editor-CCOqTxyv.js} +454 -42
- package/dist/super-editor/chunks/{toolbar-C6KdVRS2.js → toolbar-DjjHAttK.js} +2 -2
- package/dist/super-editor/converter.es.js +3 -2
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/src/core/commands/insertContent.d.ts +4 -4
- package/dist/super-editor/src/core/helpers/contentProcessor.d.ts +13 -0
- package/dist/super-editor/src/core/helpers/htmlSanitizer.d.ts +8 -0
- package/dist/super-editor/src/core/helpers/importHtml.d.ts +3 -2
- package/dist/super-editor/src/core/helpers/importMarkdown.d.ts +2 -1
- package/dist/super-editor/src/core/helpers/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/docx-helpers/get-default-style-definition.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/docx-helpers/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/exporter.d.ts +19 -2
- package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +2 -1
- package/dist/super-editor/src/core/super-converter/v2/importer/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v2/importer/lineBreakImporter.d.ts +3 -5
- package/dist/super-editor/src/core/super-converter/v2/importer/paragraphNodeImporter.d.ts +3 -63
- package/dist/super-editor/src/core/super-converter/v2/importer/tabImporter.d.ts +2 -1
- package/dist/super-editor/src/core/super-converter/v2/importer/tableImporter.d.ts +17 -6
- package/dist/super-editor/src/core/super-converter/v2/importer/types/index.d.ts +73 -0
- package/dist/super-editor/src/core/super-converter/v2/types/index.d.ts +8 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-clear.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-line-break-type.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/br-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-del.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-p.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-r-default.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-r-pr.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w-rsid-r.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w14-para-id.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/attributes/w14-text-id.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/legacy-handle-paragraph-node.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/w-p-helpers.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/p-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-leader.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-pos.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-size.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/tab-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/legacy-handle-table-cell-node.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/translate-table-cell.d.ts +17 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/tc-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/node-translator/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +203 -0
- package/dist/super-editor/src/extensions/block-node/block-node.d.ts +27 -4
- package/dist/super-editor/src/extensions/color/color.d.ts +1 -1
- package/dist/super-editor/src/extensions/dropcursor/dropcursor.d.ts +5 -0
- package/dist/super-editor/src/extensions/gapcursor/gapcursor.d.ts +5 -0
- package/dist/super-editor/src/extensions/image/image.d.ts +5 -0
- package/dist/super-editor/src/extensions/image/imageHelpers/getFileOpener.d.ts +1 -1
- package/dist/super-editor/src/extensions/image/imageHelpers/handleImageUpload.d.ts +1 -1
- package/dist/super-editor/src/extensions/image/imageHelpers/imagePlaceholderPlugin.d.ts +2 -3
- package/dist/super-editor/src/extensions/image/imageHelpers/imagePositionPlugin.d.ts +1 -2
- package/dist/super-editor/src/extensions/image/imageHelpers/processUploadedImage.d.ts +2 -5
- package/dist/super-editor/src/extensions/image/imageHelpers/startImageUpload.d.ts +18 -3
- package/dist/super-editor/src/extensions/linked-styles/helpers.d.ts +4 -6
- package/dist/super-editor/src/extensions/linked-styles/linked-styles.d.ts +29 -0
- package/dist/super-editor/src/extensions/linked-styles/plugin.d.ts +4 -2
- package/dist/super-editor/src/extensions/paragraph/paragraph.d.ts +2 -2
- package/dist/super-editor/src/extensions/text-align/text-align.d.ts +9 -0
- package/dist/super-editor/src/extensions/text-indent/text-indent.d.ts +19 -0
- package/dist/super-editor/src/extensions/text-transform/text-transform.d.ts +5 -0
- package/dist/super-editor/src/index.d.ts +2 -1
- package/dist/super-editor/src/tests/export/export-helpers/export-helpers.d.ts +1 -0
- package/dist/super-editor/super-editor.es.js +24 -18
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -1
- package/dist/super-editor.es.js +2 -1
- package/dist/superdoc.cjs +3 -2
- package/dist/superdoc.es.js +3 -2
- package/dist/superdoc.umd.js +4488 -3549
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/super-editor/src/core/super-converter/v2/handlers/index.d.ts +0 -1
- package/dist/super-editor/src/extensions/field-annotation/field-annotation-marks-impl.d.ts +0 -5
- /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:
|
|
4
|
-
export function nodeNeedsSdBlockId(node:
|
|
5
|
-
export function checkForNewBlockNodesInTrs(transactions:
|
|
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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function getFileOpener():
|
|
1
|
+
export function getFileOpener(): Function;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function handleImageUpload(file:
|
|
1
|
+
export function handleImageUpload(file: File): Promise<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export const ImagePlaceholderPluginKey: PluginKey<any>;
|
|
2
|
-
export function ImagePlaceholderPlugin(): Plugin
|
|
3
|
-
export function findPlaceholder(state: any, id:
|
|
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,2 @@
|
|
|
1
|
-
export function processUploadedImage(fileData: string | File, editor: any): Promise<string |
|
|
2
|
-
export function getAllowedImageDimensions(width:
|
|
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:
|
|
19
|
+
file: File;
|
|
5
20
|
size: any;
|
|
6
|
-
uploadHandler:
|
|
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:
|
|
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:
|
|
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:
|
|
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):
|
|
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:
|
|
2
|
-
import {
|
|
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';
|
|
@@ -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 };
|
|
@@ -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 {
|
|
13
|
-
import {
|
|
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-
|
|
15
|
-
import { k, C, l, T, i, m, j } from "./chunks/editor-
|
|
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-
|
|
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-
|
|
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,
|
|
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,
|
|
93
|
+
return listeners.fn.call(listeners.context, a1), true;
|
|
94
94
|
case 3:
|
|
95
|
-
return listeners.fn.call(listeners.context,
|
|
95
|
+
return listeners.fn.call(listeners.context, a1, a22), true;
|
|
96
96
|
case 4:
|
|
97
|
-
return listeners.fn.call(listeners.context,
|
|
97
|
+
return listeners.fn.call(listeners.context, a1, a22, a3), true;
|
|
98
98
|
case 5:
|
|
99
|
-
return listeners.fn.call(listeners.context,
|
|
99
|
+
return listeners.fn.call(listeners.context, a1, a22, a3, a4), true;
|
|
100
100
|
case 6:
|
|
101
|
-
return listeners.fn.call(listeners.context,
|
|
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,
|
|
116
|
+
listeners[i2].fn.call(listeners[i2].context, a1);
|
|
117
117
|
break;
|
|
118
118
|
case 3:
|
|
119
|
-
listeners[i2].fn.call(listeners[i2].context,
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4635
|
+
a2 as helpers,
|
|
4636
|
+
registeredHandlers,
|
|
4631
4637
|
j as trackChangesHelpers
|
|
4632
4638
|
};
|
package/dist/super-editor.cjs
CHANGED
|
@@ -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-
|
|
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;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -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-
|
|
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-
|
|
4
|
-
const superdoc = require("./chunks/index-
|
|
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;
|
package/dist/superdoc.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a, E, b, S, d, i, j, n, p, q } from "./chunks/super-editor.es-
|
|
2
|
-
import { D, H, P, S as S2, m, l } from "./chunks/index-
|
|
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
|
};
|