@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { I as process$1 } from "./converter-5WOzOHZb.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CCOqTxyv.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-CCOqTxyv.js";
|
|
2
|
+
import "./chunks/converter-5WOzOHZb.js";
|
|
3
|
+
import "./chunks/docx-zipper-CP-vEy49.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function insertContent(value:
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
})
|
|
1
|
+
export function insertContent(value: string | any, options?: {
|
|
2
|
+
contentType?: string;
|
|
3
|
+
parseOptions?: boolean;
|
|
4
|
+
}): Function;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified content processor that handles all content types
|
|
3
|
+
* @param {Object} params
|
|
4
|
+
* @param {string} params.content - The content to process
|
|
5
|
+
* @param {string} params.type - Content type: 'html', 'markdown', 'text', 'schema'
|
|
6
|
+
* @param {Object} params.schema - ProseMirror schema
|
|
7
|
+
* @returns {Object} Processed ProseMirror document
|
|
8
|
+
*/
|
|
9
|
+
export function processContent({ content, type, schema }: {
|
|
10
|
+
content: string;
|
|
11
|
+
type: string;
|
|
12
|
+
schema: any;
|
|
13
|
+
}): any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip all inline styles and non-semantic attributes from HTML
|
|
3
|
+
* Preserves structure while removing presentation
|
|
4
|
+
*
|
|
5
|
+
* @param {string} html - Raw HTML string
|
|
6
|
+
* @returns {string} Clean HTML with semantic structure only
|
|
7
|
+
*/
|
|
8
|
+
export function stripHtmlStyles(html: string): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create a document from HTML content
|
|
3
|
-
* @private
|
|
4
3
|
* @param {string} content - HTML content
|
|
4
|
+
* @param {Object} schema - ProseMirror schema
|
|
5
|
+
* @param {Object} [options={}] - Import options
|
|
5
6
|
* @returns {Object} Document node
|
|
6
7
|
*/
|
|
7
|
-
export function createDocFromHTML(content: string, schema: any): any;
|
|
8
|
+
export function createDocFromHTML(content: string, schema: any, options?: any): any;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Create a ProseMirror document from Markdown content
|
|
3
3
|
* @param {string} markdown - Markdown content
|
|
4
4
|
* @param {Object} schema - ProseMirror schema
|
|
5
|
+
* @param {Object} [options={}] - Import options
|
|
5
6
|
* @returns {Object} Document node
|
|
6
7
|
*/
|
|
7
|
-
export function createDocFromMarkdown(markdown: string, schema: any): any;
|
|
8
|
+
export function createDocFromMarkdown(markdown: string, schema: any, options?: any): any;
|
|
8
9
|
/**
|
|
9
10
|
* Convert Markdown to HTML with SuperDoc/DOCX compatibility
|
|
10
11
|
* @param {string} markdown - Markdown content
|
package/dist/super-editor/src/core/super-converter/docx-helpers/get-default-style-definition.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getDefaultStyleDefinition(defaultStyleId: string, docx: any): any;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* @typedef {Object} XmlReadyNode
|
|
16
16
|
* @property {string} name The XML tag name
|
|
17
17
|
* @property {Array<XmlReadyNode>} elements The child nodes
|
|
18
|
-
* @property {Object} attributes The node attributes
|
|
18
|
+
* @property {Object} [attributes] The node attributes
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
21
|
* @typedef {Object.<string, *>} SchemaAttributes
|
|
@@ -44,6 +44,23 @@ export function exportSchemaToJson(params: ExportParams): XmlReadyNode;
|
|
|
44
44
|
* @returns {XmlReadyNode} JSON of the XML-ready paragraph node
|
|
45
45
|
*/
|
|
46
46
|
export function translateParagraphNode(params: any): XmlReadyNode;
|
|
47
|
+
/**
|
|
48
|
+
* Generate a w:rPr node (run properties) from marks
|
|
49
|
+
*
|
|
50
|
+
* @param {Object[]} marks The marks to add to the run properties
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
export function generateRunProps(marks?: any[]): {
|
|
54
|
+
name: string;
|
|
55
|
+
elements: any[];
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Get all marks as a list of MarkType objects
|
|
59
|
+
*
|
|
60
|
+
* @param {MarkType[]} marks
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export function processOutputMarks(marks?: MarkType[]): any[];
|
|
47
64
|
/**
|
|
48
65
|
* Main translation function for a table row
|
|
49
66
|
*
|
|
@@ -111,7 +128,7 @@ export type XmlReadyNode = {
|
|
|
111
128
|
/**
|
|
112
129
|
* The node attributes
|
|
113
130
|
*/
|
|
114
|
-
attributes
|
|
131
|
+
attributes?: any;
|
|
115
132
|
};
|
|
116
133
|
/**
|
|
117
134
|
* Key value pairs representing the node attributes from prose mirror
|
|
@@ -29,7 +29,7 @@ export function createDocumentJson(docx: ParsedDocx, converter: SuperConverter,
|
|
|
29
29
|
pageStyles: any;
|
|
30
30
|
} | null;
|
|
31
31
|
export function defaultNodeListHandler(): {
|
|
32
|
-
handler: ({ nodes: elements, docx, insideTrackChange, converter, editor, filename, parentStyleId, lists, }: {
|
|
32
|
+
handler: ({ nodes: elements, docx, insideTrackChange, converter, editor, filename, parentStyleId, lists, path, }: {
|
|
33
33
|
nodes: any;
|
|
34
34
|
docx: any;
|
|
35
35
|
insideTrackChange: any;
|
|
@@ -38,6 +38,7 @@ export function defaultNodeListHandler(): {
|
|
|
38
38
|
filename: any;
|
|
39
39
|
parentStyleId: any;
|
|
40
40
|
lists: any;
|
|
41
|
+
path?: any[];
|
|
41
42
|
}) => any[];
|
|
42
43
|
handlerEntities: any[];
|
|
43
44
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
+
export function handler(params: import("../../v3/node-translator").SCEncoderConfig): any;
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
export const handleLineBreakNode: any;
|
|
5
|
-
/**
|
|
6
|
-
* @type {import("docxImporter").NodeHandlerEntry}
|
|
3
|
+
* Line break node handler entity
|
|
4
|
+
* @type {Object} Handler entity
|
|
7
5
|
*/
|
|
8
6
|
export const lineBreakNodeHandlerEntity: any;
|
|
@@ -1,66 +1,6 @@
|
|
|
1
|
+
export function handleParagraphNode(params: import("../../v3/node-translator").SCEncoderConfig): any;
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @
|
|
4
|
-
*/
|
|
5
|
-
export function getDefaultStyleDefinition(defaultStyleId: string, docx: ParsedDocx): {
|
|
6
|
-
lineSpaceBefore: any;
|
|
7
|
-
lineSpaceAfter: any;
|
|
8
|
-
} | {
|
|
9
|
-
attrs: {
|
|
10
|
-
name: any;
|
|
11
|
-
qFormat: boolean;
|
|
12
|
-
keepNext: boolean;
|
|
13
|
-
keepLines: boolean;
|
|
14
|
-
outlineLevel: number;
|
|
15
|
-
pageBreakBefore: boolean;
|
|
16
|
-
pageBreakAfter: boolean;
|
|
17
|
-
basedOn: any;
|
|
18
|
-
};
|
|
19
|
-
styles: {
|
|
20
|
-
spacing: {
|
|
21
|
-
lineSpaceAfter: number;
|
|
22
|
-
lineSpaceBefore: number;
|
|
23
|
-
line: number;
|
|
24
|
-
};
|
|
25
|
-
textAlign: any;
|
|
26
|
-
indent: {
|
|
27
|
-
leftIndent: number;
|
|
28
|
-
rightIndent: number;
|
|
29
|
-
firstLine: number;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* We need to pre-process nodes in a paragraph to combine nodes together where necessary ie: links
|
|
35
|
-
* TODO: Likely will find more w:fldChar to deal with.
|
|
36
|
-
*
|
|
37
|
-
* @param {XmlNode[]} nodes
|
|
38
|
-
* @returns
|
|
39
|
-
*/
|
|
40
|
-
export function preProcessNodesForFldChar(nodes?: XmlNode[]): any[];
|
|
41
|
-
/**
|
|
42
|
-
* Special cases of w:p based on paragraph properties
|
|
43
|
-
*
|
|
44
|
-
* If we detect a list node, we need to get all nodes that are also lists and process them together
|
|
45
|
-
* in order to combine list item nodes into list nodes.
|
|
46
|
-
*
|
|
47
|
-
* @type {import("docxImporter").NodeHandler}
|
|
48
|
-
*/
|
|
49
|
-
export const handleParagraphNode: any;
|
|
50
|
-
export function getParagraphIndent(node: any, docx: any, styleId?: string): {
|
|
51
|
-
left: number;
|
|
52
|
-
right: number;
|
|
53
|
-
firstLine: number;
|
|
54
|
-
hanging: number;
|
|
55
|
-
textIndent: number;
|
|
56
|
-
};
|
|
57
|
-
export function getParagraphSpacing(node: any, docx: any, styleId?: string, marks?: any[]): {
|
|
58
|
-
line: string | number;
|
|
59
|
-
lineRule: any;
|
|
60
|
-
lineSpaceBefore: number;
|
|
61
|
-
lineSpaceAfter: number;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* @type {import("docxImporter").NodeHandlerEntry}
|
|
3
|
+
* Paragraph node handler entity
|
|
4
|
+
* @type {Object} Handler entity
|
|
65
5
|
*/
|
|
66
6
|
export const paragraphNodeHandlerEntity: any;
|
|
@@ -16,18 +16,28 @@ export function handleTableNode(node: XmlNode, params: any): {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param node
|
|
21
|
-
* @param {ParsedDocx} docx
|
|
22
|
-
* @param {NodeListHandler} nodeListHandler
|
|
23
|
-
* @param {boolean} insideTrackChange
|
|
19
|
+
* @param {Object} options
|
|
24
20
|
* @returns {{type: string, content: (*|*[]), attrs: {}}}
|
|
25
21
|
*/
|
|
26
|
-
export function handleTableCellNode(
|
|
22
|
+
export function handleTableCellNode({ params, node, table, row, rowBorders, styleTag, columnIndex, columnWidth, }: any): {
|
|
27
23
|
type: string;
|
|
28
24
|
content: (any | any[]);
|
|
29
25
|
attrs: {};
|
|
30
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param tblStyleTag
|
|
30
|
+
* @param {ParsedDocx} docx
|
|
31
|
+
* @param {NodeListHandler} nodeListHandler
|
|
32
|
+
* @returns {{uiPriotity: *, borders: {}, name: *, rowBorders: {}, basedOn: *}|null}
|
|
33
|
+
*/
|
|
34
|
+
export function getReferencedTableStyles(tblStyleTag: any, docx: ParsedDocx): {
|
|
35
|
+
uiPriotity: any;
|
|
36
|
+
borders: {};
|
|
37
|
+
name: any;
|
|
38
|
+
rowBorders: {};
|
|
39
|
+
basedOn: any;
|
|
40
|
+
} | null;
|
|
31
41
|
/**
|
|
32
42
|
* Process a table row node
|
|
33
43
|
* @param node
|
|
@@ -49,3 +59,4 @@ export const handleAllTableNodes: any;
|
|
|
49
59
|
* @type {import("docxImporter").NodeHandlerEntry}
|
|
50
60
|
*/
|
|
51
61
|
export const tableNodeHandlerEntity: any;
|
|
62
|
+
export function getGridColumnWidths(tableNode: any): any;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export type NodeHandlerParams = {
|
|
2
|
+
/**
|
|
3
|
+
* - The array of nodes to process.
|
|
4
|
+
*/
|
|
5
|
+
nodes: any[];
|
|
6
|
+
/**
|
|
7
|
+
* - The parsed DOCX object.
|
|
8
|
+
*/
|
|
9
|
+
docx: any;
|
|
10
|
+
/**
|
|
11
|
+
* - Indicates if the processing is inside a track change.
|
|
12
|
+
*/
|
|
13
|
+
insideTrackChange: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* - The node list handler.
|
|
16
|
+
*/
|
|
17
|
+
nodeListHandler: NodeListHandler;
|
|
18
|
+
/**
|
|
19
|
+
* - The converter object.
|
|
20
|
+
*/
|
|
21
|
+
converter: any;
|
|
22
|
+
/**
|
|
23
|
+
* - The editor object.
|
|
24
|
+
*/
|
|
25
|
+
editor: import("../../../../Editor").Editor;
|
|
26
|
+
/**
|
|
27
|
+
* - The name of the file being processed.
|
|
28
|
+
*/
|
|
29
|
+
filename?: string;
|
|
30
|
+
/**
|
|
31
|
+
* - The ID of the parent style.
|
|
32
|
+
*/
|
|
33
|
+
parentStyleId?: string;
|
|
34
|
+
/**
|
|
35
|
+
* - The imported lists object
|
|
36
|
+
*/
|
|
37
|
+
lists?: any;
|
|
38
|
+
/**
|
|
39
|
+
* - The path of nodes leading to the current node.
|
|
40
|
+
*/
|
|
41
|
+
path?: any[];
|
|
42
|
+
/**
|
|
43
|
+
* - The extra params.
|
|
44
|
+
*/
|
|
45
|
+
extraParams?: Record<string, any>;
|
|
46
|
+
};
|
|
47
|
+
export type XmlNode = any;
|
|
48
|
+
export type PmNodeJson = {
|
|
49
|
+
type: string;
|
|
50
|
+
content: any;
|
|
51
|
+
attrs: {};
|
|
52
|
+
sdNodeOrKeyName: string;
|
|
53
|
+
};
|
|
54
|
+
export type PmMarkJson = {
|
|
55
|
+
type: string;
|
|
56
|
+
attrs: {};
|
|
57
|
+
};
|
|
58
|
+
export type ParsedDocx = any;
|
|
59
|
+
export type NodeListHandler = {
|
|
60
|
+
handler: NodeListHandlerFn;
|
|
61
|
+
handlerEntities: NodeHandlerEntry[];
|
|
62
|
+
};
|
|
63
|
+
export type NodeListHandlerFn = (params: NodeHandlerParams) => PmNodeJson[];
|
|
64
|
+
export type NodeHandler = (params: NodeHandlerParams) => {
|
|
65
|
+
nodes: PmNodeJson[];
|
|
66
|
+
consumed: number;
|
|
67
|
+
};
|
|
68
|
+
export type NodeHandlerEntry = {
|
|
69
|
+
handlerName: string;
|
|
70
|
+
handler: NodeHandler;
|
|
71
|
+
};
|
|
72
|
+
export type SuperConverter = any;
|
|
73
|
+
export type Editor = any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} RegisteredHandlers
|
|
3
|
+
*/
|
|
4
|
+
export const registeredHandlers: Readonly<{
|
|
5
|
+
'w:br': import("../node-translator/node-translator.js").NodeTranslator;
|
|
6
|
+
'w:tab': import("../node-translator/node-translator.js").NodeTranslator;
|
|
7
|
+
'w:p': import("../node-translator/node-translator.js").NodeTranslator;
|
|
8
|
+
}>;
|
|
9
|
+
export type RegisteredHandlers = any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @type {import('@translator').NodeTranslatorConfig} */
|
|
2
|
+
export const config: import("@translator").NodeTranslatorConfig;
|
|
3
|
+
/**
|
|
4
|
+
* The NodeTranslator instance for the passthrough element.
|
|
5
|
+
* @type {import('@translator').NodeTranslator}
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./br-translator.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./w-p-helpers.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function handleParagraphNode(params: import("@translator").SCEncoderConfig): any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function parseParagraphBorders(pBdr: any): {};
|
|
2
|
+
export function getParagraphIndent(node: any, docx: any, styleId?: string): any;
|
|
3
|
+
export function getParagraphSpacing(node: any, docx: any, styleId?: string, marks?: any[]): any;
|
|
4
|
+
export function getDefaultParagraphStyle(docx: any, styleId?: string): any;
|
|
5
|
+
export function preProcessNodesForFldChar(nodes?: any[]): any[];
|
|
6
|
+
export function processCombinedNodesForFldChar(nodesToCombine?: any[]): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./p-translator.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @type {import('@translator').NodeTranslatorConfig} */
|
|
2
|
+
export const config: import("@translator").NodeTranslatorConfig;
|
|
3
|
+
/**
|
|
4
|
+
* The NodeTranslator instance for the <w:p> element.
|
|
5
|
+
* @type {import('@translator').NodeTranslator}
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tab-translator.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @type {import('@translator').NodeTranslatorConfig} */
|
|
2
|
+
export const config: import("@translator").NodeTranslatorConfig;
|
|
3
|
+
/**
|
|
4
|
+
* The NodeTranslator instance for the <w:tab> element.
|
|
5
|
+
* @type {import('@translator').NodeTranslator}
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Object} options
|
|
3
|
+
* @returns {{type: string, content: (*|*[]), attrs: {}}}
|
|
4
|
+
*/
|
|
5
|
+
export function handleTableCellNode({ params, node, table, row, rowBorders, styleTag, columnIndex, columnWidth, }: any): {
|
|
6
|
+
type: string;
|
|
7
|
+
content: (any | any[]);
|
|
8
|
+
attrs: {};
|
|
9
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main translation function for a table cell.
|
|
3
|
+
* @param {import('@converter/exporter').ExportParams} params
|
|
4
|
+
* @returns {import('@converter/exporter').XmlReadyNode}
|
|
5
|
+
*/
|
|
6
|
+
export function translateTableCell(params: import("@converter/exporter").ExportParams): import("@converter/exporter").XmlReadyNode;
|
|
7
|
+
/**
|
|
8
|
+
* Generate w:tcPr properties node for a table cell
|
|
9
|
+
* @param {import('@converter/exporter').SchemaNode} node
|
|
10
|
+
* @returns {import('@converter/exporter').XmlReadyNode}
|
|
11
|
+
*/
|
|
12
|
+
export function generateTableCellProperties(node: import("@converter/exporter").SchemaNode): import("@converter/exporter").XmlReadyNode;
|
|
13
|
+
/**
|
|
14
|
+
* @param {Object} cellMargins
|
|
15
|
+
* @returns {Array}
|
|
16
|
+
*/
|
|
17
|
+
export function generateCellMargins(cellMargins: any): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tc-translator";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./node-translator.js";
|