@excalidraw/element 0.18.0-835eb8d → 0.18.0-8608d7b
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 +1 -1
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +1 -1
- package/dist/types/common/src/constants.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +15 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +65 -13
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +30 -6
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +15 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +45 -9
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +20 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +15 -3
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionProperties.d.ts +76 -16
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -1
- package/dist/types/excalidraw/appState.d.ts +4 -1
- package/dist/types/excalidraw/components/Actions.d.ts +9 -2
- package/dist/types/excalidraw/components/App.d.ts +8 -3
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +0 -1
- package/dist/types/excalidraw/types.d.ts +7 -2
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import "./ExcalidrawLogo.scss";
|
|
3
|
-
type LogoSize = "xs" | "small" | "normal" | "large" | "custom";
|
|
3
|
+
type LogoSize = "xs" | "small" | "normal" | "large" | "custom" | "mobile";
|
|
4
4
|
interface LogoProps {
|
|
5
5
|
size?: LogoSize;
|
|
6
6
|
withText?: boolean;
|
|
@@ -2,6 +2,7 @@ import type { FontFamilyValues } from "@excalidraw/element/types";
|
|
|
2
2
|
interface FontPickerTriggerProps {
|
|
3
3
|
selectedFontFamily: FontFamilyValues | null;
|
|
4
4
|
isOpened?: boolean;
|
|
5
|
+
compactMode?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare const FontPickerTrigger: ({ selectedFontFamily, isOpened, }: FontPickerTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const FontPickerTrigger: ({ selectedFontFamily, isOpened, compactMode, }: FontPickerTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -17,6 +17,7 @@ interface LayerUIProps {
|
|
|
17
17
|
onPenModeToggle: AppClassProperties["togglePenMode"];
|
|
18
18
|
showExitZenModeBtn: boolean;
|
|
19
19
|
langCode: Language["code"];
|
|
20
|
+
renderTopLeftUI?: ExcalidrawProps["renderTopLeftUI"];
|
|
20
21
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
21
22
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
22
23
|
UIOptions: AppProps["UIOptions"];
|
|
@@ -27,5 +28,5 @@ interface LayerUIProps {
|
|
|
27
28
|
isCollaborating: boolean;
|
|
28
29
|
generateLinkForSelection?: AppProps["generateLinkForSelection"];
|
|
29
30
|
}
|
|
30
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, isCollaborating, generateLinkForSelection, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
|
|
31
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopLeftUI, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, isCollaborating, generateLinkForSelection, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
|
|
31
32
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
import type { ActionManager } from "../actions/manager";
|
|
4
|
-
import type { AppClassProperties, AppProps, AppState,
|
|
4
|
+
import type { AppClassProperties, AppProps, AppState, UIAppState } from "../types";
|
|
5
5
|
import type { JSX } from "react";
|
|
6
6
|
type MobileMenuProps = {
|
|
7
7
|
appState: UIAppState;
|
|
@@ -10,16 +10,14 @@ type MobileMenuProps = {
|
|
|
10
10
|
renderImageExportDialog: () => React.ReactNode;
|
|
11
11
|
setAppState: React.Component<any, AppState>["setState"];
|
|
12
12
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
13
|
-
onLockToggle: () => void;
|
|
14
13
|
onHandToolToggle: () => void;
|
|
15
14
|
onPenModeToggle: AppClassProperties["togglePenMode"];
|
|
16
15
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
17
|
-
|
|
16
|
+
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
18
17
|
renderSidebars: () => JSX.Element | null;
|
|
19
|
-
device: Device;
|
|
20
18
|
renderWelcomeScreen: boolean;
|
|
21
19
|
UIOptions: AppProps["UIOptions"];
|
|
22
20
|
app: AppClassProperties;
|
|
23
21
|
};
|
|
24
|
-
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState,
|
|
22
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onHandToolToggle, renderTopLeftUI, renderTopRightUI, renderSidebars, renderWelcomeScreen, UIOptions, app, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
23
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./ToolIcon.scss";
|
|
3
|
+
import "./MobileToolBar.scss";
|
|
4
|
+
import type { AppClassProperties, UIAppState } from "../types";
|
|
5
|
+
type MobileToolBarProps = {
|
|
6
|
+
app: AppClassProperties;
|
|
7
|
+
onHandToolToggle: () => void;
|
|
8
|
+
setAppState: React.Component<any, UIAppState>["setState"];
|
|
9
|
+
};
|
|
10
|
+
export declare const MobileToolBar: ({ app, onHandToolToggle, setAppState, }: MobileToolBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ToolPopover.scss";
|
|
3
|
+
import type { AppClassProperties } from "../types";
|
|
4
|
+
type ToolOption = {
|
|
5
|
+
type: string;
|
|
6
|
+
icon: React.ReactNode;
|
|
7
|
+
title?: string;
|
|
8
|
+
};
|
|
9
|
+
type ToolPopoverProps = {
|
|
10
|
+
app: AppClassProperties;
|
|
11
|
+
options: readonly ToolOption[];
|
|
12
|
+
activeTool: {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
defaultOption: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
namePrefix: string;
|
|
18
|
+
title: string;
|
|
19
|
+
"data-testid": string;
|
|
20
|
+
onToolChange: (type: string) => void;
|
|
21
|
+
displayedOption: ToolOption;
|
|
22
|
+
fillable?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare const ToolPopover: ({ app, options, activeTool, defaultOption, className, namePrefix, title, "data-testid": dataTestId, onToolChange, displayedOption, fillable, }: ToolPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./DropdownMenu.scss";
|
|
3
3
|
declare const DropdownMenu: {
|
|
4
|
-
({ children, open, }: {
|
|
4
|
+
({ children, open, placement, }: {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
open: boolean;
|
|
7
|
+
placement?: "top" | "bottom" | undefined;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
Trigger: {
|
|
9
10
|
({ className, children, onToggle, title, ...rest }: {
|
|
@@ -15,12 +16,13 @@ declare const DropdownMenu: {
|
|
|
15
16
|
displayName: string;
|
|
16
17
|
};
|
|
17
18
|
Content: {
|
|
18
|
-
({ children, onClickOutside, className, onSelect, style, }: {
|
|
19
|
+
({ children, onClickOutside, className, onSelect, style, placement, }: {
|
|
19
20
|
children?: React.ReactNode;
|
|
20
21
|
onClickOutside?: (() => void) | undefined;
|
|
21
22
|
className?: string | undefined;
|
|
22
23
|
onSelect?: ((event: Event) => void) | undefined;
|
|
23
24
|
style?: React.CSSProperties | undefined;
|
|
25
|
+
placement?: "top" | "bottom" | undefined;
|
|
24
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
25
27
|
displayName: string;
|
|
26
28
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const MenuContent: {
|
|
3
|
-
({ children, onClickOutside, className, onSelect, style, }: {
|
|
3
|
+
({ children, onClickOutside, className, onSelect, style, placement, }: {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
onClickOutside?: (() => void) | undefined;
|
|
6
6
|
className?: string | undefined;
|
|
@@ -9,6 +9,7 @@ declare const MenuContent: {
|
|
|
9
9
|
*/
|
|
10
10
|
onSelect?: ((event: Event) => void) | undefined;
|
|
11
11
|
style?: React.CSSProperties | undefined;
|
|
12
|
+
placement?: "top" | "bottom" | undefined;
|
|
12
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
displayName: string;
|
|
14
15
|
};
|
|
@@ -226,6 +226,5 @@ export declare const cropIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
226
226
|
export declare const elementLinkIcon: import("react/jsx-runtime").JSX.Element;
|
|
227
227
|
export declare const resizeIcon: import("react/jsx-runtime").JSX.Element;
|
|
228
228
|
export declare const adjustmentsIcon: import("react/jsx-runtime").JSX.Element;
|
|
229
|
-
export declare const backgroundIcon: import("react/jsx-runtime").JSX.Element;
|
|
230
229
|
export declare const strokeIcon: import("react/jsx-runtime").JSX.Element;
|
|
231
230
|
export {};
|
|
@@ -221,6 +221,10 @@ export interface AppState {
|
|
|
221
221
|
locked: boolean;
|
|
222
222
|
fromSelection: boolean;
|
|
223
223
|
} & ActiveTool;
|
|
224
|
+
preferredSelectionTool: {
|
|
225
|
+
type: "selection" | "lasso";
|
|
226
|
+
initialized: boolean;
|
|
227
|
+
};
|
|
224
228
|
penMode: boolean;
|
|
225
229
|
penDetected: boolean;
|
|
226
230
|
exportBackground: boolean;
|
|
@@ -352,7 +356,7 @@ export interface AppState {
|
|
|
352
356
|
[groupId: string]: true;
|
|
353
357
|
};
|
|
354
358
|
/** properties sidebar mode - determines whether to show compact or complete sidebar */
|
|
355
|
-
stylesPanelMode: "compact" | "full";
|
|
359
|
+
stylesPanelMode: "compact" | "full" | "mobile";
|
|
356
360
|
}
|
|
357
361
|
export type SearchMatch = {
|
|
358
362
|
id: string;
|
|
@@ -443,6 +447,7 @@ export interface ExcalidrawProps {
|
|
|
443
447
|
onDuplicate?: (nextElements: readonly ExcalidrawElement[],
|
|
444
448
|
/** excludes the duplicated elements */
|
|
445
449
|
prevElements: readonly ExcalidrawElement[]) => ExcalidrawElement[] | void;
|
|
450
|
+
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
446
451
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
447
452
|
langCode?: Language["code"];
|
|
448
453
|
viewModeEnabled?: boolean;
|
|
@@ -559,7 +564,7 @@ export type AppClassProperties = {
|
|
|
559
564
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
560
565
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
561
566
|
updateEditorAtom: App["updateEditorAtom"];
|
|
562
|
-
|
|
567
|
+
onPointerDownEmitter: App["onPointerDownEmitter"];
|
|
563
568
|
};
|
|
564
569
|
export type PointerDownState = Readonly<{
|
|
565
570
|
origin: Readonly<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excalidraw/element",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-8608d7b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/element/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@excalidraw/common": "0.18.0-
|
|
61
|
-
"@excalidraw/math": "0.18.0-
|
|
60
|
+
"@excalidraw/common": "0.18.0-8608d7b",
|
|
61
|
+
"@excalidraw/math": "0.18.0-8608d7b"
|
|
62
62
|
}
|
|
63
63
|
}
|