js-draw 1.21.3 → 1.22.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +103 -75
- package/build-config.json +2 -2
- package/dist/Editor.css +29 -16
- package/dist/bundle.js +2 -2
- package/dist/bundledStyles.js +1 -1
- package/dist/cjs/Editor.js +36 -22
- package/dist/cjs/EventDispatcher.js +1 -1
- package/dist/cjs/Pointer.js +3 -3
- package/dist/cjs/SVGLoader/SVGLoader.js +13 -6
- package/dist/cjs/UndoRedoHistory.js +1 -1
- package/dist/cjs/Viewport.js +4 -2
- package/dist/cjs/commands/Command.js +7 -5
- package/dist/cjs/commands/Duplicate.js +2 -2
- package/dist/cjs/commands/Erase.js +3 -4
- package/dist/cjs/commands/invertCommand.js +4 -4
- package/dist/cjs/commands/lib.d.ts +1 -1
- package/dist/cjs/commands/uniteCommands.js +4 -4
- package/dist/cjs/components/AbstractComponent.d.ts +1 -1
- package/dist/cjs/components/AbstractComponent.js +3 -3
- package/dist/cjs/components/BackgroundComponent.js +8 -6
- package/dist/cjs/components/ImageComponent.js +12 -5
- package/dist/cjs/components/RestylableComponent.js +1 -1
- package/dist/cjs/components/SVGGlobalAttributesObject.js +1 -2
- package/dist/cjs/components/Stroke.js +37 -24
- package/dist/cjs/components/TextComponent.js +13 -10
- package/dist/cjs/components/UnknownSVGObject.js +2 -3
- package/dist/cjs/components/builders/ArrowBuilder.d.ts +6 -0
- package/dist/cjs/components/builders/ArrowBuilder.js +9 -3
- package/dist/cjs/components/builders/CircleBuilder.d.ts +6 -0
- package/dist/cjs/components/builders/CircleBuilder.js +11 -4
- package/dist/cjs/components/builders/FreehandLineBuilder.d.ts +6 -0
- package/dist/cjs/components/builders/FreehandLineBuilder.js +10 -4
- package/dist/cjs/components/builders/LineBuilder.d.ts +6 -0
- package/dist/cjs/components/builders/LineBuilder.js +8 -4
- package/dist/cjs/components/builders/PolylineBuilder.d.ts +4 -1
- package/dist/cjs/components/builders/PolylineBuilder.js +9 -5
- package/dist/cjs/components/builders/PressureSensitiveFreehandLineBuilder.js +16 -10
- package/dist/cjs/components/builders/RectangleBuilder.d.ts +12 -0
- package/dist/cjs/components/builders/RectangleBuilder.js +17 -3
- package/dist/cjs/components/builders/autocorrect/makeShapeFitAutocorrect.js +5 -8
- package/dist/cjs/components/builders/autocorrect/makeSnapToGridAutocorrect.js +1 -1
- package/dist/cjs/components/builders/lib.d.ts +7 -0
- package/dist/cjs/components/builders/lib.js +18 -0
- package/dist/cjs/components/lib.d.ts +1 -4
- package/dist/cjs/components/lib.js +2 -9
- package/dist/cjs/components/util/StrokeSmoother.js +5 -6
- package/dist/cjs/dialogs/makeAboutDialog.js +1 -1
- package/dist/cjs/dialogs/makeMessageDialog.js +2 -2
- package/dist/cjs/image/EditorImage.js +13 -15
- package/dist/cjs/image/export/editorImageToSVG.js +1 -1
- package/dist/cjs/inputEvents.js +3 -3
- package/dist/cjs/lib.d.ts +2 -2
- package/dist/cjs/localizations/de.js +2 -2
- package/dist/cjs/localizations/es.js +7 -3
- package/dist/cjs/rendering/Display.js +7 -3
- package/dist/cjs/rendering/RenderablePathSpec.js +26 -11
- package/dist/cjs/rendering/RenderingStyle.js +22 -15
- package/dist/cjs/rendering/TextRenderingStyle.js +1 -1
- package/dist/cjs/rendering/caching/CacheRecord.js +1 -1
- package/dist/cjs/rendering/caching/CacheRecordManager.js +1 -1
- package/dist/cjs/rendering/caching/RenderingCache.js +1 -1
- package/dist/cjs/rendering/caching/RenderingCacheNode.js +26 -15
- package/dist/cjs/rendering/caching/testUtils.js +2 -2
- package/dist/cjs/rendering/renderers/AbstractRenderer.js +3 -1
- package/dist/cjs/rendering/renderers/CanvasRenderer.js +4 -3
- package/dist/cjs/rendering/renderers/DummyRenderer.js +1 -1
- package/dist/cjs/rendering/renderers/SVGRenderer.js +37 -19
- package/dist/cjs/rendering/renderers/TextOnlyRenderer.js +13 -15
- package/dist/cjs/shortcuts/KeyBinding.js +6 -12
- package/dist/cjs/shortcuts/KeyboardShortcutManager.js +2 -2
- package/dist/cjs/testing/createEditor.js +6 -1
- package/dist/cjs/testing/findNodeWithText.d.ts +4 -1
- package/dist/cjs/testing/findNodeWithText.js +12 -3
- package/dist/cjs/testing/getUniquePointerId.js +1 -1
- package/dist/cjs/testing/sendHtmlSwipe.js +7 -3
- package/dist/cjs/testing/sendPenEvent.js +1 -3
- package/dist/cjs/testing/sendTouchEvent.js +1 -4
- package/dist/cjs/testing/startPinchGesture.js +3 -1
- package/dist/cjs/toolbar/AbstractToolbar.js +7 -11
- package/dist/cjs/toolbar/EdgeToolbar.js +11 -15
- package/dist/cjs/toolbar/IconProvider.js +5 -3
- package/dist/cjs/toolbar/localization.js +3 -3
- package/dist/cjs/toolbar/utils/HelpDisplay.js +8 -6
- package/dist/cjs/toolbar/utils/makeDraggable.js +4 -7
- package/dist/cjs/toolbar/widgets/BaseToolWidget.js +3 -2
- package/dist/cjs/toolbar/widgets/BaseWidget.js +7 -7
- package/dist/cjs/toolbar/widgets/DocumentPropertiesWidget.js +2 -2
- package/dist/cjs/toolbar/widgets/EraserToolWidget.js +5 -3
- package/dist/cjs/toolbar/widgets/HandToolWidget.js +8 -6
- package/dist/cjs/toolbar/widgets/InsertImageWidget/InsertImageWidget.js +9 -10
- package/dist/cjs/toolbar/widgets/PenToolWidget.js +22 -13
- package/dist/cjs/toolbar/widgets/SelectionToolWidget.js +2 -2
- package/dist/cjs/toolbar/widgets/TextToolWidget.js +5 -5
- package/dist/cjs/toolbar/widgets/components/makeFileInput.js +7 -7
- package/dist/cjs/toolbar/widgets/components/makeGridSelector.js +5 -5
- package/dist/cjs/toolbar/widgets/components/makeSnappedList.js +9 -5
- package/dist/cjs/toolbar/widgets/keybindings.js +2 -2
- package/dist/cjs/toolbar/widgets/layout/DropdownLayoutManager.js +6 -6
- package/dist/cjs/tools/BaseTool.js +5 -3
- package/dist/cjs/tools/Eraser.js +25 -20
- package/dist/cjs/tools/FindTool.js +2 -2
- package/dist/cjs/tools/InputFilter/ContextMenuRecognizer.js +1 -3
- package/dist/cjs/tools/InputFilter/InputMapper.js +1 -1
- package/dist/cjs/tools/InputFilter/InputPipeline.js +1 -1
- package/dist/cjs/tools/InputFilter/InputStabilizer.js +12 -5
- package/dist/cjs/tools/InputFilter/StrokeKeyboardControl.js +7 -4
- package/dist/cjs/tools/PanZoom.d.ts +1 -1
- package/dist/cjs/tools/PanZoom.js +17 -12
- package/dist/cjs/tools/PasteHandler.js +8 -2
- package/dist/cjs/tools/Pen.js +17 -9
- package/dist/cjs/tools/ScrollbarTool.js +8 -7
- package/dist/cjs/tools/SelectionTool/Selection.js +16 -12
- package/dist/cjs/tools/SelectionTool/SelectionHandle.js +5 -2
- package/dist/cjs/tools/SelectionTool/SelectionMenuShortcut.js +3 -1
- package/dist/cjs/tools/SelectionTool/SelectionTool.js +25 -16
- package/dist/cjs/tools/SelectionTool/ToPointerAutoscroller.js +1 -1
- package/dist/cjs/tools/SelectionTool/TransformMode.js +6 -7
- package/dist/cjs/tools/SelectionTool/util/makeClipboardErrorHandlers.js +23 -2
- package/dist/cjs/tools/SelectionTool/util/showSelectionContextMenu.js +29 -20
- package/dist/cjs/tools/SoundUITool.js +5 -3
- package/dist/cjs/tools/TextTool.js +8 -6
- package/dist/cjs/tools/ToolController.js +16 -10
- package/dist/cjs/tools/localization.d.ts +2 -0
- package/dist/cjs/tools/localization.js +3 -1
- package/dist/cjs/tools/util/StationaryPenDetector.js +3 -3
- package/dist/cjs/tools/util/createMenuOverlay.js +2 -2
- package/dist/cjs/util/ClipboardHandler.d.ts +1 -1
- package/dist/cjs/util/ClipboardHandler.js +19 -18
- package/dist/cjs/util/ReactiveValue.js +16 -12
- package/dist/cjs/util/adjustEditorThemeForContrast.js +6 -2
- package/dist/cjs/util/guessKeyCodeFromKey.js +1 -1
- package/dist/cjs/util/listenForKeyboardEventsFrom.js +8 -6
- package/dist/cjs/util/waitForAll.js +3 -3
- package/dist/cjs/util/waitForImageLoaded.js +3 -3
- package/dist/cjs/util/waitForTimeout.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/Editor.mjs +37 -23
- package/dist/mjs/EventDispatcher.mjs +1 -1
- package/dist/mjs/Pointer.mjs +3 -3
- package/dist/mjs/SVGLoader/SVGLoader.mjs +14 -7
- package/dist/mjs/UndoRedoHistory.mjs +1 -1
- package/dist/mjs/Viewport.mjs +4 -2
- package/dist/mjs/commands/Command.mjs +7 -5
- package/dist/mjs/commands/Duplicate.mjs +2 -2
- package/dist/mjs/commands/Erase.mjs +3 -4
- package/dist/mjs/commands/invertCommand.mjs +4 -4
- package/dist/mjs/commands/lib.d.ts +1 -1
- package/dist/mjs/commands/lib.mjs +1 -1
- package/dist/mjs/commands/uniteCommands.mjs +4 -4
- package/dist/mjs/components/AbstractComponent.d.ts +1 -1
- package/dist/mjs/components/AbstractComponent.mjs +3 -3
- package/dist/mjs/components/BackgroundComponent.mjs +10 -8
- package/dist/mjs/components/ImageComponent.mjs +12 -5
- package/dist/mjs/components/RestylableComponent.mjs +2 -2
- package/dist/mjs/components/SVGGlobalAttributesObject.mjs +1 -2
- package/dist/mjs/components/Stroke.mjs +40 -27
- package/dist/mjs/components/TextComponent.mjs +15 -12
- package/dist/mjs/components/UnknownSVGObject.mjs +2 -3
- package/dist/mjs/components/builders/ArrowBuilder.d.ts +6 -0
- package/dist/mjs/components/builders/ArrowBuilder.mjs +9 -3
- package/dist/mjs/components/builders/CircleBuilder.d.ts +6 -0
- package/dist/mjs/components/builders/CircleBuilder.mjs +11 -4
- package/dist/mjs/components/builders/FreehandLineBuilder.d.ts +6 -0
- package/dist/mjs/components/builders/FreehandLineBuilder.mjs +10 -4
- package/dist/mjs/components/builders/LineBuilder.d.ts +6 -0
- package/dist/mjs/components/builders/LineBuilder.mjs +8 -4
- package/dist/mjs/components/builders/PolylineBuilder.d.ts +4 -1
- package/dist/mjs/components/builders/PolylineBuilder.mjs +10 -6
- package/dist/mjs/components/builders/PressureSensitiveFreehandLineBuilder.mjs +17 -11
- package/dist/mjs/components/builders/RectangleBuilder.d.ts +12 -0
- package/dist/mjs/components/builders/RectangleBuilder.mjs +17 -3
- package/dist/mjs/components/builders/autocorrect/makeShapeFitAutocorrect.mjs +5 -8
- package/dist/mjs/components/builders/autocorrect/makeSnapToGridAutocorrect.mjs +1 -1
- package/dist/mjs/components/builders/lib.d.ts +7 -0
- package/dist/mjs/components/builders/lib.mjs +7 -0
- package/dist/mjs/components/lib.d.ts +1 -4
- package/dist/mjs/components/lib.mjs +2 -5
- package/dist/mjs/components/util/StrokeSmoother.mjs +5 -6
- package/dist/mjs/dialogs/makeAboutDialog.mjs +1 -1
- package/dist/mjs/dialogs/makeMessageDialog.mjs +2 -2
- package/dist/mjs/image/EditorImage.mjs +13 -15
- package/dist/mjs/image/export/editorImageToSVG.mjs +1 -1
- package/dist/mjs/inputEvents.mjs +3 -3
- package/dist/mjs/lib.d.ts +2 -2
- package/dist/mjs/lib.mjs +2 -2
- package/dist/mjs/localization.mjs +2 -2
- package/dist/mjs/localizations/de.mjs +2 -2
- package/dist/mjs/localizations/es.mjs +7 -3
- package/dist/mjs/rendering/Display.mjs +7 -3
- package/dist/mjs/rendering/RenderablePathSpec.mjs +26 -11
- package/dist/mjs/rendering/RenderingStyle.mjs +22 -15
- package/dist/mjs/rendering/TextRenderingStyle.mjs +1 -1
- package/dist/mjs/rendering/caching/CacheRecord.mjs +1 -1
- package/dist/mjs/rendering/caching/CacheRecordManager.mjs +1 -1
- package/dist/mjs/rendering/caching/RenderingCache.mjs +1 -1
- package/dist/mjs/rendering/caching/RenderingCacheNode.mjs +26 -15
- package/dist/mjs/rendering/caching/testUtils.mjs +2 -2
- package/dist/mjs/rendering/renderers/AbstractRenderer.mjs +3 -1
- package/dist/mjs/rendering/renderers/CanvasRenderer.mjs +4 -3
- package/dist/mjs/rendering/renderers/DummyRenderer.mjs +1 -1
- package/dist/mjs/rendering/renderers/SVGRenderer.mjs +38 -20
- package/dist/mjs/rendering/renderers/TextOnlyRenderer.mjs +13 -15
- package/dist/mjs/shortcuts/KeyBinding.mjs +6 -12
- package/dist/mjs/shortcuts/KeyboardShortcutManager.mjs +2 -2
- package/dist/mjs/testing/createEditor.mjs +6 -1
- package/dist/mjs/testing/findNodeWithText.d.ts +4 -1
- package/dist/mjs/testing/findNodeWithText.mjs +12 -3
- package/dist/mjs/testing/getUniquePointerId.mjs +1 -1
- package/dist/mjs/testing/sendHtmlSwipe.mjs +7 -3
- package/dist/mjs/testing/sendPenEvent.mjs +1 -3
- package/dist/mjs/testing/sendTouchEvent.mjs +1 -4
- package/dist/mjs/testing/startPinchGesture.mjs +3 -1
- package/dist/mjs/toolbar/AbstractToolbar.mjs +7 -11
- package/dist/mjs/toolbar/EdgeToolbar.mjs +11 -15
- package/dist/mjs/toolbar/IconProvider.mjs +5 -3
- package/dist/mjs/toolbar/localization.mjs +3 -3
- package/dist/mjs/toolbar/utils/HelpDisplay.mjs +8 -6
- package/dist/mjs/toolbar/utils/makeDraggable.mjs +4 -7
- package/dist/mjs/toolbar/widgets/BaseToolWidget.mjs +3 -2
- package/dist/mjs/toolbar/widgets/BaseWidget.mjs +8 -8
- package/dist/mjs/toolbar/widgets/DocumentPropertiesWidget.mjs +2 -2
- package/dist/mjs/toolbar/widgets/EraserToolWidget.mjs +5 -3
- package/dist/mjs/toolbar/widgets/HandToolWidget.mjs +8 -6
- package/dist/mjs/toolbar/widgets/InsertImageWidget/InsertImageWidget.mjs +9 -10
- package/dist/mjs/toolbar/widgets/PenToolWidget.mjs +23 -14
- package/dist/mjs/toolbar/widgets/SelectionToolWidget.mjs +2 -2
- package/dist/mjs/toolbar/widgets/TextToolWidget.mjs +5 -5
- package/dist/mjs/toolbar/widgets/components/makeFileInput.mjs +7 -7
- package/dist/mjs/toolbar/widgets/components/makeGridSelector.mjs +5 -5
- package/dist/mjs/toolbar/widgets/components/makeSnappedList.mjs +9 -5
- package/dist/mjs/toolbar/widgets/keybindings.mjs +2 -2
- package/dist/mjs/toolbar/widgets/layout/DropdownLayoutManager.mjs +6 -6
- package/dist/mjs/tools/BaseTool.mjs +6 -4
- package/dist/mjs/tools/Eraser.mjs +25 -20
- package/dist/mjs/tools/FindTool.mjs +2 -2
- package/dist/mjs/tools/InputFilter/ContextMenuRecognizer.mjs +2 -4
- package/dist/mjs/tools/InputFilter/InputMapper.mjs +1 -1
- package/dist/mjs/tools/InputFilter/InputPipeline.mjs +1 -1
- package/dist/mjs/tools/InputFilter/InputStabilizer.mjs +13 -6
- package/dist/mjs/tools/InputFilter/StrokeKeyboardControl.mjs +7 -4
- package/dist/mjs/tools/PanZoom.d.ts +1 -1
- package/dist/mjs/tools/PanZoom.mjs +18 -13
- package/dist/mjs/tools/PasteHandler.mjs +8 -2
- package/dist/mjs/tools/Pen.mjs +18 -10
- package/dist/mjs/tools/ScrollbarTool.mjs +8 -7
- package/dist/mjs/tools/SelectionTool/Selection.mjs +16 -12
- package/dist/mjs/tools/SelectionTool/SelectionHandle.mjs +5 -2
- package/dist/mjs/tools/SelectionTool/SelectionMenuShortcut.mjs +3 -1
- package/dist/mjs/tools/SelectionTool/SelectionTool.mjs +26 -17
- package/dist/mjs/tools/SelectionTool/ToPointerAutoscroller.mjs +1 -1
- package/dist/mjs/tools/SelectionTool/TransformMode.mjs +6 -7
- package/dist/mjs/tools/SelectionTool/util/makeClipboardErrorHandlers.mjs +23 -2
- package/dist/mjs/tools/SelectionTool/util/showSelectionContextMenu.mjs +29 -20
- package/dist/mjs/tools/SoundUITool.mjs +5 -3
- package/dist/mjs/tools/TextTool.mjs +8 -6
- package/dist/mjs/tools/ToolController.mjs +16 -10
- package/dist/mjs/tools/localization.d.ts +2 -0
- package/dist/mjs/tools/localization.mjs +3 -1
- package/dist/mjs/tools/util/StationaryPenDetector.mjs +3 -3
- package/dist/mjs/tools/util/createMenuOverlay.mjs +2 -2
- package/dist/mjs/util/ClipboardHandler.d.ts +1 -1
- package/dist/mjs/util/ClipboardHandler.mjs +19 -18
- package/dist/mjs/util/ReactiveValue.mjs +16 -12
- package/dist/mjs/util/adjustEditorThemeForContrast.mjs +6 -2
- package/dist/mjs/util/guessKeyCodeFromKey.mjs +1 -1
- package/dist/mjs/util/listenForKeyboardEventsFrom.mjs +8 -6
- package/dist/mjs/util/waitForAll.mjs +3 -3
- package/dist/mjs/util/waitForImageLoaded.mjs +3 -3
- package/dist/mjs/util/waitForTimeout.mjs +1 -1
- package/dist/mjs/version.mjs +1 -1
- package/package.json +88 -88
- package/src/Coloris.css +6 -6
- package/src/Editor.scss +7 -5
- package/src/dialogs/dialogs.scss +3 -4
- package/src/dialogs/makeAboutDialog.scss +2 -2
- package/src/dialogs/makeMessageDialog.scss +11 -7
- package/src/styles.js +1 -1
- package/src/toolbar/AbstractToolbar.scss +20 -12
- package/src/toolbar/DropdownToolbar.scss +5 -4
- package/src/toolbar/EdgeToolbar.scss +65 -31
- package/src/toolbar/toolbar.scss +5 -5
- package/src/toolbar/utils/HelpDisplay.scss +48 -25
- package/src/toolbar/utils/labelVisibleOnHover.scss +39 -16
- package/src/toolbar/widgets/DocumentPropertiesWidget.scss +0 -1
- package/src/toolbar/widgets/HandToolWidget.scss +0 -1
- package/src/toolbar/widgets/InsertImageWidget/InsertImageWidget.scss +2 -3
- package/src/toolbar/widgets/OverflowWidget.css +1 -2
- package/src/toolbar/widgets/PenToolWidget.scss +0 -2
- package/src/toolbar/widgets/SelectionToolWidget.scss +1 -2
- package/src/toolbar/widgets/components/components.scss +6 -6
- package/src/toolbar/widgets/components/makeColorInput.scss +0 -2
- package/src/toolbar/widgets/components/makeFileInput.scss +5 -7
- package/src/toolbar/widgets/components/makeGridSelector.scss +6 -9
- package/src/toolbar/widgets/components/makeSnappedList.scss +3 -4
- package/src/toolbar/widgets/components/makeThicknessSlider.scss +1 -2
- package/src/toolbar/widgets/widgets.scss +7 -7
- package/src/tools/FindTool.css +1 -2
- package/src/tools/ScrollbarTool.scss +9 -5
- package/src/tools/SelectionTool/SelectionTool.scss +15 -7
- package/src/tools/SelectionTool/util/makeClipboardErrorHandlers.scss +1 -2
- package/src/tools/SoundUITool.scss +4 -4
- package/src/tools/tools.scss +5 -6
- package/src/tools/util/createMenuOverlay.scss +10 -4
- package/tsconfig.json +1 -3
- package/typedoc.json +1 -1
@@ -25,13 +25,19 @@ export default class ToolController {
|
|
25
25
|
this.activeTool = null;
|
26
26
|
this.isEditorReadOnly = editor.isReadOnlyReactiveValue();
|
27
27
|
this.inputPipeline = new InputPipeline();
|
28
|
-
this.inputPipeline.setEmitListener(event => this.onEventInternal(event));
|
28
|
+
this.inputPipeline.setEmitListener((event) => this.onEventInternal(event));
|
29
29
|
const primaryToolGroup = new ToolEnabledGroup();
|
30
30
|
this.primaryToolGroup = primaryToolGroup;
|
31
31
|
const panZoomTool = new PanZoom(editor, PanZoomMode.TwoFingerTouchGestures | PanZoomMode.RightClickDrags, localization.touchPanTool);
|
32
32
|
const keyboardPanZoomTool = new PanZoom(editor, PanZoomMode.Keyboard, localization.keyboardPanZoom);
|
33
|
-
const primaryPenTool = new Pen(editor, localization.penTool(1), {
|
34
|
-
|
33
|
+
const primaryPenTool = new Pen(editor, localization.penTool(1), {
|
34
|
+
color: Color4.purple,
|
35
|
+
thickness: 8,
|
36
|
+
});
|
37
|
+
const secondaryPenTool = new Pen(editor, localization.penTool(2), {
|
38
|
+
color: Color4.clay,
|
39
|
+
thickness: 4,
|
40
|
+
});
|
35
41
|
// Stabilize the secondary pen tool.
|
36
42
|
secondaryPenTool.setInputMapper(new InputStabilizer(editor.viewport));
|
37
43
|
const eraser = new Eraser(editor, localization.eraserTool);
|
@@ -43,7 +49,7 @@ export default class ToolController {
|
|
43
49
|
new Pen(editor, localization.penTool(3), {
|
44
50
|
color: Color4.ofRGBA(1, 1, 0, 0.5),
|
45
51
|
thickness: 40,
|
46
|
-
factory: makePressureSensitiveFreehandLineBuilder
|
52
|
+
factory: makePressureSensitiveFreehandLineBuilder,
|
47
53
|
}),
|
48
54
|
eraser,
|
49
55
|
new SelectionTool(editor, localization.selectionTool),
|
@@ -68,15 +74,15 @@ export default class ToolController {
|
|
68
74
|
new PasteHandler(editor),
|
69
75
|
new SelectAllShortcutHandler(editor),
|
70
76
|
];
|
71
|
-
primaryTools.forEach(tool => tool.setToolGroup(primaryToolGroup));
|
77
|
+
primaryTools.forEach((tool) => tool.setToolGroup(primaryToolGroup));
|
72
78
|
panZoomTool.setEnabled(true);
|
73
79
|
primaryPenTool.setEnabled(true);
|
74
|
-
editor.notifier.on(EditorEventType.ToolEnabled, event => {
|
80
|
+
editor.notifier.on(EditorEventType.ToolEnabled, (event) => {
|
75
81
|
if (event.kind === EditorEventType.ToolEnabled) {
|
76
82
|
editor.announceForAccessibility(localization.toolEnabledAnnouncement(event.tool.description));
|
77
83
|
}
|
78
84
|
});
|
79
|
-
editor.notifier.on(EditorEventType.ToolDisabled, event => {
|
85
|
+
editor.notifier.on(EditorEventType.ToolDisabled, (event) => {
|
80
86
|
if (event.kind === EditorEventType.ToolDisabled) {
|
81
87
|
editor.announceForAccessibility(localization.toolDisabledAnnouncement(event.tool.description));
|
82
88
|
}
|
@@ -110,7 +116,7 @@ export default class ToolController {
|
|
110
116
|
}
|
111
117
|
}
|
112
118
|
getPrimaryTools() {
|
113
|
-
return this.tools.filter(tool => {
|
119
|
+
return this.tools.filter((tool) => {
|
114
120
|
return tool.getToolGroup() === this.primaryToolGroup;
|
115
121
|
});
|
116
122
|
}
|
@@ -152,7 +158,7 @@ export default class ToolController {
|
|
152
158
|
this.tools = newTools;
|
153
159
|
}
|
154
160
|
insertTools(insertNear, toolsToInsert, mode) {
|
155
|
-
this.tools = this.tools.filter(tool => !toolsToInsert.includes(tool));
|
161
|
+
this.tools = this.tools.filter((tool) => !toolsToInsert.includes(tool));
|
156
162
|
const newTools = [];
|
157
163
|
for (const tool of this.tools) {
|
158
164
|
if (mode === 'after') {
|
@@ -264,7 +270,7 @@ export default class ToolController {
|
|
264
270
|
this.inputPipeline.addToTail(mapper);
|
265
271
|
}
|
266
272
|
getMatchingTools(type) {
|
267
|
-
return this.tools.filter(tool => tool instanceof type);
|
273
|
+
return this.tools.filter((tool) => tool instanceof type);
|
268
274
|
}
|
269
275
|
// @internal
|
270
276
|
onEditorDestroyed() {
|
@@ -36,6 +36,8 @@ export interface ToolLocalization {
|
|
36
36
|
copyPasteError__heading: string;
|
37
37
|
copyPasteError__description: string;
|
38
38
|
copyPasteError__pasteRetry: string;
|
39
|
+
copyPasteError__copyRetry: string;
|
40
|
+
copyPasteError__copyMe: string;
|
39
41
|
copyPasteError__errorDetails: string;
|
40
42
|
toolEnabledAnnouncement: (toolName: string) => string;
|
41
43
|
toolDisabledAnnouncement: (toolName: string) => string;
|
@@ -14,10 +14,12 @@ export const defaultToolLocalization = {
|
|
14
14
|
selectionMenu__duplicate: 'Duplicate',
|
15
15
|
selectionMenu__delete: 'Delete',
|
16
16
|
selectionMenu__paste: 'Paste',
|
17
|
-
copyPasteError__heading: '
|
17
|
+
copyPasteError__heading: 'Copy/paste',
|
18
18
|
copyPasteError__description: 'Something went wrong — this tool may not have clipboard access.',
|
19
19
|
copyPasteError__errorDetails: 'Show error',
|
20
20
|
copyPasteError__pasteRetry: 'To retry, please paste into the input box below:',
|
21
|
+
copyPasteError__copyRetry: 'To retry, please copy the text in the input box below:',
|
22
|
+
copyPasteError__copyMe: 'Copy me!',
|
21
23
|
autocorrectedTo: (strokeDescription) => `Autocorrected to ${strokeDescription}`,
|
22
24
|
autocorrectionCanceled: 'Autocorrect cancelled',
|
23
25
|
textTool: 'Text',
|
@@ -45,9 +45,9 @@ export default class StationaryPenDetector {
|
|
45
45
|
const movedOutOfRadius = dxFromStationaryStart.length() > this.config.maxRadius;
|
46
46
|
this.hasMovedOutOfRadius ||= movedOutOfRadius;
|
47
47
|
// If not stationary
|
48
|
-
if (movedOutOfRadius
|
49
|
-
|
50
|
-
|
48
|
+
if (movedOutOfRadius ||
|
49
|
+
this.averageVelocity.length() > this.config.maxSpeed ||
|
50
|
+
dtFromStart < this.config.minTimeSeconds) {
|
51
51
|
this.stationaryStartPointer = currentPointer;
|
52
52
|
this.lastPointer = currentPointer;
|
53
53
|
this.setStationaryTimeout(this.config.minTimeSeconds * 1000);
|
@@ -27,7 +27,7 @@ const createMenuOverlay = async (editor, canvasAnchor, options) => {
|
|
27
27
|
await waitForTimeout(hideMenuTimeout);
|
28
28
|
menuModal.close();
|
29
29
|
};
|
30
|
-
return new Promise(resolve => {
|
30
|
+
return new Promise((resolve) => {
|
31
31
|
let resolved = false;
|
32
32
|
let result = null;
|
33
33
|
const resolveWithSelectedResult = () => {
|
@@ -70,7 +70,7 @@ const createMenuOverlay = async (editor, canvasAnchor, options) => {
|
|
70
70
|
// - https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menu_role and
|
71
71
|
// - https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/examples/disclosure-navigation/
|
72
72
|
contentElement.addEventListener('keydown', (event) => {
|
73
|
-
const focusedIndex = optionElements.findIndex(item => item === document.activeElement);
|
73
|
+
const focusedIndex = optionElements.findIndex((item) => item === document.activeElement);
|
74
74
|
if (focusedIndex === -1)
|
75
75
|
return;
|
76
76
|
let newFocusedIndex = focusedIndex;
|
@@ -29,7 +29,7 @@ export default class ClipboardHandler {
|
|
29
29
|
* is to be copied. This is done because `ClipboardEvent`s seem to not support attaching
|
30
30
|
* images.
|
31
31
|
*/
|
32
|
-
copy(event?: ClipboardEvent): Promise<void>;
|
32
|
+
copy(event?: ClipboardEvent | DragEvent): Promise<void>;
|
33
33
|
private copyInternal;
|
34
34
|
}
|
35
35
|
export {};
|
@@ -58,20 +58,15 @@ class ClipboardHandler {
|
|
58
58
|
const clipboardData = event?.dataTransfer ?? event?.clipboardData ?? null;
|
59
59
|
const hasEvent = !!clipboardData;
|
60
60
|
const sendPasteEvent = (mime, data) => {
|
61
|
-
return data &&
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
return (data &&
|
62
|
+
editor.toolController.dispatchInputEvent({
|
63
|
+
kind: InputEvtType.PasteEvent,
|
64
|
+
mime,
|
65
|
+
data,
|
66
|
+
}));
|
66
67
|
};
|
67
68
|
// Listed in order of precedence
|
68
|
-
const supportedMIMEs = [
|
69
|
-
'image/svg+xml',
|
70
|
-
'text/html',
|
71
|
-
'image/png',
|
72
|
-
'image/jpeg',
|
73
|
-
'text/plain',
|
74
|
-
];
|
69
|
+
const supportedMIMEs = ['image/svg+xml', 'text/html', 'image/png', 'image/jpeg', 'text/plain'];
|
75
70
|
let files = [];
|
76
71
|
const textData = new Map();
|
77
72
|
if (hasEvent) {
|
@@ -105,7 +100,7 @@ class ClipboardHandler {
|
|
105
100
|
}
|
106
101
|
}
|
107
102
|
for (const file of files) {
|
108
|
-
const fileType = file
|
103
|
+
const fileType = file?.type?.toLowerCase();
|
109
104
|
if (fileType !== mime) {
|
110
105
|
continue;
|
111
106
|
}
|
@@ -181,14 +176,19 @@ class ClipboardHandler {
|
|
181
176
|
event?.preventDefault();
|
182
177
|
}
|
183
178
|
const mimeTypes = [...mimeToData.keys()];
|
184
|
-
const hasNonTextMimeTypes = mimeTypes.some(mime => !isTextMimeType(mime));
|
179
|
+
const hasNonTextMimeTypes = mimeTypes.some((mime) => !isTextMimeType(mime));
|
185
180
|
const copyToEvent = (reason) => {
|
186
181
|
if (!event) {
|
187
182
|
throw new Error(`Unable to copy -- no event provided${reason ? `. Original error: ${reason}` : ''}`);
|
188
183
|
}
|
189
184
|
for (const [key, value] of mimeToData.entries()) {
|
190
185
|
if (typeof value === 'string') {
|
191
|
-
|
186
|
+
if ('clipboardData' in event) {
|
187
|
+
event.clipboardData?.setData(key, value);
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
event.dataTransfer?.setData(key, value);
|
191
|
+
}
|
192
192
|
}
|
193
193
|
}
|
194
194
|
};
|
@@ -219,7 +219,9 @@ class ClipboardHandler {
|
|
219
219
|
// Browser support for ClipboardItem.supports is limited as of mid 2024. However, some browsers
|
220
220
|
// that do support `.supports` throw an exception when attempting to copy an unsupported MIME type
|
221
221
|
// (e.g. Firefox).
|
222
|
-
const unsupported = 'supports' in ClipboardItem &&
|
222
|
+
const unsupported = 'supports' in ClipboardItem &&
|
223
|
+
typeof ClipboardItem.supports === 'function' &&
|
224
|
+
!ClipboardItem.supports(key);
|
223
225
|
if (!unsupported) {
|
224
226
|
filteredMimeToData[key] = data;
|
225
227
|
}
|
@@ -229,8 +231,7 @@ class ClipboardHandler {
|
|
229
231
|
const browserMimeToData = removeUnsupportedMime(mapInternalDataToBrowserData(mimeToData));
|
230
232
|
return navigator.clipboard.write([new ClipboardItem(browserMimeToData)]);
|
231
233
|
};
|
232
|
-
const supportsClipboardApi =
|
233
|
-
&& typeof navigator?.clipboard?.write !== 'undefined');
|
234
|
+
const supportsClipboardApi = typeof ClipboardItem !== 'undefined' && typeof navigator?.clipboard?.write !== 'undefined';
|
234
235
|
if (!__classPrivateFieldGet(this, _ClipboardHandler_preferClipboardEvents, "f") && supportsClipboardApi && (hasNonTextMimeTypes || !event)) {
|
235
236
|
let clipboardApiPromise = null;
|
236
237
|
const fallBackToCopyEvent = (reason) => {
|
@@ -11,7 +11,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
11
11
|
};
|
12
12
|
var _ReactiveValueImpl_value, _ReactiveValueImpl_onUpdateListeners;
|
13
13
|
const noOpUpdateListenerResult = {
|
14
|
-
remove() { }
|
14
|
+
remove() { },
|
15
15
|
};
|
16
16
|
/**
|
17
17
|
* An update listener that does nothing. Useful for reactive values
|
@@ -37,8 +37,8 @@ const noOpSetUpdateListener = () => {
|
|
37
37
|
export class ReactiveValue {
|
38
38
|
/** Returns a promise that resolves when this value is next changed. */
|
39
39
|
waitForNextUpdate() {
|
40
|
-
return new Promise(resolve => {
|
41
|
-
const listener = this.onUpdate(value => {
|
40
|
+
return new Promise((resolve) => {
|
41
|
+
const listener = this.onUpdate((value) => {
|
42
42
|
listener.remove();
|
43
43
|
resolve(value);
|
44
44
|
});
|
@@ -53,7 +53,7 @@ export class ReactiveValue {
|
|
53
53
|
return {
|
54
54
|
get: () => value,
|
55
55
|
onUpdate: noOpSetUpdateListener,
|
56
|
-
onUpdateAndNow: callback => {
|
56
|
+
onUpdateAndNow: (callback) => {
|
57
57
|
callback(value);
|
58
58
|
return noOpUpdateListenerResult;
|
59
59
|
},
|
@@ -69,7 +69,9 @@ export class ReactiveValue {
|
|
69
69
|
*/
|
70
70
|
static fromCallback(callback, sourceValues) {
|
71
71
|
const result = new ReactiveValueImpl(callback());
|
72
|
-
const resultRef = window.WeakRef
|
72
|
+
const resultRef = window.WeakRef
|
73
|
+
? new window.WeakRef(result)
|
74
|
+
: { deref: () => result };
|
73
75
|
for (const value of sourceValues) {
|
74
76
|
const listener = value.onUpdate(() => {
|
75
77
|
// Use resultRef to allow `result` to be garbage collected
|
@@ -88,12 +90,12 @@ export class ReactiveValue {
|
|
88
90
|
static map(source, map, inverseMap) {
|
89
91
|
const result = ReactiveValue.fromInitialValue(map(source.get()));
|
90
92
|
let expectedResultValue = result.get();
|
91
|
-
source.onUpdate(newValue => {
|
93
|
+
source.onUpdate((newValue) => {
|
92
94
|
expectedResultValue = map(newValue);
|
93
95
|
result.set(expectedResultValue);
|
94
96
|
});
|
95
97
|
if (inverseMap) {
|
96
|
-
result.onUpdate(newValue => {
|
98
|
+
result.onUpdate((newValue) => {
|
97
99
|
// Prevent infinite loops if inverseMap is not a true
|
98
100
|
// inverse.
|
99
101
|
if (newValue !== expectedResultValue) {
|
@@ -105,16 +107,18 @@ export class ReactiveValue {
|
|
105
107
|
}
|
106
108
|
static union(values) {
|
107
109
|
return ReactiveValue.fromCallback(() => {
|
108
|
-
return values.map(value => value.get());
|
110
|
+
return values.map((value) => value.get());
|
109
111
|
}, values);
|
110
112
|
}
|
111
113
|
}
|
112
114
|
export class MutableReactiveValue extends ReactiveValue {
|
113
115
|
static fromProperty(sourceValue, propertyName) {
|
114
116
|
const child = ReactiveValue.fromInitialValue(sourceValue.get()[propertyName]);
|
115
|
-
const childRef = window.WeakRef
|
117
|
+
const childRef = window.WeakRef
|
118
|
+
? new window.WeakRef(child)
|
119
|
+
: { deref: () => child };
|
116
120
|
// When the source is updated...
|
117
|
-
const sourceListener = sourceValue.onUpdate(newValue => {
|
121
|
+
const sourceListener = sourceValue.onUpdate((newValue) => {
|
118
122
|
const childValue = childRef.deref();
|
119
123
|
if (childValue) {
|
120
124
|
childValue.set(newValue[propertyName]);
|
@@ -127,7 +131,7 @@ export class MutableReactiveValue extends ReactiveValue {
|
|
127
131
|
});
|
128
132
|
// When the child is updated, also apply the update to the
|
129
133
|
// parent.
|
130
|
-
child.onUpdate(newValue => {
|
134
|
+
child.onUpdate((newValue) => {
|
131
135
|
sourceValue.set({
|
132
136
|
...sourceValue.get(),
|
133
137
|
[propertyName]: newValue,
|
@@ -164,7 +168,7 @@ class ReactiveValueImpl extends MutableReactiveValue {
|
|
164
168
|
__classPrivateFieldGet(this, _ReactiveValueImpl_onUpdateListeners, "f").push(listener);
|
165
169
|
return {
|
166
170
|
remove: () => {
|
167
|
-
__classPrivateFieldSet(this, _ReactiveValueImpl_onUpdateListeners, __classPrivateFieldGet(this, _ReactiveValueImpl_onUpdateListeners, "f").filter(otherListener => {
|
171
|
+
__classPrivateFieldSet(this, _ReactiveValueImpl_onUpdateListeners, __classPrivateFieldGet(this, _ReactiveValueImpl_onUpdateListeners, "f").filter((otherListener) => {
|
168
172
|
return otherListener !== listener;
|
169
173
|
}), "f");
|
170
174
|
},
|
@@ -73,8 +73,12 @@ const adjustEditorThemeForContrast = (editor, options) => {
|
|
73
73
|
// true if the variable can be updated
|
74
74
|
updateVar1, updateVar2) => {
|
75
75
|
// Fetch from updatedColors if available -- styles isn't updated dynamically.
|
76
|
-
let color1 = updatedColors[var1]
|
77
|
-
|
76
|
+
let color1 = updatedColors[var1]
|
77
|
+
? updatedColors[var1]
|
78
|
+
: Color4.fromString(styles.getPropertyValue(var1));
|
79
|
+
let color2 = updatedColors[var2]
|
80
|
+
? updatedColors[var2]
|
81
|
+
: Color4.fromString(styles.getPropertyValue(var2));
|
78
82
|
// Ensure that color1 has the lesser luminance
|
79
83
|
if (color1.relativeLuminance() < color2.relativeLuminance()) {
|
80
84
|
const tmp = color1;
|
@@ -19,7 +19,7 @@ const listenForKeyboardEventsFrom = (elem, callbacks) => {
|
|
19
19
|
return a.key === b.key && a.code === b.code;
|
20
20
|
};
|
21
21
|
const isKeyDown = (keyEvent) => {
|
22
|
-
return keysDown.some(other => keyEventsMatch(other, keyEvent));
|
22
|
+
return keysDown.some((other) => keyEventsMatch(other, keyEvent));
|
23
23
|
};
|
24
24
|
const keyEventToRecord = (event) => {
|
25
25
|
return {
|
@@ -45,10 +45,11 @@ const listenForKeyboardEventsFrom = (elem, callbacks) => {
|
|
45
45
|
}
|
46
46
|
callbacks.handleKeyDown(htmlEvent);
|
47
47
|
}
|
48
|
-
else {
|
48
|
+
else {
|
49
|
+
// keyup
|
49
50
|
console.assert(htmlEvent.type === 'keyup');
|
50
51
|
// Remove the key from keysDown -- it's no longer down.
|
51
|
-
keysDown = keysDown.filter(event => {
|
52
|
+
keysDown = keysDown.filter((event) => {
|
52
53
|
const matches = keyEventsMatch(event, htmlEvent);
|
53
54
|
return !matches;
|
54
55
|
});
|
@@ -58,17 +59,18 @@ const listenForKeyboardEventsFrom = (elem, callbacks) => {
|
|
58
59
|
callbacks.handleKeyUp(htmlEvent);
|
59
60
|
}
|
60
61
|
};
|
61
|
-
elem.addEventListener('keydown', htmlEvent => {
|
62
|
+
elem.addEventListener('keydown', (htmlEvent) => {
|
62
63
|
handleKeyEvent(htmlEvent);
|
63
64
|
});
|
64
|
-
elem.addEventListener('keyup', htmlEvent => {
|
65
|
+
elem.addEventListener('keyup', (htmlEvent) => {
|
65
66
|
handleKeyEvent(htmlEvent);
|
66
67
|
});
|
67
68
|
elem.addEventListener('focusout', (focusEvent) => {
|
68
69
|
let stillHasFocus = false;
|
69
70
|
if (focusEvent.relatedTarget) {
|
70
71
|
const relatedTarget = focusEvent.relatedTarget;
|
71
|
-
stillHasFocus =
|
72
|
+
stillHasFocus =
|
73
|
+
elem.contains(relatedTarget) || callbacks.getHandlesKeyEventsFrom(relatedTarget);
|
72
74
|
}
|
73
75
|
if (!stillHasFocus) {
|
74
76
|
for (const event of keysDown) {
|
@@ -6,11 +6,11 @@
|
|
6
6
|
*/
|
7
7
|
const waitForAll = (results) => {
|
8
8
|
// If any are Promises...
|
9
|
-
if (results.some(command => command && command['then'])) {
|
9
|
+
if (results.some((command) => command && command['then'])) {
|
10
10
|
// Wait for all commands to finish.
|
11
|
-
return Promise.all(results)
|
11
|
+
return (Promise.all(results)
|
12
12
|
// Ensure we return a Promise<void> and not a Promise<void[]>
|
13
|
-
.then(() => { });
|
13
|
+
.then(() => { }));
|
14
14
|
}
|
15
15
|
return;
|
16
16
|
};
|
@@ -1,12 +1,12 @@
|
|
1
1
|
const waitForImageLoad = async (image) => {
|
2
2
|
if (!image.complete) {
|
3
3
|
await new Promise((resolve, reject) => {
|
4
|
-
image.onload = event => resolve(event);
|
4
|
+
image.onload = (event) => resolve(event);
|
5
5
|
// TODO(v2): Return a `new Error(event.message)`
|
6
6
|
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- Forwarding an error-like object.
|
7
|
-
image.onerror = event => reject(event);
|
7
|
+
image.onerror = (event) => reject(event);
|
8
8
|
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- Forwarding an error-like object.
|
9
|
-
image.onabort = event => reject(event);
|
9
|
+
image.onabort = (event) => reject(event);
|
10
10
|
});
|
11
11
|
}
|
12
12
|
};
|
package/dist/mjs/version.mjs
CHANGED
package/package.json
CHANGED
@@ -1,90 +1,90 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
2
|
+
"name": "js-draw",
|
3
|
+
"version": "1.22.0",
|
4
|
+
"description": "Draw pictures using a pen, touchscreen, or mouse! JS-draw is a drawing library for JavaScript and TypeScript. ",
|
5
|
+
"types": "./dist/mjs/lib.d.ts",
|
6
|
+
"main": "./dist/cjs/lib.js",
|
7
|
+
"exports": {
|
8
|
+
".": {
|
9
|
+
"types": "./dist/mjs/lib.d.ts",
|
10
|
+
"import": "./dist/mjs/lib.mjs",
|
11
|
+
"require": "./dist/cjs/lib.js"
|
12
|
+
},
|
13
|
+
"./styles": {
|
14
|
+
"default": "./src/styles.js"
|
15
|
+
},
|
16
|
+
"./Editor.css": {
|
17
|
+
"default": "./dist/Editor.css"
|
18
|
+
},
|
19
|
+
"./bundle": {
|
20
|
+
"types": "./dist/mjs/bundle/bundled.d.ts",
|
21
|
+
"default": "./dist/bundle.js"
|
22
|
+
},
|
23
|
+
"./bundledStyles": {
|
24
|
+
"default": "./dist/bundledStyles.js"
|
25
|
+
},
|
26
|
+
"./Editor": {
|
27
|
+
"types": "./dist/mjs/Editor.d.ts",
|
28
|
+
"require": "./dist/cjs/Editor.js",
|
29
|
+
"default": "./dist/mjs/Editor.mjs"
|
30
|
+
},
|
31
|
+
"./types": {
|
32
|
+
"types": "./dist/mjs/types.d.ts",
|
33
|
+
"default": "./dist/mjs/types.mjs"
|
34
|
+
},
|
35
|
+
"./localization": {
|
36
|
+
"types": "./dist/mjs/localization.d.ts",
|
37
|
+
"require": "./dist/cjs/localization.js",
|
38
|
+
"default": "./dist/mjs/localization.mjs"
|
39
|
+
},
|
40
|
+
"./components": {
|
41
|
+
"types": "./dist/mjs/components/lib.d.ts",
|
42
|
+
"require": "./dist/cjs/components/lib.js",
|
43
|
+
"default": "./dist/mjs/components/lib.mjs"
|
44
|
+
},
|
45
|
+
"./commands": {
|
46
|
+
"types": "./dist/mjs/commands/lib.d.ts",
|
47
|
+
"require": "./dist/cjs/commands/lib.js",
|
48
|
+
"default": "./dist/mjs/commands/lib.mjs"
|
49
|
+
}
|
50
|
+
},
|
51
|
+
"repository": {
|
52
|
+
"type": "git",
|
53
|
+
"url": "git+https://github.com/personalizedrefrigerator/js-draw.git"
|
54
|
+
},
|
55
|
+
"author": "Henry Heino",
|
56
|
+
"license": "MIT",
|
57
|
+
"scripts": {
|
58
|
+
"dist-test": "cd dist-test/test_imports && yarn install && yarn run test",
|
59
|
+
"dist": "yarn run build && yarn run dist-test",
|
60
|
+
"build": "build-tool build",
|
61
|
+
"watch": "build-tool watch",
|
62
|
+
"build-translation-templates": "build-tool build-translation-templates",
|
63
|
+
"prepack": "yarn run dist && cd ../../ && yarn run test && cd packages/js-draw && ts-node tools/copyREADME.ts copy",
|
64
|
+
"postpack": "ts-node tools/copyREADME.ts revert"
|
65
|
+
},
|
66
|
+
"dependencies": {
|
67
|
+
"@js-draw/math": "^1.22.0",
|
68
|
+
"@melloware/coloris": "0.22.0"
|
69
|
+
},
|
70
|
+
"devDependencies": {
|
71
|
+
"@js-draw/build-tool": "^1.22.0",
|
72
|
+
"@types/jest": "29.5.5",
|
73
|
+
"@types/jsdom": "21.1.3"
|
74
|
+
},
|
75
|
+
"bugs": {
|
76
|
+
"url": "https://github.com/personalizedrefrigerator/js-draw/issues"
|
77
|
+
},
|
78
|
+
"homepage": "https://github.com/personalizedrefrigerator/js-draw#readme",
|
79
|
+
"directories": {
|
80
|
+
"doc": "docs"
|
81
|
+
},
|
82
|
+
"keywords": [
|
83
|
+
"ink",
|
84
|
+
"drawing",
|
85
|
+
"pen",
|
86
|
+
"freehand",
|
87
|
+
"svg"
|
88
|
+
],
|
89
|
+
"gitHead": "c922cf6e44d078133100e01383ba1bacdebe01bd"
|
90
90
|
}
|