@zsviczian/excalidraw 0.17.1-obsidian-19 → 0.17.1-obsidian-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/excalidraw.development.js +267 -92
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/styles.development.css +1103 -854
- package/dist/styles.production.css +16 -15
- package/package.json +5 -3
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +20 -5
- package/types/excalidraw/actions/actionAlign.d.ts +39 -27
- package/types/excalidraw/actions/actionBoundText.d.ts +20 -10
- package/types/excalidraw/actions/actionCanvas.d.ts +148 -52
- package/types/excalidraw/actions/actionClipboard.d.ts +72 -30
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +25 -9
- package/types/excalidraw/actions/actionDistribute.d.ts +10 -8
- package/types/excalidraw/actions/actionDuplicateSelection.d.ts +7 -7
- package/types/excalidraw/actions/actionElementLock.d.ts +24 -11
- package/types/excalidraw/actions/actionExport.d.ts +85 -32
- package/types/excalidraw/actions/actionFinalize.d.ts +19 -8
- package/types/excalidraw/actions/actionFlip.d.ts +13 -11
- package/types/excalidraw/actions/actionFrame.d.ts +30 -200
- package/types/excalidraw/actions/actionGroup.d.ts +15 -379
- package/types/excalidraw/actions/actionHistory.d.ts +3 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +9 -3
- package/types/excalidraw/actions/actionLink.d.ts +12 -6
- package/types/excalidraw/actions/actionMenu.d.ts +25 -8
- package/types/excalidraw/actions/actionNavigate.d.ts +14 -3
- package/types/excalidraw/actions/actionProperties.d.ts +114 -32
- package/types/excalidraw/actions/actionSelectAll.d.ts +12 -5
- package/types/excalidraw/actions/actionStyles.d.ts +18 -14
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +12 -5
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +12 -6
- package/types/excalidraw/actions/actionToggleStats.d.ts +12 -5
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +12 -5
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -5
- package/types/excalidraw/actions/actionZindex.d.ts +26 -23
- package/types/excalidraw/actions/manager.d.ts +3 -3
- package/types/excalidraw/actions/shortcuts.d.ts +2 -2
- package/types/excalidraw/actions/types.d.ts +10 -8
- package/types/excalidraw/appState.d.ts +4 -4
- package/types/excalidraw/change.d.ts +191 -0
- package/types/excalidraw/clients.d.ts +10 -1
- package/types/excalidraw/components/Actions.d.ts +3 -1
- package/types/excalidraw/components/App.d.ts +23 -9
- package/types/excalidraw/components/Avatar.d.ts +2 -3
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +18 -0
- package/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
- package/types/excalidraw/components/CommandPalette/types.d.ts +25 -0
- package/types/excalidraw/components/InlineIcon.d.ts +1 -1
- package/types/excalidraw/components/RadioGroup.d.ts +2 -1
- package/types/excalidraw/components/ToolButton.d.ts +1 -0
- package/types/excalidraw/components/UserList.d.ts +3 -7
- package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -1
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
- package/types/excalidraw/components/icons.d.ts +26 -1
- package/types/excalidraw/components/main-menu/DefaultItems.d.ts +15 -1
- package/types/excalidraw/constants.d.ts +8 -0
- package/types/excalidraw/data/reconcile.d.ts +6 -0
- package/types/excalidraw/data/restore.d.ts +3 -3
- package/types/excalidraw/data/transform.d.ts +1 -1
- package/types/excalidraw/data/url.d.ts +1 -0
- package/types/excalidraw/deburr.d.ts +1 -0
- package/types/excalidraw/element/binding.d.ts +52 -9
- package/types/excalidraw/element/bounds.d.ts +0 -1
- package/types/excalidraw/element/collision.d.ts +14 -19
- package/types/excalidraw/element/embeddable.d.ts +14 -4
- package/types/excalidraw/element/index.d.ts +0 -1
- package/types/excalidraw/element/linearElementEditor.d.ts +17 -12
- package/types/excalidraw/element/mutateElement.d.ts +1 -2
- package/types/excalidraw/element/newElement.d.ts +1 -1
- package/types/excalidraw/element/resizeElements.d.ts +1 -1
- package/types/excalidraw/element/resizeTest.d.ts +4 -4
- package/types/excalidraw/element/textElement.d.ts +1 -7
- package/types/excalidraw/element/transformHandles.d.ts +22 -4
- package/types/excalidraw/element/typeChecks.d.ts +2 -2
- package/types/excalidraw/element/types.d.ts +22 -6
- package/types/excalidraw/errors.d.ts +3 -0
- package/types/excalidraw/fractionalIndex.d.ts +40 -0
- package/types/excalidraw/frame.d.ts +1 -1
- package/types/excalidraw/groups.d.ts +2 -0
- package/types/excalidraw/history.d.ts +34 -46
- package/types/excalidraw/hooks/useEmitter.d.ts +2 -0
- package/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
- package/types/excalidraw/index.d.ts +3 -1
- package/types/excalidraw/keys.d.ts +1 -0
- package/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
- package/types/excalidraw/scene/Scene.d.ts +7 -6
- package/types/excalidraw/scene/types.d.ts +11 -20
- package/types/excalidraw/store.d.ts +99 -0
- package/types/excalidraw/types.d.ts +39 -6
- package/types/excalidraw/utils.d.ts +7 -0
- package/types/excalidraw/webpack.prod.config.d.ts +1 -1
- package/types/excalidraw/zindex.d.ts +2 -2
- package/types/utils/collision.d.ts +4 -0
- package/types/utils/export.d.ts +2 -2
- package/types/utils/geometry/geometry.d.ts +71 -0
- package/types/utils/geometry/shape.d.ts +56 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* this file defines pure geometric shapes
|
|
3
|
+
*
|
|
4
|
+
* for instance, a cubic bezier curve is specified by its four control points and
|
|
5
|
+
* an ellipse is defined by its center, angle, semi major axis and semi minor axis
|
|
6
|
+
* (but in semi-width and semi-height so it's more relevant to Excalidraw)
|
|
7
|
+
*
|
|
8
|
+
* the idea with pure shapes is so that we can provide collision and other geoemtric methods not depending on
|
|
9
|
+
* the specifics of roughjs or elements in Excalidraw; instead, we can focus on the pure shapes themselves
|
|
10
|
+
*
|
|
11
|
+
* also included in this file are methods for converting an Excalidraw element or a Drawable from roughjs
|
|
12
|
+
* to pure shapes
|
|
13
|
+
*/
|
|
14
|
+
import { ElementsMap, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawEllipseElement, ExcalidrawEmbeddableElement, ExcalidrawFrameLikeElement, ExcalidrawFreeDrawElement, ExcalidrawIframeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawRectangleElement, ExcalidrawSelectionElement, ExcalidrawTextElement } from "../../excalidraw/element/types";
|
|
15
|
+
import type { Drawable, Op } from "roughjs/bin/core";
|
|
16
|
+
export type Point = [number, number];
|
|
17
|
+
export type Vector = Point;
|
|
18
|
+
export type Line = [Point, Point];
|
|
19
|
+
export type Polyline = Line[];
|
|
20
|
+
export type Curve = [Point, Point, Point, Point];
|
|
21
|
+
export type Polycurve = Curve[];
|
|
22
|
+
export type Polygon = Point[];
|
|
23
|
+
export type Ellipse = {
|
|
24
|
+
center: Point;
|
|
25
|
+
angle: number;
|
|
26
|
+
halfWidth: number;
|
|
27
|
+
halfHeight: number;
|
|
28
|
+
};
|
|
29
|
+
export type GeometricShape = {
|
|
30
|
+
type: "line";
|
|
31
|
+
data: Line;
|
|
32
|
+
} | {
|
|
33
|
+
type: "polygon";
|
|
34
|
+
data: Polygon;
|
|
35
|
+
} | {
|
|
36
|
+
type: "curve";
|
|
37
|
+
data: Curve;
|
|
38
|
+
} | {
|
|
39
|
+
type: "ellipse";
|
|
40
|
+
data: Ellipse;
|
|
41
|
+
} | {
|
|
42
|
+
type: "polyline";
|
|
43
|
+
data: Polyline;
|
|
44
|
+
} | {
|
|
45
|
+
type: "polycurve";
|
|
46
|
+
data: Polycurve;
|
|
47
|
+
};
|
|
48
|
+
type RectangularElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawImageElement | ExcalidrawIframeElement | ExcalidrawTextElement | ExcalidrawSelectionElement;
|
|
49
|
+
export declare const getPolygonShape: (element: RectangularElement) => GeometricShape;
|
|
50
|
+
export declare const getSelectionBoxShape: (element: ExcalidrawElement, elementsMap: ElementsMap, padding?: number) => GeometricShape;
|
|
51
|
+
export declare const getEllipseShape: (element: ExcalidrawEllipseElement) => GeometricShape;
|
|
52
|
+
export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
53
|
+
export declare const getCurveShape: (roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: number, center: Point) => GeometricShape;
|
|
54
|
+
export declare const getFreedrawShape: (element: ExcalidrawFreeDrawElement, center: Point, isClosed?: boolean) => GeometricShape;
|
|
55
|
+
export declare const getClosedCurveShape: (element: ExcalidrawLinearElement, roughShape: Drawable, startingPoint: Point | undefined, angleInRadian: number, center: Point) => GeometricShape;
|
|
56
|
+
export {};
|