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

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 (29) hide show
  1. package/dist/chunks/{PdfViewer-DaZtoNpm.cjs → PdfViewer-BlV8_l4e.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-C2898kqZ.es.js → PdfViewer-oqYWe1FJ.es.js} +1 -1
  3. package/dist/chunks/{index-CkJ5hnvC.es.js → index-CeockUQz.es.js} +35 -3
  4. package/dist/chunks/{index-Di9R4Aas.cjs → index-DHyh73q4.cjs} +35 -3
  5. package/dist/chunks/{super-editor.es-kuaVTS8t.es.js → super-editor.es-BRBU19lM.es.js} +115 -91
  6. package/dist/chunks/{super-editor.es-DG-S6GN9.cjs → super-editor.es-bu-RKSWh.cjs} +115 -91
  7. package/dist/core/SuperDoc.d.ts.map +1 -1
  8. package/dist/stores/superdoc-store.d.ts +3 -0
  9. package/dist/stores/superdoc-store.d.ts.map +1 -1
  10. package/dist/style.css +6 -6
  11. package/dist/super-editor/ai-writer.es.js +2 -2
  12. package/dist/super-editor/chunks/{converter-CrJvpQ8J.js → converter-BFq1XXek.js} +18 -7
  13. package/dist/super-editor/chunks/{docx-zipper-CHHaFCfj.js → docx-zipper-BahUy6FS.js} +1 -1
  14. package/dist/super-editor/chunks/{editor-DlzGbfD-.js → editor-BdLd21gy.js} +92 -84
  15. package/dist/super-editor/chunks/{toolbar-DeKOVf4h.js → toolbar-DoJY1zlM.js} +2 -2
  16. package/dist/super-editor/converter.es.js +1 -1
  17. package/dist/super-editor/docx-zipper.es.js +2 -2
  18. package/dist/super-editor/editor.es.js +3 -3
  19. package/dist/super-editor/file-zipper.es.js +1 -1
  20. package/dist/super-editor/style.css +6 -6
  21. package/dist/super-editor/super-editor.es.js +13 -8
  22. package/dist/super-editor/toolbar.es.js +2 -2
  23. package/dist/super-editor.cjs +1 -1
  24. package/dist/super-editor.es.js +1 -1
  25. package/dist/superdoc.cjs +2 -2
  26. package/dist/superdoc.es.js +2 -2
  27. package/dist/superdoc.umd.js +148 -92
  28. package/dist/superdoc.umd.js.map +1 -1
  29. package/package.json +1 -1
@@ -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-CrJvpQ8J.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-BFq1XXek.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-CHHaFCfj.js";
17
+ import { D as DocxZipper } from "./docx-zipper-BahUy6FS.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -13509,7 +13509,7 @@ function validateRelationshipsRoot(relsTree, relsKey, results) {
13509
13509
  }
13510
13510
  return { root, wasFixed };
13511
13511
  }
13512
- function cleanupRootChildren(root, results) {
13512
+ function cleanupRootChildren(root) {
13513
13513
  const validChildren = root.elements?.filter((child) => child?.type === "element" && child.name === "Relationship") || [];
13514
13514
  if (root.elements?.length !== validChildren.length) {
13515
13515
  root.elements = validChildren;
@@ -14549,85 +14549,89 @@ const _Editor = class _Editor extends EventEmitter {
14549
14549
  getUpdatedDocs = false,
14550
14550
  fieldsHighlightColor = null
14551
14551
  } = {}) {
14552
- const json = __privateMethod(this, _Editor_instances, prepareDocumentForExport_fn).call(this, comments);
14553
- const documentXml = await this.converter.exportToDocx(
14554
- json,
14555
- this.schema,
14556
- this.storage.image.media,
14557
- isFinalDoc,
14558
- commentsType,
14559
- comments,
14560
- this,
14561
- exportJsonOnly,
14562
- fieldsHighlightColor
14563
- );
14564
- __privateMethod(this, _Editor_instances, validateDocumentExport_fn).call(this);
14565
- if (exportXmlOnly || exportJsonOnly) return documentXml;
14566
- const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
14567
- const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
14568
- const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
14569
- const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
14570
- const media = this.converter.addedMedia;
14571
- const updatedHeadersFooters = {};
14572
- Object.entries(this.converter.convertedXml).forEach(([name, json2]) => {
14573
- if (name.includes("header") || name.includes("footer")) {
14574
- const resultXml = this.converter.schemaToXml(json2.elements[0]);
14575
- updatedHeadersFooters[name] = String(resultXml);
14576
- }
14577
- });
14578
- const numberingData = this.converter.convertedXml["word/numbering.xml"];
14579
- const numbering = this.converter.schemaToXml(numberingData.elements[0]);
14580
- const updatedDocs = {
14581
- ...this.options.customUpdatedFiles,
14582
- "word/document.xml": String(documentXml),
14583
- "docProps/custom.xml": String(customXml),
14584
- "word/settings.xml": String(customSettings),
14585
- "word/_rels/document.xml.rels": String(rels),
14586
- "word/numbering.xml": String(numbering),
14587
- // Replace & with & in styles.xml as DOCX viewers can't handle it
14588
- "word/styles.xml": String(styles).replace(/&/gi, "&"),
14589
- ...updatedHeadersFooters
14590
- };
14591
- if (comments.length) {
14592
- const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
14593
- const commentsExtendedXml = this.converter.schemaToXml(
14594
- this.converter.convertedXml["word/commentsExtended.xml"].elements[0]
14595
- );
14596
- const commentsExtensibleXml = this.converter.schemaToXml(
14597
- this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]
14598
- );
14599
- const commentsIdsXml = this.converter.schemaToXml(
14600
- this.converter.convertedXml["word/commentsIds.xml"].elements[0]
14552
+ try {
14553
+ const json = __privateMethod(this, _Editor_instances, prepareDocumentForExport_fn).call(this, comments);
14554
+ const documentXml = await this.converter.exportToDocx(
14555
+ json,
14556
+ this.schema,
14557
+ this.storage.image.media,
14558
+ isFinalDoc,
14559
+ commentsType,
14560
+ comments,
14561
+ this,
14562
+ exportJsonOnly,
14563
+ fieldsHighlightColor
14601
14564
  );
14602
- updatedDocs["word/comments.xml"] = String(commentsXml);
14603
- updatedDocs["word/commentsExtended.xml"] = String(commentsExtendedXml);
14604
- updatedDocs["word/commentsExtensible.xml"] = String(commentsExtensibleXml);
14605
- updatedDocs["word/commentsIds.xml"] = String(commentsIdsXml);
14606
- }
14607
- const zipper = new DocxZipper();
14608
- if (getUpdatedDocs) {
14609
- updatedDocs["[Content_Types].xml"] = await zipper.updateContentTypes(
14610
- {
14611
- files: this.options.content
14612
- },
14565
+ __privateMethod(this, _Editor_instances, validateDocumentExport_fn).call(this);
14566
+ if (exportXmlOnly || exportJsonOnly) return documentXml;
14567
+ const customXml = this.converter.schemaToXml(this.converter.convertedXml["docProps/custom.xml"].elements[0]);
14568
+ const styles = this.converter.schemaToXml(this.converter.convertedXml["word/styles.xml"].elements[0]);
14569
+ const customSettings = this.converter.schemaToXml(this.converter.convertedXml["word/settings.xml"].elements[0]);
14570
+ const rels = this.converter.schemaToXml(this.converter.convertedXml["word/_rels/document.xml.rels"].elements[0]);
14571
+ const media = this.converter.addedMedia;
14572
+ const updatedHeadersFooters = {};
14573
+ Object.entries(this.converter.convertedXml).forEach(([name, json2]) => {
14574
+ if (name.includes("header") || name.includes("footer")) {
14575
+ const resultXml = this.converter.schemaToXml(json2.elements[0]);
14576
+ updatedHeadersFooters[name] = String(resultXml);
14577
+ }
14578
+ });
14579
+ const numberingData = this.converter.convertedXml["word/numbering.xml"];
14580
+ const numbering = this.converter.schemaToXml(numberingData.elements[0]);
14581
+ const updatedDocs = {
14582
+ ...this.options.customUpdatedFiles,
14583
+ "word/document.xml": String(documentXml),
14584
+ "docProps/custom.xml": String(customXml),
14585
+ "word/settings.xml": String(customSettings),
14586
+ "word/_rels/document.xml.rels": String(rels),
14587
+ "word/numbering.xml": String(numbering),
14588
+ // Replace & with & in styles.xml as DOCX viewers can't handle it
14589
+ "word/styles.xml": String(styles).replace(/&/gi, "&"),
14590
+ ...updatedHeadersFooters
14591
+ };
14592
+ if (comments.length) {
14593
+ const commentsXml = this.converter.schemaToXml(this.converter.convertedXml["word/comments.xml"].elements[0]);
14594
+ const commentsExtendedXml = this.converter.schemaToXml(
14595
+ this.converter.convertedXml["word/commentsExtended.xml"].elements[0]
14596
+ );
14597
+ const commentsExtensibleXml = this.converter.schemaToXml(
14598
+ this.converter.convertedXml["word/commentsExtensible.xml"].elements[0]
14599
+ );
14600
+ const commentsIdsXml = this.converter.schemaToXml(
14601
+ this.converter.convertedXml["word/commentsIds.xml"].elements[0]
14602
+ );
14603
+ updatedDocs["word/comments.xml"] = String(commentsXml);
14604
+ updatedDocs["word/commentsExtended.xml"] = String(commentsExtendedXml);
14605
+ updatedDocs["word/commentsExtensible.xml"] = String(commentsExtensibleXml);
14606
+ updatedDocs["word/commentsIds.xml"] = String(commentsIdsXml);
14607
+ }
14608
+ const zipper = new DocxZipper();
14609
+ if (getUpdatedDocs) {
14610
+ updatedDocs["[Content_Types].xml"] = await zipper.updateContentTypes(
14611
+ {
14612
+ files: this.options.content
14613
+ },
14614
+ media,
14615
+ true
14616
+ );
14617
+ return updatedDocs;
14618
+ }
14619
+ const result = await zipper.updateZip({
14620
+ docx: this.options.content,
14621
+ updatedDocs,
14622
+ originalDocxFile: this.options.fileSource,
14613
14623
  media,
14614
- true
14615
- );
14616
- return updatedDocs;
14624
+ fonts: this.options.fonts,
14625
+ isHeadless: this.options.isHeadless
14626
+ });
14627
+ this.options.telemetry?.trackUsage("document_export", {
14628
+ documentType: "docx",
14629
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
14630
+ });
14631
+ return result;
14632
+ } catch (error) {
14633
+ this.emit("exception", { error, editor: this });
14617
14634
  }
14618
- const result = await zipper.updateZip({
14619
- docx: this.options.content,
14620
- updatedDocs,
14621
- originalDocxFile: this.options.fileSource,
14622
- media,
14623
- fonts: this.options.fonts,
14624
- isHeadless: this.options.isHeadless
14625
- });
14626
- this.options.telemetry?.trackUsage("document_export", {
14627
- documentType: "docx",
14628
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
14629
- });
14630
- return result;
14631
14635
  }
14632
14636
  /**
14633
14637
  * Destroy the editor and clean up resources
@@ -14648,7 +14652,8 @@ const _Editor = class _Editor extends EventEmitter {
14648
14652
  }
14649
14653
  this.converter.headerEditors.length = 0;
14650
14654
  this.converter.footerEditors.length = 0;
14651
- } catch {
14655
+ } catch (error) {
14656
+ this.emit("exception", { error, editor: this });
14652
14657
  }
14653
14658
  }
14654
14659
  /**
@@ -14713,7 +14718,7 @@ const _Editor = class _Editor extends EventEmitter {
14713
14718
  this.initDefaultStyles();
14714
14719
  if (this.options.ydoc && this.options.collaborationProvider) {
14715
14720
  updateYdocDocxData(this);
14716
- this.initializeCollaborationData(true);
14721
+ this.initializeCollaborationData();
14717
14722
  } else {
14718
14723
  __privateMethod(this, _Editor_instances, insertNewFileData_fn).call(this);
14719
14724
  }
@@ -14882,7 +14887,6 @@ init_fn = function() {
14882
14887
  this.on("beforeCreate", this.options.onBeforeCreate);
14883
14888
  this.emit("beforeCreate", { editor: this });
14884
14889
  this.on("contentError", this.options.onContentError);
14885
- this.on("exception", this.options.onException);
14886
14890
  this.mount(this.options.element);
14887
14891
  this.on("create", this.options.onCreate);
14888
14892
  this.on("update", this.options.onUpdate);
@@ -14900,6 +14904,7 @@ init_fn = function() {
14900
14904
  this.on("paginationUpdate", this.options.onPaginationUpdate);
14901
14905
  this.on("comment-positions", this.options.onCommentLocationsUpdate);
14902
14906
  this.on("list-definitions-change", this.options.onListDefinitionsChange);
14907
+ this.on("exception", this.options.onException);
14903
14908
  if (!this.options.isHeadless) {
14904
14909
  this.initializeCollaborationData();
14905
14910
  this.initDefaultStyles();
@@ -15326,7 +15331,8 @@ endCollaboration_fn = function() {
15326
15331
  console.debug("🔗 [super-editor] Ending collaboration");
15327
15332
  if (this.options.collaborationProvider) this.options.collaborationProvider.disconnect();
15328
15333
  if (this.options.ydoc) this.options.ydoc.destroy();
15329
- } catch {
15334
+ } catch (error) {
15335
+ this.emit("exception", { error, editor: this });
15330
15336
  }
15331
15337
  };
15332
15338
  /**
@@ -24623,6 +24629,7 @@ const startImageUpload = async ({ editor, view, file }) => {
24623
24629
  file = processedImageResult.file;
24624
24630
  } catch (err) {
24625
24631
  console.warn("Error processing image:", err);
24632
+ editor.emit("exception", { error: err, editor });
24626
24633
  return;
24627
24634
  }
24628
24635
  await uploadImage({
@@ -24677,9 +24684,10 @@ async function uploadImage({ editor, view, file, size, uploadHandler }) {
24677
24684
  view.dispatch(
24678
24685
  view.state.tr.replaceWith(placeholderPos, placeholderPos, imageNode).setMeta(ImagePlaceholderPluginKey, removeMeta)
24679
24686
  );
24680
- } catch {
24687
+ } catch (error) {
24681
24688
  let removeMeta = { type: "remove", id };
24682
24689
  view.dispatch(tr.setMeta(ImagePlaceholderPluginKey, removeMeta));
24690
+ editor.emit("exception", { error, editor });
24683
24691
  }
24684
24692
  }
24685
24693
  function addImageRelationship({ editor, path }) {
@@ -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-CrJvpQ8J.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DlzGbfD-.js";
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";
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-CrJvpQ8J.js";
1
+ import { a5 } from "./chunks/converter-BFq1XXek.js";
2
2
  import "vue";
3
3
  export {
4
4
  a5 as SuperConverter
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-CrJvpQ8J.js";
2
- import { D } from "./chunks/docx-zipper-CHHaFCfj.js";
1
+ import "./chunks/converter-BFq1XXek.js";
2
+ import { D } from "./chunks/docx-zipper-BahUy6FS.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-DlzGbfD-.js";
2
- import "./chunks/converter-CrJvpQ8J.js";
3
- import "./chunks/docx-zipper-CHHaFCfj.js";
1
+ import { E } from "./chunks/editor-BdLd21gy.js";
2
+ import "./chunks/converter-BFq1XXek.js";
3
+ import "./chunks/docx-zipper-BahUy6FS.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-CHHaFCfj.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BahUy6FS.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1798,10 +1798,10 @@ on the right if it is inside shape textbox.
1798
1798
  min-height: 40px;
1799
1799
  }
1800
1800
 
1801
- .editor-element[data-v-8b2f8c17] {
1801
+ .editor-element[data-v-0c36dd72] {
1802
1802
  position: relative;
1803
1803
  }
1804
- .super-editor-container[data-v-8b2f8c17] {
1804
+ .super-editor-container[data-v-0c36dd72] {
1805
1805
  width: auto;
1806
1806
  height: auto;
1807
1807
  min-width: 8in;
@@ -1810,13 +1810,13 @@ on the right if it is inside shape textbox.
1810
1810
  display: flex;
1811
1811
  flex-direction: column;
1812
1812
  }
1813
- .ruler[data-v-8b2f8c17] {
1813
+ .ruler[data-v-0c36dd72] {
1814
1814
  margin-bottom: 2px;
1815
1815
  }
1816
- .super-editor[data-v-8b2f8c17] {
1816
+ .super-editor[data-v-0c36dd72] {
1817
1817
  color: initial;
1818
1818
  }
1819
- .placeholder-editor[data-v-8b2f8c17] {
1819
+ .placeholder-editor[data-v-0c36dd72] {
1820
1820
  position: absolute;
1821
1821
  top: 0;
1822
1822
  left: 0;
@@ -1828,7 +1828,7 @@ on the right if it is inside shape textbox.
1828
1828
  background-color: white;
1829
1829
  box-sizing: border-box;
1830
1830
  }
1831
- .placeholder-title[data-v-8b2f8c17] {
1831
+ .placeholder-title[data-v-0c36dd72] {
1832
1832
  display: flex;
1833
1833
  justify-content: center;
1834
1834
  margin-bottom: 40px;
@@ -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-CrJvpQ8J.js";
13
- import { aI, a5, i, a2 } from "./chunks/converter-CrJvpQ8J.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-DlzGbfD-.js";
15
- import { k, C, l, T, i as i2, m, j } from "./chunks/editor-DlzGbfD-.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-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";
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-DeKOVf4h.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-DoJY1zlM.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-CHHaFCfj.js";
19
+ import { D } from "./chunks/docx-zipper-BahUy6FS.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  var hasRequiredEventemitter3;
@@ -3003,7 +3003,9 @@ class SuperToolbar extends EventEmitter {
3003
3003
  } else if (typeof command === "function") {
3004
3004
  command({ item, argument, option });
3005
3005
  } else {
3006
- throw new Error(`[super-toolbar 🎨] Command not found: ${command}`);
3006
+ const error = new Error(`[super-toolbar 🎨] Command not found: ${command}`);
3007
+ this.emit("exception", { error, editor: this.activeEditor });
3008
+ throw error;
3007
3009
  }
3008
3010
  this.updateToolbarState();
3009
3011
  }
@@ -4303,6 +4305,9 @@ const _sfc_main$1 = {
4303
4305
  return { content: docx, media, mediaFiles, fonts };
4304
4306
  } catch (err) {
4305
4307
  console.debug("Error loading new file data:", err);
4308
+ if (typeof props.options.onException === "function") {
4309
+ props.options.onException({ error: err, editor: null });
4310
+ }
4306
4311
  }
4307
4312
  };
4308
4313
  const initializeData = async () => {
@@ -4505,7 +4510,7 @@ const _sfc_main$1 = {
4505
4510
  };
4506
4511
  }
4507
4512
  };
4508
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-8b2f8c17"]]);
4513
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c36dd72"]]);
4509
4514
  const _hoisted_1 = ["innerHTML"];
4510
4515
  const _sfc_main = {
4511
4516
  __name: "SuperInput",
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-DeKOVf4h.js";
3
- import "./chunks/editor-DlzGbfD-.js";
2
+ import { T } from "./chunks/toolbar-DoJY1zlM.js";
3
+ import "./chunks/editor-BdLd21gy.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-DG-S6GN9.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-bu-RKSWh.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-kuaVTS8t.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-BRBU19lM.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-DG-S6GN9.cjs");
4
- const superdoc = require("./chunks/index-Di9R4Aas.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-bu-RKSWh.cjs");
4
+ const superdoc = require("./chunks/index-DHyh73q4.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-kuaVTS8t.es.js";
2
- import { D, H, P, S as S2, m, l } from "./chunks/index-CkJ5hnvC.es.js";
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";
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";