v0.9.0
版本发布时间: 2021-07-10 21:24:32
excalidraw/excalidraw最新发布版本:v0.17.3(2024-02-09 22:08:24)
Excalidraw API
Features
-
restore(data, localAppState, localElements)
andrestoreElements(elements, localElements)
now takelocalElements
argument which will be used to ensure existing elements' versions are used and incremented. This fixes an issue where importing the same file would resolve to elements with older versions, potentially causing issues when reconciling #3797.BREAKING CHANGE
-
localElements
argument is mandatory (can benull
/undefined
) if using TypeScript.
-
-
Support
appState.exportEmbedScene
attribute inexportToSvg
which allows to embed the scene data #3777.BREAKING CHANGE
- The attribute
metadata
is now removed asmetadata
was only used to embed scene data which is now supported with theappState.exportEmbedScene
attribute. -
exportToSvg
now resolves to a promise which resolves tosvg
of the exported drawing.
- The attribute
-
Expose
loadLibraryFromBlob
,loadFromBlob
, andgetFreeDrawSvgPath
#3764. -
Expose
FONT_FAMILY
so that consumer can use when passinginitialData.appState.currentItemFontFamily
#3710. -
Added prop
autoFocus
to focus the excalidraw component on page load when enabled, defaults to false #3691.Note: Earlier Excalidraw component was focussed by default on page load, you need to enable
autoFocus
prop to retain the same behaviour. -
Added prop
UIOptions.canvasActions.export.renderCustomUI
to support Custom UI rendering inside export dialog #3666. -
Added prop
UIOptions.canvasActions.saveAsImage
to show/hide the Save as image button in the canvas actions. Defauls totrue
hence the Save as Image button is rendered #3662. -
Export dialog can be customised with
UiOptions.canvasActions.export
#3658.Also,
UIOptions
is now memoized to avoid unnecessary rerenders.BREAKING CHANGE
-
UIOptions.canvasActions.saveAsScene
is now renamed toUiOptions.canvasActions.export.saveFileToDisk
. Defaults totrue
hence the save file to disk button is rendered inside the export dialog. -
exportToBackend
is now renamed toUIOptions.canvasActions.export.exportToBackend
. If this prop is not passed, the shareable-link button will not be rendered, same as before.
-
Fixes
- Use excalidraw Id in elements so every element has unique id #3696.
Refactor
-
BREAKING CHANGE
- Rename
UIOptions.canvasActions.saveScene
toUIOptions.canvasActions.saveToActiveFile
#3657. - Removed
shouldAddWatermark: boolean
attribute from options for export APIs #3639. - Removed
appState.shouldAddWatermark
so in case you were passingshouldAddWatermark
in initialData.AppState it will not work anymore.
- Rename
Excalidraw Library
This section lists the updates made to the excalidraw library and will not affect the integration.
Features
-
Switch to selection tool on library item insert #3773
-
Show active file name when saving to current file #3733
-
Add hint around text editing #3708
-
Change library icon to be more clear #3583
-
Pass current
theme
when installing libraries #3701 -
Update virgil font #3692
-
Support exporting json to excalidraw plus #3678
-
Save exportScale in AppState #3580
-
Add shortcuts for stroke and background color picker #3318
-
Exporting redesign #3613
-
Auto-position tooltip and suport overflowing container #3631
-
Auto release @excalidraw/excalidraw-next on every change #3614
-
Allow inner-drag-selecting with cmd/ctrl #3603
Fixes
-
view mode cursor adjustments #3809.
-
Pass next release to updatePackageVersion & replace ## unreleased with new version #3806
-
Include deleted elements when passing to restore #3802
-
Import React before using jsx #3804
-
Ensure
s
andg
shortcuts work on no selection #3800 -
Keep binding for attached arrows after changing text #3754
-
Deselect elements on viewMode toggle #3741
-
Allow pointer events for disable zen mode button #3743
-
Use rgba instead of shorthand alpha #3688
-
Color pickers not opening on mobile #3676
-
On contextMenu, use selected element regardless of z-index #3668
-
SelectedGroupIds not being stored in history #3630
-
Overscroll on touch devices #3663
-
Small UI issues around image export dialog #3642
-
Normalize linear element points on restore #3633
-
Disable pointer-events on footer-center container #3629
Refactor
Performance
- Improve arrow head sizing #3480
Build
1、 excalidraw-excalidraw-v0.9.0.tgz 1.86MB