@dwelle/excalidraw 0.4.0-e3bee83 → 0.4.0-e587816
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/CHANGELOG.md +525 -0
- package/README.md +18 -1820
- package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
- package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
- package/dist/excalidraw.development.js +3071 -1566
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
- package/main.js +1 -8
- package/package.json +9 -4
- package/types/actions/actionAddToLibrary.d.ts +103 -55
- package/types/actions/actionAlign.d.ts +33 -28
- package/types/actions/actionBoundText.d.ts +175 -22
- package/types/actions/actionCanvas.d.ts +680 -170
- package/types/actions/actionClipboard.d.ts +174 -100
- package/types/actions/actionDeleteSelected.d.ts +102 -60
- package/types/actions/actionDistribute.d.ts +11 -12
- package/types/actions/actionDuplicateSelection.d.ts +3 -4
- package/types/actions/actionElementLock.d.ts +271 -0
- package/types/actions/actionExport.d.ts +363 -221
- package/types/actions/actionFinalize.d.ts +70 -42
- package/types/actions/actionFlip.d.ts +8 -11
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +250 -13
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +37 -21
- package/types/actions/actionMenu.d.ts +108 -62
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +465 -256
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +39 -24
- package/types/actions/actionToggleGridMode.d.ts +37 -22
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +49 -32
- package/types/actions/actionToggleStats.d.ts +37 -22
- package/types/actions/actionToggleViewMode.d.ts +37 -22
- package/types/actions/actionToggleZenMode.d.ts +37 -22
- package/types/actions/actionZindex.d.ts +12 -12
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +11 -9
- package/types/appState.d.ts +18 -18
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +8 -7
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +7 -12
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +93 -35
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +3 -2
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/ColorInput.d.ts +9 -0
- package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
- package/types/components/ColorPicker/Picker.d.ts +18 -0
- package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/types/components/ColorPicker/ShadeList.d.ts +8 -0
- package/types/components/ColorPicker/TopPicks.d.ts +9 -0
- package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/types/components/ContextMenu.d.ts +3 -3
- package/types/components/DefaultSidebar.d.ts +29 -0
- package/types/components/Dialog.d.ts +3 -4
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +28 -0
- package/types/components/FilledButton.d.ts +17 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/HelpButton.d.ts +1 -2
- package/types/components/HintViewer.d.ts +4 -5
- package/types/components/HomeButton.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +8 -13
- package/types/components/Island.d.ts +1 -1
- package/types/components/JSONExportDialog.d.ts +5 -5
- package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
- package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
- package/types/components/LaserTool/LaserTool.d.ts +7 -0
- package/types/components/LayerUI.d.ts +9 -15
- package/types/components/LibraryMenu.d.ts +13 -14
- package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
- package/types/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +10 -28
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -3
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/LockButton.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +8 -11
- package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/components/PasteChartDialog.d.ts +4 -5
- package/types/components/PenModeButton.d.ts +1 -1
- package/types/components/Popover.d.ts +1 -1
- package/types/components/ProjectName.d.ts +2 -1
- package/types/components/PublishLibrary.d.ts +2 -2
- package/types/components/RadioGroup.d.ts +12 -0
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +8 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/components/Sidebar/common.d.ts +24 -7
- package/types/components/Spinner.d.ts +2 -1
- package/types/components/Stack.d.ts +4 -3
- package/types/components/Stats.d.ts +3 -3
- package/types/components/Switch.d.ts +9 -0
- package/types/components/ToolButton.d.ts +6 -5
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/Trans.d.ts +9 -0
- package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
- package/types/components/canvases/StaticCanvas.d.ts +18 -0
- package/types/components/canvases/index.d.ts +3 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +15 -9
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +7 -3
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +4 -4
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +4 -2
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -2
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/footer/Footer.d.ts +4 -5
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +16 -1
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/main-menu/MainMenu.d.ts +22 -13
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.d.ts +2 -3
- package/types/constants.d.ts +94 -10
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/cursor.d.ts +5 -0
- package/types/data/blob.d.ts +5 -3
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/transform.d.ts +73 -0
- package/types/data/types.d.ts +3 -5
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +48 -29
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +40 -10
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +153 -0
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +43 -27
- package/types/element/mutateElement.d.ts +3 -2
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -2
- package/types/element/resizeTest.d.ts +2 -1
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +43 -17
- package/types/element/textWysiwyg.d.ts +1 -1
- package/types/element/transformHandles.d.ts +16 -8
- package/types/element/typeChecks.d.ts +5 -2
- package/types/element/types.d.ts +59 -35
- package/types/emitter.d.ts +1 -2
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +46 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +15 -11
- package/types/history.d.ts +3 -3
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -2
- package/types/hooks/useScrollPosition.d.ts +1 -0
- package/types/hooks/useStable.d.ts +1 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +11 -2
- package/types/jotai.d.ts +20 -108
- package/types/keys.d.ts +5 -4
- package/types/math.d.ts +5 -0
- package/types/packages/bbox.d.ts +11 -0
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +11 -4
- package/types/packages/excalidraw/main.d.ts +3 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
- package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
- package/types/packages/utils.d.ts +11 -2
- package/types/packages/withinBounds.d.ts +19 -0
- package/types/renderer/renderElement.d.ts +12 -22
- package/types/renderer/renderScene.d.ts +19 -27
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +27 -5
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/comparisons.d.ts +0 -1
- package/types/scene/export.d.ts +50 -11
- package/types/scene/index.d.ts +1 -1
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +27 -6
- package/types/scene/types.d.ts +70 -34
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +200 -84
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +73 -29
- package/types/zindex.d.ts +4 -4
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
- /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
package/types/groups.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { GroupId, ExcalidrawElement, NonDeleted } from "./element/types";
|
|
2
|
-
import { AppState } from "./types";
|
|
3
|
-
|
|
1
|
+
import { GroupId, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
+
import { AppClassProperties, AppState, InteractiveCanvasAppState } from "./types";
|
|
3
|
+
import { Mutable } from "./utility-types";
|
|
4
|
+
export declare const selectGroup: (groupId: GroupId, appState: InteractiveCanvasAppState, elements: readonly NonDeleted<ExcalidrawElement>[]) => Pick<InteractiveCanvasAppState, "selectedGroupIds" | "selectedElementIds" | "editingGroupId">;
|
|
5
|
+
export declare const selectGroupsForSelectedElements: {
|
|
6
|
+
(appState: Pick<AppState, "selectedElementIds" | "editingGroupId">, elements: readonly NonDeletedExcalidrawElement[], prevAppState: InteractiveCanvasAppState, app: AppClassProperties | null): Mutable<Pick<InteractiveCanvasAppState, "selectedGroupIds" | "editingGroupId" | "selectedElementIds">>;
|
|
7
|
+
clearCache(): void;
|
|
8
|
+
};
|
|
4
9
|
/**
|
|
5
10
|
* If the element's group is selected, don't render an individual
|
|
6
11
|
* selection border around it.
|
|
7
12
|
*/
|
|
8
|
-
export declare const isSelectedViaGroup: (appState:
|
|
9
|
-
export declare const getSelectedGroupForElement: (appState:
|
|
10
|
-
export declare const getSelectedGroupIds: (appState:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
export declare const selectGroupsForSelectedElements: (appState: AppState, elements: readonly NonDeleted<ExcalidrawElement>[]) => AppState;
|
|
13
|
+
export declare const isSelectedViaGroup: (appState: InteractiveCanvasAppState, element: ExcalidrawElement) => boolean;
|
|
14
|
+
export declare const getSelectedGroupForElement: (appState: InteractiveCanvasAppState, element: ExcalidrawElement) => string | undefined;
|
|
15
|
+
export declare const getSelectedGroupIds: (appState: InteractiveCanvasAppState) => GroupId[];
|
|
16
|
+
export declare const selectGroupsFromGivenElements: (elements: readonly NonDeleted<ExcalidrawElement>[], appState: InteractiveCanvasAppState) => {
|
|
17
|
+
[groupId: string]: boolean;
|
|
18
|
+
};
|
|
16
19
|
export declare const editGroupForSelectedElement: (appState: AppState, element: NonDeleted<ExcalidrawElement>) => AppState;
|
|
17
20
|
export declare const isElementInGroup: (element: ExcalidrawElement, groupId: string) => boolean;
|
|
18
21
|
export declare const getElementsInGroup: (elements: readonly ExcalidrawElement[], groupId: string) => ExcalidrawElement[];
|
|
@@ -25,3 +28,4 @@ export declare const removeFromSelectedGroups: (groupIds: ExcalidrawElement["gro
|
|
|
25
28
|
[groupId: string]: boolean;
|
|
26
29
|
}) => string[];
|
|
27
30
|
export declare const getMaximumGroups: (elements: ExcalidrawElement[]) => ExcalidrawElement[][];
|
|
31
|
+
export declare const elementsAreInSameGroup: (elements: ExcalidrawElement[]) => boolean;
|
package/types/history.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export interface HistoryEntry {
|
|
|
5
5
|
elements: ExcalidrawElement[];
|
|
6
6
|
}
|
|
7
7
|
declare const clearAppStatePropertiesForHistory: (appState: AppState) => {
|
|
8
|
-
selectedElementIds: {
|
|
9
|
-
[id: string]:
|
|
10
|
-
}
|
|
8
|
+
selectedElementIds: Readonly<{
|
|
9
|
+
[id: string]: true;
|
|
10
|
+
}>;
|
|
11
11
|
selectedGroupIds: {
|
|
12
12
|
[groupId: string]: boolean;
|
|
13
13
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LibraryItem } from "../types";
|
|
2
|
+
export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
|
3
|
+
export declare const libraryItemSvgsCache: import("jotai").PrimitiveAtom<SvgCache> & {
|
|
4
|
+
init: SvgCache;
|
|
5
|
+
};
|
|
6
|
+
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache) => SVGSVGElement | undefined;
|
|
7
|
+
export declare const useLibraryCache: () => {
|
|
8
|
+
clearLibraryCache: () => void;
|
|
9
|
+
deleteItemsFromLibraryCache: (items: LibraryItem["id"][]) => void;
|
|
10
|
+
svgCache: SvgCache;
|
|
11
|
+
};
|
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare function useOutsideClick<T extends HTMLElement>(ref: React.RefObject<T>,
|
|
2
|
+
/** if performance is of concern, memoize the callback */
|
|
3
|
+
callback: (event: Event) => void,
|
|
4
|
+
/**
|
|
5
|
+
* Optional callback which is called on every click.
|
|
6
|
+
*
|
|
7
|
+
* Should return `true` if click should be considered as inside the container,
|
|
8
|
+
* and `false` if it falls outside and should call the `callback`.
|
|
9
|
+
*
|
|
10
|
+
* Returning `true` overrides the default behavior and `callback` won't be
|
|
11
|
+
* called.
|
|
12
|
+
*
|
|
13
|
+
* Returning `undefined` will fallback to the default behavior.
|
|
14
|
+
*/
|
|
15
|
+
isInside?: (event: Event & {
|
|
16
|
+
target: HTMLElement;
|
|
17
|
+
},
|
|
18
|
+
/** the element of the passed ref */
|
|
19
|
+
container: T) => boolean | undefined): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useScrollPosition: <T extends HTMLElement>(elementRef: import("react").RefObject<T>) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStable: <T extends Record<string, any>>(value: T) => T;
|
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,6 +13,12 @@ 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
|
-
} | undefined) => string;
|
|
18
|
+
} | null | undefined, fallback?: string) => string;
|
|
19
|
+
export declare const useI18n: () => {
|
|
20
|
+
t: (path: NestedKeyOf<typeof fallbackLangData>, replacement?: {
|
|
21
|
+
[key: string]: string | number;
|
|
22
|
+
} | null | undefined, fallback?: string) => string;
|
|
23
|
+
langCode: string;
|
|
24
|
+
};
|
package/types/jotai.d.ts
CHANGED
|
@@ -1,122 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PrimitiveAtom } from "jotai";
|
|
2
2
|
export declare const jotaiScope: unique symbol;
|
|
3
3
|
export declare const jotaiStore: {
|
|
4
|
-
get: <Value>(atom: import("jotai").Atom<Value>) =>
|
|
5
|
-
asyncGet: <Value_1>(atom: import("jotai").Atom<Value_1>) => Promise<
|
|
6
|
-
set: <Value_2, Update, Result extends void | Promise<void>>(atom: WritableAtom<Value_2, Update, Result>, update: Update) => Result;
|
|
7
|
-
sub: (atom:
|
|
8
|
-
toString: () => string;
|
|
9
|
-
debugLabel?: string | undefined;
|
|
10
|
-
read: (get: {
|
|
11
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
12
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
13
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
14
|
-
}) => unknown;
|
|
15
|
-
}, callback: () => void) => () => void;
|
|
4
|
+
get: <Value>(atom: import("jotai").Atom<Value>) => Awaited<Value> | undefined;
|
|
5
|
+
asyncGet: <Value_1>(atom: import("jotai").Atom<Value_1>) => Promise<Awaited<Value_1>>;
|
|
6
|
+
set: <Value_2, Update, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_2, Update, Result>, update: Update) => Result;
|
|
7
|
+
sub: (atom: import("jotai").Atom<unknown>, callback: () => void) => () => void;
|
|
16
8
|
SECRET_INTERNAL_store: {
|
|
17
|
-
r: <
|
|
18
|
-
w: <Value_1_1, Update_1, Result_1 extends void | Promise<void>>(writingAtom: WritableAtom<Value_1_1, Update_1, Result_1>, update: Update_1, version?: import("jotai/core/store").VersionObject | undefined) => Result_1;
|
|
19
|
-
c: (_atom:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
read: (get: {
|
|
23
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
24
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
25
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
26
|
-
}) => unknown;
|
|
27
|
-
} | null, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
28
|
-
s: (atom: {
|
|
29
|
-
toString: () => string;
|
|
30
|
-
debugLabel?: string | undefined;
|
|
31
|
-
read: (get: {
|
|
32
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
33
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
34
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
35
|
-
}) => unknown;
|
|
36
|
-
}, callback: (version?: import("jotai/core/store").VersionObject | undefined) => void) => () => void;
|
|
37
|
-
h: (values: Iterable<readonly [{
|
|
38
|
-
toString: () => string;
|
|
39
|
-
debugLabel?: string | undefined;
|
|
40
|
-
read: (get: {
|
|
41
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
42
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
43
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
44
|
-
}) => unknown;
|
|
45
|
-
}, unknown]>, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
9
|
+
r: <Value_3>(readingAtom: import("jotai").Atom<Value_3>, version?: import("jotai/core/store").VersionObject | undefined) => import("jotai/core/store").AtomState<Value_3>;
|
|
10
|
+
w: <Value_1_1, Update_1, Result_1 extends void | Promise<void>>(writingAtom: import("jotai").WritableAtom<Value_1_1, Update_1, Result_1>, update: Update_1, version?: import("jotai/core/store").VersionObject | undefined) => Result_1;
|
|
11
|
+
c: (_atom: import("jotai").Atom<unknown> | null, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
12
|
+
s: (atom: import("jotai").Atom<unknown>, callback: (version?: import("jotai/core/store").VersionObject | undefined) => void, version?: import("jotai/core/store").VersionObject | undefined) => () => void;
|
|
13
|
+
h: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
46
14
|
n: (l: () => void) => () => void;
|
|
47
|
-
l: () => IterableIterator<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
read: (get: {
|
|
51
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
52
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
53
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
54
|
-
}) => unknown;
|
|
55
|
-
}>;
|
|
56
|
-
a: (a: {
|
|
57
|
-
toString: () => string;
|
|
58
|
-
debugLabel?: string | undefined;
|
|
59
|
-
read: (get: {
|
|
60
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
61
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
62
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
63
|
-
}) => unknown;
|
|
64
|
-
}) => import("jotai/core/store").AtomState<unknown> | undefined;
|
|
65
|
-
m: (a: {
|
|
66
|
-
toString: () => string;
|
|
67
|
-
debugLabel?: string | undefined;
|
|
68
|
-
read: (get: {
|
|
69
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
70
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
71
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
72
|
-
}) => unknown;
|
|
73
|
-
}) => {
|
|
15
|
+
l: () => IterableIterator<import("jotai").Atom<unknown>>;
|
|
16
|
+
a: (a: import("jotai").Atom<unknown>) => import("jotai/core/store").AtomState<unknown> | undefined;
|
|
17
|
+
m: (a: import("jotai").Atom<unknown>) => {
|
|
74
18
|
l: Set<(version?: import("jotai/core/store").VersionObject | undefined) => void>;
|
|
75
|
-
t: Set<
|
|
76
|
-
toString: () => string;
|
|
77
|
-
debugLabel?: string | undefined;
|
|
78
|
-
read: (get: {
|
|
79
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
80
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
81
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
82
|
-
}) => unknown;
|
|
83
|
-
}>;
|
|
19
|
+
t: Set<import("jotai").Atom<unknown>>;
|
|
84
20
|
u?: (() => void) | undefined;
|
|
85
21
|
} | undefined;
|
|
86
22
|
} | {
|
|
87
|
-
r: <
|
|
88
|
-
w: <Value_1_2, Update_2, Result_2 extends void | Promise<void>>(writingAtom: WritableAtom<Value_1_2, Update_2, Result_2>, update: Update_2, version?: import("jotai/core/store").VersionObject | undefined) => Result_2;
|
|
89
|
-
c: (_atom:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
read: (get: {
|
|
93
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
94
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
95
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
96
|
-
}) => unknown;
|
|
97
|
-
} | null, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
98
|
-
s: (atom: {
|
|
99
|
-
toString: () => string;
|
|
100
|
-
debugLabel?: string | undefined;
|
|
101
|
-
read: (get: {
|
|
102
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
103
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
104
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
105
|
-
}) => unknown;
|
|
106
|
-
}, callback: (version?: import("jotai/core/store").VersionObject | undefined) => void) => () => void;
|
|
107
|
-
h: (values: Iterable<readonly [{
|
|
108
|
-
toString: () => string;
|
|
109
|
-
debugLabel?: string | undefined;
|
|
110
|
-
read: (get: {
|
|
111
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>): Value_3;
|
|
112
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>): Value_4;
|
|
113
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>): Value_5 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? V_1 extends Promise<infer V_1> ? any : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : V_1 : Value_5;
|
|
114
|
-
}) => unknown;
|
|
115
|
-
}, unknown]>, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
23
|
+
r: <Value_4>(readingAtom: import("jotai").Atom<Value_4>, version?: import("jotai/core/store").VersionObject | undefined) => import("jotai/core/store").AtomState<Value_4>;
|
|
24
|
+
w: <Value_1_2, Update_2, Result_2 extends void | Promise<void>>(writingAtom: import("jotai").WritableAtom<Value_1_2, Update_2, Result_2>, update: Update_2, version?: import("jotai/core/store").VersionObject | undefined) => Result_2;
|
|
25
|
+
c: (_atom: import("jotai").Atom<unknown> | null, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
26
|
+
s: (atom: import("jotai").Atom<unknown>, callback: (version?: import("jotai/core/store").VersionObject | undefined) => void, version?: import("jotai/core/store").VersionObject | undefined) => () => void;
|
|
27
|
+
h: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>, version?: import("jotai/core/store").VersionObject | undefined) => void;
|
|
116
28
|
n?: undefined;
|
|
117
29
|
l?: undefined;
|
|
118
30
|
a?: undefined;
|
|
119
31
|
m?: undefined;
|
|
120
32
|
};
|
|
121
33
|
};
|
|
122
|
-
export declare const useAtomWithInitialValue: <T extends unknown, A extends
|
|
34
|
+
export declare const useAtomWithInitialValue: <T extends unknown, A extends PrimitiveAtom<T>>(atom: A, initialValue: T | (() => T)) => readonly [Awaited<T>, import("jotai/core/atom").SetAtom<T | ((prev: T) => T), void>];
|
package/types/keys.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare const isDarwin: boolean;
|
|
2
|
-
export declare const isWindows: boolean;
|
|
3
|
-
export declare const isAndroid: boolean;
|
|
4
1
|
export declare const CODES: {
|
|
5
2
|
readonly EQUAL: "Equal";
|
|
6
3
|
readonly MINUS: "Minus";
|
|
@@ -11,6 +8,7 @@ export declare const CODES: {
|
|
|
11
8
|
readonly BRACKET_LEFT: "BracketLeft";
|
|
12
9
|
readonly ONE: "Digit1";
|
|
13
10
|
readonly TWO: "Digit2";
|
|
11
|
+
readonly THREE: "Digit3";
|
|
14
12
|
readonly NINE: "Digit9";
|
|
15
13
|
readonly QUOTE: "Quote";
|
|
16
14
|
readonly ZERO: "Digit0";
|
|
@@ -21,6 +19,7 @@ export declare const CODES: {
|
|
|
21
19
|
readonly V: "KeyV";
|
|
22
20
|
readonly Z: "KeyZ";
|
|
23
21
|
readonly R: "KeyR";
|
|
22
|
+
readonly S: "KeyS";
|
|
24
23
|
};
|
|
25
24
|
export declare const KEYS: {
|
|
26
25
|
readonly ARROW_DOWN: "ArrowDown";
|
|
@@ -42,6 +41,7 @@ export declare const KEYS: {
|
|
|
42
41
|
readonly CHEVRON_RIGHT: ">";
|
|
43
42
|
readonly PERIOD: ".";
|
|
44
43
|
readonly COMMA: ",";
|
|
44
|
+
readonly SUBTRACT: "-";
|
|
45
45
|
readonly A: "a";
|
|
46
46
|
readonly C: "c";
|
|
47
47
|
readonly D: "d";
|
|
@@ -62,6 +62,7 @@ export declare const KEYS: {
|
|
|
62
62
|
readonly Y: "y";
|
|
63
63
|
readonly Z: "z";
|
|
64
64
|
readonly K: "k";
|
|
65
|
+
readonly W: "w";
|
|
65
66
|
readonly 0: "0";
|
|
66
67
|
readonly 1: "1";
|
|
67
68
|
readonly 2: "2";
|
|
@@ -73,7 +74,7 @@ export declare const KEYS: {
|
|
|
73
74
|
readonly 8: "8";
|
|
74
75
|
readonly 9: "9";
|
|
75
76
|
};
|
|
76
|
-
export
|
|
77
|
+
export type Key = keyof typeof KEYS;
|
|
77
78
|
export declare const isArrowKey: (key: string) => boolean;
|
|
78
79
|
export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
79
80
|
export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
|
package/types/math.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const distance2d: (x1: number, y1: number, x2: number, y2: number
|
|
|
17
17
|
export declare const centerPoint: (a: readonly [number, number], b: readonly [number, number]) => readonly [number, number];
|
|
18
18
|
export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
|
|
19
19
|
export declare const isPointInPolygon: (points: Point[], x: number, y: number) => boolean;
|
|
20
|
+
export declare const isPointWithinBounds: (p: readonly [number, number], q: readonly [number, number], r: readonly [number, number]) => boolean;
|
|
20
21
|
export declare const getGridPoint: (x: number, y: number, gridSize: number | null) => [number, number];
|
|
21
22
|
export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
|
|
22
23
|
export declare const getControlPointsForBezierCurve: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number]) => [number, number][] | null;
|
|
@@ -26,3 +27,7 @@ export declare const getBezierCurveArcLengths: (element: NonDeleted<ExcalidrawLi
|
|
|
26
27
|
export declare const getBezierCurveLength: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number]) => number;
|
|
27
28
|
export declare const mapIntervalToBezierT: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number], interval: number) => number;
|
|
28
29
|
export declare const arePointsEqual: (p1: readonly [number, number], p2: readonly [number, number]) => boolean;
|
|
30
|
+
export declare const isRightAngle: (angle: number) => boolean;
|
|
31
|
+
export declare const rangesOverlap: ([a0, a1]: [number, number], [b0, b1]: [number, number]) => boolean;
|
|
32
|
+
export declare const rangeIntersection: (rangeA: [number, number], rangeB: [number, number]) => [number, number] | null;
|
|
33
|
+
export declare const isValueInRange: (value: number, min: number, max: number) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Bounds } from "../element/bounds";
|
|
2
|
+
import { Point } from "../types";
|
|
3
|
+
export type LineSegment = [Point, Point];
|
|
4
|
+
export declare function getBBox(line: LineSegment): Bounds;
|
|
5
|
+
export declare function crossProduct(a: Point, b: Point): number;
|
|
6
|
+
export declare function doBBoxesIntersect(a: Bounds, b: Bounds): boolean;
|
|
7
|
+
export declare function translate(a: Point, b: Point): Point;
|
|
8
|
+
export declare function isPointOnLine(l: LineSegment, p: Point): boolean;
|
|
9
|
+
export declare function isPointRightOfLine(l: LineSegment, p: Point): boolean;
|
|
10
|
+
export declare function isLineSegmentTouchingOrCrossingLine(a: LineSegment, b: LineSegment): boolean;
|
|
11
|
+
export declare function doLineSegmentsIntersect(a: LineSegment, b: LineSegment): boolean;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type * as TExcalidraw from "../index";
|
|
2
2
|
import "./App.scss";
|
|
3
|
+
import { ExcalidrawImperativeAPI } from "../../../types";
|
|
3
4
|
declare global {
|
|
4
5
|
interface Window {
|
|
5
6
|
ExcalidrawLib: typeof TExcalidraw;
|
|
6
7
|
}
|
|
7
8
|
}
|
|
8
|
-
export
|
|
9
|
+
export interface AppProps {
|
|
10
|
+
appTitle: string;
|
|
11
|
+
useCustom: (api: ExcalidrawImperativeAPI | null, customArgs?: any[]) => void;
|
|
12
|
+
customArgs?: any[];
|
|
13
|
+
}
|
|
14
|
+
export default function App({ appTitle, useCustom, customArgs }: AppProps): JSX.Element;
|