@myoc/element 0.20.0 → 0.20.1
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.
|
@@ -17,6 +17,7 @@ type ToolPopoverProps = {
|
|
|
17
17
|
"data-testid": string;
|
|
18
18
|
onToolChange: (type: string) => void;
|
|
19
19
|
displayedOption: ToolOption;
|
|
20
|
+
shortcut?: string;
|
|
20
21
|
};
|
|
21
|
-
export declare const ToolPopover: ({ app, options, activeTool, defaultOption, "data-testid": dataTestId, onToolChange, displayedOption, }: ToolPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const ToolPopover: ({ app, options, activeTool, defaultOption, "data-testid": dataTestId, onToolChange, displayedOption, shortcut, }: ToolPopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import type { AppClassProperties, AppProps, AppState, UIAppState } from "../types";
|
|
2
2
|
import type { ActionManager } from "../actions/manager";
|
|
3
|
+
import type { ToolbarToolType } from "./Tools";
|
|
4
|
+
export type ExcalidrawToolbarOverflowItemName = ToolbarToolType | "objectsSnapMode" | "strokeEyedropper";
|
|
5
|
+
export declare const ObjectsSnapModeButton: ({ actionManager, app, }: {
|
|
6
|
+
actionManager: ActionManager;
|
|
7
|
+
app: AppClassProperties;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare const StrokeEyeDropperButton: ({ app, }: {
|
|
10
|
+
app: AppClassProperties;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const ExtraToolsDropdown: ({ app, activeTool, setAppState, UIOptions, isMyocSimplifiedMode, actionManager, overflowItems, }: {
|
|
13
|
+
app: AppClassProperties;
|
|
14
|
+
activeTool: UIAppState["activeTool"];
|
|
15
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
16
|
+
UIOptions: AppProps["UIOptions"];
|
|
17
|
+
isMyocSimplifiedMode: boolean;
|
|
18
|
+
actionManager: ActionManager;
|
|
19
|
+
overflowItems?: readonly ExcalidrawToolbarOverflowItemName[];
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
3
21
|
/** the main (desktop/tablet) toolbar island */
|
|
4
22
|
export declare const Toolbar: ({ app, appState, setAppState, UIOptions, actionManager, onPenModeToggle, onLockToggle, heading, showPenMode, }: {
|
|
5
23
|
app: AppClassProperties;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PointerType } from "@excalidraw/element/types";
|
|
1
2
|
import type { AppClassProperties, AppState, ToolType, UIAppState } from "../types";
|
|
2
3
|
export type ToolConfig = {
|
|
3
4
|
icon: React.ReactNode;
|
|
@@ -68,6 +69,30 @@ export type ToolButtonComponentProps = {
|
|
|
68
69
|
*/
|
|
69
70
|
hideShortcut?: boolean;
|
|
70
71
|
};
|
|
72
|
+
type ToolButtonBehavior = {
|
|
73
|
+
/**
|
|
74
|
+
* display the shortcut of another tool (tooltip, aria, keybinding badge) —
|
|
75
|
+
* e.g. the lasso button shows the selection shortcut, which activates it
|
|
76
|
+
* when lasso is the preferred selection tool
|
|
77
|
+
*/
|
|
78
|
+
shortcutType?: ToolbarToolType;
|
|
79
|
+
/**
|
|
80
|
+
* custom activation — replaces the default track + `setActiveTool` (pen
|
|
81
|
+
* detection still runs before it)
|
|
82
|
+
*/
|
|
83
|
+
onSelect?: (app: AppClassProperties, data: {
|
|
84
|
+
pointerType: PointerType | null;
|
|
85
|
+
}) => void;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Creates a toolbar button component for the given tool. Activation is
|
|
89
|
+
* uniform: track + `setActiveTool` (recording the previous tool for toggle
|
|
90
|
+
* tools), with pen detection on the first pen interaction.
|
|
91
|
+
*/
|
|
92
|
+
export declare const createToolButton: (type: ToolbarToolType, behavior?: ToolButtonBehavior) => {
|
|
93
|
+
({ app, activeTool, hideKeyBinding, hideShortcut, }: ToolButtonComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
71
96
|
export declare const HandToolButton: {
|
|
72
97
|
({ app, activeTool, hideKeyBinding, hideShortcut, }: ToolButtonComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
73
98
|
displayName: string;
|
|
@@ -136,10 +161,11 @@ export declare const LassoToolButton: {
|
|
|
136
161
|
* The selection ⇄ lasso popover used in compact (tablet) and mobile
|
|
137
162
|
* toolbars; picking an option also makes it the preferred selection tool.
|
|
138
163
|
*/
|
|
139
|
-
export declare const SelectionToolPopover: ({ app, activeTool, setAppState, }: {
|
|
164
|
+
export declare const SelectionToolPopover: ({ app, activeTool, setAppState, hideShortcut, }: {
|
|
140
165
|
app: AppClassProperties;
|
|
141
166
|
activeTool: UIAppState["activeTool"];
|
|
142
167
|
setAppState: React.Component<any, AppState>["setState"];
|
|
168
|
+
hideShortcut?: boolean;
|
|
143
169
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
144
170
|
/**
|
|
145
171
|
* The freedraw ⇄ draw-shape popover used in compact (tablet) and mobile
|
|
@@ -149,3 +175,4 @@ export declare const FreedrawToolPopover: ({ app, activeTool, }: {
|
|
|
149
175
|
app: AppClassProperties;
|
|
150
176
|
activeTool: UIAppState["activeTool"];
|
|
151
177
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
178
|
+
export {};
|
|
@@ -711,6 +711,8 @@ export type ExcalidrawUICustomItem = ExcalidrawUIItemLayout & {
|
|
|
711
711
|
render: (context: {
|
|
712
712
|
api: ExcalidrawImperativeAPI;
|
|
713
713
|
appState: UIAppState;
|
|
714
|
+
/** Current canvas zoom, updated reactively when the viewport zoom changes. */
|
|
715
|
+
zoom: AppState["zoom"];
|
|
714
716
|
editorInterface: EditorInterface;
|
|
715
717
|
region: ExcalidrawUIRegion;
|
|
716
718
|
orientation: Exclude<ExcalidrawUIOrientation, "auto">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myoc/element",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/element/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@discourse/gif": "1.0.0",
|
|
68
|
-
"@excalidraw/common": "npm:@myoc/common@0.20.
|
|
69
|
-
"@excalidraw/fractional-indexing": "npm:@myoc/fractional-indexing@0.20.
|
|
70
|
-
"@excalidraw/math": "npm:@myoc/math@0.20.
|
|
68
|
+
"@excalidraw/common": "npm:@myoc/common@0.20.1",
|
|
69
|
+
"@excalidraw/fractional-indexing": "npm:@myoc/fractional-indexing@0.20.1",
|
|
70
|
+
"@excalidraw/math": "npm:@myoc/math@0.20.1",
|
|
71
71
|
"thumbhash": "0.1.1"
|
|
72
72
|
}
|
|
73
73
|
}
|