@harbour-enterprises/superdoc 0.18.0-next.5 → 0.18.0-next.7
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-DDwiCSwf.cjs → PdfViewer-D8DhK7x_.cjs} +1 -1
- package/dist/chunks/{PdfViewer-Md3OYLQ6.es.js → PdfViewer-Db-y1BOK.es.js} +1 -1
- package/dist/chunks/{index-B8Gqq2Ls.cjs → index-B2vhAyq8.cjs} +3 -3
- package/dist/chunks/{index-nnK3k8Eg.es.js → index-gPQ_psn7.es.js} +3 -3
- package/dist/chunks/{super-editor.es-C2jrGo_q.es.js → super-editor.es-BxGYOWJs.es.js} +3537 -3236
- package/dist/chunks/{super-editor.es-DPPXteBi.cjs → super-editor.es-DQ7fZbC0.cjs} +3537 -3236
- 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-YnaMMkRN.js → converter-Cd1Nn-Yo.js} +3872 -3597
- package/dist/super-editor/chunks/{docx-zipper-Bq9-qqP_.js → docx-zipper-Bb5bKoz2.js} +1 -1
- package/dist/super-editor/chunks/{editor-CAEseNKq.js → editor-BeAxGXb9.js} +32 -5
- package/dist/super-editor/chunks/{toolbar-BxxxSTHJ.js → toolbar-C_zg3l4P.js} +2 -2
- package/dist/super-editor/converter.es.js +2 -1
- 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/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 +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/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/paragraph/paragraph.d.ts +2 -2
- package/dist/super-editor/src/tests/export/export-helpers/export-helpers.d.ts +1 -0
- package/dist/super-editor/super-editor.es.js +10 -9
- 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 +3511 -3210
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-
|
|
1
|
+
import { H as process$1, av as commonjsGlobal, I as Buffer, aw as getDefaultExportFromCjs, ax as getContentTypesFromXml, ay as xmljs } from "./converter-Cd1Nn-Yo.js";
|
|
2
2
|
function commonjsRequire(path) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -12,9 +12,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
12
12
|
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, insertNewFileData_fn, registerPluginByNameIfNotExists_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, initPagination_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _DocumentSectionView_instances, init_fn3, addToolTip_fn;
|
|
13
13
|
import * as Y from "yjs";
|
|
14
14
|
import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
|
|
15
|
-
import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, o as Slice, F as Fragment, R as ReplaceAroundStep$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as findParentNodeClosestToPos, ai as getListItemStyleDefinitions, aj as docxNumberigHelpers, ak as parseIndentElement, al as combineIndents, am as StepMap, an as getColStyleDeclaration, ao as SelectionRange, ap as Transform, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, N as NodeSelection, i as canSplit, j as defaultBlockAt$1, l as liftTarget, A as AllSelection, k as canJoin, m as joinPoint, n as Selection, r as replaceStep$1, o as Slice, F as Fragment, R as ReplaceAroundStep$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, L as ListHelpers, y as findParentNode, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as helpers, a2 as posToDOMRect, a3 as CommandService, a4 as SuperConverter, a5 as createDocument, a6 as createDocFromMarkdown, a7 as createDocFromHTML, a8 as EditorState, a9 as hasSomeParentWithClass, aa as isActive, ab as unflattenListsInHtml, ac as parseSizeUnit, ad as minMax, ae as getLineHeightValueString, af as InputRule, ag as kebabCase, ah as findParentNodeClosestToPos, ai as getListItemStyleDefinitions, aj as docxNumberigHelpers, ak as parseIndentElement, al as combineIndents, am as StepMap, an as getColStyleDeclaration, ao as SelectionRange, ap as Transform, aq as isInTable$1, ar as createColGroup, as as generateDocxRandomId, at as insertNewRelationship, au as htmlHandler } from "./converter-Cd1Nn-Yo.js";
|
|
16
16
|
import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
|
|
17
|
-
import { D as DocxZipper } from "./docx-zipper-
|
|
17
|
+
import { D as DocxZipper } from "./docx-zipper-Bb5bKoz2.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -1091,6 +1091,26 @@ createMarksSchema_fn = function(markExtensions, attributes, editor) {
|
|
|
1091
1091
|
};
|
|
1092
1092
|
__privateAdd(_Schema, _Schema_static);
|
|
1093
1093
|
let Schema = _Schema;
|
|
1094
|
+
class OxmlNode extends Node$1 {
|
|
1095
|
+
/**
|
|
1096
|
+
* @param {import('./types/index.js').OxmlNodeConfig} config
|
|
1097
|
+
*/
|
|
1098
|
+
constructor(config) {
|
|
1099
|
+
super(config);
|
|
1100
|
+
/** @type {string} */
|
|
1101
|
+
__publicField(this, "oXmlName");
|
|
1102
|
+
this.oXmlName = config.oXmlName;
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Factory method to construct a new OxmlNode instance.
|
|
1106
|
+
*
|
|
1107
|
+
* @param {import('./types/index.js').OxmlNodeConfig} config
|
|
1108
|
+
* @returns {OxmlNode} A new OxmlNode instance.
|
|
1109
|
+
*/
|
|
1110
|
+
static create(config) {
|
|
1111
|
+
return new OxmlNode(config);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1094
1114
|
const first = (commands2) => (props) => {
|
|
1095
1115
|
const items = typeof commands2 === "function" ? commands2(props) : commands2;
|
|
1096
1116
|
for (let i = 0; i < items.length; i += 1) {
|
|
@@ -14353,7 +14373,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14353
14373
|
* @returns {Object | void} Migration results
|
|
14354
14374
|
*/
|
|
14355
14375
|
processCollaborationMigrations() {
|
|
14356
|
-
console.debug("[checkVersionMigrations] Current editor version", "0.17.
|
|
14376
|
+
console.debug("[checkVersionMigrations] Current editor version", "0.17.1");
|
|
14357
14377
|
if (!this.options.ydoc) return;
|
|
14358
14378
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
14359
14379
|
let docVersion = metaMap.get("version");
|
|
@@ -18118,8 +18138,9 @@ const getDefaultSpacing = () => ({
|
|
|
18118
18138
|
line: 0,
|
|
18119
18139
|
lineRule: null
|
|
18120
18140
|
});
|
|
18121
|
-
const Paragraph =
|
|
18141
|
+
const Paragraph = OxmlNode.create({
|
|
18122
18142
|
name: "paragraph",
|
|
18143
|
+
oXmlName: "w:p",
|
|
18123
18144
|
priority: 1e3,
|
|
18124
18145
|
group: "block",
|
|
18125
18146
|
content: "inline*",
|
|
@@ -18138,6 +18159,13 @@ const Paragraph = Node$1.create({
|
|
|
18138
18159
|
},
|
|
18139
18160
|
addAttributes() {
|
|
18140
18161
|
return {
|
|
18162
|
+
paraId: { rendered: false },
|
|
18163
|
+
textId: { rendered: false },
|
|
18164
|
+
rsidR: { rendered: false },
|
|
18165
|
+
rsidRDefault: { rendered: false },
|
|
18166
|
+
rsidP: { rendered: false },
|
|
18167
|
+
rsidRPr: { rendered: false },
|
|
18168
|
+
rsidDel: { rendered: false },
|
|
18141
18169
|
spacing: {
|
|
18142
18170
|
default: getDefaultSpacing(),
|
|
18143
18171
|
renderDOM: (attrs) => {
|
|
@@ -18236,7 +18264,6 @@ const Paragraph = Node$1.create({
|
|
|
18236
18264
|
rendered: false
|
|
18237
18265
|
},
|
|
18238
18266
|
filename: { rendered: false },
|
|
18239
|
-
rsidRDefault: { rendered: false },
|
|
18240
18267
|
keepLines: { rendered: false },
|
|
18241
18268
|
keepNext: { rendered: false },
|
|
18242
18269
|
paragraphProperties: { rendered: false },
|
|
@@ -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 { H as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { H as process$1 } from "./converter-Cd1Nn-Yo.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BeAxGXb9.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-BeAxGXb9.js";
|
|
2
|
+
import "./chunks/converter-Cd1Nn-Yo.js";
|
|
3
|
+
import "./chunks/docx-zipper-Bb5bKoz2.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
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
|
|
@@ -14,7 +14,7 @@ export function createDocumentJson(docx: ParsedDocx, converter: SuperConverter,
|
|
|
14
14
|
pageStyles: any;
|
|
15
15
|
} | null;
|
|
16
16
|
export function defaultNodeListHandler(): {
|
|
17
|
-
handler: ({ nodes: elements, docx, insideTrackChange, converter, editor, filename, parentStyleId, lists, }: {
|
|
17
|
+
handler: ({ nodes: elements, docx, insideTrackChange, converter, editor, filename, parentStyleId, lists, path, }: {
|
|
18
18
|
nodes: any;
|
|
19
19
|
docx: any;
|
|
20
20
|
insideTrackChange: any;
|
|
@@ -23,6 +23,7 @@ export function defaultNodeListHandler(): {
|
|
|
23
23
|
filename: any;
|
|
24
24
|
parentStyleId: any;
|
|
25
25
|
lists: any;
|
|
26
|
+
path?: any[];
|
|
26
27
|
}) => any[];
|
|
27
28
|
handlerEntities: any[];
|
|
28
29
|
};
|
|
@@ -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
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const Paragraph:
|
|
2
|
-
import {
|
|
1
|
+
export const Paragraph: OxmlNode;
|
|
2
|
+
import { OxmlNode } from '@core/index.js';
|