@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,172 @@
1
+ export declare const actionToggleMidpointSnapping: {
2
+ name: "midpointSnapping";
3
+ label: string;
4
+ viewMode: false;
5
+ trackEvent: {
6
+ category: "canvas";
7
+ predicate: (appState: Readonly<import("../types").AppState>) => boolean;
8
+ };
9
+ perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
10
+ appState: {
11
+ isMidpointSnappingEnabled: boolean;
12
+ contextMenu: {
13
+ items: import("../components/ContextMenu").ContextMenuItems;
14
+ top: number;
15
+ left: number;
16
+ } | null;
17
+ showWelcomeScreen: boolean;
18
+ isLoading: boolean;
19
+ errorMessage: React.ReactNode;
20
+ activeEmbeddable: {
21
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
22
+ state: "hover" | "active";
23
+ } | null;
24
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
25
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
26
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
27
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
28
+ isBindingEnabled: boolean;
29
+ bindingPreference: "enabled" | "disabled";
30
+ startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
31
+ suggestedBinding: {
32
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
33
+ midPoint?: import("@excalidraw/math").GlobalPoint;
34
+ } | null;
35
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
36
+ frameRendering: {
37
+ enabled: boolean;
38
+ name: boolean;
39
+ outline: boolean;
40
+ clip: boolean;
41
+ };
42
+ editingFrame: string | null;
43
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
44
+ editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
45
+ activeTool: {
46
+ lastActiveTool: import("../types").ActiveTool | null;
47
+ locked: boolean;
48
+ fromSelection: boolean;
49
+ } & import("../types").ActiveTool;
50
+ preferredSelectionTool: {
51
+ type: "selection" | "lasso";
52
+ initialized: boolean;
53
+ };
54
+ penMode: boolean;
55
+ penDetected: boolean;
56
+ exportBackground: boolean;
57
+ exportEmbedScene: boolean;
58
+ exportWithDarkMode: boolean;
59
+ exportScale: number;
60
+ currentItemStrokeColor: string;
61
+ currentItemBackgroundColor: string;
62
+ currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
63
+ currentItemStrokeWidth: number;
64
+ currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
65
+ currentItemRoughness: number;
66
+ currentItemOpacity: number;
67
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
68
+ currentItemFontSize: number;
69
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
70
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
71
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
72
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
73
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
74
+ currentItemArrowType: "sharp" | "round" | "elbow";
75
+ viewBackgroundColor: string;
76
+ scrollX: number;
77
+ scrollY: number;
78
+ cursorButton: "up" | "down";
79
+ scrolledOutside: boolean;
80
+ name: string | null;
81
+ isResizing: boolean;
82
+ isRotating: boolean;
83
+ zoom: import("../types").Zoom;
84
+ openMenu: "canvas" | null;
85
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
86
+ openSidebar: {
87
+ name: import("../types").SidebarName;
88
+ tab?: import("../types").SidebarTabName;
89
+ } | null;
90
+ openDialog: null | {
91
+ name: "imageExport" | "help" | "jsonExport";
92
+ } | {
93
+ name: "ttd";
94
+ tab: "text-to-diagram" | "mermaid";
95
+ } | {
96
+ name: "commandPalette";
97
+ } | {
98
+ name: "settings";
99
+ } | {
100
+ name: "elementLinkSelector";
101
+ sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
102
+ } | {
103
+ name: "charts";
104
+ data: import("../charts").Spreadsheet;
105
+ rawText: string;
106
+ };
107
+ defaultSidebarDockedPreference: boolean;
108
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
109
+ selectedElementIds: Readonly<{
110
+ [id: string]: true;
111
+ }>;
112
+ hoveredElementIds: Readonly<{
113
+ [id: string]: true;
114
+ }>;
115
+ previousSelectedElementIds: {
116
+ [id: string]: true;
117
+ };
118
+ selectedElementsAreBeingDragged: boolean;
119
+ shouldCacheIgnoreZoom: boolean;
120
+ toast: {
121
+ message: string;
122
+ closable?: boolean;
123
+ duration?: number;
124
+ } | null;
125
+ zenModeEnabled: boolean;
126
+ theme: import("@excalidraw/element/types").Theme;
127
+ gridSize: number;
128
+ gridStep: number;
129
+ gridModeEnabled: boolean;
130
+ viewModeEnabled: boolean;
131
+ selectedGroupIds: {
132
+ [groupId: string]: boolean;
133
+ };
134
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
135
+ width: number;
136
+ height: number;
137
+ offsetTop: number;
138
+ offsetLeft: number;
139
+ fileHandle: import("browser-fs-access").FileSystemHandle | null;
140
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
141
+ stats: {
142
+ open: boolean;
143
+ panels: number;
144
+ };
145
+ showHyperlinkPopup: false | "info" | "editor";
146
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
147
+ snapLines: readonly import("../snapping").SnapLine[];
148
+ originSnapOffset: {
149
+ x: number;
150
+ y: number;
151
+ } | null;
152
+ objectsSnapModeEnabled: boolean;
153
+ userToFollow: import("../types").UserToFollow | null;
154
+ followedBy: Set<import("../types").SocketId>;
155
+ isCropping: boolean;
156
+ croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
157
+ searchMatches: Readonly<{
158
+ focusedId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
159
+ matches: readonly import("../types").SearchMatch[];
160
+ }> | null;
161
+ activeLockedId: string | null;
162
+ lockedMultiSelections: {
163
+ [groupId: string]: true;
164
+ };
165
+ bindMode: import("@excalidraw/element/types").BindMode;
166
+ };
167
+ captureUpdate: "NEVER";
168
+ };
169
+ checked: (appState: Readonly<import("../types").AppState>) => boolean;
170
+ } & {
171
+ keyTest?: undefined;
172
+ };
@@ -28,8 +28,13 @@ export declare const actionToggleObjectsSnapMode: {
28
28
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
29
29
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
30
30
  isBindingEnabled: boolean;
31
+ bindingPreference: "enabled" | "disabled";
32
+ isMidpointSnappingEnabled: boolean;
31
33
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
32
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
+ suggestedBinding: {
35
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
+ midPoint?: import("@excalidraw/math").GlobalPoint;
37
+ } | null;
33
38
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
34
39
  frameRendering: {
35
40
  enabled: boolean;
@@ -97,6 +102,10 @@ export declare const actionToggleObjectsSnapMode: {
97
102
  } | {
98
103
  name: "elementLinkSelector";
99
104
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
105
+ } | {
106
+ name: "charts";
107
+ data: import("../charts").Spreadsheet;
108
+ rawText: string;
100
109
  };
101
110
  defaultSidebarDockedPreference: boolean;
102
111
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -135,14 +144,6 @@ export declare const actionToggleObjectsSnapMode: {
135
144
  open: boolean;
136
145
  panels: number;
137
146
  };
138
- currentChartType: import("@excalidraw/element/types").ChartType;
139
- pasteDialog: {
140
- shown: false;
141
- data: null;
142
- } | {
143
- shown: true;
144
- data: import("../charts").Spreadsheet;
145
- };
146
147
  showHyperlinkPopup: false | "info" | "editor";
147
148
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
148
149
  snapLines: readonly import("../snapping").SnapLine[];
@@ -34,8 +34,13 @@ export declare const actionToggleSearchMenu: {
34
34
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
35
35
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
36
36
  isBindingEnabled: boolean;
37
+ bindingPreference: "enabled" | "disabled";
38
+ isMidpointSnappingEnabled: boolean;
37
39
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
38
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
40
+ suggestedBinding: {
41
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
42
+ midPoint?: import("@excalidraw/math").GlobalPoint;
43
+ } | null;
39
44
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
40
45
  frameRendering: {
41
46
  enabled: boolean;
@@ -125,14 +130,6 @@ export declare const actionToggleSearchMenu: {
125
130
  open: boolean;
126
131
  panels: number;
127
132
  };
128
- currentChartType: import("@excalidraw/element/types").ChartType;
129
- pasteDialog: {
130
- shown: false;
131
- data: null;
132
- } | {
133
- shown: true;
134
- data: import("../charts").Spreadsheet;
135
- };
136
133
  showHyperlinkPopup: false | "info" | "editor";
137
134
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
138
135
  snapLines: readonly import("../snapping").SnapLine[];
@@ -30,8 +30,13 @@ export declare const actionToggleStats: {
30
30
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
31
31
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
32
32
  isBindingEnabled: boolean;
33
+ bindingPreference: "enabled" | "disabled";
34
+ isMidpointSnappingEnabled: boolean;
33
35
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
36
+ suggestedBinding: {
37
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
38
+ midPoint?: import("@excalidraw/math").GlobalPoint;
39
+ } | null;
35
40
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
36
41
  frameRendering: {
37
42
  enabled: boolean;
@@ -99,6 +104,10 @@ export declare const actionToggleStats: {
99
104
  } | {
100
105
  name: "elementLinkSelector";
101
106
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
107
+ } | {
108
+ name: "charts";
109
+ data: import("../charts").Spreadsheet;
110
+ rawText: string;
102
111
  };
103
112
  defaultSidebarDockedPreference: boolean;
104
113
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -134,14 +143,6 @@ export declare const actionToggleStats: {
134
143
  offsetLeft: number;
135
144
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
136
145
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
137
- currentChartType: import("@excalidraw/element/types").ChartType;
138
- pasteDialog: {
139
- shown: false;
140
- data: null;
141
- } | {
142
- shown: true;
143
- data: import("../charts").Spreadsheet;
144
- };
145
146
  showHyperlinkPopup: false | "info" | "editor";
146
147
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
147
148
  snapLines: readonly import("../snapping").SnapLine[];
@@ -27,8 +27,13 @@ export declare const actionToggleViewMode: {
27
27
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
28
28
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
29
29
  isBindingEnabled: boolean;
30
+ bindingPreference: "enabled" | "disabled";
31
+ isMidpointSnappingEnabled: boolean;
30
32
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
31
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
33
+ suggestedBinding: {
34
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
35
+ midPoint?: import("@excalidraw/math").GlobalPoint;
36
+ } | null;
32
37
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
33
38
  frameRendering: {
34
39
  enabled: boolean;
@@ -96,6 +101,10 @@ export declare const actionToggleViewMode: {
96
101
  } | {
97
102
  name: "elementLinkSelector";
98
103
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
104
+ } | {
105
+ name: "charts";
106
+ data: import("../charts").Spreadsheet;
107
+ rawText: string;
99
108
  };
100
109
  defaultSidebarDockedPreference: boolean;
101
110
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -134,14 +143,6 @@ export declare const actionToggleViewMode: {
134
143
  open: boolean;
135
144
  panels: number;
136
145
  };
137
- currentChartType: import("@excalidraw/element/types").ChartType;
138
- pasteDialog: {
139
- shown: false;
140
- data: null;
141
- } | {
142
- shown: true;
143
- data: import("../charts").Spreadsheet;
144
- };
145
146
  showHyperlinkPopup: false | "info" | "editor";
146
147
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
147
148
  snapLines: readonly import("../snapping").SnapLine[];
@@ -27,8 +27,13 @@ export declare const actionToggleZenMode: {
27
27
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
28
28
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
29
29
  isBindingEnabled: boolean;
30
+ bindingPreference: "enabled" | "disabled";
31
+ isMidpointSnappingEnabled: boolean;
30
32
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
31
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
33
+ suggestedBinding: {
34
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
35
+ midPoint?: import("@excalidraw/math").GlobalPoint;
36
+ } | null;
32
37
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
33
38
  frameRendering: {
34
39
  enabled: boolean;
@@ -96,6 +101,10 @@ export declare const actionToggleZenMode: {
96
101
  } | {
97
102
  name: "elementLinkSelector";
98
103
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
104
+ } | {
105
+ name: "charts";
106
+ data: import("../charts").Spreadsheet;
107
+ rawText: string;
99
108
  };
100
109
  defaultSidebarDockedPreference: boolean;
101
110
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -134,14 +143,6 @@ export declare const actionToggleZenMode: {
134
143
  open: boolean;
135
144
  panels: number;
136
145
  };
137
- currentChartType: import("@excalidraw/element/types").ChartType;
138
- pasteDialog: {
139
- shown: false;
140
- data: null;
141
- } | {
142
- shown: true;
143
- data: import("../charts").Spreadsheet;
144
- };
145
146
  showHyperlinkPopup: false | "info" | "editor";
146
147
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
147
148
  snapLines: readonly import("../snapping").SnapLine[];
@@ -19,6 +19,8 @@ export { actionCopy, actionCut, actionCopyAsPng, actionCopyAsSvg, copyText, } fr
19
19
  export { actionToggleGridMode } from "./actionToggleGridMode";
20
20
  export { actionToggleZenMode } from "./actionToggleZenMode";
21
21
  export { actionToggleObjectsSnapMode } from "./actionToggleObjectsSnapMode";
22
+ export { actionToggleArrowBinding } from "./actionToggleArrowBinding";
23
+ export { actionToggleMidpointSnapping } from "./actionToggleMidpointSnapping";
22
24
  export { actionToggleStats } from "./actionToggleStats";
23
25
  export { actionUnbindText, actionBindText } from "./actionBoundText";
24
26
  export { actionLink } from "./actionLink";
@@ -1,4 +1,4 @@
1
1
  import type { SubtypeOf } from "@excalidraw/common/utility-types";
2
2
  import type { ActionName } from "./types";
3
- export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "toggleEraserTool" | "toggleHandTool" | "setFrameAsActiveTool" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame"> | "saveScene" | "imageExport" | "commandPalette" | "searchMenu";
3
+ export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "toggleEraserTool" | "toggleHandTool" | "setFrameAsActiveTool" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame"> | "saveScene" | "imageExport" | "commandPalette" | "searchMenu" | "toolLock";
4
4
  export declare const getShortcutFromShortcutName: (name: ShortcutName, idx?: number) => string;
@@ -14,7 +14,7 @@ export type ActionResult = {
14
14
  type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
15
15
  export type UpdaterFn = (res: ActionResult) => void;
16
16
  export type ActionFilterFn = (action: Action) => void;
17
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
17
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
18
18
  export type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -13,21 +13,25 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
13
13
  selectedElementIds?: Readonly<{
14
14
  [id: string]: true;
15
15
  }> | undefined;
16
+ activeTool?: ({
17
+ lastActiveTool: import("./types").ActiveTool | null;
18
+ locked: boolean;
19
+ fromSelection: boolean;
20
+ } & import("./types").ActiveTool) | undefined;
16
21
  selectedGroupIds?: {
17
22
  [groupId: string]: boolean;
18
23
  } | undefined;
19
24
  selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
25
+ isBindingEnabled?: boolean | undefined;
26
+ isMidpointSnappingEnabled?: boolean | undefined;
20
27
  zenModeEnabled?: boolean | undefined;
21
28
  shouldCacheIgnoreZoom?: boolean | undefined;
22
29
  exportScale?: number | undefined;
30
+ currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
23
31
  bindMode?: import("@excalidraw/element/types").BindMode | undefined;
24
32
  gridSize?: number | undefined;
25
33
  showWelcomeScreen?: boolean | undefined;
26
- activeTool?: ({
27
- lastActiveTool: import("./types").ActiveTool | null;
28
- locked: boolean;
29
- fromSelection: boolean;
30
- } & import("./types").ActiveTool) | undefined;
34
+ bindingPreference?: "enabled" | "disabled" | undefined;
31
35
  preferredSelectionTool?: {
32
36
  type: "selection" | "lasso";
33
37
  initialized: boolean;
@@ -50,7 +54,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
50
54
  currentItemStartArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
51
55
  currentItemEndArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
52
56
  currentItemRoundness?: import("@excalidraw/element/types").StrokeRoundness | undefined;
53
- currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
54
57
  cursorButton?: "up" | "down" | undefined;
55
58
  scrolledOutside?: boolean | undefined;
56
59
  openMenu?: "canvas" | null | undefined;
@@ -69,7 +72,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
69
72
  open: boolean;
70
73
  panels: number;
71
74
  } | undefined;
72
- currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
73
75
  objectsSnapModeEnabled?: boolean | undefined;
74
76
  lockedMultiSelections?: {
75
77
  [groupId: string]: true;
@@ -0,0 +1,2 @@
1
+ import type { ChartElements, Spreadsheet } from "./charts.types";
2
+ export declare const renderBarChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements;
@@ -0,0 +1,48 @@
1
+ import type { Radians } from "@excalidraw/math";
2
+ export declare const CARTESIAN_BASE_SLOT_WIDTH = 44;
3
+ export declare const CARTESIAN_BAR_SLOT_EXTRA_PER_SERIES = 22;
4
+ export declare const CARTESIAN_BAR_SLOT_EXTRA_MAX = 66;
5
+ export declare const CARTESIAN_LINE_SLOT_WIDTH = 48;
6
+ export declare const CARTESIAN_GAP = 14;
7
+ export declare const CARTESIAN_BAR_HEIGHT = 304;
8
+ export declare const CARTESIAN_LINE_HEIGHT = 320;
9
+ export declare const CARTESIAN_LABEL_ROTATION: Radians;
10
+ export declare const CARTESIAN_LABEL_MIN_WIDTH = 28;
11
+ export declare const CARTESIAN_LABEL_SLOT_PADDING = 4;
12
+ export declare const CARTESIAN_LABEL_AXIS_CLEARANCE = 2;
13
+ export declare const CARTESIAN_LABEL_MAX_WIDTH_BUFFER = 10;
14
+ export declare const CARTESIAN_LABEL_ROTATED_WIDTH_BUFFER = 10;
15
+ export declare const CARTESIAN_LABEL_OVERFLOW_PREFERENCE_BUFFER = 8;
16
+ export declare const BAR_GAP = 12;
17
+ export declare const BAR_HEIGHT = 256;
18
+ export declare const GRID_OPACITY = 10;
19
+ export declare const RADAR_GRID_LEVELS = 4;
20
+ export declare const RADAR_LABEL_OFFSET: number;
21
+ export declare const RADAR_PADDING: number;
22
+ export declare const RADAR_SINGLE_SERIES_LOG_SCALE_THRESHOLD = 100;
23
+ export declare const RADAR_AXIS_LABEL_MAX_WIDTH = 140;
24
+ export declare const RADAR_AXIS_LABEL_ALIGNMENT_THRESHOLD = 0.35;
25
+ export declare const RADAR_AXIS_LABEL_CLEARANCE: number;
26
+ export declare const RADAR_LEGEND_SWATCH_SIZE = 20;
27
+ export declare const RADAR_LEGEND_ITEM_GAP: number;
28
+ export declare const RADAR_LEGEND_TEXT_GAP = 12;
29
+ export declare const commonProps: {
30
+ readonly fillStyle: "hachure";
31
+ readonly fontFamily: number;
32
+ readonly fontSize: 20;
33
+ readonly opacity: 100;
34
+ readonly roughness: 1;
35
+ readonly strokeColor: "#1e1e1e";
36
+ readonly roundness: null;
37
+ readonly strokeStyle: "solid";
38
+ readonly strokeWidth: 1;
39
+ readonly verticalAlign: string;
40
+ readonly locked: false;
41
+ };
42
+ export type CartesianChartType = "bar" | "line";
43
+ export type CartesianChartLayout = {
44
+ slotWidth: number;
45
+ gap: number;
46
+ chartHeight: number;
47
+ xLabelMaxWidth: number;
48
+ };
@@ -0,0 +1,32 @@
1
+ import { getFontString } from "@excalidraw/common";
2
+ import type { ChartType } from "@excalidraw/element/types";
3
+ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
4
+ import { type CartesianChartLayout, type CartesianChartType } from "./charts.constants";
5
+ import type { ChartElements, Spreadsheet, SpreadsheetSeries } from "./charts.types";
6
+ export declare const isSpreadsheetValidForChartType: (spreadsheet: Spreadsheet | null, chartType: ChartType) => boolean;
7
+ export declare const getCartesianChartLayout: (chartType: CartesianChartType, seriesCount: number) => CartesianChartLayout;
8
+ export declare const getChartDimensions: (spreadsheet: Spreadsheet, layout: CartesianChartLayout) => {
9
+ chartWidth: number;
10
+ chartHeight: number;
11
+ };
12
+ export declare const getRadarDimensions: () => {
13
+ chartWidth: number;
14
+ chartHeight: number;
15
+ };
16
+ export declare const getSeriesColors: (seriesCount: number, colorOffset: number) => readonly string[];
17
+ export declare const getColorOffset: (colorSeed?: number) => number;
18
+ export declare const getBackgroundColor: (colorOffset: number) => "#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";
19
+ export declare const getRadarValueScale: (series: SpreadsheetSeries[], _labelsLength: number) => {
20
+ renderSteps: boolean;
21
+ normalize: (value: number, _axisIndex: number) => number;
22
+ };
23
+ export declare const getRadarDisplayText: (text: string, fontString: ReturnType<typeof getFontString>, maxWidth: number) => string;
24
+ export declare const createRadarAxisLabels: (labels: readonly string[], angles: readonly number[], centerX: number, centerY: number, radius: number, backgroundColor: string) => {
25
+ axisLabels: ChartElements;
26
+ axisLabelTopY: number;
27
+ axisLabelBottomY: number;
28
+ };
29
+ export declare const createSeriesLegend: (series: SpreadsheetSeries[], seriesColors: readonly string[], centerX: number, minLegendTopY: number, fallbackLegendY: number, backgroundColor: string) => ChartElements;
30
+ export declare const getRotatedTextElementBottom: (element: NonDeletedExcalidrawElement) => number;
31
+ export declare const chartXLabels: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout) => ChartElements;
32
+ export declare const chartBaseElements: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout, maxValue?: number, debug?: boolean) => ChartElements;
@@ -0,0 +1,2 @@
1
+ import type { ChartElements, Spreadsheet } from "./charts.types";
2
+ export declare const renderLineChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements;
@@ -0,0 +1,10 @@
1
+ import { type ParseSpreadsheetResult } from "./charts.types";
2
+ /**
3
+ * @private exported for testing
4
+ */
5
+ export declare const tryParseNumber: (s: string) => number | null;
6
+ /**
7
+ * @private exported for testing
8
+ */
9
+ export declare const tryParseCells: (cells: string[][]) => ParseSpreadsheetResult;
10
+ export declare const tryParseSpreadsheet: (text: string) => ParseSpreadsheetResult;
@@ -0,0 +1,2 @@
1
+ import type { ChartElements, Spreadsheet } from "./charts.types";
2
+ export declare const renderRadarChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements | null;
@@ -0,0 +1,18 @@
1
+ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
+ export type ChartElements = readonly NonDeletedExcalidrawElement[];
3
+ export interface Spreadsheet {
4
+ title: string | null;
5
+ labels: string[] | null;
6
+ series: SpreadsheetSeries[];
7
+ }
8
+ export interface SpreadsheetSeries {
9
+ title: string | null;
10
+ values: number[];
11
+ }
12
+ export type ParseSpreadsheetResult = {
13
+ ok: false;
14
+ reason: string;
15
+ } | {
16
+ ok: true;
17
+ data: Spreadsheet;
18
+ };
@@ -0,0 +1,7 @@
1
+ import type { ChartType } from "@excalidraw/element/types";
2
+ import { tryParseCells, tryParseNumber, tryParseSpreadsheet } from "./charts.parse";
3
+ import type { ChartElements, Spreadsheet } from "./charts.types";
4
+ export { type ParseSpreadsheetResult, type Spreadsheet, type SpreadsheetSeries, type ChartElements, } from "./charts.types";
5
+ export { isSpreadsheetValidForChartType } from "./charts.helpers";
6
+ export { tryParseCells, tryParseNumber, tryParseSpreadsheet };
7
+ export declare const renderSpreadsheet: (chartType: ChartType, spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements | null;
@@ -3,14 +3,12 @@ import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { IMAGE_MIME_TYPES, STRING_MIME_TYPES } from "@excalidraw/common";
4
4
  import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
5
5
  import type { FileSystemHandle } from "./data/filesystem";
6
- import type { Spreadsheet } from "./charts";
7
6
  import type { BinaryFiles } from "./types";
8
7
  export type PastedMixedContent = {
9
8
  type: "text" | "imageUrl";
10
9
  value: string;
11
10
  }[];
12
11
  export interface ClipboardData {
13
- spreadsheet?: Spreadsheet;
14
12
  elements?: readonly ExcalidrawElement[];
15
13
  files?: BinaryFiles;
16
14
  text?: string;
@@ -76,7 +74,7 @@ type ParsedDataTransferItemType<T extends AllowedParsedDataTransferItem["type"]>
76
74
  export type ParsedDataTransferFile = Extract<AllowedParsedDataTransferItem, {
77
75
  kind: "file";
78
76
  }>;
79
- type ParsedDataTranferList = ParsedDataTransferItem[] & {
77
+ export type ParsedDataTranferList = ParsedDataTransferItem[] & {
80
78
  /**
81
79
  * Only allows filtering by known `string` data types, since `file`
82
80
  * types can have multiple items of the same type (e.g. multiple image files)
@@ -94,12 +92,14 @@ type ParsedDataTranferList = ParsedDataTransferItem[] & {
94
92
  declare const findDataTransferItemType: <T extends ValueOf<typeof STRING_MIME_TYPES>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<T> | null;
95
93
  declare const getDataTransferItemData: <T extends ValueOf<typeof STRING_MIME_TYPES>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<ValueOf<typeof STRING_MIME_TYPES>>["value"] | null;
96
94
  declare const getDataTransferFiles: (this: ParsedDataTranferList) => ParsedDataTransferFile[];
95
+ /** @returns list of MIME types, synchronously */
96
+ export declare const parseDataTransferEventMimeTypes: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Set<string>;
97
97
  export declare const parseDataTransferEvent: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Promise<ParsedDataTranferList>;
98
98
  /**
99
99
  * Attempts to parse clipboard event.
100
100
  */
101
101
  export declare const parseClipboard: (dataList: ParsedDataTranferList, isPlainPaste?: boolean) => Promise<ClipboardData>;
102
102
  export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
103
- export declare const copyTextToSystemClipboard: (text: string | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
103
+ export declare const copyTextToSystemClipboard: <MimeType extends ValueOf<typeof STRING_MIME_TYPES>>(text: string | { [K in MimeType]: string; } | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
104
104
  export declare const isClipboardEvent: (event: React.SyntheticEvent | Event) => event is ClipboardEvent;
105
105
  export {};