@harbour-enterprises/superdoc 0.22.1 → 0.23.0-next.2
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-D2BPnEBG.cjs → PdfViewer-BItyloFT.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CBmOiHsj.es.js → PdfViewer-MPmm-SUD.es.js} +1 -1
- package/dist/chunks/{index-B0CI50e4.cjs → index-CdJOxoqt.cjs} +2 -2
- package/dist/chunks/{index-BSDcfSFc.es.js → index-OVF3JhUR.es.js} +2 -2
- package/dist/chunks/{super-editor.es-DOOwW-Iv.cjs → super-editor.es-C7stybby.cjs} +1608 -1032
- package/dist/chunks/{super-editor.es-BW1T3N2-.es.js → super-editor.es-DQnqUJZs.es.js} +1608 -1032
- package/dist/style.css +3 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-UuZxU-p8.js → converter-BVirrB35.js} +1463 -1028
- package/dist/super-editor/chunks/{docx-zipper-Bss48sB0.js → docx-zipper-Cpb9d2an.js} +1 -1
- package/dist/super-editor/chunks/{editor--v3HbUU0.js → editor-DIINh50j.js} +151 -10
- package/dist/super-editor/chunks/{toolbar-BeXlvdV8.js → toolbar-CmDmkPHL.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 +4 -4
- package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/hyperlink-preprocessor.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/index.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/num-pages-preprocessor.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/page-preprocessor.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/page-ref-preprocessor.d.ts +9 -0
- package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/toc-preprocessor.d.ts +8 -0
- package/dist/super-editor/src/core/super-converter/field-references/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/field-references/preProcessNodesForFldChar.d.ts +21 -0
- package/dist/super-editor/src/core/super-converter/v2/exporter/helpers/translateChildNodes.d.ts +3 -3
- package/dist/super-editor/src/core/super-converter/v2/importer/pageReferenceImporter.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v2/importer/tableOfContentsImporter.d.ts +4 -0
- package/dist/super-editor/src/core/super-converter/v2/types/index.d.ts +7 -1
- package/dist/super-editor/src/core/super-converter/v3/handlers/sd/pageReference/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/sd/pageReference/pageReference-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/sd/tableOfContents/index.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/sd/tableOfContents/tableOfContents-translator.d.ts +10 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/caps/caps-translator.d.ts +7 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/w-p-helpers.d.ts +0 -2
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/handle-doc-part-obj.d.ts +9 -1
- package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-document-part-obj.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +2 -2
- package/dist/super-editor/src/extensions/page-reference/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/page-reference/page-reference.d.ts +2 -0
- package/dist/super-editor/src/extensions/structured-content/document-part-object.d.ts +2 -0
- package/dist/super-editor/src/extensions/structured-content/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/tab/helpers/tabDecorations.d.ts +2 -2
- package/dist/super-editor/src/extensions/table-of-contents/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/table-of-contents/table-of-contents.d.ts +2 -0
- package/dist/super-editor/style.css +3 -0
- package/dist/super-editor/super-editor.es.js +10 -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 +1608 -1032
- 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-BVirrB35.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, registerCopyHandler_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, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_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 updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberigHelpers, ap as parseIndentElement, aq as combineIndents, ar as SelectionRange, as as Transform, at as isInTable$1, au as generateDocxRandomId, av as insertNewRelationship } 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 updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberigHelpers, ap as parseIndentElement, aq as combineIndents, ar as SelectionRange, as as Transform, at as isInTable$1, au as generateDocxRandomId, av as insertNewRelationship } from "./converter-BVirrB35.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-Cpb9d2an.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -17960,6 +17960,48 @@ const DocumentSection = Node$1.create({
|
|
|
17960
17960
|
};
|
|
17961
17961
|
}
|
|
17962
17962
|
});
|
|
17963
|
+
const DocumentPartObject = Node$1.create({
|
|
17964
|
+
name: "documentPartObject",
|
|
17965
|
+
group: "block",
|
|
17966
|
+
content: "block*",
|
|
17967
|
+
isolating: true,
|
|
17968
|
+
addOptions() {
|
|
17969
|
+
return {
|
|
17970
|
+
htmlAttributes: {
|
|
17971
|
+
class: "sd-document-part-object-block",
|
|
17972
|
+
"aria-label": "Structured document part block"
|
|
17973
|
+
}
|
|
17974
|
+
};
|
|
17975
|
+
},
|
|
17976
|
+
parseDOM() {
|
|
17977
|
+
return [
|
|
17978
|
+
{
|
|
17979
|
+
tag: "div.sd-document-part-object-block",
|
|
17980
|
+
priority: 60
|
|
17981
|
+
}
|
|
17982
|
+
];
|
|
17983
|
+
},
|
|
17984
|
+
renderDOM({ htmlAttributes }) {
|
|
17985
|
+
return ["div", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
|
|
17986
|
+
},
|
|
17987
|
+
addAttributes() {
|
|
17988
|
+
return {
|
|
17989
|
+
sdBlockId: {
|
|
17990
|
+
default: null,
|
|
17991
|
+
keepOnSplit: false,
|
|
17992
|
+
parseDOM: (elem) => elem.getAttribute("data-sd-block-id"),
|
|
17993
|
+
renderDOM: (attrs) => {
|
|
17994
|
+
return attrs.sdBlockId ? { "data-sd-block-id": attrs.sdBlockId } : {};
|
|
17995
|
+
}
|
|
17996
|
+
},
|
|
17997
|
+
id: {},
|
|
17998
|
+
docPartGallery: {},
|
|
17999
|
+
docPartUnique: {
|
|
18000
|
+
default: true
|
|
18001
|
+
}
|
|
18002
|
+
};
|
|
18003
|
+
}
|
|
18004
|
+
});
|
|
17963
18005
|
const Document = Node$1.create({
|
|
17964
18006
|
name: "doc",
|
|
17965
18007
|
topNode: true,
|
|
@@ -19096,7 +19138,12 @@ const generateDecorations = (state, styles) => {
|
|
|
19096
19138
|
return { ...base2, ...linkedStyle.definition?.styles || {} };
|
|
19097
19139
|
};
|
|
19098
19140
|
const pMap = buildStyleMap(paragraphStyleId);
|
|
19099
|
-
|
|
19141
|
+
let tMap;
|
|
19142
|
+
if (paragraphStyleId?.startsWith("TOC")) {
|
|
19143
|
+
tMap = {};
|
|
19144
|
+
} else {
|
|
19145
|
+
tMap = buildStyleMap(inlineTextStyleId);
|
|
19146
|
+
}
|
|
19100
19147
|
const rMap = buildStyleMap(runStyleId);
|
|
19101
19148
|
const finalStyles = { ...pMap, ...tMap, ...rMap };
|
|
19102
19149
|
if (Object.keys(finalStyles).length === 0) return;
|
|
@@ -20393,7 +20440,7 @@ const CommentsMark = Mark.create({
|
|
|
20393
20440
|
});
|
|
20394
20441
|
const defaultTabDistance = 48;
|
|
20395
20442
|
const defaultLineLength = 816;
|
|
20396
|
-
const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
|
|
20443
|
+
const getTabDecorations = (doc2, view, helpers2, from2 = 0, to = null) => {
|
|
20397
20444
|
const decorations = [];
|
|
20398
20445
|
const paragraphCache = /* @__PURE__ */ new Map();
|
|
20399
20446
|
const end2 = to ?? doc2.content.size;
|
|
@@ -20401,7 +20448,7 @@ const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
|
|
|
20401
20448
|
if (node.type.name !== "tab") return;
|
|
20402
20449
|
let extraStyles = "";
|
|
20403
20450
|
const $pos = doc2.resolve(pos);
|
|
20404
|
-
const paragraphContext = getParagraphContext($pos, paragraphCache);
|
|
20451
|
+
const paragraphContext = getParagraphContext($pos, paragraphCache, helpers2);
|
|
20405
20452
|
if (!paragraphContext) return;
|
|
20406
20453
|
try {
|
|
20407
20454
|
const { tabStops, flattened, startPos } = paragraphContext;
|
|
@@ -20456,18 +20503,27 @@ const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
|
|
|
20456
20503
|
});
|
|
20457
20504
|
return decorations;
|
|
20458
20505
|
};
|
|
20459
|
-
function getParagraphContext($pos, cache) {
|
|
20506
|
+
function getParagraphContext($pos, cache, helpers2) {
|
|
20460
20507
|
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
20461
20508
|
const node = $pos.node(depth);
|
|
20462
20509
|
if (node?.type?.name === "paragraph") {
|
|
20463
20510
|
const startPos = $pos.start(depth);
|
|
20464
20511
|
if (!cache.has(startPos)) {
|
|
20512
|
+
let tabStops = [];
|
|
20513
|
+
if (Array.isArray(node.attrs?.tabStops)) {
|
|
20514
|
+
tabStops = node.attrs.tabStops;
|
|
20515
|
+
} else {
|
|
20516
|
+
const style = helpers2.linkedStyles.getStyleById(node.attrs?.styleId);
|
|
20517
|
+
if (Array.isArray(style?.definition?.styles?.tabStops)) {
|
|
20518
|
+
tabStops = style.definition.styles.tabStops;
|
|
20519
|
+
}
|
|
20520
|
+
}
|
|
20465
20521
|
cache.set(startPos, {
|
|
20466
20522
|
paragraph: node,
|
|
20467
20523
|
paragraphDepth: depth,
|
|
20468
20524
|
startPos,
|
|
20469
20525
|
indent: node.attrs?.indent || {},
|
|
20470
|
-
tabStops
|
|
20526
|
+
tabStops,
|
|
20471
20527
|
flattened: flattenParagraph(node, startPos),
|
|
20472
20528
|
accumulatedTabWidth: 0
|
|
20473
20529
|
});
|
|
@@ -20633,7 +20689,7 @@ const TabNode = Node$1.create({
|
|
|
20633
20689
|
};
|
|
20634
20690
|
},
|
|
20635
20691
|
addPmPlugins() {
|
|
20636
|
-
const { view } = this.editor;
|
|
20692
|
+
const { view, helpers: helpers2 } = this.editor;
|
|
20637
20693
|
const tabPlugin = new Plugin({
|
|
20638
20694
|
name: "tabPlugin",
|
|
20639
20695
|
key: new PluginKey("tabPlugin"),
|
|
@@ -20643,7 +20699,7 @@ const TabNode = Node$1.create({
|
|
|
20643
20699
|
},
|
|
20644
20700
|
apply(tr, { decorations }, _oldState, newState) {
|
|
20645
20701
|
if (!decorations) {
|
|
20646
|
-
decorations = DecorationSet.create(newState.doc, getTabDecorations(newState.doc, view));
|
|
20702
|
+
decorations = DecorationSet.create(newState.doc, getTabDecorations(newState.doc, view, helpers2));
|
|
20647
20703
|
}
|
|
20648
20704
|
if (!tr.docChanged) {
|
|
20649
20705
|
return { decorations };
|
|
@@ -20683,7 +20739,7 @@ const TabNode = Node$1.create({
|
|
|
20683
20739
|
rangesToRecalculate.forEach(([start2, end2]) => {
|
|
20684
20740
|
const oldDecorations = decorations.find(start2, end2);
|
|
20685
20741
|
decorations = decorations.remove(oldDecorations);
|
|
20686
|
-
const newDecorations = getTabDecorations(newState.doc, view, start2, end2);
|
|
20742
|
+
const newDecorations = getTabDecorations(newState.doc, view, helpers2, start2, end2);
|
|
20687
20743
|
decorations = decorations.add(newState.doc, newDecorations);
|
|
20688
20744
|
});
|
|
20689
20745
|
return { decorations };
|
|
@@ -26964,6 +27020,43 @@ const processMarks = (marks) => {
|
|
|
26964
27020
|
});
|
|
26965
27021
|
return styles;
|
|
26966
27022
|
};
|
|
27023
|
+
const PageReference = Node$1.create({
|
|
27024
|
+
name: "pageReference",
|
|
27025
|
+
group: "inline",
|
|
27026
|
+
inline: true,
|
|
27027
|
+
atom: true,
|
|
27028
|
+
draggable: false,
|
|
27029
|
+
selectable: false,
|
|
27030
|
+
content: "inline*",
|
|
27031
|
+
addOptions() {
|
|
27032
|
+
return {
|
|
27033
|
+
htmlAttributes: {
|
|
27034
|
+
contenteditable: false,
|
|
27035
|
+
"data-id": "auto-page-reference",
|
|
27036
|
+
"aria-label": "Page reference node",
|
|
27037
|
+
class: "sd-editor-page-reference"
|
|
27038
|
+
}
|
|
27039
|
+
};
|
|
27040
|
+
},
|
|
27041
|
+
addAttributes() {
|
|
27042
|
+
return {
|
|
27043
|
+
marksAsAttrs: {
|
|
27044
|
+
default: null,
|
|
27045
|
+
rendered: false
|
|
27046
|
+
},
|
|
27047
|
+
instruction: {
|
|
27048
|
+
default: "",
|
|
27049
|
+
rendered: false
|
|
27050
|
+
}
|
|
27051
|
+
};
|
|
27052
|
+
},
|
|
27053
|
+
parseDOM() {
|
|
27054
|
+
return [{ tag: 'span[data-id="auto-page-reference"]' }];
|
|
27055
|
+
},
|
|
27056
|
+
renderDOM({ htmlAttributes }) {
|
|
27057
|
+
return ["span", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
|
|
27058
|
+
}
|
|
27059
|
+
});
|
|
26967
27060
|
const ShapeContainer = Node$1.create({
|
|
26968
27061
|
name: "shapeContainer",
|
|
26969
27062
|
group: "block",
|
|
@@ -27377,6 +27470,51 @@ const checkForNewBlockNodesInTrs = (transactions) => {
|
|
|
27377
27470
|
});
|
|
27378
27471
|
});
|
|
27379
27472
|
};
|
|
27473
|
+
const TableOfContents = Node$1.create({
|
|
27474
|
+
name: "tableOfContents",
|
|
27475
|
+
group: "block",
|
|
27476
|
+
content: "paragraph+",
|
|
27477
|
+
inline: false,
|
|
27478
|
+
addOptions() {
|
|
27479
|
+
return {
|
|
27480
|
+
htmlAttributes: {
|
|
27481
|
+
"data-id": "table-of-contents",
|
|
27482
|
+
"aria-label": "Table of Contents"
|
|
27483
|
+
}
|
|
27484
|
+
};
|
|
27485
|
+
},
|
|
27486
|
+
parseDOM() {
|
|
27487
|
+
return [
|
|
27488
|
+
{
|
|
27489
|
+
tag: 'div[data-id="table-of-contents"]'
|
|
27490
|
+
}
|
|
27491
|
+
];
|
|
27492
|
+
},
|
|
27493
|
+
renderDOM({ htmlAttributes }) {
|
|
27494
|
+
return ["div", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
|
|
27495
|
+
},
|
|
27496
|
+
addAttributes() {
|
|
27497
|
+
return {
|
|
27498
|
+
instruction: {
|
|
27499
|
+
default: null,
|
|
27500
|
+
rendered: false
|
|
27501
|
+
},
|
|
27502
|
+
/**
|
|
27503
|
+
* @private
|
|
27504
|
+
* @category Attribute
|
|
27505
|
+
* @param {string} [sdBlockId] - Internal block tracking ID (not user-configurable)
|
|
27506
|
+
*/
|
|
27507
|
+
sdBlockId: {
|
|
27508
|
+
default: null,
|
|
27509
|
+
keepOnSplit: false,
|
|
27510
|
+
parseDOM: (elem) => elem.getAttribute("data-sd-block-id"),
|
|
27511
|
+
renderDOM: (attrs) => {
|
|
27512
|
+
return attrs.sdBlockId ? { "data-sd-block-id": attrs.sdBlockId } : {};
|
|
27513
|
+
}
|
|
27514
|
+
}
|
|
27515
|
+
};
|
|
27516
|
+
}
|
|
27517
|
+
});
|
|
27380
27518
|
const TextStyle = Mark.create({
|
|
27381
27519
|
name: "textStyle",
|
|
27382
27520
|
addOptions() {
|
|
@@ -33983,6 +34121,7 @@ const getStarterExtensions = () => {
|
|
|
33983
34121
|
SlashMenu,
|
|
33984
34122
|
Strike,
|
|
33985
34123
|
TabNode,
|
|
34124
|
+
TableOfContents,
|
|
33986
34125
|
Text,
|
|
33987
34126
|
TextAlign,
|
|
33988
34127
|
TextIndent,
|
|
@@ -34017,6 +34156,7 @@ const getStarterExtensions = () => {
|
|
|
34017
34156
|
AiLoaderNode,
|
|
34018
34157
|
PageNumber,
|
|
34019
34158
|
TotalPageCount,
|
|
34159
|
+
PageReference,
|
|
34020
34160
|
ShapeContainer,
|
|
34021
34161
|
ShapeTextbox,
|
|
34022
34162
|
ContentBlock,
|
|
@@ -34025,6 +34165,7 @@ const getStarterExtensions = () => {
|
|
|
34025
34165
|
StructuredContentBlock,
|
|
34026
34166
|
StructuredContentCommands,
|
|
34027
34167
|
DocumentSection,
|
|
34168
|
+
DocumentPartObject,
|
|
34028
34169
|
NodeResizer,
|
|
34029
34170
|
CustomSelection,
|
|
34030
34171
|
TextTransform
|
|
@@ -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-BVirrB35.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DIINh50j.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-DIINh50j.js";
|
|
2
|
+
import "./chunks/converter-BVirrB35.js";
|
|
3
|
+
import "./chunks/docx-zipper-Cpb9d2an.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {Object} ExportParams
|
|
3
3
|
* @property {Object} node JSON node to translate (from PM schema)
|
|
4
|
-
* @property {Object} bodyNode The stored body node to restore, if available
|
|
5
|
-
* @property {Object[]} relationships The relationships to add to the document
|
|
4
|
+
* @property {Object} [bodyNode] The stored body node to restore, if available
|
|
5
|
+
* @property {Object[]} [relationships] The relationships to add to the document
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* @typedef {Object} SchemaNode
|
|
@@ -119,11 +119,11 @@ export type ExportParams = {
|
|
|
119
119
|
/**
|
|
120
120
|
* The stored body node to restore, if available
|
|
121
121
|
*/
|
|
122
|
-
bodyNode
|
|
122
|
+
bodyNode?: any;
|
|
123
123
|
/**
|
|
124
124
|
* The relationships to add to the document
|
|
125
125
|
*/
|
|
126
|
-
relationships
|
|
126
|
+
relationships?: any[];
|
|
127
127
|
};
|
|
128
128
|
export type SchemaNode = {
|
|
129
129
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes a HYPERLINK instruction and creates a `w:hyperlink` node.
|
|
3
|
+
* @param {import('../../v2/types/index.js').OpenXmlNode[]} nodesToCombine The nodes to combine.
|
|
4
|
+
* @param {string} instruction The instruction text.
|
|
5
|
+
* @param {import('../../v2/docxHelper').ParsedDocx} [docx] - The docx object.
|
|
6
|
+
* @returns {import('../../v2/types/index.js').OpenXmlNode[]}
|
|
7
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 1216
|
|
8
|
+
*/
|
|
9
|
+
export function preProcessHyperlinkInstruction(nodesToCombine: import("../../v2/types/index.js").OpenXmlNode[], instruction: string, docx?: import("../../v2/docxHelper").ParsedDocx): import("../../v2/types/index.js").OpenXmlNode[];
|
package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export function getInstructionPreProcessor(instruction: string): InstructionPreProcessor | null;
|
|
2
|
+
export type InstructionPreProcessor = (nodesToCombine: import("../../v2/types/index.js").OpenXmlNode[], instruction: string, docx?: import("../../v2/docxHelper").ParsedDocx) => import("../../v2/types/index.js").OpenXmlNode[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes a NUMPAGES instruction and creates a `sd:totalPageNumber` node.
|
|
3
|
+
* @param {import('../../v2/types/index.js').OpenXmlNode[]} nodesToCombine The nodes to combine.
|
|
4
|
+
* @param {string} _ The instruction text (unused).
|
|
5
|
+
* @param {import('../v2/docxHelper').ParsedDocx} [__] - The docx object.
|
|
6
|
+
* @returns {import('../../v2/types/index.js').OpenXmlNode[]}
|
|
7
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 1233
|
|
8
|
+
*/
|
|
9
|
+
export function preProcessNumPagesInstruction(nodesToCombine: import("../../v2/types/index.js").OpenXmlNode[], _: string, __?: any): import("../../v2/types/index.js").OpenXmlNode[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes a PAGE instruction and creates a `sd:autoPageNumber` node.
|
|
3
|
+
* @param {import('../../v2/types/index.js').OpenXmlNode[]} nodesToCombine The nodes to combine.
|
|
4
|
+
* @param {string} _ The instruction text (unused).
|
|
5
|
+
* @param {import('../v2/docxHelper').ParsedDocx} [__] - The docx object.
|
|
6
|
+
* @returns {import('../../v2/types/index.js').OpenXmlNode[]}
|
|
7
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 1234
|
|
8
|
+
*/
|
|
9
|
+
export function preProcessPageInstruction(nodesToCombine: import("../../v2/types/index.js").OpenXmlNode[], _: string, __?: any): import("../../v2/types/index.js").OpenXmlNode[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes a PAGEREF instruction and creates a `sd:pageReference` node.
|
|
3
|
+
* @param {import('../../v2/types/index.js').OpenXmlNode[]} nodesToCombine The nodes to combine.
|
|
4
|
+
* @param {string} instrText The instruction text.
|
|
5
|
+
* @param {import('../v2/docxHelper').ParsedDocx} [__] - The docx object.
|
|
6
|
+
* @returns {import('../../v2/types/index.js').OpenXmlNode[]}
|
|
7
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 1234
|
|
8
|
+
*/
|
|
9
|
+
export function preProcessPageRefInstruction(nodesToCombine: import("../../v2/types/index.js").OpenXmlNode[], instrText: string, _: any): import("../../v2/types/index.js").OpenXmlNode[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes a TOC instruction and creates a `sd:tableOfContents` node.
|
|
3
|
+
* @param {import('../../v2/types/index.js').OpenXmlNode[]} nodesToCombine The nodes to combine.
|
|
4
|
+
* @param {string} instrText The instruction text.
|
|
5
|
+
* @returns {import('../../v2/types/index.js').OpenXmlNode[]}
|
|
6
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 1251
|
|
7
|
+
*/
|
|
8
|
+
export function preProcessTocInstruction(nodesToCombine: import("../../v2/types/index.js").OpenXmlNode[], instrText: string): import("../../v2/types/index.js").OpenXmlNode[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./preProcessNodesForFldChar.js";
|
package/dist/super-editor/src/core/super-converter/field-references/preProcessNodesForFldChar.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function preProcessNodesForFldChar(nodes?: OpenXmlNode[], docx?: import("../v2/docxHelper").ParsedDocx): FldCharProcessResult;
|
|
2
|
+
export type OpenXmlNode = import("../v2/types/index.js").OpenXmlNode;
|
|
3
|
+
export type FldCharProcessResult = {
|
|
4
|
+
/**
|
|
5
|
+
* - The list of nodes after processing.
|
|
6
|
+
*/
|
|
7
|
+
processedNodes: OpenXmlNode[];
|
|
8
|
+
/**
|
|
9
|
+
* - If a field 'begin' was found without a matching 'end'. Contains the current field data.
|
|
10
|
+
*/
|
|
11
|
+
unpairedBegin: Array<{
|
|
12
|
+
nodes: OpenXmlNode[];
|
|
13
|
+
fieldInfo: {
|
|
14
|
+
instrText: string;
|
|
15
|
+
};
|
|
16
|
+
}> | null;
|
|
17
|
+
/**
|
|
18
|
+
* - If a field 'end' was found without a matching 'begin'.
|
|
19
|
+
*/
|
|
20
|
+
unpairedEnd: boolean | null;
|
|
21
|
+
};
|
package/dist/super-editor/src/core/super-converter/v2/exporter/helpers/translateChildNodes.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Process child nodes, ignoring any that are not valid
|
|
3
3
|
*
|
|
4
|
-
* @param {SchemaNode[]} nodes The input nodes
|
|
5
|
-
* @returns {XmlReadyNode[]} The processed child nodes
|
|
4
|
+
* @param {import('@converter/exporter').SchemaNode[]} nodes The input nodes
|
|
5
|
+
* @returns {import('@converter/exporter').XmlReadyNode[]} The processed child nodes
|
|
6
6
|
*/
|
|
7
|
-
export function translateChildNodes(params: any): XmlReadyNode[];
|
|
7
|
+
export function translateChildNodes(params: any): import("@converter/exporter").XmlReadyNode[];
|
|
@@ -5,4 +5,10 @@ export type SuperDocNode = any;
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a node in the Open XML document structure.
|
|
7
7
|
*/
|
|
8
|
-
export type OpenXmlNode =
|
|
8
|
+
export type OpenXmlNode = {
|
|
9
|
+
name: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
attributes?: object;
|
|
12
|
+
elements?: OpenXmlNode[];
|
|
13
|
+
text?: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./pageReference-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 passthrough element.
|
|
5
|
+
* @type {import('@translator').NodeTranslator}
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./tableOfContents-translator.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @type {import('@translator').NodeTranslatorConfig} */
|
|
2
|
+
export const config: import("@translator").NodeTranslatorConfig;
|
|
3
|
+
/**
|
|
4
|
+
* The NodeTranslator instance for the sd:tableOfContents element.
|
|
5
|
+
* This element represents a table of contents in a document and is added during
|
|
6
|
+
* preprocessing of w:fldChar elements
|
|
7
|
+
* @type {import('@translator').NodeTranslator}
|
|
8
|
+
* @see {@link https://ecma-international.org/publications-and-standards/standards/ecma-376/} "Fundamentals And Markup Language Reference", page 1251
|
|
9
|
+
*/
|
|
10
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @type {import('@translator').NodeTranslatorConfig} */
|
|
2
|
+
export const config: import("@translator").NodeTranslatorConfig;
|
|
3
|
+
/**
|
|
4
|
+
* The NodeTranslator instance for the w:caps element.
|
|
5
|
+
* @type {import('@translator').NodeTranslator}
|
|
6
|
+
*/
|
|
7
|
+
export const translator: import("@translator").NodeTranslator;
|
|
@@ -2,5 +2,3 @@ export function parseParagraphBorders(pBdr: any): {};
|
|
|
2
2
|
export function getParagraphIndent(node: any, docx: any, styleId?: string): any;
|
|
3
3
|
export function getParagraphSpacing(node: any, docx: any, styleId?: string, marks?: any[], options?: {}): any;
|
|
4
4
|
export function getDefaultParagraphStyle(docx: any, styleId?: string): any;
|
|
5
|
-
export function preProcessNodesForFldChar(nodes?: any[]): any[];
|
|
6
|
-
export function processCombinedNodesForFldChar(nodesToCombine?: any[]): any[];
|
|
@@ -3,4 +3,12 @@
|
|
|
3
3
|
* @returns {Array|null}
|
|
4
4
|
*/
|
|
5
5
|
export function handleDocPartObj(params: any): any[] | null;
|
|
6
|
-
export function tableOfContentsHandler(params: any):
|
|
6
|
+
export function tableOfContentsHandler(params: any): {
|
|
7
|
+
type: string;
|
|
8
|
+
content: any;
|
|
9
|
+
attrs: {
|
|
10
|
+
id: any;
|
|
11
|
+
docPartGallery: string;
|
|
12
|
+
docPartUnique: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translate a document part object node to its XML representation.
|
|
3
|
+
* @param {Object} params - The parameters for translation.
|
|
4
|
+
* @returns {Object} The XML representation of the structured content block.
|
|
5
|
+
*/
|
|
6
|
+
export function translateDocumentPartObj(params: any): any;
|
|
@@ -40,7 +40,7 @@ export const TranslatorTypes: Readonly<{
|
|
|
40
40
|
* @callback NodeTranslatorDecodeFn
|
|
41
41
|
* @param {SCDecoderConfig} params
|
|
42
42
|
* @param {DecodedAttributes} [decodedAttrs]
|
|
43
|
-
* @returns {import('../../v2/types').OpenXmlNode}
|
|
43
|
+
* @returns {import('../../v2/types').OpenXmlNode | import('../../v2/types').OpenXmlNode[]}
|
|
44
44
|
*/
|
|
45
45
|
/** @callback MatchesEncodeFn @param {any[]} nodes @param {any} [ctx] @returns {boolean} */
|
|
46
46
|
/** @callback MatchesDecodeFn @param {any} node @param {any} [ctx] @returns {boolean} */
|
|
@@ -170,7 +170,7 @@ export type SCDecoderResult = {
|
|
|
170
170
|
elements: any[];
|
|
171
171
|
};
|
|
172
172
|
export type NodeTranslatorEncodeFn = (params: SCEncoderConfig, encodedAttrs?: EncodedAttributes) => import("../../v2/types").SuperDocNode;
|
|
173
|
-
export type NodeTranslatorDecodeFn = (params: SCDecoderConfig, decodedAttrs?: DecodedAttributes) => import("../../v2/types").OpenXmlNode;
|
|
173
|
+
export type NodeTranslatorDecodeFn = (params: SCDecoderConfig, decodedAttrs?: DecodedAttributes) => import("../../v2/types").OpenXmlNode | import("../../v2/types").OpenXmlNode[];
|
|
174
174
|
export type MatchesEncodeFn = (nodes: any[], ctx?: any) => boolean;
|
|
175
175
|
export type MatchesDecodeFn = (node: any, ctx?: any) => boolean;
|
|
176
176
|
export type EncodedAttributes = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./page-reference.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function getParagraphContext($pos: any, cache: any): any;
|
|
1
|
+
export function getParagraphContext($pos: any, cache: any, helpers: any): any;
|
|
2
2
|
export function flattenParagraph(paragraph: any, paragraphStartPos: any): any[];
|
|
3
3
|
export function findNextTabIndex(flattened: any, fromIndex: any): any;
|
|
4
4
|
export function findDecimalBreakPos(flattened: any, startIndex: any, breakChar: any): any;
|
|
@@ -9,4 +9,4 @@ export function getLeftCoord(view: any, pos: any): any;
|
|
|
9
9
|
export function calcTabHeight(pos: any): string;
|
|
10
10
|
export const defaultTabDistance: 48;
|
|
11
11
|
export const defaultLineLength: 816;
|
|
12
|
-
export function getTabDecorations(doc: any, view: any, from?: number, to?: any): any[];
|
|
12
|
+
export function getTabDecorations(doc: any, view: any, helpers: any, from?: number, to?: any): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./table-of-contents.js";
|