@dwelle/excalidraw 0.5.0-ff7b5f2db → 0.5.0-ffade30
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 +2385 -0
- package/dist/dev/{chunk-56C7N44U.js → chunk-CB6O5JO7.js} +16177 -10984
- package/dist/dev/chunk-CB6O5JO7.js.map +7 -0
- package/dist/dev/{chunk-DGCWVQGA.js → chunk-JB4JDZ66.js} +15 -4
- package/dist/dev/chunk-JB4JDZ66.js.map +7 -0
- package/dist/dev/chunk-QXVP5PAI.js +7 -0
- package/dist/dev/chunk-QXVP5PAI.js.map +7 -0
- package/dist/dev/data/{image-BLSI3C2P.js → image-JTJWA4BG.js} +3 -3
- package/dist/dev/index.css +143 -68
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +3978 -6519
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-AAITTNRF.js → en-PIB5PD3P.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-JEM5OQGK.js +33 -0
- package/dist/prod/chunk-JH36RZFS.js +7 -0
- package/dist/prod/{chunk-OV23WS6X.js → chunk-KC3NX2DX.js} +4 -4
- package/dist/prod/data/image-UJJWHTZ6.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +22 -21
- package/dist/prod/locales/{en-YOZMX4VX.js → en-RKTHI3YA.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/colors.d.ts +1 -0
- package/dist/types/common/src/constants.d.ts +11 -1
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/common/src/font-metadata.d.ts +4 -2
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/utility-types.d.ts +5 -0
- package/dist/types/common/src/utils.d.ts +22 -5
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +11 -14
- package/dist/types/element/src/ShapeCache.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +3 -3
- package/dist/types/element/src/binding.d.ts +19 -11
- package/dist/types/element/src/bounds.d.ts +7 -2
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +40 -35
- package/dist/types/element/src/dragElements.d.ts +3 -2
- package/dist/types/element/src/duplicate.d.ts +10 -13
- package/dist/types/element/src/elbowArrow.d.ts +1 -1
- package/dist/types/element/src/flowchart.d.ts +3 -2
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +5 -4
- package/dist/types/element/src/heading.d.ts +0 -1
- package/dist/types/element/src/index.d.ts +45 -2
- package/dist/types/element/src/linearElementEditor.d.ts +19 -31
- package/dist/types/element/src/mutateElement.d.ts +10 -2
- package/dist/types/element/src/newElement.d.ts +4 -3
- package/dist/types/element/src/resizeElements.d.ts +4 -4
- package/dist/types/element/src/selection.d.ts +11 -5
- package/dist/types/element/src/shapes.d.ts +5 -1
- package/dist/types/element/src/sizeHelpers.d.ts +1 -1
- package/dist/types/element/src/store.d.ts +227 -0
- package/dist/types/element/src/textElement.d.ts +5 -3
- package/dist/types/element/src/transformHandles.d.ts +4 -4
- package/dist/types/element/src/typeChecks.d.ts +15 -1
- package/dist/types/element/src/types.d.ts +14 -1
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +42 -45
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +28 -30
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +438 -275
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +86 -92
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +14 -15
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +40 -43
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +14 -15
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +43 -47
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +14 -15
- package/dist/types/excalidraw/actions/actionExport.d.ts +219 -228
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +73 -36
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +100 -104
- package/dist/types/excalidraw/actions/actionGroup.d.ts +34 -36
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +506 -14
- package/dist/types/excalidraw/actions/actionLink.d.ts +14 -15
- package/dist/types/excalidraw/actions/actionMenu.d.ts +42 -45
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +27 -29
- package/dist/types/excalidraw/actions/actionProperties.d.ts +207 -214
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +16 -17
- package/dist/types/excalidraw/actions/actionStyles.d.ts +18 -19
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -17
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +16 -17
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -189
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +16 -18
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +16 -18
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +16 -18
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/types.d.ts +4 -3
- package/dist/types/excalidraw/animated-trail.d.ts +7 -1
- package/dist/types/excalidraw/appState.d.ts +40 -30
- package/dist/types/excalidraw/components/App.d.ts +30 -12
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +4 -0
- package/dist/types/excalidraw/components/shapes.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/data/transform.d.ts +1 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +14 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +14 -22
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +9 -9
- package/dist/types/excalidraw/lasso/index.d.ts +16 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +12 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +6 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
- package/dist/types/excalidraw/scene/export.d.ts +1 -1
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/dist/types/excalidraw/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/snapping.d.ts +2 -2
- package/dist/types/excalidraw/types.d.ts +30 -7
- package/dist/types/excalidraw/visualdebug.d.ts +1 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
- package/dist/types/math/src/curve.d.ts +2 -0
- package/dist/types/math/src/point.d.ts +1 -1
- package/dist/types/math/src/polygon.d.ts +1 -0
- package/dist/types/math/src/segment.d.ts +1 -1
- package/dist/types/math/src/types.d.ts +1 -0
- package/dist/types/math/src/vector.d.ts +4 -0
- package/dist/types/utils/src/bbox.d.ts +1 -1
- package/dist/types/utils/src/index.d.ts +1 -1
- package/dist/types/utils/src/withinBounds.d.ts +1 -1
- package/history.ts +186 -0
- package/package.json +9 -4
- package/dist/dev/chunk-56C7N44U.js.map +0 -7
- package/dist/dev/chunk-DGCWVQGA.js.map +0 -7
- package/dist/dev/chunk-HQHB2BE4.js +0 -7
- package/dist/dev/chunk-HQHB2BE4.js.map +0 -7
- package/dist/prod/chunk-BUJ2ENHZ.js +0 -31
- package/dist/prod/chunk-C3FOHAIA.js +0 -7
- package/dist/prod/data/image-MI7OQWUS.js +0 -1
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/store.d.ts +0 -129
- /package/dist/dev/data/{image-BLSI3C2P.js.map → image-JTJWA4BG.js.map} +0 -0
- /package/dist/dev/locales/{en-AAITTNRF.js.map → en-PIB5PD3P.js.map} +0 -0
|
@@ -6,7 +6,11 @@ import type { AppState } from "../../types";
|
|
|
6
6
|
export declare const getColor: (color: string) => string | null;
|
|
7
7
|
interface ColorPickerProps {
|
|
8
8
|
type: ColorPickerType;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* null indicates no color should be displayed as active
|
|
11
|
+
* (e.g. when multiple shapes selected with different colors)
|
|
12
|
+
*/
|
|
13
|
+
color: string | null;
|
|
10
14
|
onChange: (color: string) => void;
|
|
11
15
|
label: string;
|
|
12
16
|
elements: readonly ExcalidrawElement[];
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
interface HotkeyLabelProps {
|
|
2
2
|
color: string;
|
|
3
3
|
keyLabel: string | number;
|
|
4
|
-
isCustomColor?: boolean;
|
|
5
4
|
isShade?: boolean;
|
|
6
5
|
}
|
|
7
|
-
declare const HotkeyLabel: ({ color, keyLabel,
|
|
6
|
+
declare const HotkeyLabel: ({ color, keyLabel, isShade, }: HotkeyLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export default HotkeyLabel;
|
|
@@ -3,9 +3,8 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
|
3
3
|
import type { ColorPaletteCustom } from "@excalidraw/common";
|
|
4
4
|
import type { ColorPickerType } from "./colorPickerUtils";
|
|
5
5
|
interface PickerProps {
|
|
6
|
-
color: string;
|
|
6
|
+
color: string | null;
|
|
7
7
|
onChange: (color: string) => void;
|
|
8
|
-
label: string;
|
|
9
8
|
type: ColorPickerType;
|
|
10
9
|
elements: readonly ExcalidrawElement[];
|
|
11
10
|
palette: ColorPaletteCustom;
|
|
@@ -14,5 +13,5 @@ interface PickerProps {
|
|
|
14
13
|
onEyeDropperToggle: (force?: boolean) => void;
|
|
15
14
|
onEscape: (event: React.KeyboardEvent | KeyboardEvent) => void;
|
|
16
15
|
}
|
|
17
|
-
export declare const Picker:
|
|
16
|
+
export declare const Picker: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<unknown>>;
|
|
18
17
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { ColorPaletteCustom } from "@excalidraw/common";
|
|
2
2
|
interface PickerColorListProps {
|
|
3
3
|
palette: ColorPaletteCustom;
|
|
4
|
-
color: string;
|
|
4
|
+
color: string | null;
|
|
5
5
|
onChange: (color: string) => void;
|
|
6
|
-
label: string;
|
|
7
6
|
activeShade: number;
|
|
8
7
|
}
|
|
9
|
-
declare const PickerColorList: ({ palette, color, onChange,
|
|
8
|
+
declare const PickerColorList: ({ palette, color, onChange, activeShade, }: PickerColorListProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default PickerColorList;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ColorPaletteCustom } from "@excalidraw/common";
|
|
2
2
|
interface ShadeListProps {
|
|
3
|
-
|
|
3
|
+
color: string | null;
|
|
4
4
|
onChange: (color: string) => void;
|
|
5
5
|
palette: ColorPaletteCustom;
|
|
6
6
|
}
|
|
7
|
-
export declare const ShadeList: ({
|
|
7
|
+
export declare const ShadeList: ({ color, onChange, palette }: ShadeListProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { ColorPickerType } from "./colorPickerUtils";
|
|
|
2
2
|
interface TopPicksProps {
|
|
3
3
|
onChange: (color: string) => void;
|
|
4
4
|
type: ColorPickerType;
|
|
5
|
-
activeColor: string;
|
|
5
|
+
activeColor: string | null;
|
|
6
6
|
topPicks?: readonly string[];
|
|
7
7
|
}
|
|
8
8
|
export declare const TopPicks: ({ onChange, type, activeColor, topPicks, }: TopPicksProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,7 +2,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
|
2
2
|
import type { ColorPickerColor, ColorPaletteCustom } from "@excalidraw/common";
|
|
3
3
|
export declare const getColorNameAndShadeFromColor: ({ palette, color, }: {
|
|
4
4
|
palette: ColorPaletteCustom;
|
|
5
|
-
color: string;
|
|
5
|
+
color: string | null;
|
|
6
6
|
}) => {
|
|
7
7
|
colorName: ColorPickerColor;
|
|
8
8
|
shade: number | null;
|
|
@@ -17,5 +17,5 @@ export type ActiveColorPickerSectionAtomType = "custom" | "baseColors" | "shades
|
|
|
17
17
|
export declare const activeColorPickerSectionAtom: import("jotai/vanilla/atom").PrimitiveAtom<ActiveColorPickerSectionAtomType> & {
|
|
18
18
|
init: ActiveColorPickerSectionAtomType;
|
|
19
19
|
};
|
|
20
|
-
export declare const
|
|
20
|
+
export declare const isColorDark: (color: string, threshold?: number) => boolean;
|
|
21
21
|
export type ColorPickerType = "canvasBackground" | "elementBackground" | "elementStroke";
|
|
@@ -5,7 +5,7 @@ interface ColorPickerKeyNavHandlerProps {
|
|
|
5
5
|
event: React.KeyboardEvent;
|
|
6
6
|
activeColorPickerSection: ActiveColorPickerSectionAtomType;
|
|
7
7
|
palette: ColorPaletteCustom;
|
|
8
|
-
color: string;
|
|
8
|
+
color: string | null;
|
|
9
9
|
onChange: (color: string) => void;
|
|
10
10
|
customColors: string[];
|
|
11
11
|
setActiveColorPickerSection: (update: React.SetStateAction<ActiveColorPickerSectionAtomType>) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ConvertibleTypes, ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElementWithContainer } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
|
+
import "./ConvertElementTypePopup.scss";
|
|
4
|
+
import type App from "./App";
|
|
5
|
+
export declare const convertElementTypePopupAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
|
|
6
|
+
type: "panel";
|
|
7
|
+
} | null> & {
|
|
8
|
+
init: {
|
|
9
|
+
type: "panel";
|
|
10
|
+
} | null;
|
|
11
|
+
};
|
|
12
|
+
declare const ConvertElementTypePopup: ({ app }: {
|
|
13
|
+
app: App;
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const adjustBoundTextSize: (container: ExcalidrawTextContainer, boundText: ExcalidrawTextElementWithContainer, scene: Scene) => void;
|
|
16
|
+
type ConversionType = "generic" | "linear" | null;
|
|
17
|
+
export declare const convertElementTypes: (app: App, { conversionType, nextType, direction, }: {
|
|
18
|
+
conversionType: ConversionType;
|
|
19
|
+
nextType?: ConvertibleTypes | undefined;
|
|
20
|
+
direction?: "left" | "right" | undefined;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
export declare const getConversionTypeFromElements: (elements: ExcalidrawElement[]) => ConversionType;
|
|
23
|
+
export default ConvertElementTypePopup;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
2
3
|
import "./ElementLinkDialog.scss";
|
|
3
4
|
import type { AppProps, UIAppState } from "../types";
|
|
4
|
-
declare const ElementLinkDialog: ({ sourceElementId, onClose,
|
|
5
|
+
declare const ElementLinkDialog: ({ sourceElementId, onClose, appState, scene, generateLinkForSelection, }: {
|
|
5
6
|
sourceElementId: ExcalidrawElement["id"];
|
|
6
|
-
elementsMap: ElementsMap;
|
|
7
7
|
appState: UIAppState;
|
|
8
|
+
scene: Scene;
|
|
8
9
|
onClose?: (() => void) | undefined;
|
|
9
10
|
generateLinkForSelection: AppProps["generateLinkForSelection"];
|
|
10
11
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./Range.scss";
|
|
2
|
+
import type { AppClassProperties } from "../types";
|
|
2
3
|
export type RangeProps = {
|
|
3
4
|
updateData: (value: number) => void;
|
|
4
|
-
|
|
5
|
-
elements: any;
|
|
5
|
+
app: AppClassProperties;
|
|
6
6
|
testId?: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const Range: ({ updateData,
|
|
8
|
+
export declare const Range: ({ updateData, app, testId }: RangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,7 @@ interface CollapsibleProps {
|
|
|
5
5
|
openTrigger: () => void;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
+
showCollapsedIcon?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare const Collapsible: ({ label, open, openTrigger, children, className, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const Collapsible: ({ label, open, openTrigger, children, className, showCollapsedIcon, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default Collapsible;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface DimensionDragInputProps {
|
|
5
5
|
property: "width" | "height";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
4
|
import "./DragInput.scss";
|
|
4
5
|
import type { StatsInputProperty } from "./utils";
|
|
5
|
-
import type Scene from "../../scene/Scene";
|
|
6
6
|
import type { AppState } from "../../types";
|
|
7
7
|
export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawElement> = (props: {
|
|
8
8
|
accumulatedChange: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface FontSizeProps {
|
|
5
5
|
element: ExcalidrawElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface MultiAngleProps {
|
|
5
5
|
elements: readonly ExcalidrawElement[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
2
3
|
import type { AtomicUnit } from "./utils";
|
|
3
|
-
import type Scene from "../../scene/Scene";
|
|
4
4
|
import type { AppState } from "../../types";
|
|
5
5
|
interface MultiDimensionProps {
|
|
6
6
|
property: "width" | "height";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface MultiFontSizeProps {
|
|
5
5
|
elements: readonly ExcalidrawElement[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
2
3
|
import type { AtomicUnit } from "./utils";
|
|
3
|
-
import type Scene from "../../scene/Scene";
|
|
4
4
|
import type { AppState } from "../../types";
|
|
5
5
|
interface MultiPositionProps {
|
|
6
6
|
property: "x" | "y";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface PositionProps {
|
|
5
5
|
property: "x" | "y";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement
|
|
2
|
-
import type Scene from "
|
|
1
|
+
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
export type StatsInputProperty = "x" | "y" | "width" | "height" | "angle" | "fontSize" | "gridStep";
|
|
5
5
|
export declare const SMALLEST_DELTA = 0.01;
|
|
6
|
+
export declare const STEP_SIZE = 10;
|
|
6
7
|
export declare const isPropertyEditable: (element: ExcalidrawElement, property: keyof ExcalidrawElement) => boolean;
|
|
7
8
|
export declare const getStepSizedValue: (value: number, stepSize: number) => number;
|
|
8
9
|
export type AtomicUnit = Record<string, true>;
|
|
@@ -14,13 +15,5 @@ export declare const newOrigin: (x1: number, y1: number, w1: number, h1: number,
|
|
|
14
15
|
x: number;
|
|
15
16
|
y: number;
|
|
16
17
|
};
|
|
17
|
-
export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement,
|
|
18
|
+
export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
|
|
18
19
|
export declare const getAtomicUnits: (targetElements: readonly ExcalidrawElement[], appState: AppState) => AtomicUnit[];
|
|
19
|
-
export declare const updateBindings: (latestElement: ExcalidrawElement, elementsMap: NonDeletedSceneElementsMap, elements: readonly NonDeletedExcalidrawElement[], scene: Scene, options?: {
|
|
20
|
-
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
21
|
-
newSize?: {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
zoom?: AppState["zoom"];
|
|
26
|
-
}) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./UnlockPopup.scss";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
declare const UnlockPopup: ({ app, activeLockedId, }: {
|
|
5
|
+
app: App;
|
|
6
|
+
activeLockedId: NonNullable<AppState["activeLockedId"]>;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default UnlockPopup;
|
|
@@ -14,6 +14,7 @@ type InteractiveCanvasProps = {
|
|
|
14
14
|
selectionNonce: number | undefined;
|
|
15
15
|
scale: number;
|
|
16
16
|
appState: InteractiveCanvasAppState;
|
|
17
|
+
renderScrollbars: boolean;
|
|
17
18
|
device: Device;
|
|
18
19
|
renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
|
|
19
20
|
handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { Scene } from "@excalidraw/element";
|
|
1
2
|
import type { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
3
|
import "./Hyperlink.scss";
|
|
3
4
|
import type { AppState, ExcalidrawProps, UIAppState } from "../../types";
|
|
4
|
-
export declare const Hyperlink: ({ element,
|
|
5
|
+
export declare const Hyperlink: ({ element, scene, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
|
|
5
6
|
element: NonDeletedExcalidrawElement;
|
|
6
|
-
|
|
7
|
+
scene: Scene;
|
|
7
8
|
setAppState: React.Component<any, AppState>["setState"];
|
|
8
9
|
onLinkOpen: ExcalidrawProps["onLinkOpen"];
|
|
9
10
|
setToast: (toast: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { GlobalPoint, Radians } from "@excalidraw/math";
|
|
2
|
-
import type { Bounds } from "@excalidraw/element
|
|
2
|
+
import type { Bounds } from "@excalidraw/element";
|
|
3
3
|
import type { ElementsMap, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
4
|
import type { AppState, UIAppState } from "../../types";
|
|
5
|
+
export declare const DEFAULT_LINK_SIZE = 12;
|
|
5
6
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
6
7
|
export declare const ELEMENT_LINK_IMG: HTMLImageElement;
|
|
7
8
|
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: Radians, appState: Pick<UIAppState, "zoom">) => Bounds;
|
|
@@ -12,13 +12,16 @@ export declare const LibraryIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
12
12
|
export declare const PlusIcon: import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const DotsIcon: import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export declare const ExcalLogo: import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export declare const SelectionIcon: import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const LassoIcon: import("react/jsx-runtime").JSX.Element;
|
|
22
25
|
export declare const RectangleIcon: import("react/jsx-runtime").JSX.Element;
|
|
23
26
|
export declare const DiamondIcon: import("react/jsx-runtime").JSX.Element;
|
|
24
27
|
export declare const EllipseIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -53,6 +56,7 @@ export declare const LoadIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
53
56
|
export declare const clipboard: import("react/jsx-runtime").JSX.Element;
|
|
54
57
|
export declare const palette: import("react/jsx-runtime").JSX.Element;
|
|
55
58
|
export declare const bucketFillIcon: import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const slashIcon: import("react/jsx-runtime").JSX.Element;
|
|
56
60
|
export declare const ExportImageIcon: import("react/jsx-runtime").JSX.Element;
|
|
57
61
|
export declare const exportToFileIcon: import("react/jsx-runtime").JSX.Element;
|
|
58
62
|
export declare const zoomIn: import("react/jsx-runtime").JSX.Element;
|
|
@@ -59,4 +59,4 @@ export declare const SHAPES: readonly [{
|
|
|
59
59
|
readonly numericKey: "0";
|
|
60
60
|
readonly fillable: false;
|
|
61
61
|
}];
|
|
62
|
-
export declare const findShapeByKey: (key: string) => "
|
|
62
|
+
export declare const findShapeByKey: (key: string) => "text" | "line" | "arrow" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "image" | "eraser" | null;
|
|
@@ -6,7 +6,7 @@ import type { FileSystemHandle } from "./filesystem";
|
|
|
6
6
|
import type { ImportedLibraryData } from "./types";
|
|
7
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
8
|
export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
|
|
9
|
-
export declare const isImageFileHandleType: (type: string | null) => type is "
|
|
9
|
+
export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
|
|
10
10
|
export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
|
|
11
11
|
export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
|
|
12
12
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementConstructorOpts } from "@excalidraw/element
|
|
1
|
+
import type { ElementConstructorOpts } from "@excalidraw/element";
|
|
2
2
|
import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "@excalidraw/element/types";
|
|
3
3
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
4
4
|
export type ValidLinearElement = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { atom, createStore, type PrimitiveAtom } from "jotai";
|
|
1
|
+
import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
|
|
2
2
|
import { createIsolation } from "jotai-scope";
|
|
3
|
-
export { atom, PrimitiveAtom };
|
|
3
|
+
export { atom, PrimitiveAtom, WritableAtom };
|
|
4
4
|
export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
|
|
5
5
|
store?: {
|
|
6
6
|
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
7
|
-
set: <Value_1, Args extends unknown[], Result>(atom:
|
|
7
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
8
8
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
9
9
|
} | ({
|
|
10
10
|
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
11
|
-
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom:
|
|
11
|
+
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
12
12
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
13
13
|
} & {
|
|
14
14
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -29,11 +29,11 @@ export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof
|
|
|
29
29
|
}) | undefined;
|
|
30
30
|
} | undefined) => {
|
|
31
31
|
get: <Value_3>(atom: import("jotai").Atom<Value_3>) => Value_3;
|
|
32
|
-
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom:
|
|
32
|
+
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
|
|
33
33
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
34
34
|
} | ({
|
|
35
35
|
get: <Value_4>(atom: import("jotai").Atom<Value_4>) => Value_4;
|
|
36
|
-
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom:
|
|
36
|
+
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
|
|
37
37
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
38
38
|
} & {
|
|
39
39
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnimatedTrail } from "../animated-trail";
|
|
2
|
+
import type { AnimationFrameHandler } from "../animation-frame-handler";
|
|
3
|
+
import type App from "../components/App";
|
|
4
|
+
export declare class EraserTrail extends AnimatedTrail {
|
|
5
|
+
private elementsToErase;
|
|
6
|
+
private groupsToErase;
|
|
7
|
+
private segmentsCache;
|
|
8
|
+
private geometricShapesCache;
|
|
9
|
+
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
|
+
startPath(x: number, y: number): void;
|
|
11
|
+
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
12
|
+
private updateElementsToBeErased;
|
|
13
|
+
endPath(): void;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FontMetadata } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
4
|
import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
4
|
-
import type Scene from "../scene/Scene";
|
|
5
5
|
export declare class Fonts {
|
|
6
6
|
static readonly loadedFontsCache: Set<string>;
|
|
7
7
|
private static _registered;
|
|
@@ -1,40 +1,32 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import { StoreDelta, type Store } from "@excalidraw/element";
|
|
1
3
|
import type { SceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
-
import { Emitter } from "./emitter";
|
|
3
|
-
import type { AppStateChange, ElementsChange } from "./change";
|
|
4
|
-
import type { Snapshot } from "./store";
|
|
5
4
|
import type { AppState } from "./types";
|
|
5
|
+
declare class HistoryEntry extends StoreDelta {
|
|
6
|
+
}
|
|
6
7
|
export declare class HistoryChangedEvent {
|
|
7
8
|
readonly isUndoStackEmpty: boolean;
|
|
8
9
|
readonly isRedoStackEmpty: boolean;
|
|
9
10
|
constructor(isUndoStackEmpty?: boolean, isRedoStackEmpty?: boolean);
|
|
10
11
|
}
|
|
11
12
|
export declare class History {
|
|
13
|
+
private readonly store;
|
|
12
14
|
readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
readonly undoStack: HistoryEntry[];
|
|
16
|
+
readonly redoStack: HistoryEntry[];
|
|
15
17
|
get isUndoStackEmpty(): boolean;
|
|
16
18
|
get isRedoStackEmpty(): boolean;
|
|
19
|
+
constructor(store: Store);
|
|
17
20
|
clear(): void;
|
|
18
21
|
/**
|
|
19
|
-
* Record a local
|
|
22
|
+
* Record a non-empty local durable increment, which will go into the undo stack..
|
|
23
|
+
* Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
|
|
20
24
|
*/
|
|
21
|
-
record(
|
|
22
|
-
undo(elements: SceneElementsMap, appState: AppState
|
|
23
|
-
redo(elements: SceneElementsMap, appState: AppState
|
|
25
|
+
record(delta: StoreDelta): void;
|
|
26
|
+
undo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
27
|
+
redo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
24
28
|
private perform;
|
|
25
29
|
private static pop;
|
|
26
30
|
private static push;
|
|
27
31
|
}
|
|
28
|
-
export
|
|
29
|
-
readonly appStateChange: AppStateChange;
|
|
30
|
-
readonly elementsChange: ElementsChange;
|
|
31
|
-
private constructor();
|
|
32
|
-
static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry;
|
|
33
|
-
inverse(): HistoryEntry;
|
|
34
|
-
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): [SceneElementsMap, AppState, boolean];
|
|
35
|
-
/**
|
|
36
|
-
* Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`.
|
|
37
|
-
*/
|
|
38
|
-
applyLatestChanges(elements: SceneElementsMap): HistoryEntry;
|
|
39
|
-
isEmpty(): boolean;
|
|
40
|
-
}
|
|
32
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Emitter } from "
|
|
1
|
+
import type { Emitter } from "@excalidraw/common";
|
|
2
2
|
export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
|
|
@@ -9,20 +9,20 @@ import "./fonts/fonts.css";
|
|
|
9
9
|
import type { ExcalidrawProps } from "./types";
|
|
10
10
|
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
|
|
12
|
-
export { getTextFromElements } from "@excalidraw/element
|
|
13
|
-
export { isInvisiblySmallElement } from "@excalidraw/element
|
|
12
|
+
export { getTextFromElements } from "@excalidraw/element";
|
|
13
|
+
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
14
14
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
15
15
|
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
16
16
|
export { reconcileElements } from "./data/reconcile";
|
|
17
17
|
export { exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
|
|
18
18
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
19
19
|
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
20
|
-
export { getFreeDrawSvgPath } from "@excalidraw/element
|
|
20
|
+
export { getFreeDrawSvgPath } from "@excalidraw/element";
|
|
21
21
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
22
|
-
export { isLinearElement } from "@excalidraw/element
|
|
22
|
+
export { isLinearElement } from "@excalidraw/element";
|
|
23
23
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, } from "@excalidraw/common";
|
|
24
|
-
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element
|
|
25
|
-
export { CaptureUpdateAction } from "
|
|
24
|
+
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
|
|
25
|
+
export { CaptureUpdateAction } from "@excalidraw/element";
|
|
26
26
|
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
27
27
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "@excalidraw/common";
|
|
28
28
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
@@ -39,12 +39,12 @@ export { TTDDialog } from "./components/TTDDialog/TTDDialog";
|
|
|
39
39
|
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
40
40
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
41
41
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
42
|
-
export { getCommonBounds, getVisibleSceneBounds
|
|
42
|
+
export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element";
|
|
43
43
|
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
|
|
44
44
|
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
45
45
|
export { getDataURL } from "./data/blob";
|
|
46
|
-
export { isElementLink } from "@excalidraw/element
|
|
47
|
-
export { setCustomTextMetricsProvider } from "@excalidraw/element
|
|
46
|
+
export { isElementLink } from "@excalidraw/element";
|
|
47
|
+
export { setCustomTextMetricsProvider } from "@excalidraw/element";
|
|
48
48
|
export { getDefaultAppState, cleanAppStateForExport, clearAppStateForLocalStorage, } from "./appState";
|
|
49
49
|
export { libraryItemsAtom } from "./data/library";
|
|
50
50
|
export * as icons from "./components/icons";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AnimationFrameHandler } from "../animation-frame-handler";
|
|
2
|
+
import { AnimatedTrail } from "../animated-trail";
|
|
3
|
+
import type App from "../components/App";
|
|
4
|
+
export declare class LassoTrail extends AnimatedTrail {
|
|
5
|
+
private intersectedElements;
|
|
6
|
+
private enclosedElements;
|
|
7
|
+
private elementsSegments;
|
|
8
|
+
private canvasTranslate;
|
|
9
|
+
private keepPreviousSelection;
|
|
10
|
+
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
11
|
+
startPath(x: number, y: number, keepPreviousSelection?: boolean): void;
|
|
12
|
+
selectElementsFromIds: (ids: string[]) => void;
|
|
13
|
+
addPointToPath: (x: number, y: number, keepPreviousSelection?: boolean) => void;
|
|
14
|
+
private updateSelection;
|
|
15
|
+
endPath(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
|
|
2
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
export declare const getLassoSelectedElementIds: (input: {
|
|
4
|
+
lassoPath: GlobalPoint[];
|
|
5
|
+
elements: readonly ExcalidrawElement[];
|
|
6
|
+
elementsSegments: ElementsSegmentsMap;
|
|
7
|
+
intersectedElements: Set<ExcalidrawElement["id"]>;
|
|
8
|
+
enclosedElements: Set<ExcalidrawElement["id"]>;
|
|
9
|
+
simplifyDistance?: number;
|
|
10
|
+
}) => {
|
|
11
|
+
selectedElementIds: string[];
|
|
12
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
|
|
1
2
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
2
3
|
import type { AppState } from "../types";
|
|
3
|
-
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
4
|
+
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
|
|
4
5
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
6
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, canvasBackgroundColor, }: {
|
|
6
7
|
canvas: HTMLCanvasElement;
|
|
@@ -11,3 +12,7 @@ export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normali
|
|
|
11
12
|
isExporting?: boolean | undefined;
|
|
12
13
|
canvasBackgroundColor?: string | null | undefined;
|
|
13
14
|
}) => CanvasRenderingContext2D;
|
|
15
|
+
export declare const drawHighlightForRectWithRotation: (context: CanvasRenderingContext2D, element: ExcalidrawRectanguloidElement, padding: number) => void;
|
|
16
|
+
export declare const strokeEllipseWithRotation: (context: CanvasRenderingContext2D, width: number, height: number, cx: number, cy: number, angle: number) => void;
|
|
17
|
+
export declare const strokeRectWithRotation: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, cx: number, cy: number, angle: number, fill?: boolean, radius?: number) => void;
|
|
18
|
+
export declare const drawHighlightForDiamondWithRotation: (context: CanvasRenderingContext2D, padding: number, element: ExcalidrawDiamondElement) => void;
|