@harbour-enterprises/superdoc 1.0.0-beta.31 → 1.0.0-beta.32

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-C8iiBtQt.cjs → PdfViewer-CTKbqDWv.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-jGctuklH.es.js → PdfViewer-edjIRb_p.es.js} +1 -1
  3. package/dist/chunks/{index-ELjoBC86.cjs → index-Cajp7-Xa.cjs} +3 -3
  4. package/dist/chunks/{index-Bu5UUj9S.es.js → index-Pwv0a9G5.es.js} +3 -3
  5. package/dist/chunks/{index-eG-VYUeN-CIuOnW8W.es.js → index-SGV4U12y-BPGxOtvI.es.js} +1 -1
  6. package/dist/chunks/{index-eG-VYUeN-CG3M1n5T.cjs → index-SGV4U12y-Dh5jaROA.cjs} +1 -1
  7. package/dist/chunks/{super-editor.es-DatOA_vA.cjs → super-editor.es-BbbbKgEs.cjs} +1314 -62
  8. package/dist/chunks/{super-editor.es-BAKZgAuj.es.js → super-editor.es-CdGsYGU1.es.js} +1314 -62
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-CRKt1TG_.js → converter-CpuOoAUa.js} +1 -1
  11. package/dist/super-editor/chunks/{docx-zipper-CgVw58T-.js → docx-zipper-Dk99r397.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-COQCS1pn.js → editor-CFv-RJI-.js} +1363 -63
  13. package/dist/super-editor/chunks/{index-eG-VYUeN.js → index-SGV4U12y.js} +1 -1
  14. package/dist/super-editor/chunks/{toolbar-B3CSV2yT.js → toolbar-CQr3Xnx9.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 +1316 -64
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -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, 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, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, hideDimmingOverlay_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _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, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _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, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_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, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_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, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _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, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
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, 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, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, hideDimmingOverlay_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionUpdateScheduled, _remoteCursorUpdateScheduled, _rafHandle, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _isDragging, _dragExtensionMode, _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, setupDragHandlers_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, isWordCharacter_fn, _handlePointerMove, _handlePointerLeave, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_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, createDefaultHeaderFooter_fn, getPageElement_fn, scrollPageIntoView_fn, waitForPageMount_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderSelectionRects_fn, renderHoverRegion_fn, clearHoverRegion_fn, renderCaretOverlay_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_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, computeCaretLayoutRectFromDOM_fn, computeTableCaretLayoutRect_fn, findLineContainingPos_fn, lineHeightBeforeIndex_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, createHiddenHost_fn, _windowRoot, _layoutSurfaces, _getTargetDom, _isEditable, _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, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
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 htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName, $ as TrackInsertMarkName, a0 as v4, a1 as TrackFormatMarkName, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as encodeCSSFromPPr, at as twipsToPixels$2, au as resolveRunProperties, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-CRKt1TG_.js";
16
- import { D as DocxZipper } from "./docx-zipper-CgVw58T-.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 htmlHandler, E as ReplaceStep, G as twipsToInches, H as inchesToTwips, I as ptToTwips, J as getResolvedParagraphProperties, K as linesToTwips, L as changeListLevel, O as findParentNode, Q as isList, U as updateNumberingProperties, V as ListHelpers, W as isMacOS, X as isIOS, Y as getSchemaTypeByName, Z as inputRulesPlugin, _ as TrackDeleteMarkName, $ as TrackInsertMarkName, a0 as v4, a1 as TrackFormatMarkName, a2 as comments_module_events, a3 as findMark, a4 as objectIncludes, a5 as AddMarkStep, a6 as RemoveMarkStep, a7 as twipsToLines, a8 as pixelsToTwips, a9 as helpers, aa as posToDOMRect, ab as CommandService, ac as SuperConverter, ad as createDocument, ae as createDocFromMarkdown, af as createDocFromHTML, ag as EditorState, ah as isActive, ai as unflattenListsInHtml, aj as resolveParagraphProperties, ak as _getReferencedTableStyles, al as parseSizeUnit, am as minMax, an as updateDOMAttributes, ao as findChildren$5, ap as generateRandomSigned32BitIntStrId, aq as decodeRPrFromMarks, ar as calculateResolvedParagraphProperties, as as encodeCSSFromPPr, at as twipsToPixels$2, au as resolveRunProperties, av as encodeCSSFromRPr, aw as generateOrderedListIndex, ax as docxNumberingHelpers, ay as InputRule, az as convertSizeToCSS, aA as SelectionRange, aB as Transform, aC as findParentNodeClosestToPos, aD as isInTable$1, aE as generateDocxRandomId, aF as insertNewRelationship, aG as inchesToPixels, aH as kebabCase, aI as getUnderlineCssString } from "./converter-CpuOoAUa.js";
16
+ import { D as DocxZipper } from "./docx-zipper-Dk99r397.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() {
@@ -13913,7 +13913,7 @@ const isHeadless = (editor) => {
13913
13913
  const shouldSkipNodeView = (editor) => {
13914
13914
  return isHeadless(editor);
13915
13915
  };
13916
- const summaryVersion = "1.0.0-beta.31";
13916
+ const summaryVersion = "1.0.0-beta.32";
13917
13917
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
13918
13918
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
13919
13919
  function mapAttributes(attrs) {
@@ -14705,7 +14705,7 @@ const _Editor = class _Editor extends EventEmitter {
14705
14705
  { default: remarkStringify },
14706
14706
  { default: remarkGfm }
14707
14707
  ] = await Promise.all([
14708
- import("./index-eG-VYUeN.js"),
14708
+ import("./index-SGV4U12y.js"),
14709
14709
  import("./index-DRCvimau.js"),
14710
14710
  import("./index-C_x_N6Uh.js"),
14711
14711
  import("./index-D_sWOSiG.js"),
@@ -14910,7 +14910,7 @@ const _Editor = class _Editor extends EventEmitter {
14910
14910
  * Process collaboration migrations
14911
14911
  */
14912
14912
  processCollaborationMigrations() {
14913
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.31");
14913
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-beta.32");
14914
14914
  if (!this.options.ydoc) return;
14915
14915
  const metaMap = this.options.ydoc.getMap("meta");
14916
14916
  let docVersion = metaMap.get("version");
@@ -20140,7 +20140,27 @@ function handleStructuredContentBlockNode(node, context) {
20140
20140
  blocks.push(block);
20141
20141
  recordBlockKind(block.kind);
20142
20142
  });
20143
- } else if (child.type === "table") ;
20143
+ } else if (child.type === "table") {
20144
+ const tableNodeToBlock2 = converters?.tableNodeToBlock;
20145
+ if (tableNodeToBlock2) {
20146
+ const tableBlock = tableNodeToBlock2(
20147
+ child,
20148
+ nextBlockId,
20149
+ positions,
20150
+ defaultFont,
20151
+ defaultSize,
20152
+ styleContext,
20153
+ trackedChangesConfig,
20154
+ bookmarks,
20155
+ hyperlinkConfig
20156
+ );
20157
+ if (tableBlock) {
20158
+ applySdtMetadataToTableBlock(tableBlock, structuredContentMetadata);
20159
+ blocks.push(tableBlock);
20160
+ recordBlockKind(tableBlock.kind);
20161
+ }
20162
+ }
20163
+ }
20144
20164
  });
20145
20165
  }
20146
20166
  function processParagraphChild(child, sectionMetadata, context, output, converters) {
@@ -20610,6 +20630,65 @@ function imageNodeToRun(node, positions, activeSdt) {
20610
20630
  }
20611
20631
  return run;
20612
20632
  }
20633
+ function fieldAnnotationNodeToRun(node, positions, fieldMetadata) {
20634
+ const attrs = node.attrs ?? {};
20635
+ const rawVariant = attrs.type ?? fieldMetadata?.variant ?? "text";
20636
+ const validVariants = ["text", "image", "signature", "checkbox", "html", "link"];
20637
+ const variant = validVariants.includes(rawVariant) ? rawVariant : "text";
20638
+ const displayLabel = (typeof attrs.displayLabel === "string" ? attrs.displayLabel : void 0) || (typeof attrs.defaultDisplayLabel === "string" ? attrs.defaultDisplayLabel : void 0) || (typeof fieldMetadata?.displayLabel === "string" ? fieldMetadata.displayLabel : void 0) || (typeof fieldMetadata?.defaultDisplayLabel === "string" ? fieldMetadata.defaultDisplayLabel : void 0) || (typeof attrs.alias === "string" ? attrs.alias : void 0) || (typeof fieldMetadata?.alias === "string" ? fieldMetadata.alias : void 0) || "";
20639
+ const run = {
20640
+ kind: "fieldAnnotation",
20641
+ variant,
20642
+ displayLabel
20643
+ };
20644
+ const fieldId = typeof attrs.fieldId === "string" ? attrs.fieldId : fieldMetadata?.fieldId;
20645
+ if (fieldId) run.fieldId = fieldId;
20646
+ const fieldType = typeof attrs.fieldType === "string" ? attrs.fieldType : fieldMetadata?.fieldType;
20647
+ if (fieldType) run.fieldType = fieldType;
20648
+ const fieldColor = typeof attrs.fieldColor === "string" ? attrs.fieldColor : fieldMetadata?.fieldColor;
20649
+ if (fieldColor) run.fieldColor = fieldColor;
20650
+ const borderColor = typeof attrs.borderColor === "string" ? attrs.borderColor : fieldMetadata?.borderColor;
20651
+ if (borderColor) run.borderColor = borderColor;
20652
+ const highlighted = attrs.highlighted ?? fieldMetadata?.highlighted;
20653
+ if (highlighted === false) run.highlighted = false;
20654
+ if (attrs.hidden === true || fieldMetadata?.hidden === true) run.hidden = true;
20655
+ const visibility = attrs.visibility ?? fieldMetadata?.visibility;
20656
+ if (visibility === "hidden") run.visibility = "hidden";
20657
+ const imageSrc = typeof attrs.imageSrc === "string" ? attrs.imageSrc : fieldMetadata?.imageSrc;
20658
+ if (imageSrc) run.imageSrc = imageSrc;
20659
+ const linkUrl = typeof attrs.linkUrl === "string" ? attrs.linkUrl : fieldMetadata?.linkUrl;
20660
+ if (linkUrl) run.linkUrl = linkUrl;
20661
+ const rawHtml = attrs.rawHtml ?? fieldMetadata?.rawHtml;
20662
+ if (typeof rawHtml === "string") run.rawHtml = rawHtml;
20663
+ const size = attrs.size ?? fieldMetadata?.size;
20664
+ if (size && (typeof size.width === "number" || typeof size.height === "number")) {
20665
+ run.size = {
20666
+ width: typeof size.width === "number" ? size.width : void 0,
20667
+ height: typeof size.height === "number" ? size.height : void 0
20668
+ };
20669
+ }
20670
+ const fontFamily = attrs.fontFamily ?? fieldMetadata?.fontFamily;
20671
+ if (typeof fontFamily === "string") run.fontFamily = fontFamily;
20672
+ const fontSize = attrs.fontSize ?? fieldMetadata?.fontSize;
20673
+ if (typeof fontSize === "string" || typeof fontSize === "number") run.fontSize = fontSize;
20674
+ const textColor = attrs.textColor ?? fieldMetadata?.textColor;
20675
+ if (typeof textColor === "string") run.textColor = textColor;
20676
+ const textHighlight = attrs.textHighlight ?? fieldMetadata?.textHighlight;
20677
+ if (typeof textHighlight === "string") run.textHighlight = textHighlight;
20678
+ const formatting = fieldMetadata?.formatting;
20679
+ if (attrs.bold === true || formatting?.bold === true) run.bold = true;
20680
+ if (attrs.italic === true || formatting?.italic === true) run.italic = true;
20681
+ if (attrs.underline === true || formatting?.underline === true) run.underline = true;
20682
+ const pos = positions.get(node);
20683
+ if (pos) {
20684
+ run.pmStart = pos.start;
20685
+ run.pmEnd = pos.end;
20686
+ }
20687
+ if (fieldMetadata) {
20688
+ run.sdt = fieldMetadata;
20689
+ }
20690
+ return run;
20691
+ }
20613
20692
  const isTextRun$1 = (run) => run.kind !== "tab";
20614
20693
  const dataAttrsCompatible = (a, b) => {
20615
20694
  const aAttrs = a.dataAttrs;
@@ -20905,28 +20984,20 @@ function paragraphToFlowBlocks$1(para, nextBlockId, positions, defaultFont, defa
20905
20984
  }
20906
20985
  if (node.type === "fieldAnnotation") {
20907
20986
  const fieldMetadata = resolveNodeSdtMetadata(node, "fieldAnnotation");
20987
+ let contentText;
20908
20988
  if (Array.isArray(node.content) && node.content.length > 0) {
20909
- node.content.forEach((child) => visitNode(child, inheritedMarks, fieldMetadata ?? activeSdt, activeRunStyleId));
20910
- } else {
20911
- const nodeAttrs = typeof node.attrs === "object" && node.attrs !== null ? node.attrs : {};
20912
- const label = (typeof nodeAttrs.displayLabel === "string" ? nodeAttrs.displayLabel : void 0) || (typeof nodeAttrs.defaultDisplayLabel === "string" ? nodeAttrs.defaultDisplayLabel : void 0) || (typeof nodeAttrs.alias === "string" ? nodeAttrs.alias : void 0) || "";
20913
- if (label && typeof label === "string") {
20914
- const run = textNodeToRun(
20915
- { type: "text", text: label },
20916
- positions,
20917
- defaultFont,
20918
- defaultSize,
20919
- inheritedMarks,
20920
- fieldMetadata ?? activeSdt,
20921
- hyperlinkConfig,
20922
- themeColors
20923
- );
20924
- const inlineStyleId = getInlineStyleId(inheritedMarks);
20925
- applyRunStyles2(run, inlineStyleId, activeRunStyleId);
20926
- applyBaseRunDefaults(run, baseRunDefaults, defaultFont, defaultSize);
20927
- currentRuns.push(run);
20928
- }
20989
+ const extractText = (n) => {
20990
+ if (n.type === "text" && typeof n.text === "string") return n.text;
20991
+ if (Array.isArray(n.content)) {
20992
+ return n.content.map(extractText).join("");
20993
+ }
20994
+ return "";
20995
+ };
20996
+ contentText = node.content.map(extractText).join("");
20929
20997
  }
20998
+ const nodeForRun = contentText && contentText.length > 0 ? { ...node, attrs: { ...node.attrs ?? {}, displayLabel: contentText } } : node;
20999
+ const run = fieldAnnotationNodeToRun(nodeForRun, positions, fieldMetadata);
21000
+ currentRuns.push(run);
20930
21001
  return;
20931
21002
  }
20932
21003
  if (node.type === "pageReference") {
@@ -21763,9 +21834,9 @@ const extractTableStyleParagraphProps = (styleId, docx) => {
21763
21834
  }
21764
21835
  const attrs = spacingEl.attributes;
21765
21836
  const spacing = {};
21766
- const before = parseIntSafe(attrs["w:before"]);
21767
- const after = parseIntSafe(attrs["w:after"]);
21768
- const line = parseIntSafe(attrs["w:line"]);
21837
+ const before = parseIntSafe$1(attrs["w:before"]);
21838
+ const after = parseIntSafe$1(attrs["w:after"]);
21839
+ const line = parseIntSafe$1(attrs["w:line"]);
21769
21840
  const rawLineRule = attrs["w:lineRule"];
21770
21841
  const lineRule = rawLineRule === "auto" || rawLineRule === "exact" || rawLineRule === "atLeast" ? rawLineRule : void 0;
21771
21842
  if (before != null) spacing.before = twipsToPx$1(before);
@@ -21780,11 +21851,11 @@ const extractTableStyleParagraphProps = (styleId, docx) => {
21780
21851
  if (lineRule) spacing.lineRule = lineRule;
21781
21852
  const result = Object.keys(spacing).length > 0 ? { spacing } : void 0;
21782
21853
  return result;
21783
- } catch (err) {
21854
+ } catch {
21784
21855
  return void 0;
21785
21856
  }
21786
21857
  };
21787
- const parseIntSafe = (value) => {
21858
+ const parseIntSafe$1 = (value) => {
21788
21859
  if (value == null) return void 0;
21789
21860
  const num = typeof value === "number" ? value : parseInt(String(value), 10);
21790
21861
  return Number.isFinite(num) ? num : void 0;
@@ -22436,7 +22507,7 @@ function getMeasurementContext() {
22436
22507
  return measurementCtx;
22437
22508
  }
22438
22509
  function getRunFontString(run) {
22439
- if (run.kind === "tab" || run.kind === "lineBreak" || run.kind === "break" || "src" in run) {
22510
+ if (run.kind === "tab" || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" || "src" in run) {
22440
22511
  return "normal normal 16px Arial";
22441
22512
  }
22442
22513
  const style = run.italic ? "italic" : "normal";
@@ -22467,6 +22538,10 @@ function sliceRunsForLine$1(block, line) {
22467
22538
  result.push(run);
22468
22539
  continue;
22469
22540
  }
22541
+ if (run.kind === "fieldAnnotation") {
22542
+ result.push(run);
22543
+ continue;
22544
+ }
22470
22545
  const text = run.text ?? "";
22471
22546
  const isFirstRun = runIndex === line.fromRun;
22472
22547
  const isLastRun = runIndex === line.toRun;
@@ -22500,7 +22575,8 @@ function measureCharacterX(block, line, charOffset) {
22500
22575
  1,
22501
22576
  runs2.reduce((sum, run) => {
22502
22577
  if (isTabRun$1(run)) return sum + TAB_CHAR_LENGTH;
22503
- if ("src" in run || run.kind === "lineBreak" || run.kind === "break") return sum;
22578
+ if ("src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation")
22579
+ return sum;
22504
22580
  return sum + (run.text ?? "").length;
22505
22581
  }, 0)
22506
22582
  );
@@ -22521,7 +22597,7 @@ function measureCharacterX(block, line, charOffset) {
22521
22597
  currentCharOffset += runLength2;
22522
22598
  continue;
22523
22599
  }
22524
- const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? "";
22600
+ const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? "";
22525
22601
  const runLength = text.length;
22526
22602
  if (currentCharOffset + runLength >= charOffset) {
22527
22603
  const offsetInRun = charOffset - currentCharOffset;
@@ -22564,7 +22640,7 @@ function measureCharacterXSegmentBased(block, line, charOffset, ctx2) {
22564
22640
  if (isTabRun$1(run)) {
22565
22641
  return segmentBaseX + (offsetInSegment > 0 ? segment.width ?? 0 : 0);
22566
22642
  }
22567
- if ("src" in run || run.kind === "lineBreak" || run.kind === "break") {
22643
+ if ("src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation") {
22568
22644
  return segmentBaseX + (offsetInSegment >= segmentChars ? segment.width ?? 0 : 0);
22569
22645
  }
22570
22646
  const text = run.text ?? "";
@@ -22593,7 +22669,7 @@ function charOffsetToPm(block, line, charOffset, fallbackPmStart) {
22593
22669
  let lastPm = fallbackPmStart;
22594
22670
  for (const run of runs) {
22595
22671
  const isTab = isTabRun$1(run);
22596
- const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? "";
22672
+ const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? "";
22597
22673
  const runLength = isTab ? TAB_CHAR_LENGTH : text.length;
22598
22674
  const runPmStart = typeof run.pmStart === "number" ? run.pmStart : null;
22599
22675
  const runPmEnd = typeof run.pmEnd === "number" ? run.pmEnd : runPmStart != null ? runPmStart + runLength : null;
@@ -22619,7 +22695,8 @@ function findCharacterAtX(block, line, x, pmStart) {
22619
22695
  1,
22620
22696
  runs2.reduce((sum, run) => {
22621
22697
  if (isTabRun$1(run)) return sum + TAB_CHAR_LENGTH;
22622
- if ("src" in run || run.kind === "lineBreak" || run.kind === "break") return sum;
22698
+ if ("src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation")
22699
+ return sum;
22623
22700
  return sum + (run.text ?? "").length;
22624
22701
  }, 0)
22625
22702
  );
@@ -22654,7 +22731,7 @@ function findCharacterAtX(block, line, x, pmStart) {
22654
22731
  currentCharOffset += TAB_CHAR_LENGTH;
22655
22732
  continue;
22656
22733
  }
22657
- const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? "";
22734
+ const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? "";
22658
22735
  const runLength = text.length;
22659
22736
  if (runLength === 0) continue;
22660
22737
  ctx2.font = getRunFontString(run);
@@ -22694,7 +22771,7 @@ function findCharacterAtX(block, line, x, pmStart) {
22694
22771
  };
22695
22772
  }
22696
22773
  const computeLetterSpacingWidth = (run, precedingChars, runLength) => {
22697
- if (isTabRun$1(run) || "src" in run || !("letterSpacing" in run) || !run.letterSpacing) {
22774
+ if (isTabRun$1(run) || "src" in run || run.kind === "fieldAnnotation" || !("letterSpacing" in run) || !run.letterSpacing) {
22698
22775
  return 0;
22699
22776
  }
22700
22777
  const maxGaps = Math.max(runLength - 1, 0);
@@ -22791,6 +22868,17 @@ function clickToPositionDom(domContainer, clientX, clientY) {
22791
22868
  pmStart: fragmentEl.dataset.pmStart,
22792
22869
  pmEnd: fragmentEl.dataset.pmEnd
22793
22870
  });
22871
+ const hitChainLine = hitChain.find(
22872
+ (el) => el.classList?.contains?.(CLASS_NAMES$1.line) && el.dataset?.pmStart !== void 0 && el.dataset?.pmEnd !== void 0
22873
+ );
22874
+ if (hitChainLine) {
22875
+ log("Using hit chain line directly:", {
22876
+ pmStart: hitChainLine.dataset.pmStart,
22877
+ pmEnd: hitChainLine.dataset.pmEnd
22878
+ });
22879
+ const result2 = processLineElement(hitChainLine, viewX);
22880
+ return result2;
22881
+ }
22794
22882
  const result = processFragment(fragmentEl, viewX, viewY);
22795
22883
  return result;
22796
22884
  }
@@ -22856,7 +22944,9 @@ function processFragment(fragmentEl, viewX, viewY) {
22856
22944
  if (!Number.isFinite(lineStart) || !Number.isFinite(lineEnd)) {
22857
22945
  return null;
22858
22946
  }
22859
- const spanEls = Array.from(lineEl.querySelectorAll("span, a"));
22947
+ const spanEls = Array.from(lineEl.querySelectorAll("span, a")).filter(
22948
+ (el) => el.dataset.pmStart !== void 0 && el.dataset.pmEnd !== void 0
22949
+ );
22860
22950
  log(
22861
22951
  "Spans/anchors in line:",
22862
22952
  spanEls.map((el, i) => {
@@ -22915,6 +23005,77 @@ function processFragment(fragmentEl, viewX, viewY) {
22915
23005
  const pos = spanStart + charIndex;
22916
23006
  return pos;
22917
23007
  }
23008
+ function processLineElement(lineEl, viewX) {
23009
+ const lineStart = Number(lineEl.dataset.pmStart ?? "NaN");
23010
+ const lineEnd = Number(lineEl.dataset.pmEnd ?? "NaN");
23011
+ const lineRect = lineEl.getBoundingClientRect();
23012
+ log("processLineElement:", {
23013
+ pmStart: lineStart,
23014
+ pmEnd: lineEnd,
23015
+ rect: { top: lineRect.top, bottom: lineRect.bottom, left: lineRect.left, right: lineRect.right }
23016
+ });
23017
+ if (!Number.isFinite(lineStart) || !Number.isFinite(lineEnd)) {
23018
+ return null;
23019
+ }
23020
+ const spanEls = Array.from(lineEl.querySelectorAll("span, a")).filter(
23021
+ (el) => el.dataset.pmStart !== void 0 && el.dataset.pmEnd !== void 0
23022
+ );
23023
+ log(
23024
+ "Spans/anchors in line:",
23025
+ spanEls.map((el, i) => {
23026
+ const rect = el.getBoundingClientRect();
23027
+ return {
23028
+ index: i,
23029
+ tag: el.tagName,
23030
+ pmStart: el.dataset.pmStart,
23031
+ pmEnd: el.dataset.pmEnd,
23032
+ text: el.textContent?.substring(0, 20) + (el.textContent && el.textContent.length > 20 ? "..." : ""),
23033
+ visibility: el.style.visibility,
23034
+ rect: { left: rect.left, right: rect.right, width: rect.width }
23035
+ };
23036
+ })
23037
+ );
23038
+ if (spanEls.length === 0) {
23039
+ return lineStart;
23040
+ }
23041
+ const firstRect = spanEls[0].getBoundingClientRect();
23042
+ if (viewX <= firstRect.left) {
23043
+ return lineStart;
23044
+ }
23045
+ const lastRect = spanEls[spanEls.length - 1].getBoundingClientRect();
23046
+ if (viewX >= lastRect.right) {
23047
+ return lineEnd;
23048
+ }
23049
+ const targetEl = findSpanAtX(spanEls, viewX);
23050
+ if (!targetEl) {
23051
+ return lineStart;
23052
+ }
23053
+ const spanStart = Number(targetEl.dataset.pmStart ?? "NaN");
23054
+ const spanEnd = Number(targetEl.dataset.pmEnd ?? "NaN");
23055
+ const targetRect = targetEl.getBoundingClientRect();
23056
+ log("Target element:", {
23057
+ tag: targetEl.tagName,
23058
+ pmStart: spanStart,
23059
+ pmEnd: spanEnd,
23060
+ text: targetEl.textContent?.substring(0, 30),
23061
+ visibility: targetEl.style.visibility,
23062
+ rect: { left: targetRect.left, right: targetRect.right, width: targetRect.width }
23063
+ });
23064
+ if (!Number.isFinite(spanStart) || !Number.isFinite(spanEnd)) {
23065
+ return null;
23066
+ }
23067
+ const firstChild = targetEl.firstChild;
23068
+ if (!firstChild || firstChild.nodeType !== Node.TEXT_NODE || !firstChild.textContent) {
23069
+ const elRect = targetEl.getBoundingClientRect();
23070
+ const closerToLeft = Math.abs(viewX - elRect.left) <= Math.abs(viewX - elRect.right);
23071
+ const snapPos = closerToLeft ? spanStart : spanEnd;
23072
+ return snapPos;
23073
+ }
23074
+ const textNode = firstChild;
23075
+ const charIndex = findCharIndexAtX(textNode, targetEl, viewX);
23076
+ const pos = spanStart + charIndex;
23077
+ return pos;
23078
+ }
22918
23079
  function findLineAtY(lineEls, viewY) {
22919
23080
  if (lineEls.length === 0) {
22920
23081
  return null;
@@ -25805,7 +25966,7 @@ const hashRuns = (block) => {
25805
25966
  return `img:${srcHash}:${imgRun.width}x${imgRun.height}`;
25806
25967
  }
25807
25968
  const text = normalizeText(
25808
- "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? ""
25969
+ "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? ""
25809
25970
  );
25810
25971
  const bold = "bold" in run ? run.bold : false;
25811
25972
  const italic = "italic" in run ? run.italic : false;
@@ -26517,7 +26678,7 @@ function extractBlockText(block) {
26517
26678
  let pmStart = Infinity;
26518
26679
  let pmEnd = 0;
26519
26680
  for (const run of block.runs) {
26520
- text += "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text;
26681
+ text += "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text;
26521
26682
  if (run.pmStart !== void 0) {
26522
26683
  pmStart = Math.min(pmStart, run.pmStart);
26523
26684
  }
@@ -26567,7 +26728,7 @@ function fontString(run) {
26567
26728
  return `${italic}${bold}${size}px ${family}`.trim();
26568
26729
  }
26569
26730
  function runText(run) {
26570
- return "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? "";
26731
+ return "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? "";
26571
26732
  }
26572
26733
  function measureRunSliceWidth(run, fromChar, toChar) {
26573
26734
  const context = getCtx();
@@ -26729,7 +26890,7 @@ const paragraphBlocksEqual = (a, b) => {
26729
26890
  for (let i = 0; i < a.runs.length; i += 1) {
26730
26891
  const runA = a.runs[i];
26731
26892
  const runB = b.runs[i];
26732
- if (("src" in runA || runA.kind === "lineBreak" || runA.kind === "break" ? "" : runA.text) !== ("src" in runB || runB.kind === "lineBreak" || runB.kind === "break" ? "" : runB.text) || ("bold" in runA ? runA.bold : false) !== ("bold" in runB ? runB.bold : false) || ("italic" in runA ? runA.italic : false) !== ("italic" in runB ? runB.italic : false) || ("color" in runA ? runA.color : void 0) !== ("color" in runB ? runB.color : void 0) || getTrackedChangeKey(runA) !== getTrackedChangeKey(runB)) {
26893
+ if (("src" in runA || runA.kind === "lineBreak" || runA.kind === "break" || runA.kind === "fieldAnnotation" ? "" : runA.text) !== ("src" in runB || runB.kind === "lineBreak" || runB.kind === "break" || runB.kind === "fieldAnnotation" ? "" : runB.text) || ("bold" in runA ? runA.bold : false) !== ("bold" in runB ? runB.bold : false) || ("italic" in runA ? runA.italic : false) !== ("italic" in runB ? runB.italic : false) || ("color" in runA ? runA.color : void 0) !== ("color" in runB ? runB.color : void 0) || getTrackedChangeKey(runA) !== getTrackedChangeKey(runB)) {
26733
26894
  return false;
26734
26895
  }
26735
26896
  }
@@ -26849,7 +27010,7 @@ function computeHeaderFooterContentHash(blocks) {
26849
27010
  parts.push(block.id);
26850
27011
  if (block.kind === "paragraph") {
26851
27012
  for (const run of block.runs) {
26852
- if (!("src" in run) && run.kind !== "lineBreak" && run.kind !== "break") {
27013
+ if (!("src" in run) && run.kind !== "lineBreak" && run.kind !== "break" && run.kind !== "fieldAnnotation") {
26853
27014
  parts.push(run.text ?? "");
26854
27015
  }
26855
27016
  if ("bold" in run && run.bold) parts.push("b");
@@ -27334,6 +27495,255 @@ var Priority = /* @__PURE__ */ ((Priority2) => {
27334
27495
  /** P3: Heavy debounce for full document layout */
27335
27496
  [Priority.P3]: 150
27336
27497
  });
27498
+ const DEFAULT_MIME_TYPE$1 = "application/x-field-annotation";
27499
+ const LEGACY_MIME_TYPE = "fieldAnnotation";
27500
+ function parseIntSafe(value) {
27501
+ if (!value) return void 0;
27502
+ const parsed = parseInt(value, 10);
27503
+ return Number.isFinite(parsed) ? parsed : void 0;
27504
+ }
27505
+ function extractFieldAnnotationData(element) {
27506
+ const dataset = element.dataset;
27507
+ const attributes = {};
27508
+ for (const key2 in dataset) {
27509
+ const value = dataset[key2];
27510
+ if (value !== void 0) {
27511
+ attributes[key2] = value;
27512
+ }
27513
+ }
27514
+ return {
27515
+ fieldId: dataset.fieldId,
27516
+ fieldType: dataset.fieldType,
27517
+ variant: dataset.variant ?? dataset.type,
27518
+ displayLabel: dataset.displayLabel,
27519
+ pmStart: parseIntSafe(dataset.pmStart),
27520
+ pmEnd: parseIntSafe(dataset.pmEnd),
27521
+ attributes
27522
+ };
27523
+ }
27524
+ class DragHandler {
27525
+ /**
27526
+ * Creates a new DragHandler instance.
27527
+ *
27528
+ * @param container - The DOM container element (typically .superdoc-layout)
27529
+ * @param config - Configuration options and callbacks
27530
+ */
27531
+ constructor(container, config = {}) {
27532
+ this.container = container;
27533
+ this.config = config;
27534
+ this.mimeType = config.mimeType ?? DEFAULT_MIME_TYPE$1;
27535
+ this.boundHandlers = {
27536
+ dragstart: this.handleDragStart.bind(this),
27537
+ dragover: this.handleDragOver.bind(this),
27538
+ drop: this.handleDrop.bind(this),
27539
+ dragend: this.handleDragEnd.bind(this),
27540
+ dragleave: this.handleDragLeave.bind(this)
27541
+ };
27542
+ this.windowDragoverHandler = this.handleWindowDragOver.bind(this);
27543
+ this.windowDropHandler = this.handleWindowDrop.bind(this);
27544
+ this.attachListeners();
27545
+ }
27546
+ /**
27547
+ * Attaches event listeners to the container and window.
27548
+ */
27549
+ attachListeners() {
27550
+ this.container.addEventListener("dragstart", this.boundHandlers.dragstart);
27551
+ this.container.addEventListener("dragover", this.boundHandlers.dragover);
27552
+ this.container.addEventListener("drop", this.boundHandlers.drop);
27553
+ this.container.addEventListener("dragend", this.boundHandlers.dragend);
27554
+ this.container.addEventListener("dragleave", this.boundHandlers.dragleave);
27555
+ window.addEventListener("dragover", this.windowDragoverHandler, false);
27556
+ window.addEventListener("drop", this.windowDropHandler, false);
27557
+ }
27558
+ /**
27559
+ * Removes event listeners from the container and window.
27560
+ */
27561
+ removeListeners() {
27562
+ this.container.removeEventListener("dragstart", this.boundHandlers.dragstart);
27563
+ this.container.removeEventListener("dragover", this.boundHandlers.dragover);
27564
+ this.container.removeEventListener("drop", this.boundHandlers.drop);
27565
+ this.container.removeEventListener("dragend", this.boundHandlers.dragend);
27566
+ this.container.removeEventListener("dragleave", this.boundHandlers.dragleave);
27567
+ window.removeEventListener("dragover", this.windowDragoverHandler, false);
27568
+ window.removeEventListener("drop", this.windowDropHandler, false);
27569
+ }
27570
+ /**
27571
+ * Handles dragover at window level to allow drops on overlay elements.
27572
+ * This ensures preventDefault is called even when dragging over selection
27573
+ * highlights or other UI elements that sit on top of the layout content.
27574
+ */
27575
+ handleWindowDragOver(event) {
27576
+ if (this.hasFieldAnnotationData(event)) {
27577
+ event.preventDefault();
27578
+ if (event.dataTransfer) {
27579
+ event.dataTransfer.dropEffect = "move";
27580
+ }
27581
+ const target = event.target;
27582
+ if (!this.container.contains(target)) {
27583
+ this.config.onDragOver?.({
27584
+ event,
27585
+ clientX: event.clientX,
27586
+ clientY: event.clientY,
27587
+ hasFieldAnnotation: true
27588
+ });
27589
+ }
27590
+ }
27591
+ }
27592
+ /**
27593
+ * Handles drop at window level to catch drops on overlay elements.
27594
+ * If the drop target is outside the container, we process it here.
27595
+ */
27596
+ handleWindowDrop(event) {
27597
+ if (this.hasFieldAnnotationData(event)) {
27598
+ const target = event.target;
27599
+ if (!this.container.contains(target)) {
27600
+ this.handleDrop(event);
27601
+ }
27602
+ }
27603
+ }
27604
+ /**
27605
+ * Handles the dragstart event.
27606
+ * Sets up dataTransfer with field annotation data and drag image.
27607
+ */
27608
+ handleDragStart(event) {
27609
+ const target = event.target;
27610
+ if (!target?.dataset?.draggable || target.dataset.draggable !== "true") {
27611
+ return;
27612
+ }
27613
+ const data = extractFieldAnnotationData(target);
27614
+ if (event.dataTransfer) {
27615
+ const jsonData = JSON.stringify({
27616
+ attributes: data.attributes,
27617
+ sourceField: data
27618
+ });
27619
+ event.dataTransfer.setData(this.mimeType, jsonData);
27620
+ event.dataTransfer.setData(LEGACY_MIME_TYPE, jsonData);
27621
+ event.dataTransfer.setData("text/plain", data.displayLabel ?? "Field Annotation");
27622
+ event.dataTransfer.setDragImage(target, 0, 0);
27623
+ event.dataTransfer.effectAllowed = "move";
27624
+ }
27625
+ this.config.onDragStart?.({
27626
+ event,
27627
+ element: target,
27628
+ data
27629
+ });
27630
+ }
27631
+ /**
27632
+ * Handles the dragover event.
27633
+ * Provides visual feedback and determines if drop is allowed.
27634
+ */
27635
+ handleDragOver(event) {
27636
+ const hasFieldAnnotation = this.hasFieldAnnotationData(event);
27637
+ if (hasFieldAnnotation) {
27638
+ event.preventDefault();
27639
+ if (event.dataTransfer) {
27640
+ event.dataTransfer.dropEffect = "move";
27641
+ }
27642
+ this.container.classList.add("drag-over");
27643
+ }
27644
+ this.config.onDragOver?.({
27645
+ event,
27646
+ clientX: event.clientX,
27647
+ clientY: event.clientY,
27648
+ hasFieldAnnotation
27649
+ });
27650
+ }
27651
+ /**
27652
+ * Handles the dragleave event.
27653
+ * Removes visual feedback when drag leaves the container.
27654
+ */
27655
+ handleDragLeave(event) {
27656
+ const relatedTarget = event.relatedTarget;
27657
+ if (!relatedTarget || !this.container.contains(relatedTarget)) {
27658
+ this.container.classList.remove("drag-over");
27659
+ }
27660
+ }
27661
+ /**
27662
+ * Handles the drop event.
27663
+ * Maps drop coordinates to ProseMirror position and emits drop event.
27664
+ */
27665
+ handleDrop(event) {
27666
+ this.container.classList.remove("drag-over");
27667
+ if (!this.hasFieldAnnotationData(event)) {
27668
+ return;
27669
+ }
27670
+ event.preventDefault();
27671
+ const data = this.extractDragData(event);
27672
+ if (!data) {
27673
+ return;
27674
+ }
27675
+ const pmPosition = clickToPositionDom(this.container, event.clientX, event.clientY);
27676
+ this.config.onDrop?.({
27677
+ event,
27678
+ data,
27679
+ pmPosition,
27680
+ clientX: event.clientX,
27681
+ clientY: event.clientY
27682
+ });
27683
+ }
27684
+ /**
27685
+ * Handles the dragend event.
27686
+ * Cleans up drag state.
27687
+ */
27688
+ handleDragEnd(event) {
27689
+ this.container.classList.remove("drag-over");
27690
+ this.config.onDragEnd?.(event);
27691
+ }
27692
+ /**
27693
+ * Checks if a drag event contains field annotation data.
27694
+ */
27695
+ hasFieldAnnotationData(event) {
27696
+ if (!event.dataTransfer) {
27697
+ return false;
27698
+ }
27699
+ const types = event.dataTransfer.types;
27700
+ return types.includes(this.mimeType) || types.includes(LEGACY_MIME_TYPE);
27701
+ }
27702
+ /**
27703
+ * Extracts field annotation data from a drag event's dataTransfer.
27704
+ */
27705
+ extractDragData(event) {
27706
+ if (!event.dataTransfer) {
27707
+ return null;
27708
+ }
27709
+ let jsonData = event.dataTransfer.getData(this.mimeType);
27710
+ if (!jsonData) {
27711
+ jsonData = event.dataTransfer.getData(LEGACY_MIME_TYPE);
27712
+ }
27713
+ if (!jsonData) {
27714
+ return null;
27715
+ }
27716
+ try {
27717
+ const parsed = JSON.parse(jsonData);
27718
+ return parsed.sourceField ?? parsed.attributes ?? parsed;
27719
+ } catch {
27720
+ return null;
27721
+ }
27722
+ }
27723
+ /**
27724
+ * Updates the configuration options.
27725
+ *
27726
+ * @param config - New configuration options to merge
27727
+ */
27728
+ updateConfig(config) {
27729
+ this.config = { ...this.config, ...config };
27730
+ if (config.mimeType) {
27731
+ this.mimeType = config.mimeType;
27732
+ }
27733
+ }
27734
+ /**
27735
+ * Destroys the drag handler and removes all event listeners.
27736
+ * Call this when the layout engine is unmounted or the container is removed.
27737
+ */
27738
+ destroy() {
27739
+ this.removeListeners();
27740
+ this.container.classList.remove("drag-over");
27741
+ }
27742
+ }
27743
+ function createDragHandler(container, config = {}) {
27744
+ const handler = new DragHandler(container, config);
27745
+ return () => handler.destroy();
27746
+ }
27337
27747
  const isAtomicFragment = (fragment) => {
27338
27748
  return fragment.kind === "drawing" || fragment.kind === "image";
27339
27749
  };
@@ -27872,7 +28282,7 @@ function computeLinePmRange$1(block, line) {
27872
28282
  for (let runIndex = line.fromRun; runIndex <= line.toRun; runIndex += 1) {
27873
28283
  const run = block.runs[runIndex];
27874
28284
  if (!run) continue;
27875
- const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? "";
28285
+ const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? "";
27876
28286
  const runLength = text.length;
27877
28287
  const runPmStart = run.pmStart ?? null;
27878
28288
  const runPmEnd = run.pmEnd ?? (runPmStart != null ? runPmStart + runLength : null);
@@ -27896,7 +28306,7 @@ function pmPosToCharOffset(block, line, pmPos) {
27896
28306
  for (let runIndex = line.fromRun; runIndex <= line.toRun; runIndex += 1) {
27897
28307
  const run = block.runs[runIndex];
27898
28308
  if (!run) continue;
27899
- const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" ? "" : run.text ?? "";
28309
+ const text = "src" in run || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation" ? "" : run.text ?? "";
27900
28310
  const runTextLength = text.length;
27901
28311
  const runPmStart = run.pmStart ?? null;
27902
28312
  const runPmEnd = run.pmEnd ?? (runPmStart != null ? runPmStart + runTextLength : null);
@@ -30429,9 +30839,227 @@ const TRACK_CHANGE_STYLES = `
30429
30839
  border-bottom: 2px solid gold;
30430
30840
  }
30431
30841
  `;
30842
+ const SDT_CONTAINER_STYLES = `
30843
+ /* Document Section - Block-level container with gray border and hover tooltip */
30844
+ .superdoc-document-section {
30845
+ background-color: #fafafa;
30846
+ border: 1px solid #ababab;
30847
+ border-radius: 4px;
30848
+ position: relative;
30849
+ box-sizing: border-box;
30850
+ }
30851
+
30852
+ /* Document section tooltip - positioned above the fragment */
30853
+ .superdoc-document-section__tooltip {
30854
+ position: absolute;
30855
+ top: -19px;
30856
+ left: -1px;
30857
+ max-width: 100px;
30858
+ min-width: 0;
30859
+ height: 18px;
30860
+ border: 1px solid #ababab;
30861
+ border-bottom: none;
30862
+ border-radius: 6px 6px 0 0;
30863
+ padding: 0 8px;
30864
+ align-items: center;
30865
+ font-size: 10px;
30866
+ display: none;
30867
+ z-index: 100;
30868
+ background-color: #fafafa;
30869
+ pointer-events: none;
30870
+ }
30871
+
30872
+ .superdoc-document-section__tooltip span {
30873
+ max-width: 100%;
30874
+ overflow: hidden;
30875
+ white-space: nowrap;
30876
+ text-overflow: ellipsis;
30877
+ }
30878
+
30879
+ /* Show tooltip on hover - adjust border radius to connect with tooltip tab */
30880
+ .superdoc-document-section:hover {
30881
+ border-radius: 0 4px 4px 4px;
30882
+ }
30883
+
30884
+ .superdoc-document-section:hover .superdoc-document-section__tooltip {
30885
+ display: flex;
30886
+ align-items: center;
30887
+ }
30888
+
30889
+ /* Continuation styling: first fragment has top corners, last has bottom corners */
30890
+ .superdoc-document-section[data-sdt-container-start="true"] {
30891
+ border-radius: 4px 4px 0 0;
30892
+ }
30893
+
30894
+ .superdoc-document-section[data-sdt-container-end="true"] {
30895
+ border-radius: 0 0 4px 4px;
30896
+ }
30897
+
30898
+ .superdoc-document-section[data-sdt-container-start="true"][data-sdt-container-end="true"] {
30899
+ border-radius: 4px;
30900
+ }
30901
+
30902
+ .superdoc-document-section[data-sdt-container-start="true"]:hover {
30903
+ border-radius: 0 4px 0 0;
30904
+ }
30905
+
30906
+ /* Middle fragments have no border radius */
30907
+ .superdoc-document-section:not([data-sdt-container-start="true"]):not([data-sdt-container-end="true"]) {
30908
+ border-radius: 0;
30909
+ border-top: none;
30910
+ }
30911
+
30912
+ /* Structured Content Block - Blue border container */
30913
+ .superdoc-structured-content-block {
30914
+ padding: 1px;
30915
+ box-sizing: border-box;
30916
+ border-radius: 4px;
30917
+ border: 1px solid #629be7;
30918
+ position: relative;
30919
+ }
30920
+
30921
+ /* Structured content drag handle/label - positioned above */
30922
+ .superdoc-structured-content__label {
30923
+ font-size: 10px;
30924
+ align-items: center;
30925
+ justify-content: center;
30926
+ position: absolute;
30927
+ left: 2px;
30928
+ top: -19px;
30929
+ width: calc(100% - 4px);
30930
+ max-width: 110px;
30931
+ min-width: 0;
30932
+ height: 18px;
30933
+ padding: 0 4px;
30934
+ border: 1px solid #629be7;
30935
+ border-bottom: none;
30936
+ border-radius: 6px 6px 0 0;
30937
+ background-color: #629be7dd;
30938
+ box-sizing: border-box;
30939
+ z-index: 10;
30940
+ display: none;
30941
+ pointer-events: none;
30942
+ }
30943
+
30944
+ .superdoc-structured-content__label span {
30945
+ max-width: 100%;
30946
+ overflow: hidden;
30947
+ white-space: nowrap;
30948
+ text-overflow: ellipsis;
30949
+ }
30950
+
30951
+ .superdoc-structured-content-block:hover .superdoc-structured-content__label {
30952
+ display: inline-flex;
30953
+ }
30954
+
30955
+ /* Continuation styling for structured content blocks */
30956
+ .superdoc-structured-content-block[data-sdt-container-start="true"] {
30957
+ border-radius: 4px 4px 0 0;
30958
+ }
30959
+
30960
+ .superdoc-structured-content-block[data-sdt-container-end="true"] {
30961
+ border-radius: 0 0 4px 4px;
30962
+ }
30963
+
30964
+ .superdoc-structured-content-block[data-sdt-container-start="true"][data-sdt-container-end="true"] {
30965
+ border-radius: 4px;
30966
+ }
30967
+
30968
+ .superdoc-structured-content-block:not([data-sdt-container-start="true"]):not([data-sdt-container-end="true"]) {
30969
+ border-radius: 0;
30970
+ border-top: none;
30971
+ }
30972
+
30973
+ /* Structured Content Inline - Inline wrapper with blue border */
30974
+ .superdoc-structured-content-inline {
30975
+ padding: 1px;
30976
+ box-sizing: border-box;
30977
+ border-radius: 4px;
30978
+ border: 1px solid #629be7;
30979
+ position: relative;
30980
+ display: inline;
30981
+ }
30982
+
30983
+ /* Hover effect for inline structured content */
30984
+ .superdoc-structured-content-inline:hover {
30985
+ background-color: rgba(98, 155, 231, 0.15);
30986
+ border-color: #4a8ad9;
30987
+ }
30988
+
30989
+ /* Inline structured content label - shown on hover */
30990
+ .superdoc-structured-content-inline__label {
30991
+ position: absolute;
30992
+ bottom: calc(100% + 2px);
30993
+ left: 50%;
30994
+ transform: translateX(-50%);
30995
+ font-size: 10px;
30996
+ padding: 2px 6px;
30997
+ background-color: #629be7dd;
30998
+ color: white;
30999
+ border-radius: 4px;
31000
+ white-space: nowrap;
31001
+ z-index: 100;
31002
+ display: none;
31003
+ pointer-events: none;
31004
+ }
31005
+
31006
+ .superdoc-structured-content-inline:hover .superdoc-structured-content-inline__label {
31007
+ display: block;
31008
+ }
31009
+
31010
+ /* Print mode: hide visual styling for SDT containers */
31011
+ @media print {
31012
+ .superdoc-document-section,
31013
+ .superdoc-structured-content-block,
31014
+ .superdoc-structured-content-inline {
31015
+ background: none;
31016
+ border: none;
31017
+ padding: 0;
31018
+ }
31019
+
31020
+ .superdoc-document-section__tooltip,
31021
+ .superdoc-structured-content__label,
31022
+ .superdoc-structured-content-inline__label {
31023
+ display: none !important;
31024
+ }
31025
+ }
31026
+ `;
31027
+ const FIELD_ANNOTATION_STYLES = `
31028
+ /* Field annotation draggable styles */
31029
+ .superdoc-layout .annotation[data-draggable="true"] {
31030
+ cursor: grab;
31031
+ user-select: none;
31032
+ -webkit-user-select: none;
31033
+ }
31034
+
31035
+ .superdoc-layout .annotation[data-draggable="true"]:hover {
31036
+ opacity: 0.9;
31037
+ }
31038
+
31039
+ .superdoc-layout .annotation[data-draggable="true"]:active {
31040
+ cursor: grabbing;
31041
+ }
31042
+
31043
+ /* Drag over indicator for drop targets */
31044
+ .superdoc-layout.drag-over {
31045
+ outline: 2px dashed #b015b3;
31046
+ outline-offset: -2px;
31047
+ }
31048
+
31049
+ /* Drop zone indicator */
31050
+ .superdoc-layout .superdoc-drop-indicator {
31051
+ position: absolute;
31052
+ width: 2px;
31053
+ background-color: #b015b3;
31054
+ pointer-events: none;
31055
+ z-index: 1000;
31056
+ }
31057
+ `;
30432
31058
  let printStylesInjected = false;
30433
31059
  let linkStylesInjected = false;
30434
31060
  let trackChangeStylesInjected = false;
31061
+ let sdtContainerStylesInjected = false;
31062
+ let fieldAnnotationStylesInjected = false;
30435
31063
  const ensurePrintStyles = (doc2) => {
30436
31064
  if (printStylesInjected || !doc2) return;
30437
31065
  const styleEl = doc2.createElement("style");
@@ -30456,6 +31084,22 @@ const ensureTrackChangeStyles = (doc2) => {
30456
31084
  doc2.head?.appendChild(styleEl);
30457
31085
  trackChangeStylesInjected = true;
30458
31086
  };
31087
+ const ensureSdtContainerStyles = (doc2) => {
31088
+ if (sdtContainerStylesInjected || !doc2) return;
31089
+ const styleEl = doc2.createElement("style");
31090
+ styleEl.setAttribute("data-superdoc-sdt-container-styles", "true");
31091
+ styleEl.textContent = SDT_CONTAINER_STYLES;
31092
+ doc2.head?.appendChild(styleEl);
31093
+ sdtContainerStylesInjected = true;
31094
+ };
31095
+ const ensureFieldAnnotationStyles = (doc2) => {
31096
+ if (fieldAnnotationStylesInjected || !doc2) return;
31097
+ const styleEl = doc2.createElement("style");
31098
+ styleEl.setAttribute("data-superdoc-field-annotation-styles", "true");
31099
+ styleEl.textContent = FIELD_ANNOTATION_STYLES;
31100
+ doc2.head?.appendChild(styleEl);
31101
+ fieldAnnotationStylesInjected = true;
31102
+ };
30459
31103
  const ALLOWED_BORDER_STYLES = /* @__PURE__ */ new Set([
30460
31104
  "none",
30461
31105
  "single",
@@ -30785,6 +31429,50 @@ const renderTableRow = (deps) => {
30785
31429
  container.appendChild(cellElement);
30786
31430
  }
30787
31431
  };
31432
+ function isStructuredContentMetadata(sdt) {
31433
+ return sdt !== null && sdt !== void 0 && typeof sdt === "object" && "type" in sdt && sdt.type === "structuredContent";
31434
+ }
31435
+ function isDocumentSectionMetadata(sdt) {
31436
+ return sdt !== null && sdt !== void 0 && typeof sdt === "object" && "type" in sdt && sdt.type === "documentSection";
31437
+ }
31438
+ function getSdtContainerConfig(sdt) {
31439
+ if (isDocumentSectionMetadata(sdt)) {
31440
+ return {
31441
+ className: "superdoc-document-section",
31442
+ labelText: sdt.title ?? "Document section",
31443
+ labelClassName: "superdoc-document-section__tooltip",
31444
+ isStart: true,
31445
+ isEnd: true
31446
+ };
31447
+ }
31448
+ if (isStructuredContentMetadata(sdt) && sdt.scope === "block") {
31449
+ return {
31450
+ className: "superdoc-structured-content-block",
31451
+ labelText: sdt.alias ?? "Structured content",
31452
+ labelClassName: "superdoc-structured-content__label",
31453
+ isStart: true,
31454
+ isEnd: true
31455
+ };
31456
+ }
31457
+ return null;
31458
+ }
31459
+ function applySdtContainerStyling(doc2, container, sdt, containerSdt) {
31460
+ let config = getSdtContainerConfig(sdt);
31461
+ if (!config && containerSdt) {
31462
+ config = getSdtContainerConfig(containerSdt);
31463
+ }
31464
+ if (!config) return;
31465
+ container.classList.add(config.className);
31466
+ container.dataset.sdtContainerStart = String(config.isStart);
31467
+ container.dataset.sdtContainerEnd = String(config.isEnd);
31468
+ container.style.overflow = "visible";
31469
+ const labelEl = doc2.createElement("div");
31470
+ labelEl.className = config.labelClassName;
31471
+ const labelText = doc2.createElement("span");
31472
+ labelText.textContent = config.labelText;
31473
+ labelEl.appendChild(labelText);
31474
+ container.appendChild(labelEl);
31475
+ }
30788
31476
  const renderTableFragment = (deps) => {
30789
31477
  const { doc: doc2, fragment, blockLookup, context, renderLine, applyFragmentFrame, applySdtDataset, applyStyles: applyStyles2 } = deps;
30790
31478
  if (!doc2) {
@@ -30821,6 +31509,7 @@ const renderTableFragment = (deps) => {
30821
31509
  applyFragmentFrame(container, fragment);
30822
31510
  container.style.height = `${fragment.height}px`;
30823
31511
  applySdtDataset(container, block.attrs?.sdt);
31512
+ applySdtContainerStyling(doc2, container, block.attrs?.sdt);
30824
31513
  container.classList.add("superdoc-table-fragment");
30825
31514
  if (fragment.metadata?.columnBoundaries) {
30826
31515
  const columnCount = measure.columnWidths.length;
@@ -31287,6 +31976,8 @@ const _DomPainter = class _DomPainter {
31287
31976
  ensurePrintStyles(doc2);
31288
31977
  ensureLinkStyles(doc2);
31289
31978
  ensureTrackChangeStyles(doc2);
31979
+ ensureFieldAnnotationStyles(doc2);
31980
+ ensureSdtContainerStyles(doc2);
31290
31981
  mount.classList.add(CLASS_NAMES.container);
31291
31982
  if (this.mount && this.mount !== mount) {
31292
31983
  this.resetState();
@@ -31809,7 +32500,8 @@ const _DomPainter = class _DomPainter {
31809
32500
  fragmentEl.classList.add(CLASS_NAMES.fragment);
31810
32501
  const isTocEntry = block.attrs?.isTocEntry;
31811
32502
  const hasMarker = !fragment.continuesFromPrev && fragment.markerWidth && wordLayout?.marker;
31812
- const styles = isTocEntry ? { ...fragmentStyles, whiteSpace: "nowrap" } : hasMarker ? { ...fragmentStyles, overflow: "visible" } : fragmentStyles;
32503
+ const hasSdtContainer = block.attrs?.sdt?.type === "documentSection" || block.attrs?.sdt?.type === "structuredContent" || block.attrs?.containerSdt?.type === "documentSection" || block.attrs?.containerSdt?.type === "structuredContent";
32504
+ const styles = isTocEntry ? { ...fragmentStyles, whiteSpace: "nowrap" } : hasMarker || hasSdtContainer ? { ...fragmentStyles, overflow: "visible" } : fragmentStyles;
31813
32505
  applyStyles$2(fragmentEl, styles);
31814
32506
  this.applyFragmentFrame(fragmentEl, fragment, context.section);
31815
32507
  if (isTocEntry) {
@@ -31829,6 +32521,7 @@ const _DomPainter = class _DomPainter {
31829
32521
  }
31830
32522
  this.applySdtDataset(fragmentEl, block.attrs?.sdt);
31831
32523
  this.applyContainerSdtDataset(fragmentEl, block.attrs?.containerSdt);
32524
+ applySdtContainerStyling(this.doc, fragmentEl, block.attrs?.sdt, block.attrs?.containerSdt);
31832
32525
  const dropCapDescriptor = block.attrs?.dropCapDescriptor;
31833
32526
  const dropCapMeasure = measure.dropCap;
31834
32527
  if (dropCapDescriptor && dropCapMeasure && !fragment.continuesFromPrev) {
@@ -32047,6 +32740,7 @@ const _DomPainter = class _DomPainter {
32047
32740
  fragmentEl.dataset.itemId = fragment.itemId;
32048
32741
  const paragraphMetadata = item.paragraph.attrs?.sdt;
32049
32742
  this.applySdtDataset(fragmentEl, paragraphMetadata);
32743
+ applySdtContainerStyling(this.doc, fragmentEl, paragraphMetadata, item.paragraph.attrs?.containerSdt);
32050
32744
  if (fragment.continuesFromPrev) {
32051
32745
  fragmentEl.dataset.continuesFromPrev = "true";
32052
32746
  }
@@ -32818,10 +33512,19 @@ const _DomPainter = class _DomPainter {
32818
33512
  isBreakRun(run) {
32819
33513
  return run.kind === "break";
32820
33514
  }
33515
+ /**
33516
+ * Type guard to check if a run is a field annotation run.
33517
+ */
33518
+ isFieldAnnotationRun(run) {
33519
+ return run.kind === "fieldAnnotation";
33520
+ }
32821
33521
  renderRun(run, context, trackedConfig) {
32822
33522
  if (this.isImageRun(run)) {
32823
33523
  return this.renderImageRun(run);
32824
33524
  }
33525
+ if (this.isFieldAnnotationRun(run)) {
33526
+ return this.renderFieldAnnotationRun(run);
33527
+ }
32825
33528
  if (this.isLineBreakRun(run)) {
32826
33529
  return null;
32827
33530
  }
@@ -32958,6 +33661,200 @@ const _DomPainter = class _DomPainter {
32958
33661
  }
32959
33662
  return img;
32960
33663
  }
33664
+ /**
33665
+ * Renders a FieldAnnotationRun as an inline "pill" element matching super-editor's visual appearance.
33666
+ *
33667
+ * Field annotations are styled inline elements that display form fields with:
33668
+ * - Outer span with border, border-radius, padding, and background color
33669
+ * - Inner span containing the displayLabel or type-specific content (image, link, etc.)
33670
+ *
33671
+ * @param run - The FieldAnnotationRun to render containing field configuration and styling
33672
+ * @returns HTMLElement (span) or null if document is not available
33673
+ *
33674
+ * @example
33675
+ * ```typescript
33676
+ * // Text variant
33677
+ * renderFieldAnnotationRun({ kind: 'fieldAnnotation', variant: 'text', displayLabel: 'Full Name', fieldColor: '#980043' })
33678
+ * // Returns: <span class="annotation" style="border: 2px solid #b015b3; ..."><span class="annotation-content">Full Name</span></span>
33679
+ *
33680
+ * // Image variant with imageSrc
33681
+ * renderFieldAnnotationRun({ kind: 'fieldAnnotation', variant: 'image', displayLabel: 'Photo', imageSrc: 'data:image/png;...' })
33682
+ * // Returns: <span class="annotation"><span class="annotation-content"><img src="..." /></span></span>
33683
+ *
33684
+ * // Link variant
33685
+ * renderFieldAnnotationRun({ kind: 'fieldAnnotation', variant: 'link', displayLabel: 'Website', linkUrl: 'https://example.com' })
33686
+ * // Returns: <span class="annotation"><span class="annotation-content"><a href="...">https://example.com</a></span></span>
33687
+ * ```
33688
+ */
33689
+ renderFieldAnnotationRun(run) {
33690
+ if (!this.doc) {
33691
+ return null;
33692
+ }
33693
+ if (run.hidden) {
33694
+ const hidden = this.doc.createElement("span");
33695
+ hidden.style.display = "none";
33696
+ if (run.pmStart != null) hidden.dataset.pmStart = String(run.pmStart);
33697
+ if (run.pmEnd != null) hidden.dataset.pmEnd = String(run.pmEnd);
33698
+ return hidden;
33699
+ }
33700
+ const defaultBorderColor = "#b015b3";
33701
+ const defaultFieldColor = "#980043";
33702
+ const annotation = this.doc.createElement("span");
33703
+ annotation.classList.add("annotation");
33704
+ annotation.setAttribute("aria-label", "Field annotation");
33705
+ const showHighlight = run.highlighted !== false;
33706
+ if (showHighlight) {
33707
+ const borderColor = run.borderColor || defaultBorderColor;
33708
+ annotation.style.border = `2px solid ${borderColor}`;
33709
+ annotation.style.borderRadius = "2px";
33710
+ annotation.style.padding = "1px 2px";
33711
+ annotation.style.boxSizing = "border-box";
33712
+ const fieldColor = run.fieldColor || defaultFieldColor;
33713
+ const bgColor = fieldColor.length === 7 ? `${fieldColor}33` : fieldColor;
33714
+ if (run.textHighlight) {
33715
+ annotation.style.backgroundColor = run.textHighlight;
33716
+ } else {
33717
+ annotation.style.backgroundColor = bgColor;
33718
+ }
33719
+ }
33720
+ if (run.visibility === "hidden") {
33721
+ annotation.style.visibility = "hidden";
33722
+ }
33723
+ if (run.size) {
33724
+ if (run.size.width) {
33725
+ annotation.style.width = `${run.size.width}px`;
33726
+ annotation.style.display = "inline-block";
33727
+ annotation.style.overflow = "hidden";
33728
+ }
33729
+ if (run.size.height) {
33730
+ annotation.style.height = `${run.size.height}px`;
33731
+ }
33732
+ }
33733
+ if (run.fontFamily) {
33734
+ annotation.style.fontFamily = run.fontFamily;
33735
+ }
33736
+ if (run.fontSize) {
33737
+ const fontSize = typeof run.fontSize === "number" ? `${run.fontSize}pt` : run.fontSize;
33738
+ annotation.style.fontSize = fontSize;
33739
+ }
33740
+ if (run.textColor) {
33741
+ annotation.style.color = run.textColor;
33742
+ }
33743
+ if (run.bold) {
33744
+ annotation.style.fontWeight = "bold";
33745
+ }
33746
+ if (run.italic) {
33747
+ annotation.style.fontStyle = "italic";
33748
+ }
33749
+ if (run.underline) {
33750
+ annotation.style.textDecoration = "underline";
33751
+ }
33752
+ annotation.style.zIndex = "1";
33753
+ const content = this.doc.createElement("span");
33754
+ content.classList.add("annotation-content");
33755
+ content.style.pointerEvents = "none";
33756
+ content.setAttribute("contenteditable", "false");
33757
+ switch (run.variant) {
33758
+ case "image":
33759
+ case "signature": {
33760
+ if (run.imageSrc) {
33761
+ const img = this.doc.createElement("img");
33762
+ const isDataUrl = run.imageSrc.startsWith("data:");
33763
+ if (isDataUrl) {
33764
+ if (run.imageSrc.length <= MAX_DATA_URL_LENGTH && VALID_IMAGE_DATA_URL.test(run.imageSrc)) {
33765
+ img.src = run.imageSrc;
33766
+ } else {
33767
+ content.textContent = run.displayLabel;
33768
+ break;
33769
+ }
33770
+ } else {
33771
+ const sanitized = sanitizeHref(run.imageSrc);
33772
+ if (sanitized) {
33773
+ img.src = sanitized.href;
33774
+ } else {
33775
+ content.textContent = run.displayLabel;
33776
+ break;
33777
+ }
33778
+ }
33779
+ img.alt = run.displayLabel;
33780
+ img.style.height = "auto";
33781
+ img.style.maxWidth = "100%";
33782
+ img.style.pointerEvents = "none";
33783
+ img.style.verticalAlign = "middle";
33784
+ if (run.variant === "signature") {
33785
+ img.style.maxHeight = "28px";
33786
+ }
33787
+ content.appendChild(img);
33788
+ annotation.style.display = "inline-block";
33789
+ content.style.display = "inline-block";
33790
+ } else {
33791
+ content.textContent = run.displayLabel || (run.variant === "signature" ? "Signature" : "");
33792
+ }
33793
+ break;
33794
+ }
33795
+ case "link": {
33796
+ if (run.linkUrl) {
33797
+ const link = this.doc.createElement("a");
33798
+ const sanitized = sanitizeHref(run.linkUrl);
33799
+ if (sanitized) {
33800
+ link.href = sanitized.href;
33801
+ link.target = "_blank";
33802
+ link.rel = "noopener noreferrer";
33803
+ link.textContent = run.linkUrl;
33804
+ link.style.textDecoration = "none";
33805
+ content.style.pointerEvents = "all";
33806
+ content.appendChild(link);
33807
+ } else {
33808
+ content.textContent = run.displayLabel;
33809
+ }
33810
+ } else {
33811
+ content.textContent = run.displayLabel;
33812
+ }
33813
+ break;
33814
+ }
33815
+ case "html": {
33816
+ if (run.rawHtml && typeof run.rawHtml === "string") {
33817
+ content.textContent = run.displayLabel;
33818
+ annotation.style.display = "inline-block";
33819
+ content.style.display = "inline-block";
33820
+ } else {
33821
+ content.textContent = run.displayLabel;
33822
+ }
33823
+ break;
33824
+ }
33825
+ case "text":
33826
+ case "checkbox":
33827
+ default: {
33828
+ content.textContent = run.displayLabel;
33829
+ break;
33830
+ }
33831
+ }
33832
+ annotation.appendChild(content);
33833
+ annotation.dataset.type = run.variant;
33834
+ if (run.fieldId) {
33835
+ annotation.dataset.fieldId = run.fieldId;
33836
+ }
33837
+ if (run.fieldType) {
33838
+ annotation.dataset.fieldType = run.fieldType;
33839
+ }
33840
+ annotation.draggable = true;
33841
+ annotation.dataset.draggable = "true";
33842
+ if (run.displayLabel) {
33843
+ annotation.dataset.displayLabel = run.displayLabel;
33844
+ }
33845
+ if (run.variant) {
33846
+ annotation.dataset.variant = run.variant;
33847
+ }
33848
+ assertPmPositions(run, "field annotation run");
33849
+ if (run.pmStart != null) {
33850
+ annotation.dataset.pmStart = String(run.pmStart);
33851
+ }
33852
+ if (run.pmEnd != null) {
33853
+ annotation.dataset.pmEnd = String(run.pmEnd);
33854
+ }
33855
+ this.applySdtDataset(annotation, run.sdt);
33856
+ return annotation;
33857
+ }
32961
33858
  /**
32962
33859
  * Renders a single line of a paragraph block.
32963
33860
  *
@@ -33135,6 +34032,22 @@ const _DomPainter = class _DomPainter {
33135
34032
  if (this.isBreakRun(baseRun)) {
33136
34033
  continue;
33137
34034
  }
34035
+ if (this.isFieldAnnotationRun(baseRun)) {
34036
+ const elem = this.renderRun(baseRun, context, trackedConfig);
34037
+ if (elem) {
34038
+ if (styleId) {
34039
+ elem.setAttribute("styleid", styleId);
34040
+ }
34041
+ const runSegments2 = segmentsByRun.get(runIndex);
34042
+ const segX = runSegments2 && runSegments2[0]?.x !== void 0 ? runSegments2[0].x : cumulativeX;
34043
+ const segWidth = (runSegments2 && runSegments2[0]?.width !== void 0 ? runSegments2[0].width : 0) ?? 0;
34044
+ elem.style.position = "absolute";
34045
+ elem.style.left = `${segX}px`;
34046
+ el.appendChild(elem);
34047
+ cumulativeX = segX + segWidth;
34048
+ }
34049
+ continue;
34050
+ }
33138
34051
  const runSegments = segmentsByRun.get(runIndex);
33139
34052
  if (!runSegments || runSegments.length === 0) {
33140
34053
  continue;
@@ -33180,7 +34093,22 @@ const _DomPainter = class _DomPainter {
33180
34093
  });
33181
34094
  }
33182
34095
  } else {
34096
+ let currentInlineSdtWrapper = null;
34097
+ let currentInlineSdtId = null;
34098
+ const closeCurrentWrapper = () => {
34099
+ if (currentInlineSdtWrapper) {
34100
+ el.appendChild(currentInlineSdtWrapper);
34101
+ currentInlineSdtWrapper = null;
34102
+ currentInlineSdtId = null;
34103
+ }
34104
+ };
33183
34105
  runsForLine.forEach((run) => {
34106
+ const runSdt = run.sdt;
34107
+ const isInlineSdt = runSdt?.type === "structuredContent" && runSdt?.scope === "inline";
34108
+ const runSdtId = isInlineSdt && runSdt?.id ? String(runSdt.id) : null;
34109
+ if (runSdtId !== currentInlineSdtId) {
34110
+ closeCurrentWrapper();
34111
+ }
33184
34112
  if (run.kind === "tab") {
33185
34113
  const tabEl = this.doc.createElement("span");
33186
34114
  tabEl.classList.add("superdoc-tab");
@@ -33208,9 +34136,37 @@ const _DomPainter = class _DomPainter {
33208
34136
  if (styleId) {
33209
34137
  elem.setAttribute("styleid", styleId);
33210
34138
  }
33211
- el.appendChild(elem);
34139
+ if (isInlineSdt && runSdtId && this.doc) {
34140
+ if (!currentInlineSdtWrapper) {
34141
+ currentInlineSdtWrapper = this.doc.createElement("span");
34142
+ currentInlineSdtWrapper.className = "superdoc-structured-content-inline";
34143
+ currentInlineSdtId = runSdtId;
34144
+ this.applySdtDataset(currentInlineSdtWrapper, runSdt);
34145
+ const alias = runSdt?.alias || "Inline content";
34146
+ const labelEl = this.doc.createElement("span");
34147
+ labelEl.className = "superdoc-structured-content-inline__label";
34148
+ labelEl.textContent = alias;
34149
+ currentInlineSdtWrapper.appendChild(labelEl);
34150
+ }
34151
+ const wrapperPmStart = currentInlineSdtWrapper.dataset.pmStart;
34152
+ const wrapperPmEnd = currentInlineSdtWrapper.dataset.pmEnd;
34153
+ if (run.pmStart != null) {
34154
+ if (!wrapperPmStart || run.pmStart < parseInt(wrapperPmStart, 10)) {
34155
+ currentInlineSdtWrapper.dataset.pmStart = String(run.pmStart);
34156
+ }
34157
+ }
34158
+ if (run.pmEnd != null) {
34159
+ if (!wrapperPmEnd || run.pmEnd > parseInt(wrapperPmEnd, 10)) {
34160
+ currentInlineSdtWrapper.dataset.pmEnd = String(run.pmEnd);
34161
+ }
34162
+ }
34163
+ currentInlineSdtWrapper.appendChild(elem);
34164
+ } else {
34165
+ el.appendChild(elem);
34166
+ }
33212
34167
  }
33213
34168
  });
34169
+ closeCurrentWrapper();
33214
34170
  }
33215
34171
  const anchors = el.querySelectorAll("a[href]");
33216
34172
  anchors.forEach((anchor) => {
@@ -33718,7 +34674,7 @@ const deriveBlockVersion = (block) => {
33718
34674
  return block.id;
33719
34675
  };
33720
34676
  const applyRunStyles = (element, run, _isLink = false) => {
33721
- if (run.kind === "tab" || run.kind === "image" || run.kind === "lineBreak" || run.kind === "break") {
34677
+ if (run.kind === "tab" || run.kind === "image" || run.kind === "lineBreak" || run.kind === "break" || run.kind === "fieldAnnotation") {
33722
34678
  return;
33723
34679
  }
33724
34680
  element.style.fontFamily = run.fontFamily;
@@ -33878,6 +34834,10 @@ const sliceRunsForLine = (block, line) => {
33878
34834
  result.push(run);
33879
34835
  continue;
33880
34836
  }
34837
+ if (run.kind === "fieldAnnotation") {
34838
+ result.push(run);
34839
+ continue;
34840
+ }
33881
34841
  if (!("text" in run)) {
33882
34842
  continue;
33883
34843
  }
@@ -34193,6 +35153,10 @@ const DEFAULT_TAB_INTERVAL_PX = twipsToPx(DEFAULT_TAB_INTERVAL_TWIPS);
34193
35153
  const TAB_EPSILON = 0.1;
34194
35154
  const DEFAULT_DECIMAL_SEPARATOR = ".";
34195
35155
  const ALLOWED_TAB_VALS = /* @__PURE__ */ new Set(["start", "center", "end", "decimal", "bar", "clear"]);
35156
+ const FIELD_ANNOTATION_PILL_PADDING = 8;
35157
+ const FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER = 1.2;
35158
+ const FIELD_ANNOTATION_VERTICAL_PADDING = 6;
35159
+ const DEFAULT_FIELD_ANNOTATION_FONT_SIZE = 16;
34196
35160
  const roundValue = (value) => value;
34197
35161
  function getCanvasContext() {
34198
35162
  if (!canvasContext) {
@@ -34272,6 +35236,9 @@ function isImageRun(run) {
34272
35236
  function isLineBreakRun(run) {
34273
35237
  return run.kind === "lineBreak";
34274
35238
  }
35239
+ function isFieldAnnotationRun(run) {
35240
+ return run.kind === "fieldAnnotation";
35241
+ }
34275
35242
  async function measureBlock(block, constraints) {
34276
35243
  const normalized = normalizeConstraints(constraints);
34277
35244
  if (block.kind === "drawing") {
@@ -34638,6 +35605,92 @@ async function measureParagraphBlock(block, maxWidth) {
34638
35605
  lastAppliedTabAlign = null;
34639
35606
  continue;
34640
35607
  }
35608
+ if (isFieldAnnotationRun(run)) {
35609
+ const displayText = run.displayLabel || "";
35610
+ const annotationFontSize = typeof run.fontSize === "number" ? run.fontSize : typeof run.fontSize === "string" ? parseFloat(run.fontSize) || DEFAULT_FIELD_ANNOTATION_FONT_SIZE : DEFAULT_FIELD_ANNOTATION_FONT_SIZE;
35611
+ const annotationFontFamily = run.fontFamily || "Arial, sans-serif";
35612
+ const fontWeight = run.bold ? "bold" : "normal";
35613
+ const fontStyle = run.italic ? "italic" : "normal";
35614
+ const annotationFont = `${fontStyle} ${fontWeight} ${annotationFontSize}px ${annotationFontFamily}`;
35615
+ ctx2.font = annotationFont;
35616
+ const textWidth = displayText ? ctx2.measureText(displayText).width : 0;
35617
+ const annotationWidth = textWidth + FIELD_ANNOTATION_PILL_PADDING;
35618
+ const annotationHeight = annotationFontSize * FIELD_ANNOTATION_LINE_HEIGHT_MULTIPLIER + FIELD_ANNOTATION_VERTICAL_PADDING;
35619
+ let annotationStartX;
35620
+ if (pendingTabAlignment && currentLine) {
35621
+ annotationStartX = alignPendingTabForWidth(annotationWidth);
35622
+ }
35623
+ if (!currentLine) {
35624
+ currentLine = {
35625
+ fromRun: runIndex,
35626
+ fromChar: 0,
35627
+ toRun: runIndex,
35628
+ toChar: 1,
35629
+ // Field annotations are atomic units
35630
+ width: annotationWidth,
35631
+ maxFontSize: annotationHeight,
35632
+ maxWidth: getEffectiveWidth(initialAvailableWidth),
35633
+ segments: [
35634
+ {
35635
+ runIndex,
35636
+ fromChar: 0,
35637
+ toChar: 1,
35638
+ width: annotationWidth,
35639
+ ...annotationStartX !== void 0 ? { x: annotationStartX } : {}
35640
+ }
35641
+ ]
35642
+ };
35643
+ continue;
35644
+ }
35645
+ if (currentLine.width + annotationWidth > currentLine.maxWidth && currentLine.width > 0) {
35646
+ const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
35647
+ const completedLine = {
35648
+ ...currentLine,
35649
+ ...metrics
35650
+ };
35651
+ addBarTabsToLine(completedLine);
35652
+ lines.push(completedLine);
35653
+ tabStopCursor = 0;
35654
+ pendingTabAlignment = null;
35655
+ lastAppliedTabAlign = null;
35656
+ currentLine = {
35657
+ fromRun: runIndex,
35658
+ fromChar: 0,
35659
+ toRun: runIndex,
35660
+ toChar: 1,
35661
+ width: annotationWidth,
35662
+ maxFontSize: annotationHeight,
35663
+ maxWidth: getEffectiveWidth(contentWidth),
35664
+ segments: [
35665
+ {
35666
+ runIndex,
35667
+ fromChar: 0,
35668
+ toChar: 1,
35669
+ width: annotationWidth
35670
+ }
35671
+ ]
35672
+ };
35673
+ } else {
35674
+ currentLine.toRun = runIndex;
35675
+ currentLine.toChar = 1;
35676
+ currentLine.width = roundValue(currentLine.width + annotationWidth);
35677
+ currentLine.maxFontSize = Math.max(currentLine.maxFontSize, annotationHeight);
35678
+ if (!currentLine.segments) currentLine.segments = [];
35679
+ currentLine.segments.push({
35680
+ runIndex,
35681
+ fromChar: 0,
35682
+ toChar: 1,
35683
+ width: annotationWidth,
35684
+ ...annotationStartX !== void 0 ? { x: annotationStartX } : {}
35685
+ });
35686
+ }
35687
+ const tabAlign = lastAppliedTabAlign;
35688
+ if (tabAlign && currentLine && tabAlign.val === "end") {
35689
+ currentLine.width = roundValue(tabAlign.target);
35690
+ }
35691
+ lastAppliedTabAlign = null;
35692
+ continue;
35693
+ }
34641
35694
  if (!("text" in run) || !("fontSize" in run)) {
34642
35695
  continue;
34643
35696
  }
@@ -36711,6 +37764,12 @@ function isInRegisteredSurface(event) {
36711
37764
  }
36712
37765
  return false;
36713
37766
  }
37767
+ function isValidFieldAnnotationAttributes(attrs) {
37768
+ if (!attrs || typeof attrs !== "object") return false;
37769
+ const a = attrs;
37770
+ return typeof a.fieldId === "string" && typeof a.fieldType === "string" && typeof a.displayLabel === "string" && typeof a.type === "string";
37771
+ }
37772
+ const FIELD_ANNOTATION_DATA_TYPE = "fieldAnnotation";
36714
37773
  const DEFAULT_PAGE_SIZE = { w: 612, h: 792 };
36715
37774
  const DEFAULT_MARGINS = { top: 72, right: 72, bottom: 72, left: 72 };
36716
37775
  const WORD_CHARACTER_REGEX = /[\p{L}\p{N}''_~-]/u;
@@ -36736,6 +37795,7 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36736
37795
  __privateAdd(this, _layoutOptions);
36737
37796
  __privateAdd(this, _layoutState, { blocks: [], measures: [], layout: null });
36738
37797
  __privateAdd(this, _domPainter, null);
37798
+ __privateAdd(this, _dragHandlerCleanup, null);
36739
37799
  __privateAdd(this, _layoutError, null);
36740
37800
  __privateAdd(this, _layoutErrorState, "healthy");
36741
37801
  __privateAdd(this, _errorBanner, null);
@@ -36805,8 +37865,12 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36805
37865
  if (event.button !== 0) {
36806
37866
  return;
36807
37867
  }
37868
+ const target = event.target;
37869
+ const isDraggableAnnotation = target?.closest?.('[data-draggable="true"]') != null;
36808
37870
  if (!__privateGet(this, _layoutState).layout) {
36809
- event.preventDefault();
37871
+ if (!isDraggableAnnotation) {
37872
+ event.preventDefault();
37873
+ }
36810
37874
  if (document.activeElement instanceof HTMLElement) {
36811
37875
  document.activeElement.blur();
36812
37876
  }
@@ -36815,10 +37879,10 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36815
37879
  return;
36816
37880
  }
36817
37881
  const validPos = __privateMethod(this, _PresentationEditor_instances, getFirstTextPosition_fn).call(this);
36818
- const doc2 = __privateGet(this, _editor3)?.state?.doc;
36819
- if (doc2) {
37882
+ const doc22 = __privateGet(this, _editor3)?.state?.doc;
37883
+ if (doc22) {
36820
37884
  try {
36821
- const tr = __privateGet(this, _editor3).state.tr.setSelection(TextSelection.create(doc2, validPos));
37885
+ const tr = __privateGet(this, _editor3).state.tr.setSelection(TextSelection.create(doc22, validPos));
36822
37886
  __privateGet(this, _editor3).view?.dispatch(tr);
36823
37887
  } catch (error) {
36824
37888
  if (process$1.env.NODE_ENV === "development") {
@@ -36854,7 +37918,7 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36854
37918
  if (headerFooterRegion) {
36855
37919
  return;
36856
37920
  }
36857
- const hit = clickToPosition(
37921
+ const rawHit = clickToPosition(
36858
37922
  __privateGet(this, _layoutState).layout,
36859
37923
  __privateGet(this, _layoutState).blocks,
36860
37924
  __privateGet(this, _layoutState).measures,
@@ -36863,7 +37927,11 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36863
37927
  event.clientX,
36864
37928
  event.clientY
36865
37929
  );
36866
- event.preventDefault();
37930
+ const doc2 = __privateGet(this, _editor3).state?.doc;
37931
+ const hit = rawHit && doc2 ? { ...rawHit, pos: Math.max(0, Math.min(rawHit.pos, doc2.content.size)) } : rawHit;
37932
+ if (!isDraggableAnnotation) {
37933
+ event.preventDefault();
37934
+ }
36867
37935
  if (!hit) {
36868
37936
  if (document.activeElement instanceof HTMLElement) {
36869
37937
  document.activeElement.blur();
@@ -36871,10 +37939,10 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36871
37939
  const editorDom2 = __privateGet(this, _editor3).view?.dom;
36872
37940
  if (editorDom2) {
36873
37941
  const validPos = __privateMethod(this, _PresentationEditor_instances, getFirstTextPosition_fn).call(this);
36874
- const doc2 = __privateGet(this, _editor3)?.state?.doc;
36875
- if (doc2) {
37942
+ const doc22 = __privateGet(this, _editor3)?.state?.doc;
37943
+ if (doc22) {
36876
37944
  try {
36877
- const tr = __privateGet(this, _editor3).state.tr.setSelection(TextSelection.create(doc2, validPos));
37945
+ const tr = __privateGet(this, _editor3).state.tr.setSelection(TextSelection.create(doc22, validPos));
36878
37946
  __privateGet(this, _editor3).view?.dispatch(tr);
36879
37947
  } catch (error) {
36880
37948
  if (process$1.env.NODE_ENV === "development") {
@@ -36895,9 +37963,9 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36895
37963
  hit.pos
36896
37964
  );
36897
37965
  if (fragmentHit && (fragmentHit.fragment.kind === "image" || fragmentHit.fragment.kind === "drawing")) {
36898
- const doc2 = __privateGet(this, _editor3).state.doc;
37966
+ const doc22 = __privateGet(this, _editor3).state.doc;
36899
37967
  try {
36900
- const tr = __privateGet(this, _editor3).state.tr.setSelection(NodeSelection.create(doc2, hit.pos));
37968
+ const tr = __privateGet(this, _editor3).state.tr.setSelection(NodeSelection.create(doc22, hit.pos));
36901
37969
  __privateGet(this, _editor3).view?.dispatch(tr);
36902
37970
  if (__privateGet(this, _lastSelectedImageBlockId) && __privateGet(this, _lastSelectedImageBlockId) !== fragmentHit.fragment.blockId) {
36903
37971
  this.emit("imageDeselected", { blockId: __privateGet(this, _lastSelectedImageBlockId) });
@@ -36988,8 +38056,8 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
36988
38056
  }
36989
38057
  }
36990
38058
  if (!handledByDepth) {
36991
- const tr = __privateGet(this, _editor3).state.tr.setSelection(TextSelection.create(__privateGet(this, _editor3).state.doc, hit.pos));
36992
38059
  try {
38060
+ const tr = __privateGet(this, _editor3).state.tr.setSelection(TextSelection.create(__privateGet(this, _editor3).state.doc, hit.pos));
36993
38061
  __privateGet(this, _editor3).view?.dispatch(tr);
36994
38062
  } catch {
36995
38063
  }
@@ -37064,6 +38132,133 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
37064
38132
  }
37065
38133
  __privateSet(this, _isDragging, false);
37066
38134
  });
38135
+ /**
38136
+ * Handles dragover events for field annotation drag-and-drop operations.
38137
+ * Updates the cursor position during drag to provide visual feedback.
38138
+ *
38139
+ * @param event - The dragover event from the browser
38140
+ *
38141
+ * Side effects:
38142
+ * - Prevents default browser drag behavior
38143
+ * - Sets dropEffect to 'copy' to indicate the drag operation type
38144
+ * - Updates the editor's text selection to follow the drag cursor
38145
+ * - Triggers selection overlay updates via #scheduleSelectionUpdate
38146
+ *
38147
+ * Early returns:
38148
+ * - If the editor is not editable
38149
+ * - If no field annotation data is present in the drag
38150
+ * - If hit testing fails or document is unavailable
38151
+ * - If the cursor position hasn't changed
38152
+ */
38153
+ __privateAdd(this, _handleDragOver, (event) => {
38154
+ const activeEditor = this.getActiveEditor();
38155
+ if (!activeEditor?.isEditable) {
38156
+ return;
38157
+ }
38158
+ event.preventDefault();
38159
+ if (event.dataTransfer) {
38160
+ event.dataTransfer.dropEffect = "copy";
38161
+ }
38162
+ const dt = event.dataTransfer;
38163
+ const hasFieldAnnotation = dt?.types?.includes(FIELD_ANNOTATION_DATA_TYPE) || Boolean(dt?.getData?.(FIELD_ANNOTATION_DATA_TYPE));
38164
+ if (!hasFieldAnnotation) {
38165
+ return;
38166
+ }
38167
+ const hit = this.hitTest(event.clientX, event.clientY);
38168
+ const doc2 = activeEditor.state?.doc;
38169
+ if (!hit || !doc2) {
38170
+ return;
38171
+ }
38172
+ const pos = Math.min(Math.max(hit.pos, 1), doc2.content.size);
38173
+ const currentSelection = activeEditor.state.selection;
38174
+ const isSameCursor = currentSelection instanceof TextSelection && currentSelection.from === pos && currentSelection.to === pos;
38175
+ if (isSameCursor) {
38176
+ return;
38177
+ }
38178
+ try {
38179
+ const tr = activeEditor.state.tr.setSelection(TextSelection.create(doc2, pos)).setMeta("addToHistory", false);
38180
+ activeEditor.view?.dispatch(tr);
38181
+ __privateMethod(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
38182
+ } catch (error) {
38183
+ if (process$1.env.NODE_ENV === "development") {
38184
+ console.debug("[PresentationEditor] Drag position update skipped:", error);
38185
+ }
38186
+ }
38187
+ });
38188
+ /**
38189
+ * Handles drop events for field annotation drag-and-drop operations.
38190
+ * Inserts a field annotation at the drop position and emits events for tracking.
38191
+ *
38192
+ * @param event - The drop event from the browser
38193
+ *
38194
+ * Side effects:
38195
+ * - Prevents default browser drop behavior and stops event propagation
38196
+ * - Inserts a field annotation node at the drop position
38197
+ * - Moves the cursor to just after the inserted node
38198
+ * - Emits 'fieldAnnotationDropped' event with drop metadata
38199
+ * - Focuses the editor view
38200
+ * - Triggers selection overlay updates via #scheduleSelectionUpdate
38201
+ *
38202
+ * Early returns:
38203
+ * - If the editor is not editable
38204
+ * - If no field annotation data is present in the drop
38205
+ * - If JSON parsing of the payload fails
38206
+ * - If hit testing and fallback position both fail
38207
+ * - If the parsed attributes fail validation
38208
+ *
38209
+ * Fallback behavior:
38210
+ * - If hit testing fails (e.g., during a reflow), falls back to current selection position
38211
+ * - If selection is unavailable, falls back to end of document
38212
+ */
38213
+ __privateAdd(this, _handleDrop, (event) => {
38214
+ const activeEditor = this.getActiveEditor();
38215
+ if (!activeEditor?.isEditable) {
38216
+ return;
38217
+ }
38218
+ if (event.dataTransfer?.types?.includes("application/x-field-annotation")) {
38219
+ return;
38220
+ }
38221
+ event.preventDefault();
38222
+ event.stopPropagation();
38223
+ const fieldAnnotationData = event.dataTransfer?.getData(FIELD_ANNOTATION_DATA_TYPE);
38224
+ if (!fieldAnnotationData) {
38225
+ return;
38226
+ }
38227
+ const hit = this.hitTest(event.clientX, event.clientY);
38228
+ const selection = activeEditor.state?.selection;
38229
+ const fallbackPos = selection?.from ?? activeEditor.state?.doc?.content.size ?? null;
38230
+ const pos = hit?.pos ?? fallbackPos;
38231
+ if (pos == null) {
38232
+ return;
38233
+ }
38234
+ let parsedData = null;
38235
+ try {
38236
+ parsedData = JSON.parse(fieldAnnotationData);
38237
+ } catch {
38238
+ return;
38239
+ }
38240
+ const { attributes, sourceField } = parsedData ?? {};
38241
+ activeEditor.emit?.("fieldAnnotationDropped", {
38242
+ sourceField,
38243
+ editor: activeEditor,
38244
+ coordinates: hit,
38245
+ pos
38246
+ });
38247
+ if (attributes && isValidFieldAnnotationAttributes(attributes)) {
38248
+ activeEditor.commands?.addFieldAnnotation?.(pos, attributes, true);
38249
+ const posAfter = Math.min(pos + 1, activeEditor.state?.doc?.content.size ?? pos + 1);
38250
+ const tr = activeEditor.state?.tr.setSelection(TextSelection.create(activeEditor.state.doc, posAfter));
38251
+ if (tr) {
38252
+ activeEditor.view?.dispatch(tr);
38253
+ }
38254
+ __privateMethod(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
38255
+ }
38256
+ const editorDom = activeEditor.view?.dom;
38257
+ if (editorDom) {
38258
+ editorDom.focus();
38259
+ activeEditor.view?.focus();
38260
+ }
38261
+ });
37067
38262
  __privateAdd(this, _handleDoubleClick, (event) => {
37068
38263
  if (event.button !== 0) return;
37069
38264
  if (!__privateGet(this, _layoutState).layout) return;
@@ -37253,6 +38448,7 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
37253
38448
  __privateMethod(this, _PresentationEditor_instances, applyZoom_fn).call(this);
37254
38449
  __privateMethod(this, _PresentationEditor_instances, setupEditorListeners_fn).call(this);
37255
38450
  __privateMethod(this, _PresentationEditor_instances, setupPointerHandlers_fn).call(this);
38451
+ __privateMethod(this, _PresentationEditor_instances, setupDragHandlers_fn).call(this);
37256
38452
  __privateMethod(this, _PresentationEditor_instances, setupInputBridge_fn).call(this);
37257
38453
  __privateMethod(this, _PresentationEditor_instances, syncTrackedChangesPreferences_fn).call(this);
37258
38454
  if (options.documentId) {
@@ -37964,6 +39160,7 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
37964
39160
  * Safe to call during partial initialization.
37965
39161
  */
37966
39162
  destroy() {
39163
+ var _a;
37967
39164
  if (__privateGet(this, _rafHandle) != null) {
37968
39165
  __privateMethod(this, _PresentationEditor_instances, safeCleanup_fn).call(this, () => {
37969
39166
  const win = __privateGet(this, _visibleHost)?.ownerDocument?.defaultView ?? window;
@@ -37985,6 +39182,8 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
37985
39182
  __privateGet(this, _viewportHost)?.removeEventListener("pointermove", __privateGet(this, _handlePointerMove));
37986
39183
  __privateGet(this, _viewportHost)?.removeEventListener("pointerup", __privateGet(this, _handlePointerUp));
37987
39184
  __privateGet(this, _viewportHost)?.removeEventListener("pointerleave", __privateGet(this, _handlePointerLeave));
39185
+ __privateGet(this, _viewportHost)?.removeEventListener("dragover", __privateGet(this, _handleDragOver));
39186
+ __privateGet(this, _viewportHost)?.removeEventListener("drop", __privateGet(this, _handleDrop));
37988
39187
  __privateGet(this, _visibleHost)?.removeEventListener("keydown", __privateGet(this, _handleKeyDown));
37989
39188
  __privateGet(this, _inputBridge)?.notifyTargetChanged();
37990
39189
  __privateGet(this, _inputBridge)?.destroy();
@@ -38023,6 +39222,8 @@ const _PresentationEditor = class _PresentationEditor extends EventEmitter {
38023
39222
  __privateSet(this, _session, { mode: "body" });
38024
39223
  __privateSet(this, _activeHeaderFooterEditor, null);
38025
39224
  __privateSet(this, _domPainter, null);
39225
+ (_a = __privateGet(this, _dragHandlerCleanup)) == null ? void 0 : _a.call(this);
39226
+ __privateSet(this, _dragHandlerCleanup, null);
38026
39227
  __privateGet(this, _selectionOverlay2)?.remove();
38027
39228
  __privateGet(this, _painterHost)?.remove();
38028
39229
  __privateGet(this, _hiddenHost)?.remove();
@@ -38050,6 +39251,7 @@ _hiddenHost = new WeakMap();
38050
39251
  _layoutOptions = new WeakMap();
38051
39252
  _layoutState = new WeakMap();
38052
39253
  _domPainter = new WeakMap();
39254
+ _dragHandlerCleanup = new WeakMap();
38053
39255
  _layoutError = new WeakMap();
38054
39256
  _layoutErrorState = new WeakMap();
38055
39257
  _errorBanner = new WeakMap();
@@ -38550,8 +39752,104 @@ setupPointerHandlers_fn = function() {
38550
39752
  __privateGet(this, _viewportHost).addEventListener("pointermove", __privateGet(this, _handlePointerMove));
38551
39753
  __privateGet(this, _viewportHost).addEventListener("pointerup", __privateGet(this, _handlePointerUp));
38552
39754
  __privateGet(this, _viewportHost).addEventListener("pointerleave", __privateGet(this, _handlePointerLeave));
39755
+ __privateGet(this, _viewportHost).addEventListener("dragover", __privateGet(this, _handleDragOver));
39756
+ __privateGet(this, _viewportHost).addEventListener("drop", __privateGet(this, _handleDrop));
38553
39757
  __privateGet(this, _visibleHost).addEventListener("keydown", __privateGet(this, _handleKeyDown));
38554
39758
  };
39759
+ /**
39760
+ * Sets up drag and drop handlers for field annotations in the layout engine view.
39761
+ * Uses the DragHandler from layout-bridge to handle drag events and map drop
39762
+ * coordinates to ProseMirror positions.
39763
+ */
39764
+ setupDragHandlers_fn = function() {
39765
+ var _a;
39766
+ (_a = __privateGet(this, _dragHandlerCleanup)) == null ? void 0 : _a.call(this);
39767
+ __privateSet(this, _dragHandlerCleanup, null);
39768
+ __privateSet(this, _dragHandlerCleanup, createDragHandler(__privateGet(this, _painterHost), {
39769
+ onDragOver: (event) => {
39770
+ if (!event.hasFieldAnnotation || event.event.clientX === 0) {
39771
+ return;
39772
+ }
39773
+ const activeEditor = this.getActiveEditor();
39774
+ if (!activeEditor?.isEditable) {
39775
+ return;
39776
+ }
39777
+ const hit = this.hitTest(event.clientX, event.clientY);
39778
+ const doc2 = activeEditor.state?.doc;
39779
+ if (!hit || !doc2) {
39780
+ return;
39781
+ }
39782
+ const pos = Math.min(Math.max(hit.pos, 1), doc2.content.size);
39783
+ const currentSelection = activeEditor.state.selection;
39784
+ if (currentSelection instanceof TextSelection && currentSelection.from === pos && currentSelection.to === pos) {
39785
+ return;
39786
+ }
39787
+ try {
39788
+ const tr = activeEditor.state.tr.setSelection(TextSelection.create(doc2, pos)).setMeta("addToHistory", false);
39789
+ activeEditor.view?.dispatch(tr);
39790
+ __privateMethod(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
39791
+ } catch {
39792
+ }
39793
+ },
39794
+ onDrop: (event) => {
39795
+ event.event.preventDefault();
39796
+ event.event.stopPropagation();
39797
+ if (event.pmPosition === null) {
39798
+ return;
39799
+ }
39800
+ const activeEditor = this.getActiveEditor();
39801
+ const { state, view } = activeEditor;
39802
+ if (!state || !view) {
39803
+ return;
39804
+ }
39805
+ const fieldId = event.data.fieldId;
39806
+ if (fieldId) {
39807
+ const targetPos = event.pmPosition;
39808
+ let sourceStart = null;
39809
+ let sourceEnd = null;
39810
+ let sourceNode = null;
39811
+ state.doc.descendants((node, pos) => {
39812
+ if (node.type.name === "fieldAnnotation" && node.attrs.fieldId === fieldId) {
39813
+ sourceStart = pos;
39814
+ sourceEnd = pos + node.nodeSize;
39815
+ sourceNode = node;
39816
+ return false;
39817
+ }
39818
+ return true;
39819
+ });
39820
+ if (sourceStart === null || sourceEnd === null || !sourceNode) {
39821
+ return;
39822
+ }
39823
+ if (targetPos >= sourceStart && targetPos <= sourceEnd) {
39824
+ return;
39825
+ }
39826
+ const tr = state.tr;
39827
+ tr.delete(sourceStart, sourceEnd);
39828
+ const mappedTarget = tr.mapping.map(targetPos);
39829
+ if (mappedTarget < 0 || mappedTarget > tr.doc.content.size) {
39830
+ return;
39831
+ }
39832
+ tr.insert(mappedTarget, sourceNode);
39833
+ tr.setMeta("uiEvent", "drop");
39834
+ view.dispatch(tr);
39835
+ return;
39836
+ }
39837
+ const attrs = event.data.attributes;
39838
+ if (attrs && isValidFieldAnnotationAttributes(attrs)) {
39839
+ const inserted = activeEditor.commands?.addFieldAnnotation?.(event.pmPosition, attrs, true);
39840
+ if (inserted) {
39841
+ __privateMethod(this, _PresentationEditor_instances, scheduleSelectionUpdate_fn).call(this);
39842
+ }
39843
+ return;
39844
+ }
39845
+ activeEditor.emit("fieldAnnotationDropped", {
39846
+ sourceField: event.data,
39847
+ editor: activeEditor,
39848
+ coordinates: { pos: event.pmPosition }
39849
+ });
39850
+ }
39851
+ }));
39852
+ };
38555
39853
  setupInputBridge_fn = function() {
38556
39854
  __privateGet(this, _inputBridge)?.destroy();
38557
39855
  const win = __privateGet(this, _visibleHost).ownerDocument?.defaultView ?? window;
@@ -38850,6 +40148,8 @@ isWordCharacter_fn = function(char) {
38850
40148
  _handlePointerMove = new WeakMap();
38851
40149
  _handlePointerLeave = new WeakMap();
38852
40150
  _handlePointerUp = new WeakMap();
40151
+ _handleDragOver = new WeakMap();
40152
+ _handleDrop = new WeakMap();
38853
40153
  _handleDoubleClick = new WeakMap();
38854
40154
  _handleKeyDown = new WeakMap();
38855
40155
  focusHeaderFooterShortcut_fn = function(kind) {