@harbour-enterprises/superdoc 0.19.0-next.6 → 0.19.0-next.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/chunks/{PdfViewer-oqYWe1FJ.es.js → PdfViewer-BUcY_aLU.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-BlV8_l4e.cjs → PdfViewer-DtzjcoY1.cjs} +1 -1
  3. package/dist/chunks/{index-CeockUQz.es.js → index-BfPgSGCT.es.js} +2 -2
  4. package/dist/chunks/{index-DHyh73q4.cjs → index-Dic-WukZ.cjs} +2 -2
  5. package/dist/chunks/{super-editor.es-bu-RKSWh.cjs → super-editor.es-BxWpMXrO.cjs} +10947 -10849
  6. package/dist/chunks/{super-editor.es-BRBU19lM.es.js → super-editor.es-ZzKFiBVd.es.js} +10947 -10849
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/super-editor/ai-writer.es.js +2 -2
  9. package/dist/super-editor/chunks/{converter-BFq1XXek.js → converter-D7JstO1X.js} +11840 -11775
  10. package/dist/super-editor/chunks/{docx-zipper-BahUy6FS.js → docx-zipper-CxuVkw7R.js} +1 -1
  11. package/dist/super-editor/chunks/{editor-BdLd21gy.js → editor-C3cafdFa.js} +50 -17
  12. package/dist/super-editor/chunks/{toolbar-DoJY1zlM.js → toolbar-BSez2SLg.js} +2 -2
  13. package/dist/super-editor/converter.es.js +1 -1
  14. package/dist/super-editor/docx-zipper.es.js +2 -2
  15. package/dist/super-editor/editor.es.js +3 -3
  16. package/dist/super-editor/file-zipper.es.js +1 -1
  17. package/dist/super-editor/src/core/Editor.d.ts +2 -0
  18. package/dist/super-editor/src/core/super-converter/exporter.d.ts +19 -1
  19. package/dist/super-editor/src/core/super-converter/v2/exporter/index.d.ts +0 -1
  20. package/dist/super-editor/src/core/super-converter/v2/importer/sdtNodeImporter.d.ts +8 -0
  21. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/handle-annotation-node.d.ts +22 -0
  22. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/handle-doc-part-obj.d.ts +6 -0
  23. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/handle-document-section-node.d.ts +6 -0
  24. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/handle-structured-content-node.d.ts +5 -0
  25. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/parse-tag-value-json.d.ts +5 -0
  26. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/sdt-node-type-strategy.d.ts +9 -0
  27. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-document-section.d.ts +7 -0
  28. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-field-annotation.d.ts +80 -0
  29. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-structured-content.d.ts +5 -0
  30. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/index.d.ts +1 -0
  31. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/sdt-translator.d.ts +6 -0
  32. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +8 -8
  33. package/dist/super-editor/super-editor.es.js +6 -6
  34. package/dist/super-editor/toolbar.es.js +2 -2
  35. package/dist/super-editor.cjs +1 -1
  36. package/dist/super-editor.es.js +1 -1
  37. package/dist/superdoc.cjs +2 -2
  38. package/dist/superdoc.es.js +2 -2
  39. package/dist/superdoc.umd.js +11070 -10972
  40. package/dist/superdoc.umd.js.map +1 -1
  41. package/package.json +1 -1
  42. package/dist/super-editor/src/core/super-converter/v2/exporter/documentSectionExporter.d.ts +0 -1
  43. package/dist/super-editor/src/core/super-converter/v2/importer/annotationImporter.d.ts +0 -9
  44. package/dist/super-editor/src/core/super-converter/v2/importer/docPartGalleryImporter.d.ts +0 -1
  45. package/dist/super-editor/src/core/super-converter/v2/importer/docPartObjImporter.d.ts +0 -4
  46. package/dist/super-editor/src/core/super-converter/v2/importer/structuredDocumentNodeImporter.d.ts +0 -8
@@ -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-BFq1XXek.js";
1
+ import { p as process$1, aw as commonjsGlobal, B as Buffer, ax as getDefaultExportFromCjs, ay as getContentTypesFromXml, az as xmljs } from "./converter-D7JstO1X.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-BFq1XXek.js";
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-D7JstO1X.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-BahUy6FS.js";
17
+ import { D as DocxZipper } from "./docx-zipper-CxuVkw7R.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -14471,6 +14471,8 @@ const _Editor = class _Editor extends EventEmitter {
14471
14471
  }
14472
14472
  /**
14473
14473
  * Get the editor content as HTML
14474
+ * @param {Object} options - Options for the HTML serializer
14475
+ * @param {boolean} [options.unflattenLists] - Whether to unflatten lists in the HTML
14474
14476
  * @returns {string} Editor content as HTML
14475
14477
  */
14476
14478
  getHTML({ unflattenLists = false } = {}) {
@@ -18602,13 +18604,30 @@ const Paragraph = OxmlNode.create({
18602
18604
  {
18603
18605
  tag: "p",
18604
18606
  getAttrs: (node) => {
18605
- let extra = {};
18607
+ const { styleid, ...extraAttrs } = Array.from(node.attributes).reduce((acc, attr) => {
18608
+ acc[attr.name] = attr.value;
18609
+ return acc;
18610
+ }, {});
18611
+ return {
18612
+ styleId: styleid || null,
18613
+ extraAttrs
18614
+ };
18615
+ }
18616
+ },
18617
+ {
18618
+ tag: "div",
18619
+ getAttrs: (node) => {
18620
+ const extra = {};
18606
18621
  Array.from(node.attributes).forEach((attr) => {
18607
18622
  extra[attr.name] = attr.value;
18608
18623
  });
18609
18624
  return { extraAttrs: extra };
18610
18625
  }
18611
18626
  },
18627
+ {
18628
+ tag: "blockquote",
18629
+ attrs: { styleId: "BlockQuote" }
18630
+ },
18612
18631
  ...this.options.headingLevels.map((level) => ({
18613
18632
  tag: `h${level}`,
18614
18633
  attrs: { level, styleId: `Heading${level}` }
@@ -24994,7 +25013,9 @@ class AutoPageNumberNodeView {
24994
25013
  this.dom = __privateMethod(this, _AutoPageNumberNodeView_instances, renderDom_fn).call(this, node, htmlAttributes);
24995
25014
  }
24996
25015
  update(node) {
24997
- if (node.type !== this.node.type) return false;
25016
+ const incomingType = node?.type?.name;
25017
+ const currentType = this.node?.type?.name;
25018
+ if (!incomingType || incomingType !== currentType) return false;
24998
25019
  this.node = node;
24999
25020
  return true;
25000
25021
  }
@@ -25341,18 +25362,24 @@ const StructuredContent = Node$1.create({
25341
25362
  }
25342
25363
  };
25343
25364
  },
25344
- parseDOM() {
25345
- return [{ tag: `span.${this.options.structuredContentClass}` }];
25346
- },
25347
- renderDOM({ htmlAttributes }) {
25348
- return ["span", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
25349
- },
25350
25365
  addAttributes() {
25351
25366
  return {
25352
25367
  sdtPr: {
25353
25368
  rendered: false
25354
25369
  }
25355
25370
  };
25371
+ },
25372
+ parseDOM() {
25373
+ return [{ tag: `span.${this.options.structuredContentClass}` }];
25374
+ },
25375
+ renderDOM({ htmlAttributes }) {
25376
+ return [
25377
+ "span",
25378
+ Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes, {
25379
+ class: this.options.structuredContentClass
25380
+ }),
25381
+ 0
25382
+ ];
25356
25383
  }
25357
25384
  });
25358
25385
  const StructuredContentBlock = Node$1.create({
@@ -25361,24 +25388,30 @@ const StructuredContentBlock = Node$1.create({
25361
25388
  content: "block*",
25362
25389
  addOptions() {
25363
25390
  return {
25364
- structuredContentClass: "sd-structured-content-tag",
25391
+ structuredContentClass: "sd-structured-content-block-tag",
25365
25392
  htmlAttributes: {
25366
25393
  "aria-label": "Structured content block node"
25367
25394
  }
25368
25395
  };
25369
25396
  },
25370
- parseDOM() {
25371
- return [{ tag: `div.${this.options.structuredContentClass}` }];
25372
- },
25373
- renderDOM({ htmlAttributes }) {
25374
- return ["div", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
25375
- },
25376
25397
  addAttributes() {
25377
25398
  return {
25378
25399
  sdtPr: {
25379
25400
  rendered: false
25380
25401
  }
25381
25402
  };
25403
+ },
25404
+ parseDOM() {
25405
+ return [{ tag: `div.${this.options.structuredContentClass}` }];
25406
+ },
25407
+ renderDOM({ htmlAttributes }) {
25408
+ return [
25409
+ "div",
25410
+ Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes, {
25411
+ class: this.options.structuredContentClass
25412
+ }),
25413
+ 0
25414
+ ];
25382
25415
  }
25383
25416
  });
25384
25417
  class DocumentSectionView {
@@ -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-BFq1XXek.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-BdLd21gy.js";
2
+ import { p as process$1 } from "./converter-D7JstO1X.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-C3cafdFa.js";
4
4
  const sanitizeNumber = (value, defaultNumber) => {
5
5
  let sanitized = value.replace(/[^0-9.]/g, "");
6
6
  sanitized = parseFloat(sanitized);
@@ -1,4 +1,4 @@
1
- import { a5 } from "./chunks/converter-BFq1XXek.js";
1
+ import { a5 } from "./chunks/converter-D7JstO1X.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-BFq1XXek.js";
2
- import { D } from "./chunks/docx-zipper-BahUy6FS.js";
1
+ import "./chunks/converter-D7JstO1X.js";
2
+ import { D } from "./chunks/docx-zipper-CxuVkw7R.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-BdLd21gy.js";
2
- import "./chunks/converter-BFq1XXek.js";
3
- import "./chunks/docx-zipper-BahUy6FS.js";
1
+ import { E } from "./chunks/editor-C3cafdFa.js";
2
+ import "./chunks/converter-D7JstO1X.js";
3
+ import "./chunks/docx-zipper-CxuVkw7R.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BahUy6FS.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-CxuVkw7R.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -406,6 +406,8 @@ export class Editor extends EventEmitter {
406
406
  getJSON(): any;
407
407
  /**
408
408
  * Get the editor content as HTML
409
+ * @param {Object} options - Options for the HTML serializer
410
+ * @param {boolean} [options.unflattenLists] - Whether to unflatten lists in the HTML
409
411
  * @returns {string} Editor content as HTML
410
412
  */
411
413
  getHTML({ unflattenLists }?: {
@@ -44,6 +44,15 @@ export function exportSchemaToJson(params: ExportParams): XmlReadyNode;
44
44
  * @returns {XmlReadyNode} JSON of the XML-ready paragraph node
45
45
  */
46
46
  export function translateParagraphNode(params: any): XmlReadyNode;
47
+ /**
48
+ * Helper function to be used for text node translation
49
+ * Also used for transforming text annotations for the final submit
50
+ *
51
+ * @param {String} text Text node's content
52
+ * @param {Object[]} marks The marks to add to the run properties
53
+ * @returns {XmlReadyNode} The translated text node
54
+ */
55
+ export function getTextNodeForExport(text: string, marks: any[], params: any): XmlReadyNode;
47
56
  /**
48
57
  * Generate a w:rPr node (run properties) from marks
49
58
  *
@@ -61,6 +70,16 @@ export function generateRunProps(marks?: any[]): {
61
70
  * @returns
62
71
  */
63
72
  export function processOutputMarks(marks?: MarkType[]): any[];
73
+ export function processLinkContentNode(node: any): any;
74
+ /**
75
+ * Create a new link relationship and add it to the relationships array
76
+ *
77
+ * @param {ExportParams} params
78
+ * @param {string} link The URL of this link
79
+ * @returns {string} The new relationship ID
80
+ */
81
+ export function addNewLinkRelationship(params: ExportParams, link: string): string;
82
+ export function translateImageNode(params: any, imageSize: any): any;
64
83
  export function translateHardBreak(params: any): {
65
84
  name: string;
66
85
  elements: {
@@ -77,7 +96,6 @@ export class DocxExporter {
77
96
  schemaToXml(data: any, debug?: boolean): string;
78
97
  #private;
79
98
  }
80
- export function getFieldHighlightJson(fieldsHighlightColor: string): any;
81
99
  export type ExportParams = {
82
100
  /**
83
101
  * JSON node to translate (from PM schema)
@@ -1,2 +1 @@
1
- export * from "./documentSectionExporter.js";
2
1
  export * from "./commentsExporter.js";
@@ -0,0 +1,8 @@
1
+ export function handleSdtNode(params: any): {
2
+ nodes: any[];
3
+ consumed: number;
4
+ };
5
+ /**
6
+ * @type {Object}
7
+ */
8
+ export const sdtNodeHandlerEntity: any;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @param {Object} params
3
+ * @returns {Object|null}
4
+ */
5
+ export function handleAnnotationNode(params: any): any | null;
6
+ export function getAttrsFromElements({ sdtPr, tag, alias }: {
7
+ sdtPr: any;
8
+ tag: any;
9
+ alias: any;
10
+ }): {
11
+ type: any;
12
+ fieldId: any;
13
+ displayLabel: any;
14
+ fieldType: any;
15
+ fieldColor: any;
16
+ multipleImage: boolean;
17
+ fontFamily: any;
18
+ fontSize: any;
19
+ textColor: any;
20
+ textHighlight: any;
21
+ };
22
+ export function parseAnnotationMarks(content?: any): any;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param {Object} params
3
+ * @returns {Array|null}
4
+ */
5
+ export function handleDocPartObj(params: any): any[] | null;
6
+ export function tableOfContentsHandler(params: any): any;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Handle document section node. Special case of w:sdt nodes
3
+ * @param {Object} params - The parameters containing nodes and nodeListHandler
4
+ * @returns {Object|null} An object containing the processed node and consumed count
5
+ */
6
+ export function handleDocumentSectionNode(params: any): any | null;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param {Object} params
3
+ * @returns {Object|null}
4
+ */
5
+ export function handleStructuredContentNode(params: any): any | null;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param {string} json
3
+ * @returns {Object}
4
+ */
5
+ export function parseTagValueJSON(json: string): any;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * There are multiple types of w:sdt nodes.
3
+ * We need to route to the correct handler depending on certain properties.
4
+ * Example: If tag has documentSection type, we handle it as a document section node.
5
+ * If it has structuredContent type, we handle it as a structured content node.
6
+ * @param {Object} node
7
+ * @returns {Object}
8
+ */
9
+ export function sdtNodeTypeStrategy(node: any): any;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Translate a structured content block 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 translateDocumentSection(params: any): any;
7
+ export function generateSdtPrTagForDocumentSection(id: string, title: string, tag: string): any;
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Translate a field annotation node
3
+ * @param {Object} params - The parameters for translation.
4
+ * @returns {Object} The XML representation.
5
+ */
6
+ export function translateFieldAnnotation(params: any): any;
7
+ /**
8
+ * Returns node handler based on annotation type
9
+ *
10
+ * @param {String} annotationType
11
+ * @returns {Function} handler for provided annotation type
12
+ */
13
+ export function getTranslationByAnnotationType(annotationType: string, annotationFieldType: any): Function;
14
+ /**
15
+ * Translates text annotations
16
+ * @param {Object} params
17
+ * @returns {Object}
18
+ */
19
+ export function prepareTextAnnotation(params: any): any;
20
+ /**
21
+ * Translates image annotations
22
+ * @param {Object} params
23
+ * @param {Object} imageSize Object contains width and height for image in EMU
24
+ * @returns {Object} The translated image node
25
+ */
26
+ export function prepareImageAnnotation(params: any, imageSize: any): any;
27
+ /**
28
+ * Translates checkbox annotations
29
+ * @param {Object} params
30
+ * @returns {Object} The translated checkbox node
31
+ */
32
+ export function prepareCheckboxAnnotation(params: any): any;
33
+ /**
34
+ * Translates html annotations
35
+ * @param {Object} params
36
+ * @returns {Object} The translated html node
37
+ */
38
+ export function prepareHtmlAnnotation(params: any): any;
39
+ /**
40
+ * Translates URL annotations
41
+ * @param {Object} params
42
+ * @returns {Object} The translated URL node
43
+ */
44
+ export function prepareUrlAnnotation(params: any): any;
45
+ export function translateFieldAttrsToMarks(attrs?: {}): ({
46
+ type: string;
47
+ attrs: {
48
+ fontFamily: any;
49
+ fontSize?: undefined;
50
+ color?: undefined;
51
+ };
52
+ } | {
53
+ type: string;
54
+ attrs: {
55
+ fontSize: any;
56
+ fontFamily?: undefined;
57
+ color?: undefined;
58
+ };
59
+ } | {
60
+ type: string;
61
+ attrs: {
62
+ fontFamily?: undefined;
63
+ fontSize?: undefined;
64
+ color?: undefined;
65
+ };
66
+ } | {
67
+ type: string;
68
+ attrs: {
69
+ color: any;
70
+ fontFamily?: undefined;
71
+ fontSize?: undefined;
72
+ };
73
+ })[];
74
+ export function applyMarksToHtmlAnnotation(state: any, marks: any): any;
75
+ /**
76
+ * Get the JSON representation of the field highlight
77
+ * @param {string} fieldsHighlightColor - The highlight color for the field. Must be valid HEX.
78
+ * @returns {Object} The JSON representation of the field highlight
79
+ */
80
+ export function getFieldHighlightJson(fieldsHighlightColor: string): any;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param {Object} params - The parameters for translation.
3
+ * @returns {Object} The XML representation.
4
+ */
5
+ export function translateStructuredContent(params: any): any;
@@ -0,0 +1 @@
1
+ export * from "./sdt-translator";
@@ -0,0 +1,6 @@
1
+ /** @type {import('@translator').NodeTranslatorConfig} */
2
+ export const config: import("@translator").NodeTranslatorConfig;
3
+ /**
4
+ * @type {import('@translator').NodeTranslator}
5
+ */
6
+ export const translator: import("@translator").NodeTranslator;
@@ -10,7 +10,7 @@ export const TranslatorTypes: Readonly<{
10
10
  * @typedef {keyof typeof TranslatorTypes} TranslatorTypeKey
11
11
  * @typedef {typeof TranslatorTypes[TranslatorTypeKey]} TranslatorType
12
12
  * @typedef {string} XmlNodeName
13
- * @typedef {string} SuperDocNodeOrKeyName
13
+ * @typedef {string|string[]} SuperDocNodeOrKeyName
14
14
  */
15
15
  /**
16
16
  * @typedef {Object} AttrConfig
@@ -46,7 +46,7 @@ export const TranslatorTypes: Readonly<{
46
46
  /**
47
47
  * @typedef {Object} NodeTranslatorConfig
48
48
  * @property {string} xmlName - The name of the node in OOXML
49
- * @property {string} sdNodeOrKeyName - The name of the node in SuperDoc
49
+ * @property {SuperDocNodeOrKeyName} sdNodeOrKeyName - The name of the node in SuperDoc
50
50
  * @property {TranslatorType} [type="node"] - The type of the translator.
51
51
  * @property {NodeTranslatorEncodeFn} encode - The function to encode the data.
52
52
  * @property {NodeTranslatorDecodeFn} [decode] - The function to decode the data.
@@ -66,7 +66,7 @@ export class NodeTranslator {
66
66
  static from(config: NodeTranslatorConfig): NodeTranslator;
67
67
  /**
68
68
  * @param {string} xmlName
69
- * @param {string} sdNodeOrKeyName
69
+ * @param {SuperDocNodeOrKeyName} sdNodeOrKeyName
70
70
  * @param {NodeTranslatorEncodeFn} encode
71
71
  * @param {NodeTranslatorDecodeFn} decode
72
72
  * @param {number} [priority]
@@ -74,11 +74,11 @@ export class NodeTranslator {
74
74
  * @param {MatchesDecodeFn} [matchesDecode]
75
75
  * @param {AttrConfig[]} [attributes]
76
76
  */
77
- constructor(xmlName: string, sdNodeOrKeyName: string, encode: NodeTranslatorEncodeFn, decode: NodeTranslatorDecodeFn, priority?: number, matchesEncode?: MatchesEncodeFn, matchesDecode?: MatchesDecodeFn, attributes?: AttrConfig[]);
77
+ constructor(xmlName: string, sdNodeOrKeyName: SuperDocNodeOrKeyName, encode: NodeTranslatorEncodeFn, decode: NodeTranslatorDecodeFn, priority?: number, matchesEncode?: MatchesEncodeFn, matchesDecode?: MatchesDecodeFn, attributes?: AttrConfig[]);
78
78
  /** @type {string} */
79
79
  xmlName: string;
80
- /** @type {string} */
81
- sdNodeOrKeyName: string;
80
+ /** @type {SuperDocNodeOrKeyName} */
81
+ sdNodeOrKeyName: SuperDocNodeOrKeyName;
82
82
  /** @type {number} */
83
83
  priority: number;
84
84
  /** @type {NodeTranslatorEncodeFn} */
@@ -124,7 +124,7 @@ export class NodeTranslator {
124
124
  export type TranslatorTypeKey = keyof typeof TranslatorTypes;
125
125
  export type TranslatorType = (typeof TranslatorTypes)[TranslatorTypeKey];
126
126
  export type XmlNodeName = string;
127
- export type SuperDocNodeOrKeyName = string;
127
+ export type SuperDocNodeOrKeyName = string | string[];
128
128
  export type AttrConfig = {
129
129
  /**
130
130
  * - The name of the attribute in OOXML
@@ -173,7 +173,7 @@ export type NodeTranslatorConfig = {
173
173
  /**
174
174
  * - The name of the node in SuperDoc
175
175
  */
176
- sdNodeOrKeyName: string;
176
+ sdNodeOrKeyName: SuperDocNodeOrKeyName;
177
177
  /**
178
178
  * - The type of the translator.
179
179
  */
@@ -9,14 +9,14 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
11
11
  var _SuperToolbar_instances, initToolbarGroups_fn, _interceptedCommands, makeToolbarItems_fn, initDefaultFonts_fn, updateHighlightColors_fn, deactivateAll_fn, updateToolbarHistory_fn, runCommandWithArgumentOnly_fn;
12
- import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, ar as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as translator, aG as translator$1, aH as translator$2, a as Plugin } from "./chunks/converter-BFq1XXek.js";
13
- import { aI, a5, i, a2 } from "./chunks/converter-BFq1XXek.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-BdLd21gy.js";
15
- import { k, C, l, T, i as i2, m, j } from "./chunks/editor-BdLd21gy.js";
12
+ import { ax as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aA as vClickOutside, H as findParentNode, aB as getActiveFormatting, ar as isInTable, aC as readFromClipboard, aD as handleClipboardPaste, aE as getFileObject, aF as translator, aG as translator$1, aH as translator$2, a as Plugin } from "./chunks/converter-D7JstO1X.js";
13
+ import { aI, a5, i, a2 } from "./chunks/converter-D7JstO1X.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, y as yUndoPluginKey, d as undoDepth, r as redoDepth, S as SlashMenuPluginKey, E as Editor, e as getStarterExtensions, P as Placeholder, f as getRichTextExtensions, M as Mark, h as Extension, A as Attribute, N as Node } from "./chunks/editor-C3cafdFa.js";
15
+ import { k, C, l, T, i as i2, m, j } from "./chunks/editor-C3cafdFa.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, toDisplayString, createCommentVNode, normalizeStyle, computed, watch, withDirectives, withKeys, vModelText, createTextVNode, createVNode, h, createApp, markRaw, nextTick, onBeforeUnmount, reactive, onUnmounted, renderSlot, shallowRef, createBlock, withCtx, resolveDynamicComponent, normalizeProps, guardReactiveProps } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-DoJY1zlM.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, p as plusIconSvg, a as trashIconSvg, l as linkIconSvg, b as tableIconSvg, c as scissorsIconSvg, d as copyIconSvg, e as pasteIconSvg, f as borderNoneIconSvg, g as arrowsToDotIconSvg, h as arrowsLeftRightIconSvg, w as wrenchIconSvg, u as useMessage, N as NSkeleton } from "./chunks/toolbar-BSez2SLg.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-BahUy6FS.js";
19
+ import { D } from "./chunks/docx-zipper-CxuVkw7R.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-DoJY1zlM.js";
3
- import "./chunks/editor-BdLd21gy.js";
2
+ import { T } from "./chunks/toolbar-BSez2SLg.js";
3
+ import "./chunks/editor-C3cafdFa.js";
4
4
  export {
5
5
  T as default
6
6
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-bu-RKSWh.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-BxWpMXrO.cjs");
4
4
  require("./chunks/vue-DWle4Cai.cjs");
5
5
  exports.AIWriter = superEditor_es.AIWriter;
6
6
  exports.AnnotatorHelpers = superEditor_es.AnnotatorHelpers;
@@ -1,4 +1,4 @@
1
- import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-BRBU19lM.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, f, g, T, h, i, j, k, l, m, n, o, p, r, q } from "./chunks/super-editor.es-ZzKFiBVd.es.js";
2
2
  import "./chunks/vue-CXxsqYcP.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./chunks/super-editor.es-bu-RKSWh.cjs");
4
- const superdoc = require("./chunks/index-DHyh73q4.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-BxWpMXrO.cjs");
4
+ const superdoc = require("./chunks/index-Dic-WukZ.cjs");
5
5
  require("./chunks/vue-DWle4Cai.cjs");
6
6
  require("./chunks/jszip-b7l8QkfH.cjs");
7
7
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -1,5 +1,5 @@
1
- import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-BRBU19lM.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-CeockUQz.es.js";
1
+ import { a, E, b, S, d, i, j, n, r, p, q } from "./chunks/super-editor.es-ZzKFiBVd.es.js";
2
+ import { D, H, P, S as S2, m, l } from "./chunks/index-BfPgSGCT.es.js";
3
3
  import "./chunks/vue-CXxsqYcP.es.js";
4
4
  import "./chunks/jszip-B8KIZSNe.es.js";
5
5
  import { B } from "./chunks/blank-docx-iwdyG9RH.es.js";