@dwelle/excalidraw 0.4.0-532db6e → 0.4.0-587f6c0
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 +8 -0
- package/README.md +25 -9
- package/dist/excalidraw.development.js +52 -41
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +15 -0
- package/types/actions/actionBoundText.d.ts +5 -0
- package/types/actions/actionCanvas.d.ts +40 -0
- package/types/actions/actionClipboard.d.ts +43 -0
- package/types/actions/actionDeleteSelected.d.ts +15 -0
- package/types/actions/actionExport.d.ts +45 -0
- package/types/actions/actionFinalize.d.ts +10 -0
- package/types/actions/actionLinearEditor.d.ts +5 -0
- package/types/actions/actionMenu.d.ts +15 -0
- package/types/actions/actionProperties.d.ts +65 -0
- package/types/actions/actionStyles.d.ts +5 -0
- package/types/actions/actionToggleGridMode.d.ts +6 -0
- package/types/actions/actionToggleLock.d.ts +5 -0
- package/types/actions/actionToggleStats.d.ts +5 -0
- package/types/actions/actionToggleViewMode.d.ts +6 -0
- package/types/actions/actionToggleZenMode.d.ts +6 -0
- package/types/actions/types.d.ts +1 -1
- package/types/components/App.d.ts +2 -4
- 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 +1 -0
- package/types/element/Hyperlink.d.ts +5 -0
- package/types/element/linearElementEditor.d.ts +5 -0
- package/types/element/textElement.d.ts +6 -0
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/packages/excalidraw/index.d.ts +2 -0
- package/types/types.d.ts +13 -3
- package/types/utils.d.ts +4 -0
- package/types/components/Footer.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,14 @@ Please add the latest change on the top under the correct section.
|
|
|
13
13
|
|
|
14
14
|
## Unreleased
|
|
15
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
|
+
|
|
16
24
|
### Excalidraw schema
|
|
17
25
|
|
|
18
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).
|
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.
|