@dwelle/excalidraw 0.4.0-a5a6156 → 0.4.0-b1b5aaa
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 +14 -0
- package/README.md +26 -10
- package/dist/excalidraw.development.js +323 -202
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +18 -6
- package/types/actions/actionBoundText.d.ts +6 -2
- package/types/actions/actionCanvas.d.ts +60 -23
- package/types/actions/actionClipboard.d.ts +57 -10
- package/types/actions/actionDeleteSelected.d.ts +27 -6
- package/types/actions/actionExport.d.ts +62 -25
- package/types/actions/actionFinalize.d.ts +12 -4
- package/types/actions/actionLinearEditor.d.ts +6 -2
- package/types/actions/actionMenu.d.ts +20 -6
- package/types/actions/actionNavigate.d.ts +1 -0
- package/types/actions/actionProperties.d.ts +80 -28
- package/types/actions/actionStyles.d.ts +6 -2
- package/types/actions/actionToggleGridMode.d.ts +8 -2
- package/types/actions/actionToggleLock.d.ts +6 -2
- package/types/actions/actionToggleStats.d.ts +7 -2
- package/types/actions/actionToggleViewMode.d.ts +8 -2
- package/types/actions/actionToggleZenMode.d.ts +8 -2
- package/types/actions/types.d.ts +5 -2
- package/types/appState.d.ts +8 -9
- package/types/clipboard.d.ts +6 -1
- package/types/components/App.d.ts +4 -5
- package/types/components/ContextMenu.d.ts +8 -21
- package/types/components/LayerUI.d.ts +2 -2
- package/types/components/MobileMenu.d.ts +1 -2
- package/types/components/footer/Footer.d.ts +13 -0
- package/types/components/footer/FooterCenter.d.ts +7 -0
- package/types/constants.d.ts +8 -5
- package/types/element/Hyperlink.d.ts +6 -2
- package/types/element/bounds.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +37 -5
- package/types/element/newElement.d.ts +2 -2
- package/types/element/resizeElements.d.ts +0 -1
- package/types/element/textElement.d.ts +24 -2
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/element/transformHandles.d.ts +2 -3
- package/types/element/typeChecks.d.ts +10 -1
- package/types/element/types.d.ts +11 -4
- package/types/keys.d.ts +10 -0
- package/types/math.d.ts +2 -1
- package/types/packages/excalidraw/index.d.ts +2 -0
- package/types/renderer/renderElement.d.ts +4 -3
- package/types/scene/Fonts.d.ts +21 -0
- package/types/scene/Scene.d.ts +15 -0
- package/types/scene/comparisons.d.ts +2 -3
- package/types/scene/index.d.ts +1 -1
- package/types/shapes.d.ts +12 -2
- package/types/types.d.ts +26 -6
- package/types/utils.d.ts +4 -0
- package/types/components/Footer.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,20 @@ The change should be grouped under one of the below section and must contain PR
|
|
|
11
11
|
Please add the latest change on the top under the correct section.
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
|
+
## Unreleased
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
- Render Footer as a component instead of render prop [#5970](https://github.com/excalidraw/excalidraw/pull/5970). You can read more about its usage [here](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#Footer)
|
|
19
|
+
|
|
20
|
+
#### BREAKING CHANGE
|
|
21
|
+
|
|
22
|
+
- With this change, the prop `renderFooter` is now removed.
|
|
23
|
+
|
|
24
|
+
### Excalidraw schema
|
|
25
|
+
|
|
26
|
+
- Merged `appState.currentItemStrokeSharpness` and `appState.currentItemLinearStrokeSharpness` into `appState.currentItemRoundness`. Renamed `changeSharpness` action to `changeRoundness`. Excalidraw element's `strokeSharpness` was changed to `roundness`. Check the PR for types and more details [#5553](https://github.com/excalidraw/excalidraw/pull/5553).
|
|
27
|
+
|
|
14
28
|
## 0.13.0 (2022-10-27)
|
|
15
29
|
|
|
16
30
|
### Excalidraw API
|
package/README.md
CHANGED
|
@@ -380,6 +380,31 @@ For a complete list of variables, check [theme.scss](https://github.com/excalidr
|
|
|
380
380
|
|
|
381
381
|
No, Excalidraw package doesn't come with collaboration built in, since the implementation is specific to each host app. We expose APIs which you can use to communicate with Excalidraw which you can use to implement it. You can check our own implementation [here](https://github.com/excalidraw/excalidraw/blob/master/src/excalidraw-app/index.tsx).
|
|
382
382
|
|
|
383
|
+
### Component API
|
|
384
|
+
|
|
385
|
+
#### Footer
|
|
386
|
+
|
|
387
|
+
Earlier we were using `renderFooter` prop to render custom footer which was removed in [#5970](https://github.com/excalidraw/excalidraw/pull/5970). Now you can pass a `Footer` component instead to render the custom UI for footer.
|
|
388
|
+
|
|
389
|
+
You will need to import the `Footer` component from the package and wrap your component with the Footer component. The `Footer` should a valid React Node.
|
|
390
|
+
|
|
391
|
+
**Usage**
|
|
392
|
+
|
|
393
|
+
```js
|
|
394
|
+
import { Footer } from "@excalidraw/excalidraw";
|
|
395
|
+
|
|
396
|
+
const CustomFooter = () => <button> custom button</button>;
|
|
397
|
+
const App = () => {
|
|
398
|
+
return (
|
|
399
|
+
<Excalidraw>
|
|
400
|
+
<Footer>
|
|
401
|
+
<CustomFooter />
|
|
402
|
+
</Footer>
|
|
403
|
+
</Excalidraw>
|
|
404
|
+
);
|
|
405
|
+
};
|
|
406
|
+
```
|
|
407
|
+
|
|
383
408
|
### Props
|
|
384
409
|
|
|
385
410
|
| Name | Type | Default | Description |
|
|
@@ -392,7 +417,6 @@ No, Excalidraw package doesn't come with collaboration built in, since the imple
|
|
|
392
417
|
| [`onPointerUpdate`](#onPointerUpdate) | Function | | Callback triggered when mouse pointer is updated. |
|
|
393
418
|
| [`langCode`](#langCode) | string | `en` | Language code string |
|
|
394
419
|
| [`renderTopRightUI`](#renderTopRightUI) | Function | | Function that renders custom UI in top right corner |
|
|
395
|
-
| [`renderFooter `](#renderFooter) | Function | | Function that renders custom UI footer |
|
|
396
420
|
| [`renderCustomStats`](#renderCustomStats) | Function | | Function that can be used to render custom stats on the stats dialog. |
|
|
397
421
|
| [`renderSIdebar`](#renderSIdebar) | Function | | Render function that renders custom sidebar. |
|
|
398
422
|
| [`viewModeEnabled`](#viewModeEnabled) | boolean | | This implies if the app is in view mode. |
|
|
@@ -613,14 +637,6 @@ import { defaultLang, languages } from "@excalidraw/excalidraw";
|
|
|
613
637
|
|
|
614
638
|
A function returning JSX to render custom UI in the top right corner of the app.
|
|
615
639
|
|
|
616
|
-
#### `renderFooter`
|
|
617
|
-
|
|
618
|
-
<pre>
|
|
619
|
-
(isMobile: boolean, appState: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L79">AppState</a>) => JSX | null
|
|
620
|
-
</pre>
|
|
621
|
-
|
|
622
|
-
A function returning JSX to render custom UI footer. For example, you can use this to render a language picker that was previously being rendered by Excalidraw itself (for now, you'll need to implement your own language picker).
|
|
623
|
-
|
|
624
640
|
#### `renderCustomStats`
|
|
625
641
|
|
|
626
642
|
A function that can be used to render custom stats (returns JSX) in the nerd stats dialog. For example you can use this prop to render the size of the elements in the storage.
|
|
@@ -932,7 +948,7 @@ This function will make sure all properties of element is correctly set and if a
|
|
|
932
948
|
|
|
933
949
|
When `localElements` are supplied, they are used to ensure that existing restored elements reuse `version` (and increment it), and regenerate `versionNonce`. Use this when you import elements which may already be present in the scene to ensure that you do not disregard the newly imported elements if you're using element version to detect the updates.
|
|
934
950
|
|
|
935
|
-
Parameter `refreshDimensions` indicates whether we should also recalculate text element dimensions. Defaults to `
|
|
951
|
+
Parameter `refreshDimensions` indicates whether we should also recalculate text element dimensions. Defaults to `false`. Since this is a potentially costly operation, you may want to disable it if you restore elements in tight loops, such as during collaboration.
|
|
936
952
|
|
|
937
953
|
#### `restore`
|
|
938
954
|
|