github excalidraw/excalidraw v0.9.0
v0.9.0 (2021-07-10)

latest releases: v0.16.4, v0.17.6, v0.16.3...
2 years ago

Excalidraw API

Features

  • restore(data, localAppState, localElements) and restoreElements(elements, localElements) now take localElements 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 be null/undefined) if using TypeScript.
  • Support appState.exportEmbedScene attribute in exportToSvg which allows to embed the scene data #3777.

    BREAKING CHANGE

    • The attribute metadata is now removed as metadata was only used to embed scene data which is now supported with the appState.exportEmbedScene attribute.
    • exportToSvg now resolves to a promise which resolves to svg of the exported drawing.
  • Expose loadLibraryFromBlob, loadFromBlob, and getFreeDrawSvgPath #3764.

  • Expose FONT_FAMILY so that consumer can use when passing initialData.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 to true 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 to UiOptions.canvasActions.export.saveFileToDisk. Defaults to true hence the save file to disk button is rendered inside the export dialog.
    • exportToBackend is now renamed to UIOptions.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 to UIOptions.canvasActions.saveToActiveFile#3657.
    • Removed shouldAddWatermark: boolean attribute from options for export APIs #3639.
    • Removed appState.shouldAddWatermark so in case you were passing shouldAddWatermark in initialData.AppState it will not work anymore.

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 and g 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

  • Delete React SyntheticEvent persist #3700

  • Code clean up #3681

Performance

  • Improve arrow head sizing #3480

Build

  • Add release script to update relevant files and commit for next release #3805

  • Add script to update changelog before a stable release #3784

  • Add script to update readme before stable release #3781

Don't miss a new excalidraw release

NewReleases is sending notifications on new releases.