@excalidraw/element 0.18.0-9ba0f5d → 0.18.0-a9ca16e
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/dev/index.js +3757 -2654
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +13 -12
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/colors.d.ts +1 -1
- package/dist/types/common/src/constants.d.ts +4 -0
- package/dist/types/common/src/index.d.ts +3 -0
- package/dist/types/common/src/utils.d.ts +4 -7
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +2 -0
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +27 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +13 -8
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/collision.d.ts +4 -3
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/index.d.ts +3 -0
- package/dist/types/element/src/linearElementEditor.d.ts +5 -0
- package/dist/types/element/src/mutateElement.d.ts +2 -0
- package/dist/types/element/src/selection.d.ts +5 -1
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/element/src/types.d.ts +5 -2
- package/dist/types/element/src/utils.d.ts +5 -3
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +38 -35
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +27 -25
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +157 -145
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +26 -24
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +41 -36
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +26 -24
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionExport.d.ts +75 -347
- package/dist/types/excalidraw/actions/actionFrame.d.ts +52 -48
- package/dist/types/excalidraw/actions/actionGroup.d.ts +27 -25
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -12
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionProperties.d.ts +28 -26
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -11
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -12
- package/dist/types/excalidraw/actions/index.d.ts +2 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +9 -7
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +7 -0
- package/dist/types/excalidraw/clipboard.d.ts +6 -7
- package/dist/types/excalidraw/components/App.d.ts +53 -13
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +2 -6
- package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +11 -7
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +4 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
- package/dist/types/excalidraw/components/Toast.d.ts +8 -4
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/icons.d.ts +23 -9
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -0
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -14
- package/dist/types/excalidraw/components/shapes.d.ts +74 -1
- package/dist/types/excalidraw/data/blob.d.ts +45 -44
- package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
- package/dist/types/excalidraw/data/index.d.ts +2 -3
- package/dist/types/excalidraw/data/json.d.ts +37 -28
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +93 -16
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
- package/dist/types/math/src/point.d.ts +7 -2
- package/dist/types/math/src/types.d.ts +25 -1
- package/package.json +3 -3
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/index.d.ts +0 -46
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getFontString } from "@excalidraw/common";
|
|
2
|
+
import type { ChartType } from "@excalidraw/element/types";
|
|
3
|
+
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
|
+
import { type CartesianChartLayout, type CartesianChartType } from "./charts.constants";
|
|
5
|
+
import type { ChartElements, Spreadsheet, SpreadsheetSeries } from "./charts.types";
|
|
6
|
+
export declare const isSpreadsheetValidForChartType: (spreadsheet: Spreadsheet | null, chartType: ChartType) => boolean;
|
|
7
|
+
export declare const getCartesianChartLayout: (chartType: CartesianChartType, seriesCount: number) => CartesianChartLayout;
|
|
8
|
+
export declare const getChartDimensions: (spreadsheet: Spreadsheet, layout: CartesianChartLayout) => {
|
|
9
|
+
chartWidth: number;
|
|
10
|
+
chartHeight: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const getRadarDimensions: () => {
|
|
13
|
+
chartWidth: number;
|
|
14
|
+
chartHeight: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const getSeriesColors: (seriesCount: number, colorOffset: number) => readonly string[];
|
|
17
|
+
export declare const getColorOffset: (colorSeed?: number) => number;
|
|
18
|
+
export declare const getBackgroundColor: (colorOffset: number) => "#fff5f5" | "#ffc9c9" | "#ff8787" | "#fa5252" | "#e03131" | "#fff0f6" | "#fcc2d7" | "#f783ac" | "#e64980" | "#c2255c" | "#f8f0fc" | "#eebefa" | "#da77f2" | "#be4bdb" | "#9c36b5" | "#f3f0ff" | "#d0bfff" | "#9775fa" | "#7950f2" | "#6741d9" | "#e7f5ff" | "#a5d8ff" | "#4dabf7" | "#228be6" | "#1971c2" | "#e3fafc" | "#99e9f2" | "#3bc9db" | "#15aabf" | "#0c8599" | "#e6fcf5" | "#96f2d7" | "#38d9a9" | "#12b886" | "#099268" | "#ebfbee" | "#b2f2bb" | "#69db7c" | "#40c057" | "#2f9e44" | "#fff9db" | "#ffec99" | "#ffd43b" | "#fab005" | "#f08c00" | "#fff4e6" | "#ffd8a8" | "#ffa94d" | "#fd7e14" | "#e8590c";
|
|
19
|
+
export declare const getRadarValueScale: (series: SpreadsheetSeries[], _labelsLength: number) => {
|
|
20
|
+
renderSteps: boolean;
|
|
21
|
+
normalize: (value: number, _axisIndex: number) => number;
|
|
22
|
+
};
|
|
23
|
+
export declare const getRadarDisplayText: (text: string, fontString: ReturnType<typeof getFontString>, maxWidth: number) => string;
|
|
24
|
+
export declare const createRadarAxisLabels: (labels: readonly string[], angles: readonly number[], centerX: number, centerY: number, radius: number, backgroundColor: string) => {
|
|
25
|
+
axisLabels: ChartElements;
|
|
26
|
+
axisLabelTopY: number;
|
|
27
|
+
axisLabelBottomY: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const createSeriesLegend: (series: SpreadsheetSeries[], seriesColors: readonly string[], centerX: number, minLegendTopY: number, fallbackLegendY: number, backgroundColor: string) => ChartElements;
|
|
30
|
+
export declare const getRotatedTextElementBottom: (element: NonDeletedExcalidrawElement) => number;
|
|
31
|
+
export declare const chartXLabels: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout) => ChartElements;
|
|
32
|
+
export declare const chartBaseElements: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout, maxValue?: number, debug?: boolean) => ChartElements;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ParseSpreadsheetResult } from "./charts.types";
|
|
2
|
+
/**
|
|
3
|
+
* @private exported for testing
|
|
4
|
+
*/
|
|
5
|
+
export declare const tryParseNumber: (s: string) => number | null;
|
|
6
|
+
/**
|
|
7
|
+
* @private exported for testing
|
|
8
|
+
*/
|
|
9
|
+
export declare const tryParseCells: (cells: string[][]) => ParseSpreadsheetResult;
|
|
10
|
+
export declare const tryParseSpreadsheet: (text: string) => ParseSpreadsheetResult;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
export type ChartElements = readonly NonDeletedExcalidrawElement[];
|
|
3
|
+
export interface Spreadsheet {
|
|
4
|
+
title: string | null;
|
|
5
|
+
labels: string[] | null;
|
|
6
|
+
series: SpreadsheetSeries[];
|
|
7
|
+
}
|
|
8
|
+
export interface SpreadsheetSeries {
|
|
9
|
+
title: string | null;
|
|
10
|
+
values: number[];
|
|
11
|
+
}
|
|
12
|
+
export type ParseSpreadsheetResult = {
|
|
13
|
+
ok: false;
|
|
14
|
+
reason: string;
|
|
15
|
+
} | {
|
|
16
|
+
ok: true;
|
|
17
|
+
data: Spreadsheet;
|
|
18
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChartType } from "@excalidraw/element/types";
|
|
2
|
+
import { tryParseCells, tryParseNumber, tryParseSpreadsheet } from "./charts.parse";
|
|
3
|
+
import type { ChartElements, Spreadsheet } from "./charts.types";
|
|
4
|
+
export { type ParseSpreadsheetResult, type Spreadsheet, type SpreadsheetSeries, type ChartElements, } from "./charts.types";
|
|
5
|
+
export { isSpreadsheetValidForChartType } from "./charts.helpers";
|
|
6
|
+
export { tryParseCells, tryParseNumber, tryParseSpreadsheet };
|
|
7
|
+
export declare const renderSpreadsheet: (chartType: ChartType, spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements | null;
|
|
@@ -2,15 +2,12 @@ import { ALLOWED_PASTE_MIME_TYPES } from "@excalidraw/common";
|
|
|
2
2
|
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { IMAGE_MIME_TYPES, STRING_MIME_TYPES } from "@excalidraw/common";
|
|
4
4
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
5
|
-
import type { FileSystemHandle } from "./data/filesystem";
|
|
6
|
-
import type { Spreadsheet } from "./charts";
|
|
7
5
|
import type { BinaryFiles } from "./types";
|
|
8
6
|
export type PastedMixedContent = {
|
|
9
7
|
type: "text" | "imageUrl";
|
|
10
8
|
value: string;
|
|
11
9
|
}[];
|
|
12
10
|
export interface ClipboardData {
|
|
13
|
-
spreadsheet?: Spreadsheet;
|
|
14
11
|
elements?: readonly ExcalidrawElement[];
|
|
15
12
|
files?: BinaryFiles;
|
|
16
13
|
text?: string;
|
|
@@ -54,7 +51,7 @@ type AllowedParsedDataTransferItem = {
|
|
|
54
51
|
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
55
52
|
kind: "file";
|
|
56
53
|
file: File;
|
|
57
|
-
fileHandle:
|
|
54
|
+
fileHandle: FileSystemFileHandle | null;
|
|
58
55
|
} | {
|
|
59
56
|
type: ValueOf<typeof STRING_MIME_TYPES>;
|
|
60
57
|
kind: "string";
|
|
@@ -64,7 +61,7 @@ type ParsedDataTransferItem = {
|
|
|
64
61
|
type: string;
|
|
65
62
|
kind: "file";
|
|
66
63
|
file: File;
|
|
67
|
-
fileHandle:
|
|
64
|
+
fileHandle: FileSystemFileHandle | null;
|
|
68
65
|
} | {
|
|
69
66
|
type: string;
|
|
70
67
|
kind: "string";
|
|
@@ -76,7 +73,7 @@ type ParsedDataTransferItemType<T extends AllowedParsedDataTransferItem["type"]>
|
|
|
76
73
|
export type ParsedDataTransferFile = Extract<AllowedParsedDataTransferItem, {
|
|
77
74
|
kind: "file";
|
|
78
75
|
}>;
|
|
79
|
-
type ParsedDataTranferList = ParsedDataTransferItem[] & {
|
|
76
|
+
export type ParsedDataTranferList = ParsedDataTransferItem[] & {
|
|
80
77
|
/**
|
|
81
78
|
* Only allows filtering by known `string` data types, since `file`
|
|
82
79
|
* types can have multiple items of the same type (e.g. multiple image files)
|
|
@@ -94,12 +91,14 @@ type ParsedDataTranferList = ParsedDataTransferItem[] & {
|
|
|
94
91
|
declare const findDataTransferItemType: <T extends ValueOf<typeof STRING_MIME_TYPES>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<T> | null;
|
|
95
92
|
declare const getDataTransferItemData: <T extends ValueOf<typeof STRING_MIME_TYPES>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<ValueOf<typeof STRING_MIME_TYPES>>["value"] | null;
|
|
96
93
|
declare const getDataTransferFiles: (this: ParsedDataTranferList) => ParsedDataTransferFile[];
|
|
94
|
+
/** @returns list of MIME types, synchronously */
|
|
95
|
+
export declare const parseDataTransferEventMimeTypes: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Set<string>;
|
|
97
96
|
export declare const parseDataTransferEvent: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Promise<ParsedDataTranferList>;
|
|
98
97
|
/**
|
|
99
98
|
* Attempts to parse clipboard event.
|
|
100
99
|
*/
|
|
101
100
|
export declare const parseClipboard: (dataList: ParsedDataTranferList, isPlainPaste?: boolean) => Promise<ClipboardData>;
|
|
102
101
|
export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
|
|
103
|
-
export declare const copyTextToSystemClipboard: (text: string | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
102
|
+
export declare const copyTextToSystemClipboard: <MimeType extends ValueOf<typeof STRING_MIME_TYPES>>(text: string | { [K in MimeType]: string; } | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
104
103
|
export declare const isClipboardEvent: (event: React.SyntheticEvent | Event) => event is ClipboardEvent;
|
|
105
104
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
|
|
2
|
+
import { AppEventBus, type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
|
|
3
3
|
import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
|
|
4
4
|
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
5
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
@@ -13,15 +13,31 @@ import { LaserTrails } from "../laser-trails";
|
|
|
13
13
|
import { isOverScrollBars } from "../scene/scrollbars";
|
|
14
14
|
import { LassoTrail } from "../lasso";
|
|
15
15
|
import { EraserTrail } from "../eraser";
|
|
16
|
+
import { type OnStateChange } from "./AppStateObserver";
|
|
16
17
|
import type { ExportedElements } from "../data";
|
|
17
|
-
import type {
|
|
18
|
-
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
18
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
19
19
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
20
20
|
import type { ActionResult } from "../actions/types";
|
|
21
|
+
declare const editorLifecycleEventBehavior: {
|
|
22
|
+
readonly "editor:mount": {
|
|
23
|
+
readonly cardinality: "once";
|
|
24
|
+
readonly replay: "last";
|
|
25
|
+
};
|
|
26
|
+
readonly "editor:initialize": {
|
|
27
|
+
readonly cardinality: "once";
|
|
28
|
+
readonly replay: "last";
|
|
29
|
+
};
|
|
30
|
+
readonly "editor:unmount": {
|
|
31
|
+
readonly cardinality: "once";
|
|
32
|
+
readonly replay: "last";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
21
35
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
22
36
|
container: HTMLDivElement | null;
|
|
23
37
|
id: string | null;
|
|
24
38
|
}>;
|
|
39
|
+
export declare const ExcalidrawAPIContext: React.Context<ExcalidrawImperativeAPI | null>;
|
|
40
|
+
export declare const ExcalidrawAPISetContext: React.Context<((api: ExcalidrawImperativeAPI | null) => void) | null>;
|
|
25
41
|
export declare const useApp: () => AppClassProperties;
|
|
26
42
|
export declare const useAppProps: () => AppProps;
|
|
27
43
|
export declare const useEditorInterface: () => Readonly<{
|
|
@@ -44,9 +60,14 @@ export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawE
|
|
|
44
60
|
export declare const useExcalidrawAppState: () => AppState;
|
|
45
61
|
export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(state: AppState | ((prevState: Readonly<AppState>, props: Readonly<any>) => AppState | Pick<AppState, K> | null) | Pick<AppState, K> | null, callback?: (() => void) | undefined) => void;
|
|
46
62
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
63
|
+
/**
|
|
64
|
+
* Requires wrapping your component in <ExcalidrawAPIContext.Provider>
|
|
65
|
+
*/
|
|
66
|
+
export declare const useExcalidrawAPI: () => ExcalidrawImperativeAPI | null;
|
|
47
67
|
declare class App extends React.Component<AppProps, AppState> {
|
|
48
68
|
canvas: AppClassProperties["canvas"];
|
|
49
69
|
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
70
|
+
sessionExportThemeOverride: AppState["theme"] | undefined;
|
|
50
71
|
rc: RoughCanvas;
|
|
51
72
|
unmounted: boolean;
|
|
52
73
|
actionManager: ActionManager;
|
|
@@ -80,19 +101,31 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
80
101
|
/** embeds that have been inserted to DOM (as a perf optim, we don't want to
|
|
81
102
|
* insert to DOM before user initially scrolls to them) */
|
|
82
103
|
private initializedEmbeds;
|
|
83
|
-
private handleToastClose;
|
|
84
104
|
private elementsPendingErasure;
|
|
105
|
+
private _initialized;
|
|
106
|
+
private readonly editorLifecycleEvents;
|
|
107
|
+
onEvent: AppEventBus<ExcalidrawImperativeAPIEventMap, typeof editorLifecycleEventBehavior>["on"];
|
|
108
|
+
private appStateObserver;
|
|
109
|
+
onStateChange: OnStateChange;
|
|
85
110
|
flowChartCreator: FlowChartCreator;
|
|
86
111
|
private flowChartNavigator;
|
|
87
112
|
bindModeHandler: ReturnType<typeof setTimeout> | null;
|
|
88
113
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
89
114
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
90
115
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
116
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
91
117
|
lastPointerMoveEvent: PointerEvent | null;
|
|
118
|
+
/** current frame pointer cords */
|
|
92
119
|
lastPointerMoveCoords: {
|
|
93
120
|
x: number;
|
|
94
121
|
y: number;
|
|
95
122
|
} | null;
|
|
123
|
+
private lastCompletedCanvasClicks;
|
|
124
|
+
/** previous frame pointer coords */
|
|
125
|
+
previousPointerMoveCoords: {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
} | null;
|
|
96
129
|
lastViewportPosition: {
|
|
97
130
|
x: number;
|
|
98
131
|
y: number;
|
|
@@ -232,6 +265,8 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
232
265
|
}>]>;
|
|
233
266
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
234
267
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
268
|
+
api: ExcalidrawImperativeAPI;
|
|
269
|
+
private createExcalidrawAPI;
|
|
235
270
|
constructor(props: AppProps);
|
|
236
271
|
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
237
272
|
private onWindowMessage;
|
|
@@ -245,8 +280,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
245
280
|
* If disabled, returns null.
|
|
246
281
|
*/
|
|
247
282
|
getEffectiveGridSize: () => NullableGridSize;
|
|
283
|
+
private getTextCreationGridPoint;
|
|
248
284
|
private getHTMLIFrameElement;
|
|
249
|
-
private
|
|
285
|
+
private handleIframeLikeElementHover;
|
|
286
|
+
/** @returns true if iframe-like element click handled */
|
|
287
|
+
private handleIframeLikeCenterClick;
|
|
288
|
+
private isDoubleClick;
|
|
250
289
|
private isIframeLikeElementCenter;
|
|
251
290
|
private updateEmbedValidationStatus;
|
|
252
291
|
private updateEmbeddables;
|
|
@@ -371,11 +410,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
371
410
|
private maybeUnfollowRemoteUser;
|
|
372
411
|
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
373
412
|
private translateCanvas;
|
|
374
|
-
setToast: (toast:
|
|
375
|
-
message: string;
|
|
376
|
-
closable?: boolean;
|
|
377
|
-
duration?: number;
|
|
378
|
-
} | null) => void;
|
|
413
|
+
setToast: (toast: AppState["toast"]) => void;
|
|
379
414
|
restoreFileFromShare: () => Promise<void>;
|
|
380
415
|
/**
|
|
381
416
|
* adds supplied files to existing files in the appState.
|
|
@@ -441,7 +476,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
441
476
|
private onGestureEnd;
|
|
442
477
|
private handleTextWysiwyg;
|
|
443
478
|
private deselectElements;
|
|
479
|
+
private getSelectedTextElement;
|
|
480
|
+
private getSelectedTextEditingContainerAtPosition;
|
|
444
481
|
private getTextElementAtPosition;
|
|
482
|
+
private isHittingTextAutoResizeHandle;
|
|
483
|
+
private handleTextAutoResizeHandlePointerDown;
|
|
445
484
|
private getElementAtPosition;
|
|
446
485
|
private getElementsAtPosition;
|
|
447
486
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
@@ -450,9 +489,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
450
489
|
private startTextEditing;
|
|
451
490
|
private startImageCropping;
|
|
452
491
|
private finishImageCropping;
|
|
492
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
453
493
|
private handleCanvasDoubleClick;
|
|
494
|
+
private handleCanvasClick;
|
|
454
495
|
private getElementLinkAtPosition;
|
|
455
|
-
private
|
|
496
|
+
private handleElementLinkClick;
|
|
456
497
|
private getTopLayerFrameAtSceneCoords;
|
|
457
498
|
private handleCanvasPointerMove;
|
|
458
499
|
private handleEraser;
|
|
@@ -523,12 +564,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
523
564
|
/** generally you should use `addNewImagesToImageCache()` directly if you need
|
|
524
565
|
* to render new images. This is just a failsafe */
|
|
525
566
|
private scheduleImageRefresh;
|
|
526
|
-
private updateBindingEnabledOnPointerMove;
|
|
527
567
|
private clearSelection;
|
|
528
568
|
private handleInteractiveCanvasRef;
|
|
529
569
|
private insertImages;
|
|
530
570
|
private handleAppOnDrop;
|
|
531
|
-
loadFileToCanvas: (file: File, fileHandle:
|
|
571
|
+
loadFileToCanvas: (file: File, fileHandle: FileSystemFileHandle | null) => Promise<void>;
|
|
532
572
|
private handleCanvasContextMenu;
|
|
533
573
|
private maybeDragNewGenericElement;
|
|
534
574
|
private maybeHandleCrop;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { AppState, UnsubscribeCallback } from "../types";
|
|
2
|
+
type StateChangeSelector = keyof AppState | (keyof AppState)[] | ((appState: AppState) => unknown);
|
|
3
|
+
export type OnStateChange = {
|
|
4
|
+
<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void, opts?: {
|
|
5
|
+
once: boolean;
|
|
6
|
+
}): UnsubscribeCallback;
|
|
7
|
+
<K extends keyof AppState>(prop: K): Promise<AppState[K]>;
|
|
8
|
+
(prop: (keyof AppState)[], callback: (appState: AppState, appState2: AppState) => void, opts?: {
|
|
9
|
+
once: boolean;
|
|
10
|
+
}): UnsubscribeCallback;
|
|
11
|
+
(prop: (keyof AppState)[]): Promise<AppState>;
|
|
12
|
+
<T>(prop: (appState: AppState) => T, callback: (value: T, appState: AppState) => void, opts?: {
|
|
13
|
+
once: boolean;
|
|
14
|
+
}): UnsubscribeCallback;
|
|
15
|
+
<T>(prop: (appState: AppState) => T): Promise<T>;
|
|
16
|
+
(opts: {
|
|
17
|
+
predicate: (appState: AppState) => boolean;
|
|
18
|
+
callback: (appState: AppState) => void;
|
|
19
|
+
once?: boolean;
|
|
20
|
+
}): UnsubscribeCallback;
|
|
21
|
+
(opts: {
|
|
22
|
+
predicate: (appState: AppState) => boolean;
|
|
23
|
+
}): Promise<AppState>;
|
|
24
|
+
(selector: StateChangeSelector, callback: (value: any, appState: AppState) => void): any;
|
|
25
|
+
};
|
|
26
|
+
export declare class AppStateObserver {
|
|
27
|
+
private readonly getState;
|
|
28
|
+
private listeners;
|
|
29
|
+
constructor(getState: () => AppState);
|
|
30
|
+
private isStateChangePredicateOptions;
|
|
31
|
+
private subscribe;
|
|
32
|
+
private normalize;
|
|
33
|
+
onStateChange: OnStateChange;
|
|
34
|
+
flush(prevState: AppState): void;
|
|
35
|
+
clear(): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -14,7 +14,7 @@ export type CommandPaletteItem = {
|
|
|
14
14
|
category: string;
|
|
15
15
|
order?: number;
|
|
16
16
|
predicate?: boolean | Action["predicate"];
|
|
17
|
-
shortcut?: string;
|
|
17
|
+
shortcut?: string | null;
|
|
18
18
|
/** if false, command will not show while in view mode */
|
|
19
19
|
viewMode?: boolean;
|
|
20
20
|
perform: (data: {
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import "./IconPicker.scss";
|
|
2
2
|
import type { JSX } from "react";
|
|
3
|
-
|
|
3
|
+
type Option<T> = {
|
|
4
|
+
value: T;
|
|
5
|
+
text: string;
|
|
6
|
+
icon: JSX.Element;
|
|
7
|
+
keyBinding: string | null;
|
|
8
|
+
};
|
|
9
|
+
type PickerSection<T> = {
|
|
10
|
+
name: string;
|
|
11
|
+
options: readonly Option<T>[];
|
|
12
|
+
};
|
|
13
|
+
export declare function IconPicker<T>({ value, label, visibleSections, hiddenSections, onChange, }: {
|
|
4
14
|
label: string;
|
|
5
15
|
value: T;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
text: string;
|
|
9
|
-
icon: JSX.Element;
|
|
10
|
-
keyBinding: string | null;
|
|
11
|
-
}[];
|
|
16
|
+
visibleSections: readonly PickerSection<T>[];
|
|
17
|
+
hiddenSections?: readonly PickerSection<T>[];
|
|
12
18
|
onChange: (value: T) => void;
|
|
13
|
-
numberOfOptionsToAlwaysShow?: number;
|
|
14
|
-
group?: string;
|
|
15
19
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import "./PasteChartDialog.scss";
|
|
3
|
-
import type {
|
|
4
|
-
export declare const PasteChartDialog: ({
|
|
5
|
-
|
|
2
|
+
import type { Spreadsheet } from "../charts";
|
|
3
|
+
export declare const PasteChartDialog: ({ data, rawText, onClose, }: {
|
|
4
|
+
data: Spreadsheet;
|
|
5
|
+
rawText: string;
|
|
6
6
|
onClose: () => void;
|
|
7
|
-
setAppState: React.Component<any, UIAppState>["setState"];
|
|
8
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "./Range.scss";
|
|
2
|
-
import type { AppClassProperties } from "../types";
|
|
3
3
|
export type RangeProps = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: number;
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
minLabel?: React.ReactNode;
|
|
11
|
+
hasCommonValue?: boolean;
|
|
6
12
|
testId?: string;
|
|
7
13
|
};
|
|
8
|
-
export declare const Range: ({
|
|
14
|
+
export declare const Range: ({ label, value, onChange, min, max, step, minLabel, hasCommonValue, testId, }: RangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TChat, TTTDDialog } from "../types";
|
|
2
|
-
export declare const ChatInterface: ({ chatId, messages, currentPrompt, onPromptChange, onGenerate, isGenerating, rateLimits,
|
|
2
|
+
export declare const ChatInterface: ({ chatId, messages, currentPrompt, onPromptChange, onGenerate, isGenerating, rateLimits, onAbort, onMermaidTabClick, onAiRepairClick, onDeleteMessage, onInsertMessage, onRetry, renderWelcomeScreen, renderWarning, }: {
|
|
3
3
|
chatId: string;
|
|
4
4
|
messages: TChat.ChatMessage[];
|
|
5
5
|
currentPrompt: string;
|
|
@@ -12,16 +12,12 @@ export declare const ChatInterface: ({ chatId, messages, currentPrompt, onPrompt
|
|
|
12
12
|
} | null;
|
|
13
13
|
onViewAsMermaid?: () => void;
|
|
14
14
|
generatedResponse?: string | null;
|
|
15
|
-
placeholder: {
|
|
16
|
-
title: string;
|
|
17
|
-
description: string;
|
|
18
|
-
hint: string;
|
|
19
|
-
};
|
|
20
15
|
onAbort?: () => void;
|
|
21
16
|
onMermaidTabClick?: (message: TChat.ChatMessage) => void;
|
|
22
17
|
onAiRepairClick?: (message: TChat.ChatMessage) => void;
|
|
23
18
|
onDeleteMessage?: (messageId: string) => void;
|
|
24
19
|
onInsertMessage?: (message: TChat.ChatMessage) => void;
|
|
25
20
|
onRetry?: (message: TChat.ChatMessage) => void;
|
|
21
|
+
renderWelcomeScreen?: TTTDDialog.renderWelcomeScreen;
|
|
26
22
|
renderWarning?: TTTDDialog.renderWarning;
|
|
27
23
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SavedChat, TChat, TTTDDialog } from "../types";
|
|
2
|
-
export declare const TTDChatPanel: ({ chatId, messages, currentPrompt, onPromptChange, onGenerate, isGenerating, generatedResponse, isMenuOpen, onMenuToggle, onMenuClose, onNewChat, onRestoreChat, onDeleteChat, savedChats, activeSessionId, onAbort, onMermaidTabClick, onAiRepairClick, onDeleteMessage, onInsertMessage, onRetry, onViewAsMermaid, renderWarning, }: {
|
|
2
|
+
export declare const TTDChatPanel: ({ chatId, messages, currentPrompt, onPromptChange, onGenerate, isGenerating, generatedResponse, isMenuOpen, onMenuToggle, onMenuClose, onNewChat, onRestoreChat, onDeleteChat, savedChats, activeSessionId, onAbort, onMermaidTabClick, onAiRepairClick, onDeleteMessage, onInsertMessage, onRetry, onViewAsMermaid, renderWelcomeScreen, renderWarning, }: {
|
|
3
3
|
chatId: string;
|
|
4
4
|
messages: TChat.ChatMessage[];
|
|
5
5
|
currentPrompt: string;
|
|
@@ -22,5 +22,6 @@ export declare const TTDChatPanel: ({ chatId, messages, currentPrompt, onPromptC
|
|
|
22
22
|
onInsertMessage: (message: TChat.ChatMessage) => void;
|
|
23
23
|
onRetry?: (message: TChat.ChatMessage) => void;
|
|
24
24
|
onViewAsMermaid: () => void;
|
|
25
|
+
renderWelcomeScreen?: TTTDDialog.renderWelcomeScreen;
|
|
25
26
|
renderWarning?: TTTDDialog.renderWarning;
|
|
26
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Theme } from "@excalidraw/element/types";
|
|
2
|
+
export interface CodeMirrorEditorProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
onKeyboardSubmit?: () => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
theme: Theme;
|
|
8
|
+
errorLine?: number | null;
|
|
9
|
+
}
|
|
10
|
+
declare const CodeMirrorEditor: ({ value, onChange, onKeyboardSubmit, placeholder, theme, errorLine, }: CodeMirrorEditorProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default CodeMirrorEditor;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import "./TTDDialog.scss";
|
|
2
2
|
import type { TTDPersistenceAdapter, TTTDDialog } from "./types";
|
|
3
|
-
export declare const TTDDialog:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
3
|
+
export declare const TTDDialog: {
|
|
4
|
+
(props: {
|
|
5
|
+
onTextSubmit: TTTDDialog.onTextSubmit;
|
|
6
|
+
renderWelcomeScreen?: TTTDDialog.renderWelcomeScreen;
|
|
7
|
+
renderWarning?: TTTDDialog.renderWarning;
|
|
8
|
+
persistenceAdapter: TTDPersistenceAdapter;
|
|
9
|
+
} | {
|
|
10
|
+
__fallback: true;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
WelcomeMessage: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ChangeEventHandler } from "react";
|
|
2
1
|
interface TTDDialogInputProps {
|
|
3
2
|
input: string;
|
|
4
3
|
placeholder: string;
|
|
5
|
-
onChange:
|
|
4
|
+
onChange: (value: string) => void;
|
|
6
5
|
onKeyboardSubmit?: () => void;
|
|
6
|
+
errorLine?: number | null;
|
|
7
7
|
}
|
|
8
|
-
export declare const TTDDialogInput: ({ input, placeholder, onChange, onKeyboardSubmit, }: TTDDialogInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const TTDDialogInput: ({ input, placeholder, onChange, onKeyboardSubmit, errorLine, }: TTDDialogInputProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
export {};
|
|
@@ -3,6 +3,9 @@ interface TTDDialogOutputProps {
|
|
|
3
3
|
canvasRef: React.RefObject<HTMLDivElement | null>;
|
|
4
4
|
loaded: boolean;
|
|
5
5
|
hideErrorDetails?: boolean;
|
|
6
|
+
sourceText?: string;
|
|
7
|
+
autoFixAvailable?: boolean;
|
|
8
|
+
onApplyAutoFix?: () => void;
|
|
6
9
|
}
|
|
7
|
-
export declare const TTDDialogOutput: ({ error, canvasRef, loaded, hideErrorDetails, }: TTDDialogOutputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const TTDDialogOutput: ({ error, canvasRef, loaded, hideErrorDetails, sourceText, autoFixAvailable, onApplyAutoFix, }: TTDDialogOutputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TTDWelcomeMessage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { MermaidToExcalidrawLibProps, TTDPersistenceAdapter, TTTDDialog } from "./types";
|
|
2
|
-
export declare const TextToDiagram: ({ mermaidToExcalidrawLib, onTextSubmit, renderWarning, persistenceAdapter, }: {
|
|
2
|
+
export declare const TextToDiagram: ({ mermaidToExcalidrawLib, onTextSubmit, renderWelcomeScreen, renderWarning, persistenceAdapter, }: {
|
|
3
3
|
mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
|
|
4
4
|
onTextSubmit(props: TTTDDialog.OnTextSubmitProps): Promise<TTTDDialog.OnTextSubmitRetValue>;
|
|
5
|
+
renderWelcomeScreen?: TTTDDialog.renderWelcomeScreen;
|
|
5
6
|
renderWarning?: TTTDDialog.renderWarning;
|
|
6
7
|
persistenceAdapter: TTDPersistenceAdapter;
|
|
7
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -88,4 +88,8 @@ export declare namespace TTTDDialog {
|
|
|
88
88
|
* return undefined to use default rendering
|
|
89
89
|
*/
|
|
90
90
|
type renderWarning = (chatMessage: TChat.ChatMessage) => React.ReactNode | undefined;
|
|
91
|
+
type renderWelcomeScreen = (props: {
|
|
92
|
+
/** null if not rate limit data currently available */
|
|
93
|
+
rateLimits: RateLimits | null;
|
|
94
|
+
}) => React.ReactNode | undefined;
|
|
91
95
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getMermaidAutoFixCandidates: (sourceText: string, errorMessage: string) => string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const isMermaidParseSyntaxError: (message: string) => boolean;
|
|
2
|
+
export declare const isMermaidAutoFixableError: (message: string) => boolean;
|
|
3
|
+
export declare const isMermaidCaretLine: (line: string) => boolean;
|
|
4
|
+
export declare const getMermaidInactiveParticipant: (message: string) => string | null;
|
|
5
|
+
export declare const getMermaidErrorLineNumber: (message: string, sourceText?: string) => number | null;
|
|
6
|
+
export declare const getMermaidSyntaxErrorGuidance: (message: string, sourceText?: string) => {
|
|
7
|
+
summary: string;
|
|
8
|
+
likelyCauses: string[];
|
|
9
|
+
} | null;
|
|
10
|
+
export declare const formatMermaidParseErrorMessage: (message: string) => string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import "./Toast.scss";
|
|
2
|
-
import type { CSSProperties } from "react";
|
|
3
|
-
export declare const Toast: ({ message, onClose, closable, duration, style, }: {
|
|
4
|
-
message:
|
|
2
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
3
|
+
export declare const Toast: (({ message, onClose, closable, duration, style, }: {
|
|
4
|
+
message: ReactNode;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
closable?: boolean;
|
|
7
7
|
duration?: number;
|
|
8
8
|
style?: CSSProperties;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
10
|
+
ProgressBar: ({ progress }: {
|
|
11
|
+
progress: number;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
};
|
|
@@ -21,6 +21,7 @@ type InteractiveCanvasProps = {
|
|
|
21
21
|
renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
|
|
22
22
|
handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
|
|
23
23
|
onContextMenu: Exclude<DOMAttributes<HTMLCanvasElement | HTMLDivElement>["onContextMenu"], undefined>;
|
|
24
|
+
onClick: Exclude<DOMAttributes<HTMLCanvasElement>["onClick"], undefined>;
|
|
24
25
|
onPointerMove: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerMove"], undefined>;
|
|
25
26
|
onPointerUp: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerUp"], undefined>;
|
|
26
27
|
onPointerCancel: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerCancel"], undefined>;
|