@harbour-enterprises/superdoc 0.18.0-next.1 → 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-CNZTqGHw.cjs → PdfViewer-DKOAmiXw.cjs} +1 -1
- package/dist/chunks/{PdfViewer-D5cujgSt.es.js → PdfViewer-OIo9wAyq.es.js} +1 -1
- package/dist/chunks/{index-BDwD6Uex.es.js → index-DEONStGL.es.js} +3 -3
- package/dist/chunks/{index-BDysJRQU.cjs → index-cCWdcGrV.cjs} +3 -3
- package/dist/chunks/{super-editor.es-BoCmoEkp.es.js → super-editor.es-Cx5l8JEt.es.js} +4016 -3258
- package/dist/chunks/{super-editor.es-aOm7eWFU.cjs → super-editor.es-DyAWPYYh.cjs} +4016 -3258
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DvdFP4MZ.js → converter-5WOzOHZb.js} +4093 -3717
- package/dist/super-editor/chunks/{docx-zipper-CxFpxZUz.js → docx-zipper-CP-vEy49.js} +1 -1
- package/dist/super-editor/chunks/{editor-CeWNMKjc.js → editor-CCOqTxyv.js} +425 -41
- package/dist/super-editor/chunks/{toolbar-Di2oAvyr.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 +2 -2
- package/dist/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +17 -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/paragraphNodeImporter.d.ts +3 -63
- 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 +4 -6
- package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/index.d.ts +2 -2
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-clear.d.ts +4 -2
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/br/attributes/w-line-break-type.d.ts +4 -2
- 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 -3
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-leader.d.ts +4 -2
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-pos.d.ts +4 -2
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-size.d.ts +4 -2
- 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/node-translator.d.ts +31 -31
- package/dist/super-editor/src/extensions/block-node/block-node.d.ts +27 -3
- 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/tests/export/export-helpers/export-helpers.d.ts +1 -0
- package/dist/super-editor/super-editor.es.js +21 -20
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +2603 -1845
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
@@ -128,7 +128,7 @@ export type XmlReadyNode = {
|
|
|
128
128
|
/**
|
|
129
129
|
* The node attributes
|
|
130
130
|
*/
|
|
131
|
-
attributes
|
|
131
|
+
attributes?: any;
|
|
132
132
|
};
|
|
133
133
|
/**
|
|
134
134
|
* Key value pairs representing the node attributes from prose mirror
|
|
@@ -8,13 +8,28 @@
|
|
|
8
8
|
* @returns {Object | null} The updated styles object with default styles
|
|
9
9
|
*/
|
|
10
10
|
export function addDefaultStylesIfMissing(styles: any): any | null;
|
|
11
|
+
/**
|
|
12
|
+
* Remove any nodes that belong to the inline group when they appear at the root.
|
|
13
|
+
* ProseMirror's doc node only accepts block-level content; inline nodes here cause
|
|
14
|
+
* Invalid content for node doc errors. This is a conservative filter that only
|
|
15
|
+
* drops clearly inline node types if they somehow escape their paragraph.
|
|
16
|
+
*
|
|
17
|
+
* @param {Array<{type: string, content?: any, attrs?: any, marks?: any[]}>} content
|
|
18
|
+
* @returns {Array}
|
|
19
|
+
*/
|
|
20
|
+
export function filterOutRootInlineNodes(content?: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
content?: any;
|
|
23
|
+
attrs?: any;
|
|
24
|
+
marks?: any[];
|
|
25
|
+
}>): any[];
|
|
11
26
|
export function createDocumentJson(docx: ParsedDocx, converter: SuperConverter, editor: Editor): {
|
|
12
27
|
pmDoc: PmNodeJson;
|
|
13
28
|
savedTagsToRestore: XmlNode;
|
|
14
29
|
pageStyles: any;
|
|
15
30
|
} | null;
|
|
16
31
|
export function defaultNodeListHandler(): {
|
|
17
|
-
handler: ({ nodes: elements, docx, insideTrackChange, converter, editor, filename, parentStyleId, lists, }: {
|
|
32
|
+
handler: ({ nodes: elements, docx, insideTrackChange, converter, editor, filename, parentStyleId, lists, path, }: {
|
|
18
33
|
nodes: any;
|
|
19
34
|
docx: any;
|
|
20
35
|
insideTrackChange: any;
|
|
@@ -23,6 +38,7 @@ export function defaultNodeListHandler(): {
|
|
|
23
38
|
filename: any;
|
|
24
39
|
parentStyleId: any;
|
|
25
40
|
lists: any;
|
|
41
|
+
path?: any[];
|
|
26
42
|
}) => any[];
|
|
27
43
|
handlerEntities: any[];
|
|
28
44
|
};
|
|
@@ -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;
|
|
@@ -36,15 +36,13 @@ export type NodeHandlerParams = {
|
|
|
36
36
|
*/
|
|
37
37
|
lists?: any;
|
|
38
38
|
/**
|
|
39
|
-
* - The
|
|
39
|
+
* - The path of nodes leading to the current node.
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
export type NodeHandlerContext = {
|
|
41
|
+
path?: any[];
|
|
44
42
|
/**
|
|
45
|
-
* - The
|
|
43
|
+
* - The extra params.
|
|
46
44
|
*/
|
|
47
|
-
|
|
45
|
+
extraParams?: Record<string, any>;
|
|
48
46
|
};
|
|
49
47
|
export type XmlNode = any;
|
|
50
48
|
export type PmNodeJson = {
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
export const registeredHandlers: Readonly<{
|
|
5
5
|
'w:br': import("../node-translator/node-translator.js").NodeTranslator;
|
|
6
6
|
'w:tab': import("../node-translator/node-translator.js").NodeTranslator;
|
|
7
|
+
'w:p': import("../node-translator/node-translator.js").NodeTranslator;
|
|
7
8
|
}>;
|
|
8
9
|
export type RegisteredHandlers = any;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
declare const _default: import("@translator").AttrConfig[];
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function
|
|
1
|
+
export function encode(attributes: any): string | undefined;
|
|
2
|
+
export function decode(attrs: any): string | undefined;
|
|
3
|
+
/** @type {import('@translator').AttrConfig} */
|
|
4
|
+
export const attrConfig: import("@translator").AttrConfig;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function
|
|
1
|
+
export function encode(attributes: any): string | undefined;
|
|
2
|
+
export function decode(attrs: any): string | undefined;
|
|
3
|
+
/** @type {import('@translator').AttrConfig} */
|
|
4
|
+
export const attrConfig: import("@translator").AttrConfig;
|
|
@@ -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;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export * from "./w-tab-pos.js";
|
|
1
|
+
declare const _default: import("@translator").AttrConfig[];
|
|
2
|
+
export default _default;
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-leader.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function
|
|
1
|
+
export function encode(attributes: any): string | undefined;
|
|
2
|
+
export function decode(attrs: any): string | undefined;
|
|
3
|
+
/** @type {import('@translator').AttrConfig} */
|
|
4
|
+
export const attrConfig: import("@translator").AttrConfig;
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-pos.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function
|
|
1
|
+
export function encode(attributes: any): string | undefined;
|
|
2
|
+
export function decode(attrs: any): string | undefined;
|
|
3
|
+
/** @type {import('@translator').AttrConfig} */
|
|
4
|
+
export const attrConfig: import("@translator").AttrConfig;
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/tab/attributes/w-tab-size.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export function
|
|
2
|
-
export function
|
|
1
|
+
export function encode(attributes: any): string | undefined;
|
|
2
|
+
export function decode(attrs: any): string | undefined;
|
|
3
|
+
/** @type {import('@translator').AttrConfig} */
|
|
4
|
+
export const attrConfig: import("@translator").AttrConfig;
|
|
@@ -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";
|
|
@@ -12,6 +12,13 @@ export const TranslatorTypes: Readonly<{
|
|
|
12
12
|
* @typedef {string} XmlNodeName
|
|
13
13
|
* @typedef {string} SuperDocNodeOrKeyName
|
|
14
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
|
+
*/
|
|
15
22
|
/** @typedef {import('../../v2/importer/types').NodeHandlerParams} SCEncoderConfig */
|
|
16
23
|
/** @typedef {import('../../v2/types').SuperDocNode} SCEncoderResult */
|
|
17
24
|
/** @typedef {{ node: { attrs?: any, marks?: any[], type: string }, children?: any[] }} SCDecoderConfig */
|
|
@@ -30,13 +37,6 @@ export const TranslatorTypes: Readonly<{
|
|
|
30
37
|
*/
|
|
31
38
|
/** @callback MatchesEncodeFn @param {any[]} nodes @param {any} [ctx] @returns {boolean} */
|
|
32
39
|
/** @callback MatchesDecodeFn @param {any} node @param {any} [ctx] @returns {boolean} */
|
|
33
|
-
/**
|
|
34
|
-
* @typedef {Object} AttributesHandlerList
|
|
35
|
-
* @property {string} xmlName - The name of the attribute in OOXML
|
|
36
|
-
* @property {string} sdName - The name of the attribute in SuperDoc
|
|
37
|
-
* @property {Function} [encode] - Function to encode the attribute from OOXML to SuperDoc
|
|
38
|
-
* @property {Function} [decode] - Function to decode the attribute from SuperDoc to OOXML
|
|
39
|
-
*/
|
|
40
40
|
/**
|
|
41
41
|
* @typedef {Object} EncodedAttributes
|
|
42
42
|
*/
|
|
@@ -51,7 +51,7 @@ export const TranslatorTypes: Readonly<{
|
|
|
51
51
|
* @property {NodeTranslatorEncodeFn} encode - The function to encode the data.
|
|
52
52
|
* @property {NodeTranslatorDecodeFn} [decode] - The function to decode the data.
|
|
53
53
|
* @property {number} [priority] - The priority of the handler.
|
|
54
|
-
* @property {
|
|
54
|
+
* @property {AttrConfig[]} [attributes] - Attribute handlers list.
|
|
55
55
|
* @property {MatchesEncodeFn} [matchesEncode] - The function to check if the handler can encode the data.
|
|
56
56
|
* @property {MatchesDecodeFn} [matchesDecode] - The function to check if the handler can decode the data.
|
|
57
57
|
*/
|
|
@@ -72,9 +72,9 @@ export class NodeTranslator {
|
|
|
72
72
|
* @param {number} [priority]
|
|
73
73
|
* @param {MatchesEncodeFn} [matchesEncode]
|
|
74
74
|
* @param {MatchesDecodeFn} [matchesDecode]
|
|
75
|
-
* @param {
|
|
75
|
+
* @param {AttrConfig[]} [attributes]
|
|
76
76
|
*/
|
|
77
|
-
constructor(xmlName: string, sdNodeOrKeyName: string, encode: NodeTranslatorEncodeFn, decode: NodeTranslatorDecodeFn, priority?: number, matchesEncode?: MatchesEncodeFn, matchesDecode?: MatchesDecodeFn, attributes?:
|
|
77
|
+
constructor(xmlName: string, sdNodeOrKeyName: string, encode: NodeTranslatorEncodeFn, decode: NodeTranslatorDecodeFn, priority?: number, matchesEncode?: MatchesEncodeFn, matchesDecode?: MatchesDecodeFn, attributes?: AttrConfig[]);
|
|
78
78
|
/** @type {string} */
|
|
79
79
|
xmlName: string;
|
|
80
80
|
/** @type {string} */
|
|
@@ -89,8 +89,8 @@ export class NodeTranslator {
|
|
|
89
89
|
matchesEncode: MatchesEncodeFn;
|
|
90
90
|
/** @type {MatchesDecodeFn} */
|
|
91
91
|
matchesDecode: MatchesDecodeFn;
|
|
92
|
-
/** @type {
|
|
93
|
-
attributes:
|
|
92
|
+
/** @type {AttrConfig[]} */
|
|
93
|
+
attributes: AttrConfig[];
|
|
94
94
|
/**
|
|
95
95
|
* Encode the attributes for the node.
|
|
96
96
|
* @param {SCEncoderConfig} params
|
|
@@ -125,6 +125,24 @@ export type TranslatorTypeKey = keyof typeof TranslatorTypes;
|
|
|
125
125
|
export type TranslatorType = (typeof TranslatorTypes)[TranslatorTypeKey];
|
|
126
126
|
export type XmlNodeName = string;
|
|
127
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
|
+
};
|
|
128
146
|
export type SCEncoderConfig = import("../../v2/importer/types").NodeHandlerParams;
|
|
129
147
|
export type SCEncoderResult = import("../../v2/types").SuperDocNode;
|
|
130
148
|
export type SCDecoderConfig = {
|
|
@@ -143,24 +161,6 @@ export type NodeTranslatorEncodeFn = (params: SCEncoderConfig, encodedAttrs?: En
|
|
|
143
161
|
export type NodeTranslatorDecodeFn = (params: SCDecoderConfig, decodedAttrs?: DecodedAttributes) => import("../../v2/types").OpenXmlNode;
|
|
144
162
|
export type MatchesEncodeFn = (nodes: any[], ctx?: any) => boolean;
|
|
145
163
|
export type MatchesDecodeFn = (node: any, ctx?: any) => boolean;
|
|
146
|
-
export type AttributesHandlerList = {
|
|
147
|
-
/**
|
|
148
|
-
* - The name of the attribute in OOXML
|
|
149
|
-
*/
|
|
150
|
-
xmlName: string;
|
|
151
|
-
/**
|
|
152
|
-
* - The name of the attribute in SuperDoc
|
|
153
|
-
*/
|
|
154
|
-
sdName: string;
|
|
155
|
-
/**
|
|
156
|
-
* - Function to encode the attribute from OOXML to SuperDoc
|
|
157
|
-
*/
|
|
158
|
-
encode?: Function;
|
|
159
|
-
/**
|
|
160
|
-
* - Function to decode the attribute from SuperDoc to OOXML
|
|
161
|
-
*/
|
|
162
|
-
decode?: Function;
|
|
163
|
-
};
|
|
164
164
|
export type EncodedAttributes = any;
|
|
165
165
|
export type DecodedAttributes = any;
|
|
166
166
|
export type NodeTranslatorConfig = {
|
|
@@ -191,7 +191,7 @@ export type NodeTranslatorConfig = {
|
|
|
191
191
|
/**
|
|
192
192
|
* - Attribute handlers list.
|
|
193
193
|
*/
|
|
194
|
-
attributes?:
|
|
194
|
+
attributes?: AttrConfig[];
|
|
195
195
|
/**
|
|
196
196
|
* - The function to check if the handler can encode the data.
|
|
197
197
|
*/
|