@harbour-enterprises/superdoc 0.14.9-next.3 → 0.14.9-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 (27) hide show
  1. package/dist/chunks/{super-editor.es-Cm485wgf.es.js → super-editor.es-BqxptPXi.es.js} +124 -17
  2. package/dist/chunks/{super-editor.es-D4w4gOxp.cjs → super-editor.es-CEXGZ_L5.cjs} +124 -17
  3. package/dist/core/SuperDoc.d.ts +1 -1
  4. package/dist/core/SuperDoc.d.ts.map +1 -1
  5. package/dist/super-editor/ai-writer.es.js +2 -2
  6. package/dist/super-editor/chunks/{converter-wprLSvGf.js → converter-BzUe-JDb.js} +134 -26
  7. package/dist/super-editor/chunks/{docx-zipper-XpZaObsQ.js → docx-zipper-DuNhxEi5.js} +1 -1
  8. package/dist/super-editor/chunks/{editor-B-syl6XT.js → editor-D24ByYzx.js} +17 -17
  9. package/dist/super-editor/chunks/{toolbar-D0Pksjxw.js → toolbar-CCP8GEjh.js} +2 -2
  10. package/dist/super-editor/converter.es.js +1 -1
  11. package/dist/super-editor/core/Editor.d.ts +3 -10
  12. package/dist/super-editor/core/Editor.d.ts.map +1 -1
  13. package/dist/super-editor/core/inputRules/html/html-helpers.d.ts +4 -0
  14. package/dist/super-editor/core/inputRules/html/html-helpers.d.ts.map +1 -1
  15. package/dist/super-editor/core/migrations/0.14-listsv2/listsv2migration.d.ts.map +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +6 -6
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +1 -1
  23. package/dist/superdoc.cjs +4 -4
  24. package/dist/superdoc.es.js +5 -5
  25. package/dist/superdoc.umd.js +127 -20
  26. package/dist/superdoc.umd.js.map +1 -1
  27. 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, _commandService, _css, _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, createDocFromHTML_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, _ListItemNodeView_instances, init_fn2, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
13
13
  import * as Y from "yjs";
14
14
  import { UndoManager, Item as Item$1, ContentType, Text as Text$1, XmlElement, encodeStateAsUpdate } from "yjs";
15
- import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, i as canSplit, l as liftTarget, A as AllSelection, j as canJoin, k as joinPoint, N as NodeSelection, m as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, n as Slice, o as defaultBlockAt$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, y as findParentNode, L as ListHelpers, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as findParentNodeClosestToPos, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as EditorState, a8 as hasSomeParentWithClass, a9 as isActive, aa as parseSizeUnit, ab as minMax, ac as getLineHeightValueString, ad as InputRule, ae as kebabCase, af as generateOrderedListIndex, ag as getListItemStyleDefinitions, ah as docxNumberigHelpers, ai as parseIndentElement, aj as combineIndents, ak as getColStyleDeclaration, al as SelectionRange, am as Transform, an as isInTable$1, ao as createColGroup, ap as generateDocxRandomId } from "./converter-wprLSvGf.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, g as getExtensionConfigField, b as getMarkType, d as getMarksFromSelection, e as getNodeType, f as getSchemaTypeNameByName, S as Schema$1, h as cleanSchemaItem, T as TextSelection, i as canSplit, l as liftTarget, A as AllSelection, j as canJoin, k as joinPoint, N as NodeSelection, m as Selection, r as replaceStep$1, F as Fragment, R as ReplaceAroundStep$1, n as Slice, o as defaultBlockAt$1, p as isTextSelection, q as getMarkRange, s as isMarkActive, t as isNodeActive, u as deleteProps, D as DOMParser$1, v as ReplaceStep, w as NodeRange, x as findWrapping, y as findParentNode, L as ListHelpers, z as isMacOS, B as isIOS, C as DOMSerializer, E as Mark$1, G as dropPoint, H as process$1, I as Buffer2, J as getSchemaTypeByName, K as inputRulesPlugin, O as TrackDeleteMarkName, Q as TrackInsertMarkName, U as v4, V as TrackFormatMarkName, W as comments_module_events, X as findMark, Y as objectIncludes, Z as AddMarkStep, _ as RemoveMarkStep, $ as twipsToLines, a0 as pixelsToTwips, a1 as findParentNodeClosestToPos, a2 as helpers, a3 as posToDOMRect, a4 as CommandService, a5 as SuperConverter, a6 as createDocument, a7 as EditorState, a8 as hasSomeParentWithClass, a9 as isActive, aa as unflattenListsInHtml, ab as parseSizeUnit, ac as minMax, ad as getLineHeightValueString, ae as InputRule, af as kebabCase, ag as generateOrderedListIndex, ah as getListItemStyleDefinitions, ai as docxNumberigHelpers, aj as parseIndentElement, ak as combineIndents, al as getColStyleDeclaration, am as SelectionRange, an as Transform, ao as isInTable$1, ap as createColGroup, aq as generateDocxRandomId } from "./converter-BzUe-JDb.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-XpZaObsQ.js";
17
+ import { D as DocxZipper } from "./docx-zipper-DuNhxEi5.js";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
20
20
  };
@@ -12751,6 +12751,9 @@ const generateMissingListDefinition = (listNode, editor) => {
12751
12751
  const migrateParagraphFieldsListsV2 = async (annotationValues = [], editor) => {
12752
12752
  const annotations = getAllFieldAnnotations(editor.state);
12753
12753
  const newValues = [];
12754
+ if (!annotations.length) {
12755
+ return annotationValues;
12756
+ }
12754
12757
  for (const annotation of annotations) {
12755
12758
  const type = annotation.node?.attrs?.type;
12756
12759
  const matchedAnnotation = annotationValues.find((v) => v.input_id === annotation.node.attrs.fieldId);
@@ -13405,9 +13408,6 @@ const _Editor = class _Editor extends EventEmitter {
13405
13408
  const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
13406
13409
  return isActive(this.state, name, attributes);
13407
13410
  }
13408
- /**
13409
- * Get the document as JSON.
13410
- */
13411
13411
  /**
13412
13412
  * Get the editor content as JSON
13413
13413
  * @returns {Object} Editor content as JSON
@@ -13415,18 +13415,20 @@ const _Editor = class _Editor extends EventEmitter {
13415
13415
  getJSON() {
13416
13416
  return this.state.doc.toJSON();
13417
13417
  }
13418
- /**
13419
- * Get HTML string of the document
13420
- */
13421
13418
  /**
13422
13419
  * Get the editor content as HTML
13423
13420
  * @returns {string} Editor content as HTML
13424
13421
  */
13425
- getHTML() {
13426
- const div2 = document.createElement("div");
13422
+ getHTML({ unflattenLists = false } = {}) {
13423
+ const tempDocument = document.implementation.createHTMLDocument();
13424
+ const container = tempDocument.createElement("div");
13427
13425
  const fragment = DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);
13428
- div2.appendChild(fragment);
13429
- return div2.innerHTML;
13426
+ container.appendChild(fragment);
13427
+ let html = container.innerHTML;
13428
+ if (unflattenLists) {
13429
+ html = unflattenListsInHtml(html);
13430
+ }
13431
+ return html;
13430
13432
  }
13431
13433
  /**
13432
13434
  * Create a child editor linked to this editor.
@@ -13438,9 +13440,6 @@ const _Editor = class _Editor extends EventEmitter {
13438
13440
  createChildEditor(options) {
13439
13441
  return createLinkedChildEditor(this, options);
13440
13442
  }
13441
- /**
13442
- * Get page styles
13443
- */
13444
13443
  /**
13445
13444
  * Get page styles
13446
13445
  * @returns {Object} Page styles
@@ -13605,7 +13604,7 @@ const _Editor = class _Editor extends EventEmitter {
13605
13604
  * @returns {Object | void} Migration results
13606
13605
  */
13607
13606
  processCollaborationMigrations() {
13608
- console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.3");
13607
+ console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.5");
13609
13608
  if (!this.options.ydoc) return;
13610
13609
  const metaMap = this.options.ydoc.getMap("meta");
13611
13610
  let docVersion = metaMap.get("version");
@@ -13735,7 +13734,8 @@ const _Editor = class _Editor extends EventEmitter {
13735
13734
  */
13736
13735
  async migrateParagraphFields(annotationValues = []) {
13737
13736
  if (!Array.isArray(annotationValues) || !annotationValues.length) return annotationValues;
13738
- return await migrateParagraphFieldsListsV2(annotationValues, this);
13737
+ const result = await migrateParagraphFieldsListsV2(annotationValues, this);
13738
+ return result;
13739
13739
  }
13740
13740
  /**
13741
13741
  * Annotate the document with the given annotation values.
@@ -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 { H as process$1 } from "./converter-wprLSvGf.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-B-syl6XT.js";
2
+ import { H as process$1 } from "./converter-BzUe-JDb.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-D24ByYzx.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-wprLSvGf.js";
1
+ import { a5 } from "./chunks/converter-BzUe-JDb.js";
2
2
  export {
3
3
  a5 as SuperConverter
4
4
  };
@@ -390,22 +390,18 @@ export class Editor extends EventEmitter {
390
390
  * editor.isActive({ textAlign: 'center' })
391
391
  */
392
392
  isActive(nameOrAttributes: string | any, attributesOrUndefined?: any): boolean;
393
- /**
394
- * Get the document as JSON.
395
- */
396
393
  /**
397
394
  * Get the editor content as JSON
398
395
  * @returns {Object} Editor content as JSON
399
396
  */
400
397
  getJSON(): any;
401
- /**
402
- * Get HTML string of the document
403
- */
404
398
  /**
405
399
  * Get the editor content as HTML
406
400
  * @returns {string} Editor content as HTML
407
401
  */
408
- getHTML(): string;
402
+ getHTML({ unflattenLists }?: {
403
+ unflattenLists?: boolean;
404
+ }): string;
409
405
  /**
410
406
  * Create a child editor linked to this editor.
411
407
  * This is useful for creating header/footer editors that are linked to the main editor.
@@ -414,9 +410,6 @@ export class Editor extends EventEmitter {
414
410
  * @returns {Editor} A new child editor instance linked to this editor
415
411
  */
416
412
  createChildEditor(options: EditorOptions): Editor;
417
- /**
418
- * Get page styles
419
- */
420
413
  /**
421
414
  * Get page styles
422
415
  * @returns {Object} Page styles
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/core/Editor.js"],"names":[],"mappings":"AAmCA;;;;GAIG;AAEH;;;;;GAKG;AACH;;;;;EAKE;AAEF;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH;;;;GAIG;AACH;IA+sBE;;;;;;;;;;;;OAYG;IACH,+BARW,IAAI,GAAC,IAAI,GAAC,MAAM,WAChB,OAAO,GACL,OAAO,OAAO,CAc1B;IAED;;;;;OAKG;IACH,qCAFa,MAAM,CAKlB;IAED;;;;;;OAMG;IACH,gDAHW,MAAM,OAMhB;IA8vBD;;;;;OAKG;IACH,2CAFa,OAAO,CAOnB;IAj5CD;;;;OAIG;IACH,qBAHW,aAAa,EAwBvB;IAtID;;;OAGG;IACH,sBAAiB;IAEjB;;;OAGG;IACH,sBAAsB;IAEtB;;;OAGG;IACH,YAAO;IAEP;;;OAGG;IACH,UAAK;IAEL;;;OAGG;IACH,WAFU,OAAO,CAEC;IAQlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAsEE;IA0BA,0CAA8C;IAIhD;;;OAGG;IACH,kBAFa,OAAO,CAInB;IAuHD,qBAOC;IAED,gBAMC;IAeD;;;;OAIG;IACH,0BAFa,IAAI,CAIhB;IADC,aAAsB;IAsBxB;;;OAGG;IACH,SAFa,IAAI,CAIhB;IAED;;;OAGG;IACH,iBAEC;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,kBAFa,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFa,OAAO,CAInB;IAED;;;OAGG;IACH,eAFa,WAAW,CAIvB;IAED;;;OAGG;IACH,aAFa,KAAK,CAAE,IAAI,CAAC,CAIxB;IAED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;;uBAGP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAuBP,OAAO;;;;mBACP,OAAO;;;;WACP,MAAM;;6BAjHS,mBAAmB"}
@@ -4,4 +4,8 @@
4
4
  */
5
5
  export function flattenListsInHtml(html: any, editor: any): any;
6
6
  export function flattenSingleList(listElem: any, editor: any, level: number, parentNumId: any, NodeInterface: any): any[];
7
+ /**
8
+ * Converts flatten lists back to normal list structure.
9
+ */
10
+ export function unflattenListsInHtml(html: any): string;
7
11
  //# sourceMappingURL=html-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-helpers.d.ts","sourceRoot":"","sources":["../../../../src/core/inputRules/html/html-helpers.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,gEAqBC;AAmKD,0HAgBC"}
1
+ {"version":3,"file":"html-helpers.d.ts","sourceRoot":"","sources":["../../../../src/core/inputRules/html/html-helpers.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,gEAqBC;AAmKD,0HAgBC;AAED;;GAEG;AACH,wDAoEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"listsv2migration.d.ts","sourceRoot":"","sources":["../../../../src/core/migrations/0.14-listsv2/listsv2migration.js"],"names":[],"mappings":"AAkBO,oDANI,MAAM,OAyEhB;AA0MM,qFAHO,OAAO,OAAO,CA6C3B"}
1
+ {"version":3,"file":"listsv2migration.d.ts","sourceRoot":"","sources":["../../../../src/core/migrations/0.14-listsv2/listsv2migration.js"],"names":[],"mappings":"AAkBO,oDANI,MAAM,OAyEhB;AA0MM,qFAHO,OAAO,OAAO,CAiD3B"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-wprLSvGf.js";
2
- import { D } from "./chunks/docx-zipper-XpZaObsQ.js";
1
+ import "./chunks/converter-BzUe-JDb.js";
2
+ import { D } from "./chunks/docx-zipper-DuNhxEi5.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-B-syl6XT.js";
2
- import "./chunks/converter-wprLSvGf.js";
3
- import "./chunks/docx-zipper-XpZaObsQ.js";
1
+ import { E } from "./chunks/editor-D24ByYzx.js";
2
+ import "./chunks/converter-BzUe-JDb.js";
3
+ import "./chunks/docx-zipper-DuNhxEi5.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-XpZaObsQ.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-DuNhxEi5.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -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 { ar as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, au as vClickOutside, y as findParentNode, av as getActiveFormatting, an as isInTable, aw as readFromClipboard, ax as handleClipboardPaste, a as Plugin } from "./chunks/converter-wprLSvGf.js";
13
- import { a5, d, a2 } from "./chunks/converter-wprLSvGf.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, 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-B-syl6XT.js";
15
- import { k, C, T, i, l, j } from "./chunks/editor-B-syl6XT.js";
12
+ import { as as getDefaultExportFromCjs, U as v4, T as TextSelection$1, q as getMarkRange, av as vClickOutside, y as findParentNode, aw as getActiveFormatting, ao as isInTable, ax as readFromClipboard, ay as handleClipboardPaste, a as Plugin } from "./chunks/converter-BzUe-JDb.js";
13
+ import { a5, d, a2 } from "./chunks/converter-BzUe-JDb.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, c as getFileOpener, s as startImageUpload, 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-D24ByYzx.js";
15
+ import { k, C, T, i, l, j } from "./chunks/editor-D24ByYzx.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, l as linkIconSvg, a as tableIconSvg, b as scissorsIconSvg, c as copyIconSvg, p as pasteIconSvg, N as NSkeleton } from "./chunks/toolbar-D0Pksjxw.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, m as magicWandIcon, l as linkIconSvg, a as tableIconSvg, b as scissorsIconSvg, c as copyIconSvg, p as pasteIconSvg, N as NSkeleton } from "./chunks/toolbar-CCP8GEjh.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-XpZaObsQ.js";
19
+ import { D } from "./chunks/docx-zipper-DuNhxEi5.js";
20
20
  import { createZip } from "./file-zipper.es.js";
21
21
  var eventemitter3 = { exports: {} };
22
22
  (function(module) {
@@ -1,6 +1,6 @@
1
1
  import "vue";
2
- import { T } from "./chunks/toolbar-D0Pksjxw.js";
3
- import "./chunks/editor-B-syl6XT.js";
2
+ import { T } from "./chunks/toolbar-CCP8GEjh.js";
3
+ import "./chunks/editor-D24ByYzx.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-D4w4gOxp.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CEXGZ_L5.cjs");
4
4
  require("./chunks/vue-tQYF719J.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, c, S, d, e, f, T, g, h, i, j, k, l, m, n, o, p } from "./chunks/super-editor.es-Cm485wgf.es.js";
1
+ import { A, a, _, C, D, E, b, c, S, d, e, f, T, g, h, i, j, k, l, m, n, o, p } from "./chunks/super-editor.es-BqxptPXi.es.js";
2
2
  import "./chunks/vue-lU0o_RlU.es.js";
3
3
  export {
4
4
  A as AIWriter,
package/dist/superdoc.cjs CHANGED
@@ -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-D4w4gOxp.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CEXGZ_L5.cjs");
4
4
  const vue = require("./chunks/vue-tQYF719J.cjs");
5
5
  const jszip = require("./chunks/jszip-D5XoMX4C.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -47815,7 +47815,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
47815
47815
  this.config.colors = shuffleArray(this.config.colors);
47816
47816
  this.userColorMap = /* @__PURE__ */ new Map();
47817
47817
  this.colorIndex = 0;
47818
- this.version = "0.14.9-next.3";
47818
+ this.version = "0.14.9-next.5";
47819
47819
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47820
47820
  this.superdocId = config.superdocId || uuid.v4();
47821
47821
  this.colors = this.config.colors;
@@ -48227,7 +48227,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
48227
48227
  * Get the HTML content of all editors
48228
48228
  * @returns {Array<string>} The HTML content of all editors
48229
48229
  */
48230
- getHTML() {
48230
+ getHTML(options = {}) {
48231
48231
  const editors = [];
48232
48232
  this.superdocStore.documents.forEach((doc) => {
48233
48233
  const editor = doc.getEditor();
@@ -48235,7 +48235,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
48235
48235
  editors.push(editor);
48236
48236
  }
48237
48237
  });
48238
- return editors.map((editor) => editor.getHTML());
48238
+ return editors.map((editor) => editor.getHTML(options));
48239
48239
  }
48240
48240
  /**
48241
48241
  * Lock the current superdoc
@@ -1,5 +1,5 @@
1
- import { p as index$1, C as CommentsPluginKey, g as TrackChangesBasePluginKey, E as Editor, m as getRichTextExtensions, e as SuperInput, d as SuperEditor, A as AIWriter, f as SuperToolbar, h as createZip } from "./chunks/super-editor.es-Cm485wgf.es.js";
2
- import { a, S, i, o } from "./chunks/super-editor.es-Cm485wgf.es.js";
1
+ import { p as index$1, C as CommentsPluginKey, g as TrackChangesBasePluginKey, E as Editor, m as getRichTextExtensions, e as SuperInput, d as SuperEditor, A as AIWriter, f as SuperToolbar, h as createZip } from "./chunks/super-editor.es-BqxptPXi.es.js";
2
+ import { a, S, i, o } from "./chunks/super-editor.es-BqxptPXi.es.js";
3
3
  import { a0 as effectScope, r as ref, $ as markRaw, p as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a4 as hasInjectionContext, N as reactive, u as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, K as shallowRef, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, s as onDeactivated, A as createTextVNode, F as Fragment, R as Comment, m as defineComponent, E as provide, I as withDirectives, C as h, V as Teleport, S as renderSlot, W as isVNode, J as watchEffect, P as Transition, G as mergeProps, Q as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, x as createVNode, z as withCtx, f as createBaseVNode, B as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, a8 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, Y as resolveDynamicComponent } from "./chunks/vue-lU0o_RlU.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-CYDYUNnI.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -47798,7 +47798,7 @@ class SuperDoc extends EventEmitter {
47798
47798
  this.config.colors = shuffleArray(this.config.colors);
47799
47799
  this.userColorMap = /* @__PURE__ */ new Map();
47800
47800
  this.colorIndex = 0;
47801
- this.version = "0.14.9-next.3";
47801
+ this.version = "0.14.9-next.5";
47802
47802
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47803
47803
  this.superdocId = config.superdocId || v4();
47804
47804
  this.colors = this.config.colors;
@@ -48210,7 +48210,7 @@ class SuperDoc extends EventEmitter {
48210
48210
  * Get the HTML content of all editors
48211
48211
  * @returns {Array<string>} The HTML content of all editors
48212
48212
  */
48213
- getHTML() {
48213
+ getHTML(options = {}) {
48214
48214
  const editors = [];
48215
48215
  this.superdocStore.documents.forEach((doc) => {
48216
48216
  const editor = doc.getEditor();
@@ -48218,7 +48218,7 @@ class SuperDoc extends EventEmitter {
48218
48218
  editors.push(editor);
48219
48219
  }
48220
48220
  });
48221
- return editors.map((editor) => editor.getHTML());
48221
+ return editors.map((editor) => editor.getHTML(options));
48222
48222
  }
48223
48223
  /**
48224
48224
  * Lock the current superdoc
@@ -30110,6 +30110,113 @@
30110
30110
  newList.appendChild(newLi);
30111
30111
  return newList;
30112
30112
  }
30113
+ function unflattenListsInHtml(html) {
30114
+ const parser = new DOMParser();
30115
+ const doc2 = parser.parseFromString(html, "text/html");
30116
+ const allNodes = [...doc2.body.children];
30117
+ const listSequences = [];
30118
+ let currentSequence = null;
30119
+ allNodes.forEach((node2, index2) => {
30120
+ const isFlattenList = node2.tagName && (node2.tagName === "OL" || node2.tagName === "UL") && node2.hasAttribute("data-list-id");
30121
+ if (isFlattenList) {
30122
+ const listId = node2.getAttribute("data-list-id");
30123
+ if (currentSequence && currentSequence.id === listId) {
30124
+ currentSequence.lists.push({ element: node2, index: index2 });
30125
+ } else {
30126
+ currentSequence = {
30127
+ id: listId,
30128
+ lists: [{ element: node2, index: index2 }]
30129
+ };
30130
+ listSequences.push(currentSequence);
30131
+ }
30132
+ } else {
30133
+ currentSequence = null;
30134
+ }
30135
+ });
30136
+ listSequences.reverse().forEach((sequence) => {
30137
+ const sequenceLists = sequence.lists;
30138
+ if (sequenceLists.length === 0) {
30139
+ return;
30140
+ }
30141
+ const items = sequenceLists.map(({ element: list }) => {
30142
+ const liElement = list.querySelector("li");
30143
+ if (!liElement) return null;
30144
+ return {
30145
+ element: liElement,
30146
+ level: parseInt(liElement.getAttribute("data-level") || "0"),
30147
+ numFmt: liElement.getAttribute("data-num-fmt") || "bullet",
30148
+ listLevel: JSON.parse(liElement.getAttribute("data-list-level") || "[1]")
30149
+ };
30150
+ }).filter((item) => item !== null);
30151
+ if (items.length === 0) {
30152
+ return;
30153
+ }
30154
+ const rootList = buildNestedList({ items });
30155
+ const firstOriginalList = sequenceLists[0].element;
30156
+ firstOriginalList?.parentNode?.insertBefore(rootList, firstOriginalList);
30157
+ sequenceLists.forEach(({ element: list }) => {
30158
+ if (list.parentNode) list.parentNode.removeChild(list);
30159
+ });
30160
+ });
30161
+ return doc2.body.innerHTML;
30162
+ }
30163
+ function buildNestedList({ items }) {
30164
+ if (!items.length) {
30165
+ return null;
30166
+ }
30167
+ const [rootItem] = items;
30168
+ const doc2 = rootItem.element.ownerDocument;
30169
+ const isOrderedList = rootItem.numFmt && !["bullet", "none"].includes(rootItem.numFmt);
30170
+ const rootList = doc2.createElement(isOrderedList ? "ol" : "ul");
30171
+ if (isOrderedList && rootItem.listLevel?.[0] && rootItem.listLevel[0] > 1) {
30172
+ rootList.setAttribute("start", rootItem.listLevel[0]);
30173
+ }
30174
+ const lastLevelItem = /* @__PURE__ */ new Map();
30175
+ items.forEach((item) => {
30176
+ const { element: liElement, level, numFmt, listLevel } = item;
30177
+ const cleanLi = cleanListItem(liElement.cloneNode(true));
30178
+ if (level === 0) {
30179
+ rootList.append(cleanLi);
30180
+ lastLevelItem.set(0, cleanLi);
30181
+ } else {
30182
+ const parentLi = lastLevelItem.get(level - 1);
30183
+ if (!parentLi) {
30184
+ rootList.append(cleanLi);
30185
+ lastLevelItem.set(level, cleanLi);
30186
+ return;
30187
+ }
30188
+ let nestedList = null;
30189
+ [...parentLi.children].forEach((child) => {
30190
+ if (child.tagName && (child.tagName === "OL" || child.tagName === "UL")) {
30191
+ nestedList = child;
30192
+ }
30193
+ });
30194
+ if (!nestedList) {
30195
+ const listType = numFmt && !["bullet", "none"].includes(numFmt) ? "ol" : "ul";
30196
+ nestedList = doc2.createElement(listType);
30197
+ parentLi.append(nestedList);
30198
+ }
30199
+ nestedList.append(cleanLi);
30200
+ lastLevelItem.set(level, cleanLi);
30201
+ }
30202
+ });
30203
+ return rootList;
30204
+ }
30205
+ function cleanListItem(listItem) {
30206
+ const attrs = [
30207
+ "data-num-id",
30208
+ "data-level",
30209
+ "data-num-fmt",
30210
+ "data-lvl-text",
30211
+ "data-list-level",
30212
+ "data-marker-type",
30213
+ "aria-label"
30214
+ ];
30215
+ attrs.forEach((attr) => {
30216
+ listItem.removeAttribute(attr);
30217
+ });
30218
+ return listItem;
30219
+ }
30113
30220
  class InputRule {
30114
30221
  constructor(config) {
30115
30222
  __publicField$2(this, "match");
@@ -33754,7 +33861,7 @@
33754
33861
  return;
33755
33862
  }
33756
33863
  }
33757
- static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.3") {
33864
+ static updateDocumentVersion(docx = this.convertedXml, version2 = "0.14.9-next.5") {
33758
33865
  const customLocation = "docProps/custom.xml";
33759
33866
  if (!docx[customLocation]) {
33760
33867
  docx[customLocation] = generateCustomXml();
@@ -34230,7 +34337,7 @@
34230
34337
  function generateCustomXml() {
34231
34338
  return DEFAULT_CUSTOM_XML;
34232
34339
  }
34233
- function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.3") {
34340
+ function generateSuperdocVersion(pid = 2, version2 = "0.14.9-next.5") {
34234
34341
  return {
34235
34342
  type: "element",
34236
34343
  name: "property",
@@ -49491,6 +49598,9 @@
49491
49598
  const migrateParagraphFieldsListsV2 = async (annotationValues = [], editor) => {
49492
49599
  const annotations = getAllFieldAnnotations(editor.state);
49493
49600
  const newValues = [];
49601
+ if (!annotations.length) {
49602
+ return annotationValues;
49603
+ }
49494
49604
  for (const annotation of annotations) {
49495
49605
  const type2 = annotation.node?.attrs?.type;
49496
49606
  const matchedAnnotation = annotationValues.find((v) => v.input_id === annotation.node.attrs.fieldId);
@@ -50117,9 +50227,6 @@
50117
50227
  const attributes = typeof nameOrAttributes === "string" ? attributesOrUndefined : nameOrAttributes;
50118
50228
  return isActive(this.state, name, attributes);
50119
50229
  }
50120
- /**
50121
- * Get the document as JSON.
50122
- */
50123
50230
  /**
50124
50231
  * Get the editor content as JSON
50125
50232
  * @returns {Object} Editor content as JSON
@@ -50127,18 +50234,20 @@
50127
50234
  getJSON() {
50128
50235
  return this.state.doc.toJSON();
50129
50236
  }
50130
- /**
50131
- * Get HTML string of the document
50132
- */
50133
50237
  /**
50134
50238
  * Get the editor content as HTML
50135
50239
  * @returns {string} Editor content as HTML
50136
50240
  */
50137
- getHTML() {
50138
- const div2 = document.createElement("div");
50241
+ getHTML({ unflattenLists = false } = {}) {
50242
+ const tempDocument = document.implementation.createHTMLDocument();
50243
+ const container = tempDocument.createElement("div");
50139
50244
  const fragment = DOMSerializer.fromSchema(this.schema).serializeFragment(this.state.doc.content);
50140
- div2.appendChild(fragment);
50141
- return div2.innerHTML;
50245
+ container.appendChild(fragment);
50246
+ let html = container.innerHTML;
50247
+ if (unflattenLists) {
50248
+ html = unflattenListsInHtml(html);
50249
+ }
50250
+ return html;
50142
50251
  }
50143
50252
  /**
50144
50253
  * Create a child editor linked to this editor.
@@ -50150,9 +50259,6 @@
50150
50259
  createChildEditor(options2) {
50151
50260
  return createLinkedChildEditor(this, options2);
50152
50261
  }
50153
- /**
50154
- * Get page styles
50155
- */
50156
50262
  /**
50157
50263
  * Get page styles
50158
50264
  * @returns {Object} Page styles
@@ -50317,7 +50423,7 @@
50317
50423
  * @returns {Object | void} Migration results
50318
50424
  */
50319
50425
  processCollaborationMigrations() {
50320
- console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.3");
50426
+ console.debug("[checkVersionMigrations] Current editor version", "0.14.9-next.5");
50321
50427
  if (!this.options.ydoc) return;
50322
50428
  const metaMap = this.options.ydoc.getMap("meta");
50323
50429
  let docVersion = metaMap.get("version");
@@ -50447,7 +50553,8 @@
50447
50553
  */
50448
50554
  async migrateParagraphFields(annotationValues = []) {
50449
50555
  if (!Array.isArray(annotationValues) || !annotationValues.length) return annotationValues;
50450
- return await migrateParagraphFieldsListsV2(annotationValues, this);
50556
+ const result = await migrateParagraphFieldsListsV2(annotationValues, this);
50557
+ return result;
50451
50558
  }
50452
50559
  /**
50453
50560
  * Annotate the document with the given annotation values.
@@ -96088,7 +96195,7 @@ ${style2}
96088
96195
  this.config.colors = shuffleArray(this.config.colors);
96089
96196
  this.userColorMap = /* @__PURE__ */ new Map();
96090
96197
  this.colorIndex = 0;
96091
- this.version = "0.14.9-next.3";
96198
+ this.version = "0.14.9-next.5";
96092
96199
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
96093
96200
  this.superdocId = config.superdocId || v4();
96094
96201
  this.colors = this.config.colors;
@@ -96500,7 +96607,7 @@ ${style2}
96500
96607
  * Get the HTML content of all editors
96501
96608
  * @returns {Array<string>} The HTML content of all editors
96502
96609
  */
96503
- getHTML() {
96610
+ getHTML(options2 = {}) {
96504
96611
  const editors = [];
96505
96612
  this.superdocStore.documents.forEach((doc2) => {
96506
96613
  const editor = doc2.getEditor();
@@ -96508,7 +96615,7 @@ ${style2}
96508
96615
  editors.push(editor);
96509
96616
  }
96510
96617
  });
96511
- return editors.map((editor) => editor.getHTML());
96618
+ return editors.map((editor) => editor.getHTML(options2));
96512
96619
  }
96513
96620
  /**
96514
96621
  * Lock the current superdoc