@harbour-enterprises/superdoc 0.20.0-next.8 → 0.20.0

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 (126) hide show
  1. package/dist/chunks/{PdfViewer-Ch0v9vA6.cjs → PdfViewer--8KwZWwP.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BoDHZ2nW.es.js → PdfViewer-SpPk10jl.es.js} +1 -1
  3. package/dist/chunks/{index-BWPWqVxp.es.js → index-BjLjS5O9.es.js} +3 -3
  4. package/dist/chunks/{index-DFOT300M.cjs → index-yRUOdLmp.cjs} +3 -3
  5. package/dist/chunks/{super-editor.es-BQ6kZTNg.cjs → super-editor.es-CuNhawtn.cjs} +1937 -3044
  6. package/dist/chunks/{super-editor.es-sBfWb5tn.es.js → super-editor.es-D24_Ox1u.es.js} +1937 -3044
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/style.css +0 -38
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-C91Sr_5w.js → converter-Cg4SgA5y.js} +1132 -1616
  11. package/dist/super-editor/chunks/{docx-zipper-Cl7LYpt6.js → docx-zipper-CDX2fnxb.js} +2 -2
  12. package/dist/super-editor/chunks/{editor-a7cQT9Dw.js → editor-MKuu81v8.js} +638 -1250
  13. package/dist/super-editor/chunks/{toolbar-DiNFtCKr.js → toolbar-CpQ7L2K-.js} +2 -2
  14. package/dist/super-editor/converter.es.js +1 -1
  15. package/dist/super-editor/docx-zipper.es.js +2 -2
  16. package/dist/super-editor/editor.es.js +3 -3
  17. package/dist/super-editor/file-zipper.es.js +1 -1
  18. package/dist/super-editor/src/core/helpers/index.d.ts +0 -1
  19. package/dist/super-editor/src/core/super-converter/exporter.d.ts +1 -7
  20. package/dist/super-editor/src/core/super-converter/v2/importer/imageImporter.d.ts +1 -0
  21. package/dist/super-editor/src/core/super-converter/v2/importer/tableImporter.d.ts +22 -0
  22. package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +0 -2
  23. package/dist/super-editor/src/core/super-converter/v3/handlers/utils.d.ts +3 -10
  24. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/w-p-helpers.d.ts +1 -1
  25. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tc/helpers/legacy-handle-table-cell-node.d.ts +1 -1
  26. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +1 -11
  27. package/dist/super-editor/src/extensions/image/imageHelpers/imagePlaceholderPlugin.d.ts +5 -0
  28. package/dist/super-editor/src/extensions/image/imageHelpers/index.d.ts +1 -2
  29. package/dist/super-editor/src/extensions/image/imageHelpers/processUploadedImage.d.ts +2 -2
  30. package/dist/super-editor/src/extensions/image/imageHelpers/startImageUpload.d.ts +23 -18
  31. package/dist/super-editor/src/extensions/structured-content/structured-content-block.d.ts +1 -3
  32. package/dist/super-editor/src/extensions/structured-content/structured-content.d.ts +1 -3
  33. package/dist/super-editor/src/extensions/table/table.d.ts +0 -330
  34. package/dist/super-editor/style.css +0 -38
  35. package/dist/super-editor/super-editor.es.js +55 -65
  36. package/dist/super-editor/toolbar.es.js +2 -2
  37. package/dist/super-editor.cjs +1 -1
  38. package/dist/super-editor.es.js +1 -1
  39. package/dist/superdoc.cjs +2 -2
  40. package/dist/superdoc.es.js +2 -2
  41. package/dist/superdoc.umd.js +2566 -3673
  42. package/dist/superdoc.umd.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/super-editor/src/core/helpers/updateDOMAttributes.d.ts +0 -1
  45. package/dist/super-editor/src/core/super-converter/export-helpers/pre-process-vertical-merge-cells.d.ts +0 -6
  46. package/dist/super-editor/src/core/super-converter/helpers/mediaHelpers.d.ts +0 -2
  47. package/dist/super-editor/src/core/super-converter/v3/handlers/w/bidiVisual/bidiVisual-translator.d.ts +0 -6
  48. package/dist/super-editor/src/core/super-converter/v3/handlers/w/bidiVisual/index.d.ts +0 -1
  49. package/dist/super-editor/src/core/super-converter/v3/handlers/w/bottom/bottom-translator.d.ts +0 -6
  50. package/dist/super-editor/src/core/super-converter/v3/handlers/w/bottom/index.d.ts +0 -2
  51. package/dist/super-editor/src/core/super-converter/v3/handlers/w/bottom/marginBottom-translator.d.ts +0 -6
  52. package/dist/super-editor/src/core/super-converter/v3/handlers/w/drawing/drawing-translator.d.ts +0 -6
  53. package/dist/super-editor/src/core/super-converter/v3/handlers/w/drawing/index.d.ts +0 -1
  54. package/dist/super-editor/src/core/super-converter/v3/handlers/w/end/end-translator.d.ts +0 -6
  55. package/dist/super-editor/src/core/super-converter/v3/handlers/w/end/index.d.ts +0 -2
  56. package/dist/super-editor/src/core/super-converter/v3/handlers/w/end/marginEnd-translator.d.ts +0 -6
  57. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridCol/gridCol-translator.d.ts +0 -6
  58. package/dist/super-editor/src/core/super-converter/v3/handlers/w/gridCol/index.d.ts +0 -1
  59. package/dist/super-editor/src/core/super-converter/v3/handlers/w/insideH/index.d.ts +0 -1
  60. package/dist/super-editor/src/core/super-converter/v3/handlers/w/insideH/insideH-translator.d.ts +0 -6
  61. package/dist/super-editor/src/core/super-converter/v3/handlers/w/insideV/index.d.ts +0 -1
  62. package/dist/super-editor/src/core/super-converter/v3/handlers/w/insideV/insideV-translator.d.ts +0 -6
  63. package/dist/super-editor/src/core/super-converter/v3/handlers/w/left/index.d.ts +0 -2
  64. package/dist/super-editor/src/core/super-converter/v3/handlers/w/left/left-translator.d.ts +0 -6
  65. package/dist/super-editor/src/core/super-converter/v3/handlers/w/left/marginLeft-translator.d.ts +0 -6
  66. package/dist/super-editor/src/core/super-converter/v3/handlers/w/right/index.d.ts +0 -2
  67. package/dist/super-editor/src/core/super-converter/v3/handlers/w/right/marginRight-translator.d.ts +0 -6
  68. package/dist/super-editor/src/core/super-converter/v3/handlers/w/right/right-translator.d.ts +0 -6
  69. package/dist/super-editor/src/core/super-converter/v3/handlers/w/shd/index.d.ts +0 -1
  70. package/dist/super-editor/src/core/super-converter/v3/handlers/w/shd/shd-translator.d.ts +0 -6
  71. package/dist/super-editor/src/core/super-converter/v3/handlers/w/start/index.d.ts +0 -2
  72. package/dist/super-editor/src/core/super-converter/v3/handlers/w/start/marginStart-translator.d.ts +0 -6
  73. package/dist/super-editor/src/core/super-converter/v3/handlers/w/start/start-translator.d.ts +0 -6
  74. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tbl/index.d.ts +0 -1
  75. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tbl/tbl-translator.d.ts +0 -28
  76. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblBorders/index.d.ts +0 -1
  77. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblBorders/tblBorders-translator.d.ts +0 -6
  78. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCaption/index.d.ts +0 -1
  79. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCaption/tblCaption-translator.d.ts +0 -6
  80. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellMar/index.d.ts +0 -1
  81. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblCellMar/tblCellMar-translator.d.ts +0 -2
  82. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblDescription/index.d.ts +0 -1
  83. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblDescription/tblDescription-translator.d.ts +0 -6
  84. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblGrid/index.d.ts +0 -1
  85. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblGrid/tblGrid-helpers.d.ts +0 -5
  86. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblGrid/tblGrid-translator.d.ts +0 -5
  87. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblInd/index.d.ts +0 -1
  88. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblInd/tblInd-translator.d.ts +0 -6
  89. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblLayout/index.d.ts +0 -1
  90. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblLayout/tblLayout-translator.d.ts +0 -6
  91. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblLook/index.d.ts +0 -1
  92. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblLook/tblLook-translator.d.ts +0 -6
  93. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblOverlap/index.d.ts +0 -1
  94. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblOverlap/tblOverlap-translator.d.ts +0 -6
  95. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblPr/index.d.ts +0 -1
  96. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblPr/tblPr-translator.d.ts +0 -5
  97. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblStyle/index.d.ts +0 -1
  98. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblStyle/tblStyle-translator.d.ts +0 -6
  99. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblStyleColBandSize/index.d.ts +0 -1
  100. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblStyleColBandSize/tblStyleColBandSize-translator.d.ts +0 -6
  101. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblStyleRowBandSize/index.d.ts +0 -1
  102. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblStyleRowBandSize/tblStyleRowBandSize-translator.d.ts +0 -6
  103. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblW/index.d.ts +0 -1
  104. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblW/tblW-translator.d.ts +0 -6
  105. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblpPr/index.d.ts +0 -1
  106. package/dist/super-editor/src/core/super-converter/v3/handlers/w/tblpPr/tblpPr-translator.d.ts +0 -6
  107. package/dist/super-editor/src/core/super-converter/v3/handlers/w/top/index.d.ts +0 -2
  108. package/dist/super-editor/src/core/super-converter/v3/handlers/w/top/marginTop-translator.d.ts +0 -6
  109. package/dist/super-editor/src/core/super-converter/v3/handlers/w/top/top-translator.d.ts +0 -6
  110. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/anchor-translator.d.ts +0 -6
  111. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/helpers/handle-anchor-node.d.ts +0 -6
  112. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/helpers/translate-anchor-node.d.ts +0 -6
  113. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/index.d.ts +0 -1
  114. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/helpers/decode-image-node-helpers.d.ts +0 -18
  115. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/helpers/encode-image-node-helpers.d.ts +0 -6
  116. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/helpers/handle-inline-node.d.ts +0 -6
  117. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/helpers/translate-inline-node.d.ts +0 -6
  118. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/index.d.ts +0 -1
  119. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/inline-translator.d.ts +0 -6
  120. package/dist/super-editor/src/extensions/image/imageHelpers/fileNameUtils.d.ts +0 -3
  121. package/dist/super-editor/src/extensions/image/imageHelpers/handleBase64.d.ts +0 -1
  122. package/dist/super-editor/src/extensions/image/imageHelpers/handleUrl.d.ts +0 -2
  123. package/dist/super-editor/src/extensions/image/imageHelpers/imageRegistrationPlugin.d.ts +0 -11
  124. package/dist/super-editor/src/extensions/structured-content/StructuredContentBlockView.d.ts +0 -9
  125. package/dist/super-editor/src/extensions/structured-content/StructuredContentInlineView.d.ts +0 -9
  126. package/dist/super-editor/src/extensions/structured-content/StructuredContentViewBase.d.ts +0 -24
@@ -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-C91Sr_5w.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-a7cQT9Dw.js";
2
+ import { p as process$1 } from "./converter-Cg4SgA5y.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-MKuu81v8.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-C91Sr_5w.js";
1
+ import { a5 } from "./chunks/converter-Cg4SgA5y.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-C91Sr_5w.js";
2
- import { D } from "./chunks/docx-zipper-Cl7LYpt6.js";
1
+ import "./chunks/converter-Cg4SgA5y.js";
2
+ import { D } from "./chunks/docx-zipper-CDX2fnxb.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-a7cQT9Dw.js";
2
- import "./chunks/converter-C91Sr_5w.js";
3
- import "./chunks/docx-zipper-Cl7LYpt6.js";
1
+ import { E } from "./chunks/editor-MKuu81v8.js";
2
+ import "./chunks/converter-Cg4SgA5y.js";
3
+ import "./chunks/docx-zipper-CDX2fnxb.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-Cl7LYpt6.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-CDX2fnxb.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -27,4 +27,3 @@ export * from "./isInTable.js";
27
27
  export * from "./importHtml.js";
28
28
  export * from "./importMarkdown.js";
29
29
  export * from "./contentProcessor.js";
30
- export * from "./updateDOMAttributes.js";
@@ -53,13 +53,6 @@ export function translateParagraphNode(params: any): XmlReadyNode;
53
53
  * @returns {XmlReadyNode} The translated text node
54
54
  */
55
55
  export function getTextNodeForExport(text: string, marks: any[], params: any): XmlReadyNode;
56
- /**
57
- * Wrap a text node in a run
58
- *
59
- * @param {XmlReadyNode} node
60
- * @returns {XmlReadyNode} The wrapped run node
61
- */
62
- export function wrapTextInRun(nodeOrNodes: any, marks: any): XmlReadyNode;
63
56
  /**
64
57
  * Generate a w:rPr node (run properties) from marks
65
58
  *
@@ -86,6 +79,7 @@ export function processLinkContentNode(node: any): any;
86
79
  * @returns {string} The new relationship ID
87
80
  */
88
81
  export function addNewLinkRelationship(params: ExportParams, link: string): string;
82
+ export function translateImageNode(params: any, imageSize: any): any;
89
83
  export function translateHardBreak(params: any): {
90
84
  name: string;
91
85
  elements: {
@@ -1,3 +1,4 @@
1
+ export function handleImageImport(node: any, currentFileName: any, params: any): any;
1
2
  /**
2
3
  * @type {import("docxImporter").NodeHandler}
3
4
  */
@@ -1,3 +1,20 @@
1
+ /**
2
+ *
3
+ * @param {XmlNode} node
4
+ * @param {ParsedDocx} docx
5
+ * @param {NodeListHandler} nodeListHandler
6
+ * @param {boolean} insideTrackChange
7
+ * @returns {{type: string, content: *, attrs: {borders: *, tableWidth: *, tableWidthType: *}}}
8
+ */
9
+ export function handleTableNode(node: XmlNode, params: any): {
10
+ type: string;
11
+ content: any;
12
+ attrs: {
13
+ borders: any;
14
+ tableWidth: any;
15
+ tableWidthType: any;
16
+ };
17
+ };
1
18
  /**
2
19
  *
3
20
  * @param tblStyleTag
@@ -12,7 +29,12 @@ export function getReferencedTableStyles(tblStyleTag: any, docx: ParsedDocx): {
12
29
  rowBorders: {};
13
30
  basedOn: any;
14
31
  } | null;
32
+ /**
33
+ * @type {import("docxImporter").NodeHandler}
34
+ */
35
+ export const handleAllTableNodes: any;
15
36
  /**
16
37
  * @type {import("docxImporter").NodeHandlerEntry}
17
38
  */
18
39
  export const tableNodeHandlerEntity: any;
40
+ export function getGridColumnWidths(tableNode: any): any;
@@ -5,7 +5,5 @@ export const registeredHandlers: Readonly<{
5
5
  'w:br': import("../node-translator/node-translator.js").NodeTranslator;
6
6
  'w:tab': import("../node-translator/node-translator.js").NodeTranslator;
7
7
  'w:p': import("../node-translator/node-translator.js").NodeTranslator;
8
- 'wp:anchor': import("../node-translator/node-translator.js").NodeTranslator;
9
- 'wp:inline': import("../node-translator/node-translator.js").NodeTranslator;
10
8
  }>;
11
9
  export type RegisteredHandlers = any;
@@ -9,19 +9,12 @@
9
9
  */
10
10
  export function createSingleAttrPropertyHandler(xmlName: string, sdName?: string | null, attrName?: string, transformEncode?: Function, transformDecode?: Function): import("@translator").NodeTranslatorConfig;
11
11
  /**
12
- * Helper to create property handlers for measurement attributes (CT_TblWidth => w:w and w:type)
12
+ * Helper to create property handlers for measurement attributes (w:w and w:type)
13
13
  * @param {string} xmlName The XML attribute name (with namespace).
14
14
  * @param {string|null} sdName The SuperDoc attribute name (without namespace). If null, it will be derived from xmlName.
15
15
  * @returns {import('@translator').NodeTranslatorConfig} The attribute handler config with xmlName, sdName, encode, and decode functions.
16
16
  */
17
17
  export function createMeasurementPropertyHandler(xmlName: string, sdName?: string | null): import("@translator").NodeTranslatorConfig;
18
- /**
19
- * Helper to create property handlers for border attributes (CT_Border xml type)
20
- * @param {string} [xmlName] The XML element name (with namespace).
21
- * @param {string|null} [sdName] The SuperDoc attribute name (without namespace). If null, it will be derived from xmlName.
22
- * @returns {import('@translator').NodeTranslatorConfig} The border property handler config with xmlName, sdName, encode, and decode functions.
23
- */
24
- export function createBorderPropertyHandler(xmlName?: string, sdName?: string | null): import("@translator").NodeTranslatorConfig;
25
18
  /**
26
19
  * Encodes properties of a node using provided translators and adds them to the attributes object.
27
20
  * @param {object} [node] The node containing elements to be encoded.
@@ -39,7 +32,7 @@ export function encodeProperties(node?: object, translatorsByXmlName?: object, a
39
32
  export function decodeProperties(translatorsBySdName?: object, properties?: object): any[];
40
33
  export function generateV2HandlerEntity(handlerName: string, translator: import("../node-translator/").NodeTranslator): import("../../v2/importer/docxImporter").NodeHandlerEntry;
41
34
  export function createAttributeHandler(xmlName?: string, sdName?: string | null, transformEncode?: any, transformDecode?: any): import("@translator").AttrConfig;
42
- export function parseBoolean(value: string): boolean | undefined;
43
- export function booleanToString(value: boolean): string | undefined;
35
+ export function parseBoolean(value: string): boolean;
36
+ export function booleanToString(value: boolean): string;
44
37
  export function parseInteger(value: any): number | undefined;
45
38
  export function integerToString(value: any): string | undefined;
@@ -1,6 +1,6 @@
1
1
  export function parseParagraphBorders(pBdr: any): {};
2
2
  export function getParagraphIndent(node: any, docx: any, styleId?: string): any;
3
- export function getParagraphSpacing(node: any, docx: any, styleId?: string, marks?: any[], options?: {}): any;
3
+ export function getParagraphSpacing(node: any, docx: any, styleId?: string, marks?: any[]): any;
4
4
  export function getDefaultParagraphStyle(docx: any, styleId?: string): any;
5
5
  export function preProcessNodesForFldChar(nodes?: any[]): any[];
6
6
  export function processCombinedNodesForFldChar(nodesToCombine?: any[]): any[];
@@ -2,7 +2,7 @@
2
2
  * @param {Object} options
3
3
  * @returns {{type: string, content: (*|*[]), attrs: {}}}
4
4
  */
5
- export function handleTableCellNode({ params, node, table, row, rowBorders, styleTag, columnIndex, columnWidth, allColumnWidths, }: any): {
5
+ export function handleTableCellNode({ params, node, table, row, rowBorders, styleTag, columnIndex, columnWidth, }: any): {
6
6
  type: string;
7
7
  content: (any | any[]);
8
8
  attrs: {};
@@ -21,14 +21,7 @@ export const TranslatorTypes: Readonly<{
21
21
  */
22
22
  /** @typedef {import('../../v2/importer/types').NodeHandlerParams} SCEncoderConfig */
23
23
  /** @typedef {import('../../v2/types').SuperDocNode} SCEncoderResult */
24
- /**
25
- * @typedef {Object} SCDecoderConfig
26
- * @property {{ attrs?: any, marks?: any[], type: string, content?: any[] }} node
27
- * @property {any[]} [children]
28
- * @property {any[]} [relationships]
29
- * @property {Record<string, any>} [extraParams]
30
- * @property {import('../../../Editor.js').Editor} [editor]
31
- */
24
+ /** @typedef {{ node: { attrs?: any, marks?: any[], type: string }, children?: any[], relationships?: any[] }} SCDecoderConfig */
32
25
  /** @typedef {{ name: string, attributes?: any, elements: any[] }} SCDecoderResult */
33
26
  /**
34
27
  * @callback NodeTranslatorEncodeFn
@@ -157,12 +150,9 @@ export type SCDecoderConfig = {
157
150
  attrs?: any;
158
151
  marks?: any[];
159
152
  type: string;
160
- content?: any[];
161
153
  };
162
154
  children?: any[];
163
155
  relationships?: any[];
164
- extraParams?: Record<string, any>;
165
- editor?: import("../../../Editor.js").Editor;
166
156
  };
167
157
  export type SCDecoderResult = {
168
158
  name: string;
@@ -0,0 +1,5 @@
1
+ export const ImagePlaceholderPluginKey: PluginKey<any>;
2
+ export function ImagePlaceholderPlugin(): Plugin;
3
+ export function findPlaceholder(state: any, id: string): number | null;
4
+ import { PluginKey } from 'prosemirror-state';
5
+ import { Plugin } from 'prosemirror-state';
@@ -1,7 +1,6 @@
1
1
  export * from "./getFileOpener.js";
2
2
  export * from "./startImageUpload.js";
3
3
  export * from "./handleImageUpload.js";
4
- export * from "./imageRegistrationPlugin.js";
4
+ export * from "./imagePlaceholderPlugin.js";
5
5
  export * from "./processUploadedImage.js";
6
6
  export * from "./imagePositionPlugin.js";
7
- export * from "./fileNameUtils.js";
@@ -1,2 +1,2 @@
1
- export function processUploadedImage(fileData: string | File, getMaxContentSize: Function): Promise<string | any>;
2
- export function getAllowedImageDimensions(width: number, height: number, getMaxContentSize: Function): any;
1
+ export function processUploadedImage(fileData: string | File, editor: any): Promise<string | any>;
2
+ export function getAllowedImageDimensions(width: number, height: number, editor: any): any;
@@ -1,22 +1,27 @@
1
- export function replaceSelectionWithImagePlaceholder({ editorOptions, view, id }: {
2
- editorOptions: any;
3
- view: any;
4
- id: any;
5
- }): void;
6
- export function uploadAndInsertImage({ editor, view, file, size, id }: {
1
+ /**
2
+ * Uploads an image and inserts it into the document
3
+ * @category Helper
4
+ * @param {Object} params - Upload parameters
5
+ * @param {Object} params.editor - Editor instance
6
+ * @param {Object} params.view - Editor view
7
+ * @param {File} params.file - Processed image file
8
+ * @param {Object} params.size - Image dimensions
9
+ * @param {Function} params.uploadHandler - Function to handle the upload
10
+ * @returns {Promise<void>}
11
+ * @example
12
+ * await uploadImage({ editor, view, file, size, uploadHandler });
13
+ * @note Shows placeholder during upload
14
+ * @note Handles collaboration mode image sharing
15
+ */
16
+ export function uploadImage({ editor, view, file, size, uploadHandler }: {
7
17
  editor: any;
8
18
  view: any;
9
- file: any;
19
+ file: File;
10
20
  size: any;
11
- id: any;
21
+ uploadHandler: Function;
22
+ }): Promise<void>;
23
+ export function startImageUpload({ editor, view, file }: {
24
+ editor: any;
25
+ view: any;
26
+ file: File;
12
27
  }): Promise<void>;
13
- export function checkAndProcessImage({ getMaxContentSize, file }: {
14
- getMaxContentSize: any;
15
- file: any;
16
- }): Promise<{
17
- file: any;
18
- size: {
19
- width: any;
20
- height: any;
21
- };
22
- }>;
@@ -1,4 +1,2 @@
1
- export const structuredContentClass: "sd-structured-content-block";
2
- export const structuredContentInnerClass: "sd-structured-content-block__content";
3
1
  export const StructuredContentBlock: Node;
4
- import { Node } from '@core/index';
2
+ import { Node } from '@core/index.js';
@@ -1,4 +1,2 @@
1
- export const structuredContentClass: "sd-structured-content";
2
- export const structuredContentInnerClass: "sd-structured-content__content";
3
1
  export const StructuredContent: Node;
4
- import { Node } from '@core/index';
2
+ import { Node } from '@core/index.js';
@@ -135,334 +135,4 @@ export type CurrentCellInfo = {
135
135
  */
136
136
  attrs: any;
137
137
  };
138
- /**
139
- * Theme color options
140
- */
141
- export type ThemeColor = "dark1" | "light1" | "dark2" | "light2" | "accent1" | "accent2" | "accent3" | "accent4" | "accent5" | "accent6" | "hyperlink" | "followedHyperlink" | "none" | "background1" | "text1" | "background2" | "text2";
142
- /**
143
- * Shading pattern options
144
- */
145
- export type ShadingPattern = "nil" | "clear" | "solid" | "horzStripe" | "vertStripe" | "reverseDiagStripe" | "diagStripe" | "horzCross" | "diagCross" | "thinHorzStripe" | "thinVertStripe" | "thinReverseDiagStripe" | "thinDiagStripe" | "thinHorzCross" | "thinDiagCross";
146
- /**
147
- * Shading properties
148
- */
149
- export type ShadingProperties = {
150
- /**
151
- * - Shading color (hex without # or "auto" for automatic)
152
- */
153
- color?: string | "auto";
154
- /**
155
- * - Shading fill color (hex without # or "auto" for automatic)
156
- */
157
- fill?: string | "auto";
158
- /**
159
- * - Theme color name
160
- */
161
- themeColor?: ThemeColor;
162
- /**
163
- * - Theme fill name
164
- */
165
- themeFill?: ThemeColor;
166
- /**
167
- * - Theme fill shade (0-255 in hex format without #)
168
- */
169
- themeFillShade?: string;
170
- /**
171
- * - Theme fill tint (0-255 in hex format without #)
172
- */
173
- themeFillTint?: string;
174
- /**
175
- * - Theme shade (0-255 in hex format without #)
176
- */
177
- themeShade?: string;
178
- /**
179
- * - Theme tint (0-255 in hex format without #)
180
- */
181
- themeTint?: string;
182
- /**
183
- * - Shading pattern
184
- */
185
- val?: ShadingPattern;
186
- };
187
- /**
188
- * Table width options
189
- */
190
- export type TableMeasurement = {
191
- /**
192
- * - Width value in twips
193
- */
194
- value: number;
195
- /**
196
- * - Table width type (dxa=twips, pct=percentage, auto=automatic)
197
- */
198
- type?: "dxa" | "pct" | "auto";
199
- };
200
- /**
201
- * Table look options
202
- */
203
- export type TableLook = {
204
- /**
205
- * - Specifies that the first column conditional formatting should be applied
206
- */
207
- firstColumn?: boolean;
208
- /**
209
- * - Specifies that the first row conditional formatting should be applied
210
- */
211
- firstRow?: boolean;
212
- /**
213
- * - Specifies that the last column conditional formatting should be applied
214
- */
215
- lastColumn?: boolean;
216
- /**
217
- * - Specifies that the last row conditional formatting should be applied
218
- */
219
- lastRow?: boolean;
220
- /**
221
- * - Specifies that no horizontal banding conditional formatting should be applied
222
- */
223
- noHBand?: boolean;
224
- /**
225
- * - Specifies that no vertical banding conditional formatting should be applied
226
- */
227
- noVBand?: boolean;
228
- };
229
- /**
230
- * Floating table properties
231
- */
232
- export type FloatingTableProperties = {
233
- /**
234
- * - Specifies the minimum distance in twips which shall be maintained between the current floating table and the edge of text in the paragraph which is to the left of this floating table.
235
- */
236
- leftFromText?: number;
237
- /**
238
- * - Specifies the minimum distance in twips which shall be maintained between the current floating table and the edge of text in the paragraph which is to the right of this floating table.
239
- */
240
- rightFromText?: number;
241
- /**
242
- * - Specifies the minimum distance in twips which shall be maintained between the current floating table and the bottom edge of text in the paragraph which is above this floating table.
243
- */
244
- topFromText?: number;
245
- /**
246
- * - Specifies the minimum distance in twips which shall be maintained between the current floating table and the top edge of text in the paragraph which is below this floating table.
247
- */
248
- bottomFromText?: number;
249
- /**
250
- * - Specifies and absolute horizontal position for the floating table. The position is measured from the horizontal anchor point (horzAnchor) in twips.
251
- */
252
- tblpX?: number;
253
- /**
254
- * - Specifies and absolute vertical position for the floating table. The position is measured from the vertical anchor point (vertAnchor) in twips.
255
- */
256
- tblpY?: number;
257
- /**
258
- * - Horizontal anchor point for tblpX
259
- */
260
- horzAnchor?: "margin" | "page" | "text";
261
- /**
262
- * - Vertical anchor point for tblpY
263
- */
264
- vertAnchor?: "margin" | "page" | "text";
265
- /**
266
- * - Specifies a relative horizontal position for the floating table. Supercedes tblpX if both are specified.
267
- */
268
- tblpXSpec?: "left" | "center" | "right" | "inside" | "outside";
269
- /**
270
- * - Specifies a relative vertical position for the floating table. Supercedes tblpY if both are specified.
271
- */
272
- tblpYSpec?: "inline" | "top" | "center" | "bottom" | "inside" | "outside";
273
- };
274
- /**
275
- * Table border specification
276
- */
277
- export type TableBorderSpec = {
278
- /**
279
- * - Border style (e.g., 'single', 'double', 'dashed', etc.)
280
- */
281
- val?: string;
282
- /**
283
- * - Border color (hex without #, e.g., 'FF0000' for red)
284
- */
285
- color?: string;
286
- /**
287
- * - Theme color name
288
- */
289
- themeColor?: ThemeColor;
290
- /**
291
- * - Theme tint (0-255 in hex format without #)
292
- */
293
- themeTint?: string;
294
- /**
295
- * - Theme shade (0-255 in hex format without #)
296
- */
297
- themeShade?: string;
298
- /**
299
- * - Border size in eighths of a point (e.g., 8 = 1pt, 16 = 2pt)
300
- */
301
- size?: number;
302
- /**
303
- * - Space in points between border and text
304
- */
305
- space?: number;
306
- /**
307
- * - Whether the border has a shadow
308
- */
309
- shadow?: boolean;
310
- /**
311
- * - Whether the border is a frame
312
- */
313
- frame?: boolean;
314
- };
315
- /**
316
- * Table borders properties
317
- */
318
- export type TableBorders = {
319
- /**
320
- * - Bottom border specification
321
- */
322
- bottom?: TableBorderSpec;
323
- /**
324
- * - End (right in LTR, left in RTL) border specification
325
- */
326
- end?: TableBorderSpec;
327
- /**
328
- * - Inside horizontal border specification
329
- */
330
- insideH?: TableBorderSpec;
331
- /**
332
- * - Inside vertical border specification
333
- */
334
- insideV?: TableBorderSpec;
335
- /**
336
- * - Left border specification
337
- */
338
- left?: TableBorderSpec;
339
- /**
340
- * - Right border specification
341
- */
342
- right?: TableBorderSpec;
343
- /**
344
- * - Start (left in LTR, right in RTL) border specification
345
- */
346
- start?: TableBorderSpec;
347
- /**
348
- * - Top border specification
349
- */
350
- top?: TableBorderSpec;
351
- };
352
- /**
353
- * Table cell margin properties
354
- */
355
- export type TableCellMargins = {
356
- /**
357
- * - Top cell margin
358
- */
359
- top?: TableMeasurement;
360
- /**
361
- * - Left cell margin
362
- */
363
- left?: TableMeasurement;
364
- /**
365
- * - Bottom cell margin
366
- */
367
- bottom?: TableMeasurement;
368
- /**
369
- * - Start cell margin (left in LTR, right in RTL)
370
- */
371
- start?: TableMeasurement;
372
- /**
373
- * - End cell margin (right in LTR, left in RTL)
374
- */
375
- end?: TableMeasurement;
376
- /**
377
- * - Right cell margin
378
- */
379
- right?: TableMeasurement;
380
- };
381
- /**
382
- * Table properties
383
- */
384
- export type TableProperties = {
385
- /**
386
- * - Specifies that the cells with this table shall be visually represented in a right to left direction
387
- */
388
- rightToLeft?: boolean;
389
- /**
390
- * - The alignment of the set of rows which are part of the current table.
391
- */
392
- justification?: "center" | "end" | "left" | "right" | "start";
393
- /**
394
- * - Shading properties for the table
395
- */
396
- shading?: ShadingProperties;
397
- /**
398
- * - Caption text for the table
399
- */
400
- caption?: string;
401
- /**
402
- * - Description text for the table
403
- */
404
- description?: string;
405
- /**
406
- * - Cell spacing
407
- */
408
- tableCellSpacing?: TableMeasurement;
409
- /**
410
- * - Table indentation
411
- */
412
- tableIndent?: TableMeasurement;
413
- /**
414
- * - Table layout algorithm
415
- */
416
- tableLayout?: "fixed" | "autofit";
417
- /**
418
- * - Various boolean flags that affect the rendering of the table
419
- */
420
- tableLook?: TableLook;
421
- /**
422
- * - Specifies whether the current table should allow other floating tables to overlap its extents when the tables are displayed in a document
423
- */
424
- overlap?: "never" | "overlap";
425
- /**
426
- * - Reference to table style ID
427
- */
428
- tableStyleId?: string;
429
- /**
430
- * - Number of columns for which the table style is applied
431
- */
432
- tableStyleColBandSize?: number;
433
- /**
434
- * - Number of rows for which the table style is applied
435
- */
436
- tableStyleRowBandSize?: number;
437
- /**
438
- * - Table width
439
- */
440
- tableWidth?: TableMeasurement;
441
- /**
442
- * - Floating table properties
443
- */
444
- floatingTableProperties?: FloatingTableProperties;
445
- /**
446
- * - Table border configuration
447
- */
448
- borders?: TableBorders;
449
- };
450
- /**
451
- * Column width definition
452
- */
453
- export type ColWidth = {
454
- /**
455
- * - Column width in twips
456
- */
457
- col: number;
458
- };
459
- /**
460
- * Table grid definition
461
- */
462
- export type TableGrid = {
463
- /**
464
- * - Array of column widths in twips
465
- */
466
- colWidths?: ColWidth[];
467
- };
468
138
  import { Node } from '@core/index.js';
@@ -1117,44 +1117,6 @@ on the right if it is inside shape textbox.
1117
1117
  white-space: nowrap;
1118
1118
  text-overflow: ellipsis;
1119
1119
  }
1120
- .sd-structured-content,
1121
- .sd-structured-content-block {
1122
- padding: 1px;
1123
- box-sizing: border-box;
1124
- border-radius: 4px;
1125
- border: 1px solid #629be7;
1126
- position: relative;
1127
- }
1128
- .sd-structured-content-draggable {
1129
- font-size: 10px;
1130
- align-items: center;
1131
- justify-content: center;
1132
- position: absolute;
1133
- left: 2px;
1134
- bottom: 100%;
1135
- width: calc(100% - 4px);
1136
- max-width: 110px;
1137
- min-width: 0;
1138
- height: 18px;
1139
- padding: 0 4px;
1140
- border: 1px solid #629be7;
1141
- border-bottom: none;
1142
- border-radius: 6px 6px 0 0;
1143
- background-color: #629be733;
1144
- z-index: 10;
1145
- cursor: grab;
1146
- display: none;
1147
- }
1148
- .sd-structured-content-draggable span {
1149
- max-width: 100%;
1150
- overflow: hidden;
1151
- white-space: nowrap;
1152
- text-overflow: ellipsis;
1153
- }
1154
- .sd-structured-content:hover .sd-structured-content-draggable,
1155
- .sd-structured-content-block:hover .sd-structured-content-draggable {
1156
- display: inline-flex;
1157
- }
1158
1120
 
1159
1121
  .alignment-buttons[data-v-d84f57b6] {
1160
1122
  display: flex;