js-draw 0.18.2 → 0.19.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/CHANGELOG.md +7 -0
- package/dist/bundle.js +2 -2
- package/dist/bundledStyles.js +1 -0
- package/dist/cjs/src/Color4.d.ts +8 -0
- package/dist/cjs/src/Color4.js +67 -0
- package/dist/cjs/src/Editor.d.ts +2 -2
- package/dist/cjs/src/Editor.js +2 -2
- package/dist/cjs/src/SVGLoader.js +8 -5
- package/dist/cjs/src/components/AbstractComponent.d.ts +2 -2
- package/dist/cjs/src/components/AbstractComponent.js +3 -3
- package/dist/cjs/src/components/ImageBackground.js +1 -1
- package/dist/cjs/src/components/RestylableComponent.d.ts +21 -2
- package/dist/cjs/src/components/Stroke.d.ts +35 -0
- package/dist/cjs/src/components/Stroke.js +36 -2
- package/dist/cjs/src/components/TextComponent.d.ts +26 -4
- package/dist/cjs/src/components/TextComponent.js +22 -0
- package/dist/cjs/src/components/lib.d.ts +3 -2
- package/dist/cjs/src/lib.d.ts +30 -0
- package/dist/cjs/src/lib.js +30 -0
- package/dist/cjs/src/rendering/RenderingStyle.d.ts +4 -4
- package/dist/cjs/src/rendering/TextRenderingStyle.d.ts +10 -10
- package/dist/cjs/src/rendering/lib.d.ts +2 -0
- package/dist/cjs/src/rendering/renderers/AbstractRenderer.d.ts +2 -2
- package/dist/cjs/src/rendering/renderers/CanvasRenderer.d.ts +2 -2
- package/dist/cjs/src/rendering/renderers/DummyRenderer.d.ts +2 -2
- package/dist/cjs/src/rendering/renderers/SVGRenderer.d.ts +2 -2
- package/dist/cjs/src/rendering/renderers/TextOnlyRenderer.d.ts +2 -2
- package/dist/cjs/src/toolbar/IconProvider.d.ts +2 -2
- package/dist/cjs/src/toolbar/localization.js +1 -1
- package/dist/cjs/src/toolbar/widgets/BaseWidget.js +1 -1
- package/dist/cjs/src/tools/SoundUITool.d.ts +24 -0
- package/dist/cjs/src/tools/SoundUITool.js +164 -0
- package/dist/cjs/src/tools/TextTool.d.ts +2 -2
- package/dist/cjs/src/tools/ToolController.js +6 -1
- package/dist/cjs/src/tools/lib.d.ts +1 -0
- package/dist/cjs/src/tools/lib.js +3 -1
- package/dist/cjs/src/tools/localization.d.ts +3 -0
- package/dist/cjs/src/tools/localization.js +3 -0
- package/dist/mjs/src/Color4.d.ts +8 -0
- package/dist/mjs/src/Color4.mjs +64 -0
- package/dist/mjs/src/Editor.d.ts +2 -2
- package/dist/mjs/src/Editor.mjs +2 -2
- package/dist/mjs/src/SVGLoader.mjs +8 -5
- package/dist/mjs/src/components/AbstractComponent.d.ts +2 -2
- package/dist/mjs/src/components/AbstractComponent.mjs +3 -3
- package/dist/mjs/src/components/ImageBackground.mjs +1 -1
- package/dist/mjs/src/components/RestylableComponent.d.ts +21 -2
- package/dist/mjs/src/components/Stroke.d.ts +35 -0
- package/dist/mjs/src/components/Stroke.mjs +36 -2
- package/dist/mjs/src/components/TextComponent.d.ts +26 -4
- package/dist/mjs/src/components/TextComponent.mjs +22 -0
- package/dist/mjs/src/components/lib.d.ts +3 -2
- package/dist/mjs/src/lib.d.ts +30 -0
- package/dist/mjs/src/lib.mjs +30 -0
- package/dist/mjs/src/rendering/RenderingStyle.d.ts +4 -4
- package/dist/mjs/src/rendering/TextRenderingStyle.d.ts +10 -10
- package/dist/mjs/src/rendering/lib.d.ts +2 -0
- package/dist/mjs/src/rendering/renderers/AbstractRenderer.d.ts +2 -2
- package/dist/mjs/src/rendering/renderers/CanvasRenderer.d.ts +2 -2
- package/dist/mjs/src/rendering/renderers/DummyRenderer.d.ts +2 -2
- package/dist/mjs/src/rendering/renderers/SVGRenderer.d.ts +2 -2
- package/dist/mjs/src/rendering/renderers/TextOnlyRenderer.d.ts +2 -2
- package/dist/mjs/src/toolbar/IconProvider.d.ts +2 -2
- package/dist/mjs/src/toolbar/localization.mjs +1 -1
- package/dist/mjs/src/toolbar/widgets/BaseWidget.mjs +1 -1
- package/dist/mjs/src/tools/SoundUITool.d.ts +24 -0
- package/dist/mjs/src/tools/SoundUITool.mjs +158 -0
- package/dist/mjs/src/tools/TextTool.d.ts +2 -2
- package/dist/mjs/src/tools/ToolController.mjs +6 -1
- package/dist/mjs/src/tools/lib.d.ts +1 -0
- package/dist/mjs/src/tools/lib.mjs +1 -0
- package/dist/mjs/src/tools/localization.d.ts +3 -0
- package/dist/mjs/src/tools/localization.mjs +3 -0
- package/package.json +6 -4
- package/src/Editor.css +2 -2
- package/src/tools/SoundUITool.css +15 -0
- package/src/tools/tools.css +4 -0
- package/src/Color4.test.ts +0 -40
- package/src/Color4.ts +0 -236
- package/src/Editor.loadFrom.test.ts +0 -24
- package/src/Editor.toSVG.test.ts +0 -111
- package/src/Editor.ts +0 -1122
- package/src/EditorImage.test.ts +0 -120
- package/src/EditorImage.ts +0 -603
- package/src/EventDispatcher.test.ts +0 -123
- package/src/EventDispatcher.ts +0 -71
- package/src/Pointer.ts +0 -127
- package/src/SVGLoader.test.ts +0 -114
- package/src/SVGLoader.ts +0 -511
- package/src/UndoRedoHistory.test.ts +0 -33
- package/src/UndoRedoHistory.ts +0 -102
- package/src/Viewport.ts +0 -319
- package/src/bundle/bundled.ts +0 -7
- package/src/commands/Command.ts +0 -45
- package/src/commands/Duplicate.ts +0 -48
- package/src/commands/Erase.ts +0 -74
- package/src/commands/SerializableCommand.ts +0 -49
- package/src/commands/UnresolvedCommand.ts +0 -37
- package/src/commands/invertCommand.ts +0 -51
- package/src/commands/lib.ts +0 -16
- package/src/commands/localization.ts +0 -47
- package/src/commands/uniteCommands.test.ts +0 -23
- package/src/commands/uniteCommands.ts +0 -135
- package/src/components/AbstractComponent.transformBy.test.ts +0 -22
- package/src/components/AbstractComponent.ts +0 -364
- package/src/components/ImageBackground.test.ts +0 -35
- package/src/components/ImageBackground.ts +0 -176
- package/src/components/ImageComponent.ts +0 -171
- package/src/components/RestylableComponent.ts +0 -142
- package/src/components/SVGGlobalAttributesObject.ts +0 -81
- package/src/components/Stroke.test.ts +0 -139
- package/src/components/Stroke.ts +0 -245
- package/src/components/TextComponent.test.ts +0 -99
- package/src/components/TextComponent.ts +0 -315
- package/src/components/UnknownSVGObject.test.ts +0 -10
- package/src/components/UnknownSVGObject.ts +0 -60
- package/src/components/builders/ArrowBuilder.ts +0 -107
- package/src/components/builders/FreehandLineBuilder.ts +0 -212
- package/src/components/builders/LineBuilder.ts +0 -77
- package/src/components/builders/PressureSensitiveFreehandLineBuilder.ts +0 -454
- package/src/components/builders/RectangleBuilder.ts +0 -74
- package/src/components/builders/types.ts +0 -15
- package/src/components/lib.ts +0 -25
- package/src/components/localization.ts +0 -22
- package/src/components/util/StrokeSmoother.ts +0 -293
- package/src/components/util/describeComponentList.ts +0 -18
- package/src/lib.ts +0 -37
- package/src/localization.ts +0 -34
- package/src/localizations/de.ts +0 -98
- package/src/localizations/en.ts +0 -8
- package/src/localizations/es.ts +0 -74
- package/src/localizations/getLocalizationTable.test.ts +0 -27
- package/src/localizations/getLocalizationTable.ts +0 -55
- package/src/math/LineSegment2.test.ts +0 -99
- package/src/math/LineSegment2.ts +0 -160
- package/src/math/Mat33.test.ts +0 -244
- package/src/math/Mat33.ts +0 -437
- package/src/math/Path.fromString.test.ts +0 -223
- package/src/math/Path.test.ts +0 -198
- package/src/math/Path.toString.test.ts +0 -77
- package/src/math/Path.ts +0 -790
- package/src/math/Rect2.test.ts +0 -204
- package/src/math/Rect2.ts +0 -315
- package/src/math/Triangle.ts +0 -29
- package/src/math/Vec2.test.ts +0 -30
- package/src/math/Vec2.ts +0 -18
- package/src/math/Vec3.test.ts +0 -44
- package/src/math/Vec3.ts +0 -218
- package/src/math/lib.ts +0 -15
- package/src/math/rounding.test.ts +0 -65
- package/src/math/rounding.ts +0 -156
- package/src/rendering/Display.ts +0 -249
- package/src/rendering/RenderingStyle.test.ts +0 -68
- package/src/rendering/RenderingStyle.ts +0 -55
- package/src/rendering/TextRenderingStyle.ts +0 -45
- package/src/rendering/caching/CacheRecord.test.ts +0 -49
- package/src/rendering/caching/CacheRecord.ts +0 -77
- package/src/rendering/caching/CacheRecordManager.ts +0 -71
- package/src/rendering/caching/RenderingCache.test.ts +0 -44
- package/src/rendering/caching/RenderingCache.ts +0 -66
- package/src/rendering/caching/RenderingCacheNode.ts +0 -405
- package/src/rendering/caching/testUtils.ts +0 -35
- package/src/rendering/caching/types.ts +0 -34
- package/src/rendering/lib.ts +0 -6
- package/src/rendering/localization.ts +0 -20
- package/src/rendering/renderers/AbstractRenderer.ts +0 -222
- package/src/rendering/renderers/CanvasRenderer.ts +0 -296
- package/src/rendering/renderers/DummyRenderer.test.ts +0 -42
- package/src/rendering/renderers/DummyRenderer.ts +0 -136
- package/src/rendering/renderers/SVGRenderer.ts +0 -354
- package/src/rendering/renderers/TextOnlyRenderer.ts +0 -70
- package/src/testing/beforeEachFile.ts +0 -8
- package/src/testing/createEditor.ts +0 -11
- package/src/testing/global.d.ts +0 -17
- package/src/testing/lib.ts +0 -3
- package/src/testing/loadExpectExtensions.ts +0 -25
- package/src/testing/sendPenEvent.ts +0 -31
- package/src/testing/sendTouchEvent.ts +0 -78
- package/src/toolbar/HTMLToolbar.ts +0 -492
- package/src/toolbar/IconProvider.ts +0 -736
- package/src/toolbar/lib.ts +0 -4
- package/src/toolbar/localization.ts +0 -106
- package/src/toolbar/makeColorInput.ts +0 -145
- package/src/toolbar/types.ts +0 -5
- package/src/toolbar/widgets/ActionButtonWidget.ts +0 -39
- package/src/toolbar/widgets/BaseToolWidget.ts +0 -56
- package/src/toolbar/widgets/BaseWidget.ts +0 -377
- package/src/toolbar/widgets/DocumentPropertiesWidget.ts +0 -167
- package/src/toolbar/widgets/EraserToolWidget.ts +0 -85
- package/src/toolbar/widgets/HandToolWidget.ts +0 -250
- package/src/toolbar/widgets/InsertImageWidget.ts +0 -223
- package/src/toolbar/widgets/OverflowWidget.ts +0 -92
- package/src/toolbar/widgets/PenToolWidget.ts +0 -288
- package/src/toolbar/widgets/SelectionToolWidget.ts +0 -190
- package/src/toolbar/widgets/TextToolWidget.ts +0 -145
- package/src/toolbar/widgets/lib.ts +0 -13
- package/src/tools/BaseTool.ts +0 -76
- package/src/tools/Eraser.test.ts +0 -103
- package/src/tools/Eraser.ts +0 -139
- package/src/tools/FindTool.ts +0 -152
- package/src/tools/PanZoom.test.ts +0 -310
- package/src/tools/PanZoom.ts +0 -520
- package/src/tools/PasteHandler.ts +0 -95
- package/src/tools/Pen.test.ts +0 -194
- package/src/tools/Pen.ts +0 -226
- package/src/tools/PipetteTool.ts +0 -55
- package/src/tools/SelectionTool/SelectAllShortcutHandler.ts +0 -28
- package/src/tools/SelectionTool/Selection.ts +0 -607
- package/src/tools/SelectionTool/SelectionHandle.ts +0 -108
- package/src/tools/SelectionTool/SelectionTool.test.ts +0 -261
- package/src/tools/SelectionTool/SelectionTool.ts +0 -480
- package/src/tools/SelectionTool/TransformMode.ts +0 -114
- package/src/tools/SelectionTool/types.ts +0 -11
- package/src/tools/TextTool.ts +0 -326
- package/src/tools/ToolController.ts +0 -178
- package/src/tools/ToolEnabledGroup.ts +0 -14
- package/src/tools/ToolSwitcherShortcut.ts +0 -39
- package/src/tools/ToolbarShortcutHandler.ts +0 -34
- package/src/tools/UndoRedoShortcut.test.ts +0 -56
- package/src/tools/UndoRedoShortcut.ts +0 -25
- package/src/tools/lib.ts +0 -21
- package/src/tools/localization.ts +0 -66
- package/src/types.ts +0 -234
- package/src/util/assertions.ts +0 -55
- package/src/util/fileToBase64.ts +0 -18
- package/src/util/untilNextAnimationFrame.ts +0 -9
- package/src/util/waitForTimeout.ts +0 -9
@@ -0,0 +1 @@
|
|
1
|
+
(()=>{"use strict";var r={786:(r,n,o)=>{o.d(n,{Z:()=>l});var t=o(81),e=o.n(t),i=o(645),a=o.n(i)()(e());a.push([r.id,'.clr-picker {\r\n display: none;\r\n flex-wrap: wrap;\r\n position: absolute;\r\n width: 200px;\r\n z-index: 1000;\r\n border-radius: 10px;\r\n background-color: #fff;\r\n justify-content: flex-end;\r\n direction: ltr;\r\n box-shadow: 0 0 5px rgba(0,0,0,.05), 0 5px 20px rgba(0,0,0,.1);\r\n -moz-user-select: none;\r\n -webkit-user-select: none;\r\n user-select: none;\r\n}\r\n\r\n.clr-picker.clr-open,\r\n.clr-picker[data-inline="true"] {\r\n display: flex;\r\n}\r\n\r\n.clr-picker[data-inline="true"] {\r\n position: relative;\r\n}\r\n\r\n.clr-gradient {\r\n position: relative;\r\n width: 100%;\r\n height: 100px;\r\n margin-bottom: 15px;\r\n border-radius: 3px 3px 0 0;\r\n background-image: linear-gradient(rgba(0,0,0,0), #000), linear-gradient(90deg, #fff, currentColor);\r\n cursor: pointer;\r\n}\r\n\r\n.clr-marker {\r\n position: absolute;\r\n width: 12px;\r\n height: 12px;\r\n margin: -6px 0 0 -6px;\r\n border: 1px solid #fff;\r\n border-radius: 50%;\r\n background-color: currentColor;\r\n cursor: pointer;\r\n}\r\n\r\n.clr-picker input[type="range"]::-webkit-slider-runnable-track {\r\n width: 100%;\r\n height: 8px;\r\n}\r\n\r\n.clr-picker input[type="range"]::-webkit-slider-thumb {\r\n width: 8px;\r\n height: 8px;\r\n -webkit-appearance: none;\r\n}\r\n\r\n.clr-picker input[type="range"]::-moz-range-track {\r\n width: 100%;\r\n height: 8px;\r\n border: 0;\r\n}\r\n\r\n.clr-picker input[type="range"]::-moz-range-thumb {\r\n width: 8px;\r\n height: 8px;\r\n border: 0;\r\n}\r\n\r\n.clr-hue {\r\n background-image: linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);\r\n}\r\n\r\n.clr-hue,\r\n.clr-alpha {\r\n position: relative;\r\n width: calc(100% - 40px);\r\n height: 8px;\r\n margin: 5px 20px;\r\n border-radius: 4px;\r\n}\r\n\r\n.clr-alpha span {\r\n display: block;\r\n height: 100%;\r\n width: 100%;\r\n border-radius: inherit;\r\n background-image: linear-gradient(90deg, rgba(0,0,0,0), currentColor);\r\n}\r\n\r\n.clr-hue input,\r\n.clr-alpha input {\r\n position: absolute;\r\n width: calc(100% + 16px);\r\n height: 16px;\r\n left: -8px;\r\n top: -4px;\r\n margin: 0;\r\n background-color: transparent;\r\n opacity: 0;\r\n cursor: pointer;\r\n appearance: none;\r\n -webkit-appearance: none;\r\n}\r\n\r\n.clr-hue div,\r\n.clr-alpha div {\r\n position: absolute;\r\n width: 16px;\r\n height: 16px;\r\n left: 0;\r\n top: 50%;\r\n margin-left: -8px;\r\n transform: translateY(-50%);\r\n border: 2px solid #fff;\r\n border-radius: 50%;\r\n background-color: currentColor;\r\n box-shadow: 0 0 1px #888;\r\n pointer-events: none;\r\n}\r\n\r\n.clr-alpha div:before {\r\n content: \'\';\r\n position: absolute;\r\n height: 100%;\r\n width: 100%;\r\n left: 0;\r\n top: 0;\r\n border-radius: 50%;\r\n background-color: currentColor;\r\n}\r\n\r\n.clr-format {\r\n display: none;\r\n order: 1;\r\n width: calc(100% - 40px);\r\n margin: 0 20px 20px;\r\n}\r\n\r\n.clr-segmented {\r\n display: flex;\r\n position: relative;\r\n width: 100%;\r\n margin: 0;\r\n padding: 0;\r\n border: 1px solid #ddd;\r\n border-radius: 15px;\r\n box-sizing: border-box;\r\n color: #999;\r\n font-size: 12px;\r\n}\r\n\r\n.clr-segmented input,\r\n.clr-segmented legend {\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n margin: 0;\r\n padding: 0;\r\n border: 0;\r\n left: 0;\r\n top: 0;\r\n opacity: 0;\r\n pointer-events: none;\r\n}\r\n\r\n.clr-segmented label {\r\n flex-grow: 1;\r\n margin: 0;\r\n padding: 4px 0;\r\n font-size: inherit;\r\n font-weight: normal;\r\n line-height: initial;\r\n text-align: center;\r\n cursor: pointer;\r\n}\r\n\r\n.clr-segmented label:first-of-type {\r\n border-radius: 10px 0 0 10px;\r\n}\r\n\r\n.clr-segmented label:last-of-type {\r\n border-radius: 0 10px 10px 0;\r\n}\r\n\r\n.clr-segmented input:checked + label {\r\n color: #fff;\r\n background-color: #666;\r\n}\r\n\r\n.clr-swatches {\r\n order: 2;\r\n width: calc(100% - 32px);\r\n margin: 0 16px;\r\n}\r\n\r\n.clr-swatches div {\r\n display: flex;\r\n flex-wrap: wrap;\r\n padding-bottom: 12px;\r\n justify-content: center;\r\n}\r\n\r\n.clr-swatches button {\r\n position: relative;\r\n width: 20px;\r\n height: 20px;\r\n margin: 0 4px 6px 4px;\r\n padding: 0;\r\n border: 0;\r\n border-radius: 50%;\r\n color: inherit;\r\n text-indent: -1000px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n cursor: pointer;\r\n}\r\n\r\n.clr-swatches button:after {\r\n content: \'\';\r\n display: block;\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n border-radius: inherit;\r\n background-color: currentColor;\r\n box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);\r\n}\r\n\r\ninput.clr-color {\r\n order: 1;\r\n width: calc(100% - 80px);\r\n height: 32px;\r\n margin: 15px 20px 20px auto;\r\n padding: 0 10px;\r\n border: 1px solid #ddd;\r\n border-radius: 16px;\r\n color: #444;\r\n background-color: #fff;\r\n font-family: sans-serif;\r\n font-size: 14px;\r\n text-align: center;\r\n box-shadow: none;\r\n}\r\n\r\ninput.clr-color:focus {\r\n outline: none;\r\n border: 1px solid #1e90ff;\r\n}\r\n\r\n.clr-close,\r\n.clr-clear {\r\n display: none;\r\n order: 2;\r\n height: 24px;\r\n margin: 0 20px 20px;\r\n padding: 0 20px;\r\n border: 0;\r\n border-radius: 12px;\r\n color: #fff;\r\n background-color: #666;\r\n font-family: inherit;\r\n font-size: 12px;\r\n font-weight: 400;\r\n cursor: pointer;\r\n}\r\n\r\n.clr-close {\r\n display: block;\r\n margin: 0 20px 20px auto;\r\n}\r\n\r\n.clr-preview {\r\n position: relative;\r\n width: 32px;\r\n height: 32px;\r\n margin: 15px 0 20px 20px;\r\n border-radius: 50%;\r\n overflow: hidden;\r\n}\r\n\r\n.clr-preview:before,\r\n.clr-preview:after {\r\n content: \'\';\r\n position: absolute;\r\n height: 100%;\r\n width: 100%;\r\n left: 0;\r\n top: 0;\r\n border: 1px solid #fff;\r\n border-radius: 50%;\r\n}\r\n\r\n.clr-preview:after {\r\n border: 0;\r\n background-color: currentColor;\r\n box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);\r\n}\r\n\r\n.clr-preview button {\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n z-index: 1;\r\n margin: 0;\r\n padding: 0;\r\n border: 0;\r\n background-color: transparent;\r\n text-indent: -9999px;\r\n cursor: pointer;\r\n}\r\n\r\n.clr-marker,\r\n.clr-hue div,\r\n.clr-alpha div,\r\n.clr-color {\r\n box-sizing: border-box;\r\n}\r\n\r\n.clr-field {\r\n display: inline-block;\r\n position: relative;\r\n color: transparent;\r\n}\r\n\r\n.clr-field input {\r\n margin: 0;\r\n direction: ltr;\r\n}\r\n\r\n.clr-field.clr-rtl input {\r\n text-align: right;\r\n}\r\n\r\n.clr-field button {\r\n position: absolute;\r\n width: 30px;\r\n height: 100%;\r\n right: 0;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n margin: 0;\r\n padding: 0;\r\n border: 0;\r\n color: inherit;\r\n text-indent: -1000px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n pointer-events: none;\r\n}\r\n\r\n.clr-field.clr-rtl button {\r\n right: auto;\r\n left: 0;\r\n}\r\n\r\n.clr-field button:after {\r\n content: \'\';\r\n display: block;\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n border-radius: inherit;\r\n background-color: currentColor;\r\n box-shadow: inset 0 0 1px rgba(0,0,0,.5);\r\n}\r\n\r\n.clr-alpha,\r\n.clr-alpha div,\r\n.clr-swatches button,\r\n.clr-preview:before,\r\n.clr-field button {\r\n background-image: repeating-linear-gradient(45deg, #aaa 25%, transparent 25%, transparent 75%, #aaa 75%, #aaa), repeating-linear-gradient(45deg, #aaa 25%, #fff 25%, #fff 75%, #aaa 75%, #aaa);\r\n background-position: 0 0, 4px 4px;\r\n background-size: 8px 8px;\r\n}\r\n\r\n.clr-marker:focus {\r\n outline: none;\r\n}\r\n\r\n.clr-keyboard-nav .clr-marker:focus,\r\n.clr-keyboard-nav .clr-hue input:focus + div,\r\n.clr-keyboard-nav .clr-alpha input:focus + div,\r\n.clr-keyboard-nav .clr-segmented input:focus + label {\r\n outline: none;\r\n box-shadow: 0 0 0 2px #1e90ff, 0 0 2px 2px #fff;\r\n}\r\n\r\n.clr-picker[data-alpha="false"] .clr-alpha {\r\n display: none;\r\n}\r\n\r\n.clr-picker[data-minimal="true"] {\r\n padding-top: 16px;\r\n}\r\n\r\n.clr-picker[data-minimal="true"] .clr-gradient,\r\n.clr-picker[data-minimal="true"] .clr-hue,\r\n.clr-picker[data-minimal="true"] .clr-alpha,\r\n.clr-picker[data-minimal="true"] .clr-color,\r\n.clr-picker[data-minimal="true"] .clr-preview {\r\n display: none;\r\n}\r\n\r\n/** Dark theme **/\r\n\r\n.clr-dark {\r\n background-color: #444;\r\n}\r\n\r\n.clr-dark .clr-segmented {\r\n border-color: #777;\r\n}\r\n\r\n.clr-dark .clr-swatches button:after {\r\n box-shadow: inset 0 0 0 1px rgba(255,255,255,.3);\r\n}\r\n\r\n.clr-dark input.clr-color {\r\n color: #fff;\r\n border-color: #777;\r\n background-color: #555;\r\n}\r\n\r\n.clr-dark input.clr-color:focus {\r\n border-color: #1e90ff;\r\n}\r\n\r\n.clr-dark .clr-preview:after {\r\n box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);\r\n}\r\n\r\n.clr-dark .clr-alpha,\r\n.clr-dark .clr-alpha div,\r\n.clr-dark .clr-swatches button,\r\n.clr-dark .clr-preview:before {\r\n background-image: repeating-linear-gradient(45deg, #666 25%, transparent 25%, transparent 75%, #888 75%, #888), repeating-linear-gradient(45deg, #888 25%, #444 25%, #444 75%, #888 75%, #888);\r\n}\r\n\r\n/** Polaroid theme **/\r\n\r\n.clr-picker.clr-polaroid {\r\n border-radius: 6px;\r\n box-shadow: 0 0 5px rgba(0,0,0,.1), 0 5px 30px rgba(0,0,0,.2);\r\n}\r\n\r\n.clr-picker.clr-polaroid:before {\r\n content: \'\';\r\n display: block;\r\n position: absolute;\r\n width: 16px;\r\n height: 10px;\r\n left: 20px;\r\n top: -10px;\r\n border: solid transparent;\r\n border-width: 0 8px 10px 8px;\r\n border-bottom-color: currentColor;\r\n box-sizing: border-box;\r\n color: #fff;\r\n filter: drop-shadow(0 -4px 3px rgba(0,0,0,.1));\r\n pointer-events: none;\r\n}\r\n\r\n.clr-picker.clr-polaroid.clr-dark:before {\r\n color: #444;\r\n}\r\n\r\n.clr-picker.clr-polaroid.clr-left:before {\r\n left: auto;\r\n right: 20px;\r\n}\r\n\r\n.clr-picker.clr-polaroid.clr-top:before {\r\n top: auto;\r\n bottom: -10px;\r\n transform: rotateZ(180deg);\r\n}\r\n\r\n.clr-polaroid .clr-gradient {\r\n width: calc(100% - 20px);\r\n height: 120px;\r\n margin: 10px;\r\n border-radius: 3px;\r\n}\r\n\r\n.clr-polaroid .clr-hue,\r\n.clr-polaroid .clr-alpha {\r\n width: calc(100% - 30px);\r\n height: 10px;\r\n margin: 6px 15px;\r\n border-radius: 5px;\r\n}\r\n\r\n.clr-polaroid .clr-hue div,\r\n.clr-polaroid .clr-alpha div {\r\n box-shadow: 0 0 5px rgba(0,0,0,.2);\r\n}\r\n\r\n.clr-polaroid .clr-format {\r\n width: calc(100% - 20px);\r\n margin: 0 10px 15px;\r\n}\r\n\r\n.clr-polaroid .clr-swatches {\r\n width: calc(100% - 12px);\r\n margin: 0 6px;\r\n}\r\n.clr-polaroid .clr-swatches div {\r\n padding-bottom: 10px;\r\n}\r\n\r\n.clr-polaroid .clr-swatches button {\r\n width: 22px;\r\n height: 22px;\r\n}\r\n\r\n.clr-polaroid input.clr-color {\r\n width: calc(100% - 60px);\r\n margin: 10px 10px 15px auto;\r\n}\r\n\r\n.clr-polaroid .clr-clear {\r\n margin: 0 10px 15px 10px;\r\n}\r\n\r\n.clr-polaroid .clr-close {\r\n margin: 0 10px 15px auto;\r\n}\r\n\r\n.clr-polaroid .clr-preview {\r\n margin: 10px 0 15px 10px;\r\n}\r\n\r\n/** Large theme **/\r\n\r\n.clr-picker.clr-large {\r\n width: 275px;\r\n}\r\n\r\n.clr-large .clr-gradient {\r\n height: 150px;\r\n}\r\n\r\n.clr-large .clr-swatches button {\r\n width: 22px;\r\n height: 22px;\r\n}\r\n\r\n/** Pill (horizontal) theme **/\r\n\r\n.clr-picker.clr-pill {\r\n width: 380px;\r\n padding-left: 180px;\r\n box-sizing: border-box;\r\n}\r\n\r\n.clr-pill .clr-gradient {\r\n position: absolute;\r\n width: 180px;\r\n height: 100%;\r\n left: 0;\r\n top: 0;\r\n margin-bottom: 0;\r\n border-radius: 3px 0 0 3px;\r\n}\r\n\r\n.clr-pill .clr-hue {\r\n margin-top: 20px;\r\n}',""]);const l=a},59:(r,n,o)=>{o.d(n,{Z:()=>p});var t=o(81),e=o.n(t),i=o(645),a=o.n(i),l=o(771),d=o(443),c=a()(e());c.i(l.Z),c.i(d.Z),c.push([r.id,"\n.imageEditorContainer {\n\t/* Deafult colors for the editor */\n --primary-background-color: white;\n --primary-background-color-transparent: rgba(255, 255, 255, 0.5);\n --secondary-background-color: #faf;\n --primary-foreground-color: black;\n --secondary-foreground-color: black;\n\t--primary-shadow-color: rgba(0, 0, 0, 0.5);\n}\n\n@media (prefers-color-scheme: dark) {\n\t.imageEditorContainer {\n\t\t--primary-background-color: #151515;\n\t\t--primary-background-color-transparent: rgba(50, 50, 50, 0.5);\n\t\t--secondary-background-color: #607;\n\t\t--primary-foreground-color: white;\n\t\t--secondary-foreground-color: white;\n\t\t--primary-shadow-color: rgba(250, 250, 250, 0.5);\n\t}\n}\n\n.imageEditorContainer {\n\tcolor: var(--primary-foreground-color);\n\tfont-family: system-ui, -apple-system, sans-serif;\n\tbackground-color: var(--primary-background-color);\n\n\tdisplay: flex;\n\tflex-direction: column-reverse;\n}\n\n.imageEditorContainer .imageEditorRenderArea {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr;\n\tflex-grow: 2;\n\tflex-shrink: 1;\n\tmin-height: 100px;\n}\n\n.imageEditorContainer .imageEditorRenderArea canvas {\n\t/* Stack all canvases on top of each other */\n\tgrid-row: 1 / 1;\n\tgrid-column: 1 / 1;\n\ttouch-action: none;\n\n\t/* Fill the container */\n\tbox-sizing: border-box;\n\twidth: 100%;\n\theight: 100%;\n\n\t/* Allow the canvas to shrink (needed in Chrome) */\n\tmin-height: 0px;\n\tmax-height: inherit;\n}\n\n.imageEditorContainer .loadingMessage {\n\tposition: fixed;\n\ttext-align: center;\n\tfont-size: 2em;\n\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n}\n\n.imageEditorContainer .accessibilityAnnouncement {\n\topacity: 0;\n\twidth: 0;\n\theight: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n}\n\n.imageEditorContainer .textRendererOutputContainer {\n\twidth: 1px;\n\theight: 1px;\n\toverflow: hidden;\n}\n\n.imageEditorContainer .textRendererOutputContainer:focus-within {\n\toverflow: visible;\n\tz-index: 5;\n}\n",""]);const p=c},771:(r,n,o)=>{o.d(n,{Z:()=>p});var t=o(81),e=o.n(t),i=o(645),a=o.n(i),l=o(350),d=o(519),c=a()(e());c.i(l.Z),c.i(d.Z),c.push([r.id,".toolbar-root {\n\tbackground-color: var(--primary-background-color);\n\t--icon-color: var(--primary-foreground-color);\n\n\n\tborder: 1px solid var(--secondary-background-color);\n\tborder-radius: 2px;\n\tflex-wrap: wrap;\n\n\tbox-sizing: border-box;\n\twidth: 100%;\n\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n\n\t--toolbar-button-height: min(20vh, 60px);\n\n\t/* Display above selection dialogs, etc. */\n\tz-index: 2;\n\n\tfont-family: system-ui, -apple-system, sans-serif;\n}\n\n.toolbar-root > .toolbar-toolContainer > .toolbar-button,\n.toolbar-root > .toolbar-toolContainer > * > button,\n.toolbar-root > .toolbar-buttonGroup > button,\n.toolbar-root > .toolbar-button {\n\twidth: min-content;\n\twhite-space: pre;\n\theight: var(--toolbar-button-height);\n}\n\n.toolbar-dropdown .toolbar-button > .toolbar-icon {\n\tmax-width: 50px;\n\twidth: 100%;\n}\n\n.toolbar-button.disabled {\n\tfilter: opacity(0.5) sepia(0.2);\n\tcursor: unset;\n}\n\n.toolbar-button, .toolbar-root button {\n\tcursor: pointer;\n\ttext-align: center;\n\tborder-radius: 6px;\n\n\t--icon-color: var(--primary-foreground-color);\n\tbackground-color: var(--primary-background-color);\n\tcolor: var(--primary-foreground-color);\n\tborder: none;\n\tbox-shadow: 0px 0px 2px var(--primary-shadow-color);\n\n\ttransition: background-color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;\n}\n\n.toolbar-button,\n.toolbar-buttonGroup > button,\n.toolbar-toolContainer > * > button,\n.toolbar-root > button {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\n\tpadding-left: 3px;\n\tpadding-right: 3px;\n\tmargin-left: 3px;\n\tmargin-right: 3px;\n\n\tmin-width: 40px;\n\twidth: min-content;\n\tfont-size: 1em;\n}\n\n.toolbar-button > label {\n\tcursor: inherit;\n}\n\n.toolbar-dropdown > .toolbar-toolContainer > button,\n.toolbar-dropdown > .toolbar-toolContainer > .toolbar-button {\n\twidth: 6em;\n}\n\n.toolbar-button:not(.disabled):hover, .toolbar-root button:not(:disabled):hover {\n\tbox-shadow: 0px 2px 4px var(--primary-shadow-color);\n}\n\n.toolbar-root button:disabled {\n\tcursor: inherit;\n\tfilter: opacity(0.5);\n}\n\n.toolbar-root .toolbar-icon {\n\tflex-shrink: 1;\n\n\twidth: 100%;\n\tmin-width: 30px;\n\tmin-height: 30px;\n}\n\n.toolbar-toolContainer.selected > .toolbar-button {\n\tbackground-color: var(--secondary-background-color);\n\tcolor: var(--secondary-foreground-color);\n\t--icon-color: var(--secondary-foreground-color);\n}\n\n.toolbar-toolContainer:not(.selected):not(.dropdownShowable) > .toolbar-button > .toolbar-showHideDropdownIcon {\n\tdisplay: none;\n}\n\n.toolbar-toolContainer > .toolbar-button > .toolbar-showHideDropdownIcon {\n\theight: 10px;\n\ttransition: transform 0.5s ease;\n}\n\n.toolbar-toolContainer.dropdownVisible > .toolbar-button > .toolbar-showHideDropdownIcon {\n\ttransform: rotate(180deg);\n}\n\n.toolbar-dropdown.hidden,\n.toolbar-toolContainer:not(.selected):not(.dropdownShowable) > .toolbar-dropdown {\n\tdisplay: none;\n}\n\n.toolbar-dropdown {\n\tposition: absolute;\n\tpadding: 15px;\n\tpadding-top: 5px;\n\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tflex-direction: column;\n\tmax-height: 80vh;\n\n\tmax-width: fit-content;\n\n\t/* Prevent overlap/being displayed under the undo/redo buttons */\n\tz-index: 2;\n\tbackground-color: var(--primary-background-color);\n\tbox-shadow: 0px 3px 3px var(--primary-shadow-color);\n}\n\n.toolbar-buttonGroup {\n\tdisplay: flex;\n\tflex-direction: row;\n\tjustify-content: center;\n}\n\n.toolbar-closeColorPickerOverlay {\n\tdisplay: none;\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\tright: 0;\n\n\tbackground-color: var(--primary-background-color);\n\topacity: 0.3;\n}\n\n/* Make color selection buttons fill their containing label */\n.toolbar-dropdown .clr-field button {\n\twidth: 100%;\n\theight: 100%;\n\tborder-radius: 2px;\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.toolbar-root .toolbar-zoomLevelEditor {\n\tdisplay: flex;\n\tflex-direction: row;\n}\n\n.toolbar-root .toolbar-zoomLevelEditor .zoomDisplay {\n\tflex-grow: 1;\n}\n\n.toolbar-root .toolbar-zoomLevelEditor button {\n\tmin-width: 48px;\n}\n\n.color-input-container {\n\tdisplay: inline-flex;\n\tflex-direction: row;\n}\n\n.color-input-container .pipetteButton {\n\twidth: 30px;\n\theight: 30px;\n\tpadding: 0;\n\tdisplay: inline-flex;\n}\n\n.color-input-container .pipetteButton > svg {\n\twidth: 100%;\n}\n\n.color-input-container .pipetteButton.active {\n\tbackground-color: var(--secondary-background-color);\n\t--icon-color: var(--secondary-foreground-color);\n}\n\n.toolbar-spacedList > * {\n\tpadding-bottom: 5px;\n\tpadding-top: 5px;\n}",""]);const p=c},350:(r,n,o)=>{o.d(n,{Z:()=>l});var t=o(81),e=o.n(t),i=o(645),a=o.n(i)()(e());a.push([r.id,"\n.toolbar-image-selection-overlay {\n\tposition: absolute;\n\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 10;\n\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.toolbar-image-selection-overlay > div {\n\tbackground: var(--primary-background-color);\n\tbox-shadow: 1px 1px 3px var(--primary-shadow-color);\n\n\tpadding: 18px;\n\tborder-radius: 3px;\n}\n\n.toolbar-image-selection-overlay > div > div {\n\tpadding: 5px;\n}\n\n.toolbar-image-selection-overlay img {\n\tmax-width: min(50vw, 75%);\n\tmax-height: 50vh;\n\n\t/* Center */\n\tdisplay: block;\n\tmargin-left: auto;\n\tmargin-right: auto;\n}\n\n.toolbar-image-selection-overlay .action-button-row {\n\tmargin-top: 4px;\n\tdisplay: flex;\n\tflex-direction: row;\n}\n\n.toolbar-image-selection-overlay .action-button-row > button {\n\tflex-grow: 1;\n}",""]);const l=a},519:(r,n,o)=>{o.d(n,{Z:()=>l});var t=o(81),e=o.n(t),i=o(645),a=o.n(i)()(e());a.push([r.id,"\n.toolbar-overflow-widget-overflow-list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-wrap: wrap;\n\tjustify-content: center;\n}\n\n.toolbar-overflow-widget-overflow-list > .toolbar-toolContainer > .toolbar-button {\n\theight: var(--toolbar-button-height);\n}\n\n.toolbar-overflow-widget.horizontal .toolbar-overflow-widget-overflow-list {\n\tflex-direction: row;\n}\n\n.toolbar-overflow-widget.horizontal > .toolbar-dropdown {\n\tmax-width: 100%;\n\tleft: 15px;\n\tright: 15px;\n\n\t/* Override the default transform and margin-left */\n\tmargin-left: 0 !important;\n\ttransform: none !important;\n\n\tpadding: 4px;\n}",""]);const l=a},324:(r,n,o)=>{o.d(n,{Z:()=>l});var t=o(81),e=o.n(t),i=o(645),a=o.n(i)()(e());a.push([r.id,"\n.find-tool-overlay {\n /* Show at the bottom of the screen. */\n order: -1;\n\n position: absolute;\n}",""]);const l=a},611:(r,n,o)=>{o.d(n,{Z:()=>l});var t=o(81),e=o.n(t),i=o(645),a=o.n(i)()(e());a.push([r.id,"\n.selection-tool-selection-background {\n background-color: var(--secondary-background-color);\n opacity: 0.5;\n overflow: visible;\n position: absolute;\n}\n\n.selection-tool-handle {\n border: 1px solid var(--primary-foreground-color);\n background: var(--primary-background-color);\n position: absolute;\n cursor: grab;\n}\n\n.selection-tool-handle.selection-tool-circle {\n border-radius: 100%;\n}\n\n.overlay.handleOverlay {\n height: 0;\n overflow: visible;\n}",""]);const l=a},34:(r,n,o)=>{o.d(n,{Z:()=>l});var t=o(81),e=o.n(t),i=o(645),a=o.n(i)()(e());a.push([r.id,"\n.js-draw-sound-ui-toggle {\n\twidth: 0px;\n\theight: 0px;\n\toverflow: hidden; \n}\n\n.js-draw-sound-ui-toggle:focus-within, .js-draw-sound-ui-toggle.sound-ui-tool-enabled {\n\toverflow: visible;\n\tz-index: 5;\n}\n\n.js-draw-sound-ui-toggle:not(:focus-within):not(:hover).sound-ui-tool-enabled {\n\topacity: 0.5;\n}\n",""]);const l=a},443:(r,n,o)=>{o.d(n,{Z:()=>s});var t=o(81),e=o.n(t),i=o(645),a=o.n(i),l=o(611),d=o(324),c=o(34),p=a()(e());p.i(l.Z),p.i(d.Z),p.i(c.Z),p.push([r.id,"",""]);const s=p},645:r=>{r.exports=function(r){var n=[];return n.toString=function(){return this.map((function(n){var o="",t=void 0!==n[5];return n[4]&&(o+="@supports (".concat(n[4],") {")),n[2]&&(o+="@media ".concat(n[2]," {")),t&&(o+="@layer".concat(n[5].length>0?" ".concat(n[5]):""," {")),o+=r(n),t&&(o+="}"),n[2]&&(o+="}"),n[4]&&(o+="}"),o})).join("")},n.i=function(r,o,t,e,i){"string"==typeof r&&(r=[[null,r,void 0]]);var a={};if(t)for(var l=0;l<this.length;l++){var d=this[l][0];null!=d&&(a[d]=!0)}for(var c=0;c<r.length;c++){var p=[].concat(r[c]);t&&a[p[0]]||(void 0!==i&&(void 0===p[5]||(p[1]="@layer".concat(p[5].length>0?" ".concat(p[5]):""," {").concat(p[1],"}")),p[5]=i),o&&(p[2]?(p[1]="@media ".concat(p[2]," {").concat(p[1],"}"),p[2]=o):p[2]=o),e&&(p[4]?(p[1]="@supports (".concat(p[4],") {").concat(p[1],"}"),p[4]=e):p[4]="".concat(e)),n.push(p))}},n}},81:r=>{r.exports=function(r){return r[1]}},379:r=>{var n=[];function o(r){for(var o=-1,t=0;t<n.length;t++)if(n[t].identifier===r){o=t;break}return o}function t(r,t){for(var i={},a=[],l=0;l<r.length;l++){var d=r[l],c=t.base?d[0]+t.base:d[0],p=i[c]||0,s="".concat(c," ").concat(p);i[c]=p+1;var u=o(s),b={css:d[1],media:d[2],sourceMap:d[3],supports:d[4],layer:d[5]};if(-1!==u)n[u].references++,n[u].updater(b);else{var h=e(b,t);t.byIndex=l,n.splice(l,0,{identifier:s,updater:h,references:1})}a.push(s)}return a}function e(r,n){var o=n.domAPI(n);o.update(r);return function(n){if(n){if(n.css===r.css&&n.media===r.media&&n.sourceMap===r.sourceMap&&n.supports===r.supports&&n.layer===r.layer)return;o.update(r=n)}else o.remove()}}r.exports=function(r,e){var i=t(r=r||[],e=e||{});return function(r){r=r||[];for(var a=0;a<i.length;a++){var l=o(i[a]);n[l].references--}for(var d=t(r,e),c=0;c<i.length;c++){var p=o(i[c]);0===n[p].references&&(n[p].updater(),n.splice(p,1))}i=d}}},569:r=>{var n={};r.exports=function(r,o){var t=function(r){if(void 0===n[r]){var o=document.querySelector(r);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(r){o=null}n[r]=o}return n[r]}(r);if(!t)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");t.appendChild(o)}},216:r=>{r.exports=function(r){var n=document.createElement("style");return r.setAttributes(n,r.attributes),r.insert(n,r.options),n}},565:(r,n,o)=>{r.exports=function(r){var n=o.nc;n&&r.setAttribute("nonce",n)}},795:r=>{r.exports=function(r){var n=r.insertStyleElement(r);return{update:function(o){!function(r,n,o){var t="";o.supports&&(t+="@supports (".concat(o.supports,") {")),o.media&&(t+="@media ".concat(o.media," {"));var e=void 0!==o.layer;e&&(t+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),t+=o.css,e&&(t+="}"),o.media&&(t+="}"),o.supports&&(t+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(t+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),n.styleTagTransform(t,r,n.options)}(n,r,o)},remove:function(){!function(r){if(null===r.parentNode)return!1;r.parentNode.removeChild(r)}(n)}}}},589:r=>{r.exports=function(r,n){if(n.styleSheet)n.styleSheet.cssText=r;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(r))}}}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={id:t,exports:{}};return r[t](i,i.exports,o),i.exports}o.n=r=>{var n=r&&r.__esModule?()=>r.default:()=>r;return o.d(n,{a:n}),n},o.d=(r,n)=>{for(var t in n)o.o(n,t)&&!o.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:n[t]})},o.o=(r,n)=>Object.prototype.hasOwnProperty.call(r,n),o.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.nc=void 0;var t={};(()=>{o.r(t);var r=o(379),n=o.n(r),e=o(795),i=o.n(e),a=o(569),l=o.n(a),d=o(565),c=o.n(d),p=o(216),s=o.n(p),u=o(589),b=o.n(u),h=o(59),g={};g.styleTagTransform=b(),g.setAttributes=c(),g.insert=l().bind(null,"head"),g.domAPI=i(),g.insertStyleElement=s();n()(h.Z,g);h.Z&&h.Z.locals&&h.Z.locals;var x=o(786),f={};f.styleTagTransform=b(),f.setAttributes=c(),f.insert=l().bind(null,"head"),f.domAPI=i(),f.insertStyleElement=s();n()(x.Z,f);x.Z&&x.Z.locals&&x.Z.locals})(),window.jsdrawStyles=t})();
|
package/dist/cjs/src/Color4.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import Vec3 from './math/Vec3';
|
1
2
|
export default class Color4 {
|
2
3
|
/** Red component. Should be in the range [0, 1]. */
|
3
4
|
readonly r: number;
|
@@ -36,6 +37,13 @@ export default class Color4 {
|
|
36
37
|
* @returns the component-wise average of `colors`, or `Color4.transparent` if `colors` is empty.
|
37
38
|
*/
|
38
39
|
static average(colors: Color4[]): Color4;
|
40
|
+
/**
|
41
|
+
* Converts to (hue, saturation, value).
|
42
|
+
* See also https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
43
|
+
*
|
44
|
+
* The resultant hue is represented in radians and is thus in [0, 2pi].
|
45
|
+
*/
|
46
|
+
asHSV(): Vec3;
|
39
47
|
private hexString;
|
40
48
|
/**
|
41
49
|
* @returns a hexadecimal color string representation of `this`, in the form `#rrggbbaa`.
|
package/dist/cjs/src/Color4.js
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.Color4 = void 0;
|
7
|
+
const Vec3_1 = __importDefault(require("./math/Vec3"));
|
4
8
|
class Color4 {
|
5
9
|
constructor(
|
6
10
|
/** Red component. Should be in the range [0, 1]. */
|
@@ -150,6 +154,69 @@ class Color4 {
|
|
150
154
|
}
|
151
155
|
return new Color4(averageR, averageG, averageB, averageA);
|
152
156
|
}
|
157
|
+
/**
|
158
|
+
* Converts to (hue, saturation, value).
|
159
|
+
* See also https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
160
|
+
*
|
161
|
+
* The resultant hue is represented in radians and is thus in [0, 2pi].
|
162
|
+
*/
|
163
|
+
asHSV() {
|
164
|
+
// Ref: https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
165
|
+
//
|
166
|
+
// HUE:
|
167
|
+
// First, consider the unit cube. Rotate it such that one vertex is at the origin
|
168
|
+
// of a plane and its three neighboring vertices are equidistant from that plane:
|
169
|
+
//
|
170
|
+
// /\
|
171
|
+
// / | \
|
172
|
+
// 2 / 3 \ 1
|
173
|
+
// \ | /
|
174
|
+
// \ | /
|
175
|
+
// . \/ .
|
176
|
+
//
|
177
|
+
// .
|
178
|
+
//
|
179
|
+
// Let z be up and (x, y, 0) be in the plane.
|
180
|
+
//
|
181
|
+
// Label vectors 1,2,3 with R, G, and B, respectively. Let R's projection into the plane
|
182
|
+
// lie along the x axis.
|
183
|
+
//
|
184
|
+
// Because R is a unit vector and R, G, B are equidistant from the plane, they must
|
185
|
+
// form 30-60-90 triangles, which have side lengths proportional to (1, √3, 2)
|
186
|
+
//
|
187
|
+
// /|
|
188
|
+
// 1/ | (√3)/2
|
189
|
+
// / |
|
190
|
+
// 1/2
|
191
|
+
//
|
192
|
+
const minComponent = Math.min(this.r, this.g, this.b);
|
193
|
+
const maxComponent = Math.max(this.r, this.g, this.b);
|
194
|
+
const chroma = maxComponent - minComponent;
|
195
|
+
let hue;
|
196
|
+
// See https://en.wikipedia.org/wiki/HSL_and_HSV#General_approach
|
197
|
+
if (chroma === 0) {
|
198
|
+
hue = 0;
|
199
|
+
}
|
200
|
+
else if (this.r >= this.g && this.r >= this.b) {
|
201
|
+
hue = ((this.g - this.b) / chroma) % 6;
|
202
|
+
}
|
203
|
+
else if (this.g >= this.r && this.g >= this.b) {
|
204
|
+
hue = (this.b - this.r) / chroma + 2;
|
205
|
+
}
|
206
|
+
else {
|
207
|
+
hue = (this.r - this.g) / chroma + 4;
|
208
|
+
}
|
209
|
+
// Convert to degree representation, then to radians.
|
210
|
+
hue *= 60;
|
211
|
+
hue *= Math.PI / 180;
|
212
|
+
// Ensure positivity.
|
213
|
+
if (hue < 0) {
|
214
|
+
hue += Math.PI * 2;
|
215
|
+
}
|
216
|
+
const value = maxComponent;
|
217
|
+
const saturation = value > 0 ? chroma / value : 0;
|
218
|
+
return Vec3_1.default.of(hue, saturation, value);
|
219
|
+
}
|
153
220
|
/**
|
154
221
|
* @returns a hexadecimal color string representation of `this`, in the form `#rrggbbaa`.
|
155
222
|
*
|
package/dist/cjs/src/Editor.d.ts
CHANGED
@@ -53,7 +53,7 @@ export interface EditorSettings {
|
|
53
53
|
export declare class Editor {
|
54
54
|
private container;
|
55
55
|
private renderingRegion;
|
56
|
-
/** Manages drawing surfaces/{@link
|
56
|
+
/** Manages drawing surfaces/{@link AbstractRenderer}s. */
|
57
57
|
display: Display;
|
58
58
|
/**
|
59
59
|
* Handles undo/redo.
|
@@ -95,7 +95,7 @@ export declare class Editor {
|
|
95
95
|
readonly viewport: Viewport;
|
96
96
|
/** @internal */
|
97
97
|
readonly localization: EditorLocalization;
|
98
|
-
/** {@link
|
98
|
+
/** {@link EditorSettings.iconProvider} */
|
99
99
|
readonly icons: IconProvider;
|
100
100
|
/**
|
101
101
|
* Controls the list of tools. See
|
package/dist/cjs/src/Editor.js
CHANGED
@@ -258,8 +258,8 @@ class Editor {
|
|
258
258
|
if (evt.ctrlKey || evt.metaKey) {
|
259
259
|
delta = Vec3_1.default.of(0, 0, evt.deltaY);
|
260
260
|
}
|
261
|
-
// Ensure that `pos` is relative to `this.
|
262
|
-
const bbox = this.
|
261
|
+
// Ensure that `pos` is relative to `this.renderingRegion`
|
262
|
+
const bbox = this.renderingRegion.getBoundingClientRect();
|
263
263
|
const pos = Vec2_1.Vec2.of(evt.clientX, evt.clientY).minus(Vec2_1.Vec2.of(bbox.left, bbox.top));
|
264
264
|
if (this.toolController.dispatchInputEvent({
|
265
265
|
kind: types_1.InputEvtType.WheelEvt,
|
@@ -68,14 +68,13 @@ class SVGLoader {
|
|
68
68
|
// If [computedStyles] is given, it is preferred to directly accessing node's style object.
|
69
69
|
getStyle(node, computedStyles) {
|
70
70
|
var _a, _b, _c, _d, _f, _g;
|
71
|
-
|
72
|
-
|
73
|
-
};
|
71
|
+
let fill = Color4_1.default.transparent;
|
72
|
+
let stroke;
|
74
73
|
// If possible, use computedStyles (allows property inheritance).
|
75
74
|
const fillAttribute = (_b = (_a = node.getAttribute('fill')) !== null && _a !== void 0 ? _a : computedStyles === null || computedStyles === void 0 ? void 0 : computedStyles.fill) !== null && _b !== void 0 ? _b : node.style.fill;
|
76
75
|
if (fillAttribute) {
|
77
76
|
try {
|
78
|
-
|
77
|
+
fill = Color4_1.default.fromString(fillAttribute);
|
79
78
|
}
|
80
79
|
catch (e) {
|
81
80
|
console.error('Unknown fill color,', fillAttribute);
|
@@ -91,7 +90,7 @@ class SVGLoader {
|
|
91
90
|
}
|
92
91
|
const strokeColor = Color4_1.default.fromString(strokeAttribute);
|
93
92
|
if (strokeColor.a > 0) {
|
94
|
-
|
93
|
+
stroke = {
|
95
94
|
width,
|
96
95
|
color: strokeColor,
|
97
96
|
};
|
@@ -101,6 +100,10 @@ class SVGLoader {
|
|
101
100
|
console.error('Error parsing stroke data:', e);
|
102
101
|
}
|
103
102
|
}
|
103
|
+
const style = {
|
104
|
+
fill,
|
105
|
+
stroke,
|
106
|
+
};
|
104
107
|
return style;
|
105
108
|
}
|
106
109
|
strokeDataFromElem(node) {
|
@@ -26,13 +26,13 @@ export default abstract class AbstractComponent {
|
|
26
26
|
/**
|
27
27
|
* Attach data that can be used while exporting the component (e.g. to SVG).
|
28
28
|
*
|
29
|
-
* This is intended for use by
|
29
|
+
* This is intended for use by an {@link ImageLoader}.
|
30
30
|
*/
|
31
31
|
attachLoadSaveData(key: string, data: LoadSaveData): void;
|
32
32
|
/** See {@link attachLoadSaveData} */
|
33
33
|
getLoadSaveData(): LoadSaveDataTable;
|
34
34
|
getZIndex(): number;
|
35
|
-
/** @returns the bounding box of
|
35
|
+
/** @returns the bounding box of this. */
|
36
36
|
getBBox(): Rect2;
|
37
37
|
/** Called when this component is added to the given image. */
|
38
38
|
onAddToImage(_image: EditorImage): void;
|
@@ -32,7 +32,7 @@ class AbstractComponent {
|
|
32
32
|
}
|
33
33
|
}
|
34
34
|
// Returns a unique ID for this element.
|
35
|
-
// @see { @link
|
35
|
+
// @see { @link EditorImage.lookupElement }
|
36
36
|
getId() {
|
37
37
|
return this.id;
|
38
38
|
}
|
@@ -45,7 +45,7 @@ class AbstractComponent {
|
|
45
45
|
/**
|
46
46
|
* Attach data that can be used while exporting the component (e.g. to SVG).
|
47
47
|
*
|
48
|
-
* This is intended for use by
|
48
|
+
* This is intended for use by an {@link ImageLoader}.
|
49
49
|
*/
|
50
50
|
attachLoadSaveData(key, data) {
|
51
51
|
if (!this.loadSaveData[key]) {
|
@@ -60,7 +60,7 @@ class AbstractComponent {
|
|
60
60
|
getZIndex() {
|
61
61
|
return this.zIndex;
|
62
62
|
}
|
63
|
-
/** @returns the bounding box of
|
63
|
+
/** @returns the bounding box of this. */
|
64
64
|
getBBox() {
|
65
65
|
return this.contentBBox;
|
66
66
|
}
|
@@ -15,7 +15,7 @@ var BackgroundType;
|
|
15
15
|
BackgroundType[BackgroundType["None"] = 1] = "None";
|
16
16
|
})(BackgroundType = exports.BackgroundType || (exports.BackgroundType = {}));
|
17
17
|
exports.imageBackgroundCSSClassName = 'js-draw-image-background';
|
18
|
-
// Represents the background of
|
18
|
+
// Represents the background of the editor's canvas.
|
19
19
|
class ImageBackground extends AbstractComponent_1.default {
|
20
20
|
constructor(backgroundType, mainColor) {
|
21
21
|
super('image-background', 0);
|
@@ -1,16 +1,35 @@
|
|
1
1
|
import Color4 from '../Color4';
|
2
2
|
import SerializableCommand from '../commands/SerializableCommand';
|
3
3
|
import Editor from '../Editor';
|
4
|
-
import
|
4
|
+
import TextRenderingStyle from '../rendering/TextRenderingStyle';
|
5
5
|
import AbstractComponent from './AbstractComponent';
|
6
6
|
export interface ComponentStyle {
|
7
7
|
color?: Color4;
|
8
|
-
textStyle?:
|
8
|
+
textStyle?: TextRenderingStyle;
|
9
9
|
}
|
10
10
|
export declare const createRestyleComponentCommand: (initialStyle: ComponentStyle, newStyle: ComponentStyle, component: RestyleableComponent) => SerializableCommand;
|
11
11
|
export declare const isRestylableComponent: (component: AbstractComponent) => component is RestyleableComponent;
|
12
|
+
/**
|
13
|
+
* An interface to be implemented by components with a changable color or {@link TextRenderingStyle}.
|
14
|
+
*
|
15
|
+
* All such classes must have a member variable, `isRestylableComponent` that is set to `true`
|
16
|
+
* to allow testing whether the class is a `RestylableComponent` (see {@link isRestylableComponent}).
|
17
|
+
*/
|
12
18
|
export interface RestyleableComponent extends AbstractComponent {
|
19
|
+
/**
|
20
|
+
* @returns a partial representation of this component's style.
|
21
|
+
*/
|
13
22
|
getStyle(): ComponentStyle;
|
23
|
+
/**
|
24
|
+
* Returns a {@link Command} that updates portions of this component's style
|
25
|
+
* to the given `style`.
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* For some component and editor,
|
29
|
+
* ```ts
|
30
|
+
* editor.dispatch(component.updateStyle({ color: Color4.red }));
|
31
|
+
* ```
|
32
|
+
*/
|
14
33
|
updateStyle(style: ComponentStyle): SerializableCommand;
|
15
34
|
/**
|
16
35
|
* Set the style of this component in a way that can't be undone/redone
|
@@ -8,11 +8,43 @@ import AbstractRenderer, { RenderablePathSpec } from '../rendering/renderers/Abs
|
|
8
8
|
import AbstractComponent from './AbstractComponent';
|
9
9
|
import { ImageComponentLocalization } from './localization';
|
10
10
|
import RestyleableComponent, { ComponentStyle } from './RestylableComponent';
|
11
|
+
/**
|
12
|
+
* Represents an {@link AbstractComponent} made up of one or more {@link Path}s.
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* For some {@link Editor} editor and `Stroke` stroke,
|
16
|
+
*
|
17
|
+
* **Restyling**:
|
18
|
+
* ```ts
|
19
|
+
* editor.dispatch(stroke.updateStyle({ color: Color4.red }));
|
20
|
+
* ```
|
21
|
+
*
|
22
|
+
* **Transforming**:
|
23
|
+
* ```ts
|
24
|
+
* editor.dispatch(stroke.transformBy(Mat33.translation(Vec2.of(10, 0))));
|
25
|
+
* ```
|
26
|
+
*/
|
11
27
|
export default class Stroke extends AbstractComponent implements RestyleableComponent {
|
12
28
|
private parts;
|
13
29
|
protected contentBBox: Rect2;
|
14
30
|
readonly isRestylableComponent: true;
|
15
31
|
private approximateRenderingTime;
|
32
|
+
/**
|
33
|
+
* Creates a `Stroke` from the given `parts`. All parts should have the
|
34
|
+
* same color.
|
35
|
+
*
|
36
|
+
* @example
|
37
|
+
* ```ts
|
38
|
+
* // A path that starts at (1,1), moves to the right by (2, 0),
|
39
|
+
* // then moves down and right by (3, 3)
|
40
|
+
* const path = Path.fromString('m1,1 2,0 3,3');
|
41
|
+
*
|
42
|
+
* const stroke = new Stroke([
|
43
|
+
* // Fill with red
|
44
|
+
* path.toRenderable({ fill: Color4.red })
|
45
|
+
* ]);
|
46
|
+
* ```
|
47
|
+
*/
|
16
48
|
constructor(parts: RenderablePathSpec[]);
|
17
49
|
getStyle(): ComponentStyle;
|
18
50
|
updateStyle(style: ComponentStyle): SerializableCommand;
|
@@ -22,6 +54,9 @@ export default class Stroke extends AbstractComponent implements RestyleableComp
|
|
22
54
|
getProportionalRenderingTime(): number;
|
23
55
|
private bboxForPart;
|
24
56
|
protected applyTransformation(affineTransfm: Mat33): void;
|
57
|
+
/**
|
58
|
+
* @returns the {@link Path.union} of all paths that make up this stroke.
|
59
|
+
*/
|
25
60
|
getPath(): Path;
|
26
61
|
description(localization: ImageComponentLocalization): string;
|
27
62
|
protected createClone(): AbstractComponent;
|
@@ -8,12 +8,43 @@ const Rect2_1 = __importDefault(require("../math/Rect2"));
|
|
8
8
|
const RenderingStyle_1 = require("../rendering/RenderingStyle");
|
9
9
|
const AbstractComponent_1 = __importDefault(require("./AbstractComponent"));
|
10
10
|
const RestylableComponent_1 = require("./RestylableComponent");
|
11
|
+
/**
|
12
|
+
* Represents an {@link AbstractComponent} made up of one or more {@link Path}s.
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* For some {@link Editor} editor and `Stroke` stroke,
|
16
|
+
*
|
17
|
+
* **Restyling**:
|
18
|
+
* ```ts
|
19
|
+
* editor.dispatch(stroke.updateStyle({ color: Color4.red }));
|
20
|
+
* ```
|
21
|
+
*
|
22
|
+
* **Transforming**:
|
23
|
+
* ```ts
|
24
|
+
* editor.dispatch(stroke.transformBy(Mat33.translation(Vec2.of(10, 0))));
|
25
|
+
* ```
|
26
|
+
*/
|
11
27
|
class Stroke extends AbstractComponent_1.default {
|
12
|
-
|
13
|
-
|
28
|
+
/**
|
29
|
+
* Creates a `Stroke` from the given `parts`. All parts should have the
|
30
|
+
* same color.
|
31
|
+
*
|
32
|
+
* @example
|
33
|
+
* ```ts
|
34
|
+
* // A path that starts at (1,1), moves to the right by (2, 0),
|
35
|
+
* // then moves down and right by (3, 3)
|
36
|
+
* const path = Path.fromString('m1,1 2,0 3,3');
|
37
|
+
*
|
38
|
+
* const stroke = new Stroke([
|
39
|
+
* // Fill with red
|
40
|
+
* path.toRenderable({ fill: Color4.red })
|
41
|
+
* ]);
|
42
|
+
* ```
|
43
|
+
*/
|
14
44
|
constructor(parts) {
|
15
45
|
var _a;
|
16
46
|
super('stroke');
|
47
|
+
// @internal
|
17
48
|
// eslint-disable-next-line @typescript-eslint/prefer-as-const
|
18
49
|
this.isRestylableComponent = true;
|
19
50
|
this.approximateRenderingTime = 0;
|
@@ -146,6 +177,9 @@ class Stroke extends AbstractComponent_1.default {
|
|
146
177
|
};
|
147
178
|
});
|
148
179
|
}
|
180
|
+
/**
|
181
|
+
* @returns the {@link Path.union} of all paths that make up this stroke.
|
182
|
+
*/
|
149
183
|
getPath() {
|
150
184
|
let result = null;
|
151
185
|
for (const part of this.parts) {
|
@@ -4,18 +4,26 @@ import Mat33 from '../math/Mat33';
|
|
4
4
|
import Rect2 from '../math/Rect2';
|
5
5
|
import Editor from '../Editor';
|
6
6
|
import AbstractRenderer from '../rendering/renderers/AbstractRenderer';
|
7
|
-
import {
|
7
|
+
import { TextRenderingStyle } from '../rendering/TextRenderingStyle';
|
8
8
|
import AbstractComponent from './AbstractComponent';
|
9
9
|
import { ImageComponentLocalization } from './localization';
|
10
10
|
import RestyleableComponent, { ComponentStyle } from './RestylableComponent';
|
11
|
+
/**
|
12
|
+
* Displays text.
|
13
|
+
*/
|
11
14
|
export default class TextComponent extends AbstractComponent implements RestyleableComponent {
|
12
15
|
protected readonly textObjects: Array<string | TextComponent>;
|
13
16
|
private transform;
|
14
17
|
private style;
|
15
18
|
protected contentBBox: Rect2;
|
16
19
|
readonly isRestylableComponent: true;
|
17
|
-
|
18
|
-
|
20
|
+
/**
|
21
|
+
* Creates a new text object from a list of component text or child TextComponents.
|
22
|
+
*
|
23
|
+
* @see {@link fromLines}
|
24
|
+
*/
|
25
|
+
constructor(textObjects: Array<string | TextComponent>, transform: Mat33, style: TextRenderingStyle);
|
26
|
+
static applyTextStyles(ctx: CanvasRenderingContext2D, style: TextRenderingStyle): void;
|
19
27
|
private static textMeasuringCtx;
|
20
28
|
private static estimateTextDimens;
|
21
29
|
private static getTextDimens;
|
@@ -49,5 +57,19 @@ export default class TextComponent extends AbstractComponent implements Restylea
|
|
49
57
|
description(localizationTable: ImageComponentLocalization): string;
|
50
58
|
protected serializeToJSON(): Record<string, any>;
|
51
59
|
static deserializeFromString(json: any): TextComponent;
|
52
|
-
|
60
|
+
/**
|
61
|
+
* Creates a `TextComponent` from `lines`.
|
62
|
+
*
|
63
|
+
* @example
|
64
|
+
* ```ts
|
65
|
+
* const textStyle = {
|
66
|
+
* size: 12,
|
67
|
+
* fontFamily: 'serif',
|
68
|
+
* renderingStyle: { fill: Color4.black },
|
69
|
+
* };
|
70
|
+
*
|
71
|
+
* const text = TextComponent.fromLines('foo\nbar'.split('\n'), Mat33.identity, textStyle);
|
72
|
+
* ```
|
73
|
+
*/
|
74
|
+
static fromLines(lines: string[], transform: Mat33, style: TextRenderingStyle): AbstractComponent;
|
53
75
|
}
|
@@ -11,7 +11,15 @@ const TextRenderingStyle_1 = require("../rendering/TextRenderingStyle");
|
|
11
11
|
const AbstractComponent_1 = __importDefault(require("./AbstractComponent"));
|
12
12
|
const RestylableComponent_1 = require("./RestylableComponent");
|
13
13
|
const componentTypeId = 'text';
|
14
|
+
/**
|
15
|
+
* Displays text.
|
16
|
+
*/
|
14
17
|
class TextComponent extends AbstractComponent_1.default {
|
18
|
+
/**
|
19
|
+
* Creates a new text object from a list of component text or child TextComponents.
|
20
|
+
*
|
21
|
+
* @see {@link fromLines}
|
22
|
+
*/
|
15
23
|
constructor(textObjects, transform, style) {
|
16
24
|
super(componentTypeId);
|
17
25
|
this.textObjects = textObjects;
|
@@ -237,6 +245,20 @@ class TextComponent extends AbstractComponent_1.default {
|
|
237
245
|
const transform = new Mat33_1.default(...transformData);
|
238
246
|
return new TextComponent(textObjects, transform, style);
|
239
247
|
}
|
248
|
+
/**
|
249
|
+
* Creates a `TextComponent` from `lines`.
|
250
|
+
*
|
251
|
+
* @example
|
252
|
+
* ```ts
|
253
|
+
* const textStyle = {
|
254
|
+
* size: 12,
|
255
|
+
* fontFamily: 'serif',
|
256
|
+
* renderingStyle: { fill: Color4.black },
|
257
|
+
* };
|
258
|
+
*
|
259
|
+
* const text = TextComponent.fromLines('foo\nbar'.split('\n'), Mat33.identity, textStyle);
|
260
|
+
* ```
|
261
|
+
*/
|
240
262
|
static fromLines(lines, transform, style) {
|
241
263
|
let lastComponent = null;
|
242
264
|
const components = [];
|
@@ -7,6 +7,7 @@ export { default as AbstractComponent } from './AbstractComponent';
|
|
7
7
|
import Stroke from './Stroke';
|
8
8
|
import TextComponent from './TextComponent';
|
9
9
|
import ImageComponent from './ImageComponent';
|
10
|
-
import RestyleableComponent
|
10
|
+
import RestyleableComponent from './RestylableComponent';
|
11
|
+
import { createRestyleComponentCommand, isRestylableComponent, ComponentStyle as RestyleableComponentStyle } from './RestylableComponent';
|
11
12
|
import ImageBackground from './ImageBackground';
|
12
|
-
export { Stroke, TextComponent as Text, RestyleableComponent, createRestyleComponentCommand, isRestylableComponent, TextComponent, Stroke as StrokeComponent, ImageBackground as BackgroundComponent, ImageComponent, };
|
13
|
+
export { Stroke, TextComponent as Text, RestyleableComponent, createRestyleComponentCommand, isRestylableComponent, RestyleableComponentStyle, TextComponent, Stroke as StrokeComponent, ImageBackground as BackgroundComponent, ImageComponent, };
|
package/dist/cjs/src/lib.d.ts
CHANGED
@@ -5,10 +5,40 @@
|
|
5
5
|
* @example
|
6
6
|
* ```
|
7
7
|
* import { Editor, Vec3, Mat33 } from 'js-draw';
|
8
|
+
*
|
9
|
+
* // Apply js-draw CSS
|
10
|
+
* import 'js-draw/styles';
|
11
|
+
* // If your bundler doesn't support the above, try
|
12
|
+
* // import 'js-draw/bundledStyles';
|
13
|
+
*
|
14
|
+
* (async () => {
|
15
|
+
* const editor = new Editor(document.body);
|
16
|
+
* const toolbar = editor.addToolbar();
|
17
|
+
* editor.getRootElement().style.height = '600px';
|
18
|
+
*
|
19
|
+
* await editor.loadFromSVG(`
|
20
|
+
* <svg viewBox="0 0 500 500" width="500" height="500" version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
|
21
|
+
* <style id="js-draw-style-sheet">path{stroke-linecap:round;stroke-linejoin:round;}text{white-space:pre;}</style>
|
22
|
+
* <path d="M500,500L500,0L0,0L0,500L500,500" fill="#423131bf" class="js-draw-image-background"></path>
|
23
|
+
* <text style="transform: matrix(1, 0, 0, 1, 57, 192); font-family: serif; font-size: 32px; fill: rgb(204, 102, 51);">Testing...</text>
|
24
|
+
* </svg>
|
25
|
+
* `);
|
26
|
+
*
|
27
|
+
* toolbar.addActionButton({
|
28
|
+
* label: 'Save',
|
29
|
+
* icon: editor.icons.makeSaveIcon(),
|
30
|
+
* }, () => {
|
31
|
+
* const saveData = editor.toSVG().outerHTML;
|
32
|
+
*
|
33
|
+
* // Do something with saveData
|
34
|
+
* });
|
35
|
+
* })();
|
8
36
|
* ```
|
9
37
|
*
|
10
38
|
* @see
|
11
39
|
* {@link Editor}
|
40
|
+
* {@link Editor.loadFromSVG}
|
41
|
+
* {@link HTMLToolbar.addActionButton }
|
12
42
|
*
|
13
43
|
* @packageDocumentation
|
14
44
|
*/
|
package/dist/cjs/src/lib.js
CHANGED
@@ -6,10 +6,40 @@
|
|
6
6
|
* @example
|
7
7
|
* ```
|
8
8
|
* import { Editor, Vec3, Mat33 } from 'js-draw';
|
9
|
+
*
|
10
|
+
* // Apply js-draw CSS
|
11
|
+
* import 'js-draw/styles';
|
12
|
+
* // If your bundler doesn't support the above, try
|
13
|
+
* // import 'js-draw/bundledStyles';
|
14
|
+
*
|
15
|
+
* (async () => {
|
16
|
+
* const editor = new Editor(document.body);
|
17
|
+
* const toolbar = editor.addToolbar();
|
18
|
+
* editor.getRootElement().style.height = '600px';
|
19
|
+
*
|
20
|
+
* await editor.loadFromSVG(`
|
21
|
+
* <svg viewBox="0 0 500 500" width="500" height="500" version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
|
22
|
+
* <style id="js-draw-style-sheet">path{stroke-linecap:round;stroke-linejoin:round;}text{white-space:pre;}</style>
|
23
|
+
* <path d="M500,500L500,0L0,0L0,500L500,500" fill="#423131bf" class="js-draw-image-background"></path>
|
24
|
+
* <text style="transform: matrix(1, 0, 0, 1, 57, 192); font-family: serif; font-size: 32px; fill: rgb(204, 102, 51);">Testing...</text>
|
25
|
+
* </svg>
|
26
|
+
* `);
|
27
|
+
*
|
28
|
+
* toolbar.addActionButton({
|
29
|
+
* label: 'Save',
|
30
|
+
* icon: editor.icons.makeSaveIcon(),
|
31
|
+
* }, () => {
|
32
|
+
* const saveData = editor.toSVG().outerHTML;
|
33
|
+
*
|
34
|
+
* // Do something with saveData
|
35
|
+
* });
|
36
|
+
* })();
|
9
37
|
* ```
|
10
38
|
*
|
11
39
|
* @see
|
12
40
|
* {@link Editor}
|
41
|
+
* {@link Editor.loadFromSVG}
|
42
|
+
* {@link HTMLToolbar.addActionButton }
|
13
43
|
*
|
14
44
|
* @packageDocumentation
|
15
45
|
*/
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import Color4 from '../Color4';
|
2
2
|
interface RenderingStyle {
|
3
|
-
fill: Color4;
|
4
|
-
stroke?: {
|
5
|
-
color: Color4;
|
6
|
-
width: number;
|
3
|
+
readonly fill: Color4;
|
4
|
+
readonly stroke?: {
|
5
|
+
readonly color: Color4;
|
6
|
+
readonly width: number;
|
7
7
|
};
|
8
8
|
}
|
9
9
|
export default RenderingStyle;
|