@pixerate/editor-react 0.39.0 → 0.41.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.
- package/dist/canvas/index.cjs +516 -312
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +142 -6
- package/dist/canvas/index.d.ts +142 -6
- package/dist/canvas/index.js +203 -0
- package/dist/canvas/index.js.map +1 -1
- package/dist/chart/index.cjs +60 -6
- package/dist/chart/index.cjs.map +1 -1
- package/dist/chart/index.js +1 -1
- package/dist/{chunk-IYHD5Q65.js → chunk-SIEOYRHX.js} +68 -7
- package/dist/chunk-SIEOYRHX.js.map +1 -0
- package/dist/index.cjs +499 -418
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +53 -27
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-IYHD5Q65.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { UseEditorOptions, EditorContentProps as EditorContentProps$1 } from '@t
|
|
|
6
6
|
import { HistoryManager as HistoryManager$1 } from '@pixerate/editor/history';
|
|
7
7
|
import { DocxExportState, DocxExportReport, DocxExportController, DocxExportControllerOptions } from '@pixerate/editor/export';
|
|
8
8
|
import React__default from 'react';
|
|
9
|
-
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/tools';
|
|
9
|
+
import { ToolRegistry, AgentToolProvider, ToolBridgeStatus, ConnectToolBridgeOptions } from '@pixerate/editor/tools';
|
|
10
10
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
11
11
|
export { FormulaHints, FormulaHintsProps, NameManager, NameManagerProps, SheetTabs, SheetTabsProps, SpreadsheetConditionalFormatPanel, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetDataValidationPanel, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, SpreadsheetRulePanelProps, SpreadsheetValidationDialog, SpreadsheetValidationDialogProps, SpreadsheetViewportOptions, SpreadsheetViewportState, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor, useSpreadsheetViewport } from './spreadsheet/index.cjs';
|
|
12
12
|
export { AdjustmentLayersPanel, AdjustmentLayersPanelProps, ControlSlider, ControlSliderProps, CurvesEditor, CurvesEditorProps, Histogram, HistogramProps, ImageEditor, ImageEditorProps, RefineEdgePanel, RefineEdgePanelProps, SelectionOptionsBar, SelectionOptionsBarProps, UseImageEditorReturn, useImageEditor, useImageHistogram } from './image-editor/index.cjs';
|
|
@@ -282,6 +282,20 @@ declare const ExportDocxButton: React__default.FC<ExportDocxButtonProps>;
|
|
|
282
282
|
*/
|
|
283
283
|
declare function useAgentToolProvider(registry: ToolRegistry | null | undefined, provider: AgentToolProvider | null | undefined): void;
|
|
284
284
|
|
|
285
|
+
interface UseToolBridgeResult {
|
|
286
|
+
status: ToolBridgeStatus | "off";
|
|
287
|
+
/** Why the last connection ended (e.g. "Bad token"), when the bridge said. */
|
|
288
|
+
detail?: string;
|
|
289
|
+
/** The id the bridge gave this editor (`list_editors`). */
|
|
290
|
+
editorId: string | null;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Connects a `ToolRegistry` to a local MCP bridge (`pixerate-mcp-bridge`) while mounted, so an
|
|
294
|
+
* MCP client can call the page's tools. Pass `null` options to stay disconnected. Memoize the
|
|
295
|
+
* options: changing `url`, `token` or `name` reconnects.
|
|
296
|
+
*/
|
|
297
|
+
declare function useToolBridge(registry: ToolRegistry | null | undefined, options: ConnectToolBridgeOptions | null): UseToolBridgeResult;
|
|
298
|
+
|
|
285
299
|
interface EditorContentProps extends EditorContentProps$1 {
|
|
286
300
|
className?: string;
|
|
287
301
|
}
|
|
@@ -782,4 +796,4 @@ interface ReactChartNodeViewOptions extends Omit<ChartNodeViewProps, 'state'> {
|
|
|
782
796
|
*/
|
|
783
797
|
declare function createReactChartNodeView(options?: ReactChartNodeViewOptions): ChartNodeViewMount;
|
|
784
798
|
|
|
785
|
-
export { BubbleMenu, type BubbleMenuProps, ChartNodeView, type ChartNodeViewProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, ExportDocxButton, type ExportDocxButtonProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, InsertTableGrid, type InsertTableGridProps, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, type ReactChartNodeViewOptions, ReviewToolbar, type ReviewToolbarProps, StylesGallery, type StylesGalleryProps, TableBubbleMenu, type TableBubbleMenuProps, TableToolbar, type TableToolbarProps, TemplateRenderer, type TemplateRendererProps, TrackedChangesList, type TrackedChangesListProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseDocxExportResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UseParagraphStylesResult, type UsePromptEditorProps, type UseRichEditorProps, type UseTableMenuResult, type UseTrackChangesResult, VariableForm, type VariableFormProps, createReactChartNodeView, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useDocxExport, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, useParagraphStyles, usePromptEditor, useTableMenu, useTrackChanges };
|
|
799
|
+
export { BubbleMenu, type BubbleMenuProps, ChartNodeView, type ChartNodeViewProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, ExportDocxButton, type ExportDocxButtonProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, InsertTableGrid, type InsertTableGridProps, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, type ReactChartNodeViewOptions, ReviewToolbar, type ReviewToolbarProps, StylesGallery, type StylesGalleryProps, TableBubbleMenu, type TableBubbleMenuProps, TableToolbar, type TableToolbarProps, TemplateRenderer, type TemplateRendererProps, TrackedChangesList, type TrackedChangesListProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseDocxExportResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UseParagraphStylesResult, type UsePromptEditorProps, type UseRichEditorProps, type UseTableMenuResult, type UseToolBridgeResult, type UseTrackChangesResult, VariableForm, type VariableFormProps, createReactChartNodeView, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useDocxExport, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, useParagraphStyles, usePromptEditor, useTableMenu, useToolBridge, useTrackChanges };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { UseEditorOptions, EditorContentProps as EditorContentProps$1 } from '@t
|
|
|
6
6
|
import { HistoryManager as HistoryManager$1 } from '@pixerate/editor/history';
|
|
7
7
|
import { DocxExportState, DocxExportReport, DocxExportController, DocxExportControllerOptions } from '@pixerate/editor/export';
|
|
8
8
|
import React__default from 'react';
|
|
9
|
-
import { ToolRegistry, AgentToolProvider } from '@pixerate/editor/tools';
|
|
9
|
+
import { ToolRegistry, AgentToolProvider, ToolBridgeStatus, ConnectToolBridgeOptions } from '@pixerate/editor/tools';
|
|
10
10
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
11
11
|
export { FormulaHints, FormulaHintsProps, NameManager, NameManagerProps, SheetTabs, SheetTabsProps, SpreadsheetConditionalFormatPanel, SpreadsheetContextMenu, SpreadsheetContextMenuProps, SpreadsheetDataValidationPanel, SpreadsheetEditor, SpreadsheetEditorProps, SpreadsheetGroupRow, SpreadsheetGroupRowProps, SpreadsheetRulePanelProps, SpreadsheetValidationDialog, SpreadsheetValidationDialogProps, SpreadsheetViewportOptions, SpreadsheetViewportState, useFillHandle, useSpreadsheetClipboard, useSpreadsheetEditor, useSpreadsheetViewport } from './spreadsheet/index.js';
|
|
12
12
|
export { AdjustmentLayersPanel, AdjustmentLayersPanelProps, ControlSlider, ControlSliderProps, CurvesEditor, CurvesEditorProps, Histogram, HistogramProps, ImageEditor, ImageEditorProps, RefineEdgePanel, RefineEdgePanelProps, SelectionOptionsBar, SelectionOptionsBarProps, UseImageEditorReturn, useImageEditor, useImageHistogram } from './image-editor/index.js';
|
|
@@ -282,6 +282,20 @@ declare const ExportDocxButton: React__default.FC<ExportDocxButtonProps>;
|
|
|
282
282
|
*/
|
|
283
283
|
declare function useAgentToolProvider(registry: ToolRegistry | null | undefined, provider: AgentToolProvider | null | undefined): void;
|
|
284
284
|
|
|
285
|
+
interface UseToolBridgeResult {
|
|
286
|
+
status: ToolBridgeStatus | "off";
|
|
287
|
+
/** Why the last connection ended (e.g. "Bad token"), when the bridge said. */
|
|
288
|
+
detail?: string;
|
|
289
|
+
/** The id the bridge gave this editor (`list_editors`). */
|
|
290
|
+
editorId: string | null;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Connects a `ToolRegistry` to a local MCP bridge (`pixerate-mcp-bridge`) while mounted, so an
|
|
294
|
+
* MCP client can call the page's tools. Pass `null` options to stay disconnected. Memoize the
|
|
295
|
+
* options: changing `url`, `token` or `name` reconnects.
|
|
296
|
+
*/
|
|
297
|
+
declare function useToolBridge(registry: ToolRegistry | null | undefined, options: ConnectToolBridgeOptions | null): UseToolBridgeResult;
|
|
298
|
+
|
|
285
299
|
interface EditorContentProps extends EditorContentProps$1 {
|
|
286
300
|
className?: string;
|
|
287
301
|
}
|
|
@@ -782,4 +796,4 @@ interface ReactChartNodeViewOptions extends Omit<ChartNodeViewProps, 'state'> {
|
|
|
782
796
|
*/
|
|
783
797
|
declare function createReactChartNodeView(options?: ReactChartNodeViewOptions): ChartNodeViewMount;
|
|
784
798
|
|
|
785
|
-
export { BubbleMenu, type BubbleMenuProps, ChartNodeView, type ChartNodeViewProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, ExportDocxButton, type ExportDocxButtonProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, InsertTableGrid, type InsertTableGridProps, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, type ReactChartNodeViewOptions, ReviewToolbar, type ReviewToolbarProps, StylesGallery, type StylesGalleryProps, TableBubbleMenu, type TableBubbleMenuProps, TableToolbar, type TableToolbarProps, TemplateRenderer, type TemplateRendererProps, TrackedChangesList, type TrackedChangesListProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseDocxExportResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UseParagraphStylesResult, type UsePromptEditorProps, type UseRichEditorProps, type UseTableMenuResult, type UseTrackChangesResult, VariableForm, type VariableFormProps, createReactChartNodeView, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useDocxExport, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, useParagraphStyles, usePromptEditor, useTableMenu, useTrackChanges };
|
|
799
|
+
export { BubbleMenu, type BubbleMenuProps, ChartNodeView, type ChartNodeViewProps, CommentButton, type CommentButtonProps, CommentsPanel, type CommentsPanelProps, EditorContent, type EditorContentProps, EditorSlotsProvider, type EditorSlotsProviderProps, ExportDocxButton, type ExportDocxButtonProps, FindReplaceBar, type FindReplaceBarProps, type HistoryShortcutsOptions, InsertTableGrid, type InsertTableGridProps, MergePreview, type MergePreviewProps, type MergePreviewState, OutlinePanel, type OutlinePanelProps, type ReactChartNodeViewOptions, ReviewToolbar, type ReviewToolbarProps, StylesGallery, type StylesGalleryProps, TableBubbleMenu, type TableBubbleMenuProps, TableToolbar, type TableToolbarProps, TemplateRenderer, type TemplateRendererProps, TrackedChangesList, type TrackedChangesListProps, type UseCommentsResult, type UseDismissGuardOptions, type UseDismissGuardReturn, type UseDocumentCompareResult, type UseDocxExportResult, type UseFileImportResult, type UseFindReplaceResult, type UseHistoryDirtyOptions, type UseHistoryDirtyResult, type UseHistoryResult, type UseMergePreviewOptions, type UseNavigationGuardOptions, type UseNavigationGuardReturn, type UseParagraphStylesResult, type UsePromptEditorProps, type UseRichEditorProps, type UseTableMenuResult, type UseToolBridgeResult, type UseTrackChangesResult, VariableForm, type VariableFormProps, createReactChartNodeView, useAgentToolProvider, useComments, useDismissGuard, useDocumentCompare, useDocxExport, useEditor, useEditorSlots, useFileImport, useFindReplace, useHistory, useHistoryDirty, useHistoryShortcuts, useMergePreview, useNavigationGuard, useOutline, useParagraphStyles, usePromptEditor, useTableMenu, useToolBridge, useTrackChanges };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ChartDataGrid,
|
|
4
4
|
ChartInspector,
|
|
5
5
|
chartButtonClass
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SIEOYRHX.js";
|
|
7
7
|
import {
|
|
8
8
|
FormulaHints,
|
|
9
9
|
NameManager,
|
|
@@ -682,6 +682,31 @@ function useAgentToolProvider(registry, provider) {
|
|
|
682
682
|
}, [registry, provider]);
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
+
// src/hooks/useToolBridge.ts
|
|
686
|
+
import { useEffect as useEffect8, useState as useState4 } from "react";
|
|
687
|
+
import { connectToolBridge } from "@pixerate/editor/tools";
|
|
688
|
+
function useToolBridge(registry, options) {
|
|
689
|
+
const [state, setState] = useState4({ status: "off", editorId: null });
|
|
690
|
+
const key = options ? JSON.stringify([options.url, options.token, options.name, options.kind, options.reconnect]) : null;
|
|
691
|
+
useEffect8(() => {
|
|
692
|
+
if (!registry || !options) {
|
|
693
|
+
setState({ status: "off", editorId: null });
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
let connection;
|
|
697
|
+
connection = connectToolBridge(registry, {
|
|
698
|
+
...options,
|
|
699
|
+
onStatus: (status, detail) => {
|
|
700
|
+
setState({ status, detail, editorId: connection?.editorId ?? null });
|
|
701
|
+
options.onStatus?.(status, detail);
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
setState({ status: connection.status, editorId: null });
|
|
705
|
+
return () => connection?.close();
|
|
706
|
+
}, [registry, key]);
|
|
707
|
+
return state;
|
|
708
|
+
}
|
|
709
|
+
|
|
685
710
|
// src/components/EditorContent.tsx
|
|
686
711
|
import {
|
|
687
712
|
EditorContent as TipTapEditorContent
|
|
@@ -696,7 +721,7 @@ var EditorContent = ({
|
|
|
696
721
|
};
|
|
697
722
|
|
|
698
723
|
// src/components/BubbleMenu.tsx
|
|
699
|
-
import { useEffect as
|
|
724
|
+
import { useEffect as useEffect9, useRef as useRef8, useState as useState5 } from "react";
|
|
700
725
|
import { createPortal } from "react-dom";
|
|
701
726
|
import {
|
|
702
727
|
BubbleMenuPlugin
|
|
@@ -711,11 +736,11 @@ var BubbleMenu = ({
|
|
|
711
736
|
updateDelay
|
|
712
737
|
}) => {
|
|
713
738
|
const menuEl = useRef8(null);
|
|
714
|
-
const [mounted, setMounted] =
|
|
739
|
+
const [mounted, setMounted] = useState5(false);
|
|
715
740
|
if (!menuEl.current && typeof document !== "undefined") {
|
|
716
741
|
menuEl.current = document.createElement("div");
|
|
717
742
|
}
|
|
718
|
-
|
|
743
|
+
useEffect9(() => {
|
|
719
744
|
if (!editor || !menuEl.current || editor.isDestroyed) {
|
|
720
745
|
return;
|
|
721
746
|
}
|
|
@@ -858,7 +883,7 @@ var TemplateRenderer = ({
|
|
|
858
883
|
};
|
|
859
884
|
|
|
860
885
|
// src/components/VariableForm.tsx
|
|
861
|
-
import { useId, useMemo as useMemo6, useState as
|
|
886
|
+
import { useId, useMemo as useMemo6, useState as useState6 } from "react";
|
|
862
887
|
import {
|
|
863
888
|
compactVariableValues,
|
|
864
889
|
getVariableFormFields
|
|
@@ -874,7 +899,7 @@ var VariableForm = ({
|
|
|
874
899
|
className = "flex flex-col gap-3 text-sm"
|
|
875
900
|
}) => {
|
|
876
901
|
const idPrefix = useId();
|
|
877
|
-
const [internal, setInternal] =
|
|
902
|
+
const [internal, setInternal] = useState6(
|
|
878
903
|
() => defaultValues ?? {}
|
|
879
904
|
);
|
|
880
905
|
const entered = values ?? internal;
|
|
@@ -946,10 +971,10 @@ var VariableForm = ({
|
|
|
946
971
|
};
|
|
947
972
|
|
|
948
973
|
// src/components/MergePreview.tsx
|
|
949
|
-
import { useId as useId2, useState as
|
|
974
|
+
import { useId as useId2, useState as useState8 } from "react";
|
|
950
975
|
|
|
951
976
|
// src/hooks/useMergePreview.ts
|
|
952
|
-
import { useCallback as useCallback5, useMemo as useMemo7, useState as
|
|
977
|
+
import { useCallback as useCallback5, useMemo as useMemo7, useState as useState7 } from "react";
|
|
953
978
|
import {
|
|
954
979
|
extractVariables,
|
|
955
980
|
matchFields,
|
|
@@ -960,10 +985,10 @@ import {
|
|
|
960
985
|
} from "@pixerate/editor";
|
|
961
986
|
function useMergePreview(options) {
|
|
962
987
|
const { template, templates, bindings, parseOptions } = options;
|
|
963
|
-
const [sourceText, setSourceTextState] =
|
|
964
|
-
const [overrides, setOverrides] =
|
|
965
|
-
const [index, setIndexState] =
|
|
966
|
-
const [result, setResult] =
|
|
988
|
+
const [sourceText, setSourceTextState] = useState7(options.initialSource ?? "");
|
|
989
|
+
const [overrides, setOverrides] = useState7({});
|
|
990
|
+
const [index, setIndexState] = useState7(0);
|
|
991
|
+
const [result, setResult] = useState7(null);
|
|
967
992
|
const source = useMemo7(
|
|
968
993
|
() => parseDataSource(sourceText, parseOptions),
|
|
969
994
|
[sourceText, parseOptions]
|
|
@@ -1084,7 +1109,7 @@ var MergePreview = ({
|
|
|
1084
1109
|
separator,
|
|
1085
1110
|
maxOutputs
|
|
1086
1111
|
});
|
|
1087
|
-
const [copied, setCopied] =
|
|
1112
|
+
const [copied, setCopied] = useState8(false);
|
|
1088
1113
|
const { source, result } = merge;
|
|
1089
1114
|
const copy = async () => {
|
|
1090
1115
|
try {
|
|
@@ -1321,7 +1346,7 @@ function useParagraphStyles(editor) {
|
|
|
1321
1346
|
}
|
|
1322
1347
|
|
|
1323
1348
|
// src/components/StylesGallery.tsx
|
|
1324
|
-
import { useState as
|
|
1349
|
+
import { useState as useState9 } from "react";
|
|
1325
1350
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1326
1351
|
var camel = (property) => property.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
1327
1352
|
var keepSelection = (event) => event.preventDefault();
|
|
@@ -1337,9 +1362,9 @@ var StylesGallery = ({
|
|
|
1337
1362
|
onChange
|
|
1338
1363
|
}) => {
|
|
1339
1364
|
const styles = useParagraphStyles(editor);
|
|
1340
|
-
const [open, setOpen] =
|
|
1341
|
-
const [creating, setCreating] =
|
|
1342
|
-
const [name, setName] =
|
|
1365
|
+
const [open, setOpen] = useState9(false);
|
|
1366
|
+
const [creating, setCreating] = useState9(false);
|
|
1367
|
+
const [name, setName] = useState9("");
|
|
1343
1368
|
const list = showAllStyles ? styles.styles : styles.gallery;
|
|
1344
1369
|
const current = styles.currentStyle;
|
|
1345
1370
|
const expanded = variant === "gallery" || open;
|
|
@@ -1556,7 +1581,7 @@ function useTrackChanges(editor) {
|
|
|
1556
1581
|
}
|
|
1557
1582
|
|
|
1558
1583
|
// src/review/CommentsPanel.tsx
|
|
1559
|
-
import { useState as
|
|
1584
|
+
import { useState as useState10 } from "react";
|
|
1560
1585
|
import {
|
|
1561
1586
|
formatReviewTime,
|
|
1562
1587
|
getCommentAuthor
|
|
@@ -1575,7 +1600,7 @@ var CommentsPanel = ({
|
|
|
1575
1600
|
emptyMessage = "No comments yet. Select text and add a comment."
|
|
1576
1601
|
}) => {
|
|
1577
1602
|
const { threads, activeThreadId, store } = useComments(storeProp ?? editor);
|
|
1578
|
-
const [showResolved, setShowResolved] =
|
|
1603
|
+
const [showResolved, setShowResolved] = useState10(showResolvedInitial);
|
|
1579
1604
|
const author = authorProp ?? getCommentAuthor(editor) ?? { id: "anonymous", name: "Anonymous" };
|
|
1580
1605
|
const visible = threads.filter((t) => showResolved || !t.resolved);
|
|
1581
1606
|
const resolvedCount = threads.filter((t) => t.resolved).length;
|
|
@@ -1619,7 +1644,7 @@ var CommentThreadCard = ({
|
|
|
1619
1644
|
author,
|
|
1620
1645
|
formatTime
|
|
1621
1646
|
}) => {
|
|
1622
|
-
const [draft, setDraft] =
|
|
1647
|
+
const [draft, setDraft] = useState10("");
|
|
1623
1648
|
const isDraft = thread.body === "";
|
|
1624
1649
|
const quote = thread.anchor?.quote ?? thread.lastQuote ?? "";
|
|
1625
1650
|
const live = editor && !editor.isDestroyed ? editor : null;
|
|
@@ -1833,12 +1858,12 @@ var CommentButton = ({
|
|
|
1833
1858
|
);
|
|
1834
1859
|
|
|
1835
1860
|
// src/review/useDocumentCompare.ts
|
|
1836
|
-
import { useCallback as useCallback7, useMemo as useMemo12, useRef as useRef9, useState as
|
|
1861
|
+
import { useCallback as useCallback7, useMemo as useMemo12, useRef as useRef9, useState as useState11 } from "react";
|
|
1837
1862
|
import {
|
|
1838
1863
|
applyDocumentComparison
|
|
1839
1864
|
} from "@pixerate/editor";
|
|
1840
1865
|
function useDocumentCompare(editor, options) {
|
|
1841
|
-
const [summary, setSummary] =
|
|
1866
|
+
const [summary, setSummary] = useState11(null);
|
|
1842
1867
|
const defaults = useRef9(options);
|
|
1843
1868
|
defaults.current = options;
|
|
1844
1869
|
const compare = useCallback7(
|
|
@@ -1944,7 +1969,7 @@ function useFindReplace(editor) {
|
|
|
1944
1969
|
}
|
|
1945
1970
|
|
|
1946
1971
|
// src/find-replace/FindReplaceBar.tsx
|
|
1947
|
-
import { useEffect as
|
|
1972
|
+
import { useEffect as useEffect10, useRef as useRef10, useState as useState12 } from "react";
|
|
1948
1973
|
import { FIND_OPTION_TOGGLES, formatFindStatus } from "@pixerate/editor";
|
|
1949
1974
|
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1950
1975
|
var inputClass = "min-w-0 flex-1 rounded border border-input bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring";
|
|
@@ -1960,9 +1985,9 @@ var FindReplaceBar = ({
|
|
|
1960
1985
|
}) => {
|
|
1961
1986
|
const find = useFindReplace(editor);
|
|
1962
1987
|
const findInput = useRef10(null);
|
|
1963
|
-
const [moreOpen, setMoreOpen] =
|
|
1988
|
+
const [moreOpen, setMoreOpen] = useState12(false);
|
|
1964
1989
|
const visible = find.available && (alwaysOpen || find.open);
|
|
1965
|
-
|
|
1990
|
+
useEffect10(() => {
|
|
1966
1991
|
if (!visible || find.focusRequest === 0) return;
|
|
1967
1992
|
findInput.current?.focus();
|
|
1968
1993
|
findInput.current?.select();
|
|
@@ -2171,7 +2196,7 @@ var TableToolbar = ({
|
|
|
2171
2196
|
};
|
|
2172
2197
|
|
|
2173
2198
|
// src/tables/InsertTableGrid.tsx
|
|
2174
|
-
import { useState as
|
|
2199
|
+
import { useState as useState13 } from "react";
|
|
2175
2200
|
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2176
2201
|
var keepSelection3 = (event) => event.preventDefault();
|
|
2177
2202
|
var InsertTableGrid = ({
|
|
@@ -2185,7 +2210,7 @@ var InsertTableGrid = ({
|
|
|
2185
2210
|
onInsert
|
|
2186
2211
|
}) => {
|
|
2187
2212
|
const table = useTableMenu(editor);
|
|
2188
|
-
const [hover, setHover] =
|
|
2213
|
+
const [hover, setHover] = useState13(null);
|
|
2189
2214
|
const status = table.actions.insertTable;
|
|
2190
2215
|
const disabled = !editor || !status.enabled;
|
|
2191
2216
|
const insert = (size) => {
|
|
@@ -2399,6 +2424,7 @@ export {
|
|
|
2399
2424
|
useSpreadsheetEditor,
|
|
2400
2425
|
useSpreadsheetViewport,
|
|
2401
2426
|
useTableMenu,
|
|
2427
|
+
useToolBridge,
|
|
2402
2428
|
useTrackChanges,
|
|
2403
2429
|
withoutDirty
|
|
2404
2430
|
};
|