@excalidraw/math 0.18.0-ec07091 → 0.18.0-f2600fe
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/types/common/src/constants.d.ts +3 -16
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/utils.d.ts +0 -2
- package/dist/types/element/src/resizeTest.d.ts +5 -4
- package/dist/types/element/src/transformHandles.d.ts +5 -4
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +18 -9
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +12 -6
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +78 -39
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +36 -18
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +19 -10
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +12 -6
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionExport.d.ts +54 -27
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +12 -6
- package/dist/types/excalidraw/actions/actionFrame.d.ts +24 -12
- package/dist/types/excalidraw/actions/actionGroup.d.ts +12 -6
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionLink.d.ts +4 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -372
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +12 -6
- package/dist/types/excalidraw/actions/actionProperties.d.ts +91 -46
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionStyles.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +6 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -4
- package/dist/types/excalidraw/actions/index.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +5 -2
- package/dist/types/excalidraw/components/Actions.d.ts +13 -3
- package/dist/types/excalidraw/components/App.d.ts +19 -17
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -2
- 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/FilledButton.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +2 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- 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/Popover.d.ts +2 -1
- 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/canvases/InteractiveCanvas.d.ts +3 -2
- 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 +5 -1
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +13 -1
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
- package/dist/types/excalidraw/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +3 -3
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +16 -17
- package/package.json +2 -2
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type EditorInterface } from "@excalidraw/common";
|
|
2
3
|
import "./LiveCollaborationTrigger.scss";
|
|
3
4
|
declare const LiveCollaborationTrigger: {
|
|
4
|
-
({ isCollaborating, onSelect, ...rest }: {
|
|
5
|
+
({ isCollaborating, onSelect, editorInterface, ...rest }: {
|
|
5
6
|
isCollaborating: boolean;
|
|
6
7
|
onSelect: () => void;
|
|
8
|
+
editorInterface?: Readonly<{
|
|
9
|
+
formFactor: "phone" | "tablet" | "desktop";
|
|
10
|
+
desktopUIMode: "compact" | "full";
|
|
11
|
+
userAgent: Readonly<{
|
|
12
|
+
isMobileDevice: boolean;
|
|
13
|
+
platform: "other" | "ios" | "android" | "unknown";
|
|
14
|
+
}>;
|
|
15
|
+
isTouchScreen: boolean;
|
|
16
|
+
canFitSidebar: boolean;
|
|
17
|
+
isLandscape: boolean;
|
|
18
|
+
}> | undefined;
|
|
7
19
|
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): import("react/jsx-runtime").JSX.Element;
|
|
8
20
|
displayName: string;
|
|
9
21
|
};
|
|
@@ -25,9 +25,6 @@ declare const MainMenu: React.FC<{
|
|
|
25
25
|
order?: number | undefined;
|
|
26
26
|
onSelect?: ((event: Event) => void) | undefined;
|
|
27
27
|
children: React.ReactNode;
|
|
28
|
-
/**
|
|
29
|
-
* Called when any menu item is selected (clicked on).
|
|
30
|
-
*/
|
|
31
28
|
shortcut?: string | undefined;
|
|
32
29
|
hovered?: boolean | undefined;
|
|
33
30
|
selected?: boolean | undefined;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare function useOutsideClick<T extends HTMLElement>(ref: React.RefObject<T | null>,
|
|
3
3
|
/** if performance is of concern, memoize the callback */
|
|
4
|
-
callback: (event: Event
|
|
4
|
+
callback: (event: Event & {
|
|
5
|
+
target: T;
|
|
6
|
+
}) => void,
|
|
5
7
|
/**
|
|
6
8
|
* Optional callback which is called on every click.
|
|
7
9
|
*
|
|
@@ -20,17 +20,16 @@ export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "
|
|
|
20
20
|
export { getFreeDrawSvgPath } from "@excalidraw/element";
|
|
21
21
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
22
22
|
export { isLinearElement } from "@excalidraw/element";
|
|
23
|
-
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, } from "@excalidraw/common";
|
|
23
|
+
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, } from "@excalidraw/common";
|
|
24
24
|
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
|
|
25
25
|
export { CaptureUpdateAction } from "@excalidraw/element";
|
|
26
26
|
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
27
|
-
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "@excalidraw/common";
|
|
28
27
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
29
28
|
export { Button } from "./components/Button";
|
|
30
29
|
export { Footer };
|
|
31
30
|
export { MainMenu };
|
|
32
31
|
export { Ellipsify } from "./components/Ellipsify";
|
|
33
|
-
export {
|
|
32
|
+
export { useEditorInterface, useStylesPanelMode } from "./components/App";
|
|
34
33
|
export { WelcomeScreen };
|
|
35
34
|
export { LiveCollaborationTrigger };
|
|
36
35
|
export { Stats } from "./components/Stats";
|
|
@@ -9,7 +9,7 @@ export declare const renderInteractiveSceneThrottled: {
|
|
|
9
9
|
* Interactive scene is the ui-canvas where we render bounding boxes, selections
|
|
10
10
|
* and other ui stuff.
|
|
11
11
|
*/
|
|
12
|
-
export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig,
|
|
12
|
+
export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, editorInterface, }: InteractiveSceneRenderConfig) => {
|
|
13
13
|
atLeastOneVisibleElement: boolean;
|
|
14
14
|
elementsMap: RenderableElementsMap;
|
|
15
15
|
scrollBars?: undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { UserIdleState } from "@excalidraw/common";
|
|
1
|
+
import type { UserIdleState, EditorInterface } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
3
3
|
import type { MakeBrand } from "@excalidraw/common/utility-types";
|
|
4
|
-
import type { AppClassProperties, AppState, EmbedsValidationStatus, ElementsPendingErasure, InteractiveCanvasAppState, StaticCanvasAppState, SocketId,
|
|
4
|
+
import type { AppClassProperties, AppState, EmbedsValidationStatus, ElementsPendingErasure, InteractiveCanvasAppState, StaticCanvasAppState, SocketId, PendingExcalidrawElements } from "../types";
|
|
5
5
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
6
6
|
import type { Drawable } from "roughjs/bin/core";
|
|
7
7
|
export type RenderableElementsMap = NonDeletedElementsMap & MakeBrand<"RenderableElementsMap">;
|
|
@@ -69,7 +69,7 @@ export type InteractiveSceneRenderConfig = {
|
|
|
69
69
|
scale: number;
|
|
70
70
|
appState: InteractiveCanvasAppState;
|
|
71
71
|
renderConfig: InteractiveCanvasRenderConfig;
|
|
72
|
-
|
|
72
|
+
editorInterface: EditorInterface;
|
|
73
73
|
callback: (data: RenderInteractiveSceneCallback) => void;
|
|
74
74
|
};
|
|
75
75
|
export type NewElementSceneRenderConfig = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getShortcutKey: (shortcut: string) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES } from "@excalidraw/common";
|
|
1
|
+
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, EditorInterface } from "@excalidraw/common";
|
|
2
2
|
import type { SuggestedBinding } from "@excalidraw/element";
|
|
3
3
|
import type { LinearElementEditor } from "@excalidraw/element";
|
|
4
4
|
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
@@ -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;
|
|
@@ -251,7 +255,7 @@ export interface AppState {
|
|
|
251
255
|
isResizing: boolean;
|
|
252
256
|
isRotating: boolean;
|
|
253
257
|
zoom: Zoom;
|
|
254
|
-
openMenu: "canvas" |
|
|
258
|
+
openMenu: "canvas" | null;
|
|
255
259
|
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
256
260
|
openSidebar: {
|
|
257
261
|
name: SidebarName;
|
|
@@ -351,8 +355,6 @@ export interface AppState {
|
|
|
351
355
|
lockedMultiSelections: {
|
|
352
356
|
[groupId: string]: true;
|
|
353
357
|
};
|
|
354
|
-
/** properties sidebar mode - determines whether to show compact or complete sidebar */
|
|
355
|
-
stylesPanelMode: "compact" | "full";
|
|
356
358
|
}
|
|
357
359
|
export type SearchMatch = {
|
|
358
360
|
id: string;
|
|
@@ -443,6 +445,7 @@ export interface ExcalidrawProps {
|
|
|
443
445
|
onDuplicate?: (nextElements: readonly ExcalidrawElement[],
|
|
444
446
|
/** excludes the duplicated elements */
|
|
445
447
|
prevElements: readonly ExcalidrawElement[]) => ExcalidrawElement[] | void;
|
|
448
|
+
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
446
449
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
447
450
|
langCode?: Language["code"];
|
|
448
451
|
viewModeEnabled?: boolean;
|
|
@@ -500,6 +503,12 @@ export type UIOptions = Partial<{
|
|
|
500
503
|
tools: {
|
|
501
504
|
image: boolean;
|
|
502
505
|
};
|
|
506
|
+
/**
|
|
507
|
+
* Optionally control the editor form factor and desktop UI mode from the host app.
|
|
508
|
+
* If not provided, we will take care of it internally.
|
|
509
|
+
*/
|
|
510
|
+
formFactor?: EditorInterface["formFactor"];
|
|
511
|
+
desktopUIMode?: EditorInterface["desktopUIMode"];
|
|
503
512
|
/** @deprecated does nothing. Will be removed in 0.15 */
|
|
504
513
|
welcomeScreen?: boolean;
|
|
505
514
|
}>;
|
|
@@ -530,7 +539,7 @@ export type AppClassProperties = {
|
|
|
530
539
|
mimeType: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
531
540
|
}>;
|
|
532
541
|
files: BinaryFiles;
|
|
533
|
-
|
|
542
|
+
editorInterface: App["editorInterface"];
|
|
534
543
|
scene: App["scene"];
|
|
535
544
|
syncActionResult: App["syncActionResult"];
|
|
536
545
|
fonts: App["fonts"];
|
|
@@ -559,7 +568,7 @@ export type AppClassProperties = {
|
|
|
559
568
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
560
569
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
561
570
|
updateEditorAtom: App["updateEditorAtom"];
|
|
562
|
-
|
|
571
|
+
onPointerDownEmitter: App["onPointerDownEmitter"];
|
|
563
572
|
};
|
|
564
573
|
export type PointerDownState = Readonly<{
|
|
565
574
|
origin: Readonly<{
|
|
@@ -645,6 +654,7 @@ export interface ExcalidrawImperativeAPI {
|
|
|
645
654
|
setCursor: InstanceType<typeof App>["setCursor"];
|
|
646
655
|
resetCursor: InstanceType<typeof App>["resetCursor"];
|
|
647
656
|
toggleSidebar: InstanceType<typeof App>["toggleSidebar"];
|
|
657
|
+
getEditorInterface: () => EditorInterface;
|
|
648
658
|
/**
|
|
649
659
|
* Disables rendering of frames (including element clipping), but currently
|
|
650
660
|
* the frames are still interactive in edit mode. As such, this API should be
|
|
@@ -658,17 +668,6 @@ export interface ExcalidrawImperativeAPI {
|
|
|
658
668
|
onScrollChange: (callback: (scrollX: number, scrollY: number, zoom: Zoom) => void) => UnsubscribeCallback;
|
|
659
669
|
onUserFollow: (callback: (payload: OnUserFollowedPayload) => void) => UnsubscribeCallback;
|
|
660
670
|
}
|
|
661
|
-
export type Device = Readonly<{
|
|
662
|
-
viewport: {
|
|
663
|
-
isMobile: boolean;
|
|
664
|
-
isLandscape: boolean;
|
|
665
|
-
};
|
|
666
|
-
editor: {
|
|
667
|
-
isMobile: boolean;
|
|
668
|
-
canFitSidebar: boolean;
|
|
669
|
-
};
|
|
670
|
-
isTouchScreen: boolean;
|
|
671
|
-
}>;
|
|
672
671
|
export type FrameNameBounds = {
|
|
673
672
|
x: number;
|
|
674
673
|
y: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excalidraw/math",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-f2600fe",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/math/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@excalidraw/common": "0.18.0-
|
|
64
|
+
"@excalidraw/common": "0.18.0-f2600fe"
|
|
65
65
|
}
|
|
66
66
|
}
|