js-draw 1.20.3 → 1.21.2
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +1 -1
- package/dist/Editor.css +136 -26
- package/dist/bundle.js +2 -2
- package/dist/bundledStyles.js +1 -1
- package/dist/cjs/Editor.d.ts +27 -6
- package/dist/cjs/Editor.js +30 -8
- package/dist/cjs/SVGLoader/SVGLoader.js +2 -2
- package/dist/cjs/Viewport.d.ts +2 -2
- package/dist/cjs/commands/Command.d.ts +5 -0
- package/dist/cjs/commands/Command.js +5 -0
- package/dist/cjs/commands/SerializableCommand.d.ts +7 -0
- package/dist/cjs/commands/SerializableCommand.js +9 -0
- package/dist/cjs/dialogs/makeAboutDialog.d.ts +1 -1
- package/dist/cjs/dialogs/makeAboutDialog.js +10 -25
- package/dist/cjs/dialogs/makeMessageDialog.d.ts +11 -0
- package/dist/cjs/dialogs/makeMessageDialog.js +56 -0
- package/dist/cjs/image/EditorImage.d.ts +15 -1
- package/dist/cjs/image/EditorImage.js +15 -5
- package/dist/cjs/inputEvents.d.ts +10 -2
- package/dist/cjs/inputEvents.js +1 -0
- package/dist/cjs/localizations/es.js +3 -0
- package/dist/cjs/rendering/Display.d.ts +1 -0
- package/dist/cjs/rendering/Display.js +1 -0
- package/dist/cjs/rendering/TextRenderingStyle.d.ts +7 -6
- package/dist/cjs/rendering/TextRenderingStyle.js +1 -0
- package/dist/cjs/rendering/renderers/CanvasRenderer.d.ts +12 -3
- package/dist/cjs/rendering/renderers/CanvasRenderer.js +15 -2
- package/dist/cjs/rendering/renderers/DummyRenderer.d.ts +1 -1
- package/dist/cjs/testing/firstElementAncestorOfNode.d.ts +1 -1
- package/dist/cjs/testing/firstElementAncestorOfNode.js +1 -1
- package/dist/cjs/testing/sendPenEvent.d.ts +2 -2
- package/dist/cjs/testing/sendTouchEvent.d.ts +2 -2
- package/dist/cjs/toolbar/AbstractToolbar.d.ts +6 -1
- package/dist/cjs/toolbar/AbstractToolbar.js +6 -1
- package/dist/cjs/toolbar/IconProvider.d.ts +1 -1
- package/dist/cjs/toolbar/IconProvider.js +6 -1
- package/dist/cjs/toolbar/widgets/BaseWidget.d.ts +8 -0
- package/dist/cjs/toolbar/widgets/BaseWidget.js +8 -0
- package/dist/cjs/toolbar/widgets/HandToolWidget.d.ts +1 -0
- package/dist/cjs/toolbar/widgets/HandToolWidget.js +1 -0
- package/dist/cjs/toolbar/widgets/InsertImageWidget/ImageWrapper.d.ts +1 -1
- package/dist/cjs/toolbar/widgets/PenToolWidget.d.ts +6 -0
- package/dist/cjs/toolbar/widgets/PenToolWidget.js +5 -0
- package/dist/cjs/types.d.ts +5 -0
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/util/ClipboardHandler.d.ts +9 -1
- package/dist/cjs/util/ClipboardHandler.js +82 -24
- package/dist/cjs/version.js +1 -1
- package/dist/mjs/Editor.d.ts +27 -6
- package/dist/mjs/Editor.mjs +31 -9
- package/dist/mjs/SVGLoader/SVGLoader.mjs +2 -2
- package/dist/mjs/Viewport.d.ts +2 -2
- package/dist/mjs/commands/Command.d.ts +5 -0
- package/dist/mjs/commands/Command.mjs +5 -0
- package/dist/mjs/commands/SerializableCommand.d.ts +7 -0
- package/dist/mjs/commands/SerializableCommand.mjs +9 -0
- package/dist/mjs/dialogs/makeAboutDialog.d.ts +1 -1
- package/dist/mjs/dialogs/makeAboutDialog.mjs +7 -25
- package/dist/mjs/dialogs/makeMessageDialog.d.ts +11 -0
- package/dist/mjs/dialogs/makeMessageDialog.mjs +51 -0
- package/dist/mjs/image/EditorImage.d.ts +15 -1
- package/dist/mjs/image/EditorImage.mjs +15 -5
- package/dist/mjs/inputEvents.d.ts +10 -2
- package/dist/mjs/inputEvents.mjs +1 -0
- package/dist/mjs/localizations/es.mjs +3 -0
- package/dist/mjs/rendering/Display.d.ts +1 -0
- package/dist/mjs/rendering/Display.mjs +1 -0
- package/dist/mjs/rendering/TextRenderingStyle.d.ts +7 -6
- package/dist/mjs/rendering/TextRenderingStyle.mjs +1 -0
- package/dist/mjs/rendering/renderers/CanvasRenderer.d.ts +12 -3
- package/dist/mjs/rendering/renderers/CanvasRenderer.mjs +15 -2
- package/dist/mjs/rendering/renderers/DummyRenderer.d.ts +1 -1
- package/dist/mjs/testing/firstElementAncestorOfNode.d.ts +1 -1
- package/dist/mjs/testing/firstElementAncestorOfNode.mjs +1 -1
- package/dist/mjs/testing/sendPenEvent.d.ts +2 -2
- package/dist/mjs/testing/sendTouchEvent.d.ts +2 -2
- package/dist/mjs/toolbar/AbstractToolbar.d.ts +6 -1
- package/dist/mjs/toolbar/AbstractToolbar.mjs +6 -1
- package/dist/mjs/toolbar/IconProvider.d.ts +1 -1
- package/dist/mjs/toolbar/IconProvider.mjs +6 -1
- package/dist/mjs/toolbar/widgets/BaseWidget.d.ts +8 -0
- package/dist/mjs/toolbar/widgets/BaseWidget.mjs +8 -0
- package/dist/mjs/toolbar/widgets/HandToolWidget.d.ts +1 -0
- package/dist/mjs/toolbar/widgets/HandToolWidget.mjs +1 -0
- package/dist/mjs/toolbar/widgets/InsertImageWidget/ImageWrapper.d.ts +1 -1
- package/dist/mjs/toolbar/widgets/PenToolWidget.d.ts +6 -0
- package/dist/mjs/toolbar/widgets/PenToolWidget.mjs +5 -0
- package/dist/mjs/types.d.ts +5 -0
- package/dist/mjs/types.mjs +1 -0
- package/dist/mjs/util/ClipboardHandler.d.ts +9 -1
- package/dist/mjs/util/ClipboardHandler.mjs +82 -24
- package/dist/mjs/version.mjs +1 -1
- package/package.json +8 -9
- package/src/dialogs/dialogs.scss +9 -21
- package/src/dialogs/makeAboutDialog.scss +13 -33
- package/src/dialogs/makeMessageDialog.scss +46 -0
- package/dist/cjs/tools/BaseTool.d.ts +0 -60
- package/dist/cjs/tools/BaseTool.js +0 -174
- package/dist/cjs/tools/Eraser.d.ts +0 -56
- package/dist/cjs/tools/Eraser.js +0 -295
- package/dist/cjs/tools/Eraser.test.d.ts +0 -1
- package/dist/cjs/tools/FindTool.d.ts +0 -21
- package/dist/cjs/tools/FindTool.js +0 -137
- package/dist/cjs/tools/FindTool.test.d.ts +0 -1
- package/dist/cjs/tools/InputFilter/FunctionMapper.d.ts +0 -12
- package/dist/cjs/tools/InputFilter/FunctionMapper.js +0 -21
- package/dist/cjs/tools/InputFilter/InputMapper.d.ts +0 -23
- package/dist/cjs/tools/InputFilter/InputMapper.js +0 -38
- package/dist/cjs/tools/InputFilter/InputPipeline.d.ts +0 -15
- package/dist/cjs/tools/InputFilter/InputPipeline.js +0 -54
- package/dist/cjs/tools/InputFilter/InputPipeline.test.d.ts +0 -1
- package/dist/cjs/tools/InputFilter/InputStabilizer.d.ts +0 -29
- package/dist/cjs/tools/InputFilter/InputStabilizer.js +0 -181
- package/dist/cjs/tools/InputFilter/StrokeKeyboardControl.d.ts +0 -21
- package/dist/cjs/tools/InputFilter/StrokeKeyboardControl.js +0 -84
- package/dist/cjs/tools/PanZoom.d.ts +0 -119
- package/dist/cjs/tools/PanZoom.js +0 -508
- package/dist/cjs/tools/PanZoom.test.d.ts +0 -1
- package/dist/cjs/tools/PasteHandler.d.ts +0 -23
- package/dist/cjs/tools/PasteHandler.js +0 -109
- package/dist/cjs/tools/Pen.d.ts +0 -53
- package/dist/cjs/tools/Pen.js +0 -318
- package/dist/cjs/tools/Pen.test.d.ts +0 -1
- package/dist/cjs/tools/PipetteTool.d.ts +0 -28
- package/dist/cjs/tools/PipetteTool.js +0 -69
- package/dist/cjs/tools/ScrollbarTool.d.ts +0 -18
- package/dist/cjs/tools/ScrollbarTool.js +0 -85
- package/dist/cjs/tools/SelectionTool/SelectAllShortcutHandler.d.ts +0 -9
- package/dist/cjs/tools/SelectionTool/SelectAllShortcutHandler.js +0 -32
- package/dist/cjs/tools/SelectionTool/Selection.d.ts +0 -71
- package/dist/cjs/tools/SelectionTool/Selection.js +0 -620
- package/dist/cjs/tools/SelectionTool/SelectionHandle.d.ts +0 -62
- package/dist/cjs/tools/SelectionTool/SelectionHandle.js +0 -141
- package/dist/cjs/tools/SelectionTool/SelectionTool.d.ts +0 -40
- package/dist/cjs/tools/SelectionTool/SelectionTool.js +0 -494
- package/dist/cjs/tools/SelectionTool/SelectionTool.selecting.test.d.ts +0 -1
- package/dist/cjs/tools/SelectionTool/SelectionTool.test.d.ts +0 -1
- package/dist/cjs/tools/SelectionTool/ToPointerAutoscroller.d.ts +0 -23
- package/dist/cjs/tools/SelectionTool/ToPointerAutoscroller.js +0 -83
- package/dist/cjs/tools/SelectionTool/TransformMode.d.ts +0 -42
- package/dist/cjs/tools/SelectionTool/TransformMode.js +0 -155
- package/dist/cjs/tools/SelectionTool/types.d.ts +0 -28
- package/dist/cjs/tools/SelectionTool/types.js +0 -14
- package/dist/cjs/tools/SoundUITool.d.ts +0 -26
- package/dist/cjs/tools/SoundUITool.js +0 -171
- package/dist/cjs/tools/TextTool.d.ts +0 -36
- package/dist/cjs/tools/TextTool.js +0 -285
- package/dist/cjs/tools/TextTool.test.d.ts +0 -1
- package/dist/cjs/tools/ToolController.d.ts +0 -73
- package/dist/cjs/tools/ToolController.js +0 -304
- package/dist/cjs/tools/ToolController.test.d.ts +0 -1
- package/dist/cjs/tools/ToolEnabledGroup.d.ts +0 -6
- package/dist/cjs/tools/ToolEnabledGroup.js +0 -13
- package/dist/cjs/tools/ToolSwitcherShortcut.d.ts +0 -16
- package/dist/cjs/tools/ToolSwitcherShortcut.js +0 -40
- package/dist/cjs/tools/ToolbarShortcutHandler.d.ts +0 -12
- package/dist/cjs/tools/ToolbarShortcutHandler.js +0 -34
- package/dist/cjs/tools/UndoRedoShortcut.d.ts +0 -8
- package/dist/cjs/tools/UndoRedoShortcut.js +0 -27
- package/dist/cjs/tools/UndoRedoShortcut.test.d.ts +0 -1
- package/dist/cjs/tools/keybindings.d.ts +0 -18
- package/dist/cjs/tools/keybindings.js +0 -49
- package/dist/cjs/tools/lib.d.ts +0 -14
- package/dist/cjs/tools/lib.js +0 -36
- package/dist/cjs/tools/localization.d.ts +0 -34
- package/dist/cjs/tools/localization.js +0 -36
- package/dist/cjs/tools/util/StationaryPenDetector.d.ts +0 -22
- package/dist/cjs/tools/util/StationaryPenDetector.js +0 -95
- package/dist/mjs/tools/BaseTool.d.ts +0 -60
- package/dist/mjs/tools/BaseTool.mjs +0 -172
- package/dist/mjs/tools/Eraser.d.ts +0 -56
- package/dist/mjs/tools/Eraser.mjs +0 -288
- package/dist/mjs/tools/Eraser.test.d.ts +0 -1
- package/dist/mjs/tools/FindTool.d.ts +0 -21
- package/dist/mjs/tools/FindTool.mjs +0 -131
- package/dist/mjs/tools/FindTool.test.d.ts +0 -1
- package/dist/mjs/tools/InputFilter/FunctionMapper.d.ts +0 -12
- package/dist/mjs/tools/InputFilter/FunctionMapper.mjs +0 -15
- package/dist/mjs/tools/InputFilter/InputMapper.d.ts +0 -23
- package/dist/mjs/tools/InputFilter/InputMapper.mjs +0 -36
- package/dist/mjs/tools/InputFilter/InputPipeline.d.ts +0 -15
- package/dist/mjs/tools/InputFilter/InputPipeline.mjs +0 -49
- package/dist/mjs/tools/InputFilter/InputPipeline.test.d.ts +0 -1
- package/dist/mjs/tools/InputFilter/InputStabilizer.d.ts +0 -29
- package/dist/mjs/tools/InputFilter/InputStabilizer.mjs +0 -175
- package/dist/mjs/tools/InputFilter/StrokeKeyboardControl.d.ts +0 -21
- package/dist/mjs/tools/InputFilter/StrokeKeyboardControl.mjs +0 -78
- package/dist/mjs/tools/PanZoom.d.ts +0 -119
- package/dist/mjs/tools/PanZoom.mjs +0 -501
- package/dist/mjs/tools/PanZoom.test.d.ts +0 -1
- package/dist/mjs/tools/PasteHandler.d.ts +0 -23
- package/dist/mjs/tools/PasteHandler.mjs +0 -103
- package/dist/mjs/tools/Pen.d.ts +0 -53
- package/dist/mjs/tools/Pen.mjs +0 -312
- package/dist/mjs/tools/Pen.test.d.ts +0 -1
- package/dist/mjs/tools/PipetteTool.d.ts +0 -28
- package/dist/mjs/tools/PipetteTool.mjs +0 -63
- package/dist/mjs/tools/ScrollbarTool.d.ts +0 -18
- package/dist/mjs/tools/ScrollbarTool.mjs +0 -79
- package/dist/mjs/tools/SelectionTool/SelectAllShortcutHandler.d.ts +0 -9
- package/dist/mjs/tools/SelectionTool/SelectAllShortcutHandler.mjs +0 -26
- package/dist/mjs/tools/SelectionTool/Selection.d.ts +0 -71
- package/dist/mjs/tools/SelectionTool/Selection.mjs +0 -592
- package/dist/mjs/tools/SelectionTool/SelectionHandle.d.ts +0 -62
- package/dist/mjs/tools/SelectionTool/SelectionHandle.mjs +0 -137
- package/dist/mjs/tools/SelectionTool/SelectionTool.d.ts +0 -40
- package/dist/mjs/tools/SelectionTool/SelectionTool.mjs +0 -488
- package/dist/mjs/tools/SelectionTool/SelectionTool.selecting.test.d.ts +0 -1
- package/dist/mjs/tools/SelectionTool/SelectionTool.test.d.ts +0 -1
- package/dist/mjs/tools/SelectionTool/ToPointerAutoscroller.d.ts +0 -23
- package/dist/mjs/tools/SelectionTool/ToPointerAutoscroller.mjs +0 -77
- package/dist/mjs/tools/SelectionTool/TransformMode.d.ts +0 -42
- package/dist/mjs/tools/SelectionTool/TransformMode.mjs +0 -146
- package/dist/mjs/tools/SelectionTool/types.d.ts +0 -28
- package/dist/mjs/tools/SelectionTool/types.mjs +0 -11
- package/dist/mjs/tools/SoundUITool.d.ts +0 -26
- package/dist/mjs/tools/SoundUITool.mjs +0 -165
- package/dist/mjs/tools/TextTool.d.ts +0 -36
- package/dist/mjs/tools/TextTool.mjs +0 -279
- package/dist/mjs/tools/TextTool.test.d.ts +0 -1
- package/dist/mjs/tools/ToolController.d.ts +0 -73
- package/dist/mjs/tools/ToolController.mjs +0 -275
- package/dist/mjs/tools/ToolController.test.d.ts +0 -1
- package/dist/mjs/tools/ToolEnabledGroup.d.ts +0 -6
- package/dist/mjs/tools/ToolEnabledGroup.mjs +0 -10
- package/dist/mjs/tools/ToolSwitcherShortcut.d.ts +0 -16
- package/dist/mjs/tools/ToolSwitcherShortcut.mjs +0 -34
- package/dist/mjs/tools/ToolbarShortcutHandler.d.ts +0 -12
- package/dist/mjs/tools/ToolbarShortcutHandler.mjs +0 -28
- package/dist/mjs/tools/UndoRedoShortcut.d.ts +0 -8
- package/dist/mjs/tools/UndoRedoShortcut.mjs +0 -21
- package/dist/mjs/tools/UndoRedoShortcut.test.d.ts +0 -1
- package/dist/mjs/tools/keybindings.d.ts +0 -18
- package/dist/mjs/tools/keybindings.mjs +0 -43
- package/dist/mjs/tools/lib.d.ts +0 -14
- package/dist/mjs/tools/lib.mjs +0 -14
- package/dist/mjs/tools/localization.d.ts +0 -34
- package/dist/mjs/tools/localization.mjs +0 -33
- package/dist/mjs/tools/util/StationaryPenDetector.d.ts +0 -22
- package/dist/mjs/tools/util/StationaryPenDetector.mjs +0 -92
- package/src/tools/FindTool.css +0 -7
- package/src/tools/ScrollbarTool.scss +0 -57
- package/src/tools/SelectionTool/SelectionTool.scss +0 -137
- package/src/tools/SoundUITool.scss +0 -22
- package/src/tools/tools.scss +0 -5
@@ -1,34 +0,0 @@
|
|
1
|
-
import BaseTool from './BaseTool.mjs';
|
2
|
-
/**
|
3
|
-
* Handles keyboard events used, by default, to select tools. By default,
|
4
|
-
* 1 maps to the first primary tool, 2 to the second primary tool, ... .
|
5
|
-
*
|
6
|
-
* This is in the default set of {@link ToolController} tools.
|
7
|
-
*
|
8
|
-
*/
|
9
|
-
export default class ToolSwitcherShortcut extends BaseTool {
|
10
|
-
constructor(editor) {
|
11
|
-
super(editor.notifier, editor.localization.changeTool);
|
12
|
-
this.editor = editor;
|
13
|
-
}
|
14
|
-
canReceiveInputInReadOnlyEditor() {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
// @internal
|
18
|
-
onKeyPress({ key }) {
|
19
|
-
const toolController = this.editor.toolController;
|
20
|
-
const primaryTools = toolController.getPrimaryTools();
|
21
|
-
// Map keys 0-9 to primary tools.
|
22
|
-
const keyMatch = /^[0-9]$/.exec(key);
|
23
|
-
let targetTool;
|
24
|
-
if (keyMatch) {
|
25
|
-
const targetIdx = parseInt(keyMatch[0], 10) - 1;
|
26
|
-
targetTool = primaryTools[targetIdx];
|
27
|
-
}
|
28
|
-
if (targetTool) {
|
29
|
-
targetTool.setEnabled(true);
|
30
|
-
return true;
|
31
|
-
}
|
32
|
-
return false;
|
33
|
-
}
|
34
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import Editor from '../Editor';
|
2
|
-
import { KeyPressEvent } from '../inputEvents';
|
3
|
-
import BaseTool from './BaseTool';
|
4
|
-
type KeyPressListener = (event: KeyPressEvent) => boolean;
|
5
|
-
export default class ToolbarShortcutHandler extends BaseTool {
|
6
|
-
private listeners;
|
7
|
-
constructor(editor: Editor);
|
8
|
-
registerListener(listener: KeyPressListener): void;
|
9
|
-
removeListener(listener: KeyPressListener): void;
|
10
|
-
onKeyPress(event: KeyPressEvent): boolean;
|
11
|
-
}
|
12
|
-
export {};
|
@@ -1,28 +0,0 @@
|
|
1
|
-
// Allows the toolbar to register keyboard events.
|
2
|
-
// @packageDocumentation
|
3
|
-
import BaseTool from './BaseTool.mjs';
|
4
|
-
export default class ToolbarShortcutHandler extends BaseTool {
|
5
|
-
constructor(editor) {
|
6
|
-
super(editor.notifier, editor.localization.changeTool);
|
7
|
-
this.listeners = new Set([]);
|
8
|
-
}
|
9
|
-
registerListener(listener) {
|
10
|
-
this.listeners.add(listener);
|
11
|
-
}
|
12
|
-
removeListener(listener) {
|
13
|
-
this.listeners.delete(listener);
|
14
|
-
}
|
15
|
-
onKeyPress(event) {
|
16
|
-
// TypeScript seems to automatically convert for of loops into for(init;check;update)
|
17
|
-
// loops (even with target set to es6). Thus, we cannot iterate directly through the
|
18
|
-
// set here.
|
19
|
-
// See https://stackoverflow.com/q/48886500
|
20
|
-
const listeners = Array.from(this.listeners.values());
|
21
|
-
for (const listener of listeners) {
|
22
|
-
if (listener(event)) {
|
23
|
-
return true;
|
24
|
-
}
|
25
|
-
}
|
26
|
-
return false;
|
27
|
-
}
|
28
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import Editor from '../Editor';
|
2
|
-
import { KeyPressEvent } from '../inputEvents';
|
3
|
-
import BaseTool from './BaseTool';
|
4
|
-
export default class UndoRedoShortcut extends BaseTool {
|
5
|
-
private editor;
|
6
|
-
constructor(editor: Editor);
|
7
|
-
onKeyPress(event: KeyPressEvent): boolean;
|
8
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import BaseTool from './BaseTool.mjs';
|
2
|
-
import { redoKeyboardShortcutId, undoKeyboardShortcutId } from './keybindings.mjs';
|
3
|
-
// Handles ctrl+Z, ctrl+Shift+Z keyboard shortcuts.
|
4
|
-
export default class UndoRedoShortcut extends BaseTool {
|
5
|
-
constructor(editor) {
|
6
|
-
super(editor.notifier, editor.localization.undoRedoTool);
|
7
|
-
this.editor = editor;
|
8
|
-
}
|
9
|
-
// @internal
|
10
|
-
onKeyPress(event) {
|
11
|
-
if (this.editor.shortcuts.matchesShortcut(undoKeyboardShortcutId, event)) {
|
12
|
-
this.editor.history.undo();
|
13
|
-
return true;
|
14
|
-
}
|
15
|
-
else if (this.editor.shortcuts.matchesShortcut(redoKeyboardShortcutId, event)) {
|
16
|
-
this.editor.history.redo();
|
17
|
-
return true;
|
18
|
-
}
|
19
|
-
return false;
|
20
|
-
}
|
21
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,18 +0,0 @@
|
|
1
|
-
export declare const undoKeyboardShortcutId = "jsdraw.tools.undo";
|
2
|
-
export declare const redoKeyboardShortcutId = "jsdaw.tools.redo";
|
3
|
-
export declare const increaseSizeKeyboardShortcutId = "jsdraw.tools.increaseSize";
|
4
|
-
export declare const decreaseSizeKeyboardShortcutId = "jsdraw.tools.decreaseSize";
|
5
|
-
export declare const snapToGridKeyboardShortcutId = "jsdraw.tools.snapToGrid";
|
6
|
-
export declare const lineLockKeyboardShortcutId = "jsdraw.tools.lockToLine";
|
7
|
-
export declare const toggleFindVisibleShortcutId = "js-draw.tools.FindTool.toggleVisible";
|
8
|
-
export declare const moveLeftKeyboardShortcutId = "jsdraw.tools.PanZoom.moveLeft";
|
9
|
-
export declare const moveRightKeyboardShortcutId = "jsdraw.tools.PanZoom.moveRight";
|
10
|
-
export declare const moveUpKeyboardShortcutId = "jsdraw.tools.PanZoom.moveUp";
|
11
|
-
export declare const moveDownKeyboardShortcutId = "jsdraw.tools.PanZoom.moveDown";
|
12
|
-
export declare const rotateClockwiseKeyboardShortcutId = "jsdraw.tools.PanZoom.rotateViewClockwise";
|
13
|
-
export declare const rotateCounterClockwiseKeyboardShortcutId = "jsdraw.tools.PanZoom.rotateViewCounterClockwise";
|
14
|
-
export declare const zoomInKeyboardShortcutId = "jsdraw.tools.PanZoom.zoomIn";
|
15
|
-
export declare const zoomOutKeyboardShortcutId = "jsdraw.tools.PanZoom.zoomOut";
|
16
|
-
export declare const selectAllKeyboardShortcut = "jsdraw.tools.SelectionTool.selectAll";
|
17
|
-
export declare const duplicateSelectionShortcut = "jsdraw.tools.SelectionTool.duplicateSelection";
|
18
|
-
export declare const sendToBackSelectionShortcut = "jsdraw.tools.SelectionTool.sendToBack";
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import KeyboardShortcutManager from '../shortcuts/KeyboardShortcutManager.mjs';
|
2
|
-
// This file contains user-overridable tool-realted keybindings.
|
3
|
-
// Undo/redo
|
4
|
-
export const undoKeyboardShortcutId = 'jsdraw.tools.undo';
|
5
|
-
export const redoKeyboardShortcutId = 'jsdaw.tools.redo';
|
6
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(undoKeyboardShortcutId, ['CtrlOrMeta+KeyZ'], 'Undo');
|
7
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(redoKeyboardShortcutId, ['CtrlOrMeta+Shift+KeyZ', 'CtrlOrMeta+KeyY'], 'Redo');
|
8
|
-
// Pen/eraser/selection keybindings
|
9
|
-
export const increaseSizeKeyboardShortcutId = 'jsdraw.tools.increaseSize';
|
10
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(increaseSizeKeyboardShortcutId, ['Equal', 'Shift+Equal'], 'Increase pen/eraser size');
|
11
|
-
export const decreaseSizeKeyboardShortcutId = 'jsdraw.tools.decreaseSize';
|
12
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(decreaseSizeKeyboardShortcutId, ['Minus', 'Shift+Minus'], 'Decrease pen/eraser size');
|
13
|
-
export const snapToGridKeyboardShortcutId = 'jsdraw.tools.snapToGrid';
|
14
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(snapToGridKeyboardShortcutId, ['Control', 'Meta'], 'Snap to grid (press and hold)');
|
15
|
-
export const lineLockKeyboardShortcutId = 'jsdraw.tools.lockToLine';
|
16
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(lineLockKeyboardShortcutId, ['Shift'], 'Snap to XY axes (press and hold)');
|
17
|
-
// Find tool
|
18
|
-
export const toggleFindVisibleShortcutId = 'js-draw.tools.FindTool.toggleVisible';
|
19
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(toggleFindVisibleShortcutId, ['CtrlOrMeta+KeyF'], 'Shows/hides the find tool');
|
20
|
-
// Pan/zoom
|
21
|
-
export const moveLeftKeyboardShortcutId = 'jsdraw.tools.PanZoom.moveLeft';
|
22
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(moveLeftKeyboardShortcutId, ['ArrowLeft', 'KeyH', 'KeyA'], 'Pan left');
|
23
|
-
export const moveRightKeyboardShortcutId = 'jsdraw.tools.PanZoom.moveRight';
|
24
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(moveRightKeyboardShortcutId, ['ArrowRight', 'KeyL', 'KeyD'], 'Pan right');
|
25
|
-
export const moveUpKeyboardShortcutId = 'jsdraw.tools.PanZoom.moveUp';
|
26
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(moveUpKeyboardShortcutId, ['ArrowUp', 'KeyK', 'KeyQ'], 'Pan up');
|
27
|
-
export const moveDownKeyboardShortcutId = 'jsdraw.tools.PanZoom.moveDown';
|
28
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(moveDownKeyboardShortcutId, ['ArrowDown', 'KeyJ', 'KeyE'], 'Pan down');
|
29
|
-
export const rotateClockwiseKeyboardShortcutId = 'jsdraw.tools.PanZoom.rotateViewClockwise';
|
30
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(rotateClockwiseKeyboardShortcutId, ['Shift+KeyR'], 'Rotate viewport clockwise');
|
31
|
-
export const rotateCounterClockwiseKeyboardShortcutId = 'jsdraw.tools.PanZoom.rotateViewCounterClockwise';
|
32
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(rotateCounterClockwiseKeyboardShortcutId, ['KeyR'], 'Rotate viewport counter-clockwise');
|
33
|
-
export const zoomInKeyboardShortcutId = 'jsdraw.tools.PanZoom.zoomIn';
|
34
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(zoomInKeyboardShortcutId, ['KeyW'], 'Zoom in');
|
35
|
-
export const zoomOutKeyboardShortcutId = 'jsdraw.tools.PanZoom.zoomOut';
|
36
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(zoomOutKeyboardShortcutId, ['KeyS'], 'Zoom out');
|
37
|
-
// Selection
|
38
|
-
export const selectAllKeyboardShortcut = 'jsdraw.tools.SelectionTool.selectAll';
|
39
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(selectAllKeyboardShortcut, ['CtrlOrMeta+KeyA'], 'Select all');
|
40
|
-
export const duplicateSelectionShortcut = 'jsdraw.tools.SelectionTool.duplicateSelection';
|
41
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(duplicateSelectionShortcut, ['CtrlOrMeta+KeyD'], 'Duplicate selection');
|
42
|
-
export const sendToBackSelectionShortcut = 'jsdraw.tools.SelectionTool.sendToBack';
|
43
|
-
KeyboardShortcutManager.registerDefaultKeyboardShortcut(sendToBackSelectionShortcut, ['End'], 'Send to back');
|
package/dist/mjs/tools/lib.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
export { default as BaseTool } from './BaseTool';
|
2
|
-
export { default as ToolController } from './ToolController';
|
3
|
-
export { default as ToolEnabledGroup } from './ToolEnabledGroup';
|
4
|
-
export { default as UndoRedoShortcut } from './UndoRedoShortcut';
|
5
|
-
export { default as ToolSwitcherShortcut } from './ToolSwitcherShortcut';
|
6
|
-
export { default as PanZoomTool, PanZoomMode } from './PanZoom';
|
7
|
-
export { default as PenTool, PenStyle } from './Pen';
|
8
|
-
export { default as TextTool } from './TextTool';
|
9
|
-
export { default as SelectionTool } from './SelectionTool/SelectionTool';
|
10
|
-
export { default as SelectAllShortcutHandler } from './SelectionTool/SelectAllShortcutHandler';
|
11
|
-
export { default as EraserTool, EraserMode } from './Eraser';
|
12
|
-
export { default as PasteHandler } from './PasteHandler';
|
13
|
-
export { default as SoundUITool } from './SoundUITool';
|
14
|
-
export { default as ToolbarShortcutHandler } from './ToolbarShortcutHandler';
|
package/dist/mjs/tools/lib.mjs
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
export { default as BaseTool } from './BaseTool.mjs';
|
2
|
-
export { default as ToolController } from './ToolController.mjs';
|
3
|
-
export { default as ToolEnabledGroup } from './ToolEnabledGroup.mjs';
|
4
|
-
export { default as UndoRedoShortcut } from './UndoRedoShortcut.mjs';
|
5
|
-
export { default as ToolSwitcherShortcut } from './ToolSwitcherShortcut.mjs';
|
6
|
-
export { default as PanZoomTool, PanZoomMode } from './PanZoom.mjs';
|
7
|
-
export { default as PenTool } from './Pen.mjs';
|
8
|
-
export { default as TextTool } from './TextTool.mjs';
|
9
|
-
export { default as SelectionTool } from './SelectionTool/SelectionTool.mjs';
|
10
|
-
export { default as SelectAllShortcutHandler } from './SelectionTool/SelectAllShortcutHandler.mjs';
|
11
|
-
export { default as EraserTool, EraserMode } from './Eraser.mjs';
|
12
|
-
export { default as PasteHandler } from './PasteHandler.mjs';
|
13
|
-
export { default as SoundUITool } from './SoundUITool.mjs';
|
14
|
-
export { default as ToolbarShortcutHandler } from './ToolbarShortcutHandler.mjs';
|
@@ -1,34 +0,0 @@
|
|
1
|
-
export interface ToolLocalization {
|
2
|
-
keyboardPanZoom: string;
|
3
|
-
penTool: (penId: number) => string;
|
4
|
-
selectionTool: string;
|
5
|
-
selectAllTool: string;
|
6
|
-
eraserTool: string;
|
7
|
-
touchPanTool: string;
|
8
|
-
twoFingerPanZoomTool: string;
|
9
|
-
undoRedoTool: string;
|
10
|
-
pipetteTool: string;
|
11
|
-
rightClickDragPanTool: string;
|
12
|
-
autocorrectedTo: (description: string) => string;
|
13
|
-
autocorrectionCanceled: string;
|
14
|
-
textTool: string;
|
15
|
-
enterTextToInsert: string;
|
16
|
-
changeTool: string;
|
17
|
-
pasteHandler: string;
|
18
|
-
soundExplorer: string;
|
19
|
-
disableAccessibilityExploreTool: string;
|
20
|
-
enableAccessibilityExploreTool: string;
|
21
|
-
soundExplorerUsageAnnouncement: string;
|
22
|
-
findLabel: string;
|
23
|
-
toNextMatch: string;
|
24
|
-
closeDialog: string;
|
25
|
-
findDialogShown: string;
|
26
|
-
findDialogHidden: string;
|
27
|
-
focusedFoundText: (currentMatchNumber: number, totalMatches: number) => string;
|
28
|
-
anyDevicePanning: string;
|
29
|
-
copied: (count: number) => string;
|
30
|
-
pasted: (count: number) => string;
|
31
|
-
toolEnabledAnnouncement: (toolName: string) => string;
|
32
|
-
toolDisabledAnnouncement: (toolName: string) => string;
|
33
|
-
}
|
34
|
-
export declare const defaultToolLocalization: ToolLocalization;
|
@@ -1,33 +0,0 @@
|
|
1
|
-
export const defaultToolLocalization = {
|
2
|
-
penTool: (penId) => `Pen ${penId}`,
|
3
|
-
selectionTool: 'Selection',
|
4
|
-
selectAllTool: 'Select all shortcut',
|
5
|
-
eraserTool: 'Eraser',
|
6
|
-
touchPanTool: 'Touch panning',
|
7
|
-
twoFingerPanZoomTool: 'Panning and zooming',
|
8
|
-
undoRedoTool: 'Undo/Redo',
|
9
|
-
rightClickDragPanTool: 'Right-click drag',
|
10
|
-
pipetteTool: 'Pick color from screen',
|
11
|
-
keyboardPanZoom: 'Keyboard pan/zoom shortcuts',
|
12
|
-
autocorrectedTo: (strokeDescription) => `Autocorrected to ${strokeDescription}`,
|
13
|
-
autocorrectionCanceled: 'Autocorrect cancelled',
|
14
|
-
textTool: 'Text',
|
15
|
-
enterTextToInsert: 'Text to insert',
|
16
|
-
changeTool: 'Change tool',
|
17
|
-
pasteHandler: 'Copy paste handler',
|
18
|
-
soundExplorer: 'Sound-based image exploration',
|
19
|
-
disableAccessibilityExploreTool: 'Disable sound-based exploration',
|
20
|
-
enableAccessibilityExploreTool: 'Enable sound-based exploration',
|
21
|
-
soundExplorerUsageAnnouncement: 'Sound-based image exploration enabled: Click/drag the screen to play a sound representation of different parts of the image.',
|
22
|
-
findLabel: 'Find',
|
23
|
-
toNextMatch: 'Next',
|
24
|
-
closeDialog: 'Close',
|
25
|
-
findDialogShown: 'Find dialog shown',
|
26
|
-
findDialogHidden: 'Find dialog hidden',
|
27
|
-
focusedFoundText: (matchIdx, totalMatches) => `Viewing match ${matchIdx} of ${totalMatches}`,
|
28
|
-
anyDevicePanning: 'Any device panning',
|
29
|
-
copied: (count) => `Copied ${count} item(s)`,
|
30
|
-
pasted: (count) => `Pasted ${count} item(s)`,
|
31
|
-
toolEnabledAnnouncement: (toolName) => `${toolName} enabled`,
|
32
|
-
toolDisabledAnnouncement: (toolName) => `${toolName} disabled`,
|
33
|
-
};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import Pointer from '../../Pointer';
|
2
|
-
interface Config {
|
3
|
-
maxSpeed: number;
|
4
|
-
minTimeSeconds: number;
|
5
|
-
maxRadius: number;
|
6
|
-
}
|
7
|
-
type OnStationaryCallback = (lastPointer: Pointer) => void;
|
8
|
-
export default class StationaryPenDetector {
|
9
|
-
private config;
|
10
|
-
private onStationary;
|
11
|
-
private stationaryStartPointer;
|
12
|
-
private lastPointer;
|
13
|
-
private averageVelocity;
|
14
|
-
private timeout;
|
15
|
-
constructor(startPointer: Pointer, config: Config, onStationary: OnStationaryCallback);
|
16
|
-
onPointerMove(currentPointer: Pointer): boolean | undefined;
|
17
|
-
onPointerUp(pointer: Pointer): void;
|
18
|
-
destroy(): void;
|
19
|
-
private cancelStationaryTimeout;
|
20
|
-
private setStationaryTimeout;
|
21
|
-
}
|
22
|
-
export {};
|
@@ -1,92 +0,0 @@
|
|
1
|
-
import { Vec2 } from '@js-draw/math';
|
2
|
-
export default class StationaryPenDetector {
|
3
|
-
// Only handles one pen. As such, `startPointer` should be the same device/finger
|
4
|
-
// as `updatedPointer` in `onPointerMove`.
|
5
|
-
//
|
6
|
-
// A new `StationaryPenDetector` should be created for each gesture.
|
7
|
-
constructor(startPointer, config, onStationary) {
|
8
|
-
this.config = config;
|
9
|
-
this.onStationary = onStationary;
|
10
|
-
this.timeout = null;
|
11
|
-
this.stationaryStartPointer = startPointer;
|
12
|
-
this.lastPointer = startPointer;
|
13
|
-
this.averageVelocity = Vec2.zero;
|
14
|
-
}
|
15
|
-
// Returns true if stationary
|
16
|
-
onPointerMove(currentPointer) {
|
17
|
-
if (!this.stationaryStartPointer) {
|
18
|
-
// Destoroyed
|
19
|
-
return;
|
20
|
-
}
|
21
|
-
if (currentPointer.id !== this.stationaryStartPointer.id) {
|
22
|
-
return false;
|
23
|
-
}
|
24
|
-
// dx: "Δx" Displacement from last.
|
25
|
-
const dxFromLast = currentPointer.screenPos.minus(this.lastPointer.screenPos);
|
26
|
-
const dxFromStationaryStart = currentPointer.screenPos.minus(this.stationaryStartPointer.screenPos);
|
27
|
-
// dt: Delta time:
|
28
|
-
// /1000: Convert to s.
|
29
|
-
let dtFromLast = (currentPointer.timeStamp - this.lastPointer.timeStamp) / 1000; // s
|
30
|
-
// Don't divide by zero
|
31
|
-
if (dtFromLast === 0) {
|
32
|
-
dtFromLast = 1;
|
33
|
-
}
|
34
|
-
const currentVelocity = dxFromLast.times(1 / dtFromLast); // px/s
|
35
|
-
// Slight smoothing of the velocity to prevent input jitter from affecting the
|
36
|
-
// velocity too significantly.
|
37
|
-
this.averageVelocity = this.averageVelocity.lerp(currentVelocity, 0.5); // px/s
|
38
|
-
const dtFromStart = currentPointer.timeStamp - this.stationaryStartPointer.timeStamp; // ms
|
39
|
-
// If not stationary
|
40
|
-
if (dxFromStationaryStart.length() > this.config.maxRadius
|
41
|
-
|| this.averageVelocity.length() > this.config.maxSpeed
|
42
|
-
|| dtFromStart < this.config.minTimeSeconds) {
|
43
|
-
this.stationaryStartPointer = currentPointer;
|
44
|
-
this.lastPointer = currentPointer;
|
45
|
-
this.setStationaryTimeout(this.config.minTimeSeconds * 1000);
|
46
|
-
return false;
|
47
|
-
}
|
48
|
-
const stationaryTimeoutMs = this.config.minTimeSeconds * 1000 - dtFromStart;
|
49
|
-
this.lastPointer = currentPointer;
|
50
|
-
return stationaryTimeoutMs <= 0;
|
51
|
-
}
|
52
|
-
onPointerUp(pointer) {
|
53
|
-
if (pointer.id !== this.stationaryStartPointer?.id) {
|
54
|
-
this.cancelStationaryTimeout();
|
55
|
-
}
|
56
|
-
}
|
57
|
-
destroy() {
|
58
|
-
this.cancelStationaryTimeout();
|
59
|
-
this.stationaryStartPointer = null;
|
60
|
-
}
|
61
|
-
cancelStationaryTimeout() {
|
62
|
-
if (this.timeout !== null) {
|
63
|
-
clearTimeout(this.timeout);
|
64
|
-
this.timeout = null;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
setStationaryTimeout(timeoutMs) {
|
68
|
-
if (this.timeout !== null) {
|
69
|
-
return;
|
70
|
-
}
|
71
|
-
if (timeoutMs <= 0) {
|
72
|
-
this.onStationary(this.lastPointer);
|
73
|
-
}
|
74
|
-
else {
|
75
|
-
this.timeout = setTimeout(() => {
|
76
|
-
this.timeout = null;
|
77
|
-
if (!this.stationaryStartPointer) {
|
78
|
-
// Destroyed
|
79
|
-
return;
|
80
|
-
}
|
81
|
-
const timeSinceStationaryStart = performance.now() - this.stationaryStartPointer.timeStamp;
|
82
|
-
const timeRemaining = this.config.minTimeSeconds * 1000 - timeSinceStationaryStart;
|
83
|
-
if (timeRemaining <= 0) {
|
84
|
-
this.onStationary(this.lastPointer);
|
85
|
-
}
|
86
|
-
else {
|
87
|
-
this.setStationaryTimeout(timeRemaining);
|
88
|
-
}
|
89
|
-
}, timeoutMs);
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
package/src/tools/FindTool.css
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
|
2
|
-
.ScrollbarTool-overlay {
|
3
|
-
width: 0;
|
4
|
-
height: 0;
|
5
|
-
overflow: visible;
|
6
|
-
|
7
|
-
$visible-opacity: 0.2;
|
8
|
-
opacity: $visible-opacity;
|
9
|
-
pointer-events: none;
|
10
|
-
|
11
|
-
--fade-out-animation: 1s ease 0s fade-out;
|
12
|
-
|
13
|
-
@media (prefers-reduced-motion: reduce) {
|
14
|
-
--fade-out-animation: none !important;
|
15
|
-
}
|
16
|
-
|
17
|
-
@keyframes fade-out {
|
18
|
-
from { opacity: $visible-opacity; }
|
19
|
-
to { opacity: 0; }
|
20
|
-
}
|
21
|
-
|
22
|
-
&:not(.just-updated) {
|
23
|
-
animation: var(--fade-out-animation);
|
24
|
-
opacity: 0;
|
25
|
-
}
|
26
|
-
|
27
|
-
--scrollbar-size: 3px;
|
28
|
-
|
29
|
-
.vertical-scrollbar, .horizontal-scrollbar {
|
30
|
-
width: var(--scrollbar-size);
|
31
|
-
height: var(--scrollbar-size);
|
32
|
-
|
33
|
-
min-width: var(--scrollbar-size);
|
34
|
-
min-height: var(--scrollbar-size);
|
35
|
-
|
36
|
-
background-color: var(--foreground-color-1);
|
37
|
-
border-radius: var(--scrollbar-size);
|
38
|
-
position: absolute;
|
39
|
-
|
40
|
-
&.represents-no-scroll {
|
41
|
-
animation: var(--fade-out-animation);
|
42
|
-
opacity: 0;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
&:not(.scrollbar-left) {
|
47
|
-
.vertical-scrollbar {
|
48
|
-
margin-left: calc(var(--editor-current-display-width-px) - var(--scrollbar-size));
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
&:not(.scrollbar-top) {
|
53
|
-
.horizontal-scrollbar {
|
54
|
-
margin-top: calc(var(--editor-current-display-height-px) - var(--scrollbar-size));
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
@@ -1,137 +0,0 @@
|
|
1
|
-
|
2
|
-
.selection-tool-selection-background {
|
3
|
-
background-color: var(--selection-background-color);
|
4
|
-
opacity: 0.5;
|
5
|
-
overflow: visible;
|
6
|
-
}
|
7
|
-
|
8
|
-
.selection-tool-handle {
|
9
|
-
position: absolute;
|
10
|
-
box-sizing: border-box;
|
11
|
-
|
12
|
-
// Center content
|
13
|
-
display: flex;
|
14
|
-
align-items: center;
|
15
|
-
justify-content: center;
|
16
|
-
|
17
|
-
// Maximum size of the visible region (make the handle slightly larger
|
18
|
-
// so that the resize cursor is visible everywhere in the actual selection
|
19
|
-
// box).
|
20
|
-
--max-size: 17px;
|
21
|
-
|
22
|
-
.selection-tool-content {
|
23
|
-
border: 1px solid var(--foreground-color-1);
|
24
|
-
background: var(--background-color-1);
|
25
|
-
box-sizing: border-box;
|
26
|
-
|
27
|
-
max-width: var(--max-size);
|
28
|
-
max-height: var(--max-size);
|
29
|
-
width: 100%;
|
30
|
-
height: 100%;
|
31
|
-
|
32
|
-
display: flex;
|
33
|
-
justify-content: center;
|
34
|
-
align-items: center;
|
35
|
-
|
36
|
-
padding: 3px;
|
37
|
-
.icon {
|
38
|
-
width: 100%;
|
39
|
-
height: 100%;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
&.selection-tool-circle .selection-tool-content {
|
44
|
-
border-radius: 100%;
|
45
|
-
}
|
46
|
-
|
47
|
-
&.selection-tool-rotate {
|
48
|
-
// Shrink less if a rotation handle
|
49
|
-
--max-size: 28px;
|
50
|
-
|
51
|
-
cursor: grab;
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
.selection-tool-handle {
|
56
|
-
&.selection-tool-resize-x {
|
57
|
-
cursor: ew-resize;
|
58
|
-
}
|
59
|
-
|
60
|
-
&.selection-tool-resize-y {
|
61
|
-
cursor: ns-resize;
|
62
|
-
}
|
63
|
-
|
64
|
-
&.selection-tool-resize-xy {
|
65
|
-
cursor: nwse-resize;
|
66
|
-
}
|
67
|
-
}
|
68
|
-
|
69
|
-
.selection-tool-rotated-near-perpendicular .selection-tool-handle {
|
70
|
-
&.selection-tool-resize-x {
|
71
|
-
cursor: ns-resize;
|
72
|
-
}
|
73
|
-
|
74
|
-
&.selection-tool-resize-y {
|
75
|
-
cursor: ew-resize;
|
76
|
-
}
|
77
|
-
|
78
|
-
&.selection-tool-resize-xy {
|
79
|
-
cursor: nesw-resize;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
|
83
|
-
.overlay.handleOverlay {
|
84
|
-
touch-action: none;
|
85
|
-
|
86
|
-
// The selection tool makes some assumptions about margin-left, margin-top,
|
87
|
-
// and the initial (unmodified) position of the selection.
|
88
|
-
//
|
89
|
-
// For now, as we're not showing text in the selection box, force LTR.
|
90
|
-
direction: ltr;
|
91
|
-
|
92
|
-
// When expanding a selection with shift+click&drag, multiple selection boxes
|
93
|
-
// can be present in the same handleOverlay. As such, so that other overlayed
|
94
|
-
// selection boxes are in the correct place, the outer container needs to have
|
95
|
-
// zero height.
|
96
|
-
//
|
97
|
-
// This is in addition to the overlay container, which needs zero height to prevent
|
98
|
-
// other overlay containers from being affected by its size.
|
99
|
-
&, .selection-tool-selection-outer-container {
|
100
|
-
height: 0;
|
101
|
-
overflow: visible;
|
102
|
-
}
|
103
|
-
|
104
|
-
.selection-tool-selection-inner-container {
|
105
|
-
width: var(--editor-current-display-width-px);
|
106
|
-
height: var(--editor-current-display-height-px);
|
107
|
-
overflow: hidden;
|
108
|
-
|
109
|
-
// Disable pointer events: If the parent (or the container) has
|
110
|
-
// captured pointers and the container is removed, this prevents
|
111
|
-
// us from receiving the following events (e.g. in Firefox).
|
112
|
-
pointer-events: none;
|
113
|
-
|
114
|
-
& > * {
|
115
|
-
// We *do* want pointer events for handles and the background. This
|
116
|
-
// allows the mouse cursor to change shape when hovering over resize
|
117
|
-
// handles.
|
118
|
-
pointer-events: all;
|
119
|
-
}
|
120
|
-
|
121
|
-
&.-empty {
|
122
|
-
opacity: 0;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
|
127
|
-
@keyframes selection-duplicated-animation {
|
128
|
-
0% { scale: 1 1; }
|
129
|
-
50% { scale: 1.02 1.02; }
|
130
|
-
100% { scale: 1 1; }
|
131
|
-
}
|
132
|
-
|
133
|
-
/* Do not run the animation when the user has disabled motion animations. */
|
134
|
-
@media (prefers-reduced-motion: reduce) {
|
135
|
-
@keyframes selection-duplicated-animation {
|
136
|
-
}
|
137
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
.js-draw-sound-ui-toggle {
|
3
|
-
width: 0px;
|
4
|
-
height: 0px;
|
5
|
-
overflow: hidden;
|
6
|
-
|
7
|
-
user-select: none;
|
8
|
-
-webkit-user-select: none;
|
9
|
-
}
|
10
|
-
|
11
|
-
.js-draw-sound-ui-toggle button {
|
12
|
-
margin-top: 1px;
|
13
|
-
}
|
14
|
-
|
15
|
-
.js-draw-sound-ui-toggle:focus-within, .js-draw-sound-ui-toggle.sound-ui-tool-enabled {
|
16
|
-
overflow: visible;
|
17
|
-
z-index: 5;
|
18
|
-
}
|
19
|
-
|
20
|
-
.js-draw-sound-ui-toggle:not(:focus-within):not(:hover).sound-ui-tool-enabled {
|
21
|
-
opacity: 0.5;
|
22
|
-
}
|