@zsviczian/excalidraw 0.15.2-obsidian-9 → 0.15.2-obsidian-11
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/excalidraw.development.js +2147 -2146
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +9 -0
- package/package.json +7 -2
- package/types/actions/actionAddToLibrary.d.ts +3 -4
- package/types/actions/actionAlign.d.ts +0 -1
- package/types/actions/actionBoundText.d.ts +2 -3
- package/types/actions/actionCanvas.d.ts +18 -19
- package/types/actions/actionClipboard.d.ts +5 -6
- package/types/actions/actionDeleteSelected.d.ts +3 -4
- package/types/actions/actionDistribute.d.ts +0 -1
- package/types/actions/actionDuplicateSelection.d.ts +0 -1
- package/types/actions/actionElementLock.d.ts +2 -3
- package/types/actions/actionExport.d.ts +16 -17
- package/types/actions/actionFinalize.d.ts +2 -3
- package/types/actions/actionFlip.d.ts +0 -1
- package/types/actions/actionFrame.d.ts +3 -4
- package/types/actions/actionGroup.d.ts +0 -1
- package/types/actions/actionLinearEditor.d.ts +1 -2
- package/types/actions/actionMenu.d.ts +3 -4
- package/types/actions/actionProperties.d.ts +13 -14
- package/types/actions/actionSelectAll.d.ts +0 -1
- package/types/actions/actionStyles.d.ts +1 -2
- package/types/actions/actionToggleGridMode.d.ts +1 -2
- package/types/actions/actionToggleStats.d.ts +1 -2
- package/types/actions/actionToggleViewMode.d.ts +1 -2
- package/types/actions/actionToggleZenMode.d.ts +1 -2
- package/types/appState.d.ts +1 -1
- package/types/colors.d.ts +9 -9
- package/types/components/App.d.ts +0 -3
- package/types/components/Button.d.ts +0 -1
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/types/components/DefaultSidebar.d.ts +0 -1
- package/types/components/EyeDropper.d.ts +0 -1
- package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
- package/types/components/LibraryUnit.d.ts +0 -1
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/SidebarTab.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
- package/types/components/Stack.d.ts +2 -2
- package/types/components/Trans.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -1
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
- package/types/constants.d.ts +4 -0
- package/types/element/Hyperlink.d.ts +0 -1
- package/types/element/embeddable.d.ts +1 -2
- package/types/element/linearElementEditor.d.ts +1 -2
- package/types/element/newElement.d.ts +1 -1
- package/types/element/textElement.d.ts +2 -6
- package/types/element/types.d.ts +5 -5
- package/types/hooks/useOutsideClick.d.ts +0 -1
- package/types/hooks/useScrollPosition.d.ts +0 -1
- package/types/i18n.d.ts +5 -2
- package/types/packages/excalidraw/dist/excalidraw.development.d.ts +2 -4
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/packages/excalidraw/webpack.dev.config.d.ts +73 -62
- package/types/packages/excalidraw/webpack.prod.config.d.ts +88 -71
- package/types/packages/utils.d.ts +2 -1
- package/types/renderer/renderElement.d.ts +1 -1
- package/types/renderer/renderScene.d.ts +2 -1
- package/types/scene/export.d.ts +1 -0
- package/types/types.d.ts +2 -4
- package/types/utility-types.d.ts +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { AppState } from "../../src/types";
|
|
3
2
|
import { Arrowhead, ExcalidrawElement, ExcalidrawLinearElement } from "../element/types";
|
|
4
3
|
export declare const actionChangeStrokeColor: {
|
|
@@ -140,7 +139,7 @@ export declare const actionChangeFillStyle: {
|
|
|
140
139
|
data: import("../charts").Spreadsheet;
|
|
141
140
|
};
|
|
142
141
|
pendingImageElementId: string | null;
|
|
143
|
-
showHyperlinkPopup: false | "
|
|
142
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
144
143
|
linkOpacity: number;
|
|
145
144
|
trayModeEnabled: boolean;
|
|
146
145
|
colorPalette?: {
|
|
@@ -293,7 +292,7 @@ export declare const actionChangeStrokeWidth: {
|
|
|
293
292
|
data: import("../charts").Spreadsheet;
|
|
294
293
|
};
|
|
295
294
|
pendingImageElementId: string | null;
|
|
296
|
-
showHyperlinkPopup: false | "
|
|
295
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
297
296
|
linkOpacity: number;
|
|
298
297
|
trayModeEnabled: boolean;
|
|
299
298
|
colorPalette?: {
|
|
@@ -446,7 +445,7 @@ export declare const actionChangeSloppiness: {
|
|
|
446
445
|
data: import("../charts").Spreadsheet;
|
|
447
446
|
};
|
|
448
447
|
pendingImageElementId: string | null;
|
|
449
|
-
showHyperlinkPopup: false | "
|
|
448
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
450
449
|
linkOpacity: number;
|
|
451
450
|
trayModeEnabled: boolean;
|
|
452
451
|
colorPalette?: {
|
|
@@ -599,7 +598,7 @@ export declare const actionChangeStrokeStyle: {
|
|
|
599
598
|
data: import("../charts").Spreadsheet;
|
|
600
599
|
};
|
|
601
600
|
pendingImageElementId: string | null;
|
|
602
|
-
showHyperlinkPopup: false | "
|
|
601
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
603
602
|
linkOpacity: number;
|
|
604
603
|
trayModeEnabled: boolean;
|
|
605
604
|
colorPalette?: {
|
|
@@ -752,7 +751,7 @@ export declare const actionChangeOpacity: {
|
|
|
752
751
|
data: import("../charts").Spreadsheet;
|
|
753
752
|
};
|
|
754
753
|
pendingImageElementId: string | null;
|
|
755
|
-
showHyperlinkPopup: false | "
|
|
754
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
756
755
|
linkOpacity: number;
|
|
757
756
|
trayModeEnabled: boolean;
|
|
758
757
|
colorPalette?: {
|
|
@@ -905,7 +904,7 @@ export declare const actionChangeFontSize: {
|
|
|
905
904
|
data: import("../charts").Spreadsheet;
|
|
906
905
|
};
|
|
907
906
|
pendingImageElementId: string | null;
|
|
908
|
-
showHyperlinkPopup: false | "
|
|
907
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
909
908
|
linkOpacity: number;
|
|
910
909
|
trayModeEnabled: boolean;
|
|
911
910
|
colorPalette?: {
|
|
@@ -1058,7 +1057,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
1058
1057
|
data: import("../charts").Spreadsheet;
|
|
1059
1058
|
};
|
|
1060
1059
|
pendingImageElementId: string | null;
|
|
1061
|
-
showHyperlinkPopup: false | "
|
|
1060
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1062
1061
|
linkOpacity: number;
|
|
1063
1062
|
trayModeEnabled: boolean;
|
|
1064
1063
|
colorPalette?: {
|
|
@@ -1211,7 +1210,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
1211
1210
|
data: import("../charts").Spreadsheet;
|
|
1212
1211
|
};
|
|
1213
1212
|
pendingImageElementId: string | null;
|
|
1214
|
-
showHyperlinkPopup: false | "
|
|
1213
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1215
1214
|
linkOpacity: number;
|
|
1216
1215
|
trayModeEnabled: boolean;
|
|
1217
1216
|
colorPalette?: {
|
|
@@ -1364,7 +1363,7 @@ export declare const actionChangeFontFamily: {
|
|
|
1364
1363
|
data: import("../charts").Spreadsheet;
|
|
1365
1364
|
};
|
|
1366
1365
|
pendingImageElementId: string | null;
|
|
1367
|
-
showHyperlinkPopup: false | "
|
|
1366
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1368
1367
|
linkOpacity: number;
|
|
1369
1368
|
trayModeEnabled: boolean;
|
|
1370
1369
|
colorPalette?: {
|
|
@@ -1517,7 +1516,7 @@ export declare const actionChangeTextAlign: {
|
|
|
1517
1516
|
data: import("../charts").Spreadsheet;
|
|
1518
1517
|
};
|
|
1519
1518
|
pendingImageElementId: string | null;
|
|
1520
|
-
showHyperlinkPopup: false | "
|
|
1519
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1521
1520
|
linkOpacity: number;
|
|
1522
1521
|
trayModeEnabled: boolean;
|
|
1523
1522
|
colorPalette?: {
|
|
@@ -1672,7 +1671,7 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1672
1671
|
data: import("../charts").Spreadsheet;
|
|
1673
1672
|
};
|
|
1674
1673
|
pendingImageElementId: string | null;
|
|
1675
|
-
showHyperlinkPopup: false | "
|
|
1674
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1676
1675
|
linkOpacity: number;
|
|
1677
1676
|
trayModeEnabled: boolean;
|
|
1678
1677
|
colorPalette?: {
|
|
@@ -1825,7 +1824,7 @@ export declare const actionChangeRoundness: {
|
|
|
1825
1824
|
data: import("../charts").Spreadsheet;
|
|
1826
1825
|
};
|
|
1827
1826
|
pendingImageElementId: string | null;
|
|
1828
|
-
showHyperlinkPopup: false | "
|
|
1827
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1829
1828
|
linkOpacity: number;
|
|
1830
1829
|
trayModeEnabled: boolean;
|
|
1831
1830
|
colorPalette?: {
|
|
@@ -1981,7 +1980,7 @@ export declare const actionChangeArrowhead: {
|
|
|
1981
1980
|
data: import("../charts").Spreadsheet;
|
|
1982
1981
|
};
|
|
1983
1982
|
pendingImageElementId: string | null;
|
|
1984
|
-
showHyperlinkPopup: false | "
|
|
1983
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
1985
1984
|
linkOpacity: number;
|
|
1986
1985
|
trayModeEnabled: boolean;
|
|
1987
1986
|
colorPalette?: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare let copiedStyles: string;
|
|
3
2
|
export declare const actionCopyStyles: {
|
|
4
3
|
name: "copyStyles";
|
|
@@ -122,7 +121,7 @@ export declare const actionCopyStyles: {
|
|
|
122
121
|
data: import("../charts").Spreadsheet;
|
|
123
122
|
};
|
|
124
123
|
pendingImageElementId: string | null;
|
|
125
|
-
showHyperlinkPopup: false | "
|
|
124
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
126
125
|
linkOpacity: number;
|
|
127
126
|
trayModeEnabled: boolean;
|
|
128
127
|
colorPalette?: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { AppState } from "../types";
|
|
3
2
|
export declare const actionToggleGridMode: {
|
|
4
3
|
name: "gridMode";
|
|
@@ -126,7 +125,7 @@ export declare const actionToggleGridMode: {
|
|
|
126
125
|
data: import("../charts").Spreadsheet;
|
|
127
126
|
};
|
|
128
127
|
pendingImageElementId: string | null;
|
|
129
|
-
showHyperlinkPopup: false | "
|
|
128
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
130
129
|
linkOpacity: number;
|
|
131
130
|
trayModeEnabled: boolean;
|
|
132
131
|
colorPalette?: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleStats: {
|
|
3
2
|
name: "stats";
|
|
4
3
|
viewMode: true;
|
|
@@ -124,7 +123,7 @@ export declare const actionToggleStats: {
|
|
|
124
123
|
data: import("../charts").Spreadsheet;
|
|
125
124
|
};
|
|
126
125
|
pendingImageElementId: string | null;
|
|
127
|
-
showHyperlinkPopup: false | "
|
|
126
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
128
127
|
linkOpacity: number;
|
|
129
128
|
trayModeEnabled: boolean;
|
|
130
129
|
colorPalette?: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleViewMode: {
|
|
3
2
|
name: "viewMode";
|
|
4
3
|
viewMode: true;
|
|
@@ -125,7 +124,7 @@ export declare const actionToggleViewMode: {
|
|
|
125
124
|
data: import("../charts").Spreadsheet;
|
|
126
125
|
};
|
|
127
126
|
pendingImageElementId: string | null;
|
|
128
|
-
showHyperlinkPopup: false | "
|
|
127
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
129
128
|
linkOpacity: number;
|
|
130
129
|
trayModeEnabled: boolean;
|
|
131
130
|
colorPalette?: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleZenMode: {
|
|
3
2
|
name: "zenMode";
|
|
4
3
|
viewMode: true;
|
|
@@ -125,7 +124,7 @@ export declare const actionToggleZenMode: {
|
|
|
125
124
|
data: import("../charts").Spreadsheet;
|
|
126
125
|
};
|
|
127
126
|
pendingImageElementId: string | null;
|
|
128
|
-
showHyperlinkPopup: false | "
|
|
127
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
129
128
|
linkOpacity: number;
|
|
130
129
|
trayModeEnabled: boolean;
|
|
131
130
|
colorPalette?: {
|
package/types/appState.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
13
13
|
type: "custom";
|
|
14
14
|
customType: string;
|
|
15
15
|
})) | undefined;
|
|
16
|
-
showWelcomeScreen?: boolean | undefined;
|
|
17
16
|
penMode?: boolean | undefined;
|
|
17
|
+
showWelcomeScreen?: boolean | undefined;
|
|
18
18
|
penDetected?: boolean | undefined;
|
|
19
19
|
exportBackground?: boolean | undefined;
|
|
20
20
|
exportEmbedScene?: boolean | undefined;
|
package/types/colors.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { Merge } from "./utility-types";
|
|
|
3
3
|
export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
|
|
4
4
|
export type ColorTuple = readonly [string, string, string, string, string];
|
|
5
5
|
export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
|
|
6
|
-
black:
|
|
7
|
-
white:
|
|
8
|
-
transparent:
|
|
6
|
+
black: "#1e1e1e";
|
|
7
|
+
white: "#ffffff";
|
|
8
|
+
transparent: "transparent";
|
|
9
9
|
}>;
|
|
10
10
|
export type ColorPaletteCustom = {
|
|
11
11
|
[key: string]: ColorTuple | string;
|
|
@@ -34,10 +34,10 @@ export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
|
|
|
34
34
|
readonly green: ColorTuple;
|
|
35
35
|
readonly yellow: ColorTuple;
|
|
36
36
|
readonly orange: ColorTuple;
|
|
37
|
-
readonly transparent:
|
|
38
|
-
readonly white:
|
|
37
|
+
readonly transparent: "transparent";
|
|
38
|
+
readonly white: "#ffffff";
|
|
39
39
|
readonly gray: ColorTuple;
|
|
40
|
-
readonly black:
|
|
40
|
+
readonly black: "#1e1e1e";
|
|
41
41
|
readonly bronze: ColorTuple;
|
|
42
42
|
};
|
|
43
43
|
export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
@@ -51,10 +51,10 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
|
51
51
|
readonly green: ColorTuple;
|
|
52
52
|
readonly yellow: ColorTuple;
|
|
53
53
|
readonly orange: ColorTuple;
|
|
54
|
-
readonly transparent:
|
|
55
|
-
readonly white:
|
|
54
|
+
readonly transparent: "transparent";
|
|
55
|
+
readonly white: "#ffffff";
|
|
56
56
|
readonly gray: ColorTuple;
|
|
57
|
-
readonly black:
|
|
57
|
+
readonly black: "#1e1e1e";
|
|
58
58
|
readonly bronze: ColorTuple;
|
|
59
59
|
};
|
|
60
60
|
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
|
|
@@ -2,14 +2,12 @@ import React from "react";
|
|
|
2
2
|
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { EXPORT_IMAGE_TYPES } from "../constants";
|
|
5
|
-
import { RestoredDataState } from "../data/restore";
|
|
6
5
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
7
6
|
import { ExcalidrawElement, ExcalidrawLinearElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
8
7
|
import History from "../history";
|
|
9
8
|
import Scene from "../scene/Scene";
|
|
10
9
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName } from "../types";
|
|
11
10
|
import { FileSystemHandle } from "../data/filesystem";
|
|
12
|
-
import { ImportedDataState } from "../data/types";
|
|
13
11
|
export declare let showFourthFont: boolean;
|
|
14
12
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
15
13
|
container: HTMLDivElement | null;
|
|
@@ -147,7 +145,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
147
145
|
zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
|
|
148
146
|
startLineEditor: (el: ExcalidrawLinearElement, selectedPointsIndices?: number[] | null) => void;
|
|
149
147
|
updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
|
|
150
|
-
restore: (data: ImportedDataState) => RestoredDataState;
|
|
151
148
|
setToast: (toast: {
|
|
152
149
|
message: string;
|
|
153
150
|
closable?: boolean;
|
|
@@ -10,7 +10,7 @@ type StackProps = {
|
|
|
10
10
|
ref: React.RefObject<HTMLDivElement>;
|
|
11
11
|
};
|
|
12
12
|
declare const _default: {
|
|
13
|
-
Row: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "
|
|
14
|
-
Col: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "
|
|
13
|
+
Row: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "align" | "gap" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Col: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "align" | "gap" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { TranslationKeys } from "../i18n";
|
|
2
3
|
declare const Trans: ({ i18nKey, children, ...props }: {
|
|
3
4
|
[key: string]: React.ReactNode | ((el: React.ReactNode) => React.ReactNode);
|
|
4
|
-
i18nKey:
|
|
5
|
+
i18nKey: TranslationKeys;
|
|
5
6
|
}) => React.FunctionComponentElement<{
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
}>;
|
package/types/constants.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ export declare const FRAME_STYLE: {
|
|
|
101
101
|
radius: number;
|
|
102
102
|
};
|
|
103
103
|
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
104
|
+
export declare const MIN_FONT_SIZE = 1;
|
|
104
105
|
export declare const DEFAULT_FONT_SIZE = 20;
|
|
105
106
|
export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
|
|
106
107
|
export declare const DEFAULT_TEXT_ALIGN = "left";
|
|
@@ -184,6 +185,8 @@ export declare const VERSIONS: {
|
|
|
184
185
|
readonly excalidrawLibrary: 2;
|
|
185
186
|
};
|
|
186
187
|
export declare const BOUND_TEXT_PADDING = 5;
|
|
188
|
+
export declare const ARROW_LABEL_WIDTH_FRACTION = 0.7;
|
|
189
|
+
export declare const ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;
|
|
187
190
|
export declare const VERTICAL_ALIGN: {
|
|
188
191
|
TOP: string;
|
|
189
192
|
MIDDLE: string;
|
|
@@ -223,3 +226,4 @@ export declare const DEFAULT_SIDEBAR: {
|
|
|
223
226
|
readonly name: "default";
|
|
224
227
|
readonly defaultTab: "library";
|
|
225
228
|
};
|
|
229
|
+
export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "image">;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ExcalidrawProps } from "../types";
|
|
3
2
|
import { ExcalidrawElement, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement, Theme } from "./types";
|
|
4
3
|
type EmbeddedLink = ({
|
|
@@ -142,7 +141,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
142
141
|
data: import("../charts").Spreadsheet;
|
|
143
142
|
};
|
|
144
143
|
pendingImageElementId: string | null;
|
|
145
|
-
showHyperlinkPopup: false | "
|
|
144
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
146
145
|
linkOpacity: number;
|
|
147
146
|
trayModeEnabled: boolean;
|
|
148
147
|
colorPalette?: {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer } from "./types";
|
|
3
2
|
import { Point, AppState, PointerCoords } from "../types";
|
|
4
3
|
import History from "../history";
|
|
@@ -239,7 +238,7 @@ export declare class LinearElementEditor {
|
|
|
239
238
|
data: import("../charts").Spreadsheet;
|
|
240
239
|
};
|
|
241
240
|
pendingImageElementId: string | null;
|
|
242
|
-
showHyperlinkPopup: false | "
|
|
241
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
243
242
|
linkOpacity: number;
|
|
244
243
|
trayModeEnabled: boolean;
|
|
245
244
|
colorPalette?: {
|
|
@@ -7,7 +7,7 @@ export declare const newElement: (opts: {
|
|
|
7
7
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawGenericElement>;
|
|
8
8
|
export declare const newEmbeddableElement: (opts: {
|
|
9
9
|
type: "embeddable";
|
|
10
|
-
validated:
|
|
10
|
+
validated: ExcalidrawEmbeddableElement["validated"];
|
|
11
11
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawEmbeddableElement>;
|
|
12
12
|
export declare const newFrameElement: (opts: ElementConstructorOpts) => NonDeleted<ExcalidrawFrameElement>;
|
|
13
13
|
export declare const newTextElement: (opts: {
|
|
@@ -6,7 +6,7 @@ export declare const normalizeText: (text: string) => string;
|
|
|
6
6
|
export declare const splitIntoLines: (text: string) => string[];
|
|
7
7
|
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
|
|
8
8
|
export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
9
|
-
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
|
|
9
|
+
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
|
|
10
10
|
export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => {
|
|
11
11
|
x: number;
|
|
12
12
|
y: number;
|
|
@@ -47,10 +47,6 @@ export declare const getBoundTextElement: (element: ExcalidrawElement | null) =>
|
|
|
47
47
|
export declare const getContainerElement: (element: (ExcalidrawElement & {
|
|
48
48
|
containerId: ExcalidrawElement["id"] | null;
|
|
49
49
|
}) | null) => ExcalidrawElement | null;
|
|
50
|
-
export declare const getContainerDims: (element: ExcalidrawElement) => {
|
|
51
|
-
width: number;
|
|
52
|
-
height: number;
|
|
53
|
-
};
|
|
54
50
|
export declare const getContainerCenter: (container: ExcalidrawElement, appState: AppState) => {
|
|
55
51
|
x: number;
|
|
56
52
|
y: number;
|
|
@@ -71,7 +67,7 @@ export declare const getTextBindableContainerAtPosition: (elements: readonly Exc
|
|
|
71
67
|
declare const VALID_CONTAINER_TYPES: Set<string>;
|
|
72
68
|
export declare const isValidTextContainer: (element: ExcalidrawElement) => boolean;
|
|
73
69
|
export declare const computeContainerDimensionForBoundText: (dimension: number, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>, legacy?: boolean) => number;
|
|
74
|
-
export declare const getBoundTextMaxWidth: (container: ExcalidrawElement) => number;
|
|
70
|
+
export declare const getBoundTextMaxWidth: (container: ExcalidrawElement, boundTextElement?: ExcalidrawTextElement | null) => number;
|
|
75
71
|
export declare const getBoundTextMaxHeight: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => number;
|
|
76
72
|
export declare const isMeasureTextSupported: () => boolean;
|
|
77
73
|
export declare const getDefaultLineHeight: (fontFamily: FontFamilyValues) => number & {
|
package/types/element/types.d.ts
CHANGED
|
@@ -74,15 +74,15 @@ export type ExcalidrawEllipseElement = _ExcalidrawElementBase & {
|
|
|
74
74
|
type: "ellipse";
|
|
75
75
|
};
|
|
76
76
|
export type ExcalidrawEmbeddableElement = _ExcalidrawElementBase & Readonly<{
|
|
77
|
+
type: "embeddable";
|
|
77
78
|
/**
|
|
78
79
|
* indicates whether the embeddable src (url) has been validated for rendering.
|
|
79
|
-
*
|
|
80
|
+
* null value indicates that the validation is pending. We reset the
|
|
80
81
|
* value on each restore (or url change) so that we can guarantee
|
|
81
82
|
* the validation came from a trusted source (the editor). Also because we
|
|
82
83
|
* may not have access to host-app supplied url validator during restore.
|
|
83
84
|
*/
|
|
84
|
-
validated
|
|
85
|
-
type: "embeddable";
|
|
85
|
+
validated: boolean | null;
|
|
86
86
|
}>;
|
|
87
87
|
export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
88
88
|
type: "image";
|
|
@@ -100,13 +100,13 @@ export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
|
|
|
100
100
|
/**
|
|
101
101
|
* These are elements that don't have any additional properties.
|
|
102
102
|
*/
|
|
103
|
-
export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement |
|
|
103
|
+
export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
104
104
|
/**
|
|
105
105
|
* ExcalidrawElement should be JSON serializable and (eventually) contain
|
|
106
106
|
* no computed data. The list of all ExcalidrawElements should be shareable
|
|
107
107
|
* between peers and contain no state local to the peer.
|
|
108
108
|
*/
|
|
109
|
-
export type ExcalidrawElement = ExcalidrawGenericElement | ExcalidrawTextElement | ExcalidrawLinearElement | ExcalidrawFreeDrawElement | ExcalidrawImageElement | ExcalidrawFrameElement;
|
|
109
|
+
export type ExcalidrawElement = ExcalidrawGenericElement | ExcalidrawTextElement | ExcalidrawLinearElement | ExcalidrawFreeDrawElement | ExcalidrawImageElement | ExcalidrawFrameElement | ExcalidrawEmbeddableElement;
|
|
110
110
|
export type NonDeleted<TElement extends ExcalidrawElement> = TElement & {
|
|
111
111
|
isDeleted: boolean;
|
|
112
112
|
};
|
package/types/i18n.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import fallbackLangData from "./locales/en.json";
|
|
2
|
+
import { NestedKeyOf } from "./utility-types";
|
|
1
3
|
export interface Language {
|
|
2
4
|
code: string;
|
|
3
5
|
label: string;
|
|
4
6
|
rtl?: boolean;
|
|
5
7
|
}
|
|
8
|
+
export type TranslationKeys = NestedKeyOf<typeof fallbackLangData>;
|
|
6
9
|
export declare const defaultLang: {
|
|
7
10
|
code: string;
|
|
8
11
|
label: string;
|
|
@@ -10,11 +13,11 @@ export declare const defaultLang: {
|
|
|
10
13
|
export declare const languages: Language[];
|
|
11
14
|
export declare const setLanguage: (lang: Language) => Promise<void>;
|
|
12
15
|
export declare const getLanguage: () => Language;
|
|
13
|
-
export declare const t: (path:
|
|
16
|
+
export declare const t: (path: NestedKeyOf<typeof fallbackLangData>, replacement?: {
|
|
14
17
|
[key: string]: string | number;
|
|
15
18
|
} | null | undefined, fallback?: string) => string;
|
|
16
19
|
export declare const useI18n: () => {
|
|
17
|
-
t: (path:
|
|
20
|
+
t: (path: NestedKeyOf<typeof fallbackLangData>, replacement?: {
|
|
18
21
|
[key: string]: string | number;
|
|
19
22
|
} | null | undefined, fallback?: string) => string;
|
|
20
23
|
langCode: string;
|
|
@@ -26,6 +26,7 @@ export { FONT_FAMILY, THEME, MIME_TYPES } from "../../constants";
|
|
|
26
26
|
export { mutateElement, newElementWith, bumpVersion, } from "../../element/mutateElement";
|
|
27
27
|
export { parseLibraryTokensFromUrl, useHandleLibrary, } from "../../data/library";
|
|
28
28
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "../../utils";
|
|
29
|
+
export { getEmbedLink } from "../../element/embeddable";
|
|
29
30
|
export { Sidebar } from "../../components/Sidebar/Sidebar";
|
|
30
31
|
export { Button } from "../../components/Button";
|
|
31
32
|
export { Footer };
|