@dwelle/excalidraw 0.4.0-1ee4b80 → 0.4.0-7ba56c3
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.
- package/CHANGELOG.md +1 -0
- package/README.md +6 -2
- package/dist/excalidraw.development.js +66 -33
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/components/LayerUI.d.ts +2 -1
- package/types/components/LibraryButton.d.ts +2 -1
- package/types/components/MobileMenu.d.ts +2 -1
- package/types/components/Sidebar/Sidebar.d.ts +67 -0
- package/types/components/Sidebar/SidebarHeader.d.ts +20 -0
- package/types/components/Sidebar/common.d.ts +11 -0
- package/types/components/hoc/withUpstreamOverride.d.ts +10 -0
- package/types/packages/excalidraw/example/sidebar/{Sidebar.d.ts → ExampleSidebar.d.ts} +1 -1
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/packages/utils.d.ts +4 -1
- package/types/types.d.ts +6 -0
- package/types/components/SidebarLockButton.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,7 @@ Please add the latest change on the top under the correct section.
|
|
|
18
18
|
#### Features
|
|
19
19
|
|
|
20
20
|
- 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
|
+
- 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.
|
|
21
22
|
|
|
22
23
|
#### Breaking Changes
|
|
23
24
|
|
package/README.md
CHANGED
|
@@ -929,7 +929,8 @@ This function normalizes library items elements, adding missing values when need
|
|
|
929
929
|
elements,
|
|
930
930
|
appState
|
|
931
931
|
getDimensions,
|
|
932
|
-
files
|
|
932
|
+
files,
|
|
933
|
+
exportPadding?: number;
|
|
933
934
|
}: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L12">ExportOpts</a>
|
|
934
935
|
</pre>
|
|
935
936
|
|
|
@@ -940,6 +941,7 @@ This function normalizes library items elements, adding missing values when need
|
|
|
940
941
|
| getDimensions | `(width: number, height: number) => { width: number, height: number, scale?: number }` | undefined | A function which returns the `width`, `height`, and optionally `scale` (defaults `1`), with which canvas is to be exported. |
|
|
941
942
|
| maxWidthOrHeight | `number` | undefined | The maximum width or height of the exported image. If provided, `getDimensions` is ignored. |
|
|
942
943
|
| files | [BinaryFiles](The [`BinaryFiles`](<[BinaryFiles](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L64)>) | undefined | The files added to the scene. |
|
|
944
|
+
| exportPadding | number | 10 | The padding to be added on canvas |
|
|
943
945
|
|
|
944
946
|
**How to use**
|
|
945
947
|
|
|
@@ -957,7 +959,8 @@ This function returns the canvas with the exported elements, appState and dimens
|
|
|
957
959
|
exportToBlob(
|
|
958
960
|
opts: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/packages/utils.ts#L14">ExportOpts</a> & {
|
|
959
961
|
mimeType?: string,
|
|
960
|
-
quality?: number
|
|
962
|
+
quality?: number,
|
|
963
|
+
exportPadding?: number;
|
|
961
964
|
})
|
|
962
965
|
</pre>
|
|
963
966
|
|
|
@@ -966,6 +969,7 @@ exportToBlob(
|
|
|
966
969
|
| opts | | | This param is passed to `exportToCanvas`. You can refer to [`exportToCanvas`](#exportToCanvas) |
|
|
967
970
|
| mimeType | string | "image/png" | Indicates the image format |
|
|
968
971
|
| quality | number | 0.92 | A value between 0 and 1 indicating the [image quality](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob#parameters). Applies only to `image/jpeg`/`image/webp` MIME types. |
|
|
972
|
+
| exportPadding | number | 10 | The padding to be added on canvas |
|
|
969
973
|
|
|
970
974
|
**How to use**
|
|
971
975
|
|