@excalidraw/element 0.18.0-7b8a5f54c → 0.18.0-7f66e1f
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 +835 -527
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +14 -14
- package/dist/types/common/src/constants.d.ts +18 -15
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/index.d.ts +2 -0
- package/dist/types/common/src/utils.d.ts +2 -1
- package/dist/types/common/src/visualdebug.d.ts +41 -0
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/delta.d.ts +4 -4
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -1
- package/dist/types/element/src/resizeTest.d.ts +5 -4
- package/dist/types/element/src/store.d.ts +3 -2
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/transformHandles.d.ts +5 -4
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -9
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +94 -41
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +42 -18
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +22 -10
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionExport.d.ts +63 -27
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -12
- package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +8 -4
- package/dist/types/excalidraw/actions/actionLink.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -369
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -53
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +8 -4
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +5 -1
- package/dist/types/excalidraw/clipboard.d.ts +64 -1
- package/dist/types/excalidraw/components/Actions.d.ts +21 -4
- package/dist/types/excalidraw/components/App.d.ts +28 -24
- 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/CommandPalette/CommandPalette.d.ts +1 -0
- 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/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -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/PropertiesPopover.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +6 -3
- 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 +10 -0
- 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/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +3 -7
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +5 -13
- package/dist/types/excalidraw/scene/types.d.ts +11 -3
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/types.d.ts +18 -15
- package/dist/types/math/src/segment.d.ts +1 -0
- package/package.json +3 -3
|
@@ -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,8 +255,8 @@ export interface AppState {
|
|
|
251
255
|
isResizing: boolean;
|
|
252
256
|
isRotating: boolean;
|
|
253
257
|
zoom: Zoom;
|
|
254
|
-
openMenu: "canvas" |
|
|
255
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | null;
|
|
258
|
+
openMenu: "canvas" | null;
|
|
259
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
256
260
|
openSidebar: {
|
|
257
261
|
name: SidebarName;
|
|
258
262
|
tab?: SidebarTabName;
|
|
@@ -441,6 +445,7 @@ export interface ExcalidrawProps {
|
|
|
441
445
|
onDuplicate?: (nextElements: readonly ExcalidrawElement[],
|
|
442
446
|
/** excludes the duplicated elements */
|
|
443
447
|
prevElements: readonly ExcalidrawElement[]) => ExcalidrawElement[] | void;
|
|
448
|
+
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
444
449
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
445
450
|
langCode?: Language["code"];
|
|
446
451
|
viewModeEnabled?: boolean;
|
|
@@ -498,6 +503,12 @@ export type UIOptions = Partial<{
|
|
|
498
503
|
tools: {
|
|
499
504
|
image: boolean;
|
|
500
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"];
|
|
501
512
|
/** @deprecated does nothing. Will be removed in 0.15 */
|
|
502
513
|
welcomeScreen?: boolean;
|
|
503
514
|
}>;
|
|
@@ -528,7 +539,7 @@ export type AppClassProperties = {
|
|
|
528
539
|
mimeType: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
529
540
|
}>;
|
|
530
541
|
files: BinaryFiles;
|
|
531
|
-
|
|
542
|
+
editorInterface: App["editorInterface"];
|
|
532
543
|
scene: App["scene"];
|
|
533
544
|
syncActionResult: App["syncActionResult"];
|
|
534
545
|
fonts: App["fonts"];
|
|
@@ -557,6 +568,7 @@ export type AppClassProperties = {
|
|
|
557
568
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
558
569
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
559
570
|
updateEditorAtom: App["updateEditorAtom"];
|
|
571
|
+
onPointerDownEmitter: App["onPointerDownEmitter"];
|
|
560
572
|
};
|
|
561
573
|
export type PointerDownState = Readonly<{
|
|
562
574
|
origin: Readonly<{
|
|
@@ -604,6 +616,7 @@ export type PointerDownState = Readonly<{
|
|
|
604
616
|
x: number;
|
|
605
617
|
y: number;
|
|
606
618
|
};
|
|
619
|
+
blockDragging: boolean;
|
|
607
620
|
};
|
|
608
621
|
eventListeners: {
|
|
609
622
|
onMove: null | ReturnType<typeof throttleRAF>;
|
|
@@ -641,6 +654,7 @@ export interface ExcalidrawImperativeAPI {
|
|
|
641
654
|
setCursor: InstanceType<typeof App>["setCursor"];
|
|
642
655
|
resetCursor: InstanceType<typeof App>["resetCursor"];
|
|
643
656
|
toggleSidebar: InstanceType<typeof App>["toggleSidebar"];
|
|
657
|
+
getEditorInterface: () => EditorInterface;
|
|
644
658
|
/**
|
|
645
659
|
* Disables rendering of frames (including element clipping), but currently
|
|
646
660
|
* the frames are still interactive in edit mode. As such, this API should be
|
|
@@ -654,17 +668,6 @@ export interface ExcalidrawImperativeAPI {
|
|
|
654
668
|
onScrollChange: (callback: (scrollX: number, scrollY: number, zoom: Zoom) => void) => UnsubscribeCallback;
|
|
655
669
|
onUserFollow: (callback: (payload: OnUserFollowedPayload) => void) => UnsubscribeCallback;
|
|
656
670
|
}
|
|
657
|
-
export type Device = Readonly<{
|
|
658
|
-
viewport: {
|
|
659
|
-
isMobile: boolean;
|
|
660
|
-
isLandscape: boolean;
|
|
661
|
-
};
|
|
662
|
-
editor: {
|
|
663
|
-
isMobile: boolean;
|
|
664
|
-
canFitSidebar: boolean;
|
|
665
|
-
};
|
|
666
|
-
isTouchScreen: boolean;
|
|
667
|
-
}>;
|
|
668
671
|
export type FrameNameBounds = {
|
|
669
672
|
x: number;
|
|
670
673
|
y: number;
|
|
@@ -37,3 +37,4 @@ export declare const distanceToLineSegment: <Point extends GlobalPoint | LocalPo
|
|
|
37
37
|
* @returns
|
|
38
38
|
*/
|
|
39
39
|
export declare function lineSegmentIntersectionPoints<Point extends GlobalPoint | LocalPoint>(l: LineSegment<Point>, s: LineSegment<Point>, threshold?: number): Point | null;
|
|
40
|
+
export declare function lineSegmentsDistance<Point extends GlobalPoint | LocalPoint>(s1: LineSegment<Point>, s2: LineSegment<Point>): number;
|
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-7f66e1f",
|
|
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-7f66e1f",
|
|
61
|
+
"@excalidraw/math": "0.18.0-7f66e1f"
|
|
62
62
|
}
|
|
63
63
|
}
|