@dwelle/excalidraw 0.4.0-e1bdbb6 → 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 +714 -0
- package/README.md +18 -1422
- 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 +3257 -1444
- 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 +124 -64
- package/types/actions/actionAlign.d.ts +33 -40
- package/types/actions/actionBoundText.d.ts +182 -25
- package/types/actions/actionCanvas.d.ts +754 -220
- package/types/actions/actionClipboard.d.ts +236 -115
- package/types/actions/actionDeleteSelected.d.ts +133 -72
- package/types/actions/actionDistribute.d.ts +11 -16
- package/types/actions/actionDuplicateSelection.d.ts +4 -7
- package/types/actions/actionElementLock.d.ts +271 -0
- package/types/actions/actionExport.d.ts +440 -277
- package/types/actions/actionFinalize.d.ts +85 -51
- package/types/actions/actionFlip.d.ts +8 -11
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +252 -19
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +44 -24
- package/types/actions/actionMenu.d.ts +132 -79
- package/types/actions/actionNavigate.d.ts +2 -3
- package/types/actions/actionProperties.d.ts +569 -334
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +46 -27
- package/types/actions/actionToggleGridMode.d.ts +46 -25
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +56 -35
- package/types/actions/actionToggleStats.d.ts +45 -25
- package/types/actions/actionToggleViewMode.d.ts +46 -25
- package/types/actions/actionToggleZenMode.d.ts +46 -25
- package/types/actions/actionZindex.d.ts +16 -24
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +3 -2
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +16 -13
- package/types/appState.d.ts +27 -28
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +9 -3
- 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 +102 -86
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +16 -0
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +6 -0
- 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 +9 -22
- 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 +7 -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 +11 -19
- 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 -5
- 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 +9 -15
- 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/UserList.d.ts +0 -2
- 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 +70 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +14 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +12 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +17 -2
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
- package/types/components/main-menu/DefaultItems.d.ts +47 -0
- package/types/components/main-menu/MainMenu.d.ts +64 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +57 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +84 -0
- package/types/constants.d.ts +105 -18
- 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/index.d.ts +1 -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 +57 -36
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +41 -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 +77 -30
- package/types/element/mutateElement.d.ts +3 -2
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -3
- 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 +57 -9
- package/types/element/textWysiwyg.d.ts +7 -2
- package/types/element/transformHandles.d.ts +15 -8
- package/types/element/typeChecks.d.ts +14 -2
- package/types/element/types.d.ts +66 -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 +7 -4
- package/types/math.d.ts +7 -1
- package/types/packages/bbox.d.ts +11 -0
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +22 -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 +30 -24
- package/types/packages/withinBounds.d.ts +19 -0
- package/types/renderer/renderElement.d.ts +13 -22
- package/types/renderer/renderScene.d.ts +19 -29
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Fonts.d.ts +21 -0
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +42 -5
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/comparisons.d.ts +2 -4
- package/types/scene/export.d.ts +183 -10
- 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 -26
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +227 -91
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +75 -14
- package/types/zindex.d.ts +4 -4
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -6
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/Footer.d.ts +0 -10
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/MenuItem.d.ts +0 -11
- package/types/components/MenuUtils.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/WelcomeScreen.d.ts +0 -10
- package/types/components/WelcomeScreenDecor.d.ts +0 -6
- 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/element/types.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { Point } from "../types";
|
|
2
|
-
import { FONT_FAMILY, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
2
|
+
import { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
|
|
3
|
+
import { MarkNonNullable, ValueOf } from "../utility-types";
|
|
4
|
+
export type ChartType = "bar" | "line";
|
|
5
|
+
export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
|
|
6
|
+
export type FontFamilyKeys = keyof typeof FONT_FAMILY;
|
|
7
|
+
export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
|
|
8
|
+
export type Theme = typeof THEME[keyof typeof THEME];
|
|
9
|
+
export type FontString = string & {
|
|
9
10
|
_brand: "fontString";
|
|
10
11
|
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
export type GroupId = string;
|
|
13
|
+
export type PointerType = "mouse" | "pen" | "touch";
|
|
14
|
+
export type StrokeRoundness = "round" | "sharp";
|
|
15
|
+
export type RoundnessType = ValueOf<typeof ROUNDNESS>;
|
|
16
|
+
export type StrokeStyle = "solid" | "dashed" | "dotted";
|
|
17
|
+
export type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
|
|
18
|
+
type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
|
|
19
|
+
export type VerticalAlign = typeof VERTICAL_ALIGN[VerticalAlignKeys];
|
|
20
|
+
type _ExcalidrawElementBase = Readonly<{
|
|
19
21
|
id: string;
|
|
20
22
|
x: number;
|
|
21
23
|
y: number;
|
|
@@ -24,7 +26,10 @@ declare type _ExcalidrawElementBase = Readonly<{
|
|
|
24
26
|
fillStyle: FillStyle;
|
|
25
27
|
strokeWidth: number;
|
|
26
28
|
strokeStyle: StrokeStyle;
|
|
27
|
-
|
|
29
|
+
roundness: null | {
|
|
30
|
+
type: RoundnessType;
|
|
31
|
+
value?: number;
|
|
32
|
+
};
|
|
28
33
|
roughness: number;
|
|
29
34
|
opacity: number;
|
|
30
35
|
width: number;
|
|
@@ -44,6 +49,7 @@ declare type _ExcalidrawElementBase = Readonly<{
|
|
|
44
49
|
/** List of groups the element belongs to.
|
|
45
50
|
Ordered from deepest to shallowest. */
|
|
46
51
|
groupIds: readonly GroupId[];
|
|
52
|
+
frameId: string | null;
|
|
47
53
|
/** other elements that are bound to this element */
|
|
48
54
|
boundElements: readonly Readonly<{
|
|
49
55
|
id: ExcalidrawLinearElement["id"];
|
|
@@ -55,19 +61,30 @@ declare type _ExcalidrawElementBase = Readonly<{
|
|
|
55
61
|
locked: boolean;
|
|
56
62
|
customData?: Record<string, any>;
|
|
57
63
|
}>;
|
|
58
|
-
export
|
|
64
|
+
export type ExcalidrawSelectionElement = _ExcalidrawElementBase & {
|
|
59
65
|
type: "selection";
|
|
60
66
|
};
|
|
61
|
-
export
|
|
67
|
+
export type ExcalidrawRectangleElement = _ExcalidrawElementBase & {
|
|
62
68
|
type: "rectangle";
|
|
63
69
|
};
|
|
64
|
-
export
|
|
70
|
+
export type ExcalidrawDiamondElement = _ExcalidrawElementBase & {
|
|
65
71
|
type: "diamond";
|
|
66
72
|
};
|
|
67
|
-
export
|
|
73
|
+
export type ExcalidrawEllipseElement = _ExcalidrawElementBase & {
|
|
68
74
|
type: "ellipse";
|
|
69
75
|
};
|
|
70
|
-
export
|
|
76
|
+
export type ExcalidrawEmbeddableElement = _ExcalidrawElementBase & Readonly<{
|
|
77
|
+
type: "embeddable";
|
|
78
|
+
/**
|
|
79
|
+
* indicates whether the embeddable src (url) has been validated for rendering.
|
|
80
|
+
* null value indicates that the validation is pending. We reset the
|
|
81
|
+
* value on each restore (or url change) so that we can guarantee
|
|
82
|
+
* the validation came from a trusted source (the editor). Also because we
|
|
83
|
+
* may not have access to host-app supplied url validator during restore.
|
|
84
|
+
*/
|
|
85
|
+
validated: boolean | null;
|
|
86
|
+
}>;
|
|
87
|
+
export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
71
88
|
type: "image";
|
|
72
89
|
fileId: FileId | null;
|
|
73
90
|
/** whether respective file is persisted */
|
|
@@ -75,22 +92,26 @@ export declare type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
|
75
92
|
/** X and Y scale factors <-1, 1>, used for image axis flipping */
|
|
76
93
|
scale: [number, number];
|
|
77
94
|
}>;
|
|
78
|
-
export
|
|
95
|
+
export type InitializedExcalidrawImageElement = MarkNonNullable<ExcalidrawImageElement, "fileId">;
|
|
96
|
+
export type ExcalidrawFrameElement = _ExcalidrawElementBase & {
|
|
97
|
+
type: "frame";
|
|
98
|
+
name: string | null;
|
|
99
|
+
};
|
|
79
100
|
/**
|
|
80
101
|
* These are elements that don't have any additional properties.
|
|
81
102
|
*/
|
|
82
|
-
export
|
|
103
|
+
export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
|
|
83
104
|
/**
|
|
84
105
|
* ExcalidrawElement should be JSON serializable and (eventually) contain
|
|
85
106
|
* no computed data. The list of all ExcalidrawElements should be shareable
|
|
86
107
|
* between peers and contain no state local to the peer.
|
|
87
108
|
*/
|
|
88
|
-
export
|
|
89
|
-
export
|
|
109
|
+
export type ExcalidrawElement = ExcalidrawGenericElement | ExcalidrawTextElement | ExcalidrawLinearElement | ExcalidrawFreeDrawElement | ExcalidrawImageElement | ExcalidrawFrameElement | ExcalidrawEmbeddableElement;
|
|
110
|
+
export type NonDeleted<TElement extends ExcalidrawElement> = TElement & {
|
|
90
111
|
isDeleted: boolean;
|
|
91
112
|
};
|
|
92
|
-
export
|
|
93
|
-
export
|
|
113
|
+
export type NonDeletedExcalidrawElement = NonDeleted<ExcalidrawElement>;
|
|
114
|
+
export type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
|
|
94
115
|
type: "text";
|
|
95
116
|
fontSize: number;
|
|
96
117
|
fontFamily: FontFamilyValues;
|
|
@@ -100,19 +121,26 @@ export declare type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
|
|
|
100
121
|
verticalAlign: VerticalAlign;
|
|
101
122
|
containerId: ExcalidrawGenericElement["id"] | null;
|
|
102
123
|
originalText: string;
|
|
124
|
+
/**
|
|
125
|
+
* Unitless line height (aligned to W3C). To get line height in px, multiply
|
|
126
|
+
* with font size (using `getLineHeightInPx` helper).
|
|
127
|
+
*/
|
|
128
|
+
lineHeight: number & {
|
|
129
|
+
_brand: "unitlessLineHeight";
|
|
130
|
+
};
|
|
103
131
|
}>;
|
|
104
|
-
export
|
|
105
|
-
export
|
|
106
|
-
export
|
|
132
|
+
export type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement;
|
|
133
|
+
export type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawArrowElement;
|
|
134
|
+
export type ExcalidrawTextElementWithContainer = {
|
|
107
135
|
containerId: ExcalidrawTextContainer["id"];
|
|
108
136
|
} & ExcalidrawTextElement;
|
|
109
|
-
export
|
|
137
|
+
export type PointBinding = {
|
|
110
138
|
elementId: ExcalidrawBindableElement["id"];
|
|
111
139
|
focus: number;
|
|
112
140
|
gap: number;
|
|
113
141
|
};
|
|
114
|
-
export
|
|
115
|
-
export
|
|
142
|
+
export type Arrowhead = "arrow" | "bar" | "dot" | "triangle";
|
|
143
|
+
export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
116
144
|
type: "line" | "arrow";
|
|
117
145
|
points: readonly Point[];
|
|
118
146
|
lastCommittedPoint: Point | null;
|
|
@@ -121,14 +149,17 @@ export declare type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<
|
|
|
121
149
|
startArrowhead: Arrowhead | null;
|
|
122
150
|
endArrowhead: Arrowhead | null;
|
|
123
151
|
}>;
|
|
124
|
-
export
|
|
152
|
+
export type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
|
|
153
|
+
type: "arrow";
|
|
154
|
+
}>;
|
|
155
|
+
export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
|
|
125
156
|
type: "freedraw";
|
|
126
157
|
points: readonly Point[];
|
|
127
158
|
pressures: readonly number[];
|
|
128
159
|
simulatePressure: boolean;
|
|
129
160
|
lastCommittedPoint: Point | null;
|
|
130
161
|
}>;
|
|
131
|
-
export
|
|
162
|
+
export type FileId = string & {
|
|
132
163
|
_brand: "FileId";
|
|
133
164
|
};
|
|
134
165
|
export {};
|
package/types/emitter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type Subscriber<T extends any[]> = (...payload: T) => void;
|
|
2
2
|
export declare class Emitter<T extends any[] = []> {
|
|
3
3
|
subscribers: Subscriber<T>[];
|
|
4
4
|
value: T | undefined;
|
|
@@ -13,7 +13,6 @@ export declare class Emitter<T extends any[] = []> {
|
|
|
13
13
|
* @returns unsubscribe function
|
|
14
14
|
*/
|
|
15
15
|
on(...handlers: Subscriber<T>[] | Subscriber<T>[][]): () => void;
|
|
16
|
-
once(...handlers: Subscriber<T>[] | Subscriber<T>[][]): () => void;
|
|
17
16
|
off(...handlers: Subscriber<T>[] | Subscriber<T>[][]): void;
|
|
18
17
|
trigger(...payload: T): any[];
|
|
19
18
|
destroy(): void;
|
package/types/errors.d.ts
CHANGED
package/types/frame.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ExcalidrawElement, ExcalidrawFrameElement, NonDeleted, NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
+
import { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
|
|
3
|
+
import { ExcalidrawElementsIncludingDeleted } from "./scene/Scene";
|
|
4
|
+
export declare const bindElementsToFramesAfterDuplication: (nextElements: ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
5
|
+
export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameElement): boolean;
|
|
6
|
+
export declare const getElementsCompletelyInFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameElement) => ExcalidrawElement[];
|
|
7
|
+
export declare const isElementContainingFrame: (elements: readonly ExcalidrawElement[], element: ExcalidrawElement, frame: ExcalidrawFrameElement) => boolean;
|
|
8
|
+
export declare const getElementsIntersectingFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameElement) => ExcalidrawElement[];
|
|
9
|
+
export declare const elementsAreInFrameBounds: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameElement) => boolean;
|
|
10
|
+
export declare const elementOverlapsWithFrame: (element: ExcalidrawElement, frame: ExcalidrawFrameElement) => boolean;
|
|
11
|
+
export declare const isCursorInFrame: (cursorCoords: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
}, frame: NonDeleted<ExcalidrawFrameElement>) => boolean;
|
|
15
|
+
export declare const groupsAreAtLeastIntersectingTheFrame: (elements: readonly NonDeletedExcalidrawElement[], groupIds: readonly string[], frame: ExcalidrawFrameElement) => boolean;
|
|
16
|
+
export declare const groupsAreCompletelyOutOfFrame: (elements: readonly NonDeletedExcalidrawElement[], groupIds: readonly string[], frame: ExcalidrawFrameElement) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Returns a map of frameId to frame elements. Includes empty frames.
|
|
19
|
+
*/
|
|
20
|
+
export declare const groupByFrames: (elements: readonly ExcalidrawElement[]) => Map<string, ExcalidrawElement[]>;
|
|
21
|
+
export declare const getFrameElements: (allElements: ExcalidrawElementsIncludingDeleted, frameId: string) => ExcalidrawElement[];
|
|
22
|
+
export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameElement, appState: AppState) => ExcalidrawElement[];
|
|
23
|
+
export declare const getElementsInNewFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameElement) => ExcalidrawElement[];
|
|
24
|
+
export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap?: Map<string, ExcalidrawElement>) => ExcalidrawFrameElement | null;
|
|
25
|
+
/**
|
|
26
|
+
* Retains (or repairs for target frame) the ordering invriant where children
|
|
27
|
+
* elements come right before the parent frame:
|
|
28
|
+
* [el, el, child, child, frame, el]
|
|
29
|
+
*/
|
|
30
|
+
export declare const addElementsToFrame: (allElements: ExcalidrawElementsIncludingDeleted, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameElement) => ExcalidrawElement[];
|
|
31
|
+
export declare const removeElementsFromFrame: (allElements: ExcalidrawElementsIncludingDeleted, elementsToRemove: NonDeletedExcalidrawElement[], appState: AppState) => ExcalidrawElement[];
|
|
32
|
+
export declare const removeAllElementsFromFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameElement, appState: AppState) => ExcalidrawElement[];
|
|
33
|
+
export declare const replaceAllElementsInFrame: (allElements: ExcalidrawElementsIncludingDeleted, nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameElement, appState: AppState) => ExcalidrawElement[];
|
|
34
|
+
/** does not mutate elements, but returns new ones */
|
|
35
|
+
export declare const updateFrameMembershipOfSelectedElements: (allElements: ExcalidrawElementsIncludingDeleted, appState: AppState, app: AppClassProperties) => ExcalidrawElementsIncludingDeleted;
|
|
36
|
+
/**
|
|
37
|
+
* filters out elements that are inside groups that contain a frame element
|
|
38
|
+
* anywhere in the group tree
|
|
39
|
+
*/
|
|
40
|
+
export declare const omitGroupsContainingFrames: (allElements: ExcalidrawElementsIncludingDeleted, selectedElements?: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
41
|
+
/**
|
|
42
|
+
* depending on the appState, return target frame, which is the frame the given element
|
|
43
|
+
* is going to be added to or remove from
|
|
44
|
+
*/
|
|
45
|
+
export declare const getTargetFrame: (element: ExcalidrawElement, appState: StaticCanvasAppState) => ExcalidrawFrameElement | null;
|
|
46
|
+
export declare const isElementInFrame: (element: ExcalidrawElement, allElements: ExcalidrawElementsIncludingDeleted, appState: StaticCanvasAppState) => boolean;
|
package/types/ga.d.ts
CHANGED
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
* See GAPoint, GALine, GADirection and GATransform modules for common
|
|
17
17
|
* operations.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
19
|
+
export type Point = NVector;
|
|
20
|
+
export type Direction = NVector;
|
|
21
|
+
export type Line = NVector;
|
|
22
|
+
export type Transform = NVector;
|
|
23
23
|
export declare const point: (x: number, y: number) => NVector;
|
|
24
24
|
export declare const origin: () => NVector;
|
|
25
25
|
export declare const direction: (x: number, y: number) => NVector;
|
|
26
26
|
export declare const offset: (x: number, y: number) => NVector;
|
|
27
|
-
|
|
27
|
+
type NVector = readonly [
|
|
28
28
|
number,
|
|
29
29
|
number,
|
|
30
30
|
number,
|
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,12 +19,15 @@ 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";
|
|
27
26
|
readonly ARROW_LEFT: "ArrowLeft";
|
|
28
27
|
readonly ARROW_RIGHT: "ArrowRight";
|
|
29
28
|
readonly ARROW_UP: "ArrowUp";
|
|
29
|
+
readonly PAGE_UP: "PageUp";
|
|
30
|
+
readonly PAGE_DOWN: "PageDown";
|
|
30
31
|
readonly BACKSPACE: "Backspace";
|
|
31
32
|
readonly ALT: "Alt";
|
|
32
33
|
readonly CTRL_OR_CMD: "metaKey" | "ctrlKey";
|
|
@@ -40,6 +41,7 @@ export declare const KEYS: {
|
|
|
40
41
|
readonly CHEVRON_RIGHT: ">";
|
|
41
42
|
readonly PERIOD: ".";
|
|
42
43
|
readonly COMMA: ",";
|
|
44
|
+
readonly SUBTRACT: "-";
|
|
43
45
|
readonly A: "a";
|
|
44
46
|
readonly C: "c";
|
|
45
47
|
readonly D: "d";
|
|
@@ -60,6 +62,7 @@ export declare const KEYS: {
|
|
|
60
62
|
readonly Y: "y";
|
|
61
63
|
readonly Z: "z";
|
|
62
64
|
readonly K: "k";
|
|
65
|
+
readonly W: "w";
|
|
63
66
|
readonly 0: "0";
|
|
64
67
|
readonly 1: "1";
|
|
65
68
|
readonly 2: "2";
|
|
@@ -71,7 +74,7 @@ export declare const KEYS: {
|
|
|
71
74
|
readonly 8: "8";
|
|
72
75
|
readonly 9: "9";
|
|
73
76
|
};
|
|
74
|
-
export
|
|
77
|
+
export type Key = keyof typeof KEYS;
|
|
75
78
|
export declare const isArrowKey: (key: string) => boolean;
|
|
76
79
|
export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
|
|
77
80
|
export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
|