@harbour-enterprises/superdoc 0.20.0-next.3 → 0.20.0-next.5

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 (56) hide show
  1. package/dist/chunks/{PdfViewer-B9b7_8E2.cjs → PdfViewer-Blwty0A0.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-DbuZR81Q.es.js → PdfViewer-DcPZsBsK.es.js} +1 -1
  3. package/dist/chunks/{index-CLepjsej.cjs → index-BB5vhzVT.cjs} +2 -2
  4. package/dist/chunks/{index-CEAEymUl.es.js → index-BZzn2Rcn.es.js} +2 -2
  5. package/dist/chunks/{super-editor.es-C7rC3O3K.es.js → super-editor.es-BTcVSa_f.es.js} +2149 -1550
  6. package/dist/chunks/{super-editor.es-TdXXCNpJ.cjs → super-editor.es-BgBNGRxg.cjs} +2149 -1550
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/style.css +38 -0
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-BZ638uQi.js → converter-BPTfSIJf.js} +919 -813
  11. package/dist/super-editor/chunks/{docx-zipper-B-DSvrA8.js → docx-zipper-ikgI-2vM.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-JXnNPHDg.js → editor-hh7sL4Wv.js} +1013 -529
  13. package/dist/super-editor/chunks/{toolbar-CGu2Zc7R.js → toolbar-B-apzt27.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 +1 -0
  19. package/dist/super-editor/src/core/helpers/updateDOMAttributes.d.ts +1 -0
  20. package/dist/super-editor/src/core/super-converter/exporter.d.ts +7 -1
  21. package/dist/super-editor/src/core/super-converter/v2/importer/imageImporter.d.ts +0 -1
  22. package/dist/super-editor/src/core/super-converter/v3/handlers/index.d.ts +2 -0
  23. package/dist/super-editor/src/core/super-converter/v3/handlers/w/drawing/drawing-translator.d.ts +6 -0
  24. package/dist/super-editor/src/core/super-converter/v3/handlers/w/drawing/index.d.ts +1 -0
  25. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/anchor-translator.d.ts +6 -0
  26. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/helpers/handle-anchor-node.d.ts +6 -0
  27. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/helpers/translate-anchor-node.d.ts +6 -0
  28. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/anchor/index.d.ts +1 -0
  29. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/helpers/decode-image-node-helpers.d.ts +18 -0
  30. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/helpers/encode-image-node-helpers.d.ts +6 -0
  31. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/helpers/handle-inline-node.d.ts +6 -0
  32. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/helpers/translate-inline-node.d.ts +6 -0
  33. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/index.d.ts +1 -0
  34. package/dist/super-editor/src/core/super-converter/v3/handlers/wp/inline/inline-translator.d.ts +6 -0
  35. package/dist/super-editor/src/extensions/image/imageHelpers/handleBase64.d.ts +1 -0
  36. package/dist/super-editor/src/extensions/image/imageHelpers/handleUrl.d.ts +2 -0
  37. package/dist/super-editor/src/extensions/image/imageHelpers/imageRegistrationPlugin.d.ts +11 -0
  38. package/dist/super-editor/src/extensions/image/imageHelpers/index.d.ts +1 -1
  39. package/dist/super-editor/src/extensions/image/imageHelpers/processUploadedImage.d.ts +2 -2
  40. package/dist/super-editor/src/extensions/image/imageHelpers/startImageUpload.d.ts +18 -23
  41. package/dist/super-editor/src/extensions/structured-content/StructuredContentBlockView.d.ts +10 -0
  42. package/dist/super-editor/src/extensions/structured-content/StructuredContentInlineView.d.ts +10 -0
  43. package/dist/super-editor/src/extensions/structured-content/StructuredContentViewBase.d.ts +24 -0
  44. package/dist/super-editor/src/extensions/structured-content/structured-content-block.d.ts +3 -1
  45. package/dist/super-editor/src/extensions/structured-content/structured-content.d.ts +3 -1
  46. package/dist/super-editor/style.css +38 -0
  47. package/dist/super-editor/super-editor.es.js +65 -55
  48. package/dist/super-editor/toolbar.es.js +2 -2
  49. package/dist/super-editor.cjs +1 -1
  50. package/dist/super-editor.es.js +1 -1
  51. package/dist/superdoc.cjs +2 -2
  52. package/dist/superdoc.es.js +2 -2
  53. package/dist/superdoc.umd.js +2777 -2178
  54. package/dist/superdoc.umd.js.map +1 -1
  55. package/package.json +1 -1
  56. package/dist/super-editor/src/extensions/image/imageHelpers/imagePlaceholderPlugin.d.ts +0 -5
@@ -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-BZ638uQi.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-JXnNPHDg.js";
2
+ import { p as process$1 } from "./converter-BPTfSIJf.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-hh7sL4Wv.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-BZ638uQi.js";
1
+ import { a5 } from "./chunks/converter-BPTfSIJf.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-BZ638uQi.js";
2
- import { D } from "./chunks/docx-zipper-B-DSvrA8.js";
1
+ import "./chunks/converter-BPTfSIJf.js";
2
+ import { D } from "./chunks/docx-zipper-ikgI-2vM.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-JXnNPHDg.js";
2
- import "./chunks/converter-BZ638uQi.js";
3
- import "./chunks/docx-zipper-B-DSvrA8.js";
1
+ import { E } from "./chunks/editor-hh7sL4Wv.js";
2
+ import "./chunks/converter-BPTfSIJf.js";
3
+ import "./chunks/docx-zipper-ikgI-2vM.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-B-DSvrA8.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-ikgI-2vM.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -27,3 +27,4 @@ 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";
@@ -0,0 +1 @@
1
+ export function updateDOMAttributes(dom: any, attrs?: {}, options?: {}): void;
@@ -53,6 +53,13 @@ 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;
56
63
  /**
57
64
  * Generate a w:rPr node (run properties) from marks
58
65
  *
@@ -79,7 +86,6 @@ export function processLinkContentNode(node: any): any;
79
86
  * @returns {string} The new relationship ID
80
87
  */
81
88
  export function addNewLinkRelationship(params: ExportParams, link: string): string;
82
- export function translateImageNode(params: any, imageSize: any): any;
83
89
  export function translateHardBreak(params: any): {
84
90
  name: string;
85
91
  elements: {
@@ -1,4 +1,3 @@
1
- export function handleImageImport(node: any, currentFileName: any, params: any): any;
2
1
  /**
3
2
  * @type {import("docxImporter").NodeHandler}
4
3
  */
@@ -5,5 +5,7 @@ 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;
8
10
  }>;
9
11
  export type RegisteredHandlers = any;
@@ -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;
@@ -0,0 +1 @@
1
+ export * from "./drawing-translator.js";
@@ -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;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Anchor image node handler
3
+ * @param {import('@translator').SCEncoderConfig} params
4
+ * @returns {Object|null} Handler result
5
+ */
6
+ export function handleAnchorNode(params: import("@translator").SCEncoderConfig): any | null;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Translates anchor image
3
+ * @param {Object} params - The parameters for translation.
4
+ * @returns {Object} The XML representation.
5
+ */
6
+ export function translateAnchorNode(params: any): any;
@@ -0,0 +1 @@
1
+ export * from "./anchor-translator.js";
@@ -0,0 +1,18 @@
1
+ export function translateImageNode(params: any): any;
2
+ /**
3
+ * Decodes image into export XML
4
+ */
5
+ export type ExportParams = {
6
+ /**
7
+ * JSON node to translate (from PM schema)
8
+ */
9
+ node: any;
10
+ /**
11
+ * The stored body node to restore, if available
12
+ */
13
+ bodyNode: any;
14
+ /**
15
+ * The relationships to add to the document
16
+ */
17
+ relationships: any[];
18
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Encodes image xml into Editor node
3
+ * @param {Object} params
4
+ * @returns {Object|null}
5
+ */
6
+ export function handleImageNode(node: any, params: any, isAnchor: any): any | null;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Inline image node handler
3
+ * @param {import('@translator').SCEncoderConfig} params
4
+ * @returns {Object|null} Handler result
5
+ */
6
+ export function handleInlineNode(params: import("@translator").SCEncoderConfig): any | null;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Translates inline image
3
+ * @param {Object} params - The parameters for translation.
4
+ * @returns {Object} The XML representation.
5
+ */
6
+ export function translateInlineNode(params: any): any;
@@ -0,0 +1 @@
1
+ export * from "./inline-translator.js";
@@ -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;
@@ -0,0 +1 @@
1
+ export function base64ToFile(base64String: any): File;
@@ -0,0 +1,2 @@
1
+ export function urlToFile(url: string, filename?: string, mimeType?: string): Promise<File | null>;
2
+ export function validateUrlAccessibility(url: string): Promise<boolean>;
@@ -0,0 +1,11 @@
1
+ export function ImageRegistrationPlugin({ editor }: {
2
+ editor: any;
3
+ }): Plugin<{
4
+ set: DecorationSet;
5
+ }>;
6
+ export function findPlaceholder(state: any, id: any): any;
7
+ export function removeImagePlaceholder(state: any, tr: any, id: any): any;
8
+ export function addImagePlaceholder(state: any, tr: any, id: any, pos: any): any;
9
+ export function getImageRegistrationMetaType(tr: any): any;
10
+ import { DecorationSet } from 'prosemirror-view';
11
+ import { Plugin } from 'prosemirror-state';
@@ -1,6 +1,6 @@
1
1
  export * from "./getFileOpener.js";
2
2
  export * from "./startImageUpload.js";
3
3
  export * from "./handleImageUpload.js";
4
- export * from "./imagePlaceholderPlugin.js";
4
+ export * from "./imageRegistrationPlugin.js";
5
5
  export * from "./processUploadedImage.js";
6
6
  export * from "./imagePositionPlugin.js";
@@ -1,2 +1,2 @@
1
- export function processUploadedImage(fileData: string | File, editor: any): Promise<string | any>;
2
- export function getAllowedImageDimensions(width: number, height: number, editor: any): any;
1
+ export function processUploadedImage(fileData: string | File, getMaxContentSize: Function): Promise<string | any>;
2
+ export function getAllowedImageDimensions(width: number, height: number, getMaxContentSize: Function): any;
@@ -1,27 +1,22 @@
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 }: {
17
- editor: any;
1
+ export function replaceSelectionWithImagePlaceholder({ editorOptions, view, id }: {
2
+ editorOptions: any;
18
3
  view: any;
19
- file: File;
20
- size: any;
21
- uploadHandler: Function;
22
- }): Promise<void>;
23
- export function startImageUpload({ editor, view, file }: {
4
+ id: any;
5
+ }): void;
6
+ export function uploadAndInsertImage({ editor, view, file, size, id }: {
24
7
  editor: any;
25
8
  view: any;
26
- file: File;
9
+ file: any;
10
+ size: any;
11
+ id: any;
27
12
  }): 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
+ }>;
@@ -0,0 +1,10 @@
1
+ export class StructuredContentBlockView extends StructuredContentViewBase {
2
+ mount(): void;
3
+ createElement(): {
4
+ element: HTMLDivElement;
5
+ contentElement: HTMLDivElement;
6
+ };
7
+ buildView(): void;
8
+ updateView(): void;
9
+ }
10
+ import { StructuredContentViewBase } from './StructuredContentViewBase';
@@ -0,0 +1,10 @@
1
+ export class StructuredContentInlineView extends StructuredContentViewBase {
2
+ mount(): void;
3
+ createElement(): {
4
+ element: HTMLSpanElement;
5
+ contentElement: HTMLSpanElement;
6
+ };
7
+ buildView(): void;
8
+ updateView(): void;
9
+ }
10
+ import { StructuredContentViewBase } from './StructuredContentViewBase';
@@ -0,0 +1,24 @@
1
+ export class StructuredContentViewBase {
2
+ constructor(props: any);
3
+ node: any;
4
+ view: any;
5
+ getPos: any;
6
+ decorations: any;
7
+ innerDecorations: any;
8
+ editor: any;
9
+ extension: any;
10
+ htmlAttributes: any;
11
+ root: any;
12
+ isDragging: boolean;
13
+ mount(props: any): void;
14
+ get dom(): any;
15
+ get contentDOM(): any;
16
+ update(node: any, decorations: any, innerDecorations: any): boolean;
17
+ stopEvent(event: any): boolean;
18
+ ignoreMutation(mutation: any): boolean;
19
+ destroy(): void;
20
+ updateAttributes(attrs: any): any;
21
+ updateHTMLAttributes(): void;
22
+ createDragHandle(): HTMLSpanElement;
23
+ onDragStart(event: any): void;
24
+ }
@@ -1,2 +1,4 @@
1
+ export const structuredContentClass: "sd-structured-content-block";
2
+ export const structuredContentInnerClass: "sd-structured-content-block__content";
1
3
  export const StructuredContentBlock: Node;
2
- import { Node } from '@core/index.js';
4
+ import { Node } from '@core/index';
@@ -1,2 +1,4 @@
1
+ export const structuredContentClass: "sd-structured-content";
2
+ export const structuredContentInnerClass: "sd-structured-content__content";
1
3
  export const StructuredContent: Node;
2
- import { Node } from '@core/index.js';
4
+ import { Node } from '@core/index';
@@ -1117,6 +1117,44 @@ 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
+ }
1120
1158
 
1121
1159
  .alignment-buttons[data-v-d84f57b6] {
1122
1160
  display: flex;
@@ -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-BZ638uQi.js";
13
- import { aI, a5, i, a2 } from "./chunks/converter-BZ638uQi.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-JXnNPHDg.js";
15
- import { k, C, l, T, i as i2, m, j } from "./chunks/editor-JXnNPHDg.js";
12
+ import { ay as getDefaultExportFromCjs, V as v4, T as TextSelection$1, v as getMarkRange, aB as vClickOutside, H as findParentNode, aC as getActiveFormatting, ar as isInTable, aD as readFromClipboard, aE as handleClipboardPaste, aF as getFileObject, a as Plugin } from "./chunks/converter-BPTfSIJf.js";
13
+ import { aG, a5, i, a2, aH } from "./chunks/converter-BPTfSIJf.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, d as checkAndProcessImage, r as replaceSelectionWithImagePlaceholder, e as uploadAndInsertImage, y as yUndoPluginKey, f as undoDepth, h as redoDepth, S as SlashMenuPluginKey, E as Editor, i as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-hh7sL4Wv.js";
15
+ import { n, C, o, T, l, p, m } from "./chunks/editor-hh7sL4Wv.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-CGu2Zc7R.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-B-apzt27.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-B-DSvrA8.js";
19
+ import { D } from "./chunks/docx-zipper-ikgI-2vM.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -69,8 +69,8 @@ function requireEventemitter3() {
69
69
  var evt = prefix ? prefix + event : event, handlers = this._events[evt];
70
70
  if (!handlers) return [];
71
71
  if (handlers.fn) return [handlers.fn];
72
- for (var i3 = 0, l2 = handlers.length, ee = new Array(l2); i3 < l2; i3++) {
73
- ee[i3] = handlers[i3].fn;
72
+ for (var i2 = 0, l2 = handlers.length, ee = new Array(l2); i2 < l2; i2++) {
73
+ ee[i2] = handlers[i2].fn;
74
74
  }
75
75
  return ee;
76
76
  };
@@ -83,7 +83,7 @@ function requireEventemitter3() {
83
83
  EventEmitter2.prototype.emit = function emit(event, a1, a22, a3, a4, a52) {
84
84
  var evt = prefix ? prefix + event : event;
85
85
  if (!this._events[evt]) return false;
86
- var listeners = this._events[evt], len = arguments.length, args, i3;
86
+ var listeners = this._events[evt], len = arguments.length, args, i2;
87
87
  if (listeners.fn) {
88
88
  if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
89
89
  switch (len) {
@@ -100,32 +100,32 @@ function requireEventemitter3() {
100
100
  case 6:
101
101
  return listeners.fn.call(listeners.context, a1, a22, a3, a4, a52), true;
102
102
  }
103
- for (i3 = 1, args = new Array(len - 1); i3 < len; i3++) {
104
- args[i3 - 1] = arguments[i3];
103
+ for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
104
+ args[i2 - 1] = arguments[i2];
105
105
  }
106
106
  listeners.fn.apply(listeners.context, args);
107
107
  } else {
108
- var length = listeners.length, j2;
109
- for (i3 = 0; i3 < length; i3++) {
110
- if (listeners[i3].once) this.removeListener(event, listeners[i3].fn, void 0, true);
108
+ var length = listeners.length, j;
109
+ for (i2 = 0; i2 < length; i2++) {
110
+ if (listeners[i2].once) this.removeListener(event, listeners[i2].fn, void 0, true);
111
111
  switch (len) {
112
112
  case 1:
113
- listeners[i3].fn.call(listeners[i3].context);
113
+ listeners[i2].fn.call(listeners[i2].context);
114
114
  break;
115
115
  case 2:
116
- listeners[i3].fn.call(listeners[i3].context, a1);
116
+ listeners[i2].fn.call(listeners[i2].context, a1);
117
117
  break;
118
118
  case 3:
119
- listeners[i3].fn.call(listeners[i3].context, a1, a22);
119
+ listeners[i2].fn.call(listeners[i2].context, a1, a22);
120
120
  break;
121
121
  case 4:
122
- listeners[i3].fn.call(listeners[i3].context, a1, a22, a3);
122
+ listeners[i2].fn.call(listeners[i2].context, a1, a22, a3);
123
123
  break;
124
124
  default:
125
- if (!args) for (j2 = 1, args = new Array(len - 1); j2 < len; j2++) {
126
- args[j2 - 1] = arguments[j2];
125
+ if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
126
+ args[j - 1] = arguments[j];
127
127
  }
128
- listeners[i3].fn.apply(listeners[i3].context, args);
128
+ listeners[i2].fn.apply(listeners[i2].context, args);
129
129
  }
130
130
  }
131
131
  }
@@ -150,9 +150,9 @@ function requireEventemitter3() {
150
150
  clearEvent(this, evt);
151
151
  }
152
152
  } else {
153
- for (var i3 = 0, events = [], length = listeners.length; i3 < length; i3++) {
154
- if (listeners[i3].fn !== fn || once && !listeners[i3].once || context && listeners[i3].context !== context) {
155
- events.push(listeners[i3]);
153
+ for (var i2 = 0, events = [], length = listeners.length; i2 < length; i2++) {
154
+ if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
155
+ events.push(listeners[i2]);
156
156
  }
157
157
  }
158
158
  if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
@@ -1145,8 +1145,8 @@ const _sfc_main$7 = {
1145
1145
  const selectGridItems = (allItems, cols, rows) => {
1146
1146
  selectedCols.value = cols;
1147
1147
  selectedRows.value = rows;
1148
- for (let i3 = 0; i3 < allItems.length; i3++) {
1149
- let item = allItems[i3];
1148
+ for (let i2 = 0; i2 < allItems.length; i2++) {
1149
+ let item = allItems[i2];
1150
1150
  let itemsCols = parseInt(item.dataset.cols, 10);
1151
1151
  let itemsRows = parseInt(item.dataset.rows, 10);
1152
1152
  if (itemsCols <= cols && itemsRows <= rows) {
@@ -1223,20 +1223,20 @@ const _sfc_main$7 = {
1223
1223
  onMouseover: onTableGridMouseOver,
1224
1224
  "data-grid": "true"
1225
1225
  }, [
1226
- (openBlock(), createElementBlock(Fragment, null, renderList(5, (i3) => {
1227
- return openBlock(), createElementBlock(Fragment, { key: i3 }, [
1228
- (openBlock(), createElementBlock(Fragment, null, renderList(5, (n) => {
1226
+ (openBlock(), createElementBlock(Fragment, null, renderList(5, (i2) => {
1227
+ return openBlock(), createElementBlock(Fragment, { key: i2 }, [
1228
+ (openBlock(), createElementBlock(Fragment, null, renderList(5, (n2) => {
1229
1229
  return createElementVNode("div", {
1230
1230
  class: "toolbar-table-grid__item",
1231
- key: `${i3}_${n}`,
1232
- "data-cols": n,
1233
- "data-rows": i3,
1231
+ key: `${i2}_${n2}`,
1232
+ "data-cols": n2,
1233
+ "data-rows": i2,
1234
1234
  "data-item": "true",
1235
1235
  ref_for: true,
1236
1236
  ref_key: "tableGridItems",
1237
1237
  ref: tableGridItems,
1238
- onKeydown: withModifiers((event) => handleKeyDown(event, n, i3), ["prevent"]),
1239
- onClick: withModifiers(($event) => handleClick({ cols: n, rows: i3 }), ["stop", "prevent"])
1238
+ onKeydown: withModifiers((event) => handleKeyDown(event, n2, i2), ["prevent"]),
1239
+ onClick: withModifiers(($event) => handleClick({ cols: n2, rows: i2 }), ["stop", "prevent"])
1240
1240
  }, null, 40, _hoisted_1$6);
1241
1241
  }), 64))
1242
1242
  ], 64);
@@ -1457,7 +1457,7 @@ const makeDefaultItems = ({
1457
1457
  onActivate: ({ fontFamily }) => {
1458
1458
  if (!fontFamily) return;
1459
1459
  fontButton.label.value = fontFamily;
1460
- const foundFont = fontOptions.find((i3) => i3.label === fontFamily);
1460
+ const foundFont = fontOptions.find((i2) => i2.label === fontFamily);
1461
1461
  if (foundFont) {
1462
1462
  fontButton.selectedValue.value = foundFont.key;
1463
1463
  } else {
@@ -1543,8 +1543,8 @@ const makeDefaultItems = ({
1543
1543
  if (sanitizedValue < 8) sanitizedValue = 8;
1544
1544
  if (sanitizedValue > 96) sanitizedValue = 96;
1545
1545
  let sanitizedValueStr = String(sanitizedValue);
1546
- const foundSize = fontSizeOptions.find((i3) => {
1547
- return i3.label === sanitizedValueStr || i3.key === sanitizedValueStr;
1546
+ const foundSize = fontSizeOptions.find((i2) => {
1547
+ return i2.label === sanitizedValueStr || i2.key === sanitizedValueStr;
1548
1548
  });
1549
1549
  if (foundSize) {
1550
1550
  fontSize.selectedValue.value = foundSize.key;
@@ -2643,10 +2643,25 @@ class SuperToolbar extends EventEmitter {
2643
2643
  if (!result?.file) {
2644
2644
  return;
2645
2645
  }
2646
- startImageUpload({
2646
+ const { size, file } = await checkAndProcessImage({
2647
+ file: result.file,
2648
+ getMaxContentSize: () => this.activeEditor.getMaxContentSize()
2649
+ });
2650
+ if (!file) {
2651
+ return;
2652
+ }
2653
+ const id = {};
2654
+ replaceSelectionWithImagePlaceholder({
2655
+ view: this.activeEditor.view,
2656
+ editorOptions: this.activeEditor.options,
2657
+ id
2658
+ });
2659
+ await uploadAndInsertImage({
2647
2660
  editor: this.activeEditor,
2648
2661
  view: this.activeEditor.view,
2649
- file: result.file
2662
+ file,
2663
+ size,
2664
+ id
2650
2665
  });
2651
2666
  },
2652
2667
  /**
@@ -3977,11 +3992,11 @@ const _sfc_main$3 = {
3977
3992
  pageMargins.value = docMargins;
3978
3993
  rightHandle.x = docSize.width * 96 - docMargins.right * 96;
3979
3994
  leftHandle.x = docMargins.left * 96;
3980
- for (let i3 = 0; i3 < docSize.width; i3++) {
3995
+ for (let i2 = 0; i2 < docSize.width; i2++) {
3981
3996
  const marginNum = 0.0625 * 96 - 0.5;
3982
3997
  const margin = `${marginNum}px`;
3983
- const diff = docSize.width - i3;
3984
- rulerItems.push(...generateSection(1, "main", "20%", margin, i3));
3998
+ const diff = docSize.width - i2;
3999
+ rulerItems.push(...generateSection(1, "main", "20%", margin, i2));
3985
4000
  rulerItems.push(...generateSection(3, "eighth", "10%", margin));
3986
4001
  rulerItems.push(...generateSection(1, "half", "40%", margin));
3987
4002
  if (diff <= 0.5) break;
@@ -3990,7 +4005,7 @@ const _sfc_main$3 = {
3990
4005
  return rulerItems;
3991
4006
  };
3992
4007
  const generateSection = (qty, size, height, margin, index) => {
3993
- return Array.from({ length: qty }, (_, i3) => {
4008
+ return Array.from({ length: qty }, (_, i2) => {
3994
4009
  const item = {
3995
4010
  className: `${size}-unit ruler-section`,
3996
4011
  height,
@@ -4602,11 +4617,6 @@ const _sfc_main = {
4602
4617
  }
4603
4618
  };
4604
4619
  const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
4605
- const registeredHandlers = Object.freeze({
4606
- "w:br": translator$2,
4607
- "w:tab": translator$1,
4608
- "w:p": translator
4609
- });
4610
4620
  const Extensions = {
4611
4621
  Node,
4612
4622
  Attribute,
@@ -4616,13 +4626,13 @@ const Extensions = {
4616
4626
  };
4617
4627
  export {
4618
4628
  AIWriter,
4619
- k as AnnotatorHelpers,
4620
- aI as BasicUpload,
4629
+ n as AnnotatorHelpers,
4630
+ aG as BasicUpload,
4621
4631
  C as CommentsPluginKey,
4622
4632
  D as DocxZipper,
4623
4633
  Editor,
4624
4634
  Extensions,
4625
- l as SectionHelpers,
4635
+ o as SectionHelpers,
4626
4636
  _sfc_main$4 as SlashMenu,
4627
4637
  a5 as SuperConverter,
4628
4638
  SuperEditor,
@@ -4631,13 +4641,13 @@ export {
4631
4641
  Toolbar,
4632
4642
  T as TrackChangesBasePluginKey,
4633
4643
  createZip,
4634
- i2 as fieldAnnotationHelpers,
4644
+ l as fieldAnnotationHelpers,
4635
4645
  getActiveFormatting,
4636
- m as getAllowedImageDimensions,
4646
+ p as getAllowedImageDimensions,
4637
4647
  i as getMarksFromSelection,
4638
4648
  getRichTextExtensions,
4639
4649
  getStarterExtensions,
4640
4650
  a2 as helpers,
4641
- registeredHandlers,
4642
- j as trackChangesHelpers
4651
+ aH as registeredHandlers,
4652
+ m as trackChangesHelpers
4643
4653
  };