@stll/folio-react 0.31.0 → 0.32.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 { a as useDrawerFocus, s as containedHandler } from "./renderAsync-CXgKj7iM.js";
1
+ import { a as useDrawerFocus, s as containedHandler } from "./renderAsync-BQ1iwDIr.js";
2
2
  import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import { CheckIcon, MoreVerticalIcon } from "lucide-react";
4
4
  import { useLocale, useTranslations } from "use-intl";
@@ -1,5 +1,5 @@
1
- import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-CZ_bTgOh.js";
2
- import { ReactNode } from "react";
1
+ import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-POQXlmNh.js";
2
+ import { ForwardRefExoticComponent, JSX, ReactNode, RefAttributes } from "react";
3
3
  import { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
4
4
  //#region src/compat/eigenpal.d.ts
5
5
  export declare const VERSION = "folio-compat-eigenpal";
@@ -71,11 +71,11 @@ export declare const zhCN: {
71
71
  _lang: string;
72
72
  };
73
73
  export declare const locales: Record<LocaleCode, LegacyTranslations>;
74
- export declare const LocaleProvider: ({ children, i18n, locale }: LocaleProviderProps) => import("react").JSX.Element;
74
+ export declare const LocaleProvider: ({ children, i18n, locale }: LocaleProviderProps) => JSX.Element;
75
75
  export declare const useTranslation: () => {
76
76
  t: TFunction;
77
77
  };
78
- export declare const DocxEditor: import("react").ForwardRefExoticComponent<DocxEditorProps & {
78
+ export declare const DocxEditor: ForwardRefExoticComponent<DocxEditorProps & {
79
79
  agentPanel?: unknown;
80
80
  colorMode?: "light" | "dark" | "system";
81
81
  commentsSidebarOpen?: boolean;
@@ -104,6 +104,6 @@ export declare const DocxEditor: import("react").ForwardRefExoticComponent<DocxE
104
104
  showHelpMenu?: boolean;
105
105
  showOutlineButton?: boolean;
106
106
  watermarkPresets?: readonly string[];
107
- } & import("react").RefAttributes<DocxEditorRef>>;
107
+ } & RefAttributes<DocxEditorRef>>;
108
108
  //#endregion
109
109
  export { type CreateEmptyDocumentOptions, type DocxEditorHandle, type DocxEditorRef, type EditorHandle, type RenderAsyncOptions, createDocumentWithText, createEmptyDocument, renderAsync };
@@ -1,4 +1,4 @@
1
- import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-CXgKj7iM.js";
1
+ import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-BQ1iwDIr.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";
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties } from "react";
1
+ import React, { CSSProperties, JSX } from "react";
2
2
  import { EndnoteProperties, FootnoteProperties, SectionProperties } from "@stll/folio-core/types/document";
3
3
  import { FindMatch as FindMatch$1, FindOptions as FindOptions$1, FindResult as FindResult$1, ReplaceAllSummary } from "@stll/folio-core/utils/findReplace";
4
4
  import { TablePropertiesCommand } from "@stll/folio-core/utils/tableOperations";
@@ -56,7 +56,7 @@ type FootnotePropertiesDialogProps = {
56
56
  footnotePr?: FootnoteProperties;
57
57
  endnotePr?: EndnoteProperties;
58
58
  };
59
- declare function FootnotePropertiesDialog({ isOpen, onClose, onApply, footnotePr, endnotePr }: FootnotePropertiesDialogProps): import("react").JSX.Element;
59
+ declare function FootnotePropertiesDialog({ isOpen, onClose, onApply, footnotePr, endnotePr }: FootnotePropertiesDialogProps): JSX.Element;
60
60
  //#endregion
61
61
  //#region src/components/dialogs/HyperlinkDialog.d.ts
62
62
  type HyperlinkBookmarkOption = {
@@ -77,17 +77,9 @@ type HyperlinkDialogProps = {
77
77
  selectedText?: string;
78
78
  bookmarks?: readonly HyperlinkBookmarkOption[];
79
79
  };
80
- declare function HyperlinkDialog(props: HyperlinkDialogProps): import("react").JSX.Element | null;
80
+ declare function HyperlinkDialog(props: HyperlinkDialogProps): JSX.Element | null;
81
81
  //#endregion
82
82
  //#region src/components/dialogs/ImagePositionDialog.d.ts
83
- /**
84
- * Image Position Dialog
85
- *
86
- * Modal for editing image positioning settings:
87
- * - Horizontal: alignment or offset, relative to page/column/margin/paragraph
88
- * - Vertical: alignment or offset, relative to page/margin/paragraph/line
89
- * - Distance from text (top/bottom/left/right)
90
- */
91
83
  type ImagePositionData = {
92
84
  horizontal?: {
93
85
  relativeTo?: string;
@@ -110,16 +102,9 @@ type ImagePositionDialogProps = {
110
102
  onApply: (data: ImagePositionData) => void;
111
103
  currentData?: ImagePositionData;
112
104
  };
113
- declare function ImagePositionDialog(props: ImagePositionDialogProps): import("react").JSX.Element | null;
105
+ declare function ImagePositionDialog(props: ImagePositionDialogProps): JSX.Element | null;
114
106
  //#endregion
115
107
  //#region src/components/dialogs/ImagePropertiesDialog.d.ts
116
- /**
117
- * Image Properties Dialog
118
- *
119
- * Modal for editing image properties:
120
- * - Alt text for accessibility
121
- * - Border/outline style, color, and width
122
- */
123
108
  type ImagePropertiesData = {
124
109
  alt?: string;
125
110
  borderWidth?: number;
@@ -132,7 +117,7 @@ type ImagePropertiesDialogProps = {
132
117
  onApply: (data: ImagePropertiesData) => void;
133
118
  currentData?: ImagePropertiesData;
134
119
  };
135
- declare function ImagePropertiesDialog(props: ImagePropertiesDialogProps): import("react").JSX.Element | null;
120
+ declare function ImagePropertiesDialog(props: ImagePropertiesDialogProps): JSX.Element | null;
136
121
  //#endregion
137
122
  //#region src/components/dialogs/InsertImageDialog.d.ts
138
123
  type InsertImageDialogData = {
@@ -147,7 +132,7 @@ type InsertImageDialogProps = {
147
132
  onInsert: (data: InsertImageDialogData) => void;
148
133
  accept?: string;
149
134
  };
150
- declare function InsertImageDialog(props: InsertImageDialogProps): import("react").JSX.Element | null;
135
+ declare function InsertImageDialog(props: InsertImageDialogProps): JSX.Element | null;
151
136
  //#endregion
152
137
  //#region src/components/dialogs/InsertSymbolDialog.d.ts
153
138
  type InsertSymbolDialogProps = {
@@ -155,7 +140,7 @@ type InsertSymbolDialogProps = {
155
140
  onClose: () => void;
156
141
  onInsert: (symbol: string) => void;
157
142
  };
158
- declare function InsertSymbolDialog({ isOpen, onClose, onInsert }: InsertSymbolDialogProps): import("react").JSX.Element;
143
+ declare function InsertSymbolDialog({ isOpen, onClose, onInsert }: InsertSymbolDialogProps): JSX.Element;
159
144
  //#endregion
160
145
  //#region src/components/dialogs/InsertTableDialog.d.ts
161
146
  type InsertTableDialogData = {
@@ -176,7 +161,7 @@ type InsertTableDialogProps = {
176
161
  defaultColumns?: number;
177
162
  styleOptions?: readonly InsertTableStyleOption[];
178
163
  };
179
- declare function InsertTableDialog(props: InsertTableDialogProps): import("react").JSX.Element | null;
164
+ declare function InsertTableDialog(props: InsertTableDialogProps): JSX.Element | null;
180
165
  //#endregion
181
166
  //#region src/components/dialogs/PageSetupDialog.d.ts
182
167
  type PageSetupDialogProps = {
@@ -185,7 +170,7 @@ type PageSetupDialogProps = {
185
170
  onApply: (props: Partial<SectionProperties>) => void;
186
171
  currentProps?: SectionProperties;
187
172
  };
188
- declare function PageSetupDialog(props: PageSetupDialogProps): import("react").JSX.Element | null;
173
+ declare function PageSetupDialog(props: PageSetupDialogProps): JSX.Element | null;
189
174
  //#endregion
190
175
  //#region src/components/dialogs/PasteSpecialDialog.d.ts
191
176
  type PasteSpecialMode = "keepFormatting" | "mergeFormatting" | "plainText";
@@ -195,7 +180,7 @@ type PasteSpecialDialogProps = {
195
180
  onPaste: (mode: PasteSpecialMode) => void;
196
181
  defaultMode?: PasteSpecialMode;
197
182
  };
198
- declare function PasteSpecialDialog(props: PasteSpecialDialogProps): import("react").JSX.Element | null;
183
+ declare function PasteSpecialDialog(props: PasteSpecialDialogProps): JSX.Element | null;
199
184
  //#endregion
200
185
  //#region src/components/dialogs/SplitCellDialog.d.ts
201
186
  type SplitCellDialogData = {
@@ -210,7 +195,7 @@ type SplitCellDialogProps = {
210
195
  defaultRows?: number;
211
196
  defaultColumns?: number;
212
197
  };
213
- declare function SplitCellDialog(props: SplitCellDialogProps): import("react").JSX.Element | null;
198
+ declare function SplitCellDialog(props: SplitCellDialogProps): JSX.Element | null;
214
199
  //#endregion
215
200
  //#region src/components/dialogs/TablePropertiesDialog.d.ts
216
201
  type TableProperties = TablePropertiesCommand;
@@ -220,7 +205,7 @@ type TablePropertiesDialogProps = {
220
205
  onApply: (props: TableProperties) => void;
221
206
  currentProps?: TableProperties;
222
207
  };
223
- declare function TablePropertiesDialog(props: TablePropertiesDialogProps): import("react").JSX.Element | null;
208
+ declare function TablePropertiesDialog(props: TablePropertiesDialogProps): JSX.Element | null;
224
209
  //#endregion
225
210
  //#region src/components/dialogs/WatermarkDialog.d.ts
226
211
  type WatermarkDialogProps = {
@@ -229,6 +214,6 @@ type WatermarkDialogProps = {
229
214
  onApply: (watermark: Watermark | undefined) => void;
230
215
  currentWatermark?: Watermark;
231
216
  };
232
- declare function WatermarkDialog(props: WatermarkDialogProps): import("react").JSX.Element | null;
217
+ declare function WatermarkDialog(props: WatermarkDialogProps): JSX.Element | null;
233
218
  //#endregion
234
219
  export { HyperlinkDialog as A, ImagePropertiesData as C, ImagePositionDialog as D, ImagePositionData as E, FindReplaceDialog as F, FindReplaceDialogProps as I, HyperlinkDialogProps as M, FootnotePropertiesDialog as N, ImagePositionDialogProps as O, FootnotePropertiesDialogProps as P, InsertImageDialogProps as S, ImagePropertiesDialogProps as T, InsertTableStyleOption as _, TablePropertiesDialogProps as a, InsertImageDialog as b, SplitCellDialogProps as c, PasteSpecialMode as d, PageSetupDialog as f, InsertTableDialogProps as g, InsertTableDialogData as h, TablePropertiesDialog as i, HyperlinkDialogData as j, HyperlinkBookmarkOption as k, PasteSpecialDialog as l, InsertTableDialog as m, WatermarkDialogProps as n, SplitCellDialog as o, PageSetupDialogProps as p, TableProperties as r, SplitCellDialogData as s, WatermarkDialog as t, PasteSpecialDialogProps as u, InsertSymbolDialog as v, ImagePropertiesDialog as w, InsertImageDialogData as x, InsertSymbolDialogProps as y };
package/dist/dialogs.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- 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-CMAVdDEV.js";
1
+ 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-DGa8PuE4.js";
2
2
  export { FindReplaceDialog, type FindReplaceDialogProps, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, WatermarkDialog, type WatermarkDialogProps };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as FolioUIProvider, a as DocxEditorApplyDocumentOperationsOptions, c as DocxEditorRef, d as ToolbarProps, f as FontOption, g as FolioUIComponents, h as FolioButtonProps, i as renderAsync, l as HighlightPassageOptions, m as ColorPreset, n as EditorHandle, o as DocxEditorCollaboration, p as EditorMode, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageResult, v as OutlineItem, y as FontDefinition } from "./renderAsync-CZ_bTgOh.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-CMAVdDEV.js";
3
- import React, { CSSProperties, ReactNode, RefObject } from "react";
1
+ import { _ as FolioUIProvider, a as DocxEditorApplyDocumentOperationsOptions, c as DocxEditorRef, d as ToolbarProps, f as FontOption, g as FolioUIComponents, h as FolioButtonProps, i as renderAsync, l as HighlightPassageOptions, m as ColorPreset, n as EditorHandle, o as DocxEditorCollaboration, p as EditorMode, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageResult, v as OutlineItem, y as FontDefinition } from "./renderAsync-POQXlmNh.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-DGa8PuE4.js";
3
+ import React, { CSSProperties, ForwardRefExoticComponent, JSX, ReactNode, RefAttributes, 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";
6
6
  import { DocxCompatibility } from "@stll/folio-core/docx/compatibility";
@@ -38,7 +38,7 @@ import { ImageMeta, ImageRef, MarkdownOptions, MarkdownResult, fromMarkdown, toM
38
38
  /**
39
39
  * DocxEditor - Complete DOCX editor component
40
40
  */
41
- export declare const DocxEditor: import("react").ForwardRefExoticComponent<DocxEditorProps & import("react").RefAttributes<DocxEditorRef>>;
41
+ export declare const DocxEditor: ForwardRefExoticComponent<DocxEditorProps & RefAttributes<DocxEditorRef>>;
42
42
  //#endregion
43
43
  //#region src/components/FormattingBar.d.ts
44
44
  type FormattingBarProps = {
@@ -58,15 +58,6 @@ type FormattingBarProps = {
58
58
  export declare function FormattingBar(props: FormattingBarProps): React.JSX.Element;
59
59
  //#endregion
60
60
  //#region src/components/ui/ZoomControl.d.ts
61
- /**
62
- * Zoom Control
63
- *
64
- * A compact dropdown for choosing the editor's document zoom level. Renders the
65
- * injectable folio Select primitive (so a consumer's design-system Select can
66
- * override it), mirroring FontSizePicker. Opt-in: folio chrome renders this only
67
- * when both a zoom value and an onChange handler are supplied (see
68
- * FormattingBar).
69
- */
70
61
  type ZoomLevel = {
71
62
  value: number;
72
63
  label: string;
@@ -83,7 +74,7 @@ type ZoomControlProps = {
83
74
  /** Render the trigger at the smaller toolbar-chrome size. */
84
75
  compact?: boolean;
85
76
  };
86
- export declare function ZoomControl({ value, onChange, levels, disabled, className, compact }: ZoomControlProps): import("react").JSX.Element;
77
+ export declare function ZoomControl({ value, onChange, levels, disabled, className, compact }: ZoomControlProps): JSX.Element;
87
78
  //#endregion
88
79
  //#region src/hooks/useWheelZoom.d.ts
89
80
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as ZOOM_PRESETS, d as parseZoom, f as useWheelZoom, i as ZoomControl, l as clampZoom, n as DocxEditor, o as AutocompleteCaretOverlay, r as FormattingBar, t as renderAsync, u as formatZoom } from "./renderAsync-CXgKj7iM.js";
1
+ import { c as ZOOM_PRESETS, d as parseZoom, f as useWheelZoom, i as ZoomControl, l as clampZoom, n as DocxEditor, o as AutocompleteCaretOverlay, r as FormattingBar, t as renderAsync, u as formatZoom } from "./renderAsync-BQ1iwDIr.js";
2
2
  import { n as FolioUIProvider } from "./folio-ui-ruRywxeb.js";
3
3
  import { t as FindReplaceDialog } from "./FindReplaceDialog-C3njN6OI.js";
4
4
  import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-BEs7N62_.js";