@dwelle/excalidraw 0.3.59-restoreLibraryItems → 0.3.59

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 CHANGED
@@ -15,17 +15,10 @@ 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
-
26
18
  #### Refactor
27
19
 
28
20
  - Rename `appState.elementLocked` to `appState.activeTool.locked` [#4983](https://github.com/excalidraw/excalidraw/pull/4983).
21
+ - Expose [`serializeLibraryAsJSON`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#serializeLibraryAsJSON) helper that we use when saving Excalidraw Library to a file.
29
22
 
30
23
  ##### BREAKING CHANGE
31
24
 
package/README_NEXT.md CHANGED
@@ -802,24 +802,6 @@ 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
-
823
805
  ### Export utilities
824
806
 
825
807
  #### `exportToCanvas`
@@ -924,6 +906,17 @@ serializeAsJSON({
924
906
 
925
907
  Takes the scene elements and state and returns a JSON string. Deleted `elements`as well as most properties from `AppState` are removed from the resulting JSON. (see [`serializeAsJSON()`](https://github.com/excalidraw/excalidraw/blob/master/src/data/json.ts#L16) source for details).
926
908
 
909
+ #### `serializeLibraryAsJSON`
910
+
911
+ **_Signature_**
912
+
913
+ <pre>
914
+ serializeLibraryAsJSON({
915
+ libraryItems: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L191">LibraryItems[]</a>,
916
+ </pre>
917
+
918
+ Takes the library items and returns a JSON string.
919
+
927
920
  #### `getSceneVersion`
928
921
 
929
922
  **How to use**