@harbour-enterprises/superdoc 1.0.0-beta.8 → 1.0.0-beta.9

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/{PdfViewer-BfEwF25T.es.js → PdfViewer-CuFLNmIu.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DJ7BWUbW.cjs → PdfViewer-IfeBMKsU.cjs} +1 -1
  3. package/dist/chunks/{index-DJrRlj1_-HA-nVwDO.es.js → index-BVhSHfFK-4HejWjUD.es.js} +1 -1
  4. package/dist/chunks/{index-DJrRlj1_-E5dmStMF.cjs → index-BVhSHfFK-CTmHktSn.cjs} +1 -1
  5. package/dist/chunks/{index-DMwWcmrk.cjs → index-CICIPNZT.cjs} +3 -3
  6. package/dist/chunks/{index-BCZ82zY5.es.js → index-WwpxSzB1.es.js} +3 -3
  7. package/dist/chunks/{super-editor.es-MRWI4sfo.es.js → super-editor.es-BJP3oxNX.es.js} +104 -12
  8. package/dist/chunks/{super-editor.es-Bo_fWMy6.cjs → super-editor.es-CCq8j_qB.cjs} +104 -12
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-CflxlFnM.js → converter-VnZK3P1W.js} +27 -2
  11. package/dist/super-editor/chunks/{docx-zipper-DKWL4mo2.js → docx-zipper-Bw5zXmBh.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-B9V7oJbW.js → editor-CKkHVssy.js} +100 -12
  13. package/dist/super-editor/chunks/{index-DJrRlj1_.js → index-BVhSHfFK.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-B5WlPN4s.js → toolbar-DPzMju-T.js} +2 -2
  15. package/dist/super-editor/converter.es.js +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 +2 -2
  24. package/dist/superdoc.es.js +2 -2
  25. package/dist/superdoc.umd.js +106 -14
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, z 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, u as createVNode, v as unref } from "./vue-CztqUvm1.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-BCZ82zY5.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-WwpxSzB1.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
3
  const vue = require("./vue-ARQSyfaw.cjs");
4
- const superdoc = require("./index-DMwWcmrk.cjs");
4
+ const superdoc = require("./index-CICIPNZT.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-MRWI4sfo.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-BJP3oxNX.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-Bo_fWMy6.cjs");
3
+ const superEditor_es = require("./super-editor.es-CCq8j_qB.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-Bo_fWMy6.cjs");
2
+ const superEditor_es = require("./super-editor.es-CCq8j_qB.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-CFCpOk3d.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -17227,7 +17227,7 @@ const _sfc_main = {
17227
17227
  __name: "SuperDoc",
17228
17228
  emits: ["selection-update"],
17229
17229
  setup(__props, { emit: __emit }) {
17230
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-DJ7BWUbW.cjs")));
17230
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-IfeBMKsU.cjs")));
17231
17231
  const superdocStore = useSuperdocStore();
17232
17232
  const commentsStore = useCommentsStore();
17233
17233
  const {
@@ -18080,7 +18080,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18080
18080
  this.config.colors = shuffleArray(this.config.colors);
18081
18081
  this.userColorMap = /* @__PURE__ */ new Map();
18082
18082
  this.colorIndex = 0;
18083
- this.version = "1.0.0-beta.8";
18083
+ this.version = "1.0.0-beta.9";
18084
18084
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18085
18085
  this.superdocId = config.superdocId || uuid.v4();
18086
18086
  this.colors = this.config.colors;
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-MRWI4sfo.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-BJP3oxNX.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-ByBH0NYV.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -17210,7 +17210,7 @@ const _sfc_main = {
17210
17210
  __name: "SuperDoc",
17211
17211
  emits: ["selection-update"],
17212
17212
  setup(__props, { emit: __emit }) {
17213
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BfEwF25T.es.js"));
17213
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CuFLNmIu.es.js"));
17214
17214
  const superdocStore = useSuperdocStore();
17215
17215
  const commentsStore = useCommentsStore();
17216
17216
  const {
@@ -18063,7 +18063,7 @@ class SuperDoc extends EventEmitter {
18063
18063
  this.config.colors = shuffleArray(this.config.colors);
18064
18064
  this.userColorMap = /* @__PURE__ */ new Map();
18065
18065
  this.colorIndex = 0;
18066
- this.version = "1.0.0-beta.8";
18066
+ this.version = "1.0.0-beta.9";
18067
18067
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18068
18068
  this.superdocId = config.superdocId || v4();
18069
18069
  this.colors = this.config.colors;
@@ -19512,18 +19512,43 @@ function encodeMarksFromRPr(runProperties, docx) {
19512
19512
  }
19513
19513
  return marks;
19514
19514
  }
19515
- function encodeCSSFromPPr(paragraphProperties) {
19515
+ function encodeCSSFromPPr(paragraphProperties, hasPreviousParagraph, nextParagraphProps) {
19516
19516
  if (!paragraphProperties || typeof paragraphProperties !== "object") {
19517
19517
  return {};
19518
19518
  }
19519
19519
  let css = {};
19520
19520
  const { spacing, indent, borders, justification } = paragraphProperties;
19521
+ const nextStyleId = nextParagraphProps?.styleId;
19521
19522
  if (spacing) {
19523
+ const getEffectiveBefore = (nextSpacing, isListItem) => {
19524
+ if (!nextSpacing) return 0;
19525
+ if (nextSpacing.beforeAutospacing && isListItem) {
19526
+ return 0;
19527
+ }
19528
+ return nextSpacing.before || 0;
19529
+ };
19522
19530
  const isDropCap = Boolean(paragraphProperties.framePr?.dropCap);
19523
19531
  const spacingCopy = { ...spacing };
19532
+ if (hasPreviousParagraph) {
19533
+ delete spacingCopy.before;
19534
+ }
19524
19535
  if (isDropCap) {
19525
19536
  spacingCopy.line = linesToTwips(1);
19526
19537
  spacingCopy.lineRule = "auto";
19538
+ delete spacingCopy.after;
19539
+ } else {
19540
+ const nextBefore = getEffectiveBefore(
19541
+ nextParagraphProps?.spacing,
19542
+ Boolean(nextParagraphProps?.numberingProperties)
19543
+ );
19544
+ spacingCopy.after = Math.max(spacingCopy.after || 0, nextBefore);
19545
+ if (paragraphProperties.contextualSpacing && nextStyleId != null && nextStyleId === paragraphProperties.styleId) {
19546
+ spacingCopy.after -= paragraphProperties.spacing?.after || 0;
19547
+ }
19548
+ if (nextParagraphProps?.contextualSpacing && nextStyleId != null && nextStyleId === paragraphProperties.styleId) {
19549
+ spacingCopy.after -= nextBefore;
19550
+ }
19551
+ spacingCopy.after = Math.max(spacingCopy.after, 0);
19527
19552
  }
19528
19553
  const spacingStyle = getSpacingStyle(spacingCopy, Boolean(paragraphProperties.numberingProperties));
19529
19554
  css = { ...css, ...spacingStyle };
@@ -35563,7 +35588,7 @@ const _SuperConverter = class _SuperConverter2 {
35563
35588
  static getStoredSuperdocVersion(docx) {
35564
35589
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35565
35590
  }
35566
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.8") {
35591
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.9") {
35567
35592
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35568
35593
  }
35569
35594
  /**
@@ -38763,7 +38788,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
38763
38788
  var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
38764
38789
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
38765
38790
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
38766
- 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, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, updateHTMLAttributes_fn, updateDOMStyles_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
38791
+ 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, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
38767
38792
  var GOOD_LEAF_SIZE = 200;
38768
38793
  var RopeSequence = function RopeSequence2() {
38769
38794
  };
@@ -52270,7 +52295,7 @@ const isHeadless = (editor) => {
52270
52295
  const shouldSkipNodeView = (editor) => {
52271
52296
  return isHeadless(editor);
52272
52297
  };
52273
- const summaryVersion = "1.0.0-beta.8";
52298
+ const summaryVersion = "1.0.0-beta.9";
52274
52299
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
52275
52300
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
52276
52301
  function mapAttributes(attrs) {
@@ -53049,7 +53074,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53049
53074
  { default: remarkStringify },
53050
53075
  { default: remarkGfm }
53051
53076
  ] = await Promise.all([
53052
- import("./index-DJrRlj1_-HA-nVwDO.es.js"),
53077
+ import("./index-BVhSHfFK-4HejWjUD.es.js"),
53053
53078
  import("./index-DRCvimau-Cw339678.es.js"),
53054
53079
  import("./index-C_x_N6Uh-DJn8hIEt.es.js"),
53055
53080
  import("./index-D_sWOSiG-DE96TaT5.es.js"),
@@ -53254,7 +53279,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53254
53279
  * Process collaboration migrations
53255
53280
  */
53256
53281
  processCollaborationMigrations() {
53257
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.8");
53282
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.9");
53258
53283
  if (!this.options.ydoc) return;
53259
53284
  const metaMap = this.options.ydoc.getMap("meta");
53260
53285
  let docVersion = metaMap.get("version");
@@ -75065,6 +75090,7 @@ function calcTabHeight(blockParent2) {
75065
75090
  const fontSize2 = parseInt(parentTextStyleMark?.attrs.fontSize) * ptToPxRatio || defaultFontSize;
75066
75091
  return `${fontSize2 * defaultLineHeight}px`;
75067
75092
  }
75093
+ const nodeViewMap = /* @__PURE__ */ new WeakMap();
75068
75094
  class ParagraphNodeView {
75069
75095
  /**
75070
75096
  * @param {import('prosemirror-model').Node} node Current paragraph node.
@@ -75081,6 +75107,8 @@ class ParagraphNodeView {
75081
75107
  this.decorations = decorations;
75082
75108
  this.extensionAttrs = extensionAttrs;
75083
75109
  this._animationFrameRequest = null;
75110
+ this.surroundingContext = {};
75111
+ nodeViewMap.set(this.node, this);
75084
75112
  calculateResolvedParagraphProperties(this.editor, this.node, this.editor.state.doc.resolve(this.getPos()));
75085
75113
  this.dom = document.createElement("p");
75086
75114
  this.contentDOM = document.createElement("span");
@@ -75100,18 +75128,26 @@ class ParagraphNodeView {
75100
75128
  /**
75101
75129
  * @param {import('prosemirror-model').Node} node
75102
75130
  * @param {import('prosemirror-view').Decoration[]} decorations
75131
+ * @param {import('prosemirror-view').Decoration[]} innerDecorations
75132
+ * @param {boolean} [forceUpdate=false]
75133
+ * @returns {boolean}
75103
75134
  */
75104
- update(node, decorations) {
75135
+ update(node, decorations, innerDecorations, forceUpdate = false) {
75136
+ if (nodeViewMap.get(this.node) === this) {
75137
+ nodeViewMap.delete(this.node);
75138
+ }
75139
+ const oldProps = getResolvedParagraphProperties(this.node);
75105
75140
  const oldAttrs = this.node.attrs;
75106
- const newAttrs = node.attrs;
75107
75141
  this.node = node;
75108
75142
  this.decorations = decorations;
75109
- if (JSON.stringify(oldAttrs) === JSON.stringify(newAttrs)) {
75143
+ this.innerDecorations = innerDecorations;
75144
+ nodeViewMap.set(this.node, this);
75145
+ if (!forceUpdate && !__privateMethod$1(this, _ParagraphNodeView_instances, checkShouldUpdate_fn).call(this, oldProps, oldAttrs, this.surroundingContext)) {
75110
75146
  return true;
75111
75147
  }
75112
75148
  calculateResolvedParagraphProperties(this.editor, this.node, this.editor.state.doc.resolve(this.getPos()));
75113
75149
  __privateMethod$1(this, _ParagraphNodeView_instances, updateHTMLAttributes_fn).call(this);
75114
- __privateMethod$1(this, _ParagraphNodeView_instances, updateDOMStyles_fn).call(this);
75150
+ __privateMethod$1(this, _ParagraphNodeView_instances, updateDOMStyles_fn).call(this, oldProps);
75115
75151
  if (!__privateMethod$1(this, _ParagraphNodeView_instances, checkIsList_fn).call(this)) {
75116
75152
  __privateMethod$1(this, _ParagraphNodeView_instances, removeList_fn).call(this);
75117
75153
  return true;
@@ -75154,9 +75190,16 @@ class ParagraphNodeView {
75154
75190
  }
75155
75191
  destroy() {
75156
75192
  __privateMethod$1(this, _ParagraphNodeView_instances, cancelScheduledAnimation_fn).call(this);
75193
+ if (nodeViewMap.get(this.node) === this) {
75194
+ nodeViewMap.delete(this.node);
75195
+ }
75157
75196
  }
75158
75197
  }
75159
75198
  _ParagraphNodeView_instances = /* @__PURE__ */ new WeakSet();
75199
+ checkShouldUpdate_fn = function(oldProps, oldAttrs, oldSurroundingContext) {
75200
+ __privateMethod$1(this, _ParagraphNodeView_instances, resolveNeighborParagraphProperties_fn).call(this);
75201
+ return JSON.stringify(oldAttrs) !== JSON.stringify(this.node.attrs) || JSON.stringify(oldProps) !== JSON.stringify(getResolvedParagraphProperties(this.node)) || JSON.stringify(oldSurroundingContext) !== JSON.stringify(this.surroundingContext);
75202
+ };
75160
75203
  updateHTMLAttributes_fn = function() {
75161
75204
  const htmlAttributes = Attribute2.getAttributesToRender(this.node, this.extensionAttrs);
75162
75205
  htmlAttributes.style = htmlAttributes.style || "";
@@ -75184,13 +75227,62 @@ updateHTMLAttributes_fn = function() {
75184
75227
  this.dom.setAttribute("styleid", paragraphProperties.styleId);
75185
75228
  }
75186
75229
  };
75187
- updateDOMStyles_fn = function() {
75230
+ updateDOMStyles_fn = function(oldParagraphProperties = null) {
75188
75231
  this.dom.style.cssText = "";
75189
75232
  const paragraphProperties = getResolvedParagraphProperties(this.node);
75190
- const style2 = encodeCSSFromPPr(paragraphProperties);
75233
+ __privateMethod$1(this, _ParagraphNodeView_instances, resolveNeighborParagraphProperties_fn).call(this);
75234
+ const style2 = encodeCSSFromPPr(
75235
+ paragraphProperties,
75236
+ this.surroundingContext.hasPreviousParagraph,
75237
+ this.surroundingContext.nextParagraphProps
75238
+ );
75191
75239
  Object.entries(style2).forEach(([k2, v2]) => {
75192
75240
  this.dom.style[k2] = v2;
75193
75241
  });
75242
+ if (JSON.stringify(paragraphProperties.spacing) !== JSON.stringify(oldParagraphProperties?.spacing) || paragraphProperties.styleId !== oldParagraphProperties?.styleId || paragraphProperties.contextualSpacing !== oldParagraphProperties?.contextualSpacing) {
75243
+ const previousNodeView = this.surroundingContext.previousParagraph ? nodeViewMap.get(this.surroundingContext.previousParagraph) : null;
75244
+ if (previousNodeView) {
75245
+ try {
75246
+ previousNodeView.getPos();
75247
+ } catch {
75248
+ return;
75249
+ }
75250
+ previousNodeView.update(
75251
+ previousNodeView.node,
75252
+ previousNodeView.decorations,
75253
+ previousNodeView.innerDecorations,
75254
+ true
75255
+ );
75256
+ }
75257
+ }
75258
+ };
75259
+ resolveNeighborParagraphProperties_fn = function() {
75260
+ const $pos = this.editor.state.doc.resolve(this.getPos());
75261
+ const parent = $pos.parent;
75262
+ const index2 = $pos.index();
75263
+ let hasPreviousParagraph = false;
75264
+ let previousParagraph = null;
75265
+ let nextParagraphProps = null;
75266
+ if (index2 > 0) {
75267
+ const previousNode = parent.child(index2 - 1);
75268
+ hasPreviousParagraph = previousNode.type.name === "paragraph" && !getResolvedParagraphProperties(previousNode)?.framePr?.dropCap;
75269
+ if (hasPreviousParagraph) {
75270
+ previousParagraph = previousNode;
75271
+ }
75272
+ }
75273
+ if (parent) {
75274
+ if (index2 < parent.childCount - 1) {
75275
+ const nextNode = parent.child(index2 + 1);
75276
+ if (nextNode.type.name === "paragraph") {
75277
+ nextParagraphProps = getResolvedParagraphProperties(nextNode);
75278
+ }
75279
+ }
75280
+ }
75281
+ this.surroundingContext = {
75282
+ hasPreviousParagraph,
75283
+ previousParagraph,
75284
+ nextParagraphProps
75285
+ };
75194
75286
  };
75195
75287
  updateListStyles_fn = function() {
75196
75288
  let { suffix: suffix2, justification } = this.node.attrs.listRendering;
@@ -19529,18 +19529,43 @@ function encodeMarksFromRPr(runProperties, docx) {
19529
19529
  }
19530
19530
  return marks;
19531
19531
  }
19532
- function encodeCSSFromPPr(paragraphProperties) {
19532
+ function encodeCSSFromPPr(paragraphProperties, hasPreviousParagraph, nextParagraphProps) {
19533
19533
  if (!paragraphProperties || typeof paragraphProperties !== "object") {
19534
19534
  return {};
19535
19535
  }
19536
19536
  let css = {};
19537
19537
  const { spacing, indent, borders, justification } = paragraphProperties;
19538
+ const nextStyleId = nextParagraphProps?.styleId;
19538
19539
  if (spacing) {
19540
+ const getEffectiveBefore = (nextSpacing, isListItem) => {
19541
+ if (!nextSpacing) return 0;
19542
+ if (nextSpacing.beforeAutospacing && isListItem) {
19543
+ return 0;
19544
+ }
19545
+ return nextSpacing.before || 0;
19546
+ };
19539
19547
  const isDropCap = Boolean(paragraphProperties.framePr?.dropCap);
19540
19548
  const spacingCopy = { ...spacing };
19549
+ if (hasPreviousParagraph) {
19550
+ delete spacingCopy.before;
19551
+ }
19541
19552
  if (isDropCap) {
19542
19553
  spacingCopy.line = linesToTwips(1);
19543
19554
  spacingCopy.lineRule = "auto";
19555
+ delete spacingCopy.after;
19556
+ } else {
19557
+ const nextBefore = getEffectiveBefore(
19558
+ nextParagraphProps?.spacing,
19559
+ Boolean(nextParagraphProps?.numberingProperties)
19560
+ );
19561
+ spacingCopy.after = Math.max(spacingCopy.after || 0, nextBefore);
19562
+ if (paragraphProperties.contextualSpacing && nextStyleId != null && nextStyleId === paragraphProperties.styleId) {
19563
+ spacingCopy.after -= paragraphProperties.spacing?.after || 0;
19564
+ }
19565
+ if (nextParagraphProps?.contextualSpacing && nextStyleId != null && nextStyleId === paragraphProperties.styleId) {
19566
+ spacingCopy.after -= nextBefore;
19567
+ }
19568
+ spacingCopy.after = Math.max(spacingCopy.after, 0);
19544
19569
  }
19545
19570
  const spacingStyle = getSpacingStyle(spacingCopy, Boolean(paragraphProperties.numberingProperties));
19546
19571
  css = { ...css, ...spacingStyle };
@@ -35580,7 +35605,7 @@ const _SuperConverter = class _SuperConverter2 {
35580
35605
  static getStoredSuperdocVersion(docx) {
35581
35606
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
35582
35607
  }
35583
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.8") {
35608
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-beta.9") {
35584
35609
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
35585
35610
  }
35586
35611
  /**
@@ -38780,7 +38805,7 @@ var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "rea
38780
38805
  var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
38781
38806
  var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
38782
38807
  var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
38783
- 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, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, updateHTMLAttributes_fn, updateDOMStyles_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
38808
+ 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, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_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, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _headerLayoutResults, _footerLayoutResults, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _remoteCursorState, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _remoteCursorRafHandle, _scrollTimeout, _PresentationEditor_instances, aggregateLayoutBounds_fn, safeCleanup_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, normalizeAwarenessStates_fn, getFallbackColor_fn, getValidatedColor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, renderRemoteCaret_fn, renderRemoteCursorLabel_fn, renderRemoteSelection_fn, setupPointerHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, updateDecorationProviders_fn, createDecorationProvider_fn, computeDecorationBox_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, computeHeaderFooterCaretRect_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, parseColumns_fn, inchesToPx_fn, applyZoom_fn, createLayoutMetrics_fn, convertPageLocalToOverlayCoords_fn, normalizeClientPoint_fn, computeCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn;
38784
38809
  var GOOD_LEAF_SIZE = 200;
38785
38810
  var RopeSequence = function RopeSequence2() {
38786
38811
  };
@@ -52287,7 +52312,7 @@ const isHeadless = (editor) => {
52287
52312
  const shouldSkipNodeView = (editor) => {
52288
52313
  return isHeadless(editor);
52289
52314
  };
52290
- const summaryVersion = "1.0.0-beta.8";
52315
+ const summaryVersion = "1.0.0-beta.9";
52291
52316
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
52292
52317
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
52293
52318
  function mapAttributes(attrs) {
@@ -53066,7 +53091,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53066
53091
  { default: remarkStringify },
53067
53092
  { default: remarkGfm }
53068
53093
  ] = await Promise.all([
53069
- Promise.resolve().then(() => require("./index-DJrRlj1_-E5dmStMF.cjs")),
53094
+ Promise.resolve().then(() => require("./index-BVhSHfFK-CTmHktSn.cjs")),
53070
53095
  Promise.resolve().then(() => require("./index-DRCvimau-H4Ck3S9a.cjs")),
53071
53096
  Promise.resolve().then(() => require("./index-C_x_N6Uh-Db3CUJMX.cjs")),
53072
53097
  Promise.resolve().then(() => require("./index-D_sWOSiG-BtDZzJ6I.cjs")),
@@ -53271,7 +53296,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
53271
53296
  * Process collaboration migrations
53272
53297
  */
53273
53298
  processCollaborationMigrations() {
53274
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.8");
53299
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.9");
53275
53300
  if (!this.options.ydoc) return;
53276
53301
  const metaMap = this.options.ydoc.getMap("meta");
53277
53302
  let docVersion = metaMap.get("version");
@@ -75082,6 +75107,7 @@ function calcTabHeight(blockParent2) {
75082
75107
  const fontSize2 = parseInt(parentTextStyleMark?.attrs.fontSize) * ptToPxRatio || defaultFontSize;
75083
75108
  return `${fontSize2 * defaultLineHeight}px`;
75084
75109
  }
75110
+ const nodeViewMap = /* @__PURE__ */ new WeakMap();
75085
75111
  class ParagraphNodeView {
75086
75112
  /**
75087
75113
  * @param {import('prosemirror-model').Node} node Current paragraph node.
@@ -75098,6 +75124,8 @@ class ParagraphNodeView {
75098
75124
  this.decorations = decorations;
75099
75125
  this.extensionAttrs = extensionAttrs;
75100
75126
  this._animationFrameRequest = null;
75127
+ this.surroundingContext = {};
75128
+ nodeViewMap.set(this.node, this);
75101
75129
  calculateResolvedParagraphProperties(this.editor, this.node, this.editor.state.doc.resolve(this.getPos()));
75102
75130
  this.dom = document.createElement("p");
75103
75131
  this.contentDOM = document.createElement("span");
@@ -75117,18 +75145,26 @@ class ParagraphNodeView {
75117
75145
  /**
75118
75146
  * @param {import('prosemirror-model').Node} node
75119
75147
  * @param {import('prosemirror-view').Decoration[]} decorations
75148
+ * @param {import('prosemirror-view').Decoration[]} innerDecorations
75149
+ * @param {boolean} [forceUpdate=false]
75150
+ * @returns {boolean}
75120
75151
  */
75121
- update(node, decorations) {
75152
+ update(node, decorations, innerDecorations, forceUpdate = false) {
75153
+ if (nodeViewMap.get(this.node) === this) {
75154
+ nodeViewMap.delete(this.node);
75155
+ }
75156
+ const oldProps = getResolvedParagraphProperties(this.node);
75122
75157
  const oldAttrs = this.node.attrs;
75123
- const newAttrs = node.attrs;
75124
75158
  this.node = node;
75125
75159
  this.decorations = decorations;
75126
- if (JSON.stringify(oldAttrs) === JSON.stringify(newAttrs)) {
75160
+ this.innerDecorations = innerDecorations;
75161
+ nodeViewMap.set(this.node, this);
75162
+ if (!forceUpdate && !__privateMethod$1(this, _ParagraphNodeView_instances, checkShouldUpdate_fn).call(this, oldProps, oldAttrs, this.surroundingContext)) {
75127
75163
  return true;
75128
75164
  }
75129
75165
  calculateResolvedParagraphProperties(this.editor, this.node, this.editor.state.doc.resolve(this.getPos()));
75130
75166
  __privateMethod$1(this, _ParagraphNodeView_instances, updateHTMLAttributes_fn).call(this);
75131
- __privateMethod$1(this, _ParagraphNodeView_instances, updateDOMStyles_fn).call(this);
75167
+ __privateMethod$1(this, _ParagraphNodeView_instances, updateDOMStyles_fn).call(this, oldProps);
75132
75168
  if (!__privateMethod$1(this, _ParagraphNodeView_instances, checkIsList_fn).call(this)) {
75133
75169
  __privateMethod$1(this, _ParagraphNodeView_instances, removeList_fn).call(this);
75134
75170
  return true;
@@ -75171,9 +75207,16 @@ class ParagraphNodeView {
75171
75207
  }
75172
75208
  destroy() {
75173
75209
  __privateMethod$1(this, _ParagraphNodeView_instances, cancelScheduledAnimation_fn).call(this);
75210
+ if (nodeViewMap.get(this.node) === this) {
75211
+ nodeViewMap.delete(this.node);
75212
+ }
75174
75213
  }
75175
75214
  }
75176
75215
  _ParagraphNodeView_instances = /* @__PURE__ */ new WeakSet();
75216
+ checkShouldUpdate_fn = function(oldProps, oldAttrs, oldSurroundingContext) {
75217
+ __privateMethod$1(this, _ParagraphNodeView_instances, resolveNeighborParagraphProperties_fn).call(this);
75218
+ return JSON.stringify(oldAttrs) !== JSON.stringify(this.node.attrs) || JSON.stringify(oldProps) !== JSON.stringify(getResolvedParagraphProperties(this.node)) || JSON.stringify(oldSurroundingContext) !== JSON.stringify(this.surroundingContext);
75219
+ };
75177
75220
  updateHTMLAttributes_fn = function() {
75178
75221
  const htmlAttributes = Attribute2.getAttributesToRender(this.node, this.extensionAttrs);
75179
75222
  htmlAttributes.style = htmlAttributes.style || "";
@@ -75201,13 +75244,62 @@ updateHTMLAttributes_fn = function() {
75201
75244
  this.dom.setAttribute("styleid", paragraphProperties.styleId);
75202
75245
  }
75203
75246
  };
75204
- updateDOMStyles_fn = function() {
75247
+ updateDOMStyles_fn = function(oldParagraphProperties = null) {
75205
75248
  this.dom.style.cssText = "";
75206
75249
  const paragraphProperties = getResolvedParagraphProperties(this.node);
75207
- const style2 = encodeCSSFromPPr(paragraphProperties);
75250
+ __privateMethod$1(this, _ParagraphNodeView_instances, resolveNeighborParagraphProperties_fn).call(this);
75251
+ const style2 = encodeCSSFromPPr(
75252
+ paragraphProperties,
75253
+ this.surroundingContext.hasPreviousParagraph,
75254
+ this.surroundingContext.nextParagraphProps
75255
+ );
75208
75256
  Object.entries(style2).forEach(([k2, v2]) => {
75209
75257
  this.dom.style[k2] = v2;
75210
75258
  });
75259
+ if (JSON.stringify(paragraphProperties.spacing) !== JSON.stringify(oldParagraphProperties?.spacing) || paragraphProperties.styleId !== oldParagraphProperties?.styleId || paragraphProperties.contextualSpacing !== oldParagraphProperties?.contextualSpacing) {
75260
+ const previousNodeView = this.surroundingContext.previousParagraph ? nodeViewMap.get(this.surroundingContext.previousParagraph) : null;
75261
+ if (previousNodeView) {
75262
+ try {
75263
+ previousNodeView.getPos();
75264
+ } catch {
75265
+ return;
75266
+ }
75267
+ previousNodeView.update(
75268
+ previousNodeView.node,
75269
+ previousNodeView.decorations,
75270
+ previousNodeView.innerDecorations,
75271
+ true
75272
+ );
75273
+ }
75274
+ }
75275
+ };
75276
+ resolveNeighborParagraphProperties_fn = function() {
75277
+ const $pos = this.editor.state.doc.resolve(this.getPos());
75278
+ const parent = $pos.parent;
75279
+ const index2 = $pos.index();
75280
+ let hasPreviousParagraph = false;
75281
+ let previousParagraph = null;
75282
+ let nextParagraphProps = null;
75283
+ if (index2 > 0) {
75284
+ const previousNode = parent.child(index2 - 1);
75285
+ hasPreviousParagraph = previousNode.type.name === "paragraph" && !getResolvedParagraphProperties(previousNode)?.framePr?.dropCap;
75286
+ if (hasPreviousParagraph) {
75287
+ previousParagraph = previousNode;
75288
+ }
75289
+ }
75290
+ if (parent) {
75291
+ if (index2 < parent.childCount - 1) {
75292
+ const nextNode = parent.child(index2 + 1);
75293
+ if (nextNode.type.name === "paragraph") {
75294
+ nextParagraphProps = getResolvedParagraphProperties(nextNode);
75295
+ }
75296
+ }
75297
+ }
75298
+ this.surroundingContext = {
75299
+ hasPreviousParagraph,
75300
+ previousParagraph,
75301
+ nextParagraphProps
75302
+ };
75211
75303
  };
75212
75304
  updateListStyles_fn = function() {
75213
75305
  let { suffix: suffix2, justification } = this.node.attrs.listRendering;
@@ -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-CflxlFnM.js";
3
- import { _ as _export_sfc } from "./chunks/editor-B9V7oJbW.js";
2
+ import { T as TextSelection } from "./chunks/converter-VnZK3P1W.js";
3
+ import { _ as _export_sfc } from "./chunks/editor-CKkHVssy.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 = {}) {
@@ -19518,18 +19518,43 @@ function encodeMarksFromRPr(runProperties, docx) {
19518
19518
  }
19519
19519
  return marks;
19520
19520
  }
19521
- function encodeCSSFromPPr(paragraphProperties) {
19521
+ function encodeCSSFromPPr(paragraphProperties, hasPreviousParagraph, nextParagraphProps) {
19522
19522
  if (!paragraphProperties || typeof paragraphProperties !== "object") {
19523
19523
  return {};
19524
19524
  }
19525
19525
  let css = {};
19526
19526
  const { spacing, indent, borders, justification } = paragraphProperties;
19527
+ const nextStyleId = nextParagraphProps?.styleId;
19527
19528
  if (spacing) {
19529
+ const getEffectiveBefore = (nextSpacing, isListItem) => {
19530
+ if (!nextSpacing) return 0;
19531
+ if (nextSpacing.beforeAutospacing && isListItem) {
19532
+ return 0;
19533
+ }
19534
+ return nextSpacing.before || 0;
19535
+ };
19528
19536
  const isDropCap = Boolean(paragraphProperties.framePr?.dropCap);
19529
19537
  const spacingCopy = { ...spacing };
19538
+ if (hasPreviousParagraph) {
19539
+ delete spacingCopy.before;
19540
+ }
19530
19541
  if (isDropCap) {
19531
19542
  spacingCopy.line = linesToTwips(1);
19532
19543
  spacingCopy.lineRule = "auto";
19544
+ delete spacingCopy.after;
19545
+ } else {
19546
+ const nextBefore = getEffectiveBefore(
19547
+ nextParagraphProps?.spacing,
19548
+ Boolean(nextParagraphProps?.numberingProperties)
19549
+ );
19550
+ spacingCopy.after = Math.max(spacingCopy.after || 0, nextBefore);
19551
+ if (paragraphProperties.contextualSpacing && nextStyleId != null && nextStyleId === paragraphProperties.styleId) {
19552
+ spacingCopy.after -= paragraphProperties.spacing?.after || 0;
19553
+ }
19554
+ if (nextParagraphProps?.contextualSpacing && nextStyleId != null && nextStyleId === paragraphProperties.styleId) {
19555
+ spacingCopy.after -= nextBefore;
19556
+ }
19557
+ spacingCopy.after = Math.max(spacingCopy.after, 0);
19533
19558
  }
19534
19559
  const spacingStyle = getSpacingStyle(spacingCopy, Boolean(paragraphProperties.numberingProperties));
19535
19560
  css = { ...css, ...spacingStyle };
@@ -35844,7 +35869,7 @@ const _SuperConverter = class _SuperConverter {
35844
35869
  static getStoredSuperdocVersion(docx) {
35845
35870
  return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
35846
35871
  }
35847
- static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.8") {
35872
+ static setStoredSuperdocVersion(docx = this.convertedXml, version = "1.0.0-beta.9") {
35848
35873
  return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
35849
35874
  }
35850
35875
  /**
@@ -1,4 +1,4 @@
1
- import { p as process$1, aI as commonjsGlobal, B as Buffer, aJ as getDefaultExportFromCjs, aK as getContentTypesFromXml, aL as xmljs } from "./converter-CflxlFnM.js";
1
+ import { p as process$1, aI as commonjsGlobal, B as Buffer, aJ as getDefaultExportFromCjs, aK as getContentTypesFromXml, aL as xmljs } from "./converter-VnZK3P1W.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
  }