@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.
Files changed (95) hide show
  1. package/dist/excalidraw.development.js +267 -92
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/styles.development.css +1103 -854
  4. package/dist/styles.production.css +16 -15
  5. package/package.json +5 -3
  6. package/types/excalidraw/actions/actionAddToLibrary.d.ts +20 -5
  7. package/types/excalidraw/actions/actionAlign.d.ts +39 -27
  8. package/types/excalidraw/actions/actionBoundText.d.ts +20 -10
  9. package/types/excalidraw/actions/actionCanvas.d.ts +148 -52
  10. package/types/excalidraw/actions/actionClipboard.d.ts +72 -30
  11. package/types/excalidraw/actions/actionDeleteSelected.d.ts +25 -9
  12. package/types/excalidraw/actions/actionDistribute.d.ts +10 -8
  13. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +7 -7
  14. package/types/excalidraw/actions/actionElementLock.d.ts +24 -11
  15. package/types/excalidraw/actions/actionExport.d.ts +85 -32
  16. package/types/excalidraw/actions/actionFinalize.d.ts +19 -8
  17. package/types/excalidraw/actions/actionFlip.d.ts +13 -11
  18. package/types/excalidraw/actions/actionFrame.d.ts +30 -200
  19. package/types/excalidraw/actions/actionGroup.d.ts +15 -379
  20. package/types/excalidraw/actions/actionHistory.d.ts +3 -2
  21. package/types/excalidraw/actions/actionLinearEditor.d.ts +9 -3
  22. package/types/excalidraw/actions/actionLink.d.ts +12 -6
  23. package/types/excalidraw/actions/actionMenu.d.ts +25 -8
  24. package/types/excalidraw/actions/actionNavigate.d.ts +14 -3
  25. package/types/excalidraw/actions/actionProperties.d.ts +114 -32
  26. package/types/excalidraw/actions/actionSelectAll.d.ts +12 -5
  27. package/types/excalidraw/actions/actionStyles.d.ts +18 -14
  28. package/types/excalidraw/actions/actionToggleGridMode.d.ts +12 -5
  29. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +12 -6
  30. package/types/excalidraw/actions/actionToggleStats.d.ts +12 -5
  31. package/types/excalidraw/actions/actionToggleViewMode.d.ts +12 -5
  32. package/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -5
  33. package/types/excalidraw/actions/actionZindex.d.ts +26 -23
  34. package/types/excalidraw/actions/manager.d.ts +3 -3
  35. package/types/excalidraw/actions/shortcuts.d.ts +2 -2
  36. package/types/excalidraw/actions/types.d.ts +10 -8
  37. package/types/excalidraw/appState.d.ts +4 -4
  38. package/types/excalidraw/change.d.ts +191 -0
  39. package/types/excalidraw/clients.d.ts +10 -1
  40. package/types/excalidraw/components/Actions.d.ts +3 -1
  41. package/types/excalidraw/components/App.d.ts +23 -9
  42. package/types/excalidraw/components/Avatar.d.ts +2 -3
  43. package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +18 -0
  44. package/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
  45. package/types/excalidraw/components/CommandPalette/types.d.ts +25 -0
  46. package/types/excalidraw/components/InlineIcon.d.ts +1 -1
  47. package/types/excalidraw/components/RadioGroup.d.ts +2 -1
  48. package/types/excalidraw/components/ToolButton.d.ts +1 -0
  49. package/types/excalidraw/components/UserList.d.ts +3 -7
  50. package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -1
  51. package/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
  52. package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
  53. package/types/excalidraw/components/icons.d.ts +26 -1
  54. package/types/excalidraw/components/main-menu/DefaultItems.d.ts +15 -1
  55. package/types/excalidraw/constants.d.ts +8 -0
  56. package/types/excalidraw/data/reconcile.d.ts +6 -0
  57. package/types/excalidraw/data/restore.d.ts +3 -3
  58. package/types/excalidraw/data/transform.d.ts +1 -1
  59. package/types/excalidraw/data/url.d.ts +1 -0
  60. package/types/excalidraw/deburr.d.ts +1 -0
  61. package/types/excalidraw/element/binding.d.ts +52 -9
  62. package/types/excalidraw/element/bounds.d.ts +0 -1
  63. package/types/excalidraw/element/collision.d.ts +14 -19
  64. package/types/excalidraw/element/embeddable.d.ts +14 -4
  65. package/types/excalidraw/element/index.d.ts +0 -1
  66. package/types/excalidraw/element/linearElementEditor.d.ts +17 -12
  67. package/types/excalidraw/element/mutateElement.d.ts +1 -2
  68. package/types/excalidraw/element/newElement.d.ts +1 -1
  69. package/types/excalidraw/element/resizeElements.d.ts +1 -1
  70. package/types/excalidraw/element/resizeTest.d.ts +4 -4
  71. package/types/excalidraw/element/textElement.d.ts +1 -7
  72. package/types/excalidraw/element/transformHandles.d.ts +22 -4
  73. package/types/excalidraw/element/typeChecks.d.ts +2 -2
  74. package/types/excalidraw/element/types.d.ts +22 -6
  75. package/types/excalidraw/errors.d.ts +3 -0
  76. package/types/excalidraw/fractionalIndex.d.ts +40 -0
  77. package/types/excalidraw/frame.d.ts +1 -1
  78. package/types/excalidraw/groups.d.ts +2 -0
  79. package/types/excalidraw/history.d.ts +34 -46
  80. package/types/excalidraw/hooks/useEmitter.d.ts +2 -0
  81. package/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
  82. package/types/excalidraw/index.d.ts +3 -1
  83. package/types/excalidraw/keys.d.ts +1 -0
  84. package/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  85. package/types/excalidraw/scene/Scene.d.ts +7 -6
  86. package/types/excalidraw/scene/types.d.ts +11 -20
  87. package/types/excalidraw/store.d.ts +99 -0
  88. package/types/excalidraw/types.d.ts +39 -6
  89. package/types/excalidraw/utils.d.ts +7 -0
  90. package/types/excalidraw/webpack.prod.config.d.ts +1 -1
  91. package/types/excalidraw/zindex.d.ts +2 -2
  92. package/types/utils/collision.d.ts +4 -0
  93. package/types/utils/export.d.ts +2 -2
  94. package/types/utils/geometry/geometry.d.ts +71 -0
  95. 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 {};