superdoc 0.35.3 → 0.36.1

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 (47) hide show
  1. package/dist/chunks/{PdfViewer-C2woiqSD.es.js → PdfViewer-0ljQHJ46.es.js} +2 -2
  2. package/dist/chunks/{PdfViewer-cKeULrJD.cjs → PdfViewer-S16P3o_7.cjs} +2 -2
  3. package/dist/chunks/{eventemitter3-DmHNHvFX.cjs → eventemitter3-Cq0SNNyY.cjs} +1 -1
  4. package/dist/chunks/{eventemitter3-hYlnBzSA.es.js → eventemitter3-Dggxln8t.es.js} +1 -1
  5. package/dist/chunks/{index-CUb1VdVb-BOiRrEoQ.es.js → index-CzkLnJsZ-BTVdUMdV.es.js} +1 -1
  6. package/dist/chunks/{index-CUb1VdVb-Dn-WH3X_.cjs → index-CzkLnJsZ-BgswlBSf.cjs} +1 -1
  7. package/dist/chunks/{index-BLV0gVBb.cjs → index-D3qTp4tj.cjs} +32 -17
  8. package/dist/chunks/{index-qCXNfgIE.es.js → index-DzR1O6RL.es.js} +32 -17
  9. package/dist/chunks/{jszip-jKrsZoMS.es.js → jszip-CY0q2Bnp.es.js} +1 -1
  10. package/dist/chunks/{jszip-BP2FTbpi.cjs → jszip-F-dEByfH.cjs} +1 -1
  11. package/dist/chunks/{super-editor.es-FtM9y9Xi.cjs → super-editor.es-DVKZ65HN.cjs} +2240 -1699
  12. package/dist/chunks/{super-editor.es-C-FCfUaM.es.js → super-editor.es-D_ayGwNx.es.js} +2193 -1652
  13. package/dist/chunks/{vue-Cwv-wUpm.cjs → vue-dM1GiXsI.cjs} +2488 -2423
  14. package/dist/chunks/{vue-CKmzTNVs.es.js → vue-siHYWVb6.es.js} +2488 -2423
  15. package/dist/chunks/xml-js-DY0nfayl.cjs +3 -0
  16. package/dist/chunks/xml-js-lhjyYB16.es.js +2 -0
  17. package/dist/packages/superdoc/src/core/SuperDoc.d.ts +5 -2
  18. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  19. package/dist/packages/superdoc/src/core/types/index.d.ts +37 -2
  20. package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
  21. package/dist/style.css +37 -33
  22. package/dist/super-editor/ai-writer.es.js +2 -2
  23. package/dist/super-editor/chunks/{converter-DCcuo33v.js → converter-C_m22GDt.js} +311 -292
  24. package/dist/super-editor/chunks/{docx-zipper-BmJ2rJSz.js → docx-zipper-BMFQCW01.js} +1 -1
  25. package/dist/super-editor/chunks/{editor-CyldDVIe.js → editor-DOp2dsXA.js} +1496 -968
  26. package/dist/super-editor/chunks/{index-CUb1VdVb.js → index-CzkLnJsZ.js} +1 -1
  27. package/dist/super-editor/chunks/{toolbar-CO92tGD-.js → toolbar-VEU6sWSR.js} +2 -2
  28. package/dist/super-editor/converter.es.js +1 -1
  29. package/dist/super-editor/docx-zipper.es.js +2 -2
  30. package/dist/super-editor/editor.es.js +3 -3
  31. package/dist/super-editor/file-zipper.es.js +1 -1
  32. package/dist/super-editor/style.css +10 -6
  33. package/dist/super-editor/super-editor/src/core/Editor.d.ts +29 -4
  34. package/dist/super-editor/super-editor/src/core/Editor.d.ts.map +1 -1
  35. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts +5 -2
  36. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts.map +1 -1
  37. package/dist/super-editor/super-editor.es.js +32 -28
  38. package/dist/super-editor/toolbar.es.js +2 -2
  39. package/dist/super-editor.cjs +2 -2
  40. package/dist/super-editor.es.js +2 -2
  41. package/dist/superdoc.cjs +2 -2
  42. package/dist/superdoc.es.js +2 -2
  43. package/dist/superdoc.umd.js +2691 -2077
  44. package/dist/superdoc.umd.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/chunks/xml-js-BSDu25I7.cjs +0 -3
  47. package/dist/chunks/xml-js-CBrRls0f.es.js +0 -2
@@ -1,5 +1,5 @@
1
- import { m as defineComponent, y as h, O as Transition, $ as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, v as createVNode, x as unref } from "./vue-CKmzTNVs.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-qCXNfgIE.es.js";
1
+ import { m as defineComponent, y as h, O as Transition, $ as process$1, J as watchEffect, a as computed, r as ref, j as onMounted, W as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, v as createVNode, x as unref } from "./vue-siHYWVb6.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-DzR1O6RL.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vue = require("./vue-Cwv-wUpm.cjs");
4
- const superdoc = require("./index-BLV0gVBb.cjs");
3
+ const vue = require("./vue-dM1GiXsI.cjs");
4
+ const superdoc = require("./index-D3qTp4tj.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const jszip = require("./jszip-BP2FTbpi.cjs");
2
+ const jszip = require("./jszip-F-dEByfH.cjs");
3
3
  var eventemitter3 = { exports: {} };
4
4
  var hasRequiredEventemitter3;
5
5
  function requireEventemitter3() {
@@ -1,4 +1,4 @@
1
- import { g as getDefaultExportFromCjs } from "./jszip-jKrsZoMS.es.js";
1
+ import { g as getDefaultExportFromCjs } from "./jszip-CY0q2Bnp.es.js";
2
2
  var eventemitter3 = { exports: {} };
3
3
  var hasRequiredEventemitter3;
4
4
  function requireEventemitter3() {
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-C-FCfUaM.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-D_ayGwNx.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-FtM9y9Xi.cjs");
3
+ const superEditor_es = require("./super-editor.es-DVKZ65HN.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-FtM9y9Xi.cjs");
2
+ const superEditor_es = require("./super-editor.es-DVKZ65HN.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
- const eventemitter3 = require("./eventemitter3-DmHNHvFX.cjs");
4
+ const eventemitter3 = require("./eventemitter3-Cq0SNNyY.cjs");
5
5
  const provider = require("@hocuspocus/provider");
6
- const vue = require("./vue-Cwv-wUpm.cjs");
6
+ const vue = require("./vue-dM1GiXsI.cjs");
7
7
  const Y = require("yjs");
8
- const jszip = require("./jszip-BP2FTbpi.cjs");
8
+ const jszip = require("./jszip-F-dEByfH.cjs");
9
9
  const uuid = require("./uuid-R7L08bOx.cjs");
10
10
  function _interopNamespaceDefault(e) {
11
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -2137,6 +2137,7 @@ const offChange = (eventHandler) => usePolyfill || removeEventListener(
2137
2137
  /** @type {any} */
2138
2138
  eventHandler
2139
2139
  );
2140
+ const EqualityTraitSymbol = Symbol("Equality");
2140
2141
  const keys$1 = Object.keys;
2141
2142
  const map$1 = (obj, f) => {
2142
2143
  const results = [];
@@ -2145,14 +2146,13 @@ const map$1 = (obj, f) => {
2145
2146
  }
2146
2147
  return results;
2147
2148
  };
2148
- const length$1 = (obj) => keys$1(obj).length;
2149
+ const size$1 = (obj) => keys$1(obj).length;
2149
2150
  const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
2150
- const EqualityTraitSymbol = Symbol("Equality");
2151
2151
  const equalityDeep = (a, b) => {
2152
2152
  if (a === b) {
2153
2153
  return true;
2154
2154
  }
2155
- if (a == null || b == null || a.constructor !== b.constructor) {
2155
+ if (a == null || b == null || a.constructor !== b.constructor && (a.constructor || Object) !== (b.constructor || Object)) {
2156
2156
  return false;
2157
2157
  }
2158
2158
  if (a[EqualityTraitSymbol] != null) {
@@ -2196,8 +2196,9 @@ const equalityDeep = (a, b) => {
2196
2196
  }
2197
2197
  break;
2198
2198
  }
2199
+ case void 0:
2199
2200
  case Object:
2200
- if (length$1(a) !== length$1(b)) {
2201
+ if (size$1(a) !== size$1(b)) {
2201
2202
  return false;
2202
2203
  }
2203
2204
  for (const key in a) {
@@ -2369,7 +2370,7 @@ const errorUnexpectedEndOfArray = create("Unexpected end of array");
2369
2370
  const errorIntegerOutOfRange = create("Integer out of Range");
2370
2371
  class Decoder {
2371
2372
  /**
2372
- * @param {Uint8Array} uint8Array Binary data to decode
2373
+ * @param {Uint8Array<Buf>} uint8Array Binary data to decode
2373
2374
  */
2374
2375
  constructor(uint8Array) {
2375
2376
  this.arr = uint8Array;
@@ -2520,10 +2521,14 @@ const writeSyncStep2 = (encoder, doc, encodedStateVector) => {
2520
2521
  writeVarUint8Array(encoder, Y__namespace.encodeStateAsUpdate(doc, encodedStateVector));
2521
2522
  };
2522
2523
  const readSyncStep1 = (decoder, encoder, doc) => writeSyncStep2(encoder, doc, readVarUint8Array(decoder));
2523
- const readSyncStep2 = (decoder, doc, transactionOrigin) => {
2524
+ const readSyncStep2 = (decoder, doc, transactionOrigin, errorHandler) => {
2524
2525
  try {
2525
2526
  Y__namespace.applyUpdate(doc, readVarUint8Array(decoder), transactionOrigin);
2526
2527
  } catch (error) {
2528
+ if (errorHandler != null) errorHandler(
2529
+ /** @type {Error} */
2530
+ error
2531
+ );
2527
2532
  console.error("Caught error while handling a Yjs update", error);
2528
2533
  }
2529
2534
  };
@@ -2532,17 +2537,17 @@ const writeUpdate = (encoder, update) => {
2532
2537
  writeVarUint8Array(encoder, update);
2533
2538
  };
2534
2539
  const readUpdate = readSyncStep2;
2535
- const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {
2540
+ const readSyncMessage = (decoder, encoder, doc, transactionOrigin, errorHandler) => {
2536
2541
  const messageType = readVarUint(decoder);
2537
2542
  switch (messageType) {
2538
2543
  case messageYjsSyncStep1:
2539
2544
  readSyncStep1(decoder, encoder, doc);
2540
2545
  break;
2541
2546
  case messageYjsSyncStep2:
2542
- readSyncStep2(decoder, doc, transactionOrigin);
2547
+ readSyncStep2(decoder, doc, transactionOrigin, errorHandler);
2543
2548
  break;
2544
2549
  case messageYjsUpdate:
2545
- readUpdate(decoder, doc, transactionOrigin);
2550
+ readUpdate(decoder, doc, transactionOrigin, errorHandler);
2546
2551
  break;
2547
2552
  default:
2548
2553
  throw new Error("Unknown message type");
@@ -17238,7 +17243,7 @@ const _sfc_main = {
17238
17243
  __name: "SuperDoc",
17239
17244
  emits: ["selection-update"],
17240
17245
  setup(__props, { emit: __emit }) {
17241
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-cKeULrJD.cjs")));
17246
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-S16P3o_7.cjs")));
17242
17247
  const superdocStore = useSuperdocStore();
17243
17248
  const commentsStore = useCommentsStore();
17244
17249
  const {
@@ -17459,6 +17464,8 @@ const _sfc_main = {
17459
17464
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
17460
17465
  disableContextMenu: proxy.$superdoc.config.disableContextMenu,
17461
17466
  jsonOverride: proxy.$superdoc.config.jsonOverride,
17467
+ layoutMode: proxy.$superdoc.config.layoutMode,
17468
+ layoutMargins: proxy.$superdoc.config.layoutMargins,
17462
17469
  permissionResolver: (payload = {}) => proxy.$superdoc.canPerformPermission({
17463
17470
  role: proxy.$superdoc.config.role,
17464
17471
  isInternal: proxy.$superdoc.config.isInternal,
@@ -17832,7 +17839,7 @@ const _sfc_main = {
17832
17839
  };
17833
17840
  }
17834
17841
  };
17835
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-29e35f23"]]);
17842
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5138e8c6"]]);
17836
17843
  const createSuperdocVueApp = () => {
17837
17844
  const app = vue.createApp(App);
17838
17845
  const pinia = createPinia();
@@ -17969,7 +17976,15 @@ class SuperDoc extends eventemitter3.EventEmitter {
17969
17976
  // async (file) => url;
17970
17977
  handleImageUpload: null,
17971
17978
  // Disable context menus (slash and right-click) globally
17972
- disableContextMenu: false
17979
+ disableContextMenu: false,
17980
+ // Document layout mode: 'paginated' (default) or 'responsive'
17981
+ // 'paginated': Fixed page width, shows page breaks like a real document
17982
+ // 'responsive': 100% width, text reflows to fit the container (useful for mobile/accessibility)
17983
+ layoutMode: "paginated",
17984
+ // Custom margins for responsive layout mode (values in pixels)
17985
+ // Only applies when layoutMode is 'responsive'
17986
+ // Example: { top: 48, bottom: 48, left: 48, right: 48 }
17987
+ layoutMargins: null
17973
17988
  };
17974
17989
  /**
17975
17990
  * @param {Config} config
@@ -18002,7 +18017,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18002
18017
  this.config.colors = shuffleArray(this.config.colors);
18003
18018
  this.userColorMap = /* @__PURE__ */ new Map();
18004
18019
  this.colorIndex = 0;
18005
- this.version = "0.35.3";
18020
+ this.version = "0.36.1";
18006
18021
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18007
18022
  this.superdocId = config.superdocId || uuid.v4();
18008
18023
  this.colors = this.config.colors;
@@ -1,11 +1,11 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-C-FCfUaM.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-D_ayGwNx.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
- import { E as EventEmitter } from "./eventemitter3-hYlnBzSA.es.js";
3
+ import { E as EventEmitter } from "./eventemitter3-Dggxln8t.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
5
- import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, E as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, A as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, C as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, G as provide, I as withDirectives, y as h, U as Teleport, R as renderSlot, V as isVNode, J as watchEffect, O as Transition, a8 as TransitionGroup, z as mergeProps, P as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, B as withCtx, f as createBaseVNode, D as normalizeStyle, e as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, d as renderList, c as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-CKmzTNVs.es.js";
5
+ import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, a as computed, a2 as isRef, a3 as isReactive, E as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, A as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, C as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, G as provide, I as withDirectives, y as h, U as Teleport, R as renderSlot, V as isVNode, J as watchEffect, O as Transition, a8 as TransitionGroup, z as mergeProps, P as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, B as withCtx, f as createBaseVNode, D as normalizeStyle, e as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, d as renderList, c as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-siHYWVb6.es.js";
6
6
  import * as Y from "yjs";
7
7
  import { Doc, Map as Map$2 } from "yjs";
8
- import { B as Buffer$2 } from "./jszip-jKrsZoMS.es.js";
8
+ import { B as Buffer$2 } from "./jszip-CY0q2Bnp.es.js";
9
9
  import { v as v4 } from "./uuid-CjlX8hrF.es.js";
10
10
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
11
11
  const PDF = "application/pdf";
@@ -2120,6 +2120,7 @@ const offChange = (eventHandler) => usePolyfill || removeEventListener(
2120
2120
  /** @type {any} */
2121
2121
  eventHandler
2122
2122
  );
2123
+ const EqualityTraitSymbol = Symbol("Equality");
2123
2124
  const keys$1 = Object.keys;
2124
2125
  const map$1 = (obj, f) => {
2125
2126
  const results = [];
@@ -2128,14 +2129,13 @@ const map$1 = (obj, f) => {
2128
2129
  }
2129
2130
  return results;
2130
2131
  };
2131
- const length$1 = (obj) => keys$1(obj).length;
2132
+ const size$1 = (obj) => keys$1(obj).length;
2132
2133
  const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
2133
- const EqualityTraitSymbol = Symbol("Equality");
2134
2134
  const equalityDeep = (a, b) => {
2135
2135
  if (a === b) {
2136
2136
  return true;
2137
2137
  }
2138
- if (a == null || b == null || a.constructor !== b.constructor) {
2138
+ if (a == null || b == null || a.constructor !== b.constructor && (a.constructor || Object) !== (b.constructor || Object)) {
2139
2139
  return false;
2140
2140
  }
2141
2141
  if (a[EqualityTraitSymbol] != null) {
@@ -2179,8 +2179,9 @@ const equalityDeep = (a, b) => {
2179
2179
  }
2180
2180
  break;
2181
2181
  }
2182
+ case void 0:
2182
2183
  case Object:
2183
- if (length$1(a) !== length$1(b)) {
2184
+ if (size$1(a) !== size$1(b)) {
2184
2185
  return false;
2185
2186
  }
2186
2187
  for (const key in a) {
@@ -2352,7 +2353,7 @@ const errorUnexpectedEndOfArray = create("Unexpected end of array");
2352
2353
  const errorIntegerOutOfRange = create("Integer out of Range");
2353
2354
  class Decoder {
2354
2355
  /**
2355
- * @param {Uint8Array} uint8Array Binary data to decode
2356
+ * @param {Uint8Array<Buf>} uint8Array Binary data to decode
2356
2357
  */
2357
2358
  constructor(uint8Array) {
2358
2359
  this.arr = uint8Array;
@@ -2503,10 +2504,14 @@ const writeSyncStep2 = (encoder, doc, encodedStateVector) => {
2503
2504
  writeVarUint8Array(encoder, Y.encodeStateAsUpdate(doc, encodedStateVector));
2504
2505
  };
2505
2506
  const readSyncStep1 = (decoder, encoder, doc) => writeSyncStep2(encoder, doc, readVarUint8Array(decoder));
2506
- const readSyncStep2 = (decoder, doc, transactionOrigin) => {
2507
+ const readSyncStep2 = (decoder, doc, transactionOrigin, errorHandler) => {
2507
2508
  try {
2508
2509
  Y.applyUpdate(doc, readVarUint8Array(decoder), transactionOrigin);
2509
2510
  } catch (error) {
2511
+ if (errorHandler != null) errorHandler(
2512
+ /** @type {Error} */
2513
+ error
2514
+ );
2510
2515
  console.error("Caught error while handling a Yjs update", error);
2511
2516
  }
2512
2517
  };
@@ -2515,17 +2520,17 @@ const writeUpdate = (encoder, update) => {
2515
2520
  writeVarUint8Array(encoder, update);
2516
2521
  };
2517
2522
  const readUpdate = readSyncStep2;
2518
- const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {
2523
+ const readSyncMessage = (decoder, encoder, doc, transactionOrigin, errorHandler) => {
2519
2524
  const messageType = readVarUint(decoder);
2520
2525
  switch (messageType) {
2521
2526
  case messageYjsSyncStep1:
2522
2527
  readSyncStep1(decoder, encoder, doc);
2523
2528
  break;
2524
2529
  case messageYjsSyncStep2:
2525
- readSyncStep2(decoder, doc, transactionOrigin);
2530
+ readSyncStep2(decoder, doc, transactionOrigin, errorHandler);
2526
2531
  break;
2527
2532
  case messageYjsUpdate:
2528
- readUpdate(decoder, doc, transactionOrigin);
2533
+ readUpdate(decoder, doc, transactionOrigin, errorHandler);
2529
2534
  break;
2530
2535
  default:
2531
2536
  throw new Error("Unknown message type");
@@ -17221,7 +17226,7 @@ const _sfc_main = {
17221
17226
  __name: "SuperDoc",
17222
17227
  emits: ["selection-update"],
17223
17228
  setup(__props, { emit: __emit }) {
17224
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-C2woiqSD.es.js"));
17229
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-0ljQHJ46.es.js"));
17225
17230
  const superdocStore = useSuperdocStore();
17226
17231
  const commentsStore = useCommentsStore();
17227
17232
  const {
@@ -17442,6 +17447,8 @@ const _sfc_main = {
17442
17447
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
17443
17448
  disableContextMenu: proxy.$superdoc.config.disableContextMenu,
17444
17449
  jsonOverride: proxy.$superdoc.config.jsonOverride,
17450
+ layoutMode: proxy.$superdoc.config.layoutMode,
17451
+ layoutMargins: proxy.$superdoc.config.layoutMargins,
17445
17452
  permissionResolver: (payload = {}) => proxy.$superdoc.canPerformPermission({
17446
17453
  role: proxy.$superdoc.config.role,
17447
17454
  isInternal: proxy.$superdoc.config.isInternal,
@@ -17815,7 +17822,7 @@ const _sfc_main = {
17815
17822
  };
17816
17823
  }
17817
17824
  };
17818
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-29e35f23"]]);
17825
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5138e8c6"]]);
17819
17826
  const createSuperdocVueApp = () => {
17820
17827
  const app = createApp(App);
17821
17828
  const pinia = createPinia();
@@ -17952,7 +17959,15 @@ class SuperDoc extends EventEmitter {
17952
17959
  // async (file) => url;
17953
17960
  handleImageUpload: null,
17954
17961
  // Disable context menus (slash and right-click) globally
17955
- disableContextMenu: false
17962
+ disableContextMenu: false,
17963
+ // Document layout mode: 'paginated' (default) or 'responsive'
17964
+ // 'paginated': Fixed page width, shows page breaks like a real document
17965
+ // 'responsive': 100% width, text reflows to fit the container (useful for mobile/accessibility)
17966
+ layoutMode: "paginated",
17967
+ // Custom margins for responsive layout mode (values in pixels)
17968
+ // Only applies when layoutMode is 'responsive'
17969
+ // Example: { top: 48, bottom: 48, left: 48, right: 48 }
17970
+ layoutMargins: null
17956
17971
  };
17957
17972
  /**
17958
17973
  * @param {Config} config
@@ -17985,7 +18000,7 @@ class SuperDoc extends EventEmitter {
17985
18000
  this.config.colors = shuffleArray(this.config.colors);
17986
18001
  this.userColorMap = /* @__PURE__ */ new Map();
17987
18002
  this.colorIndex = 0;
17988
- this.version = "0.35.3";
18003
+ this.version = "0.36.1";
17989
18004
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17990
18005
  this.superdocId = config.superdocId || v4();
17991
18006
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import "./vue-CKmzTNVs.es.js";
1
+ import "./vue-siHYWVb6.es.js";
2
2
  function getDefaultExportFromCjs(x) {
3
3
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
4
4
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- require("./vue-Cwv-wUpm.cjs");
2
+ require("./vue-dM1GiXsI.cjs");
3
3
  function getDefaultExportFromCjs(x) {
4
4
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
5
  }