Commit Graph

28 Commits (4689a6b300d8756b54fdbaa7a3f1f8db60b9cc78)

Author SHA1 Message Date
David Luzar 0ae9b383d6
fix: Gist embed allowing unsafe html ()
Ryan Di 4987cc53d0
fix: include borders when testing insides of a shape ()
Ryan Di 32df5502ae
feat: fractional indexing ()
* Introducing fractional indices as part of `element.index`

* Ensuring invalid fractional indices are always synchronized with the array order

* Simplifying reconciliation based on the fractional indices

* Moving reconciliation inside the `@excalidraw/excalidraw` package

---------

Co-authored-by: Marcel Mraz <marcel@excalidraw.com>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Ryan Di bbdcd30a73
refactor: update collision from ga to vector geometry ()
* new collision api

* isPointOnShape

* removed redundant code

* new collision methods in app

* curve shape takes starting point

* clean up geometry

* curve rotation

* freedraw

* inside curve

* improve ellipse inside check

* ellipse distance func

* curve inside

* include frame name bounds

* replace previous private methods for getting elements at x,y

* arrow bound text hit detection

* keep iframes on top

* remove dependence on old collision methods from app

* remove old collision functions

* move some hit functions outside of app

* code refactor

* type

* text collision from inside

* fix context menu test

* highest z-index collision

* fix 1px away binding test

* strictly less

* remove unused imports

* lint

* 'ignore' resize flipping test

* more lint fix

* skip 'flips while resizing' test

* more test

* fix merge errors

* fix selection in resize test

* added a bit more comment

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Ryan Di 550a388b2b
feat: command palette ()
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
David Luzar 2382fad4f6
feat: store library to IndexedDB & support storage adapters ()
Marcel Mraz 480572f893
fix: correcting Assistant metrics ()
* Changed Assistant metrics to the corrrect ones from OS/2 table

* Adding more information about font metrics

* Adding branded types to avoid future mistakes
David Luzar 68b1fdb20e
fix: add missing font metrics for Assistant ()
Marcel Mraz 7e471b55eb
feat: text measurements based on font metrics ()
* Introduced vertical offset based on harcoded font metrics 

* Unified usage of alphabetic baseline for both canvas & svg export

* Removed baseline property

* Removed font-size rounding on Safari

* Removed artificial width offset
Aakansha Doshi f5ab3e4e12
fix: remove dependency of t from clipboard and image ()
* fix: remove dependency of t from clipboard and image

* pass errorMessage to copyTextToSystemClipboard where needed

* wrap copyTextToSystemClipboard and rethrow translated error in caller

* review fix

* typo
Aakansha Doshi 2e719ff671
fix: decouple pure functions from hyperlink to prevent mermaid bundling ()
* move hyperlink code into its folder

* move pure js functions to hyperlink/helpers and move actionLink to actions

* fix tests

* fix
Aakansha Doshi 79d9dc2f8f
fix: make bounds independent of scene ()
* fix: make bounds independent of scene

* pass only elements to getCommonBounds

* lint

* pass elementsMap to getVisibleAndNonSelectedElements
Aakansha Doshi 9013c84524
fix: make LinearElementEditor independent of scene ()
* fix: make LinearElementEditor independent of scene

* more fixes

* pass elements and elementsMap to maybeBindBindableElement,getHoveredElementForBinding,bindingBorderTest,getElligibleElementsForBindableElementAndWhere,isLinearElementEligibleForNewBindingByBindable

* replace `ElementsMap` with `NonDeletedSceneElementsMap` & remove unused params

* fix lint

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Aakansha Doshi 47f87f4ecb
fix: remove scene from getElementAbsoluteCoords and dependent functions and use elementsMap ()
* fix: remove scene from getElementAbsoluteCoords and dependent functions and use elementsMap

* lint

* fix

* use non deleted elements where possible

* use non deleted elements map in actions

* pass elementsMap instead of array to elementOverlapsWithFrame

* lint

* fix

* pass elementsMap to getElementsCorners

* pass elementsMap to getEligibleElementsForBinding

* pass elementsMap in bindOrUnbindSelectedElements and unbindLinearElements

* pass elementsMap in elementsAreInFrameBounds,elementOverlapsWithFrame,isCursorInFrame,getElementsInResizingFrame

* pass elementsMap in getElementsWithinSelection, getElementsCompletelyInFrame, isElementContainingFrame, getElementsInNewFrame

* pass elementsMap to getElementWithTransformHandleType

* pass elementsMap to getVisibleGaps, getMaximumGroups,getReferenceSnapPoints,snapDraggedElements

* lint

* pass elementsMap to bindTextToShapeAfterDuplication,bindLinearElementToElement,getTextBindableContainerAtPosition

* revert changes for bindTextToShapeAfterDuplication
YuBin, Hsu def1df2c68
fix: keep customData when converting to ExcalidrawElement ()
* feat: keep customData when converting to ExcalidrawElement ()

* docs: add changelog for keeping customData when converting to ExcalidrawElement
Aakansha Doshi 0c3dffb082
fix: make getEmbedLink independent of t function ()
* fix: make getEmbedLink independent of t function

* rename warning to error and make it type safe
Aakansha Doshi 1741c234a6
fix: decouple container cache logic to containerCache. ()
Aakansha Doshi 63b50b3586
fix: don't bundle react-dom when importing from transformHandles ()
* fix: don't bundle react when importing from transfromHandles

* rename to DEFAULT_TRANSFORM_HANDLE_SPACING
Aakansha Doshi e0fefa8025
fix: don't bundle react-dom when importing from element ()
Aashir Israr 2409c091ff
feat: support roundness for images ()
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
Aakansha Doshi 10bd08ef19
fix: make getBoundTextElement and related helpers pure ()
* fix: make getBoundTextElement pure

* updating args

* fix

* pass boundTextElement to getBoundTextMaxWidth

* fix labelled arrows

* lint

* pass elementsMap to removeElementsFromFrame

* pass elementsMap to getMaximumGroups, alignElements and distributeElements

* lint

* pass allElementsMap to renderElement

* lint

* feat: make more typesafe

* fix: remove unnecessary assertion

* fix: remove unused params

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
David Luzar 0415c616b1
refactor: decoupling global Scene state part-1 ()
David Luzar 0fa5f5de4c
fix: translating frames containing grouped text containers ()
David Luzar 0c24a7042f
feat: remove `ExcalidrawEmbeddableElement.validated` flag ()
David Luzar 43ccc875fb
feat: support multi-embed pasting & x.com domain ()
Aakansha Doshi a8064ba3ee
build: Welcome ESM and Bye Bye UMD ()
* build: Welcome ESM and Bye Bye UMD

* remove package

* create unbundled esm build

* update script for example

* fix typo

* dummy commit

* update autorelease script to build esm

* revert dummy commit

* move react, react-dom and testing library to dev dependencies

* remove entry.js, publicPath and yarn install:deps script

* fix

* upgrade esbuild to fix glob import error for locales

* remove webpack chunk names as thats not needed anymore

* marking the code sideeffects free

* make the library tree-shakeable and move fonts to fonts directory

* allow side effects for css, scss files

* remove tree-shaking

* comment code for tree shaking

* move to vite for example

* bye bye webpack

* ignore ts

* separate build and output dir

* use esbuild for creating bundle for example

* update output dir

* lint

* create browser dev build with source maps and prod with minification

* add dev and prod builds for bundler

* lint

* update script

* remove await

* load prod build

* create minified build in dist

* prod and dev builds using export field

* remove import.meta

* dummy

* define import.meta prod and dev

* fix

* export types

* add types field

* typo

* lint

* Update scripts/buildPackage.js

* move types inside export

* newline
David Luzar 6dfa89e846
fix: emitted visible scene bounds not accounting for offsets ()
Aakansha Doshi d6cd8b78f1
build: decouple package deps and introduce yarn workspaces ()
* feat: decouple package deps and introduce yarn workspaces

* update root directory

* fix

* fix scripts

* fix lint

* update path in scripts

* remove yarn.lock files from packages

* ignore workspace

* dummy

* dummy

* remove comment check

* revert workflow changes

* ignore ws when installing gh actions

* remove log

* update path

* fix

* fix typo