@dwelle/excalidraw 0.3.56 → 0.3.59-restoreLibraryItems
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 +15 -1
- package/README_NEXT.md +18 -0
- package/dist/excalidraw.development.js +44 -44
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +9 -3
- package/types/actions/actionAlign.d.ts +18 -0
- package/types/actions/actionBoundText.d.ts +8 -1
- package/types/actions/actionCanvas.d.ts +42 -9
- package/types/actions/actionClipboard.d.ts +22 -5
- package/types/actions/actionDeleteSelected.d.ts +10 -3
- package/types/actions/actionDistribute.d.ts +6 -0
- package/types/actions/actionDuplicateSelection.d.ts +3 -0
- package/types/actions/actionExport.d.ts +44 -9
- package/types/actions/actionFinalize.d.ts +5 -2
- package/types/actions/actionFlip.d.ts +6 -0
- package/types/actions/actionGroup.d.ts +6 -0
- package/types/actions/actionMenu.d.ts +20 -3
- package/types/actions/actionNavigate.d.ts +3 -0
- package/types/actions/actionProperties.d.ts +43 -13
- package/types/actions/actionSelectAll.d.ts +3 -0
- package/types/actions/actionStyles.d.ts +8 -1
- package/types/actions/actionToggleGridMode.d.ts +6 -1
- package/types/actions/actionToggleStats.d.ts +5 -1
- package/types/actions/actionToggleViewMode.d.ts +6 -1
- package/types/actions/actionToggleZenMode.d.ts +6 -1
- package/types/actions/actionZindex.d.ts +12 -0
- package/types/actions/manager.d.ts +3 -3
- package/types/actions/types.d.ts +6 -8
- package/types/appState.d.ts +2 -1
- package/types/components/App.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +2 -2
- package/types/components/JSONExportDialog.d.ts +2 -2
- package/types/data/library.d.ts +1 -2
- package/types/element/Hyperlink.d.ts +6 -2
- package/types/element/linearElementEditor.d.ts +2 -1
- package/types/packages/excalidraw/index.d.ts +1 -1
- package/types/scene/Scene.d.ts +1 -1
- package/types/types.d.ts +3 -1
- package/types/utils.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -15,9 +15,23 @@ Please add the latest change on the top under the correct section.
|
|
|
15
15
|
|
|
16
16
|
### Excalidraw API
|
|
17
17
|
|
|
18
|
+
#### Features
|
|
19
|
+
|
|
20
|
+
- Exported [`restoreLibraryItems`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#restoreLibraryItems) API useful when dealing with libraries [#4995](https://github.com/excalidraw/excalidraw/pull/4995).
|
|
21
|
+
|
|
22
|
+
#### Fixes
|
|
23
|
+
|
|
24
|
+
- Library menu now properly rerenders if open when library is updated using `updateScene({ libraryItems })` [#4995](https://github.com/excalidraw/excalidraw/pull/4995).
|
|
25
|
+
|
|
18
26
|
#### Refactor
|
|
19
27
|
|
|
20
|
-
- Rename `appState.
|
|
28
|
+
- Rename `appState.elementLocked` to `appState.activeTool.locked` [#4983](https://github.com/excalidraw/excalidraw/pull/4983).
|
|
29
|
+
|
|
30
|
+
##### BREAKING CHANGE
|
|
31
|
+
|
|
32
|
+
You will need to pass `activeTool.locked` instead of `elementType` from now onwards in `appState`.
|
|
33
|
+
|
|
34
|
+
- Rename `appState.elementType` to [`appState.activeTool`](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L80) which is now an object [#4698](https://github.com/excalidraw/excalidraw/pull/4968).
|
|
21
35
|
|
|
22
36
|
##### BREAKING CHANGE
|
|
23
37
|
|
package/README_NEXT.md
CHANGED
|
@@ -802,6 +802,24 @@ import { restore } from "@excalidraw/excalidraw-next";
|
|
|
802
802
|
|
|
803
803
|
This function makes sure elements and state is set to appropriate values and set to default value if not present. It is a combination of [restoreElements](#restoreElements) and [restoreAppState](#restoreAppState).
|
|
804
804
|
|
|
805
|
+
#### `restoreLibraryItems`
|
|
806
|
+
|
|
807
|
+
**_Signature_**
|
|
808
|
+
|
|
809
|
+
<pre>
|
|
810
|
+
restoreLibraryItems(libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/data/types.ts#L22">ImportedDataState["libraryItems"]</a>, defaultStatus: "published" | "unpublished")
|
|
811
|
+
</pre>
|
|
812
|
+
|
|
813
|
+
**_How to use_**
|
|
814
|
+
|
|
815
|
+
```js
|
|
816
|
+
import { restoreLibraryItems } from "@excalidraw/excalidraw-next";
|
|
817
|
+
|
|
818
|
+
restoreLibraryItems(libraryItems, "unpublished");
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
This function normalizes library items elements, adding missing values when needed.
|
|
822
|
+
|
|
805
823
|
### Export utilities
|
|
806
824
|
|
|
807
825
|
#### `exportToCanvas`
|