@stll/folio-react 0.15.8 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { d as containedHandler } from "./renderAsync-t52Dj0cD.js";
1
+ import { d as containedHandler } from "./renderAsync-DxN5E41W.js";
2
2
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import { CheckIcon, MoreVerticalIcon } from "lucide-react";
4
4
  import { useLocale, useTranslations } from "use-intl";
@@ -1,4 +1,4 @@
1
- import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-DD_yAlp1.js";
1
+ import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-Dhu0sHJ4.js";
2
2
  import { ReactNode } from "react";
3
3
  import { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
4
4
  //#region src/compat/eigenpal.d.ts
@@ -1,4 +1,4 @@
1
- import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-t52Dj0cD.js";
1
+ import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-DxN5E41W.js";
2
2
  import { t as messages_exports } from "../messages.js";
3
3
  import { c } from "react-compiler-runtime";
4
4
  import { forwardRef } from "react";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as FolioUIProvider, a as DocxEditorApplyDocumentOperationsOptions, c as DocxEditorRef, d as ToolbarProps, f as EditorMode, g as FolioUIComponents, h as FolioButtonProps, i as renderAsync, l as HighlightPassageOptions, m as ColorPreset, n as EditorHandle, o as DocxEditorCollaboration, p as FontOption, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageResult, v as OutlineItem, y as FontDefinition } from "./renderAsync-DD_yAlp1.js";
1
+ import { _ as FolioUIProvider, a as DocxEditorApplyDocumentOperationsOptions, c as DocxEditorRef, d as ToolbarProps, f as EditorMode, g as FolioUIComponents, h as FolioButtonProps, i as renderAsync, l as HighlightPassageOptions, m as ColorPreset, n as EditorHandle, o as DocxEditorCollaboration, p as FontOption, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageResult, v as OutlineItem, y as FontDefinition } from "./renderAsync-Dhu0sHJ4.js";
2
2
  import { A as HyperlinkDialog, C as ImagePropertiesData, D as ImagePositionDialog, E as ImagePositionData, F as FindReplaceDialog, I as FindReplaceDialogProps, M as HyperlinkDialogProps, N as FootnotePropertiesDialog, O as ImagePositionDialogProps, P as FootnotePropertiesDialogProps, S as InsertImageDialogProps, T as ImagePropertiesDialogProps, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialog, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as HyperlinkDialogData, k as HyperlinkBookmarkOption, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertSymbolDialog, w as ImagePropertiesDialog, x as InsertImageDialogData, y as InsertSymbolDialogProps } from "./dialogs-DZz6gVev.js";
3
3
  import React, { CSSProperties, ReactNode, RefObject } from "react";
4
4
  import { CreateEmptyDocumentOptions, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
@@ -10,6 +10,7 @@ import { AnonymizationMatch, AnonymizationTerm, anonymizationDecorationsKey, get
10
10
  import { TemplateSlashMenuKeyAction, TemplateSlashMenuState, clearTemplateSlashMenu, consumeTemplateSlashQuery, getTemplateSlashMenu, resetTemplateSlashQuery, templateSlashMenuKey } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
11
11
  import { Document } from "@stll/folio-core/types/document";
12
12
  import { ScrollToParaIdOptions } from "@stll/folio-core/paged-layout/paragraphFlash";
13
+ import { BlockRect } from "@stll/folio-core/paged-layout/blockGeometry";
13
14
  import { PictureWatermark, TextWatermark, Watermark, getDocumentWatermark, setDocumentWatermark } from "@stll/folio-core/watermark";
14
15
  import { DocumentStyleCatalog, DocumentStyleCatalogEntry, ExtractDocumentStyleSetOptions, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, inspectDocumentStyles, inspectDocumentStylesFromDocx } from "@stll/folio-core/style-sets/extract";
15
16
  import { STELLA_STYLE_SET_NAME, createStellaStyleDocumentPreset, createStellaStyleSet } from "@stll/folio-core/style-sets/stellaStyle";
@@ -189,4 +190,4 @@ type AutocompleteCaretOverlayProps = {
189
190
  };
190
191
  declare const AutocompleteCaretOverlay: ({ caret, text, isStreaming }: AutocompleteCaretOverlayProps) => React.JSX.Element | null;
191
192
  //#endregion
192
- export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type AcceptAutocompleteResult, type AnonymizationMatch, type AnonymizationTerm, type ApplyResult, AutocompleteCaretOverlay, type AutocompleteCaretOverlayProps, type AutocompleteCaretRect, type AutocompleteSuggestionPluginOptions, type AutocompleteSuggestionState, type AutocompleteSuggestionStatus, type AutocompleteTriggerCheck, type AutocompleteTriggerOptions, type AutocompleteTriggerSkipReason, type ColorPreset, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, type DocxCompatibility, DocxEditor, type DocxEditorApplyDocumentOperationsOptions, type DocxEditorCollaboration, type DocxEditorHandle, type DocxEditorProps, type DocxEditorRef, type EditorHandle, type EditorMode, type ExtractDocumentStyleSetOptions, FindReplaceDialog, type FindReplaceDialogProps, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAISignatureParty, type FolioBlockId, type FolioButtonProps, type FolioSuggestion, type FolioUIComponents, FolioUIProvider, type FontDefinition, type FontOption, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, FormattingBar, type FormattingBarProps, type HighlightPassageOptions, type HighlightPassageResult, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImageMeta, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, type ImageRef, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, type MarkdownOptions, type MarkdownResult, type OutlineItem, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, type PictureWatermark, type PositionalText, type RenderAsyncOptions, type ResolvedAnchor, STELLA_STYLE_SET_NAME, type ScrollToParaIdOptions, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type SuggestionAppliedAs, type SuggestionKind, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, type TextWatermark, type UseWheelZoomOptions, type UseWheelZoomReturn, type Watermark, WatermarkDialog, type WatermarkDialogProps, type WordDiffSegment, ZOOM_PRESETS, ZoomControl, type ZoomControlProps, type ZoomLevel, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applySuggestions, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildPositionalText, clampZoom, clearAutocompleteSuggestion, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, finishAutocompleteSuggestion, formatZoom, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getDocumentWatermark, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, insertImageFromFile, insertPageBreakInView, insertTableInView, insertTableOfContentsInView, inspectDocumentStyles, inspectDocumentStylesFromDocx, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, parseZoom, renderAsync, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setDocumentWatermark, setFocusedSuggestionMeta, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult, useWheelZoom };
193
+ export { type AIBarStatus, type AIChatMode, type AICitation, type AICitationRange, type AICitationSource, type AIGenerateInput, type AISuggestion, type AISuggestionApplyMode, type AISuggestionPreset, type AISuggestionSeverity, type AISuggestionStatus, type AcceptAutocompleteResult, type AnonymizationMatch, type AnonymizationTerm, type ApplyResult, AutocompleteCaretOverlay, type AutocompleteCaretOverlayProps, type AutocompleteCaretRect, type AutocompleteSuggestionPluginOptions, type AutocompleteSuggestionState, type AutocompleteSuggestionStatus, type AutocompleteTriggerCheck, type AutocompleteTriggerOptions, type AutocompleteTriggerSkipReason, type BlockRect, type ColorPreset, type CreateEmptyDocumentOptions, DEFAULT_AI_SUGGESTION_PRESETS, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DirectiveKind, type DirectiveRange, type Document, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, type DocxCompatibility, DocxEditor, type DocxEditorApplyDocumentOperationsOptions, type DocxEditorCollaboration, type DocxEditorHandle, type DocxEditorProps, type DocxEditorRef, type EditorHandle, type EditorMode, type ExtractDocumentStyleSetOptions, FindReplaceDialog, type FindReplaceDialogProps, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAISignatureParty, type FolioBlockId, type FolioButtonProps, type FolioSuggestion, type FolioUIComponents, FolioUIProvider, type FontDefinition, type FontOption, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, FormattingBar, type FormattingBarProps, type HighlightPassageOptions, type HighlightPassageResult, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImageMeta, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, type ImageRef, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, type MarkdownOptions, type MarkdownResult, type OutlineItem, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, type PictureWatermark, type PositionalText, type RenderAsyncOptions, type ResolvedAnchor, STELLA_STYLE_SET_NAME, type ScrollToParaIdOptions, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type SuggestionAppliedAs, type SuggestionKind, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, type TemplatePreviewSpan, type TemplatePreviewValue, type TemplatePreviewValues, type TemplateSlashMenuKeyAction, type TemplateSlashMenuState, type TextWatermark, type UseWheelZoomOptions, type UseWheelZoomReturn, type Watermark, WatermarkDialog, type WatermarkDialogProps, type WordDiffSegment, ZOOM_PRESETS, ZoomControl, type ZoomControlProps, type ZoomLevel, acceptAutocompleteSuggestion, acceptAutocompleteWord, anonymizationDecorationsKey, appendAutocompleteToken, applyFolioAIEditOperations, applySuggestions, autocompleteSuggestionKey, autocompleteSuggestionPlugin, buildPositionalText, clampZoom, clearAutocompleteSuggestion, clearTemplateSlashMenu, consumeTemplateSlashQuery, createAICitationDecorationsPlugin, createDocx, createEmptyDocument, createFolioAIEditSnapshot, createStellaStyleDocumentPreset, createStellaStyleSet, deriveBlockId, diffWordSegments, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, finishAutocompleteSuggestion, formatZoom, fromMarkdown, getAnonymizationMatches, getAutocompleteSuggestion, getDocumentWatermark, getFolioCaretViewportRect, getFolioParaIdFromBlockId, getFolioSelectionViewportRect, getTemplateDirectives, getTemplateSlashMenu, hashFolioAIBlockText, insertImageFromFile, insertPageBreakInView, insertTableInView, insertTableOfContentsInView, inspectDocumentStyles, inspectDocumentStylesFromDocx, isFolioBlockId, isSequentialFolioBlockId, isSuggestionStale, normalizeFolioAIBlockText, parseZoom, renderAsync, resetTemplateSlashQuery, resolveSuggestionAnchor, scanDirectives, scrollFolioPositionIntoView, setAICitationsMeta, setAISuggestionsMeta, setActiveCitationMeta, setAnonymizationTermsMeta, setDocumentWatermark, setFocusedSuggestionMeta, setTemplatePreviewValues, shouldTriggerAutocomplete, startAutocompleteSuggestion, templateSlashMenuKey, toMarkdown, toMarkdownResult, useWheelZoom };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as formatZoom, c as FormattingBar, i as clampZoom, l as ZoomControl, n as DocxEditor, o as parseZoom, r as ZOOM_PRESETS, s as useWheelZoom, t as renderAsync, u as AutocompleteCaretOverlay } from "./renderAsync-t52Dj0cD.js";
1
+ import { a as formatZoom, c as FormattingBar, i as clampZoom, l as ZoomControl, n as DocxEditor, o as parseZoom, r as ZOOM_PRESETS, s as useWheelZoom, t as renderAsync, u as AutocompleteCaretOverlay } from "./renderAsync-DxN5E41W.js";
2
2
  import { n as FolioUIProvider } from "./folio-ui-BgDDRsUX.js";
3
3
  import { t as FindReplaceDialog } from "./FindReplaceDialog-CqKK82nE.js";
4
4
  import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-CixRdIiT.js";
@@ -17,6 +17,7 @@ import { ColorValue, Document, ParagraphAlignment, SdtProperties, SectionPropert
17
17
  import { Comment } from "@stll/folio-core/types/content";
18
18
  import { DocxInput } from "@stll/folio-core/utils/docxInput";
19
19
  import { ScrollToParaIdOptions } from "@stll/folio-core/paged-layout/paragraphFlash";
20
+ import { BlockRect } from "@stll/folio-core/paged-layout/blockGeometry";
20
21
  import "@stll/folio-core/controller/noteEditorManager";
21
22
  import { Layout } from "@stll/folio-core/layout-engine/types";
22
23
  import "@stll/folio-core/prosemirror/extensions/ExtensionManager";
@@ -131,6 +132,14 @@ type PagedEditorRef = {
131
132
  * or null if no layout is available yet. Works for unrendered pages too via
132
133
  * the page shell map. */
133
134
  getPageNumberForPmPos: (pmPos: number) => number | null;
135
+ /** Painted geometry for one AI-snapshot block. */
136
+ getBlockRect: (blockId: string) => BlockRect | null;
137
+ /** Painted geometry for many AI-snapshot blocks in one layout read. */
138
+ getBlockRects: (blockIds: readonly string[]) => ReadonlyMap<string, BlockRect>;
139
+ /** The scroll root that owns the painted pages. */
140
+ getScrollRoot: () => HTMLElement | null;
141
+ /** Subscribe to changes in the set or contents of painted pages. */
142
+ onLayoutChange: (listener: () => void) => () => void;
134
143
  };
135
144
  //#endregion
136
145
  //#region src/ui/folio-ui.d.ts
@@ -1061,6 +1070,14 @@ type DocxEditorRef = {
1061
1070
  getPageText: (page: number) => string | null;
1062
1071
  /** Resolve a stable block or text range to its real 1-based rendered page. */
1063
1072
  getTargetPage: (target: FolioDocumentNavigationTarget, snapshot?: FolioAIEditSnapshot) => number | null;
1073
+ /** Painted geometry for one block, relative to this editor's scroll root. */
1074
+ getBlockRect: (blockId: string) => BlockRect | null;
1075
+ /** Painted geometry for many blocks in one layout read; missing ids are omitted. */
1076
+ getBlockRects: (blockIds: readonly string[]) => ReadonlyMap<string, BlockRect>;
1077
+ /** The element that scrolls this editor's painted pages. */
1078
+ getScrollRoot: () => HTMLElement | null;
1079
+ /** Subscribe after a layout pass changes the painted pages. */
1080
+ onLayoutChange: (listener: () => void) => () => void;
1064
1081
  /**
1065
1082
  * List every block-level content control in the live document, filtered by
1066
1083
  * tag / alias / id / sdtType. Returns the modeled SdtProperties projection
@@ -43,6 +43,7 @@ import { CellSelection } from "prosemirror-tables";
43
43
  import { createHeaderFooterEditorManager } from "@stll/folio-core/controller/headerFooterEditorManager";
44
44
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
45
45
  import { createNoteEditorManager } from "@stll/folio-core/controller/noteEditorManager";
46
+ import { createFolioAIEditSnapshot as createFolioAIEditSnapshot$1 } from "@stll/folio-core/ai-edits/snapshot";
46
47
  import { createFolioEditor } from "@stll/folio-core/controller/folioEditor";
47
48
  import { createFolioEditorEmitter } from "@stll/folio-core/controller/folioEditorEvents";
48
49
  import { createLatestRequestGate } from "@stll/folio-core/controller/latestRequestGate";
@@ -66,6 +67,7 @@ import { resolveSectionHeaderFooterRefs } from "@stll/folio-core/layout-engine";
66
67
  import { recordLayoutPhase } from "@stll/folio-core/layout-engine/layoutInstrumentation";
67
68
  import { LayoutPainter } from "@stll/folio-core/layout-painter";
68
69
  import { PAINTER_PAINTED_EVENT, findPageShellForPmPos } from "@stll/folio-core/layout-painter/renderPage";
70
+ import { onPaintedLayoutChange, readBlockRects } from "@stll/folio-core/paged-layout/blockGeometry";
69
71
  import { LayoutSelectionGate } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
70
72
  import { collectRunFontsAtPmPositions, measureDirectiveGutter, projectRangesToRects } from "@stll/folio-core/paged-layout/rangeProjection";
71
73
  import { isReadOnlyEditKey } from "@stll/folio-core/paged-layout/readOnlyEditAttempt";
@@ -5921,11 +5923,41 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
5921
5923
  }
5922
5924
  }
5923
5925
  return bestNumber;
5926
+ },
5927
+ getBlockRect(blockId) {
5928
+ const state_8 = folioEditor.getState();
5929
+ const pagesContainer_4 = pagesContainerRef.current;
5930
+ const scrollRoot = getScrollContainer();
5931
+ if (!state_8 || !pagesContainer_4 || !scrollRoot) return null;
5932
+ return readBlockRects({
5933
+ blockIds: [blockId],
5934
+ snapshot: createFolioAIEditSnapshot$1(state_8.doc),
5935
+ pagesContainer: pagesContainer_4,
5936
+ scrollRoot
5937
+ }).get(blockId) ?? null;
5938
+ },
5939
+ getBlockRects(blockIds) {
5940
+ const state_9 = folioEditor.getState();
5941
+ const pagesContainer_5 = pagesContainerRef.current;
5942
+ const scrollRoot_0 = getScrollContainer();
5943
+ if (!state_9 || !pagesContainer_5 || !scrollRoot_0) return /* @__PURE__ */ new Map();
5944
+ return readBlockRects({
5945
+ blockIds,
5946
+ snapshot: createFolioAIEditSnapshot$1(state_9.doc),
5947
+ pagesContainer: pagesContainer_5,
5948
+ scrollRoot: scrollRoot_0
5949
+ });
5950
+ },
5951
+ getScrollRoot: getScrollContainer,
5952
+ onLayoutChange(listener) {
5953
+ const pagesContainer_6 = pagesContainerRef.current;
5954
+ return pagesContainer_6 ? onPaintedLayoutChange(pagesContainer_6, listener) : () => {};
5924
5955
  }
5925
5956
  }), [
5926
5957
  ensureHiddenEditorView,
5927
5958
  folioEditor,
5928
5959
  getActiveEditorStory,
5960
+ getScrollContainer,
5929
5961
  refreshBodyImeCaretAnchor,
5930
5962
  scrollToPageImpl,
5931
5963
  scrollToParaIdImpl,
@@ -5940,8 +5972,8 @@ const PagedEditor = forwardRef(function PagedEditor(props, ref) {
5940
5972
  onTotalPagesChangeRef.current?.(totalPages);
5941
5973
  }, [layout]);
5942
5974
  useEffect(() => {
5943
- const state_8 = hiddenPMRef.current?.getState();
5944
- if (layout && state_8) updateSelectionOverlay(state_8);
5975
+ const state_10 = hiddenPMRef.current?.getState();
5976
+ if (layout && state_10) updateSelectionOverlay(state_10);
5945
5977
  }, [layout, updateSelectionOverlay]);
5946
5978
  const totalHeight = useMemo(() => {
5947
5979
  if (!layout) return DEFAULT_PAGE_HEIGHT_PX + 48;
@@ -12603,7 +12635,7 @@ function useFolioComments({ doc, autoOpenReviewSidebar, anchorPositions, editorC
12603
12635
  * - Error boundary
12604
12636
  * - Loading states
12605
12637
  */
12606
- const CommentsSidebar = lazy(() => import("./CommentsSidebar-HzkItXFC.js").then((m) => ({ default: m.CommentsSidebar })));
12638
+ const CommentsSidebar = lazy(() => import("./CommentsSidebar-C4avAlpl.js").then((m) => ({ default: m.CommentsSidebar })));
12607
12639
  const TextContextMenu = lazy(() => import("./TextContextMenu-Ci7-M4oU.js").then((m) => ({ default: m.TextContextMenu })));
12608
12640
  const loadAttemptSelectiveSave = async () => {
12609
12641
  const { attemptSelectiveSave } = await import("@stll/folio-core/docx/selectiveSave");
@@ -14497,6 +14529,10 @@ const DocxEditor = forwardRef(function DocxEditor({ documentBuffer, password, do
14497
14529
  if (range_6 === null) return null;
14498
14530
  return pagedEditorRef.current?.getPageNumberForPmPos(range_6.from) ?? null;
14499
14531
  },
14532
+ getBlockRect: (blockId_1) => pagedEditorRef.current?.getBlockRect(blockId_1) ?? null,
14533
+ getBlockRects: (blockIds) => pagedEditorRef.current?.getBlockRects(blockIds) ?? /* @__PURE__ */ new Map(),
14534
+ getScrollRoot: () => pagedEditorRef.current?.getScrollRoot() ?? null,
14535
+ onLayoutChange: (listener) => pagedEditorRef.current?.onLayoutChange(listener) ?? (() => {}),
14500
14536
  getContentControls: (filter = {}) => {
14501
14537
  const view_38 = pagedEditorRef.current?.getView();
14502
14538
  if (!view_38) return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-react",
3
- "version": "0.15.8",
3
+ "version": "0.16.0",
4
4
  "description": "React editor for folio: a Word-document (.docx) editor for the browser, built on @stll/folio-core and ProseMirror.",
5
5
  "keywords": [
6
6
  "document-editor",
@@ -68,7 +68,7 @@
68
68
  "@fontsource/noto-sans-arabic": "^5.2.7",
69
69
  "@fontsource/source-sans-3": "^5.2.9",
70
70
  "@fontsource/tinos": "^5.2.7",
71
- "@stll/folio-core": "^0.26.0",
71
+ "@stll/folio-core": "^0.27.0",
72
72
  "better-result": "3.0.1",
73
73
  "lucide-react": "1.24.0",
74
74
  "prosemirror-history": "^1.5.0",