@excalidraw/excalidraw 0.12.0-6a6b9c9 → 0.12.0-6c1246e

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 (37) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -2
  3. package/dist/excalidraw.development.js +35 -24
  4. package/dist/excalidraw.production.min.js +1 -1
  5. package/package.json +1 -1
  6. package/types/actions/actionAddToLibrary.d.ts +3 -3
  7. package/types/actions/actionBoundText.d.ts +1 -1
  8. package/types/actions/actionCanvas.d.ts +8 -8
  9. package/types/actions/actionClipboard.d.ts +6 -6
  10. package/types/actions/actionDeleteSelected.d.ts +4 -4
  11. package/types/actions/actionExport.d.ts +9 -9
  12. package/types/actions/actionFinalize.d.ts +2 -2
  13. package/types/actions/actionLinearEditor.d.ts +114 -0
  14. package/types/actions/actionMenu.d.ts +3 -3
  15. package/types/actions/actionProperties.d.ts +13 -13
  16. package/types/actions/actionStyles.d.ts +1 -1
  17. package/types/actions/actionToggleGridMode.d.ts +1 -1
  18. package/types/actions/actionToggleLock.d.ts +1 -1
  19. package/types/actions/actionToggleStats.d.ts +1 -1
  20. package/types/actions/actionToggleViewMode.d.ts +1 -1
  21. package/types/actions/actionToggleZenMode.d.ts +1 -1
  22. package/types/actions/index.d.ts +1 -0
  23. package/types/actions/types.d.ts +1 -1
  24. package/types/appState.d.ts +1 -1
  25. package/types/components/BackgroundPickerAndDarkModeToggle.d.ts +1 -6
  26. package/types/components/InitializeApp.d.ts +2 -0
  27. package/types/components/LayerUI.d.ts +1 -2
  28. package/types/components/LoadingMessage.d.ts +2 -0
  29. package/types/components/MobileMenu.d.ts +1 -2
  30. package/types/constants.d.ts +5 -0
  31. package/types/element/Hyperlink.d.ts +1 -1
  32. package/types/element/linearElementEditor.d.ts +20 -9
  33. package/types/element/newElement.d.ts +6 -1
  34. package/types/element/textElement.d.ts +6 -2
  35. package/types/element/types.d.ts +2 -2
  36. package/types/math.d.ts +8 -1
  37. package/types/types.d.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -17,11 +17,13 @@ Please add the latest change on the top under the correct section.
17
17
 
18
18
  #### Features
19
19
 
20
+ - Support [theme](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#theme) to be semi-controlled [#5660](https://github.com/excalidraw/excalidraw/pull/5660).
20
21
  - Added support for storing [`customData`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#storing-custom-data-to-excalidraw-elements) on Excalidraw elements [#5592].
21
22
  - Added `exportPadding?: number;` to [exportToCanvas](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#exporttocanvas) and [exportToBlob](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#exporttoblob). The default value of the padding is 10.
22
23
 
23
24
  #### Breaking Changes
24
25
 
26
+ - `props.UIOptions.canvasActions.theme` is now renamed to `props.UIOptions.canvasActions.toggleTheme` [#5660](https://github.com/excalidraw/excalidraw/pull/5660).
25
27
  - `setToastMessage` API is now renamed to `setToast` API and the function signature is also updated [#5427](https://github.com/excalidraw/excalidraw/pull/5427). You can also pass `duration` and `closable` attributes along with `message`.
26
28
 
27
29
  ## 0.12.0 (2022-07-07)
package/README.md CHANGED
@@ -637,7 +637,9 @@ If supplied, this URL will be used when user tries to install a library from [li
637
637
 
638
638
  #### `theme`
639
639
 
640
- This prop controls Excalidraw's theme. When supplied, the value takes precedence over `intialData.appState.theme`, the theme will be fully controlled by the host app, and users won't be able to toggle it from within the app. You can use [`THEME`](#THEME-1) to specify the theme.
640
+ This prop controls Excalidraw's theme. When supplied, the value takes precedence over `intialData.appState.theme`, the theme will be fully controlled by the host app, and users won't be able to toggle it from within the app unless `UIOptions.canvasActions.toggleTheme` is set to `true`, in which case the `theme` prop will control Excalidraw's default theme with ability to allow theme switching (you must take care of updating the `theme` prop when you detect a change to `appState.theme` from the [onChange](#onChange) callback).
641
+
642
+ You can use [`THEME`](#THEME-1) to specify the theme.
641
643
 
642
644
  #### `name`
643
645
 
@@ -660,7 +662,7 @@ This prop can be used to customise UI of Excalidraw. Currently we support custom
660
662
  | `export` | false &#124; [exportOpts](#exportOpts) | <pre>{ saveFileToDisk: true }</pre> | This prop allows to customize the UI inside the export dialog. By default it shows the "saveFileToDisk". If this prop is `false` the export button will not be rendered. For more details visit [`exportOpts`](#exportOpts). |
661
663
  | `loadScene` | boolean | true | Implies whether to show `Load button` |
662
664
  | `saveToActiveFile` | boolean | true | Implies whether to show `Save button` to save to current file |
663
- | `theme` | boolean | true | Implies whether to show `Theme toggle` |
665
+ | `toggleTheme` | boolean &#124; null | null | Implies whether to show `Theme toggle`. When defined as `boolean`, takes precedence over [`props.theme`](#theme) to show `Theme toggle` |
664
666
  | `saveAsImage` | boolean | true | Implies whether to show `Save as image button` |
665
667
 
666
668
  ##### `dockedSidebarBreakpoint`