js-draw 0.17.4 → 0.18.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/.github/workflows/firebase-hosting-merge.yml +2 -0
- package/.github/workflows/firebase-hosting-pull-request.yml +2 -0
- package/.github/workflows/github-pages.yml +2 -0
- package/CHANGELOG.md +4 -0
- package/build_tools/postDist.ts +71 -0
- package/dist/bundle.js +9 -1
- package/dist/cjs/build_tools/BundledFile.js +163 -0
- package/dist/cjs/build_tools/buildTranslationTemplate.js +119 -0
- package/dist/cjs/build_tools/bundle.js +10 -0
- package/dist/cjs/build_tools/postDist.js +72 -0
- package/dist/{src → cjs/src}/Color4.d.ts +1 -0
- package/dist/cjs/src/Color4.js +197 -0
- package/dist/cjs/src/Editor.js +904 -0
- package/dist/cjs/src/EditorImage.js +486 -0
- package/dist/cjs/src/EventDispatcher.js +57 -0
- package/dist/cjs/src/Pointer.js +84 -0
- package/dist/cjs/src/SVGLoader.js +472 -0
- package/dist/cjs/src/UndoRedoHistory.js +93 -0
- package/dist/cjs/src/Viewport.js +264 -0
- package/dist/cjs/src/bundle/bundled.js +24 -0
- package/dist/cjs/src/commands/Command.js +34 -0
- package/dist/cjs/src/commands/Duplicate.js +39 -0
- package/dist/cjs/src/commands/Erase.js +63 -0
- package/dist/cjs/src/commands/SerializableCommand.js +42 -0
- package/dist/cjs/src/commands/UnresolvedCommand.js +28 -0
- package/dist/cjs/src/commands/invertCommand.js +49 -0
- package/dist/cjs/src/commands/lib.js +18 -0
- package/dist/cjs/src/commands/localization.js +24 -0
- package/dist/cjs/src/commands/uniteCommands.js +121 -0
- package/dist/cjs/src/components/AbstractComponent.js +258 -0
- package/dist/cjs/src/components/ImageBackground.js +146 -0
- package/dist/cjs/src/components/ImageComponent.js +152 -0
- package/dist/cjs/src/components/RestylableComponent.js +88 -0
- package/dist/cjs/src/components/SVGGlobalAttributesObject.js +65 -0
- package/dist/cjs/src/components/Stroke.js +191 -0
- package/dist/cjs/src/components/TextComponent.js +258 -0
- package/dist/cjs/src/components/UnknownSVGObject.js +50 -0
- package/dist/cjs/src/components/builders/ArrowBuilder.js +117 -0
- package/dist/cjs/src/components/builders/FreehandLineBuilder.js +173 -0
- package/dist/cjs/src/components/builders/LineBuilder.js +89 -0
- package/dist/cjs/src/components/builders/PressureSensitiveFreehandLineBuilder.js +347 -0
- package/dist/cjs/src/components/builders/RectangleBuilder.js +59 -0
- package/dist/cjs/src/components/builders/types.js +2 -0
- package/dist/cjs/src/components/lib.js +43 -0
- package/dist/cjs/src/components/localization.js +13 -0
- package/dist/cjs/src/components/util/StrokeSmoother.js +217 -0
- package/dist/cjs/src/components/util/describeComponentList.js +16 -0
- package/dist/cjs/src/lib.js +63 -0
- package/dist/cjs/src/localization.js +13 -0
- package/dist/cjs/src/localizations/de.js +6 -0
- package/dist/cjs/src/localizations/en.js +6 -0
- package/dist/cjs/src/localizations/es.js +20 -0
- package/dist/cjs/src/localizations/getLocalizationTable.js +50 -0
- package/dist/cjs/src/math/LineSegment2.js +131 -0
- package/dist/cjs/src/math/Mat33.js +332 -0
- package/dist/cjs/src/math/Path.js +655 -0
- package/dist/cjs/src/math/Rect2.js +234 -0
- package/dist/cjs/src/math/Triangle.js +22 -0
- package/dist/cjs/src/math/Vec2.js +19 -0
- package/dist/cjs/src/math/Vec3.js +177 -0
- package/dist/cjs/src/math/lib.js +18 -0
- package/dist/cjs/src/math/rounding.js +135 -0
- package/dist/cjs/src/rendering/Display.js +214 -0
- package/dist/cjs/src/rendering/RenderingStyle.js +48 -0
- package/dist/cjs/src/rendering/TextRenderingStyle.js +29 -0
- package/dist/cjs/src/rendering/caching/CacheRecord.js +61 -0
- package/dist/cjs/src/rendering/caching/CacheRecordManager.js +50 -0
- package/dist/cjs/src/rendering/caching/RenderingCache.js +51 -0
- package/dist/cjs/src/rendering/caching/RenderingCacheNode.js +326 -0
- package/dist/cjs/src/rendering/caching/testUtils.js +27 -0
- package/dist/cjs/src/rendering/caching/types.js +2 -0
- package/dist/cjs/src/rendering/lib.js +16 -0
- package/dist/cjs/src/rendering/localization.js +12 -0
- package/dist/cjs/src/rendering/renderers/AbstractRenderer.js +170 -0
- package/dist/cjs/src/rendering/renderers/CanvasRenderer.js +236 -0
- package/dist/cjs/src/rendering/renderers/DummyRenderer.js +112 -0
- package/dist/cjs/src/rendering/renderers/SVGRenderer.js +311 -0
- package/dist/cjs/src/rendering/renderers/TextOnlyRenderer.js +63 -0
- package/dist/cjs/src/testing/beforeEachFile.js +12 -0
- package/dist/cjs/src/testing/createEditor.js +14 -0
- package/dist/cjs/src/testing/lib.js +10 -0
- package/dist/cjs/src/testing/loadExpectExtensions.js +28 -0
- package/dist/cjs/src/testing/sendPenEvent.js +24 -0
- package/dist/cjs/src/testing/sendTouchEvent.js +87 -0
- package/dist/cjs/src/toolbar/HTMLToolbar.js +383 -0
- package/dist/cjs/src/toolbar/IconProvider.js +660 -0
- package/dist/cjs/src/toolbar/lib.js +24 -0
- package/dist/cjs/src/toolbar/localization.js +51 -0
- package/dist/cjs/src/toolbar/makeColorInput.js +120 -0
- package/dist/cjs/src/toolbar/types.js +2 -0
- package/dist/cjs/src/toolbar/widgets/ActionButtonWidget.js +31 -0
- package/dist/cjs/src/toolbar/widgets/BaseToolWidget.js +50 -0
- package/dist/cjs/src/toolbar/widgets/BaseWidget.js +313 -0
- package/dist/cjs/src/toolbar/widgets/DocumentPropertiesWidget.js +126 -0
- package/dist/cjs/src/toolbar/widgets/EraserToolWidget.js +63 -0
- package/dist/cjs/src/toolbar/widgets/HandToolWidget.js +201 -0
- package/dist/cjs/src/toolbar/widgets/InsertImageWidget.js +176 -0
- package/dist/cjs/src/toolbar/widgets/OverflowWidget.js +77 -0
- package/dist/cjs/src/toolbar/widgets/PenToolWidget.js +226 -0
- package/dist/cjs/src/toolbar/widgets/SelectionToolWidget.js +153 -0
- package/dist/cjs/src/toolbar/widgets/TextToolWidget.js +115 -0
- package/dist/cjs/src/toolbar/widgets/lib.js +26 -0
- package/dist/cjs/src/tools/BaseTool.js +66 -0
- package/dist/cjs/src/tools/Eraser.js +112 -0
- package/dist/cjs/src/tools/FindTool.js +121 -0
- package/dist/cjs/src/tools/PanZoom.js +421 -0
- package/dist/cjs/src/tools/PasteHandler.js +99 -0
- package/dist/cjs/src/tools/Pen.js +179 -0
- package/dist/cjs/src/tools/PipetteTool.js +45 -0
- package/dist/cjs/src/tools/SelectionTool/SelectAllShortcutHandler.js +28 -0
- package/dist/cjs/src/tools/SelectionTool/Selection.js +488 -0
- package/dist/cjs/src/tools/SelectionTool/SelectionHandle.js +85 -0
- package/dist/cjs/src/tools/SelectionTool/SelectionTool.js +405 -0
- package/dist/cjs/src/tools/SelectionTool/TransformMode.js +107 -0
- package/dist/cjs/src/tools/SelectionTool/types.js +14 -0
- package/dist/cjs/src/tools/TextTool.js +262 -0
- package/dist/cjs/src/tools/ToolController.js +187 -0
- package/dist/cjs/src/tools/ToolEnabledGroup.js +14 -0
- package/dist/cjs/src/tools/ToolSwitcherShortcut.js +38 -0
- package/dist/cjs/src/tools/ToolbarShortcutHandler.js +29 -0
- package/dist/cjs/src/tools/UndoRedoShortcut.js +28 -0
- package/dist/cjs/src/tools/lib.js +36 -0
- package/dist/cjs/src/tools/localization.js +30 -0
- package/dist/cjs/src/types.js +38 -0
- package/dist/cjs/src/util/assertions.js +51 -0
- package/dist/cjs/src/util/fileToBase64.js +15 -0
- package/dist/cjs/src/util/untilNextAnimationFrame.js +9 -0
- package/dist/cjs/src/util/waitForTimeout.js +9 -0
- package/dist/mjs/build_tools/BundledFile.d.ts +13 -0
- package/dist/{build_tools/buildTranslationTemplate.js → mjs/build_tools/buildTranslationTemplate.mjs} +1 -1
- package/dist/{build_tools/bundle.js → mjs/build_tools/bundle.mjs} +1 -1
- package/dist/mjs/build_tools/postDist.d.ts +1 -0
- package/dist/mjs/build_tools/postDist.mjs +67 -0
- package/dist/mjs/src/Color4.d.ts +61 -0
- package/dist/{src/Color4.js → mjs/src/Color4.mjs} +1 -0
- package/dist/mjs/src/Editor.d.ts +308 -0
- package/dist/{src/Editor.js → mjs/src/Editor.mjs} +26 -26
- package/dist/mjs/src/EditorImage.d.ts +97 -0
- package/dist/{src/EditorImage.js → mjs/src/EditorImage.mjs} +8 -8
- package/dist/mjs/src/EventDispatcher.d.ts +30 -0
- package/dist/mjs/src/Pointer.d.ts +24 -0
- package/dist/{src/Pointer.js → mjs/src/Pointer.mjs} +1 -1
- package/dist/mjs/src/SVGLoader.d.ts +48 -0
- package/dist/{src/SVGLoader.js → mjs/src/SVGLoader.mjs} +11 -11
- package/dist/mjs/src/UndoRedoHistory.d.ts +19 -0
- package/dist/{src/UndoRedoHistory.js → mjs/src/UndoRedoHistory.mjs} +1 -1
- package/dist/mjs/src/Viewport.d.ts +71 -0
- package/dist/{src/Viewport.js → mjs/src/Viewport.mjs} +5 -5
- package/dist/mjs/src/bundle/bundled.d.ts +4 -0
- package/dist/{src/bundle/bundled.js → mjs/src/bundle/bundled.mjs} +2 -2
- package/dist/mjs/src/commands/Command.d.ts +16 -0
- package/dist/mjs/src/commands/Duplicate.d.ts +14 -0
- package/dist/{src/commands/Duplicate.js → mjs/src/commands/Duplicate.mjs} +3 -3
- package/dist/mjs/src/commands/Erase.d.ts +14 -0
- package/dist/{src/commands/Erase.js → mjs/src/commands/Erase.mjs} +3 -3
- package/dist/mjs/src/commands/SerializableCommand.d.ts +12 -0
- package/dist/{src/commands/SerializableCommand.js → mjs/src/commands/SerializableCommand.mjs} +1 -1
- package/dist/mjs/src/commands/UnresolvedCommand.d.ts +14 -0
- package/dist/{src/commands/UnresolvedCommand.js → mjs/src/commands/UnresolvedCommand.mjs} +1 -1
- package/dist/mjs/src/commands/invertCommand.d.ts +4 -0
- package/dist/{src/commands/invertCommand.js → mjs/src/commands/invertCommand.mjs} +2 -2
- package/dist/mjs/src/commands/lib.mjs +7 -0
- package/dist/mjs/src/commands/localization.d.ts +23 -0
- package/dist/mjs/src/commands/uniteCommands.d.ts +4 -0
- package/dist/{src/commands/uniteCommands.js → mjs/src/commands/uniteCommands.mjs} +2 -2
- package/dist/mjs/src/components/AbstractComponent.d.ts +73 -0
- package/dist/{src/components/AbstractComponent.js → mjs/src/components/AbstractComponent.mjs} +4 -4
- package/dist/mjs/src/components/ImageBackground.d.ts +42 -0
- package/dist/{src/components/ImageBackground.js → mjs/src/components/ImageBackground.mjs} +5 -5
- package/dist/mjs/src/components/ImageComponent.d.ts +31 -0
- package/dist/{src/components/ImageComponent.js → mjs/src/components/ImageComponent.mjs} +3 -3
- package/dist/mjs/src/components/RestylableComponent.d.ts +24 -0
- package/dist/{src/components/RestylableComponent.js → mjs/src/components/RestylableComponent.mjs} +4 -4
- package/dist/mjs/src/components/SVGGlobalAttributesObject.d.ts +21 -0
- package/dist/{src/components/SVGGlobalAttributesObject.js → mjs/src/components/SVGGlobalAttributesObject.mjs} +3 -3
- package/dist/mjs/src/components/Stroke.d.ts +40 -0
- package/dist/{src/components/Stroke.js → mjs/src/components/Stroke.mjs} +5 -5
- package/dist/mjs/src/components/TextComponent.d.ts +53 -0
- package/dist/{src/components/TextComponent.js → mjs/src/components/TextComponent.mjs} +7 -7
- package/dist/mjs/src/components/UnknownSVGObject.d.ts +18 -0
- package/dist/{src/components/UnknownSVGObject.js → mjs/src/components/UnknownSVGObject.mjs} +3 -3
- package/dist/mjs/src/components/builders/ArrowBuilder.d.ts +19 -0
- package/dist/{src/components/builders/ArrowBuilder.js → mjs/src/components/builders/ArrowBuilder.mjs} +2 -2
- package/dist/mjs/src/components/builders/FreehandLineBuilder.d.ts +33 -0
- package/dist/{src/components/builders/FreehandLineBuilder.js → mjs/src/components/builders/FreehandLineBuilder.mjs} +7 -7
- package/dist/mjs/src/components/builders/LineBuilder.d.ts +18 -0
- package/dist/{src/components/builders/LineBuilder.js → mjs/src/components/builders/LineBuilder.mjs} +2 -2
- package/dist/mjs/src/components/builders/PressureSensitiveFreehandLineBuilder.d.ts +36 -0
- package/dist/{src/components/builders/PressureSensitiveFreehandLineBuilder.js → mjs/src/components/builders/PressureSensitiveFreehandLineBuilder.mjs} +6 -6
- package/dist/mjs/src/components/builders/RectangleBuilder.d.ts +20 -0
- package/dist/{src/components/builders/RectangleBuilder.js → mjs/src/components/builders/RectangleBuilder.mjs} +4 -4
- package/dist/mjs/src/components/builders/types.d.ts +12 -0
- package/dist/mjs/src/components/builders/types.mjs +1 -0
- package/dist/{src/components/lib.js → mjs/src/components/lib.d.ts} +3 -3
- package/dist/mjs/src/components/lib.mjs +12 -0
- package/dist/mjs/src/components/localization.d.ts +11 -0
- package/dist/mjs/src/components/util/StrokeSmoother.d.ts +35 -0
- package/dist/{src/components/util/StrokeSmoother.js → mjs/src/components/util/StrokeSmoother.mjs} +3 -3
- package/dist/mjs/src/components/util/describeComponentList.d.ts +4 -0
- package/dist/{src/lib.js → mjs/src/lib.d.ts} +2 -2
- package/dist/mjs/src/lib.mjs +34 -0
- package/dist/mjs/src/localization.d.ts +14 -0
- package/dist/{src/localization.js → mjs/src/localization.mjs} +5 -5
- package/dist/mjs/src/localizations/de.d.ts +3 -0
- package/dist/{src/localizations/de.js → mjs/src/localizations/de.mjs} +1 -1
- package/dist/mjs/src/localizations/en.d.ts +3 -0
- package/dist/{src/localizations/en.js → mjs/src/localizations/en.mjs} +1 -1
- package/dist/mjs/src/localizations/es.d.ts +3 -0
- package/dist/{src/localizations/es.js → mjs/src/localizations/es.mjs} +1 -1
- package/dist/mjs/src/localizations/getLocalizationTable.d.ts +3 -0
- package/dist/{src/localizations/getLocalizationTable.js → mjs/src/localizations/getLocalizationTable.mjs} +4 -4
- package/dist/mjs/src/math/LineSegment2.d.ts +24 -0
- package/dist/{src/math/LineSegment2.js → mjs/src/math/LineSegment2.mjs} +2 -2
- package/dist/mjs/src/math/Mat33.d.ts +118 -0
- package/dist/{src/math/Mat33.js → mjs/src/math/Mat33.mjs} +2 -2
- package/dist/mjs/src/math/Path.d.ts +71 -0
- package/dist/{src/math/Path.js → mjs/src/math/Path.mjs} +5 -5
- package/dist/mjs/src/math/Rect2.d.ts +52 -0
- package/dist/{src/math/Rect2.js → mjs/src/math/Rect2.mjs} +2 -2
- package/dist/mjs/src/math/Triangle.d.ts +11 -0
- package/dist/mjs/src/math/Vec2.d.ts +13 -0
- package/dist/{src/math/Vec2.js → mjs/src/math/Vec2.mjs} +1 -1
- package/dist/mjs/src/math/Vec3.d.ts +106 -0
- package/dist/mjs/src/math/lib.mjs +7 -0
- package/dist/mjs/src/math/rounding.d.ts +4 -0
- package/dist/mjs/src/rendering/Display.d.ts +75 -0
- package/dist/{src/rendering/Display.js → mjs/src/rendering/Display.mjs} +7 -7
- package/dist/mjs/src/rendering/RenderingStyle.d.ts +31 -0
- package/dist/{src/rendering/RenderingStyle.js → mjs/src/rendering/RenderingStyle.mjs} +1 -1
- package/dist/mjs/src/rendering/TextRenderingStyle.d.ts +36 -0
- package/dist/{src/rendering/TextRenderingStyle.js → mjs/src/rendering/TextRenderingStyle.mjs} +1 -1
- package/dist/mjs/src/rendering/caching/CacheRecord.d.ts +20 -0
- package/dist/{src/rendering/caching/CacheRecord.js → mjs/src/rendering/caching/CacheRecord.mjs} +1 -1
- package/dist/mjs/src/rendering/caching/CacheRecordManager.d.ts +12 -0
- package/dist/{src/rendering/caching/CacheRecordManager.js → mjs/src/rendering/caching/CacheRecordManager.mjs} +1 -1
- package/dist/mjs/src/rendering/caching/RenderingCache.d.ts +11 -0
- package/dist/{src/rendering/caching/RenderingCache.js → mjs/src/rendering/caching/RenderingCache.mjs} +3 -3
- package/dist/mjs/src/rendering/caching/RenderingCacheNode.d.ts +29 -0
- package/dist/{src/rendering/caching/RenderingCacheNode.js → mjs/src/rendering/caching/RenderingCacheNode.mjs} +3 -3
- package/dist/mjs/src/rendering/caching/testUtils.d.ts +9 -0
- package/dist/{src/rendering/caching/testUtils.js → mjs/src/rendering/caching/testUtils.mjs} +4 -4
- package/dist/mjs/src/rendering/caching/types.d.ts +19 -0
- package/dist/mjs/src/rendering/caching/types.mjs +1 -0
- package/dist/mjs/src/rendering/lib.mjs +5 -0
- package/dist/mjs/src/rendering/localization.d.ts +10 -0
- package/dist/mjs/src/rendering/renderers/AbstractRenderer.d.ts +68 -0
- package/dist/{src/rendering/renderers/AbstractRenderer.js → mjs/src/rendering/renderers/AbstractRenderer.mjs} +3 -3
- package/dist/mjs/src/rendering/renderers/CanvasRenderer.d.ts +63 -0
- package/dist/{src/rendering/renderers/CanvasRenderer.js → mjs/src/rendering/renderers/CanvasRenderer.mjs} +5 -5
- package/dist/mjs/src/rendering/renderers/DummyRenderer.d.ts +35 -0
- package/dist/{src/rendering/renderers/DummyRenderer.js → mjs/src/rendering/renderers/DummyRenderer.mjs} +2 -2
- package/dist/mjs/src/rendering/renderers/SVGRenderer.d.ts +57 -0
- package/dist/{src/rendering/renderers/SVGRenderer.js → mjs/src/rendering/renderers/SVGRenderer.mjs} +6 -6
- package/dist/mjs/src/rendering/renderers/TextOnlyRenderer.d.ts +29 -0
- package/dist/{src/rendering/renderers/TextOnlyRenderer.js → mjs/src/rendering/renderers/TextOnlyRenderer.mjs} +2 -2
- package/dist/mjs/src/testing/beforeEachFile.d.ts +1 -0
- package/dist/{src/testing/beforeEachFile.js → mjs/src/testing/beforeEachFile.mjs} +1 -1
- package/dist/mjs/src/testing/createEditor.d.ts +4 -0
- package/dist/{src/testing/createEditor.js → mjs/src/testing/createEditor.mjs} +2 -2
- package/dist/mjs/src/testing/lib.mjs +2 -0
- package/dist/mjs/src/testing/loadExpectExtensions.d.ts +2 -0
- package/dist/mjs/src/testing/sendPenEvent.d.ts +12 -0
- package/dist/{src/testing/sendPenEvent.js → mjs/src/testing/sendPenEvent.mjs} +2 -2
- package/dist/mjs/src/testing/sendTouchEvent.d.ts +42 -0
- package/dist/{src/testing/sendTouchEvent.js → mjs/src/testing/sendTouchEvent.mjs} +2 -2
- package/dist/mjs/src/toolbar/HTMLToolbar.d.ts +103 -0
- package/dist/{src/toolbar/HTMLToolbar.js → mjs/src/toolbar/HTMLToolbar.mjs} +17 -17
- package/dist/mjs/src/toolbar/IconProvider.d.ts +62 -0
- package/dist/{src/toolbar/IconProvider.js → mjs/src/toolbar/IconProvider.mjs} +4 -4
- package/dist/mjs/src/toolbar/lib.mjs +3 -0
- package/dist/mjs/src/toolbar/localization.d.ts +49 -0
- package/dist/mjs/src/toolbar/makeColorInput.d.ts +6 -0
- package/dist/{src/toolbar/makeColorInput.js → mjs/src/toolbar/makeColorInput.mjs} +3 -3
- package/dist/mjs/src/toolbar/types.d.ts +4 -0
- package/dist/mjs/src/toolbar/types.mjs +1 -0
- package/dist/mjs/src/toolbar/widgets/ActionButtonWidget.d.ts +15 -0
- package/dist/{src/toolbar/widgets/ActionButtonWidget.js → mjs/src/toolbar/widgets/ActionButtonWidget.mjs} +1 -1
- package/dist/mjs/src/toolbar/widgets/BaseToolWidget.d.ts +11 -0
- package/dist/{src/toolbar/widgets/BaseToolWidget.js → mjs/src/toolbar/widgets/BaseToolWidget.mjs} +2 -2
- package/dist/mjs/src/toolbar/widgets/BaseWidget.d.ts +72 -0
- package/dist/{src/toolbar/widgets/BaseWidget.js → mjs/src/toolbar/widgets/BaseWidget.mjs} +3 -3
- package/dist/mjs/src/toolbar/widgets/DocumentPropertiesWidget.d.ts +18 -0
- package/dist/{src/toolbar/widgets/DocumentPropertiesWidget.js → mjs/src/toolbar/widgets/DocumentPropertiesWidget.mjs} +6 -6
- package/dist/mjs/src/toolbar/widgets/EraserToolWidget.d.ts +17 -0
- package/dist/{src/toolbar/widgets/EraserToolWidget.js → mjs/src/toolbar/widgets/EraserToolWidget.mjs} +3 -3
- package/dist/mjs/src/toolbar/widgets/HandToolWidget.d.ts +17 -0
- package/dist/{src/toolbar/widgets/HandToolWidget.js → mjs/src/toolbar/widgets/HandToolWidget.mjs} +7 -7
- package/dist/mjs/src/toolbar/widgets/InsertImageWidget.d.ts +19 -0
- package/dist/{src/toolbar/widgets/InsertImageWidget.js → mjs/src/toolbar/widgets/InsertImageWidget.mjs} +8 -8
- package/dist/mjs/src/toolbar/widgets/OverflowWidget.d.ts +25 -0
- package/dist/{src/toolbar/widgets/OverflowWidget.js → mjs/src/toolbar/widgets/OverflowWidget.mjs} +1 -1
- package/dist/mjs/src/toolbar/widgets/PenToolWidget.d.ts +27 -0
- package/dist/{src/toolbar/widgets/PenToolWidget.js → mjs/src/toolbar/widgets/PenToolWidget.mjs} +10 -10
- package/dist/mjs/src/toolbar/widgets/SelectionToolWidget.d.ts +13 -0
- package/dist/{src/toolbar/widgets/SelectionToolWidget.js → mjs/src/toolbar/widgets/SelectionToolWidget.mjs} +8 -8
- package/dist/mjs/src/toolbar/widgets/TextToolWidget.d.ts +16 -0
- package/dist/{src/toolbar/widgets/TextToolWidget.js → mjs/src/toolbar/widgets/TextToolWidget.mjs} +5 -5
- package/dist/mjs/src/toolbar/widgets/lib.mjs +10 -0
- package/dist/mjs/src/tools/BaseTool.d.ts +22 -0
- package/dist/{src/tools/BaseTool.js → mjs/src/tools/BaseTool.mjs} +1 -1
- package/dist/mjs/src/tools/Eraser.d.ts +23 -0
- package/dist/{src/tools/Eraser.js → mjs/src/tools/Eraser.mjs} +8 -8
- package/dist/mjs/src/tools/FindTool.d.ts +21 -0
- package/dist/{src/tools/FindTool.js → mjs/src/tools/FindTool.mjs} +2 -2
- package/dist/mjs/src/tools/PanZoom.d.ts +52 -0
- package/dist/{src/tools/PanZoom.js → mjs/src/tools/PanZoom.mjs} +8 -8
- package/dist/mjs/src/tools/PasteHandler.d.ts +23 -0
- package/dist/{src/tools/PasteHandler.js → mjs/src/tools/PasteHandler.mjs} +7 -7
- package/dist/mjs/src/tools/Pen.d.ts +39 -0
- package/dist/{src/tools/Pen.js → mjs/src/tools/Pen.mjs} +5 -5
- package/dist/mjs/src/tools/PipetteTool.d.ts +18 -0
- package/dist/{src/tools/PipetteTool.js → mjs/src/tools/PipetteTool.mjs} +1 -1
- package/dist/mjs/src/tools/SelectionTool/SelectAllShortcutHandler.d.ts +8 -0
- package/dist/{src/tools/SelectionTool/SelectAllShortcutHandler.js → mjs/src/tools/SelectionTool/SelectAllShortcutHandler.mjs} +2 -2
- package/dist/mjs/src/tools/SelectionTool/Selection.d.ts +64 -0
- package/dist/{src/tools/SelectionTool/Selection.js → mjs/src/tools/SelectionTool/Selection.mjs} +12 -12
- package/dist/mjs/src/tools/SelectionTool/SelectionHandle.d.ts +38 -0
- package/dist/{src/tools/SelectionTool/SelectionHandle.js → mjs/src/tools/SelectionTool/SelectionHandle.mjs} +3 -3
- package/dist/mjs/src/tools/SelectionTool/SelectionTool.d.ts +36 -0
- package/dist/{src/tools/SelectionTool/SelectionTool.js → mjs/src/tools/SelectionTool/SelectionTool.mjs} +8 -8
- package/dist/mjs/src/tools/SelectionTool/TransformMode.d.ts +34 -0
- package/dist/{src/tools/SelectionTool/TransformMode.js → mjs/src/tools/SelectionTool/TransformMode.mjs} +4 -4
- package/dist/mjs/src/tools/SelectionTool/types.d.ts +9 -0
- package/dist/mjs/src/tools/TextTool.d.ts +33 -0
- package/dist/{src/tools/TextTool.js → mjs/src/tools/TextTool.mjs} +11 -11
- package/dist/mjs/src/tools/ToolController.d.ts +18 -0
- package/dist/{src/tools/ToolController.js → mjs/src/tools/ToolController.mjs} +16 -16
- package/dist/mjs/src/tools/ToolEnabledGroup.d.ts +6 -0
- package/dist/mjs/src/tools/ToolSwitcherShortcut.d.ts +16 -0
- package/dist/{src/tools/ToolSwitcherShortcut.js → mjs/src/tools/ToolSwitcherShortcut.mjs} +1 -1
- package/dist/mjs/src/tools/ToolbarShortcutHandler.d.ts +12 -0
- package/dist/{src/tools/ToolbarShortcutHandler.js → mjs/src/tools/ToolbarShortcutHandler.mjs} +1 -1
- package/dist/mjs/src/tools/UndoRedoShortcut.d.ts +8 -0
- package/dist/{src/tools/UndoRedoShortcut.js → mjs/src/tools/UndoRedoShortcut.mjs} +1 -1
- package/dist/{src/tools/lib.js → mjs/src/tools/lib.d.ts} +1 -1
- package/dist/mjs/src/tools/lib.mjs +16 -0
- package/dist/mjs/src/tools/localization.d.ts +28 -0
- package/dist/mjs/src/types.d.ts +151 -0
- package/dist/mjs/src/util/assertions.d.ts +23 -0
- package/dist/mjs/src/util/fileToBase64.d.ts +3 -0
- package/dist/mjs/src/util/untilNextAnimationFrame.d.ts +3 -0
- package/dist/mjs/src/util/waitForTimeout.d.ts +2 -0
- package/package.json +34 -33
- package/src/Color4.ts +2 -0
- package/tsconfig.json +3 -2
- package/tsconfig.mjs.json +9 -0
- /package/dist/{build_tools → cjs/build_tools}/BundledFile.d.ts +0 -0
- /package/dist/{build_tools → cjs/build_tools}/buildTranslationTemplate.d.ts +0 -0
- /package/dist/{build_tools → cjs/build_tools}/bundle.d.ts +0 -0
- /package/dist/{src/components/builders/types.js → cjs/build_tools/postDist.d.ts} +0 -0
- /package/dist/{src → cjs/src}/Editor.d.ts +0 -0
- /package/dist/{src → cjs/src}/EditorImage.d.ts +0 -0
- /package/dist/{src → cjs/src}/EventDispatcher.d.ts +0 -0
- /package/dist/{src → cjs/src}/Pointer.d.ts +0 -0
- /package/dist/{src → cjs/src}/SVGLoader.d.ts +0 -0
- /package/dist/{src → cjs/src}/UndoRedoHistory.d.ts +0 -0
- /package/dist/{src → cjs/src}/Viewport.d.ts +0 -0
- /package/dist/{src → cjs/src}/bundle/bundled.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/Command.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/Duplicate.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/Erase.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/SerializableCommand.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/UnresolvedCommand.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/invertCommand.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/localization.d.ts +0 -0
- /package/dist/{src → cjs/src}/commands/uniteCommands.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/AbstractComponent.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/ImageBackground.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/ImageComponent.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/RestylableComponent.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/SVGGlobalAttributesObject.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/Stroke.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/TextComponent.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/UnknownSVGObject.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/builders/ArrowBuilder.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/builders/FreehandLineBuilder.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/builders/LineBuilder.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/builders/PressureSensitiveFreehandLineBuilder.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/builders/RectangleBuilder.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/builders/types.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/localization.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/util/StrokeSmoother.d.ts +0 -0
- /package/dist/{src → cjs/src}/components/util/describeComponentList.d.ts +0 -0
- /package/dist/{src → cjs/src}/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/localization.d.ts +0 -0
- /package/dist/{src → cjs/src}/localizations/de.d.ts +0 -0
- /package/dist/{src → cjs/src}/localizations/en.d.ts +0 -0
- /package/dist/{src → cjs/src}/localizations/es.d.ts +0 -0
- /package/dist/{src → cjs/src}/localizations/getLocalizationTable.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/LineSegment2.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/Mat33.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/Path.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/Rect2.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/Triangle.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/Vec2.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/Vec3.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/math/rounding.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/Display.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/RenderingStyle.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/TextRenderingStyle.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/caching/CacheRecord.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/caching/CacheRecordManager.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/caching/RenderingCache.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/caching/RenderingCacheNode.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/caching/testUtils.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/caching/types.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/localization.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/renderers/AbstractRenderer.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/renderers/CanvasRenderer.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/renderers/DummyRenderer.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/renderers/SVGRenderer.d.ts +0 -0
- /package/dist/{src → cjs/src}/rendering/renderers/TextOnlyRenderer.d.ts +0 -0
- /package/dist/{src → cjs/src}/testing/beforeEachFile.d.ts +0 -0
- /package/dist/{src → cjs/src}/testing/createEditor.d.ts +0 -0
- /package/dist/{src → cjs/src}/testing/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/testing/loadExpectExtensions.d.ts +0 -0
- /package/dist/{src → cjs/src}/testing/sendPenEvent.d.ts +0 -0
- /package/dist/{src → cjs/src}/testing/sendTouchEvent.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/HTMLToolbar.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/IconProvider.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/localization.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/makeColorInput.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/types.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/ActionButtonWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/BaseToolWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/BaseWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/DocumentPropertiesWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/EraserToolWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/HandToolWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/InsertImageWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/OverflowWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/PenToolWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/SelectionToolWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/TextToolWidget.d.ts +0 -0
- /package/dist/{src → cjs/src}/toolbar/widgets/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/BaseTool.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/Eraser.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/FindTool.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/PanZoom.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/PasteHandler.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/Pen.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/PipetteTool.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/SelectionTool/SelectAllShortcutHandler.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/SelectionTool/Selection.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/SelectionTool/SelectionHandle.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/SelectionTool/SelectionTool.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/SelectionTool/TransformMode.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/SelectionTool/types.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/TextTool.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/ToolController.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/ToolEnabledGroup.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/ToolSwitcherShortcut.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/ToolbarShortcutHandler.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/UndoRedoShortcut.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/lib.d.ts +0 -0
- /package/dist/{src → cjs/src}/tools/localization.d.ts +0 -0
- /package/dist/{src → cjs/src}/types.d.ts +0 -0
- /package/dist/{src → cjs/src}/util/assertions.d.ts +0 -0
- /package/dist/{src → cjs/src}/util/fileToBase64.d.ts +0 -0
- /package/dist/{src → cjs/src}/util/untilNextAnimationFrame.d.ts +0 -0
- /package/dist/{src → cjs/src}/util/waitForTimeout.d.ts +0 -0
- /package/dist/{build_tools/BundledFile.js → mjs/build_tools/BundledFile.mjs} +0 -0
- /package/dist/{src/rendering/caching/types.js → mjs/build_tools/buildTranslationTemplate.d.ts} +0 -0
- /package/dist/{src/toolbar/types.js → mjs/build_tools/bundle.d.ts} +0 -0
- /package/dist/{src/EventDispatcher.js → mjs/src/EventDispatcher.mjs} +0 -0
- /package/dist/{src/commands/Command.js → mjs/src/commands/Command.mjs} +0 -0
- /package/dist/{src/commands/lib.js → mjs/src/commands/lib.d.ts} +0 -0
- /package/dist/{src/commands/localization.js → mjs/src/commands/localization.mjs} +0 -0
- /package/dist/{src/components/localization.js → mjs/src/components/localization.mjs} +0 -0
- /package/dist/{src/components/util/describeComponentList.js → mjs/src/components/util/describeComponentList.mjs} +0 -0
- /package/dist/{src/math/Triangle.js → mjs/src/math/Triangle.mjs} +0 -0
- /package/dist/{src/math/Vec3.js → mjs/src/math/Vec3.mjs} +0 -0
- /package/dist/{src/math/lib.js → mjs/src/math/lib.d.ts} +0 -0
- /package/dist/{src/math/rounding.js → mjs/src/math/rounding.mjs} +0 -0
- /package/dist/{src/rendering/lib.js → mjs/src/rendering/lib.d.ts} +0 -0
- /package/dist/{src/rendering/localization.js → mjs/src/rendering/localization.mjs} +0 -0
- /package/dist/{src/testing/lib.js → mjs/src/testing/lib.d.ts} +0 -0
- /package/dist/{src/testing/loadExpectExtensions.js → mjs/src/testing/loadExpectExtensions.mjs} +0 -0
- /package/dist/{src/toolbar/lib.js → mjs/src/toolbar/lib.d.ts} +0 -0
- /package/dist/{src/toolbar/localization.js → mjs/src/toolbar/localization.mjs} +0 -0
- /package/dist/{src/toolbar/widgets/lib.js → mjs/src/toolbar/widgets/lib.d.ts} +0 -0
- /package/dist/{src/tools/SelectionTool/types.js → mjs/src/tools/SelectionTool/types.mjs} +0 -0
- /package/dist/{src/tools/ToolEnabledGroup.js → mjs/src/tools/ToolEnabledGroup.mjs} +0 -0
- /package/dist/{src/tools/localization.js → mjs/src/tools/localization.mjs} +0 -0
- /package/dist/{src/types.js → mjs/src/types.mjs} +0 -0
- /package/dist/{src/util/assertions.js → mjs/src/util/assertions.mjs} +0 -0
- /package/dist/{src/util/fileToBase64.js → mjs/src/util/fileToBase64.mjs} +0 -0
- /package/dist/{src/util/untilNextAnimationFrame.js → mjs/src/util/untilNextAnimationFrame.mjs} +0 -0
- /package/dist/{src/util/waitForTimeout.js → mjs/src/util/waitForTimeout.mjs} +0 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assertIsNumberArray = exports.assertIsNumber = exports.assertUnreachable = void 0;
|
4
|
+
/**
|
5
|
+
* Compile-time assertion that a branch of code is unreachable.
|
6
|
+
* @internal
|
7
|
+
*/
|
8
|
+
const assertUnreachable = (key) => {
|
9
|
+
// See https://stackoverflow.com/a/39419171/17055750
|
10
|
+
throw new Error(`Should be unreachable. Key: ${key}.`);
|
11
|
+
};
|
12
|
+
exports.assertUnreachable = assertUnreachable;
|
13
|
+
/**
|
14
|
+
* Throws an exception if the typeof given value is not a number or `value` is NaN.
|
15
|
+
*
|
16
|
+
* @example
|
17
|
+
* ```ts
|
18
|
+
* const foo: unknown = 3;
|
19
|
+
* assertIsNumber(foo);
|
20
|
+
*
|
21
|
+
* assertIsNumber('hello, world'); // throws an Error.
|
22
|
+
* ```
|
23
|
+
*
|
24
|
+
*
|
25
|
+
*/
|
26
|
+
const assertIsNumber = (value, allowNaN = false) => {
|
27
|
+
if (typeof value !== 'number' || (!allowNaN && isNaN(value))) {
|
28
|
+
throw new Error('Given value is not a number');
|
29
|
+
// return false;
|
30
|
+
}
|
31
|
+
return true;
|
32
|
+
};
|
33
|
+
exports.assertIsNumber = assertIsNumber;
|
34
|
+
/**
|
35
|
+
* Throws if any of `values` is not of type number.
|
36
|
+
*/
|
37
|
+
const assertIsNumberArray = (values, allowNaN = false) => {
|
38
|
+
if (typeof values !== 'object') {
|
39
|
+
throw new Error('Asserting isNumberArray: Given entity is not an array');
|
40
|
+
}
|
41
|
+
if (!(0, exports.assertIsNumber)(values['length'])) {
|
42
|
+
return false;
|
43
|
+
}
|
44
|
+
for (const value of values) {
|
45
|
+
if (!(0, exports.assertIsNumber)(value, allowNaN)) {
|
46
|
+
return false;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
return true;
|
50
|
+
};
|
51
|
+
exports.assertIsNumberArray = assertIsNumberArray;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const fileToBase64 = (file, onprogress) => {
|
4
|
+
const reader = new FileReader();
|
5
|
+
return new Promise((resolve, reject) => {
|
6
|
+
reader.onload = () => resolve(reader.result);
|
7
|
+
reader.onerror = reject;
|
8
|
+
reader.onabort = reject;
|
9
|
+
reader.onprogress = (evt) => {
|
10
|
+
onprogress === null || onprogress === void 0 ? void 0 : onprogress(evt);
|
11
|
+
};
|
12
|
+
reader.readAsDataURL(file);
|
13
|
+
});
|
14
|
+
};
|
15
|
+
exports.default = fileToBase64;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
/** @internal */
|
4
|
+
const untilNextAnimationFrame = () => {
|
5
|
+
return new Promise((resolve) => {
|
6
|
+
requestAnimationFrame(() => resolve());
|
7
|
+
});
|
8
|
+
};
|
9
|
+
exports.default = untilNextAnimationFrame;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
// Returns a promise that resolves after `timeout` milliseconds.
|
4
|
+
const waitForTimeout = (timeout) => {
|
5
|
+
return new Promise(resolve => {
|
6
|
+
setTimeout(() => resolve(), timeout);
|
7
|
+
});
|
8
|
+
};
|
9
|
+
exports.default = waitForTimeout;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export default class BundledFile {
|
2
|
+
readonly bundleName: string;
|
3
|
+
private readonly sourceFilePath;
|
4
|
+
private readonly bundleBaseName;
|
5
|
+
private readonly rootFileDirectory;
|
6
|
+
private readonly outputDirectory;
|
7
|
+
private readonly outputFilename;
|
8
|
+
constructor(bundleName: string, sourceFilePath: string, outputFilepath?: string);
|
9
|
+
private getWebpackOptions;
|
10
|
+
private handleErrors;
|
11
|
+
build(): Promise<void>;
|
12
|
+
startWatching(): void;
|
13
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as fs from 'fs';
|
2
2
|
import * as path from 'path';
|
3
|
-
import
|
3
|
+
import { defaultEditorLocalization } from '../src/localization.mjs';
|
4
4
|
// Adds markdown formatting to format text like code.
|
5
5
|
const codeFormat = (text) => {
|
6
6
|
let maxConsecutiveBackticks = 0;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { dirname } from 'path';
|
2
|
-
import
|
2
|
+
import BundledFile from './BundledFile.mjs';
|
3
3
|
const rootDir = dirname(__dirname);
|
4
4
|
const mainBundle = new BundledFile('jsdraw', `${rootDir}/src/bundle/bundled.ts`, `${rootDir}/dist/bundle.js`);
|
5
5
|
void mainBundle.build();
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
+
});
|
9
|
+
};
|
10
|
+
import { readdir, stat, rename, readFile, writeFile, unlink } from 'fs/promises';
|
11
|
+
import path from 'path';
|
12
|
+
// Script to be run after building JavaScript files from TypeScript.
|
13
|
+
// TODO: This is very hacky.
|
14
|
+
// TODO: [Use the TypeScript Compiler API instead.](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API)
|
15
|
+
// Iterates over every JavaScript file in [directory].
|
16
|
+
const forEachFile = (directory, processFile) => __awaiter(void 0, void 0, void 0, function* () {
|
17
|
+
const files = yield readdir(directory);
|
18
|
+
yield Promise.all(files.map((file) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const filePath = path.join(directory, file);
|
20
|
+
const stats = yield stat(filePath);
|
21
|
+
if (stats.isDirectory()) {
|
22
|
+
yield forEachFile(filePath, processFile);
|
23
|
+
}
|
24
|
+
else if (stats.isFile()) {
|
25
|
+
yield processFile(filePath);
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
throw new Error('Unknown file type!');
|
29
|
+
}
|
30
|
+
})));
|
31
|
+
});
|
32
|
+
const removeFiles = (directory, filePattern) => __awaiter(void 0, void 0, void 0, function* () {
|
33
|
+
yield forEachFile(directory, (filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
34
|
+
if (!filePath.match(filePattern)) {
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
yield unlink(filePath);
|
38
|
+
}));
|
39
|
+
});
|
40
|
+
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
41
|
+
const rootDir = path.dirname(__dirname);
|
42
|
+
const cjsPath = `${rootDir}/dist/cjs`;
|
43
|
+
const mjsPath = `${rootDir}/dist/mjs`;
|
44
|
+
const testPattern = /\.test\.js$/;
|
45
|
+
yield removeFiles(cjsPath, testPattern);
|
46
|
+
yield removeFiles(mjsPath, testPattern);
|
47
|
+
// We need to replace imports in ESM files.
|
48
|
+
yield forEachFile(mjsPath, (filePath) => __awaiter(void 0, void 0, void 0, function* () {
|
49
|
+
if (!filePath.endsWith('.js')) {
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
// Rename
|
53
|
+
const newPath = filePath.replace(/\.js$/, '.mjs');
|
54
|
+
yield rename(filePath, newPath);
|
55
|
+
// Change imports from
|
56
|
+
// import foo from './bar'
|
57
|
+
// to
|
58
|
+
// import foo from './bar.mjs'
|
59
|
+
// and exports similarly.
|
60
|
+
let contents = yield readFile(newPath, { encoding: 'utf-8' });
|
61
|
+
// TODO: Switch to using the TypeScript compiler API. This has the danger of changing imports
|
62
|
+
// in multi-line strings.
|
63
|
+
contents = contents.replace(/([\n]|^)(import|export)(.*)from\s+(['"])(\.*\/[^\n]+)(['"])/g, '$1$2 $3 from $4$5.mjs$6');
|
64
|
+
yield writeFile(newPath, contents);
|
65
|
+
}));
|
66
|
+
});
|
67
|
+
main();
|
@@ -0,0 +1,61 @@
|
|
1
|
+
export default class Color4 {
|
2
|
+
/** Red component. Should be in the range [0, 1]. */
|
3
|
+
readonly r: number;
|
4
|
+
/** Green component. `g` ∈ [0, 1] */
|
5
|
+
readonly g: number;
|
6
|
+
/** Blue component. `b` ∈ [0, 1] */
|
7
|
+
readonly b: number;
|
8
|
+
/** Alpha/transparent component. `a` ∈ [0, 1]. 0 = transparent */
|
9
|
+
readonly a: number;
|
10
|
+
private constructor();
|
11
|
+
/**
|
12
|
+
* Create a color from red, green, blue components. The color is fully opaque (`a = 1.0`).
|
13
|
+
*
|
14
|
+
* Each component should be in the range [0, 1].
|
15
|
+
*/
|
16
|
+
static ofRGB(red: number, green: number, blue: number): Color4;
|
17
|
+
static ofRGBA(red: number, green: number, blue: number, alpha: number): Color4;
|
18
|
+
static fromHex(hexString: string): Color4;
|
19
|
+
/** Like fromHex, but can handle additional colors if an `HTMLCanvasElement` is available. */
|
20
|
+
static fromString(text: string): Color4;
|
21
|
+
/** @returns true if `this` and `other` are approximately equal. */
|
22
|
+
eq(other: Color4 | null | undefined): boolean;
|
23
|
+
/**
|
24
|
+
* If `fractionTo` is not in the range [0, 1], it will be clamped to the nearest number
|
25
|
+
* in that range. For example, `a.mix(b, -1)` is equivalent to `a.mix(b, 0)`.
|
26
|
+
*
|
27
|
+
* @returns a color `fractionTo` of the way from this color to `other`.
|
28
|
+
*
|
29
|
+
* @example
|
30
|
+
* ```ts
|
31
|
+
* Color4.ofRGB(1, 0, 0).mix(Color4.ofRGB(0, 1, 0), 0.1) // -> Color4(0.9, 0.1, 0)
|
32
|
+
* ```
|
33
|
+
*/
|
34
|
+
mix(other: Color4, fractionTo: number): Color4;
|
35
|
+
/**
|
36
|
+
* @returns the component-wise average of `colors`, or `Color4.transparent` if `colors` is empty.
|
37
|
+
*/
|
38
|
+
static average(colors: Color4[]): Color4;
|
39
|
+
private hexString;
|
40
|
+
/**
|
41
|
+
* @returns a hexadecimal color string representation of `this`, in the form `#rrggbbaa`.
|
42
|
+
*
|
43
|
+
* @example
|
44
|
+
* ```
|
45
|
+
* Color4.red.toHexString(); // -> #ff0000ff
|
46
|
+
* ```
|
47
|
+
*/
|
48
|
+
toHexString(): string;
|
49
|
+
toString(): string;
|
50
|
+
static transparent: Color4;
|
51
|
+
static red: Color4;
|
52
|
+
static green: Color4;
|
53
|
+
static blue: Color4;
|
54
|
+
static purple: Color4;
|
55
|
+
static yellow: Color4;
|
56
|
+
static clay: Color4;
|
57
|
+
static black: Color4;
|
58
|
+
static gray: Color4;
|
59
|
+
static white: Color4;
|
60
|
+
}
|
61
|
+
export { Color4 };
|
@@ -0,0 +1,308 @@
|
|
1
|
+
import EditorImage from './EditorImage';
|
2
|
+
import ToolController from './tools/ToolController';
|
3
|
+
import { InputEvtType, EditorNotifier, ImageLoader } 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
|
+
type HTMLPointerEventType = 'pointerdown' | 'pointermove' | 'pointerup' | 'pointercancel';
|
18
|
+
type HTMLPointerEventFilter = (eventName: HTMLPointerEventType, event: PointerEvent) => boolean;
|
19
|
+
export interface EditorSettings {
|
20
|
+
/** Defaults to `RenderingMode.CanvasRenderer` */
|
21
|
+
renderingMode: RenderingMode;
|
22
|
+
/** Uses a default English localization if a translation is not given. */
|
23
|
+
localization: Partial<EditorLocalization>;
|
24
|
+
/**
|
25
|
+
* `true` if touchpad/mousewheel scrolling should scroll the editor instead of the document.
|
26
|
+
* This does not include pinch-zoom events.
|
27
|
+
* Defaults to true.
|
28
|
+
*/
|
29
|
+
wheelEventsEnabled: boolean | 'only-if-focused';
|
30
|
+
/** Minimum zoom fraction (e.g. 0.5 → 50% zoom). */
|
31
|
+
minZoom: number;
|
32
|
+
maxZoom: number;
|
33
|
+
iconProvider: IconProvider;
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* The main entrypoint for the full editor.
|
37
|
+
*
|
38
|
+
* @example
|
39
|
+
* To create an editor with a toolbar,
|
40
|
+
* ```
|
41
|
+
* const editor = new Editor(document.body);
|
42
|
+
*
|
43
|
+
* const toolbar = editor.addToolbar();
|
44
|
+
* toolbar.addActionButton('Save', () => {
|
45
|
+
* const saveData = editor.toSVG().outerHTML;
|
46
|
+
* // Do something with saveData...
|
47
|
+
* });
|
48
|
+
* ```
|
49
|
+
*
|
50
|
+
* See also
|
51
|
+
* [`docs/example/example.ts`](https://github.com/personalizedrefrigerator/js-draw/blob/main/docs/example/example.ts#L15).
|
52
|
+
*/
|
53
|
+
export declare class Editor {
|
54
|
+
private container;
|
55
|
+
private renderingRegion;
|
56
|
+
/** Manages drawing surfaces/{@link lib!AbstractRenderer}s. */
|
57
|
+
display: Display;
|
58
|
+
/**
|
59
|
+
* Handles undo/redo.
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* ```
|
63
|
+
* const editor = new Editor(document.body);
|
64
|
+
*
|
65
|
+
* // Do something undoable.
|
66
|
+
* // ...
|
67
|
+
*
|
68
|
+
* // Undo the last action
|
69
|
+
* editor.history.undo();
|
70
|
+
* ```
|
71
|
+
*/
|
72
|
+
history: UndoRedoHistory;
|
73
|
+
/**
|
74
|
+
* Data structure for adding/removing/querying objects in the image.
|
75
|
+
*
|
76
|
+
* @example
|
77
|
+
* ```
|
78
|
+
* const editor = new Editor(document.body);
|
79
|
+
*
|
80
|
+
* // Create a path.
|
81
|
+
* const stroke = new Stroke([
|
82
|
+
* Path.fromString('M0,0 L30,30 z').toRenderable({ fill: Color4.black }),
|
83
|
+
* ]);
|
84
|
+
* const addElementCommand = editor.image.addElement(stroke);
|
85
|
+
*
|
86
|
+
* // Add the stroke to the editor
|
87
|
+
* editor.dispatch(addElementCommand);
|
88
|
+
* ```
|
89
|
+
*/
|
90
|
+
readonly image: EditorImage;
|
91
|
+
/**
|
92
|
+
* Allows transforming the view and querying information about
|
93
|
+
* what is currently visible.
|
94
|
+
*/
|
95
|
+
readonly viewport: Viewport;
|
96
|
+
/** @internal */
|
97
|
+
readonly localization: EditorLocalization;
|
98
|
+
/** {@link lib!EditorSettings.iconProvider} */
|
99
|
+
readonly icons: IconProvider;
|
100
|
+
/**
|
101
|
+
* Controls the list of tools. See
|
102
|
+
* [the custom tool example](https://github.com/personalizedrefrigerator/js-draw/tree/main/docs/example-custom-tools)
|
103
|
+
* for more.
|
104
|
+
*/
|
105
|
+
readonly toolController: ToolController;
|
106
|
+
/**
|
107
|
+
* Global event dispatcher/subscriber.
|
108
|
+
*/
|
109
|
+
readonly notifier: EditorNotifier;
|
110
|
+
private loadingWarning;
|
111
|
+
private accessibilityAnnounceArea;
|
112
|
+
private accessibilityControlArea;
|
113
|
+
private eventListenerTargets;
|
114
|
+
private settings;
|
115
|
+
/**
|
116
|
+
* @example
|
117
|
+
* ```
|
118
|
+
* const container = document.body;
|
119
|
+
*
|
120
|
+
* // Create an editor
|
121
|
+
* const editor = new Editor(container, {
|
122
|
+
* // 2e-10 and 1e12 are the default values for minimum/maximum zoom.
|
123
|
+
* minZoom: 2e-10,
|
124
|
+
* maxZoom: 1e12,
|
125
|
+
* });
|
126
|
+
*
|
127
|
+
* // Add the default toolbar
|
128
|
+
* const toolbar = editor.addToolbar();
|
129
|
+
*
|
130
|
+
* // Add a save button
|
131
|
+
* toolbar.addActionButton({
|
132
|
+
* label: 'Save'
|
133
|
+
* icon: createSaveIcon(),
|
134
|
+
* }, () => {
|
135
|
+
* const saveData = editor.toSVG().outerHTML;
|
136
|
+
* // Do something with saveData
|
137
|
+
* });
|
138
|
+
* ```
|
139
|
+
*/
|
140
|
+
constructor(parent: HTMLElement, settings?: Partial<EditorSettings>);
|
141
|
+
/**
|
142
|
+
* @returns a reference to the editor's container.
|
143
|
+
*
|
144
|
+
* @example
|
145
|
+
* ```
|
146
|
+
* // Set the editor's height to 500px
|
147
|
+
* editor.getRootElement().style.height = '500px';
|
148
|
+
* ```
|
149
|
+
*/
|
150
|
+
getRootElement(): HTMLElement;
|
151
|
+
/** @param fractionLoaded - should be a number from 0 to 1, where 1 represents completely loaded. */
|
152
|
+
showLoadingWarning(fractionLoaded: number): void;
|
153
|
+
hideLoadingWarning(): void;
|
154
|
+
private previousAccessibilityAnnouncement;
|
155
|
+
/**
|
156
|
+
* Announce `message` for screen readers. If `message` is the same as the previous
|
157
|
+
* message, it is re-announced.
|
158
|
+
*/
|
159
|
+
announceForAccessibility(message: string): void;
|
160
|
+
/**
|
161
|
+
* Creates a toolbar. If `defaultLayout` is true, default buttons are used.
|
162
|
+
* @returns a reference to the toolbar.
|
163
|
+
*/
|
164
|
+
addToolbar(defaultLayout?: boolean): HTMLToolbar;
|
165
|
+
private registerListeners;
|
166
|
+
private pointers;
|
167
|
+
private getPointerList;
|
168
|
+
/**
|
169
|
+
* Dispatches a `PointerEvent` to the editor. The target element for `evt` must have the same top left
|
170
|
+
* as the content of the editor.
|
171
|
+
*/
|
172
|
+
handleHTMLPointerEvent(eventType: 'pointerdown' | 'pointermove' | 'pointerup' | 'pointercancel', evt: PointerEvent): boolean;
|
173
|
+
private isEventSink;
|
174
|
+
private handlePaste;
|
175
|
+
/**
|
176
|
+
* Forward pointer events from `elem` to this editor. Such that right-click/right-click drag
|
177
|
+
* events are also forwarded, `elem`'s contextmenu is disabled.
|
178
|
+
*
|
179
|
+
* @example
|
180
|
+
* ```ts
|
181
|
+
* const overlay = document.createElement('div');
|
182
|
+
* editor.createHTMLOverlay(overlay);
|
183
|
+
*
|
184
|
+
* // Send all pointer events that don't have the control key pressed
|
185
|
+
* // to the editor.
|
186
|
+
* editor.handlePointerEventsFrom(overlay, (event) => {
|
187
|
+
* if (event.ctrlKey) {
|
188
|
+
* return false;
|
189
|
+
* }
|
190
|
+
* return true;
|
191
|
+
* });
|
192
|
+
* ```
|
193
|
+
*/
|
194
|
+
handlePointerEventsFrom(elem: HTMLElement, filter?: HTMLPointerEventFilter): void;
|
195
|
+
/** Adds event listners for keypresses to `elem` and forwards those events to the editor. */
|
196
|
+
handleKeyEventsFrom(elem: HTMLElement): void;
|
197
|
+
/** `apply` a command. `command` will be announced for accessibility. */
|
198
|
+
dispatch(command: Command, addToHistory?: boolean): void | Promise<void>;
|
199
|
+
/**
|
200
|
+
* Dispatches a command without announcing it. By default, does not add to history.
|
201
|
+
* Use this to show finalized commands that don't need to have `announceForAccessibility`
|
202
|
+
* called.
|
203
|
+
*
|
204
|
+
* Prefer `command.apply(editor)` for incomplete commands. `dispatchNoAnnounce` may allow
|
205
|
+
* clients to listen for the application of commands (e.g. `SerializableCommand`s so they can
|
206
|
+
* be sent across the network), while `apply` does not.
|
207
|
+
*
|
208
|
+
* @example
|
209
|
+
* ```
|
210
|
+
* const addToHistory = false;
|
211
|
+
* editor.dispatchNoAnnounce(editor.viewport.zoomTo(someRectangle), addToHistory);
|
212
|
+
* ```
|
213
|
+
*/
|
214
|
+
dispatchNoAnnounce(command: Command, addToHistory?: boolean): void | Promise<void>;
|
215
|
+
/**
|
216
|
+
* Apply a large transformation in chunks.
|
217
|
+
* If `apply` is `false`, the commands are unapplied.
|
218
|
+
* Triggers a re-render after each `updateChunkSize`-sized group of commands
|
219
|
+
* has been applied.
|
220
|
+
*/
|
221
|
+
asyncApplyOrUnapplyCommands(commands: Command[], apply: boolean, updateChunkSize: number): Promise<void>;
|
222
|
+
asyncApplyCommands(commands: Command[], chunkSize: number): Promise<void>;
|
223
|
+
asyncUnapplyCommands(commands: Command[], chunkSize: number, unapplyInReverseOrder?: boolean): Promise<void>;
|
224
|
+
private announceUndoCallback;
|
225
|
+
private announceRedoCallback;
|
226
|
+
private nextRerenderListeners;
|
227
|
+
private rerenderQueued;
|
228
|
+
/**
|
229
|
+
* Schedule a re-render for some time in the near future. Does not schedule an additional
|
230
|
+
* re-render if a re-render is already queued.
|
231
|
+
*
|
232
|
+
* @returns a promise that resolves when re-rendering has completed.
|
233
|
+
*/
|
234
|
+
queueRerender(): Promise<void>;
|
235
|
+
isRerenderQueued(): boolean;
|
236
|
+
/**
|
237
|
+
* Re-renders the entire image.
|
238
|
+
*
|
239
|
+
* @see {@link Editor.queueRerender}
|
240
|
+
*/
|
241
|
+
rerender(showImageBounds?: boolean): void;
|
242
|
+
/**
|
243
|
+
* Draws the given path onto the wet ink renderer. The given path will
|
244
|
+
* be displayed on top of the main image.
|
245
|
+
*
|
246
|
+
* @see {@link Display.getWetInkRenderer} {@link Display.flatten}
|
247
|
+
*/
|
248
|
+
drawWetInk(...path: RenderablePathSpec[]): void;
|
249
|
+
/**
|
250
|
+
* Clears the wet ink display.
|
251
|
+
*
|
252
|
+
* @see {@link Display.getWetInkRenderer}
|
253
|
+
*/
|
254
|
+
clearWetInk(): void;
|
255
|
+
/**
|
256
|
+
* Focuses the region used for text input/key commands.
|
257
|
+
*/
|
258
|
+
focus(): void;
|
259
|
+
/**
|
260
|
+
* Creates an element that will be positioned on top of the dry/wet ink
|
261
|
+
* renderers.
|
262
|
+
*
|
263
|
+
* This is useful for displaying content on top of the rendered content
|
264
|
+
* (e.g. a selection box).
|
265
|
+
*/
|
266
|
+
createHTMLOverlay(overlay: HTMLElement): {
|
267
|
+
remove: () => void;
|
268
|
+
};
|
269
|
+
addStyleSheet(content: string): HTMLStyleElement;
|
270
|
+
sendKeyboardEvent(eventType: InputEvtType.KeyPressEvent | InputEvtType.KeyUpEvent, key: string, ctrlKey?: boolean, altKey?: boolean): void;
|
271
|
+
/**
|
272
|
+
* Dispatch a pen event to the currently selected tool.
|
273
|
+
* Intended primarially for unit tests.
|
274
|
+
*
|
275
|
+
* @deprecated
|
276
|
+
* @see {@link sendPenEvent} {@link sendTouchEvent}
|
277
|
+
*/
|
278
|
+
sendPenEvent(eventType: InputEvtType.PointerDownEvt | InputEvtType.PointerMoveEvt | InputEvtType.PointerUpEvt, point: Point2, allPointers?: Pointer[]): void;
|
279
|
+
addAndCenterComponents(components: AbstractComponent[], selectComponents?: boolean): Promise<void>;
|
280
|
+
toDataURL(format?: 'image/png' | 'image/jpeg' | 'image/webp'): string;
|
281
|
+
toSVG(): SVGElement;
|
282
|
+
/**
|
283
|
+
* Load editor data from an `ImageLoader` (e.g. an {@link SVGLoader}).
|
284
|
+
*
|
285
|
+
* @see loadFromSVG
|
286
|
+
*/
|
287
|
+
loadFrom(loader: ImageLoader): Promise<void>;
|
288
|
+
private getTopmostBackgroundComponent;
|
289
|
+
/**
|
290
|
+
* Set the background color of the image.
|
291
|
+
*/
|
292
|
+
setBackgroundColor(color: Color4): Command;
|
293
|
+
/**
|
294
|
+
* @returns the average of the colors of all background components. Use this to get the current background
|
295
|
+
* color.
|
296
|
+
*/
|
297
|
+
estimateBackgroundColor(): Color4;
|
298
|
+
getImportExportRect(): Rect2;
|
299
|
+
setImportExportRect(imageRect: Rect2): Command;
|
300
|
+
/**
|
301
|
+
* Alias for loadFrom(SVGLoader.fromString).
|
302
|
+
*
|
303
|
+
* This is particularly useful when accessing a bundled version of the editor,
|
304
|
+
* where `SVGLoader.fromString` is unavailable.
|
305
|
+
*/
|
306
|
+
loadFromSVG(svgData: string, sanitize?: boolean): Promise<void>;
|
307
|
+
}
|
308
|
+
export default Editor;
|
@@ -7,32 +7,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
8
|
});
|
9
9
|
};
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import
|
16
|
-
import
|
17
|
-
import
|
18
|
-
import
|
19
|
-
import
|
20
|
-
import
|
21
|
-
import
|
22
|
-
import
|
23
|
-
import
|
24
|
-
import
|
25
|
-
import
|
26
|
-
import
|
27
|
-
import
|
28
|
-
import
|
29
|
-
import
|
30
|
-
import
|
31
|
-
import
|
32
|
-
import
|
33
|
-
import
|
34
|
-
import
|
35
|
-
import
|
10
|
+
import EditorImage from './EditorImage.mjs';
|
11
|
+
import ToolController from './tools/ToolController.mjs';
|
12
|
+
import { InputEvtType, EditorEventType } from './types.mjs';
|
13
|
+
import UndoRedoHistory from './UndoRedoHistory.mjs';
|
14
|
+
import Viewport from './Viewport.mjs';
|
15
|
+
import EventDispatcher from './EventDispatcher.mjs';
|
16
|
+
import { Vec2 } from './math/Vec2.mjs';
|
17
|
+
import Vec3 from './math/Vec3.mjs';
|
18
|
+
import HTMLToolbar from './toolbar/HTMLToolbar.mjs';
|
19
|
+
import Display, { RenderingMode } from './rendering/Display.mjs';
|
20
|
+
import SVGRenderer from './rendering/renderers/SVGRenderer.mjs';
|
21
|
+
import Color4 from './Color4.mjs';
|
22
|
+
import SVGLoader from './SVGLoader.mjs';
|
23
|
+
import Pointer from './Pointer.mjs';
|
24
|
+
import Mat33 from './math/Mat33.mjs';
|
25
|
+
import getLocalizationTable from './localizations/getLocalizationTable.mjs';
|
26
|
+
import IconProvider from './toolbar/IconProvider.mjs';
|
27
|
+
import { toRoundedString } from './math/rounding.mjs';
|
28
|
+
import CanvasRenderer from './rendering/renderers/CanvasRenderer.mjs';
|
29
|
+
import untilNextAnimationFrame from './util/untilNextAnimationFrame.mjs';
|
30
|
+
import fileToBase64 from './util/fileToBase64.mjs';
|
31
|
+
import uniteCommands from './commands/uniteCommands.mjs';
|
32
|
+
import SelectionTool from './tools/SelectionTool/SelectionTool.mjs';
|
33
|
+
import Erase from './commands/Erase.mjs';
|
34
|
+
import ImageBackground, { BackgroundType } from './components/ImageBackground.mjs';
|
35
|
+
import sendPenEvent from './testing/sendPenEvent.mjs';
|
36
36
|
/**
|
37
37
|
* The main entrypoint for the full editor.
|
38
38
|
*
|