mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-01 06:36:56 +02:00
Compare commits
1 Commits
vscode-rea
...
export-com
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f5c44e1f0b |
@@ -34,7 +34,7 @@ Last but not least, we're thankful to these companies for offering their service
|
|||||||
|
|
||||||
## Who's integrating Excalidraw
|
## Who's integrating Excalidraw
|
||||||
|
|
||||||
[Google Cloud](https://googlecloudcheatsheet.withgoogle.com/architecture) • [Meta](https://meta.com/) • [CodeSandbox](https://codesandbox.io/) • [Obsidian Excalidraw](https://github.com/zsviczian/obsidian-excalidraw-plugin) • [Replit](https://replit.com/) • [Slite](https://slite.com/) • [Notion](https://notion.so/) • [HackerRank](https://www.hackerrank.com/) • [VS Code](https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor)
|
[Google Cloud](https://googlecloudcheatsheet.withgoogle.com/architecture) • [Meta](https://meta.com/) • [CodeSandbox](https://codesandbox.io/) • [Obsidian Excalidraw](https://github.com/zsviczian/obsidian-excalidraw-plugin) • [Replit](https://replit.com/) • [Slite](https://slite.com/) • [Notion](https://notion.so/) • [HackerRank](https://www.hackerrank.com/) •
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
@@ -15,6 +15,11 @@ Please add the latest change on the top under the correct section.
|
|||||||
|
|
||||||
### Excalidraw API
|
### Excalidraw API
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
|
||||||
|
- Added [`compressData`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#compressData) and [`decompressData`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#decompressData)
|
||||||
|
- Added [`generateEncryptionKey`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#generateEncryptionKey)
|
||||||
|
|
||||||
#### Breaking Changes
|
#### Breaking Changes
|
||||||
|
|
||||||
- `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`.
|
- `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`.
|
||||||
|
@@ -1150,6 +1150,29 @@ loadSceneOrLibraryFromBlob(
|
|||||||
|
|
||||||
This function loads either scene or library data from the supplied blob. If the blob contains scene data, and you pass `localAppState`, `localAppState` value will be preferred over the `appState` derived from `blob`. Throws if blob doesn't contain neither valid scene data or library data.
|
This function loads either scene or library data from the supplied blob. If the blob contains scene data, and you pass `localAppState`, `localAppState` value will be preferred over the `appState` derived from `blob`. Throws if blob doesn't contain neither valid scene data or library data.
|
||||||
|
|
||||||
|
#### `compressData`
|
||||||
|
|
||||||
|
```js
|
||||||
|
const encrytionKey = generateEncryptionKey();
|
||||||
|
|
||||||
|
const buffer = await compressData(
|
||||||
|
new TextEncoder().encode(
|
||||||
|
serializeAsJSON(elements, appState, files, "database"),
|
||||||
|
),
|
||||||
|
{ encryptionKey },
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `decompressData`
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { data: decodedBuffer } = await decompressData(new Uint8Array(payload), {
|
||||||
|
decryptionKey,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
#### `generateEncryptionKey`
|
||||||
|
|
||||||
#### `getFreeDrawSvgPath`
|
#### `getFreeDrawSvgPath`
|
||||||
|
|
||||||
**How to use**
|
**How to use**
|
||||||
|
@@ -206,6 +206,9 @@ export {
|
|||||||
getFreeDrawSvgPath,
|
getFreeDrawSvgPath,
|
||||||
exportToClipboard,
|
exportToClipboard,
|
||||||
mergeLibraryItems,
|
mergeLibraryItems,
|
||||||
|
generateEncryptionKey,
|
||||||
|
compressData,
|
||||||
|
decompressData,
|
||||||
} from "../../packages/utils";
|
} from "../../packages/utils";
|
||||||
export { isLinearElement } from "../../element/typeChecks";
|
export { isLinearElement } from "../../element/typeChecks";
|
||||||
|
|
||||||
|
@@ -193,6 +193,8 @@ export const exportToClipboard = async (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export { decompressData, compressData } from "../data/encode";
|
||||||
|
export { generateEncryptionKey } from "../data/encryption";
|
||||||
export { serializeAsJSON, serializeLibraryAsJSON } from "../data/json";
|
export { serializeAsJSON, serializeLibraryAsJSON } from "../data/json";
|
||||||
export {
|
export {
|
||||||
loadFromBlob,
|
loadFromBlob,
|
||||||
|
Reference in New Issue
Block a user