v0.12.0
版本发布时间: 2022-07-07 21:00:40
excalidraw/excalidraw最新发布版本:v0.17.3(2024-02-09 22:08:24)
0.12.0 (2022-07-07)
Excalidraw API
Features
-
loadLibraryFromBlob
now takes an additional parameterdefaultStatus
which sets the default status of library item if not present, defaults tounpublished
#5067. -
Add
UIOptions.dockedSidebarBreakpoint
to customize at which point to break from the docked sidebar #5274. -
Added support for supplying user
id
in the Collaborator object (seecollaborators
inupdateScene()
), which will be used to deduplicate users when rendering collaborator avatar list. Cursors will still be rendered for every user. #5309 -
Export API to set and reset mouse cursor on the canvas #5215.
-
Export
sceneCoordsToViewportCoords
andviewportCoordsToSceneCoords
utilities #5187. -
Added
useHandleLibrary
hook to automatically handle importing of libraries when#addLibrary
URL hash key is present, and potentially for initializing library as well #5115.Also added
parseLibraryTokensFromUrl
to help in manually importing library from URL if desired.BREAKING CHANGE
- Libraries are no longer automatically initialized from URL when
#addLibrary
hash key is present. Host apps now need to handle this themselves with the help of either of the above APIs (useHandleLibrary
is recommended).
- Libraries are no longer automatically initialized from URL when
-
Added
updateLibrary
API to update (replace/merge) the library #5115.BREAKING CHANGE
-
updateScene
API no longer supports passinglibraryItems
. Instead, use theupdateLibrary
API.
-
-
Add support for integrating custom elements #5164.
- Add
onPointerDown
callback which gets triggered on pointer down events. - Add
onScrollChange
callback which gets triggered when scrolling the canvas. - Add API
setActiveTool
which host can call to set the active tool.
- Add
-
Exported
loadSceneOrLibraryFromBlob
function #5057. -
Export
MIME_TYPES
supported by Excalidraw #5135. -
Support
avatarUrl
for collaborators. Now onwards host can passavatarUrl
to render the customized avatar for collaborators #5114, renamed in #5177. -
Support
libraryItems
argument ininitialData.libraryItems
andupdateScene({ libraryItems })
to be a Promise resolving toLibraryItems
, and support functional update oflibraryItems
inupdateScene({ libraryItems })
. #5101. -
Expose util
mergeLibraryItems
#5101. -
Expose util
exportToClipboard
which allows to copy the scene contents to clipboard assvg
,png
orjson
#5103. -
Expose
window.EXCALIDRAW_EXPORT_SOURCE
which you can use to overwrite thesource
field in exported data #5095. -
The
exportToBlob
utility now supports theexportEmbedScene
option when generating a png image #5047. -
Exported
restoreLibraryItems
API #4995.
Fixes
-
Allow returning
null
inrenderFooter
prop #5282. -
Transpile
browser-fs-access
dependency so that itsfor await
syntax doesn't forcees2018
requirement onto dependent projects #5041. -
Use
window.EXCALIDRAW_ASSET_PATH
for fonts when exporting to svg #5065. -
Library menu now properly rerenders if open when library is updated using
updateScene({ libraryItems })
#4995.
Refactor
- Rename
appState.elementLocked
toappState.activeTool.locked
#4983. - Expose
serializeLibraryAsJSON
helper that we use when saving Excalidraw Library to a file.
BREAKING CHANGE
You will need to pass activeTool.locked
instead of elementType
from now onwards in appState
.
- Rename
appState.elementType
toappState.activeTool
which is now an object #4698.
BREAKING CHANGE
You will need to pass activeTool
instead of elementType
from now onwards in appState
Build
- Use only named exports #5045.
BREAKING CHANGE
You will need to import the named export from now onwards to use the component
Using bundler :point_down:
import { Excalidraw } from "@excalidraw/excalidraw";
In Browser :point_down:
React.createElement(ExcalidrawLib.Excalidraw, opts);
Excalidraw Library
This section lists the updates made to the excalidraw library and will not affect the integration.
Features
-
Throttle scene rendering to animation framerate #5422
-
Make toast closable and allow custom duration #5308
-
Collab component state handling rewrite & fixes #5046
-
Support debugging PWA in dev #4853
-
Redirect vscode.excalidraw.com to vscode marketplace #5285
-
Go-to-excalidrawplus button #5202
-
Autoredirect to Excalidraw+ if special cookie is present #5183
-
Support resubmitting published library items #5174
-
Support adding multiple library items on canvas #5116
-
Support customType in activeTool #5144
-
Stop event propagation when key handled #5091
-
Rewrite library state management & related refactor #5067
-
Delay initial loading message & tweak design #5049
-
Reconcile when saving to firebase #4991
-
Hide trash button during collaboration #5037
-
Refactor local persistence & fix race condition on SW reload #5032
-
Element locking #4964
-
Copy to clipboard all text nodes as text #5013
-
Create and expose serializeLibraryAsJSON #5009
-
Hide penMode button on reload if not enabled #4992
-
Eraser toggle to switch back to the previous tool #4981
-
Save penDetected and penMode, and detect pen already on ToolButton click #4955
-
Support binding text to container via context menu #4935
-
Map shortcut O to ellipse and Add eraser shortcut E #4930
-
Update eraser cursor #4922
-
Add Eraser 🎉 #4887
-
Added optional REACT_APP_WS_SERVER_URL for forks usecases #4889
-
Rewrite collab server connecting #4881
-
Support vertical text align for bound containers #4852
-
Support custom colors 🎉 #4843
-
Support Links in Exported SVG #4791
-
Scale font size when bound text containers resized with shift pressed #4828
Fixes
-
Autorelease job name #5412
-
Action name for autorelease #5411
-
Typecast file to fix the build #5410
-
File handle not persisted when importing excalidraw files #5372
-
Library not scrollable when no published items installed #5352
-
Focus traps inside popovers #5317
-
Unable to use cmd/ctrl-delete/backspace in inputs #5348
-
Delay loading until language imported #5344
-
Command to trigger release #5347
-
Remove unnecessary options passed to language detector #5336
-
Stale
appState.pendingImageElement
#5322 -
Non-letter shortcuts being swallowed by color picker #5316
-
Bind text to correct container when nested #5307
-
Copy bound text style when copying element having bound text #5305
-
Copy arrow head when using copy styles #5303
-
Unsafely accessing draggingElement #5216
-
Library load button does not work #5205
-
Do not deselect when not zooming using touchscreen pinch #5181
-
Wheel zoom normalization #5165
-
Hide sidebar when
custom
tool active #5179 -
Don't save deleted ExcalidrawElements to Firebase #5108
-
Eraser removed deleted elements #5155
-
Handle
ColorPicker
parentSelector being undefined #5152 -
Library multiselect not accounting for published state #5132
-
Chart display fix #5154
-
Update opacity of bound text when opacity of container updated #5142
-
Jumping of text when typing single line in bound text #5139
-
Remove opacity scroll wheel interaction #5111
-
Propagate keydown events from excalidraw-wysiwyg inputs #5099
-
Don't bind text to container if double clicked else instead of center #5105
-
ToolIcon height not using rem #5092
-
Excalidraw named export type #5078
-
BoundElementIds when arrows bound to elements are deleted #5077
-
Don't merge libraryItems on updateScene #5076
-
SVG metadata extraction regex on multiline elements #5074
-
Eraser cursor showing on theme change when not using eraser #4990
-
Update
storage.rules
#5020 -
Add image button not working on iPad #5038
-
Ensure svg image dimensions are always set #5044
-
Pinch zoom in view mode #5001
-
Select whole group on righclick & few lock-related fixes #5022
-
Export serializeLibraryAsJSON from the package #5017
-
Support copying PNG to clipboard on Safari #3746
-
More copyText fixes #5016
-
Copy to clipboard all text nodes as text #5014
-
Update cursorButton once freedraw is released #4996
-
Decouple actionFinalize and actionErase #4984
-
Using stale state when switching tools #4989
-
UpdateWysiwygStyle updatedElement is undefined TypeError #4980
-
Adding check for link length to prevent early return #4982
-
Show link icon for bound text containers #4960
-
Cancel erase elements on pointer up if eraser is not active on pointer up #4956
-
Restore original opacities when alt pressed while erasing #4954
-
Don't bind text to container if already present #4946
-
Erase all elements which are hit with single point click #4934
-
Add multiElement-edit finalize action to Desktop (currently only visible in Mobile view) #4764
-
Hide eraser in view mode in desktop #4929
-
Undo when erasing elements by clicking #4921
-
Undo when erasing #4900
-
Incorrectly erasing on mobile #4899
-
Don't crash on drop highlighted text onto canvas #4890
-
Paste styles shortcut #4886
-
Freedraw element's background fill color missing from SVG when exporting with package API exportToSvg() #4871
-
Improve pointer syncing performance #4883
-
Collab room initialization #4882
-
Ensure verticalAlign properties not shown when no element selected #4860
-
Binding text to non-bindable containers and not always preferring selection #4655
-
Don't show align icons for single bound container element #4846
-
Redraw text bounding box when pasting styles #4845
-
Restore cursor position after bound text container value updated #4836
-
Support resizing multiple bound text containers #4824
-
Also check overflowY: overlay in detectScroll #4806
-
Stuck resizing when resizing bound text container very fast beyond threshold #4804
Refactor
- Don't pass array to handleBindTextResize #4826
Build
-
Extract all i18n files into locales folder #5419
-
Automate release step fully #5414
-
Use next and preview tags instead of separate packages for next and preview release #5346
-
Support runtime React Jsx in @excalidraw/utils #4866
-
Release @excalidraw/utils 0.1.1 #4862
-
Remove build packages workflow #4835
1、 excalidraw-excalidraw-v0.12.0.tgz 2.91MB