js-draw 0.23.1 → 0.24.0
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/build-config.json +23 -0
- package/dist/bundle.js +3 -3
- package/dist/bundledStyles.js +1 -1
- package/dist/cjs/Color4.js +263 -0
- package/dist/cjs/Editor.d.ts +328 -0
- package/dist/cjs/Editor.js +1058 -0
- package/dist/cjs/EditorImage.d.ts +97 -0
- package/dist/cjs/EditorImage.js +531 -0
- package/dist/cjs/EventDispatcher.d.ts +29 -0
- package/dist/cjs/EventDispatcher.js +58 -0
- package/dist/cjs/Pointer.d.ts +37 -0
- package/dist/cjs/Pointer.js +123 -0
- package/dist/cjs/SVGLoader.d.ts +48 -0
- package/dist/cjs/SVGLoader.js +667 -0
- package/dist/cjs/SVGLoader.test.d.ts +1 -0
- package/dist/cjs/UndoRedoHistory.js +105 -0
- package/dist/cjs/UndoRedoHistory.test.d.ts +1 -0
- package/dist/cjs/Viewport.d.ts +73 -0
- package/dist/cjs/Viewport.js +307 -0
- package/dist/cjs/bundle/bundled.js +21 -0
- package/dist/cjs/commands/Command.js +61 -0
- package/dist/cjs/commands/Duplicate.js +80 -0
- package/dist/cjs/commands/Erase.js +101 -0
- package/dist/cjs/commands/SerializableCommand.js +57 -0
- package/dist/cjs/commands/UnresolvedCommand.js +43 -0
- package/dist/cjs/commands/invertCommand.js +77 -0
- package/dist/cjs/commands/lib.js +15 -0
- package/dist/cjs/commands/localization.d.ts +23 -0
- package/dist/cjs/commands/localization.js +24 -0
- package/dist/cjs/commands/uniteCommands.js +152 -0
- package/dist/cjs/commands/uniteCommands.test.d.ts +1 -0
- package/dist/cjs/components/AbstractComponent.d.ts +85 -0
- package/dist/cjs/components/AbstractComponent.js +300 -0
- package/dist/cjs/components/AbstractComponent.transformBy.test.d.ts +1 -0
- package/dist/cjs/components/BackgroundComponent.d.ts +62 -0
- package/dist/cjs/components/BackgroundComponent.js +311 -0
- package/dist/cjs/components/BackgroundComponent.test.d.ts +1 -0
- package/dist/cjs/components/ImageComponent.d.ts +31 -0
- package/dist/cjs/components/ImageComponent.js +228 -0
- package/dist/cjs/components/RestylableComponent.js +103 -0
- package/dist/cjs/components/SVGGlobalAttributesObject.d.ts +21 -0
- package/dist/cjs/components/SVGGlobalAttributesObject.js +82 -0
- package/dist/cjs/components/Stroke.d.ts +76 -0
- package/dist/cjs/components/Stroke.js +271 -0
- package/dist/cjs/components/Stroke.test.d.ts +1 -0
- package/dist/cjs/components/TextComponent.d.ts +79 -0
- package/dist/cjs/components/TextComponent.js +411 -0
- package/dist/cjs/components/TextComponent.test.d.ts +1 -0
- package/dist/cjs/components/UnknownSVGObject.d.ts +18 -0
- package/dist/cjs/components/UnknownSVGObject.js +65 -0
- package/dist/cjs/components/UnknownSVGObject.test.d.ts +1 -0
- package/dist/cjs/components/builders/ArrowBuilder.d.ts +19 -0
- package/dist/cjs/components/builders/ArrowBuilder.js +93 -0
- package/dist/cjs/components/builders/CircleBuilder.d.ts +2 -0
- package/dist/cjs/components/builders/CircleBuilder.js +74 -0
- package/dist/cjs/components/builders/FreehandLineBuilder.d.ts +33 -0
- package/dist/cjs/components/builders/FreehandLineBuilder.js +183 -0
- package/dist/cjs/components/builders/FreehandLineBuilder.test.d.ts +1 -0
- package/dist/cjs/components/builders/LineBuilder.d.ts +18 -0
- package/dist/cjs/components/builders/LineBuilder.js +65 -0
- package/dist/cjs/components/builders/PressureSensitiveFreehandLineBuilder.d.ts +36 -0
- package/dist/cjs/components/builders/PressureSensitiveFreehandLineBuilder.js +351 -0
- package/dist/cjs/components/builders/RectangleBuilder.d.ts +20 -0
- package/dist/cjs/components/builders/RectangleBuilder.js +58 -0
- package/dist/cjs/components/builders/types.d.ts +12 -0
- package/dist/cjs/components/lib.d.ts +14 -0
- package/dist/cjs/components/lib.js +42 -0
- package/dist/cjs/components/localization.js +14 -0
- package/dist/cjs/components/util/StrokeSmoother.d.ts +35 -0
- package/dist/cjs/components/util/StrokeSmoother.js +225 -0
- package/dist/cjs/components/util/describeComponentList.d.ts +4 -0
- package/dist/cjs/components/util/describeComponentList.js +17 -0
- package/dist/cjs/lib.d.ts +66 -0
- package/dist/cjs/lib.js +94 -0
- package/dist/cjs/localization.js +24 -0
- package/dist/cjs/localizations/de.js +17 -0
- package/dist/cjs/localizations/en.js +17 -0
- package/dist/cjs/localizations/es.js +31 -0
- package/dist/cjs/localizations/getLocalizationTable.d.ts +17 -0
- package/dist/cjs/localizations/getLocalizationTable.js +65 -0
- package/dist/cjs/localizations/getLocalizationTable.test.d.ts +1 -0
- package/dist/cjs/math/Mat33.d.ts +123 -0
- package/dist/cjs/math/Mat33.js +340 -0
- package/dist/cjs/math/Mat33.test.d.ts +1 -0
- package/dist/cjs/math/Vec2.js +37 -0
- package/dist/cjs/math/Vec2.test.d.ts +1 -0
- package/dist/cjs/math/Vec3.js +183 -0
- package/dist/cjs/math/Vec3.test.d.ts +1 -0
- package/dist/cjs/math/lib.d.ts +7 -0
- package/dist/cjs/math/lib.js +15 -0
- package/dist/cjs/math/polynomial/solveQuadratic.d.ts +9 -0
- package/dist/cjs/math/polynomial/solveQuadratic.js +39 -0
- package/dist/cjs/math/polynomial/solveQuadratic.test.d.ts +1 -0
- package/dist/cjs/math/rounding.js +140 -0
- package/dist/cjs/math/rounding.test.d.ts +1 -0
- package/dist/cjs/math/shapes/Abstract2DShape.d.ts +49 -0
- package/dist/cjs/math/shapes/Abstract2DShape.js +42 -0
- package/dist/cjs/math/shapes/BezierJSWrapper.d.ts +36 -0
- package/dist/cjs/math/shapes/BezierJSWrapper.js +109 -0
- package/dist/cjs/math/shapes/CubicBezier.d.ts +17 -0
- package/dist/cjs/math/shapes/CubicBezier.js +50 -0
- package/dist/cjs/math/shapes/LineSegment2.d.ts +70 -0
- package/dist/cjs/math/shapes/LineSegment2.js +204 -0
- package/dist/cjs/math/shapes/LineSegment2.test.d.ts +1 -0
- package/dist/cjs/math/shapes/Path.d.ts +93 -0
- package/dist/cjs/math/shapes/Path.fromString.test.d.ts +1 -0
- package/dist/cjs/math/shapes/Path.js +865 -0
- package/dist/cjs/math/shapes/Path.test.d.ts +1 -0
- package/dist/cjs/math/shapes/Path.toString.test.d.ts +1 -0
- package/dist/cjs/math/shapes/PointShape2D.d.ts +18 -0
- package/dist/cjs/math/shapes/PointShape2D.js +46 -0
- package/dist/cjs/math/shapes/QuadraticBezier.d.ts +34 -0
- package/dist/cjs/math/shapes/QuadraticBezier.js +133 -0
- package/dist/cjs/math/shapes/QuadraticBezier.test.d.ts +1 -0
- package/dist/cjs/math/shapes/Rect2.d.ts +57 -0
- package/dist/cjs/math/shapes/Rect2.js +311 -0
- package/dist/cjs/math/shapes/Rect2.test.d.ts +1 -0
- package/dist/cjs/math/shapes/Triangle.d.ts +46 -0
- package/dist/cjs/math/shapes/Triangle.js +148 -0
- package/dist/cjs/math/shapes/Triangle.test.d.ts +1 -0
- package/dist/cjs/rendering/Display.js +222 -0
- package/dist/cjs/rendering/RenderingStyle.d.ts +31 -0
- package/dist/cjs/rendering/RenderingStyle.js +56 -0
- package/dist/cjs/rendering/RenderingStyle.test.d.ts +1 -0
- package/dist/cjs/rendering/TextRenderingStyle.d.ts +43 -0
- package/dist/cjs/rendering/TextRenderingStyle.js +40 -0
- package/dist/cjs/rendering/caching/CacheRecord.d.ts +20 -0
- package/dist/cjs/rendering/caching/CacheRecord.js +59 -0
- package/dist/cjs/rendering/caching/CacheRecord.test.d.ts +1 -0
- package/dist/cjs/rendering/caching/CacheRecordManager.d.ts +12 -0
- package/dist/cjs/rendering/caching/CacheRecordManager.js +48 -0
- package/dist/cjs/rendering/caching/RenderingCache.js +50 -0
- package/dist/cjs/rendering/caching/RenderingCache.test.d.ts +1 -0
- package/dist/cjs/rendering/caching/RenderingCacheNode.d.ts +29 -0
- package/dist/cjs/rendering/caching/RenderingCacheNode.js +340 -0
- package/dist/cjs/rendering/caching/testUtils.js +34 -0
- package/dist/cjs/rendering/lib.js +14 -0
- package/dist/cjs/rendering/localization.js +12 -0
- package/dist/cjs/rendering/renderers/AbstractRenderer.d.ts +85 -0
- package/dist/cjs/rendering/renderers/AbstractRenderer.js +168 -0
- package/dist/cjs/rendering/renderers/CanvasRenderer.d.ts +63 -0
- package/dist/cjs/rendering/renderers/CanvasRenderer.js +263 -0
- package/dist/cjs/rendering/renderers/DummyRenderer.d.ts +35 -0
- package/dist/cjs/rendering/renderers/DummyRenderer.js +132 -0
- package/dist/cjs/rendering/renderers/DummyRenderer.test.d.ts +1 -0
- package/dist/cjs/rendering/renderers/SVGRenderer.d.ts +57 -0
- package/dist/cjs/rendering/renderers/SVGRenderer.js +355 -0
- package/dist/cjs/rendering/renderers/TextOnlyRenderer.d.ts +29 -0
- package/dist/cjs/rendering/renderers/TextOnlyRenderer.js +89 -0
- package/dist/cjs/rendering/renderers/TextOnlyRenderer.test.d.ts +1 -0
- package/dist/cjs/shortcuts/KeyBinding.d.ts +46 -0
- package/dist/cjs/shortcuts/KeyBinding.js +157 -0
- package/dist/cjs/shortcuts/KeyBinding.test.d.ts +1 -0
- package/dist/cjs/shortcuts/KeyboardShortcutManager.d.ts +77 -0
- package/dist/cjs/shortcuts/KeyboardShortcutManager.js +148 -0
- package/dist/cjs/shortcuts/KeyboardShortcutManager.test.d.ts +1 -0
- package/dist/cjs/shortcuts/lib.d.ts +2 -0
- package/dist/cjs/shortcuts/lib.js +7 -0
- package/dist/cjs/testing/createEditor.js +11 -0
- package/dist/cjs/testing/lib.js +7 -0
- package/dist/cjs/testing/sendPenEvent.js +21 -0
- package/dist/cjs/testing/sendTouchEvent.js +73 -0
- package/dist/cjs/toolbar/HTMLToolbar.js +465 -0
- package/dist/cjs/toolbar/IconProvider.js +274 -0
- package/dist/cjs/toolbar/lib.js +21 -0
- package/dist/cjs/toolbar/localization.d.ts +52 -0
- package/dist/cjs/toolbar/localization.js +54 -0
- package/dist/cjs/toolbar/makeColorInput.js +125 -0
- package/dist/cjs/toolbar/widgets/ActionButtonWidget.js +47 -0
- package/dist/cjs/toolbar/widgets/BaseToolWidget.js +64 -0
- package/dist/cjs/toolbar/widgets/BaseWidget.js +359 -0
- package/dist/cjs/toolbar/widgets/DocumentPropertiesWidget.js +196 -0
- package/dist/cjs/toolbar/widgets/EraserToolWidget.js +90 -0
- package/dist/cjs/toolbar/widgets/HandToolWidget.js +211 -0
- package/dist/cjs/toolbar/widgets/InsertImageWidget.js +246 -0
- package/dist/cjs/toolbar/widgets/OverflowWidget.js +103 -0
- package/dist/cjs/toolbar/widgets/PenToolWidget.js +264 -0
- package/dist/cjs/toolbar/widgets/SelectionToolWidget.js +213 -0
- package/dist/cjs/toolbar/widgets/TextToolWidget.js +142 -0
- package/dist/cjs/toolbar/widgets/keybindings.d.ts +2 -0
- package/dist/cjs/toolbar/widgets/keybindings.js +13 -0
- package/dist/cjs/toolbar/widgets/lib.js +23 -0
- package/dist/cjs/tools/BaseTool.js +67 -0
- package/dist/cjs/tools/Eraser.d.ts +24 -0
- package/dist/cjs/tools/Eraser.js +148 -0
- package/dist/cjs/tools/Eraser.test.d.ts +1 -0
- package/dist/cjs/tools/FindTool.d.ts +20 -0
- package/dist/cjs/tools/FindTool.js +137 -0
- package/dist/cjs/tools/PanZoom.d.ts +52 -0
- package/dist/cjs/tools/PanZoom.js +471 -0
- package/dist/cjs/tools/PanZoom.test.d.ts +1 -0
- package/dist/cjs/tools/PasteHandler.js +179 -0
- package/dist/cjs/tools/Pen.d.ts +41 -0
- package/dist/cjs/tools/Pen.js +238 -0
- package/dist/cjs/tools/Pen.test.d.ts +1 -0
- package/dist/cjs/tools/PipetteTool.js +63 -0
- package/dist/cjs/tools/SelectionTool/SelectAllShortcutHandler.d.ts +8 -0
- package/dist/cjs/tools/SelectionTool/SelectAllShortcutHandler.js +44 -0
- package/dist/cjs/tools/SelectionTool/Selection.d.ts +64 -0
- package/dist/cjs/tools/SelectionTool/Selection.js +602 -0
- package/dist/cjs/tools/SelectionTool/SelectionHandle.js +86 -0
- package/dist/cjs/tools/SelectionTool/SelectionTool.d.ts +37 -0
- package/dist/cjs/tools/SelectionTool/SelectionTool.js +441 -0
- package/dist/cjs/tools/SelectionTool/SelectionTool.test.d.ts +1 -0
- package/dist/cjs/tools/SelectionTool/TransformMode.js +107 -0
- package/dist/cjs/tools/SelectionTool/types.js +14 -0
- package/dist/cjs/tools/SoundUITool.js +182 -0
- package/dist/cjs/tools/TextTool.d.ts +34 -0
- package/dist/cjs/tools/TextTool.js +284 -0
- package/dist/cjs/tools/ToolController.js +179 -0
- package/dist/cjs/tools/ToolEnabledGroup.js +16 -0
- package/dist/cjs/tools/ToolSwitcherShortcut.js +54 -0
- package/dist/cjs/tools/ToolbarShortcutHandler.js +50 -0
- package/dist/cjs/tools/UndoRedoShortcut.d.ts +8 -0
- package/dist/cjs/tools/UndoRedoShortcut.js +42 -0
- package/dist/cjs/tools/UndoRedoShortcut.test.d.ts +1 -0
- package/dist/cjs/tools/keybindings.d.ts +17 -0
- package/dist/cjs/tools/keybindings.js +44 -0
- package/dist/cjs/tools/lib.js +35 -0
- package/dist/cjs/tools/localization.js +33 -0
- package/dist/cjs/types.d.ts +154 -0
- package/dist/cjs/types.js +38 -0
- package/dist/cjs/util/assertions.js +54 -0
- package/dist/cjs/util/fileToBase64.js +15 -0
- package/dist/cjs/util/untilNextAnimationFrame.js +9 -0
- package/dist/cjs/util/waitForAll.js +17 -0
- package/dist/cjs/util/waitForTimeout.js +9 -0
- package/dist/mjs/Color4.mjs +260 -0
- package/dist/mjs/Color4.test.d.ts +1 -0
- package/dist/mjs/Editor.d.ts +328 -0
- package/dist/mjs/Editor.loadFrom.test.d.ts +1 -0
- package/dist/mjs/Editor.mjs +1055 -0
- package/dist/mjs/Editor.toSVG.test.d.ts +1 -0
- package/dist/mjs/EditorImage.d.ts +97 -0
- package/dist/mjs/EditorImage.mjs +527 -0
- package/dist/mjs/EditorImage.test.d.ts +1 -0
- package/dist/mjs/EventDispatcher.d.ts +29 -0
- package/dist/mjs/EventDispatcher.mjs +56 -0
- package/dist/mjs/EventDispatcher.test.d.ts +1 -0
- package/dist/mjs/Pointer.d.ts +37 -0
- package/dist/mjs/Pointer.mjs +120 -0
- package/dist/mjs/SVGLoader.d.ts +48 -0
- package/dist/mjs/SVGLoader.mjs +664 -0
- package/dist/mjs/SVGLoader.test.d.ts +1 -0
- package/dist/mjs/UndoRedoHistory.mjs +103 -0
- package/dist/mjs/UndoRedoHistory.test.d.ts +1 -0
- package/dist/mjs/Viewport.d.ts +73 -0
- package/dist/mjs/Viewport.mjs +304 -0
- package/dist/mjs/commands/Command.mjs +58 -0
- package/dist/mjs/commands/Duplicate.mjs +78 -0
- package/dist/mjs/commands/Erase.mjs +99 -0
- package/dist/mjs/commands/SerializableCommand.mjs +55 -0
- package/dist/mjs/commands/UnresolvedCommand.mjs +41 -0
- package/dist/mjs/commands/invertCommand.mjs +75 -0
- package/dist/mjs/commands/localization.d.ts +23 -0
- package/dist/mjs/commands/localization.mjs +21 -0
- package/dist/mjs/commands/uniteCommands.mjs +150 -0
- package/dist/mjs/commands/uniteCommands.test.d.ts +1 -0
- package/dist/mjs/components/AbstractComponent.d.ts +85 -0
- package/dist/mjs/components/AbstractComponent.mjs +298 -0
- package/dist/mjs/components/AbstractComponent.transformBy.test.d.ts +1 -0
- package/dist/mjs/components/BackgroundComponent.d.ts +62 -0
- package/dist/mjs/components/BackgroundComponent.mjs +308 -0
- package/dist/mjs/components/BackgroundComponent.test.d.ts +1 -0
- package/dist/mjs/components/ImageComponent.d.ts +31 -0
- package/dist/mjs/components/ImageComponent.mjs +226 -0
- package/dist/mjs/components/RestylableComponent.mjs +98 -0
- package/dist/mjs/components/SVGGlobalAttributesObject.d.ts +21 -0
- package/dist/mjs/components/SVGGlobalAttributesObject.mjs +80 -0
- package/dist/mjs/components/Stroke.d.ts +76 -0
- package/dist/mjs/components/Stroke.mjs +269 -0
- package/dist/mjs/components/Stroke.test.d.ts +1 -0
- package/dist/mjs/components/TextComponent.d.ts +79 -0
- package/dist/mjs/components/TextComponent.mjs +408 -0
- package/dist/mjs/components/TextComponent.test.d.ts +1 -0
- package/dist/mjs/components/UnknownSVGObject.d.ts +18 -0
- package/dist/mjs/components/UnknownSVGObject.mjs +63 -0
- package/dist/mjs/components/UnknownSVGObject.test.d.ts +1 -0
- package/dist/mjs/components/builders/ArrowBuilder.d.ts +19 -0
- package/dist/mjs/components/builders/ArrowBuilder.mjs +89 -0
- package/dist/mjs/components/builders/CircleBuilder.d.ts +2 -0
- package/dist/mjs/components/builders/CircleBuilder.mjs +70 -0
- package/dist/mjs/components/builders/FreehandLineBuilder.d.ts +33 -0
- package/dist/mjs/components/builders/FreehandLineBuilder.mjs +179 -0
- package/dist/mjs/components/builders/FreehandLineBuilder.test.d.ts +1 -0
- package/dist/mjs/components/builders/LineBuilder.d.ts +18 -0
- package/dist/mjs/components/builders/LineBuilder.mjs +61 -0
- package/dist/mjs/components/builders/PressureSensitiveFreehandLineBuilder.d.ts +36 -0
- package/dist/mjs/components/builders/PressureSensitiveFreehandLineBuilder.mjs +347 -0
- package/dist/mjs/components/builders/RectangleBuilder.d.ts +20 -0
- package/dist/mjs/components/builders/RectangleBuilder.mjs +53 -0
- package/dist/mjs/components/builders/types.d.ts +12 -0
- package/dist/mjs/components/builders/types.mjs +1 -0
- package/dist/mjs/components/lib.d.ts +14 -0
- package/dist/mjs/components/lib.mjs +15 -0
- package/dist/mjs/components/localization.mjs +11 -0
- package/dist/mjs/components/util/StrokeSmoother.d.ts +35 -0
- package/dist/mjs/components/util/StrokeSmoother.mjs +222 -0
- package/dist/mjs/components/util/describeComponentList.d.ts +4 -0
- package/dist/mjs/components/util/describeComponentList.mjs +15 -0
- package/dist/mjs/lib.d.ts +66 -0
- package/dist/mjs/lib.mjs +66 -0
- package/dist/mjs/localization.mjs +21 -0
- package/dist/mjs/localizations/de.mjs +15 -0
- package/dist/mjs/localizations/en.mjs +15 -0
- package/dist/mjs/localizations/es.mjs +29 -0
- package/dist/mjs/localizations/getLocalizationTable.d.ts +17 -0
- package/dist/mjs/localizations/getLocalizationTable.mjs +61 -0
- package/dist/mjs/localizations/getLocalizationTable.test.d.ts +1 -0
- package/dist/mjs/math/Mat33.d.ts +123 -0
- package/dist/mjs/math/Mat33.mjs +338 -0
- package/dist/mjs/math/Mat33.test.d.ts +1 -0
- package/dist/mjs/math/Vec2.mjs +34 -0
- package/dist/mjs/math/Vec2.test.d.ts +1 -0
- package/dist/mjs/math/Vec3.mjs +181 -0
- package/dist/mjs/math/Vec3.test.d.ts +1 -0
- package/dist/mjs/math/lib.d.ts +7 -0
- package/dist/mjs/math/lib.mjs +7 -0
- package/dist/mjs/math/polynomial/solveQuadratic.d.ts +9 -0
- package/dist/mjs/math/polynomial/solveQuadratic.mjs +37 -0
- package/dist/mjs/math/polynomial/solveQuadratic.test.d.ts +1 -0
- package/dist/mjs/math/rounding.mjs +133 -0
- package/dist/mjs/math/rounding.test.d.ts +1 -0
- package/dist/mjs/math/shapes/Abstract2DShape.d.ts +49 -0
- package/dist/mjs/math/shapes/Abstract2DShape.mjs +40 -0
- package/dist/mjs/math/shapes/BezierJSWrapper.d.ts +36 -0
- package/dist/mjs/math/shapes/BezierJSWrapper.mjs +107 -0
- package/dist/mjs/math/shapes/CubicBezier.d.ts +17 -0
- package/dist/mjs/math/shapes/CubicBezier.mjs +48 -0
- package/dist/mjs/math/shapes/LineSegment2.d.ts +70 -0
- package/dist/mjs/math/shapes/LineSegment2.mjs +202 -0
- package/dist/mjs/math/shapes/LineSegment2.test.d.ts +1 -0
- package/dist/mjs/math/shapes/Path.d.ts +93 -0
- package/dist/mjs/math/shapes/Path.fromString.test.d.ts +1 -0
- package/dist/mjs/math/shapes/Path.mjs +862 -0
- package/dist/mjs/math/shapes/Path.test.d.ts +1 -0
- package/dist/mjs/math/shapes/Path.toString.test.d.ts +1 -0
- package/dist/mjs/math/shapes/PointShape2D.d.ts +18 -0
- package/dist/mjs/math/shapes/PointShape2D.mjs +44 -0
- package/dist/mjs/math/shapes/QuadraticBezier.d.ts +34 -0
- package/dist/mjs/math/shapes/QuadraticBezier.mjs +131 -0
- package/dist/mjs/math/shapes/QuadraticBezier.test.d.ts +1 -0
- package/dist/mjs/math/shapes/Rect2.d.ts +57 -0
- package/dist/mjs/math/shapes/Rect2.mjs +309 -0
- package/dist/mjs/math/shapes/Rect2.test.d.ts +1 -0
- package/dist/mjs/math/shapes/Triangle.d.ts +46 -0
- package/dist/mjs/math/shapes/Triangle.mjs +146 -0
- package/dist/mjs/math/shapes/Triangle.test.d.ts +1 -0
- package/dist/mjs/rendering/Display.mjs +219 -0
- package/dist/mjs/rendering/RenderingStyle.d.ts +31 -0
- package/dist/mjs/rendering/RenderingStyle.mjs +49 -0
- package/dist/mjs/rendering/RenderingStyle.test.d.ts +1 -0
- package/dist/mjs/rendering/TextRenderingStyle.d.ts +43 -0
- package/dist/mjs/rendering/TextRenderingStyle.mjs +34 -0
- package/dist/mjs/rendering/caching/CacheRecord.d.ts +20 -0
- package/dist/mjs/rendering/caching/CacheRecord.mjs +57 -0
- package/dist/mjs/rendering/caching/CacheRecord.test.d.ts +1 -0
- package/dist/mjs/rendering/caching/CacheRecordManager.d.ts +12 -0
- package/dist/mjs/rendering/caching/CacheRecordManager.mjs +45 -0
- package/dist/mjs/rendering/caching/RenderingCache.mjs +48 -0
- package/dist/mjs/rendering/caching/RenderingCache.test.d.ts +1 -0
- package/dist/mjs/rendering/caching/RenderingCacheNode.d.ts +29 -0
- package/dist/mjs/rendering/caching/RenderingCacheNode.mjs +338 -0
- package/dist/mjs/rendering/caching/testUtils.mjs +30 -0
- package/dist/mjs/rendering/caching/types.mjs +1 -0
- package/dist/mjs/rendering/localization.mjs +9 -0
- package/dist/mjs/rendering/renderers/AbstractRenderer.d.ts +85 -0
- package/dist/mjs/rendering/renderers/AbstractRenderer.mjs +166 -0
- package/dist/mjs/rendering/renderers/CanvasRenderer.d.ts +63 -0
- package/dist/mjs/rendering/renderers/CanvasRenderer.mjs +261 -0
- package/dist/mjs/rendering/renderers/DummyRenderer.d.ts +35 -0
- package/dist/mjs/rendering/renderers/DummyRenderer.mjs +130 -0
- package/dist/mjs/rendering/renderers/DummyRenderer.test.d.ts +1 -0
- package/dist/mjs/rendering/renderers/SVGRenderer.d.ts +57 -0
- package/dist/mjs/rendering/renderers/SVGRenderer.mjs +352 -0
- package/dist/mjs/rendering/renderers/TextOnlyRenderer.d.ts +29 -0
- package/dist/mjs/rendering/renderers/TextOnlyRenderer.mjs +87 -0
- package/dist/mjs/rendering/renderers/TextOnlyRenderer.test.d.ts +1 -0
- package/dist/mjs/shortcuts/KeyBinding.d.ts +46 -0
- package/dist/mjs/shortcuts/KeyBinding.mjs +155 -0
- package/dist/mjs/shortcuts/KeyBinding.test.d.ts +1 -0
- package/dist/mjs/shortcuts/KeyboardShortcutManager.d.ts +77 -0
- package/dist/mjs/shortcuts/KeyboardShortcutManager.mjs +146 -0
- package/dist/mjs/shortcuts/KeyboardShortcutManager.test.d.ts +1 -0
- package/dist/mjs/shortcuts/lib.d.ts +2 -0
- package/dist/mjs/shortcuts/lib.mjs +2 -0
- package/dist/mjs/testing/createEditor.mjs +9 -0
- package/dist/mjs/testing/sendPenEvent.mjs +19 -0
- package/dist/mjs/testing/sendTouchEvent.mjs +71 -0
- package/dist/mjs/toolbar/HTMLToolbar.mjs +462 -0
- package/dist/mjs/toolbar/IconProvider.mjs +272 -0
- package/dist/mjs/toolbar/localization.d.ts +52 -0
- package/dist/mjs/toolbar/localization.mjs +51 -0
- package/dist/mjs/toolbar/makeColorInput.mjs +121 -0
- package/dist/mjs/toolbar/types.mjs +1 -0
- package/dist/mjs/toolbar/widgets/ActionButtonWidget.mjs +45 -0
- package/dist/mjs/toolbar/widgets/BaseToolWidget.mjs +62 -0
- package/dist/mjs/toolbar/widgets/BaseWidget.mjs +357 -0
- package/dist/mjs/toolbar/widgets/DocumentPropertiesWidget.mjs +194 -0
- package/dist/mjs/toolbar/widgets/EraserToolWidget.mjs +88 -0
- package/dist/mjs/toolbar/widgets/HandToolWidget.mjs +209 -0
- package/dist/mjs/toolbar/widgets/InsertImageWidget.mjs +244 -0
- package/dist/mjs/toolbar/widgets/OverflowWidget.mjs +101 -0
- package/dist/mjs/toolbar/widgets/PenToolWidget.mjs +262 -0
- package/dist/mjs/toolbar/widgets/SelectionToolWidget.mjs +211 -0
- package/dist/mjs/toolbar/widgets/TextToolWidget.mjs +140 -0
- package/dist/mjs/toolbar/widgets/keybindings.d.ts +2 -0
- package/dist/mjs/toolbar/widgets/keybindings.mjs +10 -0
- package/dist/mjs/tools/BaseTool.mjs +65 -0
- package/dist/mjs/tools/Eraser.d.ts +24 -0
- package/dist/mjs/tools/Eraser.mjs +146 -0
- package/dist/mjs/tools/Eraser.test.d.ts +1 -0
- package/dist/mjs/tools/FindTool.d.ts +20 -0
- package/dist/mjs/tools/FindTool.mjs +135 -0
- package/dist/mjs/tools/PanZoom.d.ts +52 -0
- package/dist/mjs/tools/PanZoom.mjs +468 -0
- package/dist/mjs/tools/PanZoom.test.d.ts +1 -0
- package/dist/mjs/tools/PasteHandler.mjs +177 -0
- package/dist/mjs/tools/Pen.d.ts +41 -0
- package/dist/mjs/tools/Pen.mjs +236 -0
- package/dist/mjs/tools/Pen.test.d.ts +1 -0
- package/dist/mjs/tools/PipetteTool.mjs +61 -0
- package/dist/mjs/tools/SelectionTool/SelectAllShortcutHandler.d.ts +8 -0
- package/dist/mjs/tools/SelectionTool/SelectAllShortcutHandler.mjs +42 -0
- package/dist/mjs/tools/SelectionTool/Selection.d.ts +64 -0
- package/dist/mjs/tools/SelectionTool/Selection.mjs +600 -0
- package/dist/mjs/tools/SelectionTool/SelectionHandle.mjs +83 -0
- package/dist/mjs/tools/SelectionTool/SelectionTool.d.ts +37 -0
- package/dist/mjs/tools/SelectionTool/SelectionTool.mjs +438 -0
- package/dist/mjs/tools/SelectionTool/SelectionTool.test.d.ts +1 -0
- package/dist/mjs/tools/SelectionTool/TransformMode.mjs +104 -0
- package/dist/mjs/tools/SoundUITool.mjs +180 -0
- package/dist/mjs/tools/TextTool.d.ts +34 -0
- package/dist/mjs/tools/TextTool.mjs +282 -0
- package/dist/mjs/tools/ToolController.mjs +177 -0
- package/dist/mjs/tools/ToolEnabledGroup.mjs +14 -0
- package/dist/mjs/tools/ToolSwitcherShortcut.mjs +52 -0
- package/dist/mjs/tools/ToolbarShortcutHandler.mjs +48 -0
- package/dist/mjs/tools/UndoRedoShortcut.d.ts +8 -0
- package/dist/mjs/tools/UndoRedoShortcut.mjs +40 -0
- package/dist/mjs/tools/UndoRedoShortcut.test.d.ts +1 -0
- package/dist/mjs/tools/keybindings.d.ts +17 -0
- package/dist/mjs/tools/keybindings.mjs +41 -0
- package/dist/mjs/tools/localization.mjs +30 -0
- package/dist/mjs/types.d.ts +154 -0
- package/dist/mjs/util/assertions.mjs +48 -0
- package/dist/mjs/util/fileToBase64.mjs +13 -0
- package/dist/mjs/util/untilNextAnimationFrame.mjs +7 -0
- package/dist/mjs/util/waitForAll.mjs +15 -0
- package/dist/mjs/util/waitForTimeout.mjs +7 -0
- package/dist-test/test_imports/package-lock.json +13 -0
- package/dist-test/test_imports/package.json +12 -0
- package/dist-test/test_imports/test-imports.js +17 -0
- package/dist-test/test_imports/test-require.cjs +19 -0
- package/package.json +98 -124
- package/src/Color4.test.ts +47 -0
- package/src/Color4.ts +304 -0
- package/src/Editor.loadFrom.test.ts +24 -0
- package/src/Editor.toSVG.test.ts +111 -0
- package/src/Editor.ts +1171 -0
- package/src/EditorImage.test.ts +120 -0
- package/src/EditorImage.ts +603 -0
- package/src/EventDispatcher.test.ts +123 -0
- package/src/EventDispatcher.ts +72 -0
- package/src/Pointer.ts +167 -0
- package/src/SVGLoader.test.ts +114 -0
- package/src/SVGLoader.ts +610 -0
- package/src/UndoRedoHistory.test.ts +33 -0
- package/src/UndoRedoHistory.ts +102 -0
- package/src/Viewport.ts +325 -0
- package/src/bundle/bundled.ts +7 -0
- package/src/commands/Command.ts +45 -0
- package/src/commands/Duplicate.ts +75 -0
- package/src/commands/Erase.ts +94 -0
- package/src/commands/SerializableCommand.ts +49 -0
- package/src/commands/UnresolvedCommand.ts +37 -0
- package/src/commands/invertCommand.ts +58 -0
- package/src/commands/lib.ts +16 -0
- package/src/commands/localization.ts +47 -0
- package/src/commands/uniteCommands.test.ts +23 -0
- package/src/commands/uniteCommands.ts +140 -0
- package/src/components/AbstractComponent.transformBy.test.ts +22 -0
- package/src/components/AbstractComponent.ts +374 -0
- package/src/components/BackgroundComponent.test.ts +45 -0
- package/src/components/BackgroundComponent.ts +353 -0
- package/src/components/ImageComponent.ts +178 -0
- package/src/components/RestylableComponent.ts +161 -0
- package/src/components/SVGGlobalAttributesObject.ts +81 -0
- package/src/components/Stroke.test.ts +139 -0
- package/src/components/Stroke.ts +296 -0
- package/src/components/TextComponent.test.ts +204 -0
- package/src/components/TextComponent.ts +432 -0
- package/src/components/UnknownSVGObject.test.ts +10 -0
- package/src/components/UnknownSVGObject.ts +60 -0
- package/src/components/builders/ArrowBuilder.ts +107 -0
- package/src/components/builders/CircleBuilder.ts +102 -0
- package/src/components/builders/FreehandLineBuilder.test.ts +25 -0
- package/src/components/builders/FreehandLineBuilder.ts +212 -0
- package/src/components/builders/LineBuilder.ts +77 -0
- package/src/components/builders/PressureSensitiveFreehandLineBuilder.ts +454 -0
- package/src/components/builders/RectangleBuilder.ts +74 -0
- package/src/components/builders/types.ts +15 -0
- package/src/components/lib.ts +31 -0
- package/src/components/localization.ts +24 -0
- package/src/components/util/StrokeSmoother.ts +302 -0
- package/src/components/util/describeComponentList.ts +18 -0
- package/src/lib.ts +69 -0
- package/src/localization.ts +34 -0
- package/src/localizations/de.ts +146 -0
- package/src/localizations/en.ts +8 -0
- package/src/localizations/es.ts +74 -0
- package/src/localizations/getLocalizationTable.test.ts +27 -0
- package/src/localizations/getLocalizationTable.ts +74 -0
- package/src/math/Mat33.test.ts +244 -0
- package/src/math/Mat33.ts +442 -0
- package/src/math/Vec2.test.ts +30 -0
- package/src/math/Vec2.ts +40 -0
- package/src/math/Vec3.test.ts +44 -0
- package/src/math/Vec3.ts +218 -0
- package/src/math/lib.ts +15 -0
- package/src/math/polynomial/solveQuadratic.test.ts +39 -0
- package/src/math/polynomial/solveQuadratic.ts +43 -0
- package/src/math/rounding.test.ts +65 -0
- package/src/math/rounding.ts +156 -0
- package/src/math/shapes/Abstract2DShape.ts +63 -0
- package/src/math/shapes/BezierJSWrapper.ts +93 -0
- package/src/math/shapes/CubicBezier.ts +35 -0
- package/src/math/shapes/LineSegment2.test.ts +99 -0
- package/src/math/shapes/LineSegment2.ts +231 -0
- package/src/math/shapes/Path.fromString.test.ts +223 -0
- package/src/math/shapes/Path.test.ts +309 -0
- package/src/math/shapes/Path.toString.test.ts +77 -0
- package/src/math/shapes/Path.ts +1027 -0
- package/src/math/shapes/PointShape2D.ts +33 -0
- package/src/math/shapes/QuadraticBezier.test.ts +31 -0
- package/src/math/shapes/QuadraticBezier.ts +141 -0
- package/src/math/shapes/Rect2.test.ts +209 -0
- package/src/math/shapes/Rect2.ts +344 -0
- package/src/math/shapes/Triangle.test.ts +61 -0
- package/src/math/shapes/Triangle.ts +139 -0
- package/src/rendering/Display.ts +248 -0
- package/src/rendering/RenderingStyle.test.ts +68 -0
- package/src/rendering/RenderingStyle.ts +55 -0
- package/src/rendering/TextRenderingStyle.ts +55 -0
- package/src/rendering/caching/CacheRecord.test.ts +49 -0
- package/src/rendering/caching/CacheRecord.ts +77 -0
- package/src/rendering/caching/CacheRecordManager.ts +71 -0
- package/src/rendering/caching/RenderingCache.test.ts +44 -0
- package/src/rendering/caching/RenderingCache.ts +66 -0
- package/src/rendering/caching/RenderingCacheNode.ts +405 -0
- package/src/rendering/caching/testUtils.ts +35 -0
- package/src/rendering/caching/types.ts +34 -0
- package/src/rendering/lib.ts +8 -0
- package/src/rendering/localization.ts +20 -0
- package/src/rendering/renderers/AbstractRenderer.ts +242 -0
- package/src/rendering/renderers/CanvasRenderer.ts +305 -0
- package/src/rendering/renderers/DummyRenderer.test.ts +42 -0
- package/src/rendering/renderers/DummyRenderer.ts +145 -0
- package/src/rendering/renderers/SVGRenderer.ts +374 -0
- package/src/rendering/renderers/TextOnlyRenderer.test.ts +34 -0
- package/src/rendering/renderers/TextOnlyRenderer.ts +71 -0
- package/src/shortcuts/KeyBinding.test.ts +51 -0
- package/src/shortcuts/KeyBinding.ts +218 -0
- package/src/shortcuts/KeyboardShortcutManager.test.ts +95 -0
- package/src/shortcuts/KeyboardShortcutManager.ts +163 -0
- package/src/shortcuts/lib.ts +3 -0
- package/src/testing/createEditor.ts +11 -0
- package/src/testing/lib.ts +3 -0
- package/src/testing/sendPenEvent.ts +31 -0
- package/src/testing/sendTouchEvent.ts +78 -0
- package/src/toolbar/HTMLToolbar.ts +567 -0
- package/src/toolbar/IconProvider.ts +736 -0
- package/src/toolbar/lib.ts +4 -0
- package/src/toolbar/localization.ts +114 -0
- package/src/toolbar/makeColorInput.ts +159 -0
- package/src/toolbar/types.ts +5 -0
- package/src/toolbar/widgets/ActionButtonWidget.ts +39 -0
- package/src/toolbar/widgets/BaseToolWidget.ts +56 -0
- package/src/toolbar/widgets/BaseWidget.ts +428 -0
- package/src/toolbar/widgets/DocumentPropertiesWidget.ts +234 -0
- package/src/toolbar/widgets/EraserToolWidget.ts +85 -0
- package/src/toolbar/widgets/HandToolWidget.ts +250 -0
- package/src/toolbar/widgets/InsertImageWidget.ts +223 -0
- package/src/toolbar/widgets/OverflowWidget.ts +92 -0
- package/src/toolbar/widgets/PenToolWidget.ts +297 -0
- package/src/toolbar/widgets/SelectionToolWidget.ts +193 -0
- package/src/toolbar/widgets/TextToolWidget.ts +145 -0
- package/src/toolbar/widgets/keybindings.ts +21 -0
- package/src/toolbar/widgets/lib.ts +13 -0
- package/src/tools/BaseTool.ts +76 -0
- package/src/tools/Eraser.test.ts +103 -0
- package/src/tools/Eraser.ts +160 -0
- package/src/tools/FindTool.ts +153 -0
- package/src/tools/PanZoom.test.ts +310 -0
- package/src/tools/PanZoom.ts +502 -0
- package/src/tools/PasteHandler.ts +95 -0
- package/src/tools/Pen.test.ts +194 -0
- package/src/tools/Pen.ts +262 -0
- package/src/tools/PipetteTool.ts +55 -0
- package/src/tools/SelectionTool/SelectAllShortcutHandler.ts +29 -0
- package/src/tools/SelectionTool/Selection.ts +611 -0
- package/src/tools/SelectionTool/SelectionHandle.ts +108 -0
- package/src/tools/SelectionTool/SelectionTool.test.ts +261 -0
- package/src/tools/SelectionTool/SelectionTool.ts +496 -0
- package/src/tools/SelectionTool/TransformMode.ts +114 -0
- package/src/tools/SelectionTool/types.ts +11 -0
- package/src/tools/SoundUITool.ts +212 -0
- package/src/tools/TextTool.ts +340 -0
- package/src/tools/ToolController.ts +185 -0
- package/src/tools/ToolEnabledGroup.ts +14 -0
- package/src/tools/ToolSwitcherShortcut.ts +39 -0
- package/src/tools/ToolbarShortcutHandler.ts +39 -0
- package/src/tools/UndoRedoShortcut.test.ts +56 -0
- package/src/tools/UndoRedoShortcut.ts +24 -0
- package/src/tools/keybindings.ts +85 -0
- package/src/tools/lib.ts +22 -0
- package/src/tools/localization.ts +74 -0
- package/src/types.ts +239 -0
- package/src/util/assertions.ts +55 -0
- package/src/util/fileToBase64.ts +18 -0
- package/src/util/untilNextAnimationFrame.ts +9 -0
- package/src/util/waitForAll.ts +18 -0
- package/src/util/waitForTimeout.ts +9 -0
- package/tools/allLocales.js +4 -0
- package/tsconfig.json +2 -32
- package/.eslintrc.js +0 -60
- package/.firebaserc +0 -5
- package/CHANGELOG.md +0 -390
- package/CONTRIBUTING.md +0 -75
- package/LICENSE +0 -21
- package/README.md +0 -217
- package/__mocks__/coloris.ts +0 -8
- package/__mocks__/styleMock.js +0 -1
- package/dist/cjs/src/Color4.js +0 -264
- package/dist/cjs/src/Editor.d.ts +0 -309
- package/dist/cjs/src/Editor.js +0 -922
- package/dist/cjs/src/EditorImage.d.ts +0 -97
- package/dist/cjs/src/EditorImage.js +0 -492
- package/dist/cjs/src/EventDispatcher.d.ts +0 -30
- package/dist/cjs/src/EventDispatcher.js +0 -57
- package/dist/cjs/src/Pointer.d.ts +0 -26
- package/dist/cjs/src/Pointer.js +0 -109
- package/dist/cjs/src/SVGLoader.d.ts +0 -48
- package/dist/cjs/src/SVGLoader.js +0 -537
- package/dist/cjs/src/UndoRedoHistory.js +0 -93
- package/dist/cjs/src/Viewport.d.ts +0 -73
- package/dist/cjs/src/Viewport.js +0 -268
- package/dist/cjs/src/bundle/bundled.js +0 -24
- package/dist/cjs/src/commands/Command.js +0 -34
- package/dist/cjs/src/commands/Duplicate.js +0 -65
- package/dist/cjs/src/commands/Erase.js +0 -83
- package/dist/cjs/src/commands/SerializableCommand.js +0 -42
- package/dist/cjs/src/commands/UnresolvedCommand.js +0 -28
- package/dist/cjs/src/commands/invertCommand.js +0 -55
- package/dist/cjs/src/commands/lib.js +0 -18
- package/dist/cjs/src/commands/localization.d.ts +0 -23
- package/dist/cjs/src/commands/localization.js +0 -24
- package/dist/cjs/src/commands/uniteCommands.js +0 -122
- package/dist/cjs/src/components/AbstractComponent.d.ts +0 -85
- package/dist/cjs/src/components/AbstractComponent.js +0 -273
- package/dist/cjs/src/components/BackgroundComponent.d.ts +0 -62
- package/dist/cjs/src/components/BackgroundComponent.js +0 -316
- package/dist/cjs/src/components/ImageComponent.d.ts +0 -31
- package/dist/cjs/src/components/ImageComponent.js +0 -157
- package/dist/cjs/src/components/RestylableComponent.js +0 -88
- package/dist/cjs/src/components/SVGGlobalAttributesObject.d.ts +0 -21
- package/dist/cjs/src/components/SVGGlobalAttributesObject.js +0 -65
- package/dist/cjs/src/components/Stroke.d.ts +0 -76
- package/dist/cjs/src/components/Stroke.js +0 -238
- package/dist/cjs/src/components/TextComponent.d.ts +0 -63
- package/dist/cjs/src/components/TextComponent.js +0 -280
- package/dist/cjs/src/components/UnknownSVGObject.d.ts +0 -18
- package/dist/cjs/src/components/UnknownSVGObject.js +0 -50
- package/dist/cjs/src/components/builders/ArrowBuilder.d.ts +0 -19
- package/dist/cjs/src/components/builders/ArrowBuilder.js +0 -117
- package/dist/cjs/src/components/builders/FreehandLineBuilder.d.ts +0 -33
- package/dist/cjs/src/components/builders/FreehandLineBuilder.js +0 -173
- package/dist/cjs/src/components/builders/LineBuilder.d.ts +0 -18
- package/dist/cjs/src/components/builders/LineBuilder.js +0 -89
- package/dist/cjs/src/components/builders/PressureSensitiveFreehandLineBuilder.d.ts +0 -36
- package/dist/cjs/src/components/builders/PressureSensitiveFreehandLineBuilder.js +0 -347
- package/dist/cjs/src/components/builders/RectangleBuilder.d.ts +0 -20
- package/dist/cjs/src/components/builders/RectangleBuilder.js +0 -59
- package/dist/cjs/src/components/builders/types.d.ts +0 -12
- package/dist/cjs/src/components/lib.d.ts +0 -13
- package/dist/cjs/src/components/lib.js +0 -43
- package/dist/cjs/src/components/localization.js +0 -14
- package/dist/cjs/src/components/util/StrokeSmoother.d.ts +0 -35
- package/dist/cjs/src/components/util/StrokeSmoother.js +0 -225
- package/dist/cjs/src/components/util/describeComponentList.d.ts +0 -4
- package/dist/cjs/src/components/util/describeComponentList.js +0 -16
- package/dist/cjs/src/lib.d.ts +0 -64
- package/dist/cjs/src/lib.js +0 -93
- package/dist/cjs/src/localization.js +0 -13
- package/dist/cjs/src/localizations/de.js +0 -6
- package/dist/cjs/src/localizations/en.js +0 -6
- package/dist/cjs/src/localizations/es.js +0 -20
- package/dist/cjs/src/localizations/getLocalizationTable.d.ts +0 -3
- package/dist/cjs/src/localizations/getLocalizationTable.js +0 -50
- package/dist/cjs/src/math/LineSegment2.d.ts +0 -26
- package/dist/cjs/src/math/LineSegment2.js +0 -135
- package/dist/cjs/src/math/Mat33.d.ts +0 -118
- package/dist/cjs/src/math/Mat33.js +0 -332
- package/dist/cjs/src/math/Path.d.ts +0 -92
- package/dist/cjs/src/math/Path.js +0 -876
- package/dist/cjs/src/math/Rect2.d.ts +0 -52
- package/dist/cjs/src/math/Rect2.js +0 -235
- package/dist/cjs/src/math/Triangle.d.ts +0 -11
- package/dist/cjs/src/math/Triangle.js +0 -22
- package/dist/cjs/src/math/Vec2.js +0 -39
- package/dist/cjs/src/math/Vec3.js +0 -177
- package/dist/cjs/src/math/lib.d.ts +0 -7
- package/dist/cjs/src/math/lib.js +0 -18
- package/dist/cjs/src/math/polynomial/QuadraticBezier.d.ts +0 -28
- package/dist/cjs/src/math/polynomial/QuadraticBezier.js +0 -114
- package/dist/cjs/src/math/polynomial/solveQuadratic.d.ts +0 -6
- package/dist/cjs/src/math/polynomial/solveQuadratic.js +0 -36
- package/dist/cjs/src/math/rounding.js +0 -135
- package/dist/cjs/src/rendering/Display.js +0 -213
- package/dist/cjs/src/rendering/RenderingStyle.d.ts +0 -31
- package/dist/cjs/src/rendering/RenderingStyle.js +0 -48
- package/dist/cjs/src/rendering/TextRenderingStyle.d.ts +0 -36
- package/dist/cjs/src/rendering/TextRenderingStyle.js +0 -29
- package/dist/cjs/src/rendering/caching/CacheRecord.d.ts +0 -20
- package/dist/cjs/src/rendering/caching/CacheRecord.js +0 -61
- package/dist/cjs/src/rendering/caching/CacheRecordManager.d.ts +0 -12
- package/dist/cjs/src/rendering/caching/CacheRecordManager.js +0 -50
- package/dist/cjs/src/rendering/caching/RenderingCache.js +0 -51
- package/dist/cjs/src/rendering/caching/RenderingCacheNode.d.ts +0 -29
- package/dist/cjs/src/rendering/caching/RenderingCacheNode.js +0 -326
- package/dist/cjs/src/rendering/caching/testUtils.js +0 -27
- package/dist/cjs/src/rendering/lib.js +0 -17
- package/dist/cjs/src/rendering/localization.js +0 -12
- package/dist/cjs/src/rendering/renderers/AbstractRenderer.d.ts +0 -85
- package/dist/cjs/src/rendering/renderers/AbstractRenderer.js +0 -188
- package/dist/cjs/src/rendering/renderers/CanvasRenderer.d.ts +0 -63
- package/dist/cjs/src/rendering/renderers/CanvasRenderer.js +0 -243
- package/dist/cjs/src/rendering/renderers/DummyRenderer.d.ts +0 -35
- package/dist/cjs/src/rendering/renderers/DummyRenderer.js +0 -112
- package/dist/cjs/src/rendering/renderers/SVGRenderer.d.ts +0 -57
- package/dist/cjs/src/rendering/renderers/SVGRenderer.js +0 -320
- package/dist/cjs/src/rendering/renderers/TextOnlyRenderer.d.ts +0 -29
- package/dist/cjs/src/rendering/renderers/TextOnlyRenderer.js +0 -63
- package/dist/cjs/src/testing/beforeEachFile.js +0 -12
- package/dist/cjs/src/testing/createEditor.js +0 -14
- package/dist/cjs/src/testing/lib.js +0 -10
- package/dist/cjs/src/testing/loadExpectExtensions.d.ts +0 -2
- package/dist/cjs/src/testing/loadExpectExtensions.js +0 -28
- package/dist/cjs/src/testing/sendPenEvent.js +0 -24
- package/dist/cjs/src/testing/sendTouchEvent.js +0 -87
- package/dist/cjs/src/toolbar/HTMLToolbar.js +0 -449
- package/dist/cjs/src/toolbar/IconProvider.js +0 -660
- package/dist/cjs/src/toolbar/lib.js +0 -24
- package/dist/cjs/src/toolbar/localization.d.ts +0 -51
- package/dist/cjs/src/toolbar/localization.js +0 -53
- package/dist/cjs/src/toolbar/makeColorInput.js +0 -128
- package/dist/cjs/src/toolbar/widgets/ActionButtonWidget.js +0 -31
- package/dist/cjs/src/toolbar/widgets/BaseToolWidget.js +0 -49
- package/dist/cjs/src/toolbar/widgets/BaseWidget.js +0 -351
- package/dist/cjs/src/toolbar/widgets/DocumentPropertiesWidget.js +0 -201
- package/dist/cjs/src/toolbar/widgets/EraserToolWidget.js +0 -63
- package/dist/cjs/src/toolbar/widgets/HandToolWidget.js +0 -201
- package/dist/cjs/src/toolbar/widgets/InsertImageWidget.js +0 -176
- package/dist/cjs/src/toolbar/widgets/OverflowWidget.js +0 -77
- package/dist/cjs/src/toolbar/widgets/PenToolWidget.js +0 -226
- package/dist/cjs/src/toolbar/widgets/SelectionToolWidget.js +0 -153
- package/dist/cjs/src/toolbar/widgets/TextToolWidget.js +0 -115
- package/dist/cjs/src/toolbar/widgets/lib.js +0 -26
- package/dist/cjs/src/tools/BaseTool.js +0 -66
- package/dist/cjs/src/tools/Eraser.d.ts +0 -23
- package/dist/cjs/src/tools/Eraser.js +0 -112
- package/dist/cjs/src/tools/FindTool.d.ts +0 -21
- package/dist/cjs/src/tools/FindTool.js +0 -121
- package/dist/cjs/src/tools/PanZoom.d.ts +0 -52
- package/dist/cjs/src/tools/PanZoom.js +0 -421
- package/dist/cjs/src/tools/PasteHandler.js +0 -99
- package/dist/cjs/src/tools/Pen.d.ts +0 -43
- package/dist/cjs/src/tools/Pen.js +0 -202
- package/dist/cjs/src/tools/PipetteTool.js +0 -45
- package/dist/cjs/src/tools/SelectionTool/SelectAllShortcutHandler.d.ts +0 -8
- package/dist/cjs/src/tools/SelectionTool/SelectAllShortcutHandler.js +0 -28
- package/dist/cjs/src/tools/SelectionTool/Selection.d.ts +0 -64
- package/dist/cjs/src/tools/SelectionTool/Selection.js +0 -491
- package/dist/cjs/src/tools/SelectionTool/SelectionHandle.js +0 -85
- package/dist/cjs/src/tools/SelectionTool/SelectionTool.d.ts +0 -37
- package/dist/cjs/src/tools/SelectionTool/SelectionTool.js +0 -413
- package/dist/cjs/src/tools/SelectionTool/TransformMode.js +0 -107
- package/dist/cjs/src/tools/SelectionTool/types.js +0 -14
- package/dist/cjs/src/tools/SoundUITool.js +0 -164
- package/dist/cjs/src/tools/TextTool.d.ts +0 -33
- package/dist/cjs/src/tools/TextTool.js +0 -262
- package/dist/cjs/src/tools/ToolController.js +0 -192
- package/dist/cjs/src/tools/ToolEnabledGroup.js +0 -14
- package/dist/cjs/src/tools/ToolSwitcherShortcut.js +0 -38
- package/dist/cjs/src/tools/ToolbarShortcutHandler.js +0 -29
- package/dist/cjs/src/tools/UndoRedoShortcut.d.ts +0 -8
- package/dist/cjs/src/tools/UndoRedoShortcut.js +0 -28
- package/dist/cjs/src/tools/lib.js +0 -38
- package/dist/cjs/src/tools/localization.js +0 -33
- package/dist/cjs/src/types.d.ts +0 -153
- package/dist/cjs/src/types.js +0 -38
- package/dist/cjs/src/util/assertions.js +0 -51
- package/dist/cjs/src/util/fileToBase64.js +0 -15
- package/dist/cjs/src/util/untilNextAnimationFrame.js +0 -9
- package/dist/cjs/src/util/waitForAll.js +0 -17
- package/dist/cjs/src/util/waitForTimeout.js +0 -9
- package/dist/mjs/src/Color4.mjs +0 -258
- package/dist/mjs/src/Editor.d.ts +0 -309
- package/dist/mjs/src/Editor.mjs +0 -892
- package/dist/mjs/src/EditorImage.d.ts +0 -97
- package/dist/mjs/src/EditorImage.mjs +0 -485
- package/dist/mjs/src/EventDispatcher.d.ts +0 -30
- package/dist/mjs/src/EventDispatcher.mjs +0 -54
- package/dist/mjs/src/Pointer.d.ts +0 -26
- package/dist/mjs/src/Pointer.mjs +0 -105
- package/dist/mjs/src/SVGLoader.d.ts +0 -48
- package/dist/mjs/src/SVGLoader.mjs +0 -507
- package/dist/mjs/src/UndoRedoHistory.mjs +0 -91
- package/dist/mjs/src/Viewport.d.ts +0 -73
- package/dist/mjs/src/Viewport.mjs +0 -261
- package/dist/mjs/src/commands/Command.mjs +0 -31
- package/dist/mjs/src/commands/Duplicate.mjs +0 -59
- package/dist/mjs/src/commands/Erase.mjs +0 -77
- package/dist/mjs/src/commands/SerializableCommand.mjs +0 -37
- package/dist/mjs/src/commands/UnresolvedCommand.mjs +0 -22
- package/dist/mjs/src/commands/invertCommand.mjs +0 -50
- package/dist/mjs/src/commands/localization.d.ts +0 -23
- package/dist/mjs/src/commands/localization.mjs +0 -21
- package/dist/mjs/src/commands/uniteCommands.mjs +0 -117
- package/dist/mjs/src/components/AbstractComponent.d.ts +0 -85
- package/dist/mjs/src/components/AbstractComponent.mjs +0 -268
- package/dist/mjs/src/components/BackgroundComponent.d.ts +0 -62
- package/dist/mjs/src/components/BackgroundComponent.mjs +0 -286
- package/dist/mjs/src/components/ImageComponent.d.ts +0 -31
- package/dist/mjs/src/components/ImageComponent.mjs +0 -151
- package/dist/mjs/src/components/RestylableComponent.mjs +0 -80
- package/dist/mjs/src/components/SVGGlobalAttributesObject.d.ts +0 -21
- package/dist/mjs/src/components/SVGGlobalAttributesObject.mjs +0 -59
- package/dist/mjs/src/components/Stroke.d.ts +0 -76
- package/dist/mjs/src/components/Stroke.mjs +0 -232
- package/dist/mjs/src/components/TextComponent.d.ts +0 -63
- package/dist/mjs/src/components/TextComponent.mjs +0 -275
- package/dist/mjs/src/components/UnknownSVGObject.d.ts +0 -18
- package/dist/mjs/src/components/UnknownSVGObject.mjs +0 -44
- package/dist/mjs/src/components/builders/ArrowBuilder.d.ts +0 -19
- package/dist/mjs/src/components/builders/ArrowBuilder.mjs +0 -86
- package/dist/mjs/src/components/builders/FreehandLineBuilder.d.ts +0 -33
- package/dist/mjs/src/components/builders/FreehandLineBuilder.mjs +0 -165
- package/dist/mjs/src/components/builders/LineBuilder.d.ts +0 -18
- package/dist/mjs/src/components/builders/LineBuilder.mjs +0 -58
- package/dist/mjs/src/components/builders/PressureSensitiveFreehandLineBuilder.d.ts +0 -36
- package/dist/mjs/src/components/builders/PressureSensitiveFreehandLineBuilder.mjs +0 -339
- package/dist/mjs/src/components/builders/RectangleBuilder.d.ts +0 -20
- package/dist/mjs/src/components/builders/RectangleBuilder.mjs +0 -50
- package/dist/mjs/src/components/builders/types.d.ts +0 -12
- package/dist/mjs/src/components/lib.d.ts +0 -13
- package/dist/mjs/src/components/lib.mjs +0 -14
- package/dist/mjs/src/components/localization.mjs +0 -11
- package/dist/mjs/src/components/util/StrokeSmoother.d.ts +0 -35
- package/dist/mjs/src/components/util/StrokeSmoother.mjs +0 -218
- package/dist/mjs/src/components/util/describeComponentList.d.ts +0 -4
- package/dist/mjs/src/components/util/describeComponentList.mjs +0 -14
- package/dist/mjs/src/lib.d.ts +0 -64
- package/dist/mjs/src/lib.mjs +0 -64
- package/dist/mjs/src/localization.mjs +0 -10
- package/dist/mjs/src/localizations/de.mjs +0 -4
- package/dist/mjs/src/localizations/en.mjs +0 -4
- package/dist/mjs/src/localizations/es.mjs +0 -18
- package/dist/mjs/src/localizations/getLocalizationTable.d.ts +0 -3
- package/dist/mjs/src/localizations/getLocalizationTable.mjs +0 -45
- package/dist/mjs/src/math/LineSegment2.d.ts +0 -26
- package/dist/mjs/src/math/LineSegment2.mjs +0 -129
- package/dist/mjs/src/math/Mat33.d.ts +0 -118
- package/dist/mjs/src/math/Mat33.mjs +0 -327
- package/dist/mjs/src/math/Path.d.ts +0 -92
- package/dist/mjs/src/math/Path.mjs +0 -870
- package/dist/mjs/src/math/Rect2.d.ts +0 -52
- package/dist/mjs/src/math/Rect2.mjs +0 -230
- package/dist/mjs/src/math/Triangle.d.ts +0 -11
- package/dist/mjs/src/math/Triangle.mjs +0 -19
- package/dist/mjs/src/math/Vec2.mjs +0 -33
- package/dist/mjs/src/math/Vec3.mjs +0 -175
- package/dist/mjs/src/math/lib.d.ts +0 -7
- package/dist/mjs/src/math/lib.mjs +0 -7
- package/dist/mjs/src/math/polynomial/QuadraticBezier.d.ts +0 -28
- package/dist/mjs/src/math/polynomial/QuadraticBezier.mjs +0 -108
- package/dist/mjs/src/math/polynomial/solveQuadratic.d.ts +0 -6
- package/dist/mjs/src/math/polynomial/solveQuadratic.mjs +0 -34
- package/dist/mjs/src/math/rounding.mjs +0 -128
- package/dist/mjs/src/rendering/Display.mjs +0 -206
- package/dist/mjs/src/rendering/RenderingStyle.d.ts +0 -31
- package/dist/mjs/src/rendering/RenderingStyle.mjs +0 -38
- package/dist/mjs/src/rendering/TextRenderingStyle.d.ts +0 -36
- package/dist/mjs/src/rendering/TextRenderingStyle.mjs +0 -23
- package/dist/mjs/src/rendering/caching/CacheRecord.d.ts +0 -20
- package/dist/mjs/src/rendering/caching/CacheRecord.mjs +0 -55
- package/dist/mjs/src/rendering/caching/CacheRecordManager.d.ts +0 -12
- package/dist/mjs/src/rendering/caching/CacheRecordManager.mjs +0 -43
- package/dist/mjs/src/rendering/caching/RenderingCache.mjs +0 -45
- package/dist/mjs/src/rendering/caching/RenderingCacheNode.d.ts +0 -29
- package/dist/mjs/src/rendering/caching/RenderingCacheNode.mjs +0 -320
- package/dist/mjs/src/rendering/caching/testUtils.mjs +0 -20
- package/dist/mjs/src/rendering/localization.mjs +0 -9
- package/dist/mjs/src/rendering/renderers/AbstractRenderer.d.ts +0 -85
- package/dist/mjs/src/rendering/renderers/AbstractRenderer.mjs +0 -162
- package/dist/mjs/src/rendering/renderers/CanvasRenderer.d.ts +0 -63
- package/dist/mjs/src/rendering/renderers/CanvasRenderer.mjs +0 -237
- package/dist/mjs/src/rendering/renderers/DummyRenderer.d.ts +0 -35
- package/dist/mjs/src/rendering/renderers/DummyRenderer.mjs +0 -106
- package/dist/mjs/src/rendering/renderers/SVGRenderer.d.ts +0 -57
- package/dist/mjs/src/rendering/renderers/SVGRenderer.mjs +0 -313
- package/dist/mjs/src/rendering/renderers/TextOnlyRenderer.d.ts +0 -29
- package/dist/mjs/src/rendering/renderers/TextOnlyRenderer.mjs +0 -57
- package/dist/mjs/src/testing/beforeEachFile.mjs +0 -7
- package/dist/mjs/src/testing/createEditor.mjs +0 -9
- package/dist/mjs/src/testing/loadExpectExtensions.d.ts +0 -2
- package/dist/mjs/src/testing/loadExpectExtensions.mjs +0 -24
- package/dist/mjs/src/testing/sendPenEvent.mjs +0 -19
- package/dist/mjs/src/testing/sendTouchEvent.mjs +0 -62
- package/dist/mjs/src/toolbar/HTMLToolbar.mjs +0 -443
- package/dist/mjs/src/toolbar/IconProvider.mjs +0 -654
- package/dist/mjs/src/toolbar/localization.d.ts +0 -51
- package/dist/mjs/src/toolbar/localization.mjs +0 -50
- package/dist/mjs/src/toolbar/makeColorInput.mjs +0 -121
- package/dist/mjs/src/toolbar/widgets/ActionButtonWidget.mjs +0 -25
- package/dist/mjs/src/toolbar/widgets/BaseToolWidget.mjs +0 -43
- package/dist/mjs/src/toolbar/widgets/BaseWidget.mjs +0 -345
- package/dist/mjs/src/toolbar/widgets/DocumentPropertiesWidget.mjs +0 -173
- package/dist/mjs/src/toolbar/widgets/EraserToolWidget.mjs +0 -58
- package/dist/mjs/src/toolbar/widgets/HandToolWidget.mjs +0 -172
- package/dist/mjs/src/toolbar/widgets/InsertImageWidget.mjs +0 -171
- package/dist/mjs/src/toolbar/widgets/OverflowWidget.mjs +0 -71
- package/dist/mjs/src/toolbar/widgets/PenToolWidget.mjs +0 -221
- package/dist/mjs/src/toolbar/widgets/SelectionToolWidget.mjs +0 -147
- package/dist/mjs/src/toolbar/widgets/TextToolWidget.mjs +0 -110
- package/dist/mjs/src/tools/BaseTool.mjs +0 -63
- package/dist/mjs/src/tools/Eraser.d.ts +0 -23
- package/dist/mjs/src/tools/Eraser.mjs +0 -106
- package/dist/mjs/src/tools/FindTool.d.ts +0 -21
- package/dist/mjs/src/tools/FindTool.mjs +0 -114
- package/dist/mjs/src/tools/PanZoom.d.ts +0 -52
- package/dist/mjs/src/tools/PanZoom.mjs +0 -414
- package/dist/mjs/src/tools/PasteHandler.mjs +0 -93
- package/dist/mjs/src/tools/Pen.d.ts +0 -43
- package/dist/mjs/src/tools/Pen.mjs +0 -196
- package/dist/mjs/src/tools/PipetteTool.mjs +0 -39
- package/dist/mjs/src/tools/SelectionTool/SelectAllShortcutHandler.d.ts +0 -8
- package/dist/mjs/src/tools/SelectionTool/SelectAllShortcutHandler.mjs +0 -22
- package/dist/mjs/src/tools/SelectionTool/Selection.d.ts +0 -64
- package/dist/mjs/src/tools/SelectionTool/Selection.mjs +0 -463
- package/dist/mjs/src/tools/SelectionTool/SelectionHandle.mjs +0 -81
- package/dist/mjs/src/tools/SelectionTool/SelectionTool.d.ts +0 -37
- package/dist/mjs/src/tools/SelectionTool/SelectionTool.mjs +0 -407
- package/dist/mjs/src/tools/SelectionTool/TransformMode.mjs +0 -98
- package/dist/mjs/src/tools/SoundUITool.mjs +0 -158
- package/dist/mjs/src/tools/TextTool.d.ts +0 -33
- package/dist/mjs/src/tools/TextTool.mjs +0 -256
- package/dist/mjs/src/tools/ToolController.mjs +0 -163
- package/dist/mjs/src/tools/ToolEnabledGroup.mjs +0 -11
- package/dist/mjs/src/tools/ToolSwitcherShortcut.mjs +0 -32
- package/dist/mjs/src/tools/ToolbarShortcutHandler.mjs +0 -23
- package/dist/mjs/src/tools/UndoRedoShortcut.d.ts +0 -8
- package/dist/mjs/src/tools/UndoRedoShortcut.mjs +0 -22
- package/dist/mjs/src/tools/localization.mjs +0 -30
- package/dist/mjs/src/types.d.ts +0 -153
- package/dist/mjs/src/util/assertions.mjs +0 -45
- package/dist/mjs/src/util/fileToBase64.mjs +0 -13
- package/dist/mjs/src/util/untilNextAnimationFrame.mjs +0 -7
- package/dist/mjs/src/util/waitForAll.mjs +0 -15
- package/dist/mjs/src/util/waitForTimeout.mjs +0 -7
- package/firebase.json +0 -16
- package/jest.config.js +0 -29
- package/lint-staged.config.js +0 -6
- package/tsconfig-typedoc.json +0 -7
- package/tsconfig.mjs.json +0 -9
- package/typedoc.json +0 -25
- /package/dist/cjs/{src/Color4.d.ts → Color4.d.ts} +0 -0
- /package/dist/cjs/{src/testing/beforeEachFile.d.ts → Color4.test.d.ts} +0 -0
- /package/dist/{mjs/src/components/builders/types.mjs → cjs/Editor.loadFrom.test.d.ts} +0 -0
- /package/dist/{mjs/src/rendering/caching/types.mjs → cjs/Editor.toSVG.test.d.ts} +0 -0
- /package/dist/{mjs/src/testing/beforeEachFile.d.ts → cjs/EditorImage.test.d.ts} +0 -0
- /package/dist/{mjs/src/toolbar/types.mjs → cjs/EventDispatcher.test.d.ts} +0 -0
- /package/dist/cjs/{src/UndoRedoHistory.d.ts → UndoRedoHistory.d.ts} +0 -0
- /package/dist/cjs/{src/bundle → bundle}/bundled.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/Command.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/Duplicate.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/Erase.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/SerializableCommand.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/UnresolvedCommand.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/invertCommand.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/lib.d.ts +0 -0
- /package/dist/cjs/{src/commands → commands}/uniteCommands.d.ts +0 -0
- /package/dist/cjs/{src/components → components}/RestylableComponent.d.ts +0 -0
- /package/dist/cjs/{src/components → components}/builders/types.js +0 -0
- /package/dist/cjs/{src/components → components}/localization.d.ts +0 -0
- /package/dist/cjs/{src/localization.d.ts → localization.d.ts} +0 -0
- /package/dist/cjs/{src/localizations → localizations}/de.d.ts +0 -0
- /package/dist/cjs/{src/localizations → localizations}/en.d.ts +0 -0
- /package/dist/cjs/{src/localizations → localizations}/es.d.ts +0 -0
- /package/dist/cjs/{src/math → math}/Vec2.d.ts +0 -0
- /package/dist/cjs/{src/math → math}/Vec3.d.ts +0 -0
- /package/dist/cjs/{src/math → math}/rounding.d.ts +0 -0
- /package/dist/cjs/{src/rendering → rendering}/Display.d.ts +0 -0
- /package/dist/cjs/{src/rendering → rendering}/caching/RenderingCache.d.ts +0 -0
- /package/dist/cjs/{src/rendering → rendering}/caching/testUtils.d.ts +0 -0
- /package/dist/cjs/{src/rendering → rendering}/caching/types.d.ts +0 -0
- /package/dist/cjs/{src/rendering → rendering}/caching/types.js +0 -0
- /package/dist/cjs/{src/rendering → rendering}/lib.d.ts +0 -0
- /package/dist/cjs/{src/rendering → rendering}/localization.d.ts +0 -0
- /package/dist/cjs/{src/testing → testing}/createEditor.d.ts +0 -0
- /package/dist/cjs/{src/testing → testing}/lib.d.ts +0 -0
- /package/dist/cjs/{src/testing → testing}/sendPenEvent.d.ts +0 -0
- /package/dist/cjs/{src/testing → testing}/sendTouchEvent.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/HTMLToolbar.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/IconProvider.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/lib.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/makeColorInput.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/types.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/types.js +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/ActionButtonWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/BaseToolWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/BaseWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/DocumentPropertiesWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/EraserToolWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/HandToolWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/InsertImageWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/OverflowWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/PenToolWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/SelectionToolWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/TextToolWidget.d.ts +0 -0
- /package/dist/cjs/{src/toolbar → toolbar}/widgets/lib.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/BaseTool.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/PasteHandler.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/PipetteTool.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/SelectionTool/SelectionHandle.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/SelectionTool/TransformMode.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/SelectionTool/types.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/SoundUITool.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/ToolController.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/ToolEnabledGroup.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/ToolSwitcherShortcut.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/ToolbarShortcutHandler.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/lib.d.ts +0 -0
- /package/dist/cjs/{src/tools → tools}/localization.d.ts +0 -0
- /package/dist/cjs/{src/util → util}/assertions.d.ts +0 -0
- /package/dist/cjs/{src/util → util}/fileToBase64.d.ts +0 -0
- /package/dist/cjs/{src/util → util}/untilNextAnimationFrame.d.ts +0 -0
- /package/dist/cjs/{src/util → util}/waitForAll.d.ts +0 -0
- /package/dist/cjs/{src/util → util}/waitForTimeout.d.ts +0 -0
- /package/dist/mjs/{src/Color4.d.ts → Color4.d.ts} +0 -0
- /package/dist/mjs/{src/UndoRedoHistory.d.ts → UndoRedoHistory.d.ts} +0 -0
- /package/dist/mjs/{src/bundle → bundle}/bundled.d.ts +0 -0
- /package/dist/mjs/{src/bundle → bundle}/bundled.mjs +0 -0
- /package/dist/mjs/{src/commands → commands}/Command.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/Duplicate.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/Erase.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/SerializableCommand.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/UnresolvedCommand.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/invertCommand.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/lib.d.ts +0 -0
- /package/dist/mjs/{src/commands → commands}/lib.mjs +0 -0
- /package/dist/mjs/{src/commands → commands}/uniteCommands.d.ts +0 -0
- /package/dist/mjs/{src/components → components}/RestylableComponent.d.ts +0 -0
- /package/dist/mjs/{src/components → components}/localization.d.ts +0 -0
- /package/dist/mjs/{src/localization.d.ts → localization.d.ts} +0 -0
- /package/dist/mjs/{src/localizations → localizations}/de.d.ts +0 -0
- /package/dist/mjs/{src/localizations → localizations}/en.d.ts +0 -0
- /package/dist/mjs/{src/localizations → localizations}/es.d.ts +0 -0
- /package/dist/mjs/{src/math → math}/Vec2.d.ts +0 -0
- /package/dist/mjs/{src/math → math}/Vec3.d.ts +0 -0
- /package/dist/mjs/{src/math → math}/rounding.d.ts +0 -0
- /package/dist/mjs/{src/rendering → rendering}/Display.d.ts +0 -0
- /package/dist/mjs/{src/rendering → rendering}/caching/RenderingCache.d.ts +0 -0
- /package/dist/mjs/{src/rendering → rendering}/caching/testUtils.d.ts +0 -0
- /package/dist/mjs/{src/rendering → rendering}/caching/types.d.ts +0 -0
- /package/dist/mjs/{src/rendering → rendering}/lib.d.ts +0 -0
- /package/dist/mjs/{src/rendering → rendering}/lib.mjs +0 -0
- /package/dist/mjs/{src/rendering → rendering}/localization.d.ts +0 -0
- /package/dist/mjs/{src/testing → testing}/createEditor.d.ts +0 -0
- /package/dist/mjs/{src/testing → testing}/lib.d.ts +0 -0
- /package/dist/mjs/{src/testing → testing}/lib.mjs +0 -0
- /package/dist/mjs/{src/testing → testing}/sendPenEvent.d.ts +0 -0
- /package/dist/mjs/{src/testing → testing}/sendTouchEvent.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/HTMLToolbar.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/IconProvider.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/lib.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/lib.mjs +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/makeColorInput.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/types.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/ActionButtonWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/BaseToolWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/BaseWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/DocumentPropertiesWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/EraserToolWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/HandToolWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/InsertImageWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/OverflowWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/PenToolWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/SelectionToolWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/TextToolWidget.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/lib.d.ts +0 -0
- /package/dist/mjs/{src/toolbar → toolbar}/widgets/lib.mjs +0 -0
- /package/dist/mjs/{src/tools → tools}/BaseTool.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/PasteHandler.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/PipetteTool.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/SelectionTool/SelectionHandle.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/SelectionTool/TransformMode.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/SelectionTool/types.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/SelectionTool/types.mjs +0 -0
- /package/dist/mjs/{src/tools → tools}/SoundUITool.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/ToolController.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/ToolEnabledGroup.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/ToolSwitcherShortcut.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/ToolbarShortcutHandler.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/lib.d.ts +0 -0
- /package/dist/mjs/{src/tools → tools}/lib.mjs +0 -0
- /package/dist/mjs/{src/tools → tools}/localization.d.ts +0 -0
- /package/dist/mjs/{src/types.mjs → types.mjs} +0 -0
- /package/dist/mjs/{src/util → util}/assertions.d.ts +0 -0
- /package/dist/mjs/{src/util → util}/fileToBase64.d.ts +0 -0
- /package/dist/mjs/{src/util → util}/untilNextAnimationFrame.d.ts +0 -0
- /package/dist/mjs/{src/util → util}/waitForAll.d.ts +0 -0
- /package/dist/mjs/{src/util → util}/waitForTimeout.d.ts +0 -0
package/dist/mjs/src/Color4.mjs
DELETED
@@ -1,258 +0,0 @@
|
|
1
|
-
import Vec3 from './math/Vec3.mjs';
|
2
|
-
class Color4 {
|
3
|
-
constructor(
|
4
|
-
/** Red component. Should be in the range [0, 1]. */
|
5
|
-
r,
|
6
|
-
/** Green component. `g` ∈ [0, 1] */
|
7
|
-
g,
|
8
|
-
/** Blue component. `b` ∈ [0, 1] */
|
9
|
-
b,
|
10
|
-
/** Alpha/transparent component. `a` ∈ [0, 1]. 0 = transparent */
|
11
|
-
a) {
|
12
|
-
this.r = r;
|
13
|
-
this.g = g;
|
14
|
-
this.b = b;
|
15
|
-
this.a = a;
|
16
|
-
this.hexString = null;
|
17
|
-
}
|
18
|
-
/**
|
19
|
-
* Create a color from red, green, blue components. The color is fully opaque (`a = 1.0`).
|
20
|
-
*
|
21
|
-
* Each component should be in the range [0, 1].
|
22
|
-
*/
|
23
|
-
static ofRGB(red, green, blue) {
|
24
|
-
return Color4.ofRGBA(red, green, blue, 1.0);
|
25
|
-
}
|
26
|
-
static ofRGBA(red, green, blue, alpha) {
|
27
|
-
red = Math.max(0, Math.min(red, 1));
|
28
|
-
green = Math.max(0, Math.min(green, 1));
|
29
|
-
blue = Math.max(0, Math.min(blue, 1));
|
30
|
-
alpha = Math.max(0, Math.min(alpha, 1));
|
31
|
-
return new Color4(red, green, blue, alpha);
|
32
|
-
}
|
33
|
-
static fromHex(hexString) {
|
34
|
-
var _a;
|
35
|
-
// Remove starting '#' (if present)
|
36
|
-
hexString = ((_a = hexString.match(/^[#]?(.*)$/)) !== null && _a !== void 0 ? _a : [])[1];
|
37
|
-
hexString = hexString.toUpperCase();
|
38
|
-
if (!hexString.match(/^[0-9A-F]+$/)) {
|
39
|
-
throw new Error(`${hexString} is not in a valid format.`);
|
40
|
-
}
|
41
|
-
// RGBA or RGB
|
42
|
-
if (hexString.length === 3 || hexString.length === 4) {
|
43
|
-
// Each character is a component
|
44
|
-
const components = hexString.split('');
|
45
|
-
// Convert to RRGGBBAA or RRGGBB format
|
46
|
-
hexString = components.map(component => `${component}0`).join('');
|
47
|
-
}
|
48
|
-
if (hexString.length === 6) {
|
49
|
-
// Alpha component
|
50
|
-
hexString += 'FF';
|
51
|
-
}
|
52
|
-
const components = [];
|
53
|
-
for (let i = 2; i <= hexString.length; i += 2) {
|
54
|
-
const chunk = hexString.substring(i - 2, i);
|
55
|
-
components.push(parseInt(chunk, 16) / 255);
|
56
|
-
}
|
57
|
-
if (components.length !== 4) {
|
58
|
-
throw new Error(`Unable to parse ${hexString}: Wrong number of components.`);
|
59
|
-
}
|
60
|
-
return Color4.ofRGBA(components[0], components[1], components[2], components[3]);
|
61
|
-
}
|
62
|
-
/** Like fromHex, but can handle additional colors if an `HTMLCanvasElement` is available. */
|
63
|
-
static fromString(text) {
|
64
|
-
if (text.startsWith('#')) {
|
65
|
-
return Color4.fromHex(text);
|
66
|
-
}
|
67
|
-
if (text === 'none' || text === 'transparent') {
|
68
|
-
return Color4.transparent;
|
69
|
-
}
|
70
|
-
// rgba?: Match both rgb and rgba strings.
|
71
|
-
// ([,0-9.]+): Match any string of only numeric, '.' and ',' characters.
|
72
|
-
const rgbRegex = /^rgba?\(([,0-9.]+)\)$/i;
|
73
|
-
const rgbMatch = text.replace(/\s*/g, '').match(rgbRegex);
|
74
|
-
if (rgbMatch) {
|
75
|
-
const componentsListStr = rgbMatch[1];
|
76
|
-
const componentsList = JSON.parse(`[ ${componentsListStr} ]`);
|
77
|
-
if (componentsList.length === 3) {
|
78
|
-
return Color4.ofRGB(componentsList[0] / 255, componentsList[1] / 255, componentsList[2] / 255);
|
79
|
-
}
|
80
|
-
else if (componentsList.length === 4) {
|
81
|
-
return Color4.ofRGBA(componentsList[0] / 255, componentsList[1] / 255, componentsList[2] / 255, componentsList[3]);
|
82
|
-
}
|
83
|
-
else {
|
84
|
-
throw new Error(`RGB string, ${text}, has wrong number of components: ${componentsList.length}`);
|
85
|
-
}
|
86
|
-
}
|
87
|
-
// Otherwise, try to use an HTMLCanvasElement to determine the color.
|
88
|
-
// Note: We may be unable to create an HTMLCanvasElement if running as a unit test.
|
89
|
-
const canvas = document.createElement('canvas');
|
90
|
-
canvas.width = 1;
|
91
|
-
canvas.height = 1;
|
92
|
-
const ctx = canvas.getContext('2d');
|
93
|
-
ctx.fillStyle = text;
|
94
|
-
ctx.fillRect(0, 0, 1, 1);
|
95
|
-
const data = ctx.getImageData(0, 0, 1, 1);
|
96
|
-
const red = data.data[0] / 255;
|
97
|
-
const green = data.data[1] / 255;
|
98
|
-
const blue = data.data[2] / 255;
|
99
|
-
const alpha = data.data[3] / 255;
|
100
|
-
return Color4.ofRGBA(red, green, blue, alpha);
|
101
|
-
}
|
102
|
-
/** @returns true if `this` and `other` are approximately equal. */
|
103
|
-
eq(other) {
|
104
|
-
if (other == null) {
|
105
|
-
return false;
|
106
|
-
}
|
107
|
-
// If both completely transparent,
|
108
|
-
if (this.a === 0 && other.a === 0) {
|
109
|
-
return true;
|
110
|
-
}
|
111
|
-
return this.toHexString() === other.toHexString();
|
112
|
-
}
|
113
|
-
/**
|
114
|
-
* If `fractionTo` is not in the range [0, 1], it will be clamped to the nearest number
|
115
|
-
* in that range. For example, `a.mix(b, -1)` is equivalent to `a.mix(b, 0)`.
|
116
|
-
*
|
117
|
-
* @returns a color `fractionTo` of the way from this color to `other`.
|
118
|
-
*
|
119
|
-
* @example
|
120
|
-
* ```ts
|
121
|
-
* Color4.ofRGB(1, 0, 0).mix(Color4.ofRGB(0, 1, 0), 0.1) // -> Color4(0.9, 0.1, 0)
|
122
|
-
* ```
|
123
|
-
*/
|
124
|
-
mix(other, fractionTo) {
|
125
|
-
fractionTo = Math.min(Math.max(fractionTo, 0), 1);
|
126
|
-
const fractionOfThis = 1 - fractionTo;
|
127
|
-
return new Color4(this.r * fractionOfThis + other.r * fractionTo, this.g * fractionOfThis + other.g * fractionTo, this.b * fractionOfThis + other.b * fractionTo, this.a * fractionOfThis + other.a * fractionTo);
|
128
|
-
}
|
129
|
-
/**
|
130
|
-
* @returns the component-wise average of `colors`, or `Color4.transparent` if `colors` is empty.
|
131
|
-
*/
|
132
|
-
static average(colors) {
|
133
|
-
let averageA = 0;
|
134
|
-
let averageR = 0;
|
135
|
-
let averageG = 0;
|
136
|
-
let averageB = 0;
|
137
|
-
for (const color of colors) {
|
138
|
-
averageA += color.a;
|
139
|
-
averageR += color.r;
|
140
|
-
averageG += color.g;
|
141
|
-
averageB += color.b;
|
142
|
-
}
|
143
|
-
if (colors.length > 0) {
|
144
|
-
averageA /= colors.length;
|
145
|
-
averageR /= colors.length;
|
146
|
-
averageG /= colors.length;
|
147
|
-
averageB /= colors.length;
|
148
|
-
}
|
149
|
-
return new Color4(averageR, averageG, averageB, averageA);
|
150
|
-
}
|
151
|
-
/**
|
152
|
-
* Converts to (hue, saturation, value).
|
153
|
-
* See also https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
154
|
-
*
|
155
|
-
* The resultant hue is represented in radians and is thus in [0, 2pi].
|
156
|
-
*/
|
157
|
-
asHSV() {
|
158
|
-
// Ref: https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
159
|
-
//
|
160
|
-
// HUE:
|
161
|
-
// First, consider the unit cube. Rotate it such that one vertex is at the origin
|
162
|
-
// of a plane and its three neighboring vertices are equidistant from that plane:
|
163
|
-
//
|
164
|
-
// /\
|
165
|
-
// / | \
|
166
|
-
// 2 / 3 \ 1
|
167
|
-
// \ | /
|
168
|
-
// \ | /
|
169
|
-
// . \/ .
|
170
|
-
//
|
171
|
-
// .
|
172
|
-
//
|
173
|
-
// Let z be up and (x, y, 0) be in the plane.
|
174
|
-
//
|
175
|
-
// Label vectors 1,2,3 with R, G, and B, respectively. Let R's projection into the plane
|
176
|
-
// lie along the x axis.
|
177
|
-
//
|
178
|
-
// Because R is a unit vector and R, G, B are equidistant from the plane, they must
|
179
|
-
// form 30-60-90 triangles, which have side lengths proportional to (1, √3, 2)
|
180
|
-
//
|
181
|
-
// /|
|
182
|
-
// 1/ | (√3)/2
|
183
|
-
// / |
|
184
|
-
// 1/2
|
185
|
-
//
|
186
|
-
const minComponent = Math.min(this.r, this.g, this.b);
|
187
|
-
const maxComponent = Math.max(this.r, this.g, this.b);
|
188
|
-
const chroma = maxComponent - minComponent;
|
189
|
-
let hue;
|
190
|
-
// See https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
191
|
-
if (chroma === 0) {
|
192
|
-
hue = 0;
|
193
|
-
}
|
194
|
-
else if (this.r >= this.g && this.r >= this.b) {
|
195
|
-
hue = ((this.g - this.b) / chroma) % 6;
|
196
|
-
}
|
197
|
-
else if (this.g >= this.r && this.g >= this.b) {
|
198
|
-
hue = (this.b - this.r) / chroma + 2;
|
199
|
-
}
|
200
|
-
else {
|
201
|
-
hue = (this.r - this.g) / chroma + 4;
|
202
|
-
}
|
203
|
-
// Convert to degree representation, then to radians.
|
204
|
-
hue *= 60;
|
205
|
-
hue *= Math.PI / 180;
|
206
|
-
// Ensure positivity.
|
207
|
-
if (hue < 0) {
|
208
|
-
hue += Math.PI * 2;
|
209
|
-
}
|
210
|
-
const value = maxComponent;
|
211
|
-
const saturation = value > 0 ? chroma / value : 0;
|
212
|
-
return Vec3.of(hue, saturation, value);
|
213
|
-
}
|
214
|
-
/**
|
215
|
-
* @returns a hexadecimal color string representation of `this`, in the form `#rrggbbaa`.
|
216
|
-
*
|
217
|
-
* @example
|
218
|
-
* ```
|
219
|
-
* Color4.red.toHexString(); // -> #ff0000ff
|
220
|
-
* ```
|
221
|
-
*/
|
222
|
-
toHexString() {
|
223
|
-
if (this.hexString) {
|
224
|
-
return this.hexString;
|
225
|
-
}
|
226
|
-
const componentToHex = (component) => {
|
227
|
-
const res = Math.round(255 * component).toString(16);
|
228
|
-
if (res.length === 1) {
|
229
|
-
return `0${res}`;
|
230
|
-
}
|
231
|
-
return res;
|
232
|
-
};
|
233
|
-
const alpha = componentToHex(this.a);
|
234
|
-
const red = componentToHex(this.r);
|
235
|
-
const green = componentToHex(this.g);
|
236
|
-
const blue = componentToHex(this.b);
|
237
|
-
if (alpha === 'ff') {
|
238
|
-
return `#${red}${green}${blue}`;
|
239
|
-
}
|
240
|
-
this.hexString = `#${red}${green}${blue}${alpha}`;
|
241
|
-
return this.hexString;
|
242
|
-
}
|
243
|
-
toString() {
|
244
|
-
return this.toHexString();
|
245
|
-
}
|
246
|
-
}
|
247
|
-
Color4.transparent = Color4.ofRGBA(0, 0, 0, 0);
|
248
|
-
Color4.red = Color4.ofRGB(1.0, 0.0, 0.0);
|
249
|
-
Color4.green = Color4.ofRGB(0.0, 1.0, 0.0);
|
250
|
-
Color4.blue = Color4.ofRGB(0.0, 0.0, 1.0);
|
251
|
-
Color4.purple = Color4.ofRGB(0.5, 0.2, 0.5);
|
252
|
-
Color4.yellow = Color4.ofRGB(1, 1, 0.1);
|
253
|
-
Color4.clay = Color4.ofRGB(0.8, 0.4, 0.2);
|
254
|
-
Color4.black = Color4.ofRGB(0, 0, 0);
|
255
|
-
Color4.gray = Color4.ofRGB(0.5, 0.5, 0.5);
|
256
|
-
Color4.white = Color4.ofRGB(1, 1, 1);
|
257
|
-
export default Color4;
|
258
|
-
export { Color4 };
|
package/dist/mjs/src/Editor.d.ts
DELETED
@@ -1,309 +0,0 @@
|
|
1
|
-
import EditorImage from './EditorImage';
|
2
|
-
import ToolController from './tools/ToolController';
|
3
|
-
import { InputEvtType, EditorNotifier, ImageLoader, HTMLPointerEventFilter } from './types';
|
4
|
-
import Command from './commands/Command';
|
5
|
-
import UndoRedoHistory from './UndoRedoHistory';
|
6
|
-
import Viewport from './Viewport';
|
7
|
-
import { Point2 } from './math/Vec2';
|
8
|
-
import HTMLToolbar from './toolbar/HTMLToolbar';
|
9
|
-
import { RenderablePathSpec } from './rendering/renderers/AbstractRenderer';
|
10
|
-
import Display, { RenderingMode } from './rendering/Display';
|
11
|
-
import Color4 from './Color4';
|
12
|
-
import Pointer from './Pointer';
|
13
|
-
import Rect2 from './math/Rect2';
|
14
|
-
import { EditorLocalization } from './localization';
|
15
|
-
import IconProvider from './toolbar/IconProvider';
|
16
|
-
import AbstractComponent from './components/AbstractComponent';
|
17
|
-
export interface EditorSettings {
|
18
|
-
/** Defaults to `RenderingMode.CanvasRenderer` */
|
19
|
-
renderingMode: RenderingMode;
|
20
|
-
/** Uses a default English localization if a translation is not given. */
|
21
|
-
localization: Partial<EditorLocalization>;
|
22
|
-
/**
|
23
|
-
* `true` if touchpad/mousewheel scrolling should scroll the editor instead of the document.
|
24
|
-
* This does not include pinch-zoom events.
|
25
|
-
* Defaults to true.
|
26
|
-
*/
|
27
|
-
wheelEventsEnabled: boolean | 'only-if-focused';
|
28
|
-
/** Minimum zoom fraction (e.g. 0.5 → 50% zoom). */
|
29
|
-
minZoom: number;
|
30
|
-
maxZoom: number;
|
31
|
-
iconProvider: IconProvider;
|
32
|
-
}
|
33
|
-
/**
|
34
|
-
* The main entrypoint for the full editor.
|
35
|
-
*
|
36
|
-
* @example
|
37
|
-
* To create an editor with a toolbar,
|
38
|
-
* ```
|
39
|
-
* const editor = new Editor(document.body);
|
40
|
-
*
|
41
|
-
* const toolbar = editor.addToolbar();
|
42
|
-
* toolbar.addActionButton('Save', () => {
|
43
|
-
* const saveData = editor.toSVG().outerHTML;
|
44
|
-
* // Do something with saveData...
|
45
|
-
* });
|
46
|
-
* ```
|
47
|
-
*
|
48
|
-
* See also
|
49
|
-
* [`docs/example/example.ts`](https://github.com/personalizedrefrigerator/js-draw/blob/main/docs/example/example.ts#L15).
|
50
|
-
*/
|
51
|
-
export declare class Editor {
|
52
|
-
private container;
|
53
|
-
private renderingRegion;
|
54
|
-
/** Manages drawing surfaces/{@link AbstractRenderer}s. */
|
55
|
-
display: Display;
|
56
|
-
/**
|
57
|
-
* Handles undo/redo.
|
58
|
-
*
|
59
|
-
* @example
|
60
|
-
* ```
|
61
|
-
* const editor = new Editor(document.body);
|
62
|
-
*
|
63
|
-
* // Do something undoable.
|
64
|
-
* // ...
|
65
|
-
*
|
66
|
-
* // Undo the last action
|
67
|
-
* editor.history.undo();
|
68
|
-
* ```
|
69
|
-
*/
|
70
|
-
history: UndoRedoHistory;
|
71
|
-
/**
|
72
|
-
* Data structure for adding/removing/querying objects in the image.
|
73
|
-
*
|
74
|
-
* @example
|
75
|
-
* ```
|
76
|
-
* const editor = new Editor(document.body);
|
77
|
-
*
|
78
|
-
* // Create a path.
|
79
|
-
* const stroke = new Stroke([
|
80
|
-
* Path.fromString('M0,0 L30,30 z').toRenderable({ fill: Color4.black }),
|
81
|
-
* ]);
|
82
|
-
* const addElementCommand = editor.image.addElement(stroke);
|
83
|
-
*
|
84
|
-
* // Add the stroke to the editor
|
85
|
-
* editor.dispatch(addElementCommand);
|
86
|
-
* ```
|
87
|
-
*/
|
88
|
-
readonly image: EditorImage;
|
89
|
-
/**
|
90
|
-
* Allows transforming the view and querying information about
|
91
|
-
* what is currently visible.
|
92
|
-
*/
|
93
|
-
readonly viewport: Viewport;
|
94
|
-
/** @internal */
|
95
|
-
readonly localization: EditorLocalization;
|
96
|
-
/** {@link EditorSettings.iconProvider} */
|
97
|
-
readonly icons: IconProvider;
|
98
|
-
/**
|
99
|
-
* Controls the list of tools. See
|
100
|
-
* [the custom tool example](https://github.com/personalizedrefrigerator/js-draw/tree/main/docs/example-custom-tools)
|
101
|
-
* for more.
|
102
|
-
*/
|
103
|
-
readonly toolController: ToolController;
|
104
|
-
/**
|
105
|
-
* Global event dispatcher/subscriber.
|
106
|
-
*/
|
107
|
-
readonly notifier: EditorNotifier;
|
108
|
-
private loadingWarning;
|
109
|
-
private accessibilityAnnounceArea;
|
110
|
-
private accessibilityControlArea;
|
111
|
-
private eventListenerTargets;
|
112
|
-
private settings;
|
113
|
-
/**
|
114
|
-
* @example
|
115
|
-
* ```
|
116
|
-
* const container = document.body;
|
117
|
-
*
|
118
|
-
* // Create an editor
|
119
|
-
* const editor = new Editor(container, {
|
120
|
-
* // 2e-10 and 1e12 are the default values for minimum/maximum zoom.
|
121
|
-
* minZoom: 2e-10,
|
122
|
-
* maxZoom: 1e12,
|
123
|
-
* });
|
124
|
-
*
|
125
|
-
* // Add the default toolbar
|
126
|
-
* const toolbar = editor.addToolbar();
|
127
|
-
*
|
128
|
-
* // Add a save button
|
129
|
-
* toolbar.addActionButton({
|
130
|
-
* label: 'Save'
|
131
|
-
* icon: createSaveIcon(),
|
132
|
-
* }, () => {
|
133
|
-
* const saveData = editor.toSVG().outerHTML;
|
134
|
-
* // Do something with saveData
|
135
|
-
* });
|
136
|
-
* ```
|
137
|
-
*/
|
138
|
-
constructor(parent: HTMLElement, settings?: Partial<EditorSettings>);
|
139
|
-
/**
|
140
|
-
* @returns a reference to the editor's container.
|
141
|
-
*
|
142
|
-
* @example
|
143
|
-
* ```
|
144
|
-
* // Set the editor's height to 500px
|
145
|
-
* editor.getRootElement().style.height = '500px';
|
146
|
-
* ```
|
147
|
-
*/
|
148
|
-
getRootElement(): HTMLElement;
|
149
|
-
/** @param fractionLoaded - should be a number from 0 to 1, where 1 represents completely loaded. */
|
150
|
-
showLoadingWarning(fractionLoaded: number): void;
|
151
|
-
hideLoadingWarning(): void;
|
152
|
-
private previousAccessibilityAnnouncement;
|
153
|
-
/**
|
154
|
-
* Announce `message` for screen readers. If `message` is the same as the previous
|
155
|
-
* message, it is re-announced.
|
156
|
-
*/
|
157
|
-
announceForAccessibility(message: string): void;
|
158
|
-
/**
|
159
|
-
* Creates a toolbar. If `defaultLayout` is true, default buttons are used.
|
160
|
-
* @returns a reference to the toolbar.
|
161
|
-
*/
|
162
|
-
addToolbar(defaultLayout?: boolean): HTMLToolbar;
|
163
|
-
private registerListeners;
|
164
|
-
private pointers;
|
165
|
-
private getPointerList;
|
166
|
-
/**
|
167
|
-
* Dispatches a `PointerEvent` to the editor. The target element for `evt` must have the same top left
|
168
|
-
* as the content of the editor.
|
169
|
-
*/
|
170
|
-
handleHTMLPointerEvent(eventType: 'pointerdown' | 'pointermove' | 'pointerup' | 'pointercancel', evt: PointerEvent): boolean;
|
171
|
-
private isEventSink;
|
172
|
-
private handlePaste;
|
173
|
-
/**
|
174
|
-
* Forward pointer events from `elem` to this editor. Such that right-click/right-click drag
|
175
|
-
* events are also forwarded, `elem`'s contextmenu is disabled.
|
176
|
-
*
|
177
|
-
* @example
|
178
|
-
* ```ts
|
179
|
-
* const overlay = document.createElement('div');
|
180
|
-
* editor.createHTMLOverlay(overlay);
|
181
|
-
*
|
182
|
-
* // Send all pointer events that don't have the control key pressed
|
183
|
-
* // to the editor.
|
184
|
-
* editor.handlePointerEventsFrom(overlay, (event) => {
|
185
|
-
* if (event.ctrlKey) {
|
186
|
-
* return false;
|
187
|
-
* }
|
188
|
-
* return true;
|
189
|
-
* });
|
190
|
-
* ```
|
191
|
-
*/
|
192
|
-
handlePointerEventsFrom(elem: HTMLElement, filter?: HTMLPointerEventFilter): {
|
193
|
-
/** Remove all event listeners registered by this function. */
|
194
|
-
remove: () => void;
|
195
|
-
};
|
196
|
-
/** Adds event listners for keypresses to `elem` and forwards those events to the editor. */
|
197
|
-
handleKeyEventsFrom(elem: HTMLElement): void;
|
198
|
-
/** `apply` a command. `command` will be announced for accessibility. */
|
199
|
-
dispatch(command: Command, addToHistory?: boolean): void | Promise<void>;
|
200
|
-
/**
|
201
|
-
* Dispatches a command without announcing it. By default, does not add to history.
|
202
|
-
* Use this to show finalized commands that don't need to have `announceForAccessibility`
|
203
|
-
* called.
|
204
|
-
*
|
205
|
-
* Prefer `command.apply(editor)` for incomplete commands. `dispatchNoAnnounce` may allow
|
206
|
-
* clients to listen for the application of commands (e.g. `SerializableCommand`s so they can
|
207
|
-
* be sent across the network), while `apply` does not.
|
208
|
-
*
|
209
|
-
* @example
|
210
|
-
* ```
|
211
|
-
* const addToHistory = false;
|
212
|
-
* editor.dispatchNoAnnounce(editor.viewport.zoomTo(someRectangle), addToHistory);
|
213
|
-
* ```
|
214
|
-
*/
|
215
|
-
dispatchNoAnnounce(command: Command, addToHistory?: boolean): void | Promise<void>;
|
216
|
-
/**
|
217
|
-
* Apply a large transformation in chunks.
|
218
|
-
* If `apply` is `false`, the commands are unapplied.
|
219
|
-
* Triggers a re-render after each `updateChunkSize`-sized group of commands
|
220
|
-
* has been applied.
|
221
|
-
*/
|
222
|
-
asyncApplyOrUnapplyCommands(commands: Command[], apply: boolean, updateChunkSize: number): Promise<void>;
|
223
|
-
asyncApplyCommands(commands: Command[], chunkSize: number): Promise<void>;
|
224
|
-
asyncUnapplyCommands(commands: Command[], chunkSize: number, unapplyInReverseOrder?: boolean): Promise<void>;
|
225
|
-
private announceUndoCallback;
|
226
|
-
private announceRedoCallback;
|
227
|
-
private nextRerenderListeners;
|
228
|
-
private rerenderQueued;
|
229
|
-
/**
|
230
|
-
* Schedule a re-render for some time in the near future. Does not schedule an additional
|
231
|
-
* re-render if a re-render is already queued.
|
232
|
-
*
|
233
|
-
* @returns a promise that resolves when re-rendering has completed.
|
234
|
-
*/
|
235
|
-
queueRerender(): Promise<void>;
|
236
|
-
isRerenderQueued(): boolean;
|
237
|
-
/**
|
238
|
-
* Re-renders the entire image.
|
239
|
-
*
|
240
|
-
* @see {@link Editor.queueRerender}
|
241
|
-
*/
|
242
|
-
rerender(showImageBounds?: boolean): void;
|
243
|
-
/**
|
244
|
-
* Draws the given path onto the wet ink renderer. The given path will
|
245
|
-
* be displayed on top of the main image.
|
246
|
-
*
|
247
|
-
* @see {@link Display.getWetInkRenderer} {@link Display.flatten}
|
248
|
-
*/
|
249
|
-
drawWetInk(...path: RenderablePathSpec[]): void;
|
250
|
-
/**
|
251
|
-
* Clears the wet ink display.
|
252
|
-
*
|
253
|
-
* @see {@link Display.getWetInkRenderer}
|
254
|
-
*/
|
255
|
-
clearWetInk(): void;
|
256
|
-
/**
|
257
|
-
* Focuses the region used for text input/key commands.
|
258
|
-
*/
|
259
|
-
focus(): void;
|
260
|
-
/**
|
261
|
-
* Creates an element that will be positioned on top of the dry/wet ink
|
262
|
-
* renderers.
|
263
|
-
*
|
264
|
-
* This is useful for displaying content on top of the rendered content
|
265
|
-
* (e.g. a selection box).
|
266
|
-
*/
|
267
|
-
createHTMLOverlay(overlay: HTMLElement): {
|
268
|
-
remove: () => void;
|
269
|
-
};
|
270
|
-
addStyleSheet(content: string): HTMLStyleElement;
|
271
|
-
sendKeyboardEvent(eventType: InputEvtType.KeyPressEvent | InputEvtType.KeyUpEvent, key: string, ctrlKey?: boolean, altKey?: boolean): void;
|
272
|
-
/**
|
273
|
-
* Dispatch a pen event to the currently selected tool.
|
274
|
-
* Intended primarially for unit tests.
|
275
|
-
*
|
276
|
-
* @deprecated
|
277
|
-
* @see {@link sendPenEvent} {@link sendTouchEvent}
|
278
|
-
*/
|
279
|
-
sendPenEvent(eventType: InputEvtType.PointerDownEvt | InputEvtType.PointerMoveEvt | InputEvtType.PointerUpEvt, point: Point2, allPointers?: Pointer[]): void;
|
280
|
-
addAndCenterComponents(components: AbstractComponent[], selectComponents?: boolean): Promise<void>;
|
281
|
-
toDataURL(format?: 'image/png' | 'image/jpeg' | 'image/webp'): string;
|
282
|
-
toSVG(): SVGElement;
|
283
|
-
/**
|
284
|
-
* Load editor data from an `ImageLoader` (e.g. an {@link SVGLoader}).
|
285
|
-
*
|
286
|
-
* @see loadFromSVG
|
287
|
-
*/
|
288
|
-
loadFrom(loader: ImageLoader): Promise<void>;
|
289
|
-
private getTopmostBackgroundComponent;
|
290
|
-
/**
|
291
|
-
* Set the background color of the image.
|
292
|
-
*/
|
293
|
-
setBackgroundColor(color: Color4): Command;
|
294
|
-
/**
|
295
|
-
* @returns the average of the colors of all background components. Use this to get the current background
|
296
|
-
* color.
|
297
|
-
*/
|
298
|
-
estimateBackgroundColor(): Color4;
|
299
|
-
getImportExportRect(): Rect2;
|
300
|
-
setImportExportRect(imageRect: Rect2): Command;
|
301
|
-
/**
|
302
|
-
* Alias for loadFrom(SVGLoader.fromString).
|
303
|
-
*
|
304
|
-
* This is particularly useful when accessing a bundled version of the editor,
|
305
|
-
* where `SVGLoader.fromString` is unavailable.
|
306
|
-
*/
|
307
|
-
loadFromSVG(svgData: string, sanitize?: boolean): Promise<void>;
|
308
|
-
}
|
309
|
-
export default Editor;
|