@harbour-enterprises/superdoc 0.14.0-next.5 → 0.14.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.
@@ -9,12 +9,12 @@ 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 __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
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, initPagination_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;
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, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, r as replaceStep$1, e as Selection, F as Fragment, R as ReplaceAroundStep$1, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as generateDocxRandomId, p as minMax, q as chainableEditorState, s as generateRandom32BitHex, t as getStyleTagFromStyleId, u as getAbstractDefinition, v as getDefinitionForLevel, w as isMacOS, x as isIOS, y as DOMSerializer, z as Mark$1, B as dropPoint, C as process$1, E as Buffer2, G as inputRulesPlugin, H as TrackDeleteMarkName, I as TrackInsertMarkName, J as v4, K as TrackFormatMarkName, L as comments_module_events, O as AddMarkStep, Q as RemoveMarkStep, U as twipsToLines, V as pixelsToTwips, W as CommandService, X as SuperConverter, Y as EditorState, Z as hasSomeParentWithClass, _ as parseSizeUnit, $ as getLineHeightValueString, a0 as InputRule, a1 as toKebabCase, a2 as kebabCase, a3 as docxNumberigHelpers, a4 as parseIndentElement, a5 as combineIndents, a6 as getColStyleDeclaration, a7 as SelectionRange, a8 as Transform, a9 as createColGroup } from "./converter-3dVTYXnm.js";
15
+ import { P as PluginKey, a as Plugin, M as Mapping, c as callOrGet, i as isEmptyObject, S as Schema$1, T as TextSelection, b as canSplit, l as liftTarget, A as AllSelection, d as canJoin, j as joinPoint, N as NodeSelection, r as replaceStep$1, e as Selection, F as Fragment, R as ReplaceAroundStep$1, f as Slice, o as objectIncludes, g as deleteProps, D as DOMParser$1, h as ReplaceStep, k as NodeRange, m as findWrapping, n as generateDocxRandomId, p as minMax, q as chainableEditorState, s as generateRandom32BitHex, t as getStyleTagFromStyleId, u as getAbstractDefinition, v as getDefinitionForLevel, w as isMacOS, x as isIOS, y as DOMSerializer, z as Mark$1, B as dropPoint, C as process$1, E as Buffer2, G as inputRulesPlugin, H as TrackDeleteMarkName, I as TrackInsertMarkName, J as v4, K as TrackFormatMarkName, L as comments_module_events, O as AddMarkStep, Q as RemoveMarkStep, U as twipsToLines, V as pixelsToTwips, W as CommandService, X as SuperConverter, Y as EditorState, Z as hasSomeParentWithClass, _ as parseSizeUnit, $ as getLineHeightValueString, a0 as InputRule, a1 as toKebabCase, a2 as kebabCase, a3 as docxNumberigHelpers, a4 as parseIndentElement, a5 as combineIndents, a6 as getColStyleDeclaration, a7 as SelectionRange, a8 as Transform, a9 as createColGroup } from "./converter-DXxu8c9w.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-CAF6BgPQ.js";
17
+ import { D as DocxZipper } from "./docx-zipper-DjxR5LqI.js";
18
18
  function getMarksFromSelection(state) {
19
19
  const { from: from2, to, empty: empty2 } = state.selection;
20
20
  const marks = [];
@@ -14327,10 +14327,10 @@ const _Editor = class _Editor extends EventEmitter {
14327
14327
  }
14328
14328
  /**
14329
14329
  * Unregister a PM plugin
14330
- * @param {string|Object} nameOrPlugin - Plugin name or plugin instance
14330
+ * @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
14331
14331
  * @returns {void}
14332
14332
  */
14333
- unregisterPlugin(nameOrPlugin) {
14333
+ unregisterPlugin(nameOrPluginKey) {
14334
14334
  if (this.isDestroyed) return;
14335
14335
  const name = typeof nameOrPluginKey === "string" ? `${nameOrPluginKey}$` : nameOrPluginKey.key;
14336
14336
  const state = this.state.reconfigure({
@@ -14408,7 +14408,7 @@ const _Editor = class _Editor extends EventEmitter {
14408
14408
  /**
14409
14409
  * Attach styles and attributes to the editor element
14410
14410
  */
14411
- updateEditorStyles(element, proseMirror) {
14411
+ updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
14412
14412
  const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
14413
14413
  if (!proseMirror || !element) {
14414
14414
  return;
@@ -14442,9 +14442,12 @@ const _Editor = class _Editor extends EventEmitter {
14442
14442
  element.style.webkitOverflowScrolling = "touch";
14443
14443
  const defaultLineHeight = 1.2;
14444
14444
  proseMirror.style.lineHeight = defaultLineHeight;
14445
- if (!this.options.extensions.find((e) => e.name === "pagination")) {
14445
+ if (!hasPaginationEnabled) {
14446
14446
  proseMirror.style.paddingTop = "1in";
14447
14447
  proseMirror.style.paddingBottom = "1in";
14448
+ } else {
14449
+ proseMirror.style.paddingTop = "0";
14450
+ proseMirror.style.paddingBottom = "0";
14448
14451
  }
14449
14452
  }
14450
14453
  /**
@@ -14455,10 +14458,10 @@ const _Editor = class _Editor extends EventEmitter {
14455
14458
  * @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
14456
14459
  * @returns {void}
14457
14460
  */
14458
- initDefaultStyles(element = this.element) {
14461
+ initDefaultStyles(element = this.element, isPaginationEnabled = true) {
14459
14462
  if (this.options.isHeadless || this.options.suppressDefaultDocxStyles) return;
14460
14463
  const proseMirror = element?.querySelector(".ProseMirror");
14461
- this.updateEditorStyles(element, proseMirror);
14464
+ this.updateEditorStyles(element, proseMirror, isPaginationEnabled);
14462
14465
  this.initMobileStyles(element);
14463
14466
  }
14464
14467
  /**
@@ -14506,6 +14509,25 @@ const _Editor = class _Editor extends EventEmitter {
14506
14509
  }
14507
14510
  window.addEventListener("resize", () => handleResize);
14508
14511
  }
14512
+ /**
14513
+ * Initialize pagination, if the pagination extension is enabled.
14514
+ * @private
14515
+ * @async
14516
+ * @returns {Promise<void>}
14517
+ */
14518
+ async initPagination() {
14519
+ if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
14520
+ return;
14521
+ }
14522
+ const pagination = this.options.extensions.find((e) => e.name === "pagination");
14523
+ if (pagination && this.options.pagination) {
14524
+ const sectionData = await initPaginationData(this);
14525
+ this.storage.pagination.sectionData = sectionData;
14526
+ const { state, dispatch } = this.view;
14527
+ const tr = state.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
14528
+ dispatch(tr);
14529
+ }
14530
+ }
14509
14531
  /**
14510
14532
  * Get attrs of the currently selected node or mark.
14511
14533
  * @param {String} nameOrType
@@ -14715,7 +14737,7 @@ const _Editor = class _Editor extends EventEmitter {
14715
14737
  * @returns {Object | void} Migration results
14716
14738
  */
14717
14739
  processCollaborationMigrations() {
14718
- console.debug("[checkVersionMigrations] Current editor version", "0.14.0-next.5");
14740
+ console.debug("[checkVersionMigrations] Current editor version", "0.14.0-next.6");
14719
14741
  if (!this.options.ydoc) return;
14720
14742
  const metaMap = this.options.ydoc.getMap("meta");
14721
14743
  let docVersion = metaMap.get("version");
@@ -14765,7 +14787,7 @@ const _Editor = class _Editor extends EventEmitter {
14765
14787
  __privateMethod(this, _Editor_instances, insertNewFileData_fn).call(this);
14766
14788
  }
14767
14789
  if (!this.options.ydoc) {
14768
- __privateMethod(this, _Editor_instances, initPagination_fn).call(this);
14790
+ this.initPagination();
14769
14791
  __privateMethod(this, _Editor_instances, initComments_fn).call(this);
14770
14792
  }
14771
14793
  }
@@ -14944,7 +14966,7 @@ init_fn = function(options) {
14944
14966
  this.on("comment-positions", this.options.onCommentLocationsUpdate);
14945
14967
  this.initializeCollaborationData();
14946
14968
  if (!this.options.ydoc) {
14947
- __privateMethod(this, _Editor_instances, initPagination_fn).call(this);
14969
+ this.initPagination();
14948
14970
  __privateMethod(this, _Editor_instances, initComments_fn).call(this);
14949
14971
  }
14950
14972
  };
@@ -15020,7 +15042,7 @@ insertNewFileData_fn = function() {
15020
15042
  const tr = this.state.tr.replaceWith(0, this.state.doc.content.size, doc2);
15021
15043
  this.view.dispatch(tr);
15022
15044
  setTimeout(() => {
15023
- __privateMethod(this, _Editor_instances, initPagination_fn).call(this);
15045
+ this.initPagination();
15024
15046
  __privateMethod(this, _Editor_instances, initComments_fn).call(this);
15025
15047
  }, 50);
15026
15048
  };
@@ -15231,7 +15253,7 @@ onCollaborationReady_fn = function({ editor, ydoc }) {
15231
15253
  this.options.onCollaborationReady({ editor, ydoc });
15232
15254
  this.options.collaborationIsReady = true;
15233
15255
  if (!this.options.isNewFile) {
15234
- __privateMethod(this, _Editor_instances, initPagination_fn).call(this);
15256
+ this.initPagination();
15235
15257
  __privateMethod(this, _Editor_instances, initComments_fn).call(this);
15236
15258
  }
15237
15259
  };
@@ -15253,19 +15275,6 @@ initComments_fn = function() {
15253
15275
  dispatch(tr);
15254
15276
  }, 50);
15255
15277
  };
15256
- initPagination_fn = async function() {
15257
- if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
15258
- return;
15259
- }
15260
- const pagination = this.options.extensions.find((e) => e.name === "pagination");
15261
- if (pagination && this.options.pagination) {
15262
- const sectionData = await initPaginationData(this);
15263
- this.storage.pagination.sectionData = sectionData;
15264
- const { state, dispatch } = this.view;
15265
- const tr = state.tr.setMeta(PaginationPluginKey, { isReadyToInit: true });
15266
- dispatch(tr);
15267
- }
15268
- };
15269
15278
  /**
15270
15279
  * Dispatch a transaction to update the editor state
15271
15280
  * @private
@@ -27915,6 +27924,19 @@ const Pagination = Extension.create({
27915
27924
  return commands2.insertContent({
27916
27925
  type: "hardBreak"
27917
27926
  });
27927
+ },
27928
+ /**
27929
+ * Toggle pagination on/off
27930
+ * @returns {void}
27931
+ */
27932
+ togglePagination: () => ({ tr, state, dispatch, editor }) => {
27933
+ const isEnabled = PaginationPluginKey.getState(state)?.isEnabled;
27934
+ tr.setMeta(PaginationPluginKey, { isEnabled: !isEnabled });
27935
+ if (dispatch) {
27936
+ dispatch(tr);
27937
+ editor.initDefaultStyles(editor.element, !isEnabled);
27938
+ return true;
27939
+ }
27918
27940
  }
27919
27941
  };
27920
27942
  },
@@ -27940,11 +27962,21 @@ const Pagination = Extension.create({
27940
27962
  return {
27941
27963
  isReadyToInit: false,
27942
27964
  decorations: DecorationSet.empty,
27943
- isDebugging
27965
+ isDebugging,
27966
+ isEnabled: editor.options.pagination
27944
27967
  };
27945
27968
  },
27946
27969
  apply(tr, oldState, prevEditorState, newEditorState) {
27947
27970
  const meta = tr.getMeta(PaginationPluginKey);
27971
+ if (meta && "isEnabled" in meta) {
27972
+ const newEnabled = meta.isEnabled;
27973
+ if (newEnabled) shouldUpdate = true;
27974
+ return {
27975
+ ...oldState,
27976
+ decorations: newEnabled ? oldState.decorations : DecorationSet.empty,
27977
+ isEnabled: newEnabled
27978
+ };
27979
+ }
27948
27980
  if (meta && meta.isReadyToInit) {
27949
27981
  shouldUpdate = true;
27950
27982
  shouldInitialize = meta.isReadyToInit;
@@ -27994,6 +28026,7 @@ const Pagination = Extension.create({
27994
28026
  let previousDecorations = DecorationSet.empty;
27995
28027
  return {
27996
28028
  update: (view2, prevState) => {
28029
+ if (!PaginationPluginKey.getState(view2.state)?.isEnabled) return;
27997
28030
  if (!shouldUpdate || isUpdating) return;
27998
28031
  isUpdating = true;
27999
28032
  hasInitialized = true;
@@ -28005,7 +28038,8 @@ const Pagination = Extension.create({
28005
28038
  },
28006
28039
  props: {
28007
28040
  decorations(state) {
28008
- return PaginationPluginKey.getState(state).decorations;
28041
+ const pluginState = PaginationPluginKey.getState(state);
28042
+ return pluginState.isEnabled ? pluginState.decorations : DecorationSet.empty;
28009
28043
  }
28010
28044
  }
28011
28045
  });
@@ -1,6 +1,6 @@
1
1
  import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, nextTick, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
2
- import { C as process$1 } from "./converter-3dVTYXnm.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-NHY1ApZn.js";
2
+ import { C as process$1 } from "./converter-DXxu8c9w.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DQyfLPCk.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 { X } from "./chunks/converter-3dVTYXnm.js";
1
+ import { X } from "./chunks/converter-DXxu8c9w.js";
2
2
  export {
3
3
  X as SuperConverter
4
4
  };
@@ -320,10 +320,10 @@ export class Editor extends EventEmitter {
320
320
  registerPlugin(plugin: any, handlePlugins: any): void;
321
321
  /**
322
322
  * Unregister a PM plugin
323
- * @param {string|Object} nameOrPlugin - Plugin name or plugin instance
323
+ * @param {string|Object} nameOrPluginKey - Plugin name or plugin instance
324
324
  * @returns {void}
325
325
  */
326
- unregisterPlugin(nameOrPlugin: string | any): void;
326
+ unregisterPlugin(nameOrPluginKey: string | any): void;
327
327
  converter: any;
328
328
  /**
329
329
  * Creates all node views.
@@ -338,7 +338,7 @@ export class Editor extends EventEmitter {
338
338
  /**
339
339
  * Attach styles and attributes to the editor element
340
340
  */
341
- updateEditorStyles(element: any, proseMirror: any): void;
341
+ updateEditorStyles(element: any, proseMirror: any, hasPaginationEnabled?: boolean): void;
342
342
  /**
343
343
  * Initialize default styles for the editor container and ProseMirror.
344
344
  * Get page size and margins from the converter.
@@ -347,7 +347,7 @@ export class Editor extends EventEmitter {
347
347
  * @param {HTMLElement} [element=this.element] - The DOM element to apply styles to
348
348
  * @returns {void}
349
349
  */
350
- initDefaultStyles(element?: HTMLElement): void;
350
+ initDefaultStyles(element?: HTMLElement, isPaginationEnabled?: boolean): void;
351
351
  /**
352
352
  * Initializes responsive styles for mobile devices.
353
353
  * Sets up scaling based on viewport width and handles orientation changes.
@@ -356,6 +356,13 @@ export class Editor extends EventEmitter {
356
356
  * @returns {void}
357
357
  */
358
358
  initMobileStyles(element: HTMLElement | void): void;
359
+ /**
360
+ * Initialize pagination, if the pagination extension is enabled.
361
+ * @private
362
+ * @async
363
+ * @returns {Promise<void>}
364
+ */
365
+ private initPagination;
359
366
  /**
360
367
  * Get attrs of the currently selected node or mark.
361
368
  * @param {String} nameOrType
@@ -1 +1 @@
1
- {"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/core/Editor.js"],"names":[],"mappings":"AA6BA;;;;GAIG;AAEH;;;;;GAKG;AACH;;;;;EAKE;AAEF;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH;;;;GAIG;AACH;IA6rBE;;;;;;;;;;;;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;IAouBD;;;;;OAKG;IACH,2CAFa,OAAO,CAOnB;IAz2CD;;;;OAIG;IACH,qBAHW,aAAa,EAwBvB;IAlID;;;OAGG;IACH,sBAAiB;IAEjB;;;OAGG;IACH,sBAAsB;IAEtB;;;OAGG;IACH,YAAO;IAEP;;;OAGG;IACH,UAAK;IAEL;;;OAGG;IACH,WAFU,OAAO,CAEC;IAQlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkEE;IA0BA,0CAA8C;IAoHhD,qBAOC;IAED,gBA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;;;uBAGP,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAsBP,OAAO;;;;mBACP,OAAO;;;;WACP,MAAM;;6BA9GS,mBAAmB"}
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-3dVTYXnm.js";
2
- import { D } from "./chunks/docx-zipper-CAF6BgPQ.js";
1
+ import "./chunks/converter-DXxu8c9w.js";
2
+ import { D } from "./chunks/docx-zipper-DjxR5LqI.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-NHY1ApZn.js";
2
- import "./chunks/converter-3dVTYXnm.js";
3
- import "./chunks/docx-zipper-CAF6BgPQ.js";
1
+ import { E } from "./chunks/editor-DQyfLPCk.js";
2
+ import "./chunks/converter-DXxu8c9w.js";
3
+ import "./chunks/docx-zipper-DjxR5LqI.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination.js"],"names":[],"mappings":"AAkBA,6BAkKG"}
1
+ {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/extensions/pagination/pagination.js"],"names":[],"mappings":"AAkBA,6BAgMG"}
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-CAF6BgPQ.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-DjxR5LqI.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 { ab as getDefaultExportFromCjs, J as v4, ae as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-3dVTYXnm.js";
13
- import { X } from "./chunks/converter-3dVTYXnm.js";
14
- import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, f as findParentNode, c as getFileOpener, s as startImageUpload, d as getActiveFormatting, i as isInTable, e as undoDepth, r as redoDepth, E as Editor, h as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-NHY1ApZn.js";
15
- import { o, C, T, m, q, p, l, n } from "./chunks/editor-NHY1ApZn.js";
12
+ import { ab as getDefaultExportFromCjs, J as v4, ae as vClickOutside, T as TextSelection, a as Plugin } from "./chunks/converter-DXxu8c9w.js";
13
+ import { X } from "./chunks/converter-DXxu8c9w.js";
14
+ import { _ as _export_sfc, u as useHighContrastMode, a as getQuickFormatList, b as generateLinkedStyleString, f as findParentNode, c as getFileOpener, s as startImageUpload, d as getActiveFormatting, i as isInTable, e as undoDepth, r as redoDepth, E as Editor, h as getStarterExtensions, P as Placeholder, j as getRichTextExtensions, M as Mark, k as Extension, A as Attribute, N as Node } from "./chunks/editor-DQyfLPCk.js";
15
+ import { o, C, T, m, q, p, l, n } from "./chunks/editor-DQyfLPCk.js";
16
16
  import { ref, onMounted, createElementBlock, openBlock, normalizeClass, unref, Fragment, renderList, createElementVNode, withModifiers, getCurrentInstance, computed, watch, createCommentVNode, withDirectives, withKeys, vModelText, createTextVNode, toDisplayString, normalizeStyle, createVNode, h, createApp, reactive, onUnmounted, shallowRef, onBeforeUnmount, createBlock } from "vue";
17
- import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-Dr1wHywT.js";
17
+ import { t as toolbarIcons, s as sanitizeNumber, T as Toolbar, N as NSkeleton } from "./chunks/toolbar-LIs10qdJ.js";
18
18
  import AIWriter from "./ai-writer.es.js";
19
- import { D } from "./chunks/docx-zipper-CAF6BgPQ.js";
19
+ import { D } from "./chunks/docx-zipper-DjxR5LqI.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-Dr1wHywT.js";
3
- import "./chunks/editor-NHY1ApZn.js";
2
+ import { T } from "./chunks/toolbar-LIs10qdJ.js";
3
+ import "./chunks/editor-DQyfLPCk.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-1V_Ac-SF.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CETApTAM.cjs");
4
4
  require("./chunks/vue-BBjMeYfo.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, T, f, g, i, h, j, k, l, m, n, o } from "./chunks/super-editor.es-CS08WNwP.es.js";
1
+ import { A, a, _, C, D, E, b, S, c, d, e, T, f, g, i, h, j, k, l, m, n, o } from "./chunks/super-editor.es-PFHHaxd8.es.js";
2
2
  import "./chunks/vue-BBJVqxjL.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-1V_Ac-SF.cjs");
3
+ const superEditor_es = require("./chunks/super-editor.es-CETApTAM.cjs");
4
4
  const vue = require("./chunks/vue-BBjMeYfo.cjs");
5
5
  const jszip = require("./chunks/jszip-9bCX1h2W.cjs");
6
6
  const blankDocx = require("./chunks/blank-docx-CPqX9RF5.cjs");
@@ -47803,7 +47803,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
47803
47803
  this.config.colors = shuffleArray(this.config.colors);
47804
47804
  this.userColorMap = /* @__PURE__ */ new Map();
47805
47805
  this.colorIndex = 0;
47806
- this.version = "0.14.0-next.5";
47806
+ this.version = "0.14.0-next.6";
47807
47807
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47808
47808
  this.superdocId = config.superdocId || uuid.v4();
47809
47809
  this.colors = this.config.colors;
@@ -48046,6 +48046,19 @@ class SuperDoc extends eventemitter3.EventEmitter {
48046
48046
  doc.rulers = this.config.rulers;
48047
48047
  });
48048
48048
  }
48049
+ /**
48050
+ * Toggle pagination for SuperEditors
48051
+ * @returns {void}
48052
+ */
48053
+ togglePagination() {
48054
+ this.config.pagination = !this.config.pagination;
48055
+ this.superdocStore.documents.forEach((doc) => {
48056
+ const editor = doc.getEditor();
48057
+ if (editor) {
48058
+ editor.commands.togglePagination();
48059
+ }
48060
+ });
48061
+ }
48049
48062
  #addToolbar() {
48050
48063
  const moduleConfig = this.config.modules?.toolbar || {};
48051
48064
  this.toolbarElement = this.config.modules?.toolbar?.selector || this.config.toolbar;
@@ -1,5 +1,5 @@
1
- import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-CS08WNwP.es.js";
2
- import { a, S, i, n } from "./chunks/super-editor.es-CS08WNwP.es.js";
1
+ import { o as index$1, C as CommentsPluginKey, f as TrackChangesBasePluginKey, E as Editor, l as getRichTextExtensions, d as SuperInput, A as AIWriter, c as SuperEditor, e as SuperToolbar, g as createZip } from "./chunks/super-editor.es-PFHHaxd8.es.js";
2
+ import { a, S, i, n } from "./chunks/super-editor.es-PFHHaxd8.es.js";
3
3
  import { Y as effectScope, r as ref, Z as markRaw, p as process$1, _ as toRaw, a as computed, $ as isRef, a0 as isReactive, D as toRef, i as inject, q as getCurrentInstance, l as watch, y as unref, a1 as hasInjectionContext, N as reactive, u as nextTick, a2 as getCurrentScope, a3 as onScopeDispose, a4 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, a5 as resolveDirective, d as renderList, c as createApp, X as onUnmounted, a6 as resolveDynamicComponent } from "./chunks/vue-BBJVqxjL.es.js";
4
4
  import { B as Buffer$2 } from "./chunks/jszip-Cl3s9njw.es.js";
5
5
  import { B as BlankDOCX } from "./chunks/blank-docx-iwdyG9RH.es.js";
@@ -47786,7 +47786,7 @@ class SuperDoc extends EventEmitter {
47786
47786
  this.config.colors = shuffleArray(this.config.colors);
47787
47787
  this.userColorMap = /* @__PURE__ */ new Map();
47788
47788
  this.colorIndex = 0;
47789
- this.version = "0.14.0-next.5";
47789
+ this.version = "0.14.0-next.6";
47790
47790
  console.debug("🦋 [superdoc] Using SuperDoc version:", this.version);
47791
47791
  this.superdocId = config.superdocId || v4();
47792
47792
  this.colors = this.config.colors;
@@ -48029,6 +48029,19 @@ class SuperDoc extends EventEmitter {
48029
48029
  doc.rulers = this.config.rulers;
48030
48030
  });
48031
48031
  }
48032
+ /**
48033
+ * Toggle pagination for SuperEditors
48034
+ * @returns {void}
48035
+ */
48036
+ togglePagination() {
48037
+ this.config.pagination = !this.config.pagination;
48038
+ this.superdocStore.documents.forEach((doc) => {
48039
+ const editor = doc.getEditor();
48040
+ if (editor) {
48041
+ editor.commands.togglePagination();
48042
+ }
48043
+ });
48044
+ }
48032
48045
  #addToolbar() {
48033
48046
  const moduleConfig = this.config.modules?.toolbar || {};
48034
48047
  this.toolbarElement = this.config.modules?.toolbar?.selector || this.config.toolbar;