@dwelle/excalidraw 0.4.0-78b30cc → 0.4.0-83a4d67

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 (142) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/README.md +4 -0
  3. package/dist/excalidraw.development.js +994 -159
  4. package/dist/excalidraw.production.min.js +1 -1
  5. package/package.json +2 -2
  6. package/types/actions/actionAddToLibrary.d.ts +63 -21
  7. package/types/actions/actionAlign.d.ts +25 -19
  8. package/types/actions/actionBoundText.d.ts +46 -17
  9. package/types/actions/actionCanvas.d.ts +345 -72
  10. package/types/actions/actionClipboard.d.ts +101 -34
  11. package/types/actions/actionDeleteSelected.d.ts +57 -18
  12. package/types/actions/actionDistribute.d.ts +7 -7
  13. package/types/actions/actionElementLock.d.ts +272 -0
  14. package/types/actions/actionExport.d.ts +227 -101
  15. package/types/actions/actionFinalize.d.ts +39 -14
  16. package/types/actions/actionFlip.d.ts +4 -6
  17. package/types/actions/actionFrame.d.ts +424 -0
  18. package/types/actions/actionGroup.d.ts +5 -5
  19. package/types/actions/actionHistory.d.ts +1 -1
  20. package/types/actions/actionLinearEditor.d.ts +23 -9
  21. package/types/actions/actionMenu.d.ts +64 -23
  22. package/types/actions/actionNavigate.d.ts +1 -1
  23. package/types/actions/actionProperties.d.ts +275 -93
  24. package/types/actions/actionStyles.d.ts +21 -7
  25. package/types/actions/actionToggleGridMode.d.ts +21 -7
  26. package/types/actions/actionToggleStats.d.ts +21 -7
  27. package/types/actions/actionToggleViewMode.d.ts +21 -7
  28. package/types/actions/actionToggleZenMode.d.ts +21 -7
  29. package/types/actions/actionZindex.d.ts +4 -4
  30. package/types/actions/index.d.ts +1 -1
  31. package/types/actions/manager.d.ts +1 -1
  32. package/types/actions/shortcuts.d.ts +1 -1
  33. package/types/actions/types.d.ts +10 -9
  34. package/types/appState.d.ts +6 -6
  35. package/types/charts.d.ts +2 -2
  36. package/types/clients.d.ts +5 -6
  37. package/types/colors.d.ts +60 -5
  38. package/types/components/ActiveConfirmDialog.d.ts +1 -21
  39. package/types/components/App.d.ts +43 -7
  40. package/types/components/Avatar.d.ts +1 -2
  41. package/types/components/ColorPicker/ColorInput.d.ts +7 -0
  42. package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
  43. package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
  44. package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
  45. package/types/components/ColorPicker/Picker.d.ts +18 -0
  46. package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
  47. package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
  48. package/types/components/ColorPicker/ShadeList.d.ts +8 -0
  49. package/types/components/ColorPicker/TopPicks.d.ts +9 -0
  50. package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
  51. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +21 -0
  52. package/types/components/ContextMenu.d.ts +3 -3
  53. package/types/components/Dialog.d.ts +3 -4
  54. package/types/components/EyeDropper.d.ts +18 -0
  55. package/types/components/FilledButton.d.ts +17 -0
  56. package/types/components/FixedSideContainer.d.ts +1 -1
  57. package/types/components/HandButton.d.ts +1 -1
  58. package/types/components/HelpButton.d.ts +1 -1
  59. package/types/components/HintViewer.d.ts +3 -4
  60. package/types/components/ImageExportDialog.d.ts +7 -12
  61. package/types/components/Island.d.ts +1 -1
  62. package/types/components/JSONExportDialog.d.ts +1 -1
  63. package/types/components/LayerUI.d.ts +4 -2
  64. package/types/components/LibraryMenu.d.ts +3 -23
  65. package/types/components/LibraryMenuControlButtons.d.ts +4 -4
  66. package/types/components/LibraryMenuHeaderContent.d.ts +3 -1
  67. package/types/components/LibraryMenuItems.d.ts +4 -5
  68. package/types/components/LibraryMenuSection.d.ts +22 -0
  69. package/types/components/LibraryUnit.d.ts +7 -3
  70. package/types/components/LockButton.d.ts +1 -1
  71. package/types/components/MobileMenu.d.ts +4 -3
  72. package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  73. package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  74. package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  75. package/types/components/PenModeButton.d.ts +1 -1
  76. package/types/components/Popover.d.ts +1 -1
  77. package/types/components/ProjectName.d.ts +2 -1
  78. package/types/components/RadioGroup.d.ts +12 -0
  79. package/types/components/Sidebar/Sidebar.d.ts +1 -21
  80. package/types/components/Sidebar/common.d.ts +3 -3
  81. package/types/components/Spinner.d.ts +2 -1
  82. package/types/components/Stack.d.ts +4 -3
  83. package/types/components/Switch.d.ts +9 -0
  84. package/types/components/ToolButton.d.ts +5 -4
  85. package/types/components/Tooltip.d.ts +1 -1
  86. package/types/components/dropdownMenu/DropdownMenu.d.ts +3 -2
  87. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +4 -2
  88. package/types/components/icons.d.ts +12 -1
  89. package/types/components/main-menu/MainMenu.d.ts +3 -2
  90. package/types/constants.d.ts +31 -3
  91. package/types/context/tunnels.d.ts +3 -2
  92. package/types/data/encode.d.ts +1 -1
  93. package/types/data/filesystem.d.ts +1 -1
  94. package/types/data/library.d.ts +3 -45
  95. package/types/data/restore.d.ts +2 -2
  96. package/types/data/types.d.ts +1 -1
  97. package/types/data/url.d.ts +7 -0
  98. package/types/element/Hyperlink.d.ts +31 -13
  99. package/types/element/binding.d.ts +3 -3
  100. package/types/element/bounds.d.ts +31 -6
  101. package/types/element/collision.d.ts +7 -7
  102. package/types/element/dragElements.d.ts +2 -1
  103. package/types/element/embeddable.d.ts +154 -0
  104. package/types/element/index.d.ts +3 -2
  105. package/types/element/linearElementEditor.d.ts +23 -9
  106. package/types/element/mutateElement.d.ts +1 -1
  107. package/types/element/newElement.d.ts +7 -2
  108. package/types/element/resizeElements.d.ts +1 -0
  109. package/types/element/transformHandles.d.ts +13 -6
  110. package/types/element/typeChecks.d.ts +3 -1
  111. package/types/element/types.d.ts +51 -35
  112. package/types/emitter.d.ts +1 -1
  113. package/types/errors.d.ts +1 -1
  114. package/types/frame.d.ts +40 -0
  115. package/types/ga.d.ts +5 -5
  116. package/types/groups.d.ts +7 -3
  117. package/types/history.d.ts +3 -3
  118. package/types/hooks/useCreatePortalContainer.d.ts +4 -0
  119. package/types/hooks/useLibraryItemSvg.d.ts +11 -0
  120. package/types/hooks/useOutsideClick.d.ts +19 -1
  121. package/types/hooks/useScrollPosition.d.ts +2 -0
  122. package/types/hooks/useTransition.d.ts +2 -0
  123. package/types/i18n.d.ts +2 -2
  124. package/types/jotai.d.ts +16 -104
  125. package/types/keys.d.ts +4 -1
  126. package/types/math.d.ts +1 -0
  127. package/types/packages/excalidraw/example/initialData.d.ts +6 -0
  128. package/types/packages/excalidraw/index.d.ts +3 -2
  129. package/types/packages/utils.d.ts +2 -2
  130. package/types/renderer/renderElement.d.ts +5 -4
  131. package/types/renderer/renderScene.d.ts +12 -3
  132. package/types/renderer/roundRect.d.ts +1 -1
  133. package/types/scene/Scene.d.ts +25 -5
  134. package/types/scene/export.d.ts +12 -35
  135. package/types/scene/selection.d.ts +24 -4
  136. package/types/scene/types.d.ts +4 -4
  137. package/types/types.d.ts +81 -42
  138. package/types/utility-types.d.ts +15 -13
  139. package/types/utils.d.ts +51 -19
  140. package/types/zindex.d.ts +4 -4
  141. package/types/actions/actionToggleLock.d.ts +0 -122
  142. package/types/components/ColorPicker.d.ts +0 -14
package/CHANGELOG.md CHANGED
@@ -13,8 +13,29 @@ Please add the latest change on the top under the correct section.
13
13
 
14
14
  ## Unreleased
15
15
 
16
+ ### renderEmbeddable
17
+
18
+ ```tsx
19
+ (element: NonDeletedExcalidrawElement, radius: number, appState: UIAppState) => JSX.Element | null;`
20
+ ```
21
+
22
+ The renderEmbeddable function allows you to customize the rendering of a JSX component instead of using the default `<iframe>`. By setting props.renderEmbeddable, you can provide a custom implementation for rendering the element.
23
+
24
+ #### Parameters:
25
+
26
+ - element (NonDeletedExcalidrawElement): The element to be rendered.
27
+ - radius (number): The calculated border radius in pixels.
28
+ - appState (UIAppState): The current state of the UI.
29
+
30
+ #### Return value:
31
+
32
+ JSX.Element | null: The JSX component representing the custom rendering, or null if the default `<iframe>` should be rendered.
33
+
16
34
  ### Features
17
35
 
36
+ - Added [`props.validateEmbeddable`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props#validateEmbeddable) to customize embeddable src url validation. [#6691](https://github.com/excalidraw/excalidraw/pull/6691)
37
+ - Add support for `opts.fitToViewport` and `opts.viewportZoomFactor` in the [`ExcalidrawAPI.scrollToContent`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/ref#scrolltocontent) API. [#6581](https://github.com/excalidraw/excalidraw/pull/6581).
38
+ - Properly sanitize element `link` urls. [#6728](https://github.com/excalidraw/excalidraw/pull/6728).
18
39
  - Sidebar component now supports tabs — for more detailed description of new behavior and breaking changes, see the linked PR. [#6213](https://github.com/excalidraw/excalidraw/pull/6213)
19
40
  - Exposed `DefaultSidebar` component to allow modifying the default sidebar, such as adding custom tabs to it. [#6213](https://github.com/excalidraw/excalidraw/pull/6213)
20
41
 
@@ -63,7 +84,7 @@ Please add the latest change on the top under the correct section.
63
84
 
64
85
  ### Features
65
86
 
66
- - [`ExcalidrawAPI.scrolToContent`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/ref#scrolltocontent) has new opts object allowing you to fit viewport to content, and animate the scrolling. [#6319](https://github.com/excalidraw/excalidraw/pull/6319)
87
+ - [`ExcalidrawAPI.scrollToContent`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/ref#scrolltocontent) has new opts object allowing you to fit viewport to content, and animate the scrolling. [#6319](https://github.com/excalidraw/excalidraw/pull/6319)
67
88
 
68
89
  - Expose `useI18n()` hook return an object containing `t()` i18n helper and current `langCode`. You can use this in components you render as `<Excalidraw>` children to render any of our i18n locale strings. [#6224](https://github.com/excalidraw/excalidraw/pull/6224)
69
90
 
package/README.md CHANGED
@@ -43,3 +43,7 @@ Head over to the [docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/
43
43
  ## API
44
44
 
45
45
  Head over to the [docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api)
46
+
47
+ ## Contributing
48
+
49
+ Head over to the [docs](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/contributing)