@harbour-enterprises/superdoc 0.19.0-next.4 → 0.19.0-next.6
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-DmC4Qg1S.cjs → PdfViewer-BlV8_l4e.cjs} +1 -1
- package/dist/chunks/{PdfViewer-Df9H8xeA.es.js → PdfViewer-oqYWe1FJ.es.js} +1 -1
- package/dist/chunks/{index-C_oHQN7n.es.js → index-CeockUQz.es.js} +35 -3
- package/dist/chunks/{index-CWQGBk3Z.cjs → index-DHyh73q4.cjs} +35 -3
- package/dist/chunks/{super-editor.es-C2QwEj1z.es.js → super-editor.es-BRBU19lM.es.js} +614 -295
- package/dist/chunks/{super-editor.es-B_u6OGsf.cjs → super-editor.es-bu-RKSWh.cjs} +614 -295
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/stores/superdoc-store.d.ts +3 -0
- package/dist/stores/superdoc-store.d.ts.map +1 -1
- package/dist/style.css +6 -6
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CMajoq-M.js → converter-BFq1XXek.js} +472 -208
- package/dist/super-editor/chunks/{docx-zipper-C5rg6GNf.js → docx-zipper-BahUy6FS.js} +1 -1
- package/dist/super-editor/chunks/{editor-CH3sE8Fq.js → editor-BdLd21gy.js} +135 -85
- package/dist/super-editor/chunks/{toolbar-BHnLBr61.js → toolbar-DoJY1zlM.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -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/exporter.d.ts +0 -7
- package/dist/super-editor/src/core/super-converter/v2/importer/tableImporter.d.ts +0 -22
- package/dist/super-editor/src/core/super-converter/v3/handlers/utils.d.ts +37 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/cantSplit-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/cnfStyle-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/divId/divId-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/divId/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/gridAfter-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridBefore/gridBefore-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridBefore/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/hidden-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/jc/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/jc/jc-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellSpacing/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellSpacing/tblCellSpacing-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/tblHeader-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tr/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/tr/tr-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/trHeight-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/trPr/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/trPr/trPr-translator.d.ts +5 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/wAfter-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/wBefore-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +2 -1
- package/dist/super-editor/src/extensions/table-row/table-row.d.ts +149 -0
- package/dist/super-editor/style.css +6 -6
- package/dist/super-editor/super-editor.es.js +13 -8
- 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 +647 -296
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-
|
|
1
|
+
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-BFq1XXek.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, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as InputRule, ah as kebabCase, ai as findParentNodeClosestToPos, aj as getListItemStyleDefinitions, ak as docxNumberigHelpers, al as parseIndentElement, am as combineIndents, an as StepMap, ao as getColStyleDeclaration, ap as SelectionRange, aq as Transform, ar as isInTable$1, as as createColGroup, at as generateDocxRandomId, au as insertNewRelationship, av as htmlHandler } from "./converter-
|
|
15
|
+
import { P as PluginKey, a as Plugin, M as Mapping, N as NodeSelection, S as Selection, T as TextSelection, b as Slice, D as DOMSerializer, F as Fragment, c as DOMParser$1, d as Mark$1, e as dropPoint, A as AllSelection, p as process$1, B as Buffer2, f as callOrGet, g as getExtensionConfigField, h as getMarkType, i as getMarksFromSelection, j as getNodeType, k as getSchemaTypeNameByName, l as Schema$1, m as cleanSchemaItem, n as canSplit, o as defaultBlockAt$1, q as liftTarget, r as canJoin, s as joinPoint, t as replaceStep$1, R as ReplaceAroundStep$1, u as isTextSelection, v as getMarkRange, w as isMarkActive, x as isNodeActive, y as deleteProps, z as processContent, C as ReplaceStep, E as NodeRange, G as findWrapping, L as ListHelpers, H as findParentNode, I as isMacOS, J as isIOS, K as getSchemaTypeByName, O as inputRulesPlugin, Q as TrackDeleteMarkName, U as TrackInsertMarkName, V as v4, W as TrackFormatMarkName, X as comments_module_events, Y as findMark, Z as objectIncludes, _ as AddMarkStep, $ as RemoveMarkStep, a0 as twipsToLines, a1 as pixelsToTwips, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as createDocFromMarkdown, a8 as createDocFromHTML, a9 as EditorState, aa as hasSomeParentWithClass, ab as isActive, ac as unflattenListsInHtml, ad as parseSizeUnit, ae as minMax, af as getLineHeightValueString, ag as InputRule, ah as kebabCase, ai as findParentNodeClosestToPos, aj as getListItemStyleDefinitions, ak as docxNumberigHelpers, al as parseIndentElement, am as combineIndents, an as StepMap, ao as getColStyleDeclaration, ap as SelectionRange, aq as Transform, ar as isInTable$1, as as createColGroup, at as generateDocxRandomId, au as insertNewRelationship, av as htmlHandler } from "./converter-BFq1XXek.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-BahUy6FS.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -13509,7 +13509,7 @@ function validateRelationshipsRoot(relsTree, relsKey, results) {
|
|
|
13509
13509
|
}
|
|
13510
13510
|
return { root, wasFixed };
|
|
13511
13511
|
}
|
|
13512
|
-
function cleanupRootChildren(root
|
|
13512
|
+
function cleanupRootChildren(root) {
|
|
13513
13513
|
const validChildren = root.elements?.filter((child) => child?.type === "element" && child.name === "Relationship") || [];
|
|
13514
13514
|
if (root.elements?.length !== validChildren.length) {
|
|
13515
13515
|
root.elements = validChildren;
|
|
@@ -14549,85 +14549,89 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14549
14549
|
getUpdatedDocs = false,
|
|
14550
14550
|
fieldsHighlightColor = null
|
|
14551
14551
|
} = {}) {
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
|
|
14560
|
-
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
14564
|
-
__privateMethod(this, _Editor_instances, validateDocumentExport_fn).call(this);
|
|
14565
|
-
if (exportXmlOnly || exportJsonOnly) return documentXml;
|
|
14566
|
-
const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
|
|
14567
|
-
const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
|
|
14568
|
-
const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
|
|
14569
|
-
const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
|
|
14570
|
-
const media = this.converter.addedMedia;
|
|
14571
|
-
const updatedHeadersFooters = {};
|
|
14572
|
-
Object.entries(this.converter.convertedXml).forEach(([name, json2]) => {
|
|
14573
|
-
if (name.includes("header") || name.includes("footer")) {
|
|
14574
|
-
const resultXml = this.converter.schemaToXml(json2.elements[0]);
|
|
14575
|
-
updatedHeadersFooters[name] = String(resultXml);
|
|
14576
|
-
}
|
|
14577
|
-
});
|
|
14578
|
-
const numberingData = this.converter.convertedXml["word/numbering.xml"];
|
|
14579
|
-
const numbering = this.converter.schemaToXml(numberingData.elements[0]);
|
|
14580
|
-
const updatedDocs = {
|
|
14581
|
-
...this.options.customUpdatedFiles,
|
|
14582
|
-
"word/document.xml": String(documentXml),
|
|
14583
|
-
"docProps/custom.xml": String(customXml),
|
|
14584
|
-
"word/settings.xml": String(customSettings),
|
|
14585
|
-
"word/_rels/document.xml.rels": String(rels),
|
|
14586
|
-
"word/numbering.xml": String(numbering),
|
|
14587
|
-
// Replace & with & in styles.xml as DOCX viewers can't handle it
|
|
14588
|
-
"word/styles.xml": String(styles).replace(/&/gi, "&"),
|
|
14589
|
-
...updatedHeadersFooters
|
|
14590
|
-
};
|
|
14591
|
-
if (comments.length) {
|
|
14592
|
-
const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
|
|
14593
|
-
const commentsExtendedXml = this.converter.schemaToXml(
|
|
14594
|
-
this.converter.convertedXml["word/commentsExtended.xml"].elements[0]
|
|
14595
|
-
);
|
|
14596
|
-
const commentsExtensibleXml = this.converter.schemaToXml(
|
|
14597
|
-
this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]
|
|
14598
|
-
);
|
|
14599
|
-
const commentsIdsXml = this.converter.schemaToXml(
|
|
14600
|
-
this.converter.convertedXml["word/commentsIds.xml"].elements[0]
|
|
14552
|
+
try {
|
|
14553
|
+
const json = __privateMethod(this, _Editor_instances, prepareDocumentForExport_fn).call(this, comments);
|
|
14554
|
+
const documentXml = await this.converter.exportToDocx(
|
|
14555
|
+
json,
|
|
14556
|
+
this.schema,
|
|
14557
|
+
this.storage.image.media,
|
|
14558
|
+
isFinalDoc,
|
|
14559
|
+
commentsType,
|
|
14560
|
+
comments,
|
|
14561
|
+
this,
|
|
14562
|
+
exportJsonOnly,
|
|
14563
|
+
fieldsHighlightColor
|
|
14601
14564
|
);
|
|
14602
|
-
|
|
14603
|
-
|
|
14604
|
-
|
|
14605
|
-
|
|
14606
|
-
|
|
14607
|
-
|
|
14608
|
-
|
|
14609
|
-
|
|
14610
|
-
|
|
14611
|
-
|
|
14612
|
-
|
|
14565
|
+
__privateMethod(this, _Editor_instances, validateDocumentExport_fn).call(this);
|
|
14566
|
+
if (exportXmlOnly || exportJsonOnly) return documentXml;
|
|
14567
|
+
const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
|
|
14568
|
+
const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
|
|
14569
|
+
const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
|
|
14570
|
+
const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
|
|
14571
|
+
const media = this.converter.addedMedia;
|
|
14572
|
+
const updatedHeadersFooters = {};
|
|
14573
|
+
Object.entries(this.converter.convertedXml).forEach(([name, json2]) => {
|
|
14574
|
+
if (name.includes("header") || name.includes("footer")) {
|
|
14575
|
+
const resultXml = this.converter.schemaToXml(json2.elements[0]);
|
|
14576
|
+
updatedHeadersFooters[name] = String(resultXml);
|
|
14577
|
+
}
|
|
14578
|
+
});
|
|
14579
|
+
const numberingData = this.converter.convertedXml["word/numbering.xml"];
|
|
14580
|
+
const numbering = this.converter.schemaToXml(numberingData.elements[0]);
|
|
14581
|
+
const updatedDocs = {
|
|
14582
|
+
...this.options.customUpdatedFiles,
|
|
14583
|
+
"word/document.xml": String(documentXml),
|
|
14584
|
+
"docProps/custom.xml": String(customXml),
|
|
14585
|
+
"word/settings.xml": String(customSettings),
|
|
14586
|
+
"word/_rels/document.xml.rels": String(rels),
|
|
14587
|
+
"word/numbering.xml": String(numbering),
|
|
14588
|
+
// Replace & with & in styles.xml as DOCX viewers can't handle it
|
|
14589
|
+
"word/styles.xml": String(styles).replace(/&/gi, "&"),
|
|
14590
|
+
...updatedHeadersFooters
|
|
14591
|
+
};
|
|
14592
|
+
if (comments.length) {
|
|
14593
|
+
const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
|
|
14594
|
+
const commentsExtendedXml = this.converter.schemaToXml(
|
|
14595
|
+
this.converter.convertedXml["word/commentsExtended.xml"].elements[0]
|
|
14596
|
+
);
|
|
14597
|
+
const commentsExtensibleXml = this.converter.schemaToXml(
|
|
14598
|
+
this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]
|
|
14599
|
+
);
|
|
14600
|
+
const commentsIdsXml = this.converter.schemaToXml(
|
|
14601
|
+
this.converter.convertedXml["word/commentsIds.xml"].elements[0]
|
|
14602
|
+
);
|
|
14603
|
+
updatedDocs["word/comments.xml"] = String(commentsXml);
|
|
14604
|
+
updatedDocs["word/commentsExtended.xml"] = String(commentsExtendedXml);
|
|
14605
|
+
updatedDocs["word/commentsExtensible.xml"] = String(commentsExtensibleXml);
|
|
14606
|
+
updatedDocs["word/commentsIds.xml"] = String(commentsIdsXml);
|
|
14607
|
+
}
|
|
14608
|
+
const zipper = new DocxZipper();
|
|
14609
|
+
if (getUpdatedDocs) {
|
|
14610
|
+
updatedDocs["[Content_Types].xml"] = await zipper.updateContentTypes(
|
|
14611
|
+
{
|
|
14612
|
+
files: this.options.content
|
|
14613
|
+
},
|
|
14614
|
+
media,
|
|
14615
|
+
true
|
|
14616
|
+
);
|
|
14617
|
+
return updatedDocs;
|
|
14618
|
+
}
|
|
14619
|
+
const result = await zipper.updateZip({
|
|
14620
|
+
docx: this.options.content,
|
|
14621
|
+
updatedDocs,
|
|
14622
|
+
originalDocxFile: this.options.fileSource,
|
|
14613
14623
|
media,
|
|
14614
|
-
|
|
14615
|
-
|
|
14616
|
-
|
|
14624
|
+
fonts: this.options.fonts,
|
|
14625
|
+
isHeadless: this.options.isHeadless
|
|
14626
|
+
});
|
|
14627
|
+
this.options.telemetry?.trackUsage("document_export", {
|
|
14628
|
+
documentType: "docx",
|
|
14629
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
14630
|
+
});
|
|
14631
|
+
return result;
|
|
14632
|
+
} catch (error) {
|
|
14633
|
+
this.emit("exception", { error, editor: this });
|
|
14617
14634
|
}
|
|
14618
|
-
const result = await zipper.updateZip({
|
|
14619
|
-
docx: this.options.content,
|
|
14620
|
-
updatedDocs,
|
|
14621
|
-
originalDocxFile: this.options.fileSource,
|
|
14622
|
-
media,
|
|
14623
|
-
fonts: this.options.fonts,
|
|
14624
|
-
isHeadless: this.options.isHeadless
|
|
14625
|
-
});
|
|
14626
|
-
this.options.telemetry?.trackUsage("document_export", {
|
|
14627
|
-
documentType: "docx",
|
|
14628
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
14629
|
-
});
|
|
14630
|
-
return result;
|
|
14631
14635
|
}
|
|
14632
14636
|
/**
|
|
14633
14637
|
* Destroy the editor and clean up resources
|
|
@@ -14648,7 +14652,8 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14648
14652
|
}
|
|
14649
14653
|
this.converter.headerEditors.length = 0;
|
|
14650
14654
|
this.converter.footerEditors.length = 0;
|
|
14651
|
-
} catch {
|
|
14655
|
+
} catch (error) {
|
|
14656
|
+
this.emit("exception", { error, editor: this });
|
|
14652
14657
|
}
|
|
14653
14658
|
}
|
|
14654
14659
|
/**
|
|
@@ -14713,7 +14718,7 @@ const _Editor = class _Editor extends EventEmitter {
|
|
|
14713
14718
|
this.initDefaultStyles();
|
|
14714
14719
|
if (this.options.ydoc && this.options.collaborationProvider) {
|
|
14715
14720
|
updateYdocDocxData(this);
|
|
14716
|
-
this.initializeCollaborationData(
|
|
14721
|
+
this.initializeCollaborationData();
|
|
14717
14722
|
} else {
|
|
14718
14723
|
__privateMethod(this, _Editor_instances, insertNewFileData_fn).call(this);
|
|
14719
14724
|
}
|
|
@@ -14882,7 +14887,6 @@ init_fn = function() {
|
|
|
14882
14887
|
this.on("beforeCreate", this.options.onBeforeCreate);
|
|
14883
14888
|
this.emit("beforeCreate", { editor: this });
|
|
14884
14889
|
this.on("contentError", this.options.onContentError);
|
|
14885
|
-
this.on("exception", this.options.onException);
|
|
14886
14890
|
this.mount(this.options.element);
|
|
14887
14891
|
this.on("create", this.options.onCreate);
|
|
14888
14892
|
this.on("update", this.options.onUpdate);
|
|
@@ -14900,6 +14904,7 @@ init_fn = function() {
|
|
|
14900
14904
|
this.on("paginationUpdate", this.options.onPaginationUpdate);
|
|
14901
14905
|
this.on("comment-positions", this.options.onCommentLocationsUpdate);
|
|
14902
14906
|
this.on("list-definitions-change", this.options.onListDefinitionsChange);
|
|
14907
|
+
this.on("exception", this.options.onException);
|
|
14903
14908
|
if (!this.options.isHeadless) {
|
|
14904
14909
|
this.initializeCollaborationData();
|
|
14905
14910
|
this.initDefaultStyles();
|
|
@@ -15326,7 +15331,8 @@ endCollaboration_fn = function() {
|
|
|
15326
15331
|
console.debug("🔗 [super-editor] Ending collaboration");
|
|
15327
15332
|
if (this.options.collaborationProvider) this.options.collaborationProvider.disconnect();
|
|
15328
15333
|
if (this.options.ydoc) this.options.ydoc.destroy();
|
|
15329
|
-
} catch {
|
|
15334
|
+
} catch (error) {
|
|
15335
|
+
this.emit("exception", { error, editor: this });
|
|
15330
15336
|
}
|
|
15331
15337
|
};
|
|
15332
15338
|
/**
|
|
@@ -22342,7 +22348,49 @@ const TableRow = Node$1.create({
|
|
|
22342
22348
|
if (!cantSplit) return {};
|
|
22343
22349
|
return { "data-cant-split": "true" };
|
|
22344
22350
|
}
|
|
22345
|
-
}
|
|
22351
|
+
},
|
|
22352
|
+
/**
|
|
22353
|
+
* @category Attribute
|
|
22354
|
+
* @param {TableRowProperties} [tableRowProperties] - Properties for the table row.
|
|
22355
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 377-482
|
|
22356
|
+
*/
|
|
22357
|
+
tableRowProperties: { rendered: false },
|
|
22358
|
+
/**
|
|
22359
|
+
* @category Attribute
|
|
22360
|
+
* @param {string} [rsidDel] - Unique identifier used to track the editing session when the row was deleted from the main document.
|
|
22361
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 472
|
|
22362
|
+
*/
|
|
22363
|
+
rsidDel: { rendered: false },
|
|
22364
|
+
/**
|
|
22365
|
+
* @category Attribute
|
|
22366
|
+
* @param {string} [rsidR] - Unique identifier used to track the editing session when the table row was added to the main document.
|
|
22367
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 472
|
|
22368
|
+
*/
|
|
22369
|
+
rsidR: { rendered: false },
|
|
22370
|
+
/**
|
|
22371
|
+
* @category Attribute
|
|
22372
|
+
* @param {string} [rsidRPr] - Unique identifier used to track the editing session when the glyph character representing the table row mark was last modified in the main document.
|
|
22373
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 473
|
|
22374
|
+
*/
|
|
22375
|
+
rsidRPr: { rendered: false },
|
|
22376
|
+
/**
|
|
22377
|
+
* @category Attribute
|
|
22378
|
+
* @param {string} [rsidTr] - Unique identifier used to track the editing session when the table row's properties were last modified in this document.
|
|
22379
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 473
|
|
22380
|
+
*/
|
|
22381
|
+
rsidTr: { rendered: false },
|
|
22382
|
+
/**
|
|
22383
|
+
* @category Attribute
|
|
22384
|
+
* @param {string} [paraId] - A randomly generated unique identifier for the table row.
|
|
22385
|
+
* @see {@link https://learn.microsoft.com/en-us/openspecs/office_standards/ms-docx/a0e7d2e2-2246-44c6-96e8-1cf009823615}
|
|
22386
|
+
*/
|
|
22387
|
+
paraId: { rendered: false },
|
|
22388
|
+
/**
|
|
22389
|
+
* @category Attribute
|
|
22390
|
+
* @param {string} [textId] - A randomly generated unique identifier for the text of the table row.
|
|
22391
|
+
* @see {@link https://learn.microsoft.com/en-us/openspecs/office_standards/ms-docx/b7eeddec-7c50-47fb-88b6-1feec3ed832c}
|
|
22392
|
+
*/
|
|
22393
|
+
textId: { rendered: false }
|
|
22346
22394
|
};
|
|
22347
22395
|
},
|
|
22348
22396
|
parseDOM() {
|
|
@@ -24581,6 +24629,7 @@ const startImageUpload = async ({ editor, view, file }) => {
|
|
|
24581
24629
|
file = processedImageResult.file;
|
|
24582
24630
|
} catch (err) {
|
|
24583
24631
|
console.warn("Error processing image:", err);
|
|
24632
|
+
editor.emit("exception", { error: err, editor });
|
|
24584
24633
|
return;
|
|
24585
24634
|
}
|
|
24586
24635
|
await uploadImage({
|
|
@@ -24635,9 +24684,10 @@ async function uploadImage({ editor, view, file, size, uploadHandler }) {
|
|
|
24635
24684
|
view.dispatch(
|
|
24636
24685
|
view.state.tr.replaceWith(placeholderPos, placeholderPos, imageNode).setMeta(ImagePlaceholderPluginKey, removeMeta)
|
|
24637
24686
|
);
|
|
24638
|
-
} catch {
|
|
24687
|
+
} catch (error) {
|
|
24639
24688
|
let removeMeta = { type: "remove", id };
|
|
24640
24689
|
view.dispatch(tr.setMeta(ImagePlaceholderPluginKey, removeMeta));
|
|
24690
|
+
editor.emit("exception", { error, editor });
|
|
24641
24691
|
}
|
|
24642
24692
|
}
|
|
24643
24693
|
function addImageRelationship({ editor, path }) {
|
|
@@ -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 { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-BFq1XXek.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BdLd21gy.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-BdLd21gy.js";
|
|
2
|
+
import "./chunks/converter-BFq1XXek.js";
|
|
3
|
+
import "./chunks/docx-zipper-BahUy6FS.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -61,13 +61,6 @@ export function generateRunProps(marks?: any[]): {
|
|
|
61
61
|
* @returns
|
|
62
62
|
*/
|
|
63
63
|
export function processOutputMarks(marks?: MarkType[]): any[];
|
|
64
|
-
/**
|
|
65
|
-
* Main translation function for a table row
|
|
66
|
-
*
|
|
67
|
-
* @param {ExportParams} params
|
|
68
|
-
* @returns {XmlReadyNode} The translated table row node
|
|
69
|
-
*/
|
|
70
|
-
export function translateTableRow(params: ExportParams): XmlReadyNode;
|
|
71
64
|
export function translateHardBreak(params: any): {
|
|
72
65
|
name: string;
|
|
73
66
|
elements: {
|
|
@@ -15,15 +15,6 @@ export function handleTableNode(node: XmlNode, params: any): {
|
|
|
15
15
|
tableWidthType: any;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
/**
|
|
19
|
-
* @param {Object} options
|
|
20
|
-
* @returns {{type: string, content: (*|*[]), attrs: {}}}
|
|
21
|
-
*/
|
|
22
|
-
export function handleTableCellNode({ params, node, table, row, rowBorders, styleTag, columnIndex, columnWidth, }: any): {
|
|
23
|
-
type: string;
|
|
24
|
-
content: (any | any[]);
|
|
25
|
-
attrs: {};
|
|
26
|
-
};
|
|
27
18
|
/**
|
|
28
19
|
*
|
|
29
20
|
* @param tblStyleTag
|
|
@@ -38,19 +29,6 @@ export function getReferencedTableStyles(tblStyleTag: any, docx: ParsedDocx): {
|
|
|
38
29
|
rowBorders: {};
|
|
39
30
|
basedOn: any;
|
|
40
31
|
} | null;
|
|
41
|
-
/**
|
|
42
|
-
* Process a table row node
|
|
43
|
-
* @param node
|
|
44
|
-
* @param {undefined | null | {insideH?: *, insideV?: *}} rowBorders
|
|
45
|
-
* @param {ParsedDocx} docx
|
|
46
|
-
* @param {NodeListHandler} nodeListHandler
|
|
47
|
-
* @param {boolean} insideTrackChange
|
|
48
|
-
* @returns {*}
|
|
49
|
-
*/
|
|
50
|
-
export function handleTableRowNode(node: any, table: any, rowBorders: undefined | null | {
|
|
51
|
-
insideH?: any;
|
|
52
|
-
insideV?: any;
|
|
53
|
-
}, styleTag: any, params: any): any;
|
|
54
32
|
/**
|
|
55
33
|
* @type {import("docxImporter").NodeHandler}
|
|
56
34
|
*/
|
|
@@ -1 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper to create simple property handlers with one-to-one mapping for properties with a single attribute (eg: 'w:val')
|
|
3
|
+
* @param {string} xmlName The XML attribute name (with namespace).
|
|
4
|
+
* @param {string|null} sdName The SuperDoc attribute name (without namespace). If null, it will be derived from xmlName.
|
|
5
|
+
* @param {string} [attrName='w:val'] The specific attribute name to map to/from. Default is 'w:val'.
|
|
6
|
+
* @param {function} [transformEncode=(v) => v] Optional transformation function to apply during encoding.
|
|
7
|
+
* @param {function} [transformDecode=(v) => v] Optional transformation function to apply during decoding.
|
|
8
|
+
* @returns {import('@translator').NodeTranslatorConfig} The attribute handler config with xmlName, sdName, encode, and decode functions.
|
|
9
|
+
*/
|
|
10
|
+
export function createSingleAttrPropertyHandler(xmlName: string, sdName?: string | null, attrName?: string, transformEncode?: Function, transformDecode?: Function): import("@translator").NodeTranslatorConfig;
|
|
11
|
+
/**
|
|
12
|
+
* Helper to create property handlers for measurement attributes (w:w and w:type)
|
|
13
|
+
* @param {string} xmlName The XML attribute name (with namespace).
|
|
14
|
+
* @param {string|null} sdName The SuperDoc attribute name (without namespace). If null, it will be derived from xmlName.
|
|
15
|
+
* @returns {import('@translator').NodeTranslatorConfig} The attribute handler config with xmlName, sdName, encode, and decode functions.
|
|
16
|
+
*/
|
|
17
|
+
export function createMeasurementPropertyHandler(xmlName: string, sdName?: string | null): import("@translator").NodeTranslatorConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Encodes properties of a node using provided translators and adds them to the attributes object.
|
|
20
|
+
* @param {object} [node] The node containing elements to be encoded.
|
|
21
|
+
* @param {object} [translatorsByXmlName] A mapping of XML names to their corresponding translators.
|
|
22
|
+
* @param {boolean} [asArray=false] If true, encodes attributes as an array of objects; otherwise, as a single object.
|
|
23
|
+
* @returns {object|Array} The encoded attributes as an object or array based on the asArray flag.
|
|
24
|
+
*/
|
|
25
|
+
export function encodeProperties(node?: object, translatorsByXmlName?: object, asArray?: boolean): object | any[];
|
|
26
|
+
/** Decodes properties from a given properties object using provided translators and adds them to the elements array.
|
|
27
|
+
* @param {object} [node] The node being processed.
|
|
28
|
+
* @param {object} [translatorsBySdName] A mapping of SuperDoc names to their corresponding translators.
|
|
29
|
+
* @param {object} [properties] The properties object containing attributes to be decoded.
|
|
30
|
+
* @returns {Array} An array of decoded elements.
|
|
31
|
+
*/
|
|
32
|
+
export function decodeProperties(translatorsBySdName?: object, properties?: object): any[];
|
|
1
33
|
export function generateV2HandlerEntity(handlerName: string, translator: import("../node-translator/").NodeTranslator): import("../../v2/importer/docxImporter").NodeHandlerEntry;
|
|
34
|
+
export function createAttributeHandler(xmlName?: string, sdName?: string | null, transformEncode?: any, transformDecode?: any): import("@translator").AttrConfig;
|
|
35
|
+
export function parseBoolean(value: string): boolean;
|
|
36
|
+
export function booleanToString(value: boolean): string;
|
|
37
|
+
export function parseInteger(value: any): number | undefined;
|
|
38
|
+
export function integerToString(value: any): string | undefined;
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/cantSplit/cantSplit-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the cantSplit element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 377
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cantSplit-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/cnfStyle/cnfStyle-translator.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the cnfStyle element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 379
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cnfStyle-translator.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the divId element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 391
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./divId-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridAfter/gridAfter-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the gridAfter element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 395
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./gridAfter-translator.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the gridBefore element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 396
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./gridBefore-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/hidden/hidden-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the hidden element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 405
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./hidden-translator.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./jc-translator.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the jc element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 411
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tblCellSpacing-translator.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the tblCellSpacing element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 427
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tblHeader-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblHeader/tblHeader-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the tblHeader element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 433
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tr-translator";
|
|
@@ -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 "./trHeight-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/trHeight/trHeight-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the trHeight element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 474
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./trPr-translator.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./wAfter-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/wAfter/wAfter-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the wAfter element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 481
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./wBefore-translator.js";
|
package/dist/super-editor/src/core/super-converter/v3/handlers/w/wBefore/wBefore-translator.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The NodeTranslator instance for the wBefore element.
|
|
3
|
+
* @type {import('@translator').NodeTranslator}
|
|
4
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 482
|
|
5
|
+
*/
|
|
6
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -22,7 +22,7 @@ export const TranslatorTypes: Readonly<{
|
|
|
22
22
|
/** @typedef {import('../../v2/importer/types').NodeHandlerParams} SCEncoderConfig */
|
|
23
23
|
/** @typedef {import('../../v2/types').SuperDocNode} SCEncoderResult */
|
|
24
24
|
/** @typedef {{ node: { attrs?: any, marks?: any[], type: string }, children?: any[], relationships?: any[] }} SCDecoderConfig */
|
|
25
|
-
/** @typedef {{ name: string, elements: any[] }} SCDecoderResult */
|
|
25
|
+
/** @typedef {{ name: string, attributes?: any, elements: any[] }} SCDecoderResult */
|
|
26
26
|
/**
|
|
27
27
|
* @callback NodeTranslatorEncodeFn
|
|
28
28
|
* @param {SCEncoderConfig} params
|
|
@@ -156,6 +156,7 @@ export type SCDecoderConfig = {
|
|
|
156
156
|
};
|
|
157
157
|
export type SCDecoderResult = {
|
|
158
158
|
name: string;
|
|
159
|
+
attributes?: any;
|
|
159
160
|
elements: any[];
|
|
160
161
|
};
|
|
161
162
|
export type NodeTranslatorEncodeFn = (params: SCEncoderConfig, encodedAttrs?: EncodedAttributes) => import("../../v2/types").SuperDocNode;
|