@stll/folio-react 0.12.1 → 0.12.3

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.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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-D2OJupOm.js";
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-auOIiNGI.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-CH8S7yqU.js";
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-lCOx21mG.js";
3
3
  import React, { CSSProperties, ReactNode, RefObject } from "react";
4
4
  import { CreateEmptyDocumentOptions, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
5
5
  import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAISignatureParty, WordDiffSegment, applyFolioAIEditOperations, createFolioAIEditSnapshot, diffWordSegments, hashFolioAIBlockText, normalizeFolioAIBlockText } from "@stll/folio-core/ai-edits";
@@ -28,7 +28,6 @@ import { DirectiveKind, DirectiveRange, getTemplateDirectives, scanDirectives }
28
28
  import { TemplatePreviewSpan, TemplatePreviewValue, TemplatePreviewValues, setTemplatePreviewValues } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
29
29
  import { AcceptAutocompleteResult, AutocompleteSuggestionPluginOptions, AutocompleteSuggestionState, AutocompleteSuggestionStatus, AutocompleteTriggerCheck, AutocompleteTriggerOptions, AutocompleteTriggerSkipReason, DEFAULT_AUTOCOMPLETE_DEAD_ZONE_NODES, acceptAutocompleteSuggestion, acceptAutocompleteWord, appendAutocompleteToken, autocompleteSuggestionKey, autocompleteSuggestionPlugin, clearAutocompleteSuggestion, finishAutocompleteSuggestion, getAutocompleteSuggestion, shouldTriggerAutocomplete, startAutocompleteSuggestion } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
30
30
  import { ImageMeta, ImageRef, MarkdownOptions, MarkdownResult, fromMarkdown, toMarkdown, toMarkdownResult } from "@stll/folio-core/markdown";
31
-
32
31
  //#region src/components/DocxEditor.d.ts
33
32
  /**
34
33
  * DocxEditor - Complete DOCX editor component
@@ -37,10 +36,14 @@ declare const DocxEditor: import("react").ForwardRefExoticComponent<DocxEditorPr
37
36
  //#endregion
38
37
  //#region src/components/FormattingBar.d.ts
39
38
  type FormattingBarProps = {
40
- children?: ReactNode; /** Host controls that should stay in the primary row before text formatting */
41
- priorityExtra?: ReactNode; /** Extra controls rendered inline in the center column (after formatting buttons) */
42
- inlineExtra?: ReactNode; /** Display label for the style picker when the backing document is hydrating. */
43
- stylePickerLabel?: string | undefined; /** Computed preview style for the hydrating style picker label. */
39
+ children?: ReactNode;
40
+ /** Host controls that should stay in the primary row before text formatting */
41
+ priorityExtra?: ReactNode;
42
+ /** Extra controls rendered inline in the center column (after formatting buttons) */
43
+ inlineExtra?: ReactNode;
44
+ /** Display label for the style picker when the backing document is hydrating. */
45
+ stylePickerLabel?: string | undefined;
46
+ /** Computed preview style for the hydrating style picker label. */
44
47
  stylePickerLabelStyle?: CSSProperties | undefined;
45
48
  inline?: boolean;
46
49
  } & ToolbarProps;
@@ -61,32 +64,35 @@ type ZoomLevel = {
61
64
  label: string;
62
65
  };
63
66
  type ZoomControlProps = {
64
- /** Current zoom (1 = 100%). */value?: number; /** Called with the chosen zoom level. */
65
- onChange?: (zoom: number) => void; /** Override the preset levels offered in the dropdown. */
67
+ /** Current zoom (1 = 100%). */
68
+ value?: number;
69
+ /** Called with the chosen zoom level. */
70
+ onChange?: (zoom: number) => void;
71
+ /** Override the preset levels offered in the dropdown. */
66
72
  levels?: ZoomLevel[];
67
73
  disabled?: boolean;
68
- className?: string; /** Render the trigger at the smaller toolbar-chrome size. */
74
+ className?: string;
75
+ /** Render the trigger at the smaller toolbar-chrome size. */
69
76
  compact?: boolean;
70
77
  };
71
- declare function ZoomControl({
72
- value,
73
- onChange,
74
- levels,
75
- disabled,
76
- className,
77
- compact
78
- }: ZoomControlProps): import("react").JSX.Element;
78
+ declare function ZoomControl({ value, onChange, levels, disabled, className, compact }: ZoomControlProps): import("react").JSX.Element;
79
79
  //#endregion
80
80
  //#region src/hooks/useWheelZoom.d.ts
81
81
  /**
82
82
  * Options for useWheelZoom hook
83
83
  */
84
84
  type UseWheelZoomOptions = {
85
- /** Initial zoom level (default: 1.0) */initialZoom?: number; /** Minimum zoom level (default: 0.25) */
86
- minZoom?: number; /** Maximum zoom level (default: 4.0) */
87
- maxZoom?: number; /** Zoom step for each scroll event (default: 0.1) */
88
- zoomStep?: number; /** Whether zoom is enabled (default: true) */
89
- enabled?: boolean; /** Container element ref to attach wheel listener */
85
+ /** Initial zoom level (default: 1.0) */
86
+ initialZoom?: number;
87
+ /** Minimum zoom level (default: 0.25) */
88
+ minZoom?: number;
89
+ /** Maximum zoom level (default: 4.0) */
90
+ maxZoom?: number;
91
+ /** Zoom step for each scroll event (default: 0.1) */
92
+ zoomStep?: number;
93
+ /** Whether zoom is enabled (default: true) */
94
+ enabled?: boolean;
95
+ /** Container element ref to attach wheel listener */
90
96
  containerRef?: RefObject<HTMLElement | null>;
91
97
  /**
92
98
  * Live current zoom getter. When provided the hook runs controlled: it reads
@@ -94,26 +100,41 @@ type UseWheelZoomOptions = {
94
100
  * and only emits the next value through `onZoomChange`. Lets the hook compose
95
101
  * with an external zoom owner without a second, divergent source of truth.
96
102
  */
97
- getCurrentZoom?: () => number; /** Callback when zoom changes */
98
- onZoomChange?: (zoom: number) => void; /** Whether to enable keyboard shortcuts (Ctrl++, Ctrl+-, Ctrl+0) */
99
- enableKeyboardShortcuts?: boolean; /** Whether to prevent default browser zoom behavior */
103
+ getCurrentZoom?: () => number;
104
+ /** Callback when zoom changes */
105
+ onZoomChange?: (zoom: number) => void;
106
+ /** Whether to enable keyboard shortcuts (Ctrl++, Ctrl+-, Ctrl+0) */
107
+ enableKeyboardShortcuts?: boolean;
108
+ /** Whether to prevent default browser zoom behavior */
100
109
  preventDefault?: boolean;
101
110
  };
102
111
  /**
103
112
  * Return value of useWheelZoom hook
104
113
  */
105
114
  type UseWheelZoomReturn = {
106
- /** Current zoom level */zoom: number; /** Set zoom level directly */
107
- setZoom: (zoom: number) => void; /** Zoom in by step */
108
- zoomIn: () => void; /** Zoom out by step */
109
- zoomOut: () => void; /** Reset zoom to initial level */
110
- resetZoom: () => void; /** Reset zoom to 100% */
111
- zoomTo100: () => void; /** Zoom to fit width */
112
- zoomToFit: (containerWidth: number, contentWidth: number) => void; /** Whether currently at minimum zoom */
113
- isMinZoom: boolean; /** Whether currently at maximum zoom */
114
- isMaxZoom: boolean; /** Zoom percentage (e.g., 100 for zoom level 1.0) */
115
- zoomPercent: number; /** Wheel event handler (for manual attachment) */
116
- handleWheel: (event: WheelEvent) => void; /** Keyboard event handler (for manual attachment) */
115
+ /** Current zoom level */
116
+ zoom: number;
117
+ /** Set zoom level directly */
118
+ setZoom: (zoom: number) => void;
119
+ /** Zoom in by step */
120
+ zoomIn: () => void;
121
+ /** Zoom out by step */
122
+ zoomOut: () => void;
123
+ /** Reset zoom to initial level */
124
+ resetZoom: () => void;
125
+ /** Reset zoom to 100% */
126
+ zoomTo100: () => void;
127
+ /** Zoom to fit width */
128
+ zoomToFit: (containerWidth: number, contentWidth: number) => void;
129
+ /** Whether currently at minimum zoom */
130
+ isMinZoom: boolean;
131
+ /** Whether currently at maximum zoom */
132
+ isMaxZoom: boolean;
133
+ /** Zoom percentage (e.g., 100 for zoom level 1.0) */
134
+ zoomPercent: number;
135
+ /** Wheel event handler (for manual attachment) */
136
+ handleWheel: (event: WheelEvent) => void;
137
+ /** Keyboard event handler (for manual attachment) */
117
138
  handleKeyDown: (event: KeyboardEvent) => void;
118
139
  };
119
140
  /**
@@ -140,8 +161,11 @@ declare function clampZoom(zoom: number, minZoom?: number, maxZoom?: number): nu
140
161
  //#endregion
141
162
  //#region src/paged-editor/AutocompleteCaretOverlay.d.ts
142
163
  type AutocompleteCaretRect = {
143
- /** Container-relative pixel x. */x: number; /** Container-relative pixel y (top of the cursor line). */
144
- y: number; /** Line height in pixels at the anchor. */
164
+ /** Container-relative pixel x. */
165
+ x: number;
166
+ /** Container-relative pixel y (top of the cursor line). */
167
+ y: number;
168
+ /** Line height in pixels at the anchor. */
145
169
  lineHeight: number;
146
170
  /**
147
171
  * Available width from the caret to the page's right content margin,
@@ -157,14 +181,12 @@ type AutocompleteCaretOverlayProps = {
157
181
  * Position of the autocomplete anchor, projected into the
158
182
  * overlay's container space. `null` while idle.
159
183
  */
160
- caret: AutocompleteCaretRect | null; /** The full streamed ghost text so far. */
161
- text: string; /** Whether tokens are still arriving from the model. */
184
+ caret: AutocompleteCaretRect | null;
185
+ /** The full streamed ghost text so far. */
186
+ text: string;
187
+ /** Whether tokens are still arriving from the model. */
162
188
  isStreaming: boolean;
163
189
  };
164
- declare const AutocompleteCaretOverlay: ({
165
- caret,
166
- text,
167
- isStreaming
168
- }: AutocompleteCaretOverlayProps) => React.JSX.Element | null;
190
+ declare const AutocompleteCaretOverlay: ({ caret, text, isStreaming }: AutocompleteCaretOverlayProps) => React.JSX.Element | null;
169
191
  //#endregion
170
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 };