@harbour-enterprises/superdoc 0.22.0-next.10 → 0.22.0-next.11
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-CJdQmuIm.es.js → PdfViewer-CS3pY_UR.es.js} +1 -1
- package/dist/chunks/{PdfViewer-DE1NR4Ve.cjs → PdfViewer-Cz3fT1qt.cjs} +1 -1
- package/dist/chunks/{index-B9sHxXr_.es.js → index-Bbqhu9ev.es.js} +2 -2
- package/dist/chunks/{index-nfoifSpX.cjs → index-p73XAt11.cjs} +2 -2
- package/dist/chunks/{super-editor.es-DAP-fnHo.cjs → super-editor.es-CFD0lcOY.cjs} +1620 -1044
- package/dist/chunks/{super-editor.es-_iVPQ8J8.es.js → super-editor.es-DK3l03fz.es.js} +1620 -1044
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/style.css +3 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-DK1NMJZB.js → converter-DFDRdFEB.js} +1482 -1041
- package/dist/super-editor/chunks/{docx-zipper-CmK8TyNb.js → docx-zipper-CplUdgI9.js} +1 -1
- package/dist/super-editor/chunks/{editor-YR4uV-dp.js → editor-BnpIdTLI.js} +155 -19
- package/dist/super-editor/chunks/{toolbar-DzJyRvb0.js → toolbar-5h-ljJ_h.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/helpers/generateDocxRandomId.d.ts +5 -0
- 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/structured-content/structuredContentHelpers/getStructuredContentBlockTags.d.ts +2 -3
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentInlineTags.d.ts +2 -3
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTags.d.ts +2 -3
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTagsById.d.ts +2 -3
- 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 +1620 -1044
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as process$1,
|
|
1
|
+
import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-DFDRdFEB.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
|
|
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-DFDRdFEB.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-CplUdgI9.js";
|
|
18
18
|
var GOOD_LEAF_SIZE = 200;
|
|
19
19
|
var RopeSequence = function RopeSequence2() {
|
|
20
20
|
};
|
|
@@ -12107,7 +12107,7 @@ const handleTrackedChangeTransaction = (trackedChangeMeta, trackedChanges, newEd
|
|
|
12107
12107
|
if (emitParams) editor.emit("commentsUpdate", emitParams);
|
|
12108
12108
|
return newTrackedChanges;
|
|
12109
12109
|
};
|
|
12110
|
-
const getTrackedChangeText = ({
|
|
12110
|
+
const getTrackedChangeText = ({ nodes, mark, trackedChangeType, isDeletionInsertion }) => {
|
|
12111
12111
|
let trackedChangeText = "";
|
|
12112
12112
|
let deletionText = "";
|
|
12113
12113
|
if (trackedChangeType === TrackInsertMarkName) {
|
|
@@ -12149,10 +12149,8 @@ const createOrUpdateTrackedChangeComment = ({ event, marks, deletionNodes, nodes
|
|
|
12149
12149
|
if (hasMatchingId) nodesWithMark.push(node2);
|
|
12150
12150
|
});
|
|
12151
12151
|
const { deletionText, trackedChangeText } = getTrackedChangeText({
|
|
12152
|
-
state: newEditorState,
|
|
12153
12152
|
nodes: nodesWithMark.length ? nodesWithMark : [node],
|
|
12154
12153
|
mark: trackedMark,
|
|
12155
|
-
marks,
|
|
12156
12154
|
trackedChangeType,
|
|
12157
12155
|
isDeletionInsertion
|
|
12158
12156
|
});
|
|
@@ -17410,7 +17408,7 @@ const StructuredContentCommands = Extension.create({
|
|
|
17410
17408
|
}
|
|
17411
17409
|
const attrs = {
|
|
17412
17410
|
...options.attrs,
|
|
17413
|
-
id: options.attrs?.id ||
|
|
17411
|
+
id: options.attrs?.id || generateRandomSigned32BitIntStrId(),
|
|
17414
17412
|
tag: "inline_text_sdt",
|
|
17415
17413
|
alias: options.attrs?.alias || "Structured content"
|
|
17416
17414
|
};
|
|
@@ -17451,7 +17449,7 @@ const StructuredContentCommands = Extension.create({
|
|
|
17451
17449
|
}
|
|
17452
17450
|
const attrs = {
|
|
17453
17451
|
...options.attrs,
|
|
17454
|
-
id: options.attrs?.id ||
|
|
17452
|
+
id: options.attrs?.id || generateRandomSigned32BitIntStrId(),
|
|
17455
17453
|
tag: "block_table_sdt",
|
|
17456
17454
|
alias: options.attrs?.alias || "Structured content"
|
|
17457
17455
|
};
|
|
@@ -17558,7 +17556,7 @@ const StructuredContentCommands = Extension.create({
|
|
|
17558
17556
|
* Removes a structured content at cursor, preserving its content.
|
|
17559
17557
|
* @category Command
|
|
17560
17558
|
*/
|
|
17561
|
-
deleteStructuredContentAtSelection: () => ({
|
|
17559
|
+
deleteStructuredContentAtSelection: () => ({ dispatch, state, tr }) => {
|
|
17562
17560
|
const predicate = (node) => STRUCTURED_CONTENT_NAMES.includes(node.type.name);
|
|
17563
17561
|
const structuredContent = findParentNode(predicate)(state.selection);
|
|
17564
17562
|
if (!structuredContent) {
|
|
@@ -17581,9 +17579,6 @@ const StructuredContentCommands = Extension.create({
|
|
|
17581
17579
|
};
|
|
17582
17580
|
}
|
|
17583
17581
|
});
|
|
17584
|
-
const randomId = () => {
|
|
17585
|
-
return Math.floor(Math.random() * 4294967295).toString();
|
|
17586
|
-
};
|
|
17587
17582
|
class DocumentSectionView {
|
|
17588
17583
|
constructor(node, getPos, decorations, editor) {
|
|
17589
17584
|
__privateAdd(this, _DocumentSectionView_instances);
|
|
@@ -17965,6 +17960,48 @@ const DocumentSection = Node$1.create({
|
|
|
17965
17960
|
};
|
|
17966
17961
|
}
|
|
17967
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
|
+
});
|
|
17968
18005
|
const Document = Node$1.create({
|
|
17969
18006
|
name: "doc",
|
|
17970
18007
|
topNode: true,
|
|
@@ -19101,7 +19138,12 @@ const generateDecorations = (state, styles) => {
|
|
|
19101
19138
|
return { ...base2, ...linkedStyle.definition?.styles || {} };
|
|
19102
19139
|
};
|
|
19103
19140
|
const pMap = buildStyleMap(paragraphStyleId);
|
|
19104
|
-
|
|
19141
|
+
let tMap;
|
|
19142
|
+
if (paragraphStyleId?.startsWith("TOC")) {
|
|
19143
|
+
tMap = {};
|
|
19144
|
+
} else {
|
|
19145
|
+
tMap = buildStyleMap(inlineTextStyleId);
|
|
19146
|
+
}
|
|
19105
19147
|
const rMap = buildStyleMap(runStyleId);
|
|
19106
19148
|
const finalStyles = { ...pMap, ...tMap, ...rMap };
|
|
19107
19149
|
if (Object.keys(finalStyles).length === 0) return;
|
|
@@ -20398,7 +20440,7 @@ const CommentsMark = Mark.create({
|
|
|
20398
20440
|
});
|
|
20399
20441
|
const defaultTabDistance = 48;
|
|
20400
20442
|
const defaultLineLength = 816;
|
|
20401
|
-
const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
|
|
20443
|
+
const getTabDecorations = (doc2, view, helpers2, from2 = 0, to = null) => {
|
|
20402
20444
|
const decorations = [];
|
|
20403
20445
|
const paragraphCache = /* @__PURE__ */ new Map();
|
|
20404
20446
|
const end2 = to ?? doc2.content.size;
|
|
@@ -20406,7 +20448,7 @@ const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
|
|
|
20406
20448
|
if (node.type.name !== "tab") return;
|
|
20407
20449
|
let extraStyles = "";
|
|
20408
20450
|
const $pos = doc2.resolve(pos);
|
|
20409
|
-
const paragraphContext = getParagraphContext($pos, paragraphCache);
|
|
20451
|
+
const paragraphContext = getParagraphContext($pos, paragraphCache, helpers2);
|
|
20410
20452
|
if (!paragraphContext) return;
|
|
20411
20453
|
try {
|
|
20412
20454
|
const { tabStops, flattened, startPos } = paragraphContext;
|
|
@@ -20461,18 +20503,27 @@ const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
|
|
|
20461
20503
|
});
|
|
20462
20504
|
return decorations;
|
|
20463
20505
|
};
|
|
20464
|
-
function getParagraphContext($pos, cache) {
|
|
20506
|
+
function getParagraphContext($pos, cache, helpers2) {
|
|
20465
20507
|
for (let depth = $pos.depth; depth >= 0; depth--) {
|
|
20466
20508
|
const node = $pos.node(depth);
|
|
20467
20509
|
if (node?.type?.name === "paragraph") {
|
|
20468
20510
|
const startPos = $pos.start(depth);
|
|
20469
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
|
+
}
|
|
20470
20521
|
cache.set(startPos, {
|
|
20471
20522
|
paragraph: node,
|
|
20472
20523
|
paragraphDepth: depth,
|
|
20473
20524
|
startPos,
|
|
20474
20525
|
indent: node.attrs?.indent || {},
|
|
20475
|
-
tabStops
|
|
20526
|
+
tabStops,
|
|
20476
20527
|
flattened: flattenParagraph(node, startPos),
|
|
20477
20528
|
accumulatedTabWidth: 0
|
|
20478
20529
|
});
|
|
@@ -20638,7 +20689,7 @@ const TabNode = Node$1.create({
|
|
|
20638
20689
|
};
|
|
20639
20690
|
},
|
|
20640
20691
|
addPmPlugins() {
|
|
20641
|
-
const { view } = this.editor;
|
|
20692
|
+
const { view, helpers: helpers2 } = this.editor;
|
|
20642
20693
|
const tabPlugin = new Plugin({
|
|
20643
20694
|
name: "tabPlugin",
|
|
20644
20695
|
key: new PluginKey("tabPlugin"),
|
|
@@ -20648,7 +20699,7 @@ const TabNode = Node$1.create({
|
|
|
20648
20699
|
},
|
|
20649
20700
|
apply(tr, { decorations }, _oldState, newState) {
|
|
20650
20701
|
if (!decorations) {
|
|
20651
|
-
decorations = DecorationSet.create(newState.doc, getTabDecorations(newState.doc, view));
|
|
20702
|
+
decorations = DecorationSet.create(newState.doc, getTabDecorations(newState.doc, view, helpers2));
|
|
20652
20703
|
}
|
|
20653
20704
|
if (!tr.docChanged) {
|
|
20654
20705
|
return { decorations };
|
|
@@ -20688,7 +20739,7 @@ const TabNode = Node$1.create({
|
|
|
20688
20739
|
rangesToRecalculate.forEach(([start2, end2]) => {
|
|
20689
20740
|
const oldDecorations = decorations.find(start2, end2);
|
|
20690
20741
|
decorations = decorations.remove(oldDecorations);
|
|
20691
|
-
const newDecorations = getTabDecorations(newState.doc, view, start2, end2);
|
|
20742
|
+
const newDecorations = getTabDecorations(newState.doc, view, helpers2, start2, end2);
|
|
20692
20743
|
decorations = decorations.add(newState.doc, newDecorations);
|
|
20693
20744
|
});
|
|
20694
20745
|
return { decorations };
|
|
@@ -26969,6 +27020,43 @@ const processMarks = (marks) => {
|
|
|
26969
27020
|
});
|
|
26970
27021
|
return styles;
|
|
26971
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
|
+
});
|
|
26972
27060
|
const ShapeContainer = Node$1.create({
|
|
26973
27061
|
name: "shapeContainer",
|
|
26974
27062
|
group: "block",
|
|
@@ -27382,6 +27470,51 @@ const checkForNewBlockNodesInTrs = (transactions) => {
|
|
|
27382
27470
|
});
|
|
27383
27471
|
});
|
|
27384
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
|
+
});
|
|
27385
27518
|
const TextStyle = Mark.create({
|
|
27386
27519
|
name: "textStyle",
|
|
27387
27520
|
addOptions() {
|
|
@@ -33988,6 +34121,7 @@ const getStarterExtensions = () => {
|
|
|
33988
34121
|
SlashMenu,
|
|
33989
34122
|
Strike,
|
|
33990
34123
|
TabNode,
|
|
34124
|
+
TableOfContents,
|
|
33991
34125
|
Text,
|
|
33992
34126
|
TextAlign,
|
|
33993
34127
|
TextIndent,
|
|
@@ -34022,6 +34156,7 @@ const getStarterExtensions = () => {
|
|
|
34022
34156
|
AiLoaderNode,
|
|
34023
34157
|
PageNumber,
|
|
34024
34158
|
TotalPageCount,
|
|
34159
|
+
PageReference,
|
|
34025
34160
|
ShapeContainer,
|
|
34026
34161
|
ShapeTextbox,
|
|
34027
34162
|
ContentBlock,
|
|
@@ -34030,6 +34165,7 @@ const getStarterExtensions = () => {
|
|
|
34030
34165
|
StructuredContentBlock,
|
|
34031
34166
|
StructuredContentCommands,
|
|
34032
34167
|
DocumentSection,
|
|
34168
|
+
DocumentPartObject,
|
|
34033
34169
|
NodeResizer,
|
|
34034
34170
|
CustomSelection,
|
|
34035
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-DFDRdFEB.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BnpIdTLI.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-BnpIdTLI.js";
|
|
2
|
+
import "./chunks/converter-DFDRdFEB.js";
|
|
3
|
+
import "./chunks/docx-zipper-CplUdgI9.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -3,4 +3,9 @@
|
|
|
3
3
|
* @returns {string} - 8 character random string
|
|
4
4
|
*/
|
|
5
5
|
export function generateDocxRandomId(length?: number): string;
|
|
6
|
+
/**
|
|
7
|
+
* Generate a random signed 32-bit integer as a string.
|
|
8
|
+
* @returns {string} A random signed 32-bit integer as a string
|
|
9
|
+
*/
|
|
10
|
+
export function generateRandomSigned32BitIntStrId(): string;
|
|
6
11
|
export function generateRandom32BitHex(): string;
|
|
@@ -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";
|