superdoc 0.35.3 → 0.36.0

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 (37) hide show
  1. package/dist/chunks/{PdfViewer-cKeULrJD.cjs → PdfViewer-BVjCijQM.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-C2woiqSD.es.js → PdfViewer-Cw6hrjmI.es.js} +1 -1
  3. package/dist/chunks/{index-BLV0gVBb.cjs → index-C2I7v8Mz.cjs} +15 -5
  4. package/dist/chunks/{index-CUb1VdVb-Dn-WH3X_.cjs → index-C6pGFRDv-DPPxKqzz.cjs} +1 -1
  5. package/dist/chunks/{index-CUb1VdVb-BOiRrEoQ.es.js → index-C6pGFRDv-NmZ85_ZC.es.js} +1 -1
  6. package/dist/chunks/{index-qCXNfgIE.es.js → index-DxVLb2GI.es.js} +15 -5
  7. package/dist/chunks/{super-editor.es-FtM9y9Xi.cjs → super-editor.es-DU7fPHu1.cjs} +115 -50
  8. package/dist/chunks/{super-editor.es-C-FCfUaM.es.js → super-editor.es-wvWKJiSQ.es.js} +115 -50
  9. package/dist/packages/superdoc/src/core/SuperDoc.d.ts +5 -2
  10. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  11. package/dist/packages/superdoc/src/core/types/index.d.ts +37 -2
  12. package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
  13. package/dist/style.css +37 -33
  14. package/dist/super-editor/ai-writer.es.js +2 -2
  15. package/dist/super-editor/chunks/{converter-DCcuo33v.js → converter-B_MV8Ifd.js} +1 -1
  16. package/dist/super-editor/chunks/{docx-zipper-BmJ2rJSz.js → docx-zipper-BErVQPhm.js} +1 -1
  17. package/dist/super-editor/chunks/{editor-CyldDVIe.js → editor-DJdDJYe1.js} +88 -17
  18. package/dist/super-editor/chunks/{index-CUb1VdVb.js → index-C6pGFRDv.js} +1 -1
  19. package/dist/super-editor/chunks/{toolbar-CO92tGD-.js → toolbar-C3z7Pv8Z.js} +2 -2
  20. package/dist/super-editor/converter.es.js +1 -1
  21. package/dist/super-editor/docx-zipper.es.js +2 -2
  22. package/dist/super-editor/editor.es.js +3 -3
  23. package/dist/super-editor/file-zipper.es.js +1 -1
  24. package/dist/super-editor/style.css +10 -6
  25. package/dist/super-editor/super-editor/src/core/Editor.d.ts +29 -4
  26. package/dist/super-editor/super-editor/src/core/Editor.d.ts.map +1 -1
  27. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts +5 -2
  28. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts.map +1 -1
  29. package/dist/super-editor/super-editor.es.js +32 -28
  30. package/dist/super-editor/toolbar.es.js +2 -2
  31. package/dist/super-editor.cjs +1 -1
  32. package/dist/super-editor.es.js +1 -1
  33. package/dist/superdoc.cjs +2 -2
  34. package/dist/superdoc.es.js +2 -2
  35. package/dist/superdoc.umd.js +123 -48
  36. package/dist/superdoc.umd.js.map +1 -1
  37. package/package.json +1 -1
package/dist/style.css CHANGED
@@ -2323,10 +2323,10 @@ on the right if it is inside shape textbox.
2323
2323
  min-height: 40px;
2324
2324
  }
2325
2325
 
2326
- .editor-element[data-v-86fdd359] {
2326
+ .editor-element[data-v-25b8680d] {
2327
2327
  position: relative;
2328
2328
  }
2329
- .super-editor-container[data-v-86fdd359] {
2329
+ .super-editor-container[data-v-25b8680d] {
2330
2330
  width: auto;
2331
2331
  height: auto;
2332
2332
  min-width: 8in;
@@ -2335,13 +2335,17 @@ on the right if it is inside shape textbox.
2335
2335
  display: flex;
2336
2336
  flex-direction: column;
2337
2337
  }
2338
- .ruler[data-v-86fdd359] {
2338
+ .super-editor-container.no-min-height[data-v-25b8680d] {
2339
+ min-height: unset;
2340
+ min-width: unset;
2341
+ }
2342
+ .ruler[data-v-25b8680d] {
2339
2343
  margin-bottom: 2px;
2340
2344
  }
2341
- .super-editor[data-v-86fdd359] {
2345
+ .super-editor[data-v-25b8680d] {
2342
2346
  color: initial;
2343
2347
  }
2344
- .placeholder-editor[data-v-86fdd359] {
2348
+ .placeholder-editor[data-v-25b8680d] {
2345
2349
  position: absolute;
2346
2350
  top: 0;
2347
2351
  left: 0;
@@ -2353,7 +2357,7 @@ on the right if it is inside shape textbox.
2353
2357
  background-color: white;
2354
2358
  box-sizing: border-box;
2355
2359
  }
2356
- .placeholder-title[data-v-86fdd359] {
2360
+ .placeholder-title[data-v-25b8680d] {
2357
2361
  display: flex;
2358
2362
  justify-content: center;
2359
2363
  margin-bottom: 40px;
@@ -2537,46 +2541,46 @@ img[data-v-7dd69850] {
2537
2541
  box-shadow: 0 0 5px hsla(0, 0%, 0%, 0.05);
2538
2542
  }
2539
2543
 
2540
- .superdoc[data-v-29e35f23] {
2544
+ .superdoc[data-v-5138e8c6] {
2541
2545
  display: flex;
2542
2546
  }
2543
- .right-sidebar[data-v-29e35f23] {
2547
+ .right-sidebar[data-v-5138e8c6] {
2544
2548
  min-width: 320px;
2545
2549
  }
2546
- .floating-comments[data-v-29e35f23] {
2550
+ .floating-comments[data-v-5138e8c6] {
2547
2551
  min-width: 300px;
2548
2552
  width: 300px;
2549
2553
  }
2550
- .superdoc__layers[data-v-29e35f23] {
2554
+ .superdoc__layers[data-v-5138e8c6] {
2551
2555
  height: 100%;
2552
2556
  position: relative;
2553
2557
  box-sizing: border-box;
2554
2558
  }
2555
- .superdoc__document[data-v-29e35f23] {
2559
+ .superdoc__document[data-v-5138e8c6] {
2556
2560
  width: 100%;
2557
2561
  position: relative;
2558
2562
  }
2559
- .superdoc__sub-document[data-v-29e35f23] {
2563
+ .superdoc__sub-document[data-v-5138e8c6] {
2560
2564
  width: 100%;
2561
2565
  position: relative;
2562
2566
  }
2563
- .superdoc__selection-layer[data-v-29e35f23] {
2567
+ .superdoc__selection-layer[data-v-5138e8c6] {
2564
2568
  position: absolute;
2565
2569
  min-width: 100%;
2566
2570
  min-height: 100%;
2567
2571
  z-index: 10;
2568
2572
  pointer-events: none;
2569
2573
  }
2570
- .superdoc__temp-selection[data-v-29e35f23] {
2574
+ .superdoc__temp-selection[data-v-5138e8c6] {
2571
2575
  position: absolute;
2572
2576
  }
2573
- .superdoc__comments-layer[data-v-29e35f23] {
2577
+ .superdoc__comments-layer[data-v-5138e8c6] {
2574
2578
  /* position: absolute; */
2575
2579
  top: 0;
2576
2580
  height: 100%;
2577
2581
  position: relative;
2578
2582
  }
2579
- .superdoc__right-sidebar[data-v-29e35f23] {
2583
+ .superdoc__right-sidebar[data-v-5138e8c6] {
2580
2584
  width: 320px;
2581
2585
  min-width: 320px;
2582
2586
  padding: 0 10px;
@@ -2586,14 +2590,14 @@ img[data-v-7dd69850] {
2586
2590
  }
2587
2591
 
2588
2592
  /* Tools styles */
2589
- .tools[data-v-29e35f23] {
2593
+ .tools[data-v-5138e8c6] {
2590
2594
  position: absolute;
2591
2595
  z-index: 3;
2592
2596
  display: flex;
2593
2597
  flex-direction: column;
2594
2598
  gap: 6px;
2595
2599
  }
2596
- .tools .tool-icon[data-v-29e35f23] {
2600
+ .tools .tool-icon[data-v-5138e8c6] {
2597
2601
  font-size: 20px;
2598
2602
  border-radius: 12px;
2599
2603
  border: none;
@@ -2601,7 +2605,7 @@ img[data-v-7dd69850] {
2601
2605
  background-color: #dbdbdb;
2602
2606
  cursor: pointer;
2603
2607
  }
2604
- .tools-item[data-v-29e35f23] {
2608
+ .tools-item[data-v-5138e8c6] {
2605
2609
  display: flex;
2606
2610
  align-items: center;
2607
2611
  justify-content: center;
@@ -2611,10 +2615,10 @@ img[data-v-7dd69850] {
2611
2615
  border-radius: 12px;
2612
2616
  cursor: pointer;
2613
2617
  }
2614
- .tools-item i[data-v-29e35f23] {
2618
+ .tools-item i[data-v-5138e8c6] {
2615
2619
  cursor: pointer;
2616
2620
  }
2617
- .superdoc__tools-icon[data-v-29e35f23] {
2621
+ .superdoc__tools-icon[data-v-5138e8c6] {
2618
2622
  width: 20px;
2619
2623
  height: 20px;
2620
2624
  flex-shrink: 0;
@@ -2629,15 +2633,15 @@ img[data-v-7dd69850] {
2629
2633
 
2630
2634
  /* 834px is iPad screen size in portrait orientation */
2631
2635
  @media (max-width: 834px) {
2632
- .superdoc .superdoc__layers[data-v-29e35f23] {
2636
+ .superdoc .superdoc__layers[data-v-5138e8c6] {
2633
2637
  margin: 0;
2634
2638
  border: 0 !important;
2635
2639
  box-shadow: none;
2636
2640
  }
2637
- .superdoc__sub-document[data-v-29e35f23] {
2641
+ .superdoc__sub-document[data-v-5138e8c6] {
2638
2642
  max-width: 100%;
2639
2643
  }
2640
- .superdoc__right-sidebar[data-v-29e35f23] {
2644
+ .superdoc__right-sidebar[data-v-5138e8c6] {
2641
2645
  padding: 10px;
2642
2646
  width: 55px;
2643
2647
  position: relative;
@@ -2645,7 +2649,7 @@ img[data-v-7dd69850] {
2645
2649
  }
2646
2650
 
2647
2651
  /* AI Writer styles */
2648
- .ai-writer-container[data-v-29e35f23] {
2652
+ .ai-writer-container[data-v-5138e8c6] {
2649
2653
  position: fixed;
2650
2654
  z-index: 1000;
2651
2655
  background: white;
@@ -2663,13 +2667,13 @@ img[data-v-7dd69850] {
2663
2667
  } */
2664
2668
 
2665
2669
  /* Tools styles */
2666
- .tools[data-v-29e35f23] {
2670
+ .tools[data-v-5138e8c6] {
2667
2671
  position: absolute;
2668
2672
  z-index: 3;
2669
2673
  display: flex;
2670
2674
  gap: 6px;
2671
2675
  }
2672
- .tools .tool-icon[data-v-29e35f23] {
2676
+ .tools .tool-icon[data-v-5138e8c6] {
2673
2677
  font-size: 20px;
2674
2678
  border-radius: 12px;
2675
2679
  border: none;
@@ -2677,7 +2681,7 @@ img[data-v-7dd69850] {
2677
2681
  background-color: #dbdbdb;
2678
2682
  cursor: pointer;
2679
2683
  }
2680
- .tools-item[data-v-29e35f23] {
2684
+ .tools-item[data-v-5138e8c6] {
2681
2685
  display: flex;
2682
2686
  align-items: center;
2683
2687
  justify-content: center;
@@ -2688,18 +2692,18 @@ img[data-v-7dd69850] {
2688
2692
  border-radius: 12px;
2689
2693
  cursor: pointer;
2690
2694
  }
2691
- .tools-item i[data-v-29e35f23] {
2695
+ .tools-item i[data-v-5138e8c6] {
2692
2696
  cursor: pointer;
2693
2697
  }
2694
- .superdoc__tools-icon[data-v-29e35f23] {
2698
+ .superdoc__tools-icon[data-v-5138e8c6] {
2695
2699
  width: 20px;
2696
2700
  height: 20px;
2697
2701
  flex-shrink: 0;
2698
2702
  }
2699
- .ai-tool > svg[data-v-29e35f23] {
2703
+ .ai-tool > svg[data-v-5138e8c6] {
2700
2704
  fill: transparent;
2701
2705
  }
2702
- .ai-tool[data-v-29e35f23]::before {
2706
+ .ai-tool[data-v-5138e8c6]::before {
2703
2707
  content: '';
2704
2708
  position: absolute;
2705
2709
  width: 20px;
@@ -2720,7 +2724,7 @@ img[data-v-7dd69850] {
2720
2724
  filter: brightness(1.2);
2721
2725
  transition: filter 0.2s ease;
2722
2726
  }
2723
- .ai-tool[data-v-29e35f23]:hover::before {
2727
+ .ai-tool[data-v-5138e8c6]:hover::before {
2724
2728
  filter: brightness(1.3);
2725
2729
  }
2726
2730
 
@@ -1,6 +1,6 @@
1
1
  import { ref, onMounted, onUnmounted, computed, createElementBlock, openBlock, withModifiers, createElementVNode, withDirectives, unref, vModelText, createCommentVNode, nextTick } from "vue";
2
- import { T as TextSelection } from "./chunks/converter-DCcuo33v.js";
3
- import { _ as _export_sfc } from "./chunks/editor-CyldDVIe.js";
2
+ import { T as TextSelection } from "./chunks/converter-B_MV8Ifd.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-DJdDJYe1.js";
4
4
  const DEFAULT_API_ENDPOINT = "https://sd-dev-express-gateway-i6xtm.ondigitalocean.app/insights";
5
5
  const SYSTEM_PROMPT = "You are an expert copywriter and you are immersed in a document editor. You are to provide document related text responses based on the user prompts. Only write what is asked for. Do not provide explanations. Try to keep placeholders as short as possible. Do not output your prompt. Your instructions are: ";
6
6
  async function baseInsightsFetch(payload, options = {}) {
@@ -36067,7 +36067,7 @@ const _SuperConverter = class _SuperConverter {
36067
36067
  static getStoredSuperdocVersion(docx) {
36068
36068
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
36069
36069
  }
36070
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.35.3") {
36070
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.36.0") {
36071
36071
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
36072
36072
  }
36073
36073
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-DCcuo33v.js";
1
+ import { p as process$1, az as commonjsGlobal, B as Buffer, aA as getDefaultExportFromCjs, aB as getContentTypesFromXml, aC as xmljs } from "./converter-B_MV8Ifd.js";
2
2
  function commonjsRequire(path) {
3
3
  throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
4
4
  }
@@ -9,11 +9,11 @@ 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, _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, registerCopyHandler_fn, insertNewFileData_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_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, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, applyIndentStyling_fn, _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, _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, validateLayoutMargins_fn, isResponsiveMode_fn, registerCopyHandler_fn, insertNewFileData_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_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, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ListItemNodeView_instances, init_fn3, applyIndentStyling_fn, _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, 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 updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-DCcuo33v.js";
16
- import { D as DocxZipper } from "./docx-zipper-BmJ2rJSz.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 updateDOMAttributes, ah as findChildren$5, ai as htmlHandler, aj as generateRandomSigned32BitIntStrId, ak as InputRule, al as kebabCase, am as findParentNodeClosestToPos, an as getListItemStyleDefinitions, ao as docxNumberingHelpers, ap as parseIndentElement, aq as combineIndents, ar as twipsToPixels, as as PIXELS_PER_INCH$1, at as SelectionRange, au as Transform, av as isInTable$1, aw as generateDocxRandomId, ax as insertNewRelationship, ay as inchesToPixels } from "./converter-B_MV8Ifd.js";
16
+ import { D as DocxZipper } from "./docx-zipper-BErVQPhm.js";
17
17
  import { ref, computed, createElementBlock, openBlock, withModifiers, Fragment as Fragment$1, renderList, normalizeClass, createCommentVNode, toDisplayString, createElementVNode, createApp } from "vue";
18
18
  var GOOD_LEAF_SIZE = 200;
19
19
  var RopeSequence = function RopeSequence2() {
@@ -14494,6 +14494,9 @@ function buildSchemaSummary(schema, schemaVersion) {
14494
14494
  marks
14495
14495
  };
14496
14496
  }
14497
+ const PIXELS_PER_INCH = 96;
14498
+ const MAX_HEIGHT_BUFFER_PX = 50;
14499
+ const MAX_WIDTH_BUFFER_PX = 20;
14497
14500
  const _Editor = class _Editor extends EventEmitter {
14498
14501
  /**
14499
14502
  * Create a new Editor instance
@@ -14575,6 +14578,8 @@ const _Editor = class _Editor extends EventEmitter {
14575
14578
  lastSelection: null,
14576
14579
  suppressDefaultDocxStyles: false,
14577
14580
  jsonOverride: null,
14581
+ layoutMode: "paginated",
14582
+ layoutMargins: null,
14578
14583
  onBeforeCreate: () => null,
14579
14584
  onCreate: () => null,
14580
14585
  onUpdate: () => null,
@@ -14613,6 +14618,7 @@ const _Editor = class _Editor extends EventEmitter {
14613
14618
  });
14614
14619
  __privateMethod(this, _Editor_instances, initContainerElement_fn).call(this, options);
14615
14620
  __privateMethod(this, _Editor_instances, checkHeadless_fn).call(this, options);
14621
+ __privateMethod(this, _Editor_instances, validateLayoutMargins_fn).call(this, options);
14616
14622
  this.setOptions(options);
14617
14623
  let modes = {
14618
14624
  docx: () => __privateMethod(this, _Editor_instances, init_fn).call(this),
@@ -14991,17 +14997,28 @@ const _Editor = class _Editor extends EventEmitter {
14991
14997
  });
14992
14998
  }
14993
14999
  /**
14994
- * Get the maximum content size
14995
- * @returns {Object} Size object with width and height
15000
+ * Get the maximum content size based on page dimensions and margins
15001
+ * @returns {{width: number, height: number} | {}} Size object with width and height in pixels, or empty object if no page size
14996
15002
  */
14997
15003
  getMaxContentSize() {
14998
15004
  if (!this.converter) return {};
14999
15005
  const { pageSize = {}, pageMargins = {} } = this.converter.pageStyles ?? {};
15006
+ const { layoutMargins } = this.options;
15000
15007
  const { width, height } = pageSize;
15001
- const { top: top2 = 0, bottom: bottom2 = 0, left: left2 = 0, right: right2 = 0 } = pageMargins;
15008
+ const isResponsive = __privateMethod(this, _Editor_instances, isResponsiveMode_fn).call(this);
15009
+ const getMarginPx = (side) => {
15010
+ if (isResponsive) {
15011
+ return layoutMargins?.[side] ?? PIXELS_PER_INCH;
15012
+ }
15013
+ return (pageMargins?.[side] ?? 0) * PIXELS_PER_INCH;
15014
+ };
15015
+ const topPx = getMarginPx("top");
15016
+ const bottomPx = getMarginPx("bottom");
15017
+ const leftPx = getMarginPx("left");
15018
+ const rightPx = getMarginPx("right");
15002
15019
  if (!width || !height) return {};
15003
- const maxHeight = height * 96 - top2 * 96 - bottom2 * 96 - 50;
15004
- const maxWidth = width * 96 - left2 * 96 - right2 * 96 - 20;
15020
+ const maxHeight = height * PIXELS_PER_INCH - topPx - bottomPx - MAX_HEIGHT_BUFFER_PX;
15021
+ const maxWidth = width * PIXELS_PER_INCH - leftPx - rightPx - MAX_WIDTH_BUFFER_PX;
15005
15022
  return {
15006
15023
  width: maxWidth,
15007
15024
  height: maxHeight
@@ -15009,9 +15026,15 @@ const _Editor = class _Editor extends EventEmitter {
15009
15026
  }
15010
15027
  /**
15011
15028
  * Attach styles and attributes to the editor element
15029
+ * @param {HTMLElement} element - The editor container element
15030
+ * @param {HTMLElement} proseMirror - The ProseMirror element
15031
+ * @param {boolean} [hasPaginationEnabled=true] - Whether pagination is enabled
15032
+ * @returns {void}
15012
15033
  */
15013
15034
  updateEditorStyles(element, proseMirror, hasPaginationEnabled = true) {
15014
15035
  const { pageSize, pageMargins } = this.converter.pageStyles ?? {};
15036
+ const { layoutMargins, pagination } = this.options;
15037
+ const isResponsive = __privateMethod(this, _Editor_instances, isResponsiveMode_fn).call(this);
15015
15038
  if (!proseMirror || !element) {
15016
15039
  return;
15017
15040
  }
@@ -15020,12 +15043,17 @@ const _Editor = class _Editor extends EventEmitter {
15020
15043
  proseMirror.setAttribute("aria-label", "Main content area, start typing to enter text.");
15021
15044
  proseMirror.setAttribute("aria-description", "");
15022
15045
  proseMirror.classList.remove("view-mode");
15023
- if (pageSize) {
15024
- element.style.width = pageSize.width + "in";
15025
- element.style.minWidth = pageSize.width + "in";
15026
- element.style.minHeight = pageSize.height + "in";
15046
+ if (pageSize?.width != null) {
15047
+ element.style.width = isResponsive ? "100%" : `${pageSize.width}in`;
15048
+ element.style.minWidth = isResponsive ? "" : `${pageSize.width}in`;
15027
15049
  }
15028
- if (pageMargins) {
15050
+ if (pageSize?.height != null) {
15051
+ element.style.minHeight = isResponsive ? "" : `${pageSize.height}in`;
15052
+ }
15053
+ if (isResponsive) {
15054
+ element.style.paddingLeft = (layoutMargins?.left ?? PIXELS_PER_INCH) + "px";
15055
+ element.style.paddingRight = (layoutMargins?.right ?? PIXELS_PER_INCH) + "px";
15056
+ } else if (pageMargins) {
15029
15057
  element.style.paddingLeft = pageMargins.left + "in";
15030
15058
  element.style.paddingRight = pageMargins.right + "in";
15031
15059
  }
@@ -15048,7 +15076,10 @@ const _Editor = class _Editor extends EventEmitter {
15048
15076
  element.style.webkitOverflowScrolling = "touch";
15049
15077
  const defaultLineHeight = 1.2;
15050
15078
  proseMirror.style.lineHeight = defaultLineHeight;
15051
- if (!hasPaginationEnabled) {
15079
+ if (isResponsive) {
15080
+ proseMirror.style.paddingTop = (layoutMargins?.top ?? PIXELS_PER_INCH) + "px";
15081
+ proseMirror.style.paddingBottom = (layoutMargins?.bottom ?? PIXELS_PER_INCH) + "px";
15082
+ } else if (!pagination) {
15052
15083
  proseMirror.style.paddingTop = "1in";
15053
15084
  proseMirror.style.paddingBottom = "1in";
15054
15085
  } else {
@@ -15073,6 +15104,7 @@ const _Editor = class _Editor extends EventEmitter {
15073
15104
  /**
15074
15105
  * Initializes responsive styles for mobile devices.
15075
15106
  * Sets up scaling based on viewport width and handles orientation changes.
15107
+ * Note: Scaling is skipped in responsive layout mode since content reflows naturally.
15076
15108
  *
15077
15109
  * @param {HTMLElement|void} element - The DOM element to apply mobile styles to
15078
15110
  * @returns {void}
@@ -15081,6 +15113,9 @@ const _Editor = class _Editor extends EventEmitter {
15081
15113
  if (!element) {
15082
15114
  return;
15083
15115
  }
15116
+ if (__privateMethod(this, _Editor_instances, isResponsiveMode_fn).call(this)) {
15117
+ return;
15118
+ }
15084
15119
  const initialWidth = element.offsetWidth;
15085
15120
  const updateScale = () => {
15086
15121
  const minPageSideMargin = 10;
@@ -15229,7 +15264,7 @@ const _Editor = class _Editor extends EventEmitter {
15229
15264
  { default: remarkStringify },
15230
15265
  { default: remarkGfm }
15231
15266
  ] = await Promise.all([
15232
- import("./index-CUb1VdVb.js"),
15267
+ import("./index-C6pGFRDv.js"),
15233
15268
  import("./index-DRCvimau.js"),
15234
15269
  import("./index-C_x_N6Uh.js"),
15235
15270
  import("./index-D_sWOSiG.js"),
@@ -15447,7 +15482,7 @@ const _Editor = class _Editor extends EventEmitter {
15447
15482
  * @returns {Object | void} Migration results
15448
15483
  */
15449
15484
  processCollaborationMigrations() {
15450
- console.debug("[checkVersionMigrations] Current editor version", "0.35.3");
15485
+ console.debug("[checkVersionMigrations] Current editor version", "0.36.0");
15451
15486
  if (!this.options.ydoc) return;
15452
15487
  const metaMap = this.options.ydoc.getMap("meta");
15453
15488
  let docVersion = metaMap.get("version");
@@ -15761,6 +15796,39 @@ checkHeadless_fn = function(options) {
15761
15796
  global.window = options.mockWindow;
15762
15797
  }
15763
15798
  };
15799
+ /**
15800
+ * Validate layoutMargins option values
15801
+ * @param {EditorOptions} options - Editor options
15802
+ * @returns {void}
15803
+ */
15804
+ validateLayoutMargins_fn = function(options) {
15805
+ if (!options.layoutMargins) return;
15806
+ const margins = options.layoutMargins;
15807
+ const validatedMargins = {};
15808
+ let hasValidValues = false;
15809
+ for (const key2 of ["top", "bottom", "left", "right"]) {
15810
+ if (margins[key2] !== void 0 && margins[key2] !== null) {
15811
+ const value = margins[key2];
15812
+ if (typeof value === "number" && Number.isFinite(value) && value >= 0) {
15813
+ validatedMargins[key2] = value;
15814
+ hasValidValues = true;
15815
+ } else {
15816
+ console.warn(
15817
+ `[SuperDoc] Invalid layoutMargins.${key2}: ${value}. Value must be a positive finite number. Ignoring this property.`
15818
+ );
15819
+ }
15820
+ }
15821
+ }
15822
+ options.layoutMargins = hasValidValues ? validatedMargins : null;
15823
+ };
15824
+ /**
15825
+ * Check if responsive layout mode is enabled
15826
+ * @returns {boolean} True if layoutMode is 'responsive'
15827
+ * @private
15828
+ */
15829
+ isResponsiveMode_fn = function() {
15830
+ return this.options.layoutMode === "responsive";
15831
+ };
15764
15832
  registerCopyHandler_fn = function() {
15765
15833
  this.view.dom.addEventListener("copy", (event) => {
15766
15834
  const clipboardData = event.clipboardData;
@@ -16043,6 +16111,9 @@ initPagination_fn = async function() {
16043
16111
  if (this.options.isHeadless || !this.extensionService || this.options.isHeaderOrFooter) {
16044
16112
  return;
16045
16113
  }
16114
+ if (__privateMethod(this, _Editor_instances, isResponsiveMode_fn).call(this)) {
16115
+ return;
16116
+ }
16046
16117
  const pagination = this.options.extensions.find((e) => e.name === "pagination");
16047
16118
  if (pagination && this.options.pagination) {
16048
16119
  const sectionData = await initPaginationData(this);
@@ -22057,7 +22128,7 @@ function updateColumns(node, colgroup, table, cellMinWidth, overrideCol, overrid
22057
22128
  const pageWidth = toNumber(pageStyles.pageSize.width);
22058
22129
  const marginLeft = toNumber(pageStyles.pageMargins?.left);
22059
22130
  const marginRight = toNumber(pageStyles.pageMargins?.right);
22060
- const pageAvailableWidthPx = Math.max((pageWidth - marginLeft - marginRight) * PIXELS_PER_INCH, 0);
22131
+ const pageAvailableWidthPx = Math.max((pageWidth - marginLeft - marginRight) * PIXELS_PER_INCH$1, 0);
22061
22132
  if (pageAvailableWidthPx > 0) {
22062
22133
  availableWidth = availableWidth ? Math.min(availableWidth, pageAvailableWidthPx) : pageAvailableWidthPx;
22063
22134
  }
@@ -1,4 +1,4 @@
1
- import { aA as getDefaultExportFromCjs } from "./converter-DCcuo33v.js";
1
+ import { aA as getDefaultExportFromCjs } from "./converter-B_MV8Ifd.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG.js";
3
3
  function bail(error) {
4
4
  if (error) {
@@ -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-DCcuo33v.js";
3
- import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-CyldDVIe.js";
2
+ import { p as process$1 } from "./converter-B_MV8Ifd.js";
3
+ import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-DJdDJYe1.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-DCcuo33v.js";
1
+ import { a5 } from "./chunks/converter-B_MV8Ifd.js";
2
2
  export {
3
3
  a5 as SuperConverter
4
4
  };
@@ -1,5 +1,5 @@
1
- import "./chunks/converter-DCcuo33v.js";
2
- import { D } from "./chunks/docx-zipper-BmJ2rJSz.js";
1
+ import "./chunks/converter-B_MV8Ifd.js";
2
+ import { D } from "./chunks/docx-zipper-BErVQPhm.js";
3
3
  export {
4
4
  D as default
5
5
  };
@@ -1,6 +1,6 @@
1
- import { E } from "./chunks/editor-CyldDVIe.js";
2
- import "./chunks/converter-DCcuo33v.js";
3
- import "./chunks/docx-zipper-BmJ2rJSz.js";
1
+ import { E } from "./chunks/editor-DJdDJYe1.js";
2
+ import "./chunks/converter-B_MV8Ifd.js";
3
+ import "./chunks/docx-zipper-BErVQPhm.js";
4
4
  export {
5
5
  E as Editor
6
6
  };
@@ -1,4 +1,4 @@
1
- import { J as JSZip } from "./chunks/docx-zipper-BmJ2rJSz.js";
1
+ import { J as JSZip } from "./chunks/docx-zipper-BErVQPhm.js";
2
2
  async function createZip(blobs, fileNames) {
3
3
  const zip = new JSZip();
4
4
  blobs.forEach((blob, index) => {
@@ -1949,10 +1949,10 @@ on the right if it is inside shape textbox.
1949
1949
  min-height: 40px;
1950
1950
  }
1951
1951
 
1952
- .editor-element[data-v-86fdd359] {
1952
+ .editor-element[data-v-25b8680d] {
1953
1953
  position: relative;
1954
1954
  }
1955
- .super-editor-container[data-v-86fdd359] {
1955
+ .super-editor-container[data-v-25b8680d] {
1956
1956
  width: auto;
1957
1957
  height: auto;
1958
1958
  min-width: 8in;
@@ -1961,13 +1961,17 @@ on the right if it is inside shape textbox.
1961
1961
  display: flex;
1962
1962
  flex-direction: column;
1963
1963
  }
1964
- .ruler[data-v-86fdd359] {
1964
+ .super-editor-container.no-min-height[data-v-25b8680d] {
1965
+ min-height: unset;
1966
+ min-width: unset;
1967
+ }
1968
+ .ruler[data-v-25b8680d] {
1965
1969
  margin-bottom: 2px;
1966
1970
  }
1967
- .super-editor[data-v-86fdd359] {
1971
+ .super-editor[data-v-25b8680d] {
1968
1972
  color: initial;
1969
1973
  }
1970
- .placeholder-editor[data-v-86fdd359] {
1974
+ .placeholder-editor[data-v-25b8680d] {
1971
1975
  position: absolute;
1972
1976
  top: 0;
1973
1977
  left: 0;
@@ -1979,7 +1983,7 @@ on the right if it is inside shape textbox.
1979
1983
  background-color: white;
1980
1984
  box-sizing: border-box;
1981
1985
  }
1982
- .placeholder-title[data-v-86fdd359] {
1986
+ .placeholder-title[data-v-25b8680d] {
1983
1987
  display: flex;
1984
1988
  justify-content: center;
1985
1989
  margin-bottom: 40px;
@@ -90,6 +90,8 @@
90
90
  * @property {string} [html] - HTML content to initialize the editor with
91
91
  * @property {string} [markdown] - Markdown content to initialize the editor with
92
92
  * @property {boolean} [isDebug=false] - Whether to enable debug mode
93
+ * @property {'responsive' | 'paginated'} [layoutMode='paginated'] - Document layout mode ('paginated' for fixed page width, 'responsive' for fluid width)
94
+ * @property {{top?: number, bottom?: number, left?: number, right?: number}} [layoutMargins] - Custom margins in pixels for responsive layout mode
93
95
  * @property {(params: {
94
96
  * permission: string,
95
97
  * role?: string,
@@ -223,6 +225,8 @@ export class Editor extends EventEmitter {
223
225
  lastSelection: any;
224
226
  suppressDefaultDocxStyles: boolean;
225
227
  jsonOverride: any;
228
+ layoutMode: string;
229
+ layoutMargins: any;
226
230
  onBeforeCreate: () => any;
227
231
  onCreate: () => any;
228
232
  onUpdate: () => any;
@@ -395,14 +399,21 @@ export class Editor extends EventEmitter {
395
399
  */
396
400
  createNodeViews(): void;
397
401
  /**
398
- * Get the maximum content size
399
- * @returns {Object} Size object with width and height
402
+ * Get the maximum content size based on page dimensions and margins
403
+ * @returns {{width: number, height: number} | {}} Size object with width and height in pixels, or empty object if no page size
400
404
  */
401
- getMaxContentSize(): any;
405
+ getMaxContentSize(): {
406
+ width: number;
407
+ height: number;
408
+ } | {};
402
409
  /**
403
410
  * Attach styles and attributes to the editor element
411
+ * @param {HTMLElement} element - The editor container element
412
+ * @param {HTMLElement} proseMirror - The ProseMirror element
413
+ * @param {boolean} [hasPaginationEnabled=true] - Whether pagination is enabled
414
+ * @returns {void}
404
415
  */
405
- updateEditorStyles(element: any, proseMirror: any, hasPaginationEnabled?: boolean): void;
416
+ updateEditorStyles(element: HTMLElement, proseMirror: HTMLElement, hasPaginationEnabled?: boolean): void;
406
417
  /**
407
418
  * Initialize default styles for the editor container and ProseMirror.
408
419
  * Get page size and margins from the converter.
@@ -415,6 +426,7 @@ export class Editor extends EventEmitter {
415
426
  /**
416
427
  * Initializes responsive styles for mobile devices.
417
428
  * Sets up scaling based on viewport width and handles orientation changes.
429
+ * Note: Scaling is skipped in responsive layout mode since content reflows naturally.
418
430
  *
419
431
  * @param {HTMLElement|void} element - The DOM element to apply mobile styles to
420
432
  * @returns {void}
@@ -915,6 +927,19 @@ export type EditorOptions = {
915
927
  * - Whether to enable debug mode
916
928
  */
917
929
  isDebug?: boolean;
930
+ /**
931
+ * - Document layout mode ('paginated' for fixed page width, 'responsive' for fluid width)
932
+ */
933
+ layoutMode?: "responsive" | "paginated";
934
+ /**
935
+ * - Custom margins in pixels for responsive layout mode
936
+ */
937
+ layoutMargins?: {
938
+ top?: number;
939
+ bottom?: number;
940
+ left?: number;
941
+ right?: number;
942
+ };
918
943
  /**
919
944
  * - Host-provided permission hook
920
945
  */