smoosic 1.0.34 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/html/smoosic.html +1 -0
- package/build/smoosic.js +36 -14
- package/package.json +1 -1
- package/release/html/smoosic.html +4 -3
- package/release/smoosic.js +36 -14
- package/release/styles/general.css +15 -0
- package/src/application/common.ts +20 -0
- package/src/application/eventHandler.ts +44 -8
- package/src/render/sui/NoteEntryCaret.ts +739 -0
- package/src/render/sui/NoteEntryMediator.ts +58 -0
- package/src/render/sui/mapper.ts +22 -4
- package/src/render/sui/scoreRender.ts +7 -7
- package/src/render/sui/scoreViewOperations.ts +46 -0
- package/src/render/sui/tracker.ts +93 -47
- package/src/render/vex/vxMeasure.ts +2 -1
- package/src/render/vex/vxNote.ts +1 -0
- package/src/smo/data/music.ts +17 -0
- package/src/smo/data/note.ts +3 -1
- package/src/smo/data/noteModifiers.ts +2 -0
- package/src/smo/data/scoreModifiers.ts +0 -3
- package/src/styles/general.css +22 -0
- package/src/ui/components/dialogs/scorePreferences.vue +1 -11
- package/types/src/application/application.d.ts +102 -102
- package/types/src/application/configuration.d.ts +74 -74
- package/types/src/application/dynamicInit.d.ts +1 -1
- package/types/src/application/eventHandler.d.ts +78 -78
- package/types/src/application/exports.d.ts +494 -494
- package/types/src/render/audio/oscillator.d.ts +98 -98
- package/types/src/render/audio/player.d.ts +141 -141
- package/types/src/render/audio/samples.d.ts +56 -56
- package/types/src/render/sui/configuration.d.ts +12 -12
- package/types/src/render/sui/formatter.d.ts +151 -151
- package/types/src/render/sui/layoutDebug.d.ts +43 -43
- package/types/src/render/sui/mapper.d.ts +116 -116
- package/types/src/render/sui/renderState.d.ts +88 -88
- package/types/src/render/sui/scoreRender.d.ts +93 -93
- package/types/src/render/sui/scoreView.d.ts +267 -267
- package/types/src/render/sui/scoreViewOperations.d.ts +594 -594
- package/types/src/render/sui/scroller.d.ts +34 -34
- package/types/src/render/sui/svgPageMap.d.ts +318 -318
- package/types/src/render/sui/textEdit.d.ts +310 -310
- package/types/src/render/vex/vxMeasure.d.ts +95 -95
- package/types/src/smo/data/common.d.ts +220 -220
- package/types/src/smo/data/measure.d.ts +510 -510
- package/types/src/smo/data/measureModifiers.d.ts +506 -506
- package/types/src/smo/data/scoreModifiers.d.ts +433 -433
- package/types/src/smo/xform/selections.d.ts +153 -153
- package/types/src/ui/common.d.ts +45 -45
- package/types/src/ui/configuration.d.ts +31 -31
- package/types/src/ui/dialogs/chordChange.d.ts +35 -35
- package/types/src/ui/dialogs/components/baseComponent.d.ts +158 -158
- package/types/src/ui/dialogs/components/button.d.ts +54 -54
- package/types/src/ui/dialogs/components/dropdown.d.ts +78 -78
- package/types/src/ui/dialogs/components/pitch.d.ts +95 -95
- package/types/src/ui/dialogs/components/rocker.d.ts +66 -66
- package/types/src/ui/dialogs/components/textInPlace.d.ts +90 -90
- package/types/src/ui/dialogs/components/textInput.d.ts +58 -58
- package/types/src/ui/dialogs/components/toggle.d.ts +53 -53
- package/types/src/ui/dialogs/dialog.d.ts +201 -201
- package/types/src/ui/dialogs/endings.d.ts +61 -61
- package/types/src/ui/dialogs/lyric.d.ts +39 -39
- package/types/src/ui/dialogs/measureFormat.d.ts +52 -52
- package/types/src/ui/dialogs/textBlock.d.ts +61 -61
- package/types/src/ui/exceptions.d.ts +12 -12
- package/types/src/ui/menus/manager.d.ts +57 -57
- package/types/src/ui/navigation.d.ts +15 -15
- package/types/typedoc.d.ts +158 -158
- package/release/styles/styles.css +0 -0
- package/src/styles/fonts/Roboto-Italic-VariableFont_wdth,wght.ttf +0 -0
- package/src/styles/fonts/Roboto-VariableFont_wdth,wght.ttf +0 -0
- package/src/styles/styles.css +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.pitch-preview {
|
|
2
|
+
cursor: default;
|
|
3
|
+
pointer-events: none;
|
|
4
|
+
user-select: none;
|
|
5
|
+
-webkit-user-select: none;
|
|
6
|
+
-moz-user-select: none;
|
|
7
|
+
-ms-user-select: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.note-entry-caret {
|
|
11
|
+
user-select: none;
|
|
12
|
+
-webkit-user-select: none;
|
|
13
|
+
-moz-user-select: none;
|
|
14
|
+
-ms-user-select: none;
|
|
15
|
+
}
|
|
@@ -80,6 +80,8 @@ export abstract class ModalEventHandler {
|
|
|
80
80
|
abstract mouseClick(ev: any): Promise<void>;
|
|
81
81
|
abstract evKey(evdata: any): Promise<void>;
|
|
82
82
|
abstract keyUp(evdata: any): void;
|
|
83
|
+
abstract mouseUp(ev: any): void;
|
|
84
|
+
abstract mouseDown(ev: any): void;
|
|
83
85
|
}
|
|
84
86
|
export type handler = (ev: any) => void;
|
|
85
87
|
|
|
@@ -96,6 +98,8 @@ export class ModalEventHandlerProxy {
|
|
|
96
98
|
keyupHandler: EventHandler | null = null;
|
|
97
99
|
mouseMoveHandler: EventHandler | null = null;
|
|
98
100
|
mouseClickHandler: EventHandler | null = null;
|
|
101
|
+
mouseUpHandler: EventHandler | null = null;
|
|
102
|
+
mouseDownHandler: EventHandler | null = null;
|
|
99
103
|
constructor(evSource: BrowserEventSource) {
|
|
100
104
|
this.eventSource = evSource;
|
|
101
105
|
this.bindEvents();
|
|
@@ -125,13 +129,27 @@ export class ModalEventHandlerProxy {
|
|
|
125
129
|
await this._handler.mouseClick(ev);
|
|
126
130
|
}
|
|
127
131
|
}
|
|
132
|
+
mouseUp(ev: any) {
|
|
133
|
+
if (this._handler) {
|
|
134
|
+
this._handler.mouseUp(ev);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
mouseDown(ev: any) {
|
|
138
|
+
if (this._handler) {
|
|
139
|
+
this._handler.mouseDown(ev);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
128
142
|
bindEvents() {
|
|
129
143
|
const mousemove = async (ev: any) => { this.mouseMove(ev); }
|
|
130
144
|
const mouseclick = async (ev: any) => { await this.mouseClick(ev); }
|
|
145
|
+
const mouseup = async (ev: any) => { this.mouseUp(ev); }
|
|
146
|
+
const mousedown = async (ev: any) => { this.mouseDown(ev); }
|
|
131
147
|
const keydown = async (ev: any) => { this.evKey(ev); }
|
|
132
148
|
const keyup = async (ev: any) => { this.keyUp(ev); }
|
|
133
149
|
this.mouseMoveHandler = this.eventSource.bindMouseMoveHandler(mousemove);
|
|
134
150
|
this.mouseClickHandler = this.eventSource.bindMouseClickHandler(mouseclick);
|
|
151
|
+
this.mouseUpHandler = this.eventSource.bindMouseUpHandler(mouseup);
|
|
152
|
+
this.mouseDownHandler = this.eventSource.bindMouseDownHandler(mousedown);
|
|
135
153
|
this.keydownHandler = this.eventSource.bindKeydownHandler(keydown);
|
|
136
154
|
this.keyupHandler = this.eventSource.bindKeyupHandler(keyup);
|
|
137
155
|
}
|
|
@@ -152,6 +170,8 @@ export class ModalEventHandlerProxy {
|
|
|
152
170
|
}
|
|
153
171
|
this.eventSource.unbindKeydownHandler(this.keydownHandler!);
|
|
154
172
|
this.eventSource.unbindMouseMoveHandler(this.mouseMoveHandler!);
|
|
173
|
+
this.eventSource.unbindMouseUpHandler(this.mouseUpHandler!);
|
|
174
|
+
this.eventSource.unbindMouseDownHandler(this.mouseDownHandler!);
|
|
155
175
|
this.eventSource.unbindMouseClickHandler(this.mouseClickHandler!);
|
|
156
176
|
dialog.closeModalPromise.then(rebind);
|
|
157
177
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// [Smoosic](https://github.com/AaronDavidNewman/Smoosic)
|
|
2
2
|
// Copyright (c) Aaron David Newman 2021.
|
|
3
3
|
|
|
4
|
-
import { KeyEvent
|
|
4
|
+
import { KeyEvent } from '../smo/data/common';
|
|
5
5
|
import { SuiExceptionHandler } from '../ui/exceptions';
|
|
6
6
|
import { Qwerty } from '../ui/qwerty';
|
|
7
7
|
import { SuiModifierDialogFactory } from '../ui/dialogs/factory';
|
|
@@ -20,6 +20,8 @@ import { SvgHelpers } from '../render/sui/svgHelpers';
|
|
|
20
20
|
import { SuiMenuManager } from '../ui/menus/manager';
|
|
21
21
|
import { SmoConfiguration } from './configuration';
|
|
22
22
|
import { SuiDom } from './dom';
|
|
23
|
+
import { NoteEntryCaret } from '../render/sui/NoteEntryCaret';
|
|
24
|
+
import {NoteEntryMediator} from "../render/sui/NoteEntryMediator";
|
|
23
25
|
import { SuiNavigation } from '../ui/navigation'
|
|
24
26
|
declare var $: any;
|
|
25
27
|
|
|
@@ -70,7 +72,10 @@ export class SuiEventHandler implements ModalEventHandler {
|
|
|
70
72
|
keyHandlerObj: any = null;
|
|
71
73
|
menus: SuiMenuManager;
|
|
72
74
|
piano: SuiPiano | null = null;
|
|
73
|
-
exhandler: SuiExceptionHandler;
|
|
75
|
+
exhandler: SuiExceptionHandler;
|
|
76
|
+
noteEntryCaret: NoteEntryCaret;
|
|
77
|
+
noteEntryMediator: NoteEntryMediator;
|
|
78
|
+
|
|
74
79
|
constructor(params: EventHandlerParams) {
|
|
75
80
|
SuiEventHandler.instance = this;
|
|
76
81
|
|
|
@@ -92,6 +97,10 @@ export class SuiEventHandler implements ModalEventHandler {
|
|
|
92
97
|
this.bindEvents();
|
|
93
98
|
this.bindResize();
|
|
94
99
|
this.createPiano();
|
|
100
|
+
|
|
101
|
+
// Initialize note entry caret
|
|
102
|
+
this.noteEntryCaret = new NoteEntryCaret(this.view, this.tracker);
|
|
103
|
+
this.noteEntryMediator = new NoteEntryMediator(this.tracker, this.noteEntryCaret, this.view);
|
|
95
104
|
}
|
|
96
105
|
|
|
97
106
|
private static handleScrollEventDefer(handler: SuiEventHandler) {
|
|
@@ -191,7 +200,6 @@ export class SuiEventHandler implements ModalEventHandler {
|
|
|
191
200
|
el.onscroll = scrollCallback;
|
|
192
201
|
}
|
|
193
202
|
|
|
194
|
-
|
|
195
203
|
// ### renderElement
|
|
196
204
|
// return render element that is the DOM parent of the svg
|
|
197
205
|
get renderElement() {
|
|
@@ -297,6 +305,15 @@ export class SuiEventHandler implements ModalEventHandler {
|
|
|
297
305
|
}
|
|
298
306
|
|
|
299
307
|
mouseMove(ev: any) {
|
|
308
|
+
if (this.noteEntryCaret && this.noteEntryCaret.containsPoint(ev)) {
|
|
309
|
+
this.noteEntryCaret.handleMouseMove(ev);
|
|
310
|
+
return;
|
|
311
|
+
} else {
|
|
312
|
+
if (this.noteEntryCaret) {
|
|
313
|
+
this.noteEntryCaret.resetInteraction();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
300
317
|
this.view.tracker.intersectingArtifact(SvgHelpers.smoBox({
|
|
301
318
|
x: ev.clientX,
|
|
302
319
|
y: ev.clientY
|
|
@@ -305,13 +322,32 @@ export class SuiEventHandler implements ModalEventHandler {
|
|
|
305
322
|
|
|
306
323
|
async mouseClick(ev: any) {
|
|
307
324
|
const dataCopy = SuiTracker.serializeEvent(ev);
|
|
308
|
-
await this.view.renderer.updatePromise();
|
|
309
|
-
this.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
325
|
+
await this.view.renderer.updatePromise();
|
|
326
|
+
const caret = this.noteEntryCaret;
|
|
327
|
+
if (caret && caret.containsPoint(ev)) {
|
|
328
|
+
caret.handleMouseClick(ev);
|
|
329
|
+
return;
|
|
330
|
+
} else {
|
|
331
|
+
this.view.tracker.selectSuggestion(dataCopy);
|
|
332
|
+
var modifier = this.view.tracker.getSelectedModifier();
|
|
333
|
+
if (modifier) {
|
|
334
|
+
this.createModifierDialog(modifier);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
mouseUp(ev: any) {
|
|
340
|
+
if (this.noteEntryCaret && this.noteEntryCaret.containsPoint(ev)) {
|
|
341
|
+
this.noteEntryCaret.handleMouseUp(ev);
|
|
313
342
|
}
|
|
314
343
|
}
|
|
344
|
+
|
|
345
|
+
async mouseDown(ev: any) {
|
|
346
|
+
if (this.noteEntryCaret && this.noteEntryCaret.containsPoint(ev)) {
|
|
347
|
+
this.noteEntryCaret.handleMouseDown(ev);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
315
351
|
bindEvents() {
|
|
316
352
|
const self = this;
|
|
317
353
|
const tracker = this.view.tracker;
|