@excalidraw/element 0.18.0-c158187 → 0.18.0-c1dbbdf

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 (121) hide show
  1. package/dist/dev/index.js +3420 -2566
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +12 -12
  4. package/dist/types/common/debug.d.ts +21 -0
  5. package/dist/types/common/src/colors.d.ts +57 -40
  6. package/dist/types/common/src/constants.d.ts +4 -0
  7. package/dist/types/common/src/editorInterface.d.ts +1 -1
  8. package/dist/types/common/src/index.d.ts +1 -1
  9. package/dist/types/common/src/utils.d.ts +3 -5
  10. package/dist/types/element/src/Scene.d.ts +2 -0
  11. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  12. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  13. package/dist/types/element/src/binding.d.ts +13 -8
  14. package/dist/types/element/src/collision.d.ts +4 -3
  15. package/dist/types/element/src/distribute.d.ts +2 -1
  16. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  17. package/dist/types/element/src/index.d.ts +2 -0
  18. package/dist/types/element/src/linearElementEditor.d.ts +5 -0
  19. package/dist/types/element/src/mutateElement.d.ts +2 -0
  20. package/dist/types/element/src/types.d.ts +1 -1
  21. package/dist/types/element/src/utils.d.ts +5 -3
  22. package/dist/types/{common → element}/src/visualdebug.d.ts +20 -2
  23. package/dist/types/element/src/zindex.d.ts +1 -1
  24. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +30 -27
  25. package/dist/types/excalidraw/actions/actionBoundText.d.ts +20 -18
  26. package/dist/types/excalidraw/actions/actionCanvas.d.ts +121 -109
  27. package/dist/types/excalidraw/actions/actionClipboard.d.ts +20 -18
  28. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +10 -9
  29. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +32 -27
  30. package/dist/types/excalidraw/actions/actionElementLink.d.ts +6 -9
  31. package/dist/types/excalidraw/actions/actionElementLock.d.ts +20 -18
  32. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +10 -9
  33. package/dist/types/excalidraw/actions/actionExport.d.ts +42 -42
  34. package/dist/types/excalidraw/actions/actionFrame.d.ts +40 -36
  35. package/dist/types/excalidraw/actions/actionGroup.d.ts +20 -18
  36. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +12 -9
  37. package/dist/types/excalidraw/actions/actionLink.d.ts +10 -9
  38. package/dist/types/excalidraw/actions/actionMenu.d.ts +6 -9
  39. package/dist/types/excalidraw/actions/actionProperties.d.ts +20 -18
  40. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +10 -9
  41. package/dist/types/excalidraw/actions/actionStyles.d.ts +10 -9
  42. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
  43. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +10 -9
  44. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
  45. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +10 -9
  46. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +6 -9
  47. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +10 -9
  48. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +10 -9
  49. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +10 -9
  50. package/dist/types/excalidraw/actions/index.d.ts +2 -0
  51. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  52. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  53. package/dist/types/excalidraw/appState.d.ts +9 -7
  54. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  55. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  56. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  57. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  58. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  59. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  60. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  61. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  62. package/dist/types/excalidraw/clipboard.d.ts +4 -4
  63. package/dist/types/excalidraw/components/App.d.ts +10 -3
  64. package/dist/types/excalidraw/components/Card.d.ts +1 -2
  65. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +0 -5
  66. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -1
  67. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
  68. package/dist/types/excalidraw/components/FilledButton.d.ts +1 -0
  69. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  70. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  71. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  72. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  73. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  74. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  75. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  76. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  77. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  78. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  79. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  80. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -28
  81. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  82. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -1
  83. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  84. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  85. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  86. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  87. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +14 -13
  88. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  89. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  90. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  91. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  92. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  93. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  94. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +24 -0
  95. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  96. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  97. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  98. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  99. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
  100. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  101. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
  102. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  103. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
  104. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  105. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  106. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  107. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  108. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  109. package/dist/types/excalidraw/components/icons.d.ts +11 -2
  110. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -0
  111. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -14
  112. package/dist/types/excalidraw/components/shapes.d.ts +74 -1
  113. package/dist/types/excalidraw/data/blob.d.ts +32 -30
  114. package/dist/types/excalidraw/data/json.d.ts +16 -15
  115. package/dist/types/excalidraw/errors.d.ts +14 -0
  116. package/dist/types/excalidraw/index.d.ts +4 -0
  117. package/dist/types/excalidraw/types.d.ts +24 -13
  118. package/dist/types/math/src/point.d.ts +6 -1
  119. package/dist/types/math/src/types.d.ts +25 -1
  120. package/package.json +9 -3
  121. package/dist/types/excalidraw/charts.d.ts +0 -27
@@ -0,0 +1,21 @@
1
+ export declare class Debug {
2
+ static DEBUG_LOG_TIMES: boolean;
3
+ private static TIMES_AGGR;
4
+ private static TIMES_AVG;
5
+ private static LAST_DEBUG_LOG_CALL;
6
+ private static DEBUG_LOG_INTERVAL_ID;
7
+ private static LAST_FRAME_TIMESTAMP;
8
+ private static FRAME_COUNT;
9
+ private static ANIMATION_FRAME_ID;
10
+ private static scheduleAnimationFrame;
11
+ private static setupInterval;
12
+ private static debugLogger;
13
+ static logTime: (time?: number, name?: string) => void;
14
+ static logTimeAverage: (time?: number, name?: string) => void;
15
+ private static logWrapper;
16
+ static logTimeWrap: <T extends any[], R>(fn: (...args: T) => R, name?: string) => (...args: T) => R;
17
+ static logTimeAverageWrap: <T extends any[], R>(fn: (...args: T) => R, name?: string) => (...args: T) => R;
18
+ static perfWrap: <T extends any[], R>(fn: (...args: T) => R, name?: string) => (...args: T) => R;
19
+ private static CHANGED_CACHE;
20
+ static logChanged(name: string, obj: Record<string, unknown>): void;
21
+ }
@@ -1,16 +1,5 @@
1
- import oc from "open-color";
2
- import tinycolor from "tinycolor2";
3
- import type { Merge } from "./utility-types";
4
- export { tinycolor };
5
1
  export declare const applyDarkModeFilter: (color: string) => string;
6
- export declare const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
7
- export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
8
2
  export type ColorTuple = readonly [string, string, string, string, string];
9
- export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
10
- black: "#1e1e1e";
11
- white: "#ffffff";
12
- transparent: "transparent";
13
- }>;
14
3
  export type ColorPaletteCustom = {
15
4
  [key: string]: ColorTuple | string;
16
5
  };
@@ -20,46 +9,74 @@ export declare const COLORS_PER_ROW = 5;
20
9
  export declare const DEFAULT_CHART_COLOR_INDEX = 4;
21
10
  export declare const DEFAULT_ELEMENT_STROKE_COLOR_INDEX = 4;
22
11
  export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX = 1;
23
- export declare const ELEMENTS_PALETTE_SHADE_INDEXES: readonly [0, 2, 4, 6, 8];
24
- export declare const CANVAS_PALETTE_SHADE_INDEXES: readonly [0, 1, 2, 3, 4];
25
- export declare const getSpecificColorShades: (color: Exclude<ColorPickerColor, "transparent" | "white" | "black" | "bronze">, indexArr: Readonly<ColorShadesIndexes>) => ColorTuple;
26
- export declare const COLOR_PALETTE: ColorPalette;
12
+ export declare const COLOR_PALETTE: {
13
+ readonly transparent: "transparent";
14
+ readonly black: "#1e1e1e";
15
+ readonly white: "#ffffff";
16
+ readonly gray: readonly ["#f8f9fa", "#e9ecef", "#ced4da", "#868e96", "#343a40"];
17
+ readonly red: readonly ["#fff5f5", "#ffc9c9", "#ff8787", "#fa5252", "#e03131"];
18
+ readonly pink: readonly ["#fff0f6", "#fcc2d7", "#f783ac", "#e64980", "#c2255c"];
19
+ readonly grape: readonly ["#f8f0fc", "#eebefa", "#da77f2", "#be4bdb", "#9c36b5"];
20
+ readonly violet: readonly ["#f3f0ff", "#d0bfff", "#9775fa", "#7950f2", "#6741d9"];
21
+ readonly blue: readonly ["#e7f5ff", "#a5d8ff", "#4dabf7", "#228be6", "#1971c2"];
22
+ readonly cyan: readonly ["#e3fafc", "#99e9f2", "#3bc9db", "#15aabf", "#0c8599"];
23
+ readonly teal: readonly ["#e6fcf5", "#96f2d7", "#38d9a9", "#12b886", "#099268"];
24
+ readonly green: readonly ["#ebfbee", "#b2f2bb", "#69db7c", "#40c057", "#2f9e44"];
25
+ readonly yellow: readonly ["#fff9db", "#ffec99", "#ffd43b", "#fab005", "#f08c00"];
26
+ readonly orange: readonly ["#fff4e6", "#ffd8a8", "#ffa94d", "#fd7e14", "#e8590c"];
27
+ readonly bronze: readonly ["#f8f1ee", "#eaddd7", "#d2bab0", "#a18072", "#846358"];
28
+ };
29
+ export type ColorPalette = typeof COLOR_PALETTE;
30
+ export type ColorPickerColor = keyof typeof COLOR_PALETTE;
27
31
  export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
28
32
  export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
29
33
  export declare const DEFAULT_CANVAS_BACKGROUND_PICKS: ColorTuple;
30
34
  export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
31
- readonly red: ColorTuple;
32
- readonly pink: ColorTuple;
33
- readonly grape: ColorTuple;
34
- readonly violet: ColorTuple;
35
- readonly blue: ColorTuple;
36
- readonly cyan: ColorTuple;
37
- readonly teal: ColorTuple;
38
- readonly green: ColorTuple;
39
- readonly yellow: ColorTuple;
40
- readonly orange: ColorTuple;
35
+ readonly cyan: readonly ["#e3fafc", "#99e9f2", "#3bc9db", "#15aabf", "#0c8599"];
36
+ readonly blue: readonly ["#e7f5ff", "#a5d8ff", "#4dabf7", "#228be6", "#1971c2"];
37
+ readonly violet: readonly ["#f3f0ff", "#d0bfff", "#9775fa", "#7950f2", "#6741d9"];
38
+ readonly grape: readonly ["#f8f0fc", "#eebefa", "#da77f2", "#be4bdb", "#9c36b5"];
39
+ readonly pink: readonly ["#fff0f6", "#fcc2d7", "#f783ac", "#e64980", "#c2255c"];
40
+ readonly green: readonly ["#ebfbee", "#b2f2bb", "#69db7c", "#40c057", "#2f9e44"];
41
+ readonly teal: readonly ["#e6fcf5", "#96f2d7", "#38d9a9", "#12b886", "#099268"];
42
+ readonly yellow: readonly ["#fff9db", "#ffec99", "#ffd43b", "#fab005", "#f08c00"];
43
+ readonly orange: readonly ["#fff4e6", "#ffd8a8", "#ffa94d", "#fd7e14", "#e8590c"];
44
+ readonly red: readonly ["#fff5f5", "#ffc9c9", "#ff8787", "#fa5252", "#e03131"];
41
45
  readonly transparent: "transparent";
42
46
  readonly white: "#ffffff";
43
- readonly gray: ColorTuple;
47
+ readonly gray: readonly ["#f8f9fa", "#e9ecef", "#ced4da", "#868e96", "#343a40"];
44
48
  readonly black: "#1e1e1e";
45
- readonly bronze: ColorTuple;
49
+ readonly bronze: readonly ["#f8f1ee", "#eaddd7", "#d2bab0", "#a18072", "#846358"];
46
50
  };
47
51
  export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
48
- readonly red: ColorTuple;
49
- readonly pink: ColorTuple;
50
- readonly grape: ColorTuple;
51
- readonly violet: ColorTuple;
52
- readonly blue: ColorTuple;
53
- readonly cyan: ColorTuple;
54
- readonly teal: ColorTuple;
55
- readonly green: ColorTuple;
56
- readonly yellow: ColorTuple;
57
- readonly orange: ColorTuple;
52
+ readonly cyan: readonly ["#e3fafc", "#99e9f2", "#3bc9db", "#15aabf", "#0c8599"];
53
+ readonly blue: readonly ["#e7f5ff", "#a5d8ff", "#4dabf7", "#228be6", "#1971c2"];
54
+ readonly violet: readonly ["#f3f0ff", "#d0bfff", "#9775fa", "#7950f2", "#6741d9"];
55
+ readonly grape: readonly ["#f8f0fc", "#eebefa", "#da77f2", "#be4bdb", "#9c36b5"];
56
+ readonly pink: readonly ["#fff0f6", "#fcc2d7", "#f783ac", "#e64980", "#c2255c"];
57
+ readonly green: readonly ["#ebfbee", "#b2f2bb", "#69db7c", "#40c057", "#2f9e44"];
58
+ readonly teal: readonly ["#e6fcf5", "#96f2d7", "#38d9a9", "#12b886", "#099268"];
59
+ readonly yellow: readonly ["#fff9db", "#ffec99", "#ffd43b", "#fab005", "#f08c00"];
60
+ readonly orange: readonly ["#fff4e6", "#ffd8a8", "#ffa94d", "#fd7e14", "#e8590c"];
61
+ readonly red: readonly ["#fff5f5", "#ffc9c9", "#ff8787", "#fa5252", "#e03131"];
58
62
  readonly transparent: "transparent";
59
63
  readonly white: "#ffffff";
60
- readonly gray: ColorTuple;
64
+ readonly gray: readonly ["#f8f9fa", "#e9ecef", "#ced4da", "#868e96", "#343a40"];
61
65
  readonly black: "#1e1e1e";
62
- readonly bronze: ColorTuple;
66
+ readonly bronze: readonly ["#f8f1ee", "#eaddd7", "#d2bab0", "#a18072", "#846358"];
63
67
  };
64
- export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
68
+ export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => ("#fff5f5" | "#ffc9c9" | "#ff8787" | "#fa5252" | "#e03131" | "#fff0f6" | "#fcc2d7" | "#f783ac" | "#e64980" | "#c2255c" | "#f8f0fc" | "#eebefa" | "#da77f2" | "#be4bdb" | "#9c36b5" | "#f3f0ff" | "#d0bfff" | "#9775fa" | "#7950f2" | "#6741d9" | "#e7f5ff" | "#a5d8ff" | "#4dabf7" | "#228be6" | "#1971c2" | "#e3fafc" | "#99e9f2" | "#3bc9db" | "#15aabf" | "#0c8599" | "#e6fcf5" | "#96f2d7" | "#38d9a9" | "#12b886" | "#099268" | "#ebfbee" | "#b2f2bb" | "#69db7c" | "#40c057" | "#2f9e44" | "#fff9db" | "#ffec99" | "#ffd43b" | "#fab005" | "#f08c00" | "#fff4e6" | "#ffd8a8" | "#ffa94d" | "#fd7e14" | "#e8590c")[];
65
69
  export declare const rgbToHex: (r: number, g: number, b: number, a?: number) => string;
70
+ /**
71
+ * @returns #RRGGBB or #RRGGBBAA based on color containing non-opaque alpha,
72
+ * null if not valid color
73
+ */
74
+ export declare const colorToHex: (color: string) => string | null;
75
+ export declare const isTransparent: (color: string) => boolean;
76
+ export declare const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
77
+ export declare const isColorDark: (color: string, threshold?: number) => boolean;
78
+ /**
79
+ * tries to keep the input color as-is if it's valid, making minimal adjustments
80
+ * (trimming whitespace or adding `#` to hex colors)
81
+ */
82
+ export declare const normalizeInputColor: (color: string) => string | null;
@@ -85,6 +85,7 @@ export declare const CLASSES: {
85
85
  CONVERT_ELEMENT_TYPE_POPUP: string;
86
86
  SHAPE_ACTIONS_THEME_SCOPE: string;
87
87
  FRAME_NAME: string;
88
+ DROPDOWN_MENU_EVENT_WRAPPER: string;
88
89
  };
89
90
  export declare const FONT_SIZES: {
90
91
  readonly sm: 16;
@@ -131,6 +132,7 @@ export declare const THEME: {
131
132
  readonly LIGHT: "light";
132
133
  readonly DARK: "dark";
133
134
  };
135
+ export declare const DARK_THEME_FILTER = "invert(93%) hue-rotate(180deg)";
134
136
  export declare const FRAME_STYLE: {
135
137
  strokeColor: ExcalidrawElement["strokeColor"];
136
138
  strokeWidth: ExcalidrawElement["strokeWidth"];
@@ -178,6 +180,7 @@ export declare const STRING_MIME_TYPES: {
178
180
  readonly html: "text/html";
179
181
  readonly json: "application/json";
180
182
  readonly excalidraw: "application/vnd.excalidraw+json";
183
+ readonly excalidrawClipboard: "application/vnd.excalidraw.clipboard+json";
181
184
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
182
185
  readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
183
186
  };
@@ -198,6 +201,7 @@ export declare const MIME_TYPES: {
198
201
  readonly html: "text/html";
199
202
  readonly json: "application/json";
200
203
  readonly excalidraw: "application/vnd.excalidraw+json";
204
+ readonly excalidrawClipboard: "application/vnd.excalidraw.clipboard+json";
201
205
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
202
206
  readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
203
207
  };
@@ -14,7 +14,7 @@ export declare const MQ_MAX_MOBILE = 599;
14
14
  export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
15
15
  export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
16
16
  export declare const MQ_MIN_TABLET: number;
17
- export declare const MQ_MAX_TABLET = 1400;
17
+ export declare const MQ_MAX_TABLET = 1180;
18
18
  export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
19
19
  export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
20
20
  export declare const isDarwin: boolean;
@@ -11,5 +11,5 @@ export * from "./random";
11
11
  export * from "./url";
12
12
  export * from "./utils";
13
13
  export * from "./emitter";
14
- export * from "./visualdebug";
15
14
  export * from "./editorInterface";
15
+ export { Debug } from "../debug";
@@ -1,3 +1,4 @@
1
+ import type { GlobalCoord } from "@excalidraw/math";
1
2
  import type { FontFamilyValues, FontString } from "@excalidraw/element/types";
2
3
  import type { ActiveTool, AppState, ToolType, UnsubscribeCallback, Zoom } from "@excalidraw/excalidraw/types";
3
4
  import type { MaybePromise, ResolutionType } from "./utility-types";
@@ -108,10 +109,7 @@ export declare const viewportCoordsToSceneCoords: ({ clientX, clientY }: {
108
109
  offsetTop: number;
109
110
  scrollX: number;
110
111
  scrollY: number;
111
- }) => {
112
- x: number;
113
- y: number;
114
- };
112
+ }) => GlobalCoord;
115
113
  export declare const sceneCoordsToViewportCoords: ({ sceneX, sceneY }: {
116
114
  sceneX: number;
117
115
  sceneY: number;
@@ -143,7 +141,6 @@ export declare const findIndex: <T>(array: readonly T[], cb: (element: T, index:
143
141
  export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
144
142
  /** returns the first non-null mapped value */
145
143
  export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K | undefined | null) => K | undefined;
146
- export declare const isTransparent: (color: string) => boolean;
147
144
  export type ResolvablePromise<T> = Promise<T> & {
148
145
  resolve: [T] extends [undefined] ? (value?: MaybePromise<Awaited<T>>) => void : (value: MaybePromise<Awaited<T>>) => void;
149
146
  reject: (error: Error) => void;
@@ -280,4 +277,5 @@ type FEATURE_FLAGS = {
280
277
  };
281
278
  export declare const getFeatureFlag: <F extends keyof FEATURE_FLAGS>(flag: F) => FEATURE_FLAGS[F];
282
279
  export declare const setFeatureFlag: <F extends keyof FEATURE_FLAGS>(flag: F, value: FEATURE_FLAGS[F]) => void;
280
+ export declare const oneOf: <N extends string | number | symbol | null, H extends N>(needle: N, haystack: readonly H[]) => needle is H;
283
281
  export {};
@@ -75,6 +75,8 @@ export declare class Scene {
75
75
  mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
76
76
  informMutation: boolean;
77
77
  isDragging: boolean;
78
+ isBindingEnabled?: boolean;
79
+ isMidpointSnappingEnabled?: boolean;
78
80
  }): TElement;
79
81
  }
80
82
  export {};
@@ -0,0 +1,27 @@
1
+ import { type GlobalPoint } from "@excalidraw/math";
2
+ import type { AppState, NullableGridSize } from "@excalidraw/excalidraw/types";
3
+ import { LinearElementEditor } from "../linearElementEditor";
4
+ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, NonDeletedSceneElementsMap } from "../types";
5
+ import type { Scene } from "../Scene";
6
+ export declare const isFocusPointVisible: (focusPoint: GlobalPoint, arrow: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, appState: {
7
+ isBindingEnabled: AppState["isBindingEnabled"];
8
+ zoom: AppState["zoom"];
9
+ }, startOrEnd: "start" | "end", ignoreOverlap?: boolean) => boolean;
10
+ export declare const handleFocusPointDrag: (linearElementEditor: LinearElementEditor, elementsMap: NonDeletedSceneElementsMap, pointerCoords: {
11
+ x: number;
12
+ y: number;
13
+ }, scene: Scene, appState: AppState, gridSize: NullableGridSize, switchToInsideBinding: boolean) => void;
14
+ export declare const handleFocusPointPointerDown: (arrow: ExcalidrawArrowElement, pointerDownState: {
15
+ origin: {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ }, elementsMap: NonDeletedSceneElementsMap, appState: AppState) => {
20
+ hitFocusPoint: "start" | "end" | null;
21
+ pointerOffset: {
22
+ x: number;
23
+ y: number;
24
+ };
25
+ };
26
+ export declare const handleFocusPointPointerUp: (linearElementEditor: LinearElementEditor, scene: Scene) => void;
27
+ export declare const handleFocusPointHover: (arrow: ExcalidrawArrowElement, scenePointerX: number, scenePointerY: number, scene: Scene, appState: AppState) => "start" | "end" | null;
@@ -0,0 +1,5 @@
1
+ import type { App } from "@excalidraw/excalidraw/types";
2
+ export declare const maybeHandleArrowPointlikeDrag: ({ app, event, }: {
3
+ app: App;
4
+ event: KeyboardEvent | React.KeyboardEvent<Element> | PointerEvent;
5
+ }) => boolean;
@@ -24,12 +24,15 @@ export type BindingStrategy = {
24
24
  *
25
25
  * IMPORTANT: currently must be > 0 (this also applies to the computed gap)
26
26
  */
27
- export declare const BASE_BINDING_GAP = 10;
27
+ export declare const BASE_BINDING_GAP = 5;
28
28
  export declare const BASE_BINDING_GAP_ELBOW = 5;
29
+ export declare const BASE_ARROW_MIN_LENGTH = 10;
30
+ export declare const FOCUS_POINT_SIZE: number;
29
31
  export declare const getBindingGap: (bindTarget: ExcalidrawBindableElement, opts: Pick<ExcalidrawArrowElement, "elbowed">) => number;
30
32
  export declare const maxBindingDistance_simple: (zoom?: AppState["zoom"]) => number;
31
- export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<HTMLElement>) => boolean;
32
- export declare const isBindingEnabled: (appState: AppState) => boolean;
33
+ export declare const isBindingEnabled: (appState: {
34
+ isBindingEnabled: AppState["isBindingEnabled"];
35
+ }) => boolean;
33
36
  export declare const bindOrUnbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, draggingPoints: PointsPositionUpdates, scenePointerX: number, scenePointerY: number, scene: Scene, appState: AppState, opts?: {
34
37
  newArrow?: boolean;
35
38
  altKey?: boolean;
@@ -51,7 +54,7 @@ export declare const getBindingStrategyForDraggingBindingElementEndpoints: (arro
51
54
  end: BindingStrategy;
52
55
  };
53
56
  export declare const bindOrUnbindBindingElements: (selectedArrows: NonDeleted<ExcalidrawArrowElement>[], scene: Scene, appState: AppState) => void;
54
- export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint) => void;
57
+ export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint, shouldSnapToOutline?: boolean) => void;
55
58
  export declare const unbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
56
59
  export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
57
60
  simultaneouslyUpdated?: readonly ExcalidrawElement[];
@@ -65,10 +68,11 @@ export declare const updateBindings: (latestElement: ExcalidrawElement, scene: S
65
68
  };
66
69
  }) => void;
67
70
  export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, elementsMap: ElementsMap, zoom?: AppState["zoom"]) => Heading;
68
- export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>) => GlobalPoint;
71
+ export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>, isMidpointSnappingEnabled?: boolean) => GlobalPoint;
69
72
  export declare const avoidRectangularCorner: (arrowElement: ExcalidrawArrowElement, bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
70
- export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>) => LocalPoint | null;
71
- export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => {
73
+ export declare const snapToMid: (bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint, tolerance?: number, arrowElement?: ExcalidrawArrowElement) => GlobalPoint | undefined;
74
+ export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, dragging?: boolean) => LocalPoint | null;
75
+ export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, shouldSnapToOutline?: boolean, isMidpointSnappingEnabled?: boolean) => {
72
76
  fixedPoint: FixedPoint;
73
77
  };
74
78
  export declare const calculateFixedPointForNonElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, focusPoint?: GlobalPoint) => {
@@ -120,5 +124,6 @@ export declare class BindableElement {
120
124
  export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: FixedPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap) => GlobalPoint;
121
125
  export declare const getGlobalFixedPoints: (arrow: ExcalidrawArrowElement, elementsMap: ElementsMap) => [GlobalPoint, GlobalPoint];
122
126
  export declare const getArrowLocalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) => LocalPoint[];
123
- export declare const normalizeFixedPoint: <T extends FixedPoint | null>(fixedPoint: T) => T extends null ? null : FixedPoint;
127
+ export declare const isFixedPoint: (fixedPoint: any) => fixedPoint is FixedPointBinding["fixedPoint"];
128
+ export declare const normalizeFixedPoint: <T extends FixedPoint>(fixedPoint: T) => FixedPoint;
124
129
  export declare const getBindingSideMidPoint: (binding: FixedPointBinding, elementsMap: ElementsMap) => GlobalPoint | LocalPoint | null;
@@ -1,6 +1,6 @@
1
1
  import type { GlobalPoint, LineSegment } from "@excalidraw/math";
2
2
  import type { FrameNameBounds } from "@excalidraw/excalidraw/types";
3
- import type { ElementsMap, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
3
+ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
4
4
  export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
5
5
  export type HitTestArgs = {
6
6
  point: GlobalPoint;
@@ -14,8 +14,9 @@ export declare const hitElementItself: ({ point, element, threshold, elementsMap
14
14
  export declare const hitElementBoundingBox: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
15
15
  export declare const hitElementBoundingBoxOnly: (hitArgs: HitTestArgs, elementsMap: ElementsMap) => boolean;
16
16
  export declare const hitElementBoundText: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
17
- export declare const getAllHoveredElementAtPoint: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, toleranceFn?: (element: ExcalidrawBindableElement) => number) => NonDeleted<ExcalidrawBindableElement>[];
18
- export declare const getHoveredElementForBinding: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, toleranceFn?: (element: ExcalidrawBindableElement) => number) => NonDeleted<ExcalidrawBindableElement> | null;
17
+ export declare const getAllHoveredElementAtPoint: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement>[];
18
+ export declare const getHoveredElementForBinding: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement> | null;
19
+ export declare const getHoveredElementForFocusPoint: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => ExcalidrawBindableElement | null;
19
20
  /**
20
21
  * Intersect a line with an element for binding test
21
22
  *
@@ -1,7 +1,8 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
+ import type { Scene } from "./Scene";
2
3
  import type { ElementsMap, ExcalidrawElement } from "./types";
3
4
  export interface Distribution {
4
5
  space: "between";
5
6
  axis: "x" | "y";
6
7
  }
7
- export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>) => ExcalidrawElement[];
8
+ export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>, scene: Scene) => ExcalidrawElement[];
@@ -13,5 +13,7 @@ export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArr
13
13
  endBinding?: FixedPointBinding | null;
14
14
  }, options?: {
15
15
  isDragging?: boolean;
16
+ isBindingEnabled?: boolean;
17
+ isMidpointSnappingEnabled?: boolean;
16
18
  }) => ElementUpdate<ExcalidrawElbowArrowElement>;
17
19
  export declare const validateElbowPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], tolerance?: number) => boolean;
@@ -27,6 +27,7 @@ export * from "./elbowArrow";
27
27
  export * from "./elementLink";
28
28
  export * from "./embeddable";
29
29
  export * from "./flowchart";
30
+ export * from "./arrows/focus";
30
31
  export * from "./fractionalIndex";
31
32
  export * from "./frame";
32
33
  export * from "./groups";
@@ -54,3 +55,4 @@ export * from "./transformHandles";
54
55
  export * from "./typeChecks";
55
56
  export * from "./utils";
56
57
  export * from "./zindex";
58
+ export * from "./arrows/helpers";
@@ -33,6 +33,8 @@ export declare class LinearElementEditor {
33
33
  }>;
34
34
  readonly hoverPointIndex: number;
35
35
  readonly segmentMidPointHoveredCoords: GlobalPoint | null;
36
+ readonly hoveredFocusPointBinding: "start" | "end" | null;
37
+ readonly draggedFocusPointBinding: "start" | "end" | null;
36
38
  readonly elbowed: boolean;
37
39
  readonly customLineAngle: number | null;
38
40
  readonly isEditing: boolean;
@@ -94,6 +96,9 @@ export declare class LinearElementEditor {
94
96
  startBinding?: FixedPointBinding | null;
95
97
  endBinding?: FixedPointBinding | null;
96
98
  moveMidPointsWithElement?: boolean | null;
99
+ }, options?: {
100
+ isBindingEnabled?: boolean;
101
+ isMidpointSnappingEnabled?: boolean;
97
102
  }): void;
98
103
  static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
99
104
  static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
@@ -11,6 +11,8 @@ export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TEl
11
11
  */
12
12
  export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
13
13
  isDragging?: boolean;
14
+ isBindingEnabled?: boolean;
15
+ isMidpointSnappingEnabled?: boolean;
14
16
  }) => TElement;
15
17
  export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>,
16
18
  /** pass `true` to always regenerate */
@@ -1,7 +1,7 @@
1
1
  import type { LocalPoint, Radians } from "@excalidraw/math";
2
2
  import type { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "@excalidraw/common";
3
3
  import type { MakeBrand, MarkNonNullable, Merge, ValueOf } from "@excalidraw/common/utility-types";
4
- export type ChartType = "bar" | "line";
4
+ export type ChartType = "bar" | "line" | "radar";
5
5
  export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
6
6
  export type FontFamilyKeys = keyof typeof FONT_FAMILY;
7
7
  export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
@@ -1,7 +1,7 @@
1
1
  import { type GlobalPoint } from "@excalidraw/math";
2
2
  import type { Curve, LineSegment } from "@excalidraw/math";
3
- import type { Zoom } from "@excalidraw/excalidraw/types";
4
- import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
3
+ import type { AppState, Zoom } from "@excalidraw/excalidraw/types";
4
+ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
5
5
  /**
6
6
  * Returns the **rotated** components of freedraw, line or arrow elements.
7
7
  *
@@ -18,6 +18,7 @@ export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLi
18
18
  * @returns Tuple of **unrotated** line segments (0) and curves (1)
19
19
  */
20
20
  export declare function deconstructRectanguloidElement(element: ExcalidrawRectanguloidElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
21
+ export declare function getDiamondBaseCorners(element: ExcalidrawDiamondElement, offset?: number): Curve<GlobalPoint>[];
21
22
  /**
22
23
  * Get the **unrotated** building components of a diamond element
23
24
  * in the form of line segments and curves as a tuple, in this order.
@@ -31,4 +32,5 @@ export declare const isPathALoop: (points: ExcalidrawLinearElement["points"],
31
32
  /** supply if you want the loop detection to account for current zoom */
32
33
  zoomValue?: Zoom["value"]) => boolean;
33
34
  export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
34
- export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => GlobalPoint | null;
35
+ export declare const getSnapOutlineMidPoint: (point: GlobalPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap, zoom: AppState["zoom"]) => GlobalPoint | undefined;
36
+ export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, zoom: AppState["zoom"], isMidpointSnappingEnabled?: boolean) => GlobalPoint | null;
@@ -1,7 +1,8 @@
1
1
  import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
2
+ import { type Bounds } from "@excalidraw/common";
3
+ import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
2
4
  import type { Curve } from "@excalidraw/math";
3
5
  import type { LineSegment } from "@excalidraw/utils";
4
- import { type Bounds } from "./bounds";
5
6
  declare global {
6
7
  interface Window {
7
8
  visualDebug?: {
@@ -12,9 +13,20 @@ declare global {
12
13
  }
13
14
  export type DebugElement = {
14
15
  color: string;
15
- data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;
16
+ data: LineSegment<GlobalPoint> | Curve<GlobalPoint> | DebugPolygon;
16
17
  permanent: boolean;
17
18
  };
19
+ export type DebugPolygon = {
20
+ type: "polygon";
21
+ points: GlobalPoint[];
22
+ fill?: boolean;
23
+ close?: boolean;
24
+ };
25
+ export declare const debugDrawHitVolume: (element: ExcalidrawElement, elementsMap: ElementsMap, options?: {
26
+ rays?: number;
27
+ color?: string;
28
+ fill?: boolean;
29
+ }) => void;
18
30
  export declare const debugDrawCubicBezier: (c: Curve<GlobalPoint>, opts?: {
19
31
  color?: string;
20
32
  permanent?: boolean;
@@ -23,6 +35,12 @@ export declare const debugDrawLine: (segment: LineSegment<GlobalPoint> | LineSeg
23
35
  color?: string;
24
36
  permanent?: boolean;
25
37
  }) => void;
38
+ export declare const debugDrawPolygon: (points: GlobalPoint[], opts?: {
39
+ color?: string;
40
+ permanent?: boolean;
41
+ fill?: boolean;
42
+ close?: boolean;
43
+ }) => void;
26
44
  export declare const debugDrawPoint: (p: GlobalPoint, opts?: {
27
45
  color?: string;
28
46
  permanent?: boolean;
@@ -6,7 +6,7 @@ import type { ExcalidrawArrowElement, ExcalidrawElement, NonDeletedExcalidrawEle
6
6
  * Moves the arrow element above any bindable elements it intersects with or
7
7
  * hovers over.
8
8
  */
9
- export declare const moveArrowAboveBindable: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, scene: Scene) => readonly OrderedExcalidrawElement[];
9
+ export declare const moveArrowAboveBindable: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, scene: Scene, hit?: NonDeletedExcalidrawElement) => readonly OrderedExcalidrawElement[];
10
10
  export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
11
11
  export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
12
12
  export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];