smoosic 2.0.3 → 2.0.4
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/smoosic.js +395 -67
- package/changes.md +85 -0
- package/package.json +98 -82
- package/release/smoosic.js +395 -67
- package/specs/032-split-multimeasure-rests/checklists/requirements.md +40 -0
- package/specs/032-split-multimeasure-rests/contracts/grouping-contract.md +53 -0
- package/specs/032-split-multimeasure-rests/data-model.md +70 -0
- package/specs/032-split-multimeasure-rests/plan.md +81 -0
- package/specs/032-split-multimeasure-rests/quickstart.md +46 -0
- package/specs/032-split-multimeasure-rests/research.md +63 -0
- package/specs/032-split-multimeasure-rests/spec.md +127 -0
- package/specs/032-split-multimeasure-rests/tasks.md +174 -0
- package/specs/033-key-distance-transposition/checklists/requirements.md +35 -0
- package/specs/033-key-distance-transposition/contracts/spelling-api.md +36 -0
- package/specs/033-key-distance-transposition/data-model.md +49 -0
- package/specs/033-key-distance-transposition/plan.md +87 -0
- package/specs/033-key-distance-transposition/quickstart.md +40 -0
- package/specs/033-key-distance-transposition/research.md +82 -0
- package/specs/033-key-distance-transposition/spec.md +132 -0
- package/specs/033-key-distance-transposition/tasks.md +139 -0
- package/specs/034-smz-compressed-scores/checklists/requirements.md +35 -0
- package/specs/034-smz-compressed-scores/contracts/archive-api.md +30 -0
- package/specs/034-smz-compressed-scores/data-model.md +48 -0
- package/specs/034-smz-compressed-scores/plan.md +89 -0
- package/specs/034-smz-compressed-scores/quickstart.md +44 -0
- package/specs/034-smz-compressed-scores/research.md +86 -0
- package/specs/034-smz-compressed-scores/spec.md +137 -0
- package/specs/034-smz-compressed-scores/tasks.md +148 -0
- package/specs/035-paste-special/checklists/requirements.md +35 -0
- package/specs/035-paste-special/contracts/paste-special-api.md +50 -0
- package/specs/035-paste-special/data-model.md +47 -0
- package/specs/035-paste-special/plan.md +83 -0
- package/specs/035-paste-special/quickstart.md +51 -0
- package/specs/035-paste-special/research.md +97 -0
- package/specs/035-paste-special/spec.md +170 -0
- package/specs/035-paste-special/tasks.md +149 -0
- package/specs/036-autosave-recovery/checklists/requirements.md +36 -0
- package/specs/036-autosave-recovery/contracts/autosave-api.md +111 -0
- package/specs/036-autosave-recovery/data-model.md +70 -0
- package/specs/036-autosave-recovery/plan.md +87 -0
- package/specs/036-autosave-recovery/quickstart.md +65 -0
- package/specs/036-autosave-recovery/research.md +105 -0
- package/specs/036-autosave-recovery/spec.md +143 -0
- package/specs/036-autosave-recovery/tasks.md +165 -0
- package/specs/037-fix-new-part-dialog/checklists/requirements.md +38 -0
- package/specs/037-fix-new-part-dialog/contracts/create-part-api.md +84 -0
- package/specs/037-fix-new-part-dialog/data-model.md +68 -0
- package/specs/037-fix-new-part-dialog/plan.md +83 -0
- package/specs/037-fix-new-part-dialog/quickstart.md +58 -0
- package/specs/037-fix-new-part-dialog/research.md +86 -0
- package/specs/037-fix-new-part-dialog/spec.md +144 -0
- package/specs/037-fix-new-part-dialog/tasks.md +174 -0
- package/specs/038-per-measure-beam-groups/checklists/requirements.md +36 -0
- package/specs/038-per-measure-beam-groups/contracts/beam-groups-api.md +74 -0
- package/specs/038-per-measure-beam-groups/data-model.md +75 -0
- package/specs/038-per-measure-beam-groups/plan.md +84 -0
- package/specs/038-per-measure-beam-groups/quickstart.md +53 -0
- package/specs/038-per-measure-beam-groups/research.md +72 -0
- package/specs/038-per-measure-beam-groups/spec.md +146 -0
- package/specs/038-per-measure-beam-groups/tasks.md +132 -0
- package/specs/039-measure-fill-submenu/checklists/requirements.md +35 -0
- package/specs/039-measure-fill-submenu/contracts/measure-fill-api.md +56 -0
- package/specs/039-measure-fill-submenu/data-model.md +79 -0
- package/specs/039-measure-fill-submenu/plan.md +81 -0
- package/specs/039-measure-fill-submenu/quickstart.md +62 -0
- package/specs/039-measure-fill-submenu/research.md +68 -0
- package/specs/039-measure-fill-submenu/spec.md +153 -0
- package/specs/039-measure-fill-submenu/tasks.md +121 -0
- package/specs/040-dynamics-dialog-cleanup/checklists/requirements.md +36 -0
- package/specs/040-dynamics-dialog-cleanup/contracts/dynamics-dialog.md +52 -0
- package/specs/040-dynamics-dialog-cleanup/data-model.md +48 -0
- package/specs/040-dynamics-dialog-cleanup/plan.md +89 -0
- package/specs/040-dynamics-dialog-cleanup/quickstart.md +69 -0
- package/specs/040-dynamics-dialog-cleanup/research.md +80 -0
- package/specs/040-dynamics-dialog-cleanup/spec.md +120 -0
- package/specs/040-dynamics-dialog-cleanup/tasks.md +114 -0
- package/specs/041-delete-special/checklists/requirements.md +35 -0
- package/specs/041-delete-special/contracts/delete-special-api.md +41 -0
- package/specs/041-delete-special/data-model.md +40 -0
- package/specs/041-delete-special/plan.md +93 -0
- package/specs/041-delete-special/quickstart.md +41 -0
- package/specs/041-delete-special/research.md +75 -0
- package/specs/041-delete-special/spec.md +136 -0
- package/specs/041-delete-special/tasks.md +106 -0
- package/src/application/application.ts +13 -2
- package/src/application/exports.ts +401 -395
- package/src/application/generateVexTests.ts +2 -2
- package/src/render/sui/NoteEntryCaret.ts +117 -16
- package/src/render/sui/autosave.ts +265 -0
- package/src/render/sui/formatter.ts +12 -2
- package/src/render/sui/scoreChangeState.ts +8 -3
- package/src/render/sui/scoreView.ts +47 -2
- package/src/render/sui/scoreViewOperations.ts +2706 -2555
- package/src/render/sui/staffLineGeometry.ts +82 -0
- package/src/render/vex/vxMeasure.ts +22 -8
- package/src/render/vex/vxNote.ts +2 -4
- package/src/smo/data/measure.ts +58 -1
- package/src/smo/data/measureModifiers.ts +81 -1
- package/src/smo/data/music.ts +169 -359
- package/src/smo/data/note.ts +1 -1
- package/src/smo/data/noteModifiers.ts +12 -0
- package/src/smo/data/score.ts +167 -2
- package/src/smo/data/scoreModifiers.ts +46 -1
- package/src/smo/data/systemStaff.ts +43 -0
- package/src/smo/xform/beamers.ts +80 -6
- package/src/smo/xform/copypaste.ts +207 -47
- package/src/smo/xform/measureFill.ts +89 -0
- package/src/smo/xform/operations.ts +403 -61
- package/src/smo/xform/selections.ts +7 -0
- package/src/ui/components/dialogs/beamGroups.vue +106 -0
- package/src/ui/components/dialogs/deleteSpecial.vue +38 -0
- package/src/ui/components/dialogs/dynamics.vue +16 -3
- package/src/ui/components/dialogs/fileUpload.vue +2 -2
- package/src/ui/components/dialogs/hairpin.vue +3 -3
- package/src/ui/components/dialogs/newPart.vue +148 -184
- package/src/ui/components/dialogs/pasteSpecial.vue +49 -0
- package/src/ui/components/dialogs/recovery.vue +66 -0
- package/src/ui/components/dialogs/save.vue +11 -4
- package/src/ui/components/dialogs/scorePreferences.vue +23 -1
- package/src/ui/components/dialogs/slur.vue +6 -6
- package/src/ui/components/dialogs/tempo.vue +11 -3
- package/src/ui/components/dialogs/timeSignature.vue +5 -0
- package/src/ui/components/dialogs/volta.vue +3 -3
- package/src/ui/dialogs/annotationVue.ts +1 -1
- package/src/ui/dialogs/beamGroupsVue.ts +69 -0
- package/src/ui/dialogs/createPartHelpers.ts +68 -0
- package/src/ui/dialogs/deleteSpecial.ts +57 -0
- package/src/ui/dialogs/dynamicsVue.ts +87 -60
- package/src/ui/dialogs/factory.ts +0 -2
- package/src/ui/dialogs/fileDialogs.ts +63 -22
- package/src/ui/dialogs/instrument.ts +37 -30
- package/src/ui/dialogs/pasteSpecial.ts +59 -0
- package/src/ui/dialogs/preferences.ts +41 -40
- package/src/ui/dialogs/recovery.ts +49 -0
- package/src/ui/fileio/fileInput.ts +12 -3
- package/src/ui/fileio/scoreArchive.ts +151 -0
- package/src/ui/fileio/xhrLoader.ts +26 -0
- package/src/ui/i18n/language.ts +1 -1
- package/src/ui/menus/beams.ts +181 -112
- package/src/ui/menus/edit.ts +44 -6
- package/src/ui/menus/file.ts +21 -1
- package/src/ui/menus/measure.ts +40 -1
- package/tests/autosave.ts +332 -0
- package/tests/beamDotted.ts +56 -0
- package/tests/beamGroups.ts +338 -0
- package/tests/createPart.ts +292 -0
- package/tests/deleteSpecial.ts +350 -0
- package/tests/dynamicsFontSize.ts +132 -0
- package/tests/keyDistanceTransposition.ts +351 -0
- package/tests/measureFill.ts +295 -0
- package/tests/movePart.ts +94 -0
- package/tests/multimeasureRest.ts +338 -0
- package/tests/pasteIntoMeasure.ts +103 -0
- package/tests/pasteSpecial.ts +541 -0
- package/tests/quickBeam.ts +126 -0
- package/tests/scoreArchive.ts +218 -0
- package/tests/scoreChangeState.ts +2 -0
- package/tests/staffLineGeometry.ts +179 -0
- package/tests/timeSignatureDisplay.ts +58 -0
- package/tools/smoosic-schema.json +37 -0
- package/typedoc.ts +1 -1
- package/types/src/application/exports.d.ts +453 -447
- package/types/src/common/promiseHelpers.d.ts +30 -30
- package/types/src/common/vex.d.ts +224 -224
- package/types/src/render/sui/NoteEntryCaret.d.ts +107 -107
- package/types/src/render/sui/autosave.d.ts +99 -0
- package/types/src/render/sui/scoreView.d.ts +23 -0
- package/types/src/render/sui/scoreViewOperations.d.ts +759 -639
- package/types/src/render/sui/svgHelpers.d.ts +88 -88
- package/types/src/render/sui/svgPageMap.d.ts +344 -344
- package/types/src/render/sui/textEdit.d.ts +96 -96
- package/types/src/render/sui/textRender.d.ts +199 -199
- package/types/src/render/vex/smoAdapter.d.ts +47 -47
- package/types/src/render/vex/vxMeasure.d.ts +97 -97
- package/types/src/render/vex/vxNote.d.ts +56 -56
- package/types/src/render/vex/vxSystem.d.ts +71 -71
- package/types/src/smo/data/measure.d.ts +30 -0
- package/types/src/smo/data/measureModifiers.d.ts +568 -513
- package/types/src/smo/data/music.d.ts +74 -32
- package/types/src/smo/data/note.d.ts +498 -498
- package/types/src/smo/data/noteModifiers.d.ts +615 -606
- package/types/src/smo/data/score.d.ts +476 -421
- package/types/src/smo/data/scoreModifiers.d.ts +30 -0
- package/types/src/smo/data/scoreText.d.ts +334 -334
- package/types/src/smo/data/systemStaff.d.ts +14 -0
- package/types/src/smo/xform/beamers.d.ts +23 -1
- package/types/src/smo/xform/copypaste.d.ts +138 -2
- package/types/src/smo/xform/measureFill.d.ts +21 -0
- package/types/src/smo/xform/operations.d.ts +245 -129
- package/types/src/smo/xform/selections.d.ts +154 -154
- package/types/src/smo/xform/undo.d.ts +142 -142
- package/types/src/ui/buttons/button.d.ts +100 -100
- package/types/src/ui/buttons/ribbon.d.ts +70 -70
- package/types/src/ui/common.d.ts +76 -76
- package/types/src/ui/components/dialogs/chordText.d.ts +28 -28
- package/types/src/ui/components/dialogs/textBlockAtomNode.d.ts +20 -20
- package/types/src/ui/components/dialogs/textGroupHtml.d.ts +29 -29
- package/types/src/ui/composable/draggable.d.ts +15 -15
- package/types/src/ui/dialogs/adapter.d.ts +120 -120
- package/types/src/ui/dialogs/annotationVue.d.ts +9 -9
- package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
- package/types/src/ui/dialogs/beamGroupsVue.d.ts +20 -0
- package/types/src/ui/dialogs/chordChangeVue.d.ts +8 -8
- package/types/src/ui/dialogs/createPartHelpers.d.ts +29 -0
- package/types/src/ui/dialogs/customTupletsVue.d.ts +9 -9
- package/types/src/ui/dialogs/deleteSpecial.d.ts +8 -0
- package/types/src/ui/dialogs/dialog.d.ts +203 -203
- package/types/src/ui/dialogs/dynamicsVue.d.ts +10 -10
- package/types/src/ui/dialogs/factory.d.ts +15 -15
- package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
- package/types/src/ui/dialogs/hairpin.d.ts +35 -35
- package/types/src/ui/dialogs/hairpinVue.d.ts +7 -7
- package/types/src/ui/dialogs/instrument.d.ts +3 -3
- package/types/src/ui/dialogs/keySignatureVue.d.ts +7 -7
- package/types/src/ui/dialogs/libraryVue.d.ts +15 -15
- package/types/src/ui/dialogs/lyricVue.d.ts +8 -8
- package/types/src/ui/dialogs/pasteSpecial.d.ts +8 -0
- package/types/src/ui/dialogs/pedalMarkingVue.d.ts +7 -7
- package/types/src/ui/dialogs/recovery.d.ts +8 -0
- package/types/src/ui/dialogs/rehearsalMark.d.ts +25 -25
- package/types/src/ui/dialogs/rehearsalMarkVue.d.ts +7 -7
- package/types/src/ui/dialogs/slur.d.ts +57 -57
- package/types/src/ui/dialogs/slurVue.d.ts +7 -7
- package/types/src/ui/dialogs/tempo.d.ts +50 -50
- package/types/src/ui/dialogs/tempoVue.d.ts +10 -10
- package/types/src/ui/dialogs/textBlockVue.d.ts +8 -8
- package/types/src/ui/dialogs/textBracket.d.ts +35 -35
- package/types/src/ui/dialogs/textBracketVue.d.ts +7 -7
- package/types/src/ui/dialogs/tie.d.ts +41 -41
- package/types/src/ui/dialogs/volta.d.ts +40 -40
- package/types/src/ui/dialogs/voltaVue.d.ts +7 -7
- package/types/src/ui/fileio/fileInput.d.ts +7 -1
- package/types/src/ui/fileio/library.d.ts +40 -40
- package/types/src/ui/fileio/scoreArchive.d.ts +55 -0
- package/types/src/ui/fileio/xhrLoader.d.ts +7 -0
- package/types/src/ui/menus/file.d.ts +8 -8
- package/types/src/ui/menus/language.d.ts +7 -7
- package/types/src/ui/menus/manager.d.ts +58 -58
- package/types/src/ui/menus/menu.d.ts +159 -159
- package/types/src/ui/menus/partSelection.d.ts +14 -14
- package/types/src/ui/menus/score.d.ts +8 -8
- package/types/src/ui/menus/staffModifier.d.ts +17 -17
- package/types/typedoc.d.ts +147 -147
- package/src/ui/dialogs/dynamics.ts +0 -141
- package/types/src/ui/dialogs/dynamics.d.ts +0 -37
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
|
|
2
|
-
import { BrowserEventSource } from '../eventSource';
|
|
3
|
-
import { SuiMenuManager } from '../menus/manager';
|
|
4
|
-
import { CompleteNotifier } from '../common';
|
|
5
|
-
/**
|
|
6
|
-
* Button actions are one of the following.
|
|
7
|
-
* - collapse... buttons are used to expand/collapse button groups in a ribbon.
|
|
8
|
-
* all buttons with these classes have 'ctor' constructor, and perform actions based on
|
|
9
|
-
* their bind method
|
|
10
|
-
* - menu brings up a modal menu with class 'ctor'
|
|
11
|
-
* - modal brings up a modal dialog with class 'ctor'
|
|
12
|
-
* - collapseChildMenu brings up a modal menu, and is also collapsable.
|
|
13
|
-
*
|
|
14
|
-
* Buttons here refer to buttons on the top ribbon, buttons in dialogs are a dialog component
|
|
15
|
-
*/
|
|
16
|
-
export type ButtonAction = 'menu' | 'modal' | 'collapseChild' | 'collapseChildMenu' | 'collapseParent' | 'collapseGrandchild' | 'collapseMore';
|
|
17
|
-
/**
|
|
18
|
-
* structure of a button object.
|
|
19
|
-
* @param leftText - can be used in place of an icon for display
|
|
20
|
-
* @param rightText - usually used to represent a keyboard shortcut
|
|
21
|
-
* @param classes - to control button display
|
|
22
|
-
* @param icon - icon for the button face
|
|
23
|
-
* @param action - indicates to the button the action to perform
|
|
24
|
-
* @param ctor - the constructor of the button object
|
|
25
|
-
* @param group - the logical group, used to group the ribbon buttons
|
|
26
|
-
* @param id - unique ID for DOM selector
|
|
27
|
-
* @param dataElements - can be used to give buttons in a group basic parameters
|
|
28
|
-
* @category SuiButton
|
|
29
|
-
*/
|
|
30
|
-
export interface ButtonDefinition {
|
|
31
|
-
leftText: string;
|
|
32
|
-
rightText: string;
|
|
33
|
-
classes: string;
|
|
34
|
-
icon: string;
|
|
35
|
-
action: ButtonAction;
|
|
36
|
-
ctor: string;
|
|
37
|
-
group: string;
|
|
38
|
-
id: string;
|
|
39
|
-
callback?: ButtonCallback;
|
|
40
|
-
hotKey?: string;
|
|
41
|
-
dataElements?: {
|
|
42
|
-
interval: string;
|
|
43
|
-
direction: string;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* @param button - the button definition that was activated
|
|
48
|
-
* @param elementId - the actual rendered DOM id of the clicked element, when known.
|
|
49
|
-
* Used to anchor any menu the button opens near the triggering element.
|
|
50
|
-
*/
|
|
51
|
-
export type ButtonCallback = (button: ButtonDefinition, elementId?: string) => Promise<void>;
|
|
52
|
-
export type DialogButtonState = 'selected' | 'unselected' | 'partiallySelected';
|
|
53
|
-
export interface DialogButtonDefinition {
|
|
54
|
-
label: string;
|
|
55
|
-
classes: string;
|
|
56
|
-
icon: string;
|
|
57
|
-
callback: DialogButtonCallback;
|
|
58
|
-
id: string;
|
|
59
|
-
group: string;
|
|
60
|
-
hotkey?: string;
|
|
61
|
-
state: DialogButtonState;
|
|
62
|
-
}
|
|
63
|
-
export type DialogButtonCallback = (button: DialogButtonDefinition) => Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* @category SuiButton
|
|
66
|
-
*/
|
|
67
|
-
export interface ButtonLabel {
|
|
68
|
-
buttonId: string;
|
|
69
|
-
buttonText: string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Buttons perform any variety of functions, so they need access to all the rendering logic
|
|
73
|
-
* as well as all the event sources.
|
|
74
|
-
* Sometimes they invoke menus which invoke modals, etc.
|
|
75
|
-
* @category SuiButton
|
|
76
|
-
*/
|
|
77
|
-
export interface SuiButtonParams {
|
|
78
|
-
ctor: string;
|
|
79
|
-
buttonId: string;
|
|
80
|
-
buttonElement: string;
|
|
81
|
-
buttonData: ButtonDefinition;
|
|
82
|
-
view: SuiScoreViewOperations;
|
|
83
|
-
eventSource: BrowserEventSource;
|
|
84
|
-
menus: SuiMenuManager;
|
|
85
|
-
completeNotifier: CompleteNotifier;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* @category SuiButton
|
|
89
|
-
*/
|
|
90
|
-
export declare abstract class SuiButton {
|
|
91
|
-
buttonId: string;
|
|
92
|
-
buttonElement: string;
|
|
93
|
-
view: SuiScoreViewOperations;
|
|
94
|
-
buttonData: ButtonDefinition;
|
|
95
|
-
eventSource: BrowserEventSource;
|
|
96
|
-
menus: SuiMenuManager;
|
|
97
|
-
completeNotifier: CompleteNotifier | null;
|
|
98
|
-
constructor(params: SuiButtonParams);
|
|
99
|
-
abstract bind(): void;
|
|
100
|
-
}
|
|
1
|
+
import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
|
|
2
|
+
import { BrowserEventSource } from '../eventSource';
|
|
3
|
+
import { SuiMenuManager } from '../menus/manager';
|
|
4
|
+
import { CompleteNotifier } from '../common';
|
|
5
|
+
/**
|
|
6
|
+
* Button actions are one of the following.
|
|
7
|
+
* - collapse... buttons are used to expand/collapse button groups in a ribbon.
|
|
8
|
+
* all buttons with these classes have 'ctor' constructor, and perform actions based on
|
|
9
|
+
* their bind method
|
|
10
|
+
* - menu brings up a modal menu with class 'ctor'
|
|
11
|
+
* - modal brings up a modal dialog with class 'ctor'
|
|
12
|
+
* - collapseChildMenu brings up a modal menu, and is also collapsable.
|
|
13
|
+
*
|
|
14
|
+
* Buttons here refer to buttons on the top ribbon, buttons in dialogs are a dialog component
|
|
15
|
+
*/
|
|
16
|
+
export type ButtonAction = 'menu' | 'modal' | 'collapseChild' | 'collapseChildMenu' | 'collapseParent' | 'collapseGrandchild' | 'collapseMore';
|
|
17
|
+
/**
|
|
18
|
+
* structure of a button object.
|
|
19
|
+
* @param leftText - can be used in place of an icon for display
|
|
20
|
+
* @param rightText - usually used to represent a keyboard shortcut
|
|
21
|
+
* @param classes - to control button display
|
|
22
|
+
* @param icon - icon for the button face
|
|
23
|
+
* @param action - indicates to the button the action to perform
|
|
24
|
+
* @param ctor - the constructor of the button object
|
|
25
|
+
* @param group - the logical group, used to group the ribbon buttons
|
|
26
|
+
* @param id - unique ID for DOM selector
|
|
27
|
+
* @param dataElements - can be used to give buttons in a group basic parameters
|
|
28
|
+
* @category SuiButton
|
|
29
|
+
*/
|
|
30
|
+
export interface ButtonDefinition {
|
|
31
|
+
leftText: string;
|
|
32
|
+
rightText: string;
|
|
33
|
+
classes: string;
|
|
34
|
+
icon: string;
|
|
35
|
+
action: ButtonAction;
|
|
36
|
+
ctor: string;
|
|
37
|
+
group: string;
|
|
38
|
+
id: string;
|
|
39
|
+
callback?: ButtonCallback;
|
|
40
|
+
hotKey?: string;
|
|
41
|
+
dataElements?: {
|
|
42
|
+
interval: string;
|
|
43
|
+
direction: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @param button - the button definition that was activated
|
|
48
|
+
* @param elementId - the actual rendered DOM id of the clicked element, when known.
|
|
49
|
+
* Used to anchor any menu the button opens near the triggering element.
|
|
50
|
+
*/
|
|
51
|
+
export type ButtonCallback = (button: ButtonDefinition, elementId?: string) => Promise<void>;
|
|
52
|
+
export type DialogButtonState = 'selected' | 'unselected' | 'partiallySelected';
|
|
53
|
+
export interface DialogButtonDefinition {
|
|
54
|
+
label: string;
|
|
55
|
+
classes: string;
|
|
56
|
+
icon: string;
|
|
57
|
+
callback: DialogButtonCallback;
|
|
58
|
+
id: string;
|
|
59
|
+
group: string;
|
|
60
|
+
hotkey?: string;
|
|
61
|
+
state: DialogButtonState;
|
|
62
|
+
}
|
|
63
|
+
export type DialogButtonCallback = (button: DialogButtonDefinition) => Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* @category SuiButton
|
|
66
|
+
*/
|
|
67
|
+
export interface ButtonLabel {
|
|
68
|
+
buttonId: string;
|
|
69
|
+
buttonText: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Buttons perform any variety of functions, so they need access to all the rendering logic
|
|
73
|
+
* as well as all the event sources.
|
|
74
|
+
* Sometimes they invoke menus which invoke modals, etc.
|
|
75
|
+
* @category SuiButton
|
|
76
|
+
*/
|
|
77
|
+
export interface SuiButtonParams {
|
|
78
|
+
ctor: string;
|
|
79
|
+
buttonId: string;
|
|
80
|
+
buttonElement: string;
|
|
81
|
+
buttonData: ButtonDefinition;
|
|
82
|
+
view: SuiScoreViewOperations;
|
|
83
|
+
eventSource: BrowserEventSource;
|
|
84
|
+
menus: SuiMenuManager;
|
|
85
|
+
completeNotifier: CompleteNotifier;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @category SuiButton
|
|
89
|
+
*/
|
|
90
|
+
export declare abstract class SuiButton {
|
|
91
|
+
buttonId: string;
|
|
92
|
+
buttonElement: string;
|
|
93
|
+
view: SuiScoreViewOperations;
|
|
94
|
+
buttonData: ButtonDefinition;
|
|
95
|
+
eventSource: BrowserEventSource;
|
|
96
|
+
menus: SuiMenuManager;
|
|
97
|
+
completeNotifier: CompleteNotifier | null;
|
|
98
|
+
constructor(params: SuiButtonParams);
|
|
99
|
+
abstract bind(): void;
|
|
100
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { KeyEvent, SvgPoint } from '../../smo/data/common';
|
|
2
|
-
import { ButtonDefinition, ButtonAction } from './button';
|
|
3
|
-
import { BrowserEventSource } from '../eventSource';
|
|
4
|
-
import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
|
|
5
|
-
import { CompleteNotifier, RibbonLayout } from '../common';
|
|
6
|
-
import { SuiTracker } from '../../render/sui/tracker';
|
|
7
|
-
import { SuiMenuManager } from '../menus/manager';
|
|
8
|
-
import { ButtonLabel } from './button';
|
|
9
|
-
import { SmoUiConfiguration } from '../configuration';
|
|
10
|
-
export type SuiModalButtonTypes = 'SuiLibraryDialog' | 'SuiTempoDialog';
|
|
11
|
-
export declare var SuiModalButtonStrings: string[];
|
|
12
|
-
export declare function isModalButtonType(but: string | SuiModalButtonTypes): but is SuiModalButtonTypes;
|
|
13
|
-
/**
|
|
14
|
-
* Parameters for creating the global button ribbon object. The button ribbon supports a
|
|
15
|
-
* button panel in 'top' and 'left' areas, with support for R-to-L languages.
|
|
16
|
-
* Button groups in left and display menus are not collapsible. They are just a ButtonDefinition
|
|
17
|
-
* capsule but are not actually buttons - event handling is done by this 'ribbon' object.
|
|
18
|
-
* Button groups (mostly obsolete) are collapsible and are first-class button objects and
|
|
19
|
-
* are collapsible. The content of ribbonButtons determines which buttons show up.
|
|
20
|
-
* ribbon layout determines which show up top vs. left
|
|
21
|
-
* @param {BrowserEventSource} eventSource - buttons will use this to bind click events
|
|
22
|
-
* @param {CompleteNotifier} completeNotifier - buttons that bring up menus and dialogs will pass this to the dialogs
|
|
23
|
-
* @param {SuiTracker} tracker - some buttons act on the current selection
|
|
24
|
-
* @param {SuiMenuManager} menus - some buttons invoke a menu
|
|
25
|
-
* @param {ButtonDefinition[]} - the buttons
|
|
26
|
-
* @param {RibbonLayout} ribbons - where the buttons appear
|
|
27
|
-
* @category SuiButton
|
|
28
|
-
* @see {ButtonDefinition} for how to create/modify buttons
|
|
29
|
-
* @see {defaultRibbonLayout} for buttons supported from the demo application
|
|
30
|
-
*/
|
|
31
|
-
export interface SuiRibbonParams {
|
|
32
|
-
config: SmoUiConfiguration;
|
|
33
|
-
eventSource: BrowserEventSource;
|
|
34
|
-
view: SuiScoreViewOperations;
|
|
35
|
-
completeNotifier: CompleteNotifier;
|
|
36
|
-
tracker: SuiTracker;
|
|
37
|
-
menus: SuiMenuManager;
|
|
38
|
-
ribbonButtons: ButtonDefinition[];
|
|
39
|
-
ribbons: RibbonLayout;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Render the ribbon buttons based on group, function, and underlying UI handler.
|
|
43
|
-
* Also handles UI events.
|
|
44
|
-
* @category SuiButton
|
|
45
|
-
*/
|
|
46
|
-
export declare class RibbonButtons {
|
|
47
|
-
static get paramArray(): string[];
|
|
48
|
-
static translateButtons: ButtonLabel[];
|
|
49
|
-
controller: CompleteNotifier;
|
|
50
|
-
config: SmoUiConfiguration;
|
|
51
|
-
eventSource: BrowserEventSource;
|
|
52
|
-
view: SuiScoreViewOperations;
|
|
53
|
-
menus: SuiMenuManager;
|
|
54
|
-
ribbons: RibbonLayout;
|
|
55
|
-
ribbonButtons: ButtonDefinition[];
|
|
56
|
-
constructor(params: SuiRibbonParams);
|
|
57
|
-
resolveTopRightAnchor(elementId?: string): SvgPoint | undefined;
|
|
58
|
-
resolveBottomLeftAnchor(elementId?: string): SvgPoint | undefined;
|
|
59
|
-
executeQuickButton(button: ButtonDefinition, elementId?: string): Promise<void>;
|
|
60
|
-
executeButtonModal(buttonElement: string, buttonData: ButtonDefinition): Promise<void>;
|
|
61
|
-
executeButton(buttonElement: string, buttonData: ButtonDefinition): Promise<void>;
|
|
62
|
-
bindButton(buttonElement: string, buttonData: ButtonDefinition): void;
|
|
63
|
-
static isCollapsible(action: ButtonAction): boolean;
|
|
64
|
-
createRibbonHtml(buttonAr: string[], selector: string | HTMLElement): void;
|
|
65
|
-
createSidebarMenuHtml(buttonAr: string[], selector: string | HTMLElement): void;
|
|
66
|
-
createRibbon(buttonDataArray: string[], parentElement: string | HTMLElement): void;
|
|
67
|
-
createSidebarRibbon(buttonDataArray: string[], parentElement: string | HTMLElement, containerClasses: string): Promise<void>;
|
|
68
|
-
handleKeyDown(ev: KeyEvent): Promise<void>;
|
|
69
|
-
display(): void;
|
|
70
|
-
}
|
|
1
|
+
import { KeyEvent, SvgPoint } from '../../smo/data/common';
|
|
2
|
+
import { ButtonDefinition, ButtonAction } from './button';
|
|
3
|
+
import { BrowserEventSource } from '../eventSource';
|
|
4
|
+
import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
|
|
5
|
+
import { CompleteNotifier, RibbonLayout } from '../common';
|
|
6
|
+
import { SuiTracker } from '../../render/sui/tracker';
|
|
7
|
+
import { SuiMenuManager } from '../menus/manager';
|
|
8
|
+
import { ButtonLabel } from './button';
|
|
9
|
+
import { SmoUiConfiguration } from '../configuration';
|
|
10
|
+
export type SuiModalButtonTypes = 'SuiLibraryDialog' | 'SuiTempoDialog';
|
|
11
|
+
export declare var SuiModalButtonStrings: string[];
|
|
12
|
+
export declare function isModalButtonType(but: string | SuiModalButtonTypes): but is SuiModalButtonTypes;
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for creating the global button ribbon object. The button ribbon supports a
|
|
15
|
+
* button panel in 'top' and 'left' areas, with support for R-to-L languages.
|
|
16
|
+
* Button groups in left and display menus are not collapsible. They are just a ButtonDefinition
|
|
17
|
+
* capsule but are not actually buttons - event handling is done by this 'ribbon' object.
|
|
18
|
+
* Button groups (mostly obsolete) are collapsible and are first-class button objects and
|
|
19
|
+
* are collapsible. The content of ribbonButtons determines which buttons show up.
|
|
20
|
+
* ribbon layout determines which show up top vs. left
|
|
21
|
+
* @param {BrowserEventSource} eventSource - buttons will use this to bind click events
|
|
22
|
+
* @param {CompleteNotifier} completeNotifier - buttons that bring up menus and dialogs will pass this to the dialogs
|
|
23
|
+
* @param {SuiTracker} tracker - some buttons act on the current selection
|
|
24
|
+
* @param {SuiMenuManager} menus - some buttons invoke a menu
|
|
25
|
+
* @param {ButtonDefinition[]} - the buttons
|
|
26
|
+
* @param {RibbonLayout} ribbons - where the buttons appear
|
|
27
|
+
* @category SuiButton
|
|
28
|
+
* @see {ButtonDefinition} for how to create/modify buttons
|
|
29
|
+
* @see {defaultRibbonLayout} for buttons supported from the demo application
|
|
30
|
+
*/
|
|
31
|
+
export interface SuiRibbonParams {
|
|
32
|
+
config: SmoUiConfiguration;
|
|
33
|
+
eventSource: BrowserEventSource;
|
|
34
|
+
view: SuiScoreViewOperations;
|
|
35
|
+
completeNotifier: CompleteNotifier;
|
|
36
|
+
tracker: SuiTracker;
|
|
37
|
+
menus: SuiMenuManager;
|
|
38
|
+
ribbonButtons: ButtonDefinition[];
|
|
39
|
+
ribbons: RibbonLayout;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Render the ribbon buttons based on group, function, and underlying UI handler.
|
|
43
|
+
* Also handles UI events.
|
|
44
|
+
* @category SuiButton
|
|
45
|
+
*/
|
|
46
|
+
export declare class RibbonButtons {
|
|
47
|
+
static get paramArray(): string[];
|
|
48
|
+
static translateButtons: ButtonLabel[];
|
|
49
|
+
controller: CompleteNotifier;
|
|
50
|
+
config: SmoUiConfiguration;
|
|
51
|
+
eventSource: BrowserEventSource;
|
|
52
|
+
view: SuiScoreViewOperations;
|
|
53
|
+
menus: SuiMenuManager;
|
|
54
|
+
ribbons: RibbonLayout;
|
|
55
|
+
ribbonButtons: ButtonDefinition[];
|
|
56
|
+
constructor(params: SuiRibbonParams);
|
|
57
|
+
resolveTopRightAnchor(elementId?: string): SvgPoint | undefined;
|
|
58
|
+
resolveBottomLeftAnchor(elementId?: string): SvgPoint | undefined;
|
|
59
|
+
executeQuickButton(button: ButtonDefinition, elementId?: string): Promise<void>;
|
|
60
|
+
executeButtonModal(buttonElement: string, buttonData: ButtonDefinition): Promise<void>;
|
|
61
|
+
executeButton(buttonElement: string, buttonData: ButtonDefinition): Promise<void>;
|
|
62
|
+
bindButton(buttonElement: string, buttonData: ButtonDefinition): void;
|
|
63
|
+
static isCollapsible(action: ButtonAction): boolean;
|
|
64
|
+
createRibbonHtml(buttonAr: string[], selector: string | HTMLElement): void;
|
|
65
|
+
createSidebarMenuHtml(buttonAr: string[], selector: string | HTMLElement): void;
|
|
66
|
+
createRibbon(buttonDataArray: string[], parentElement: string | HTMLElement): void;
|
|
67
|
+
createSidebarRibbon(buttonDataArray: string[], parentElement: string | HTMLElement, containerClasses: string): Promise<void>;
|
|
68
|
+
handleKeyDown(ev: KeyEvent): Promise<void>;
|
|
69
|
+
display(): void;
|
|
70
|
+
}
|
package/types/src/ui/common.d.ts
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { ButtonDefinition } from '../ui/buttons/button';
|
|
2
|
-
import { KeyEvent } from '../smo/data/common';
|
|
3
|
-
import { SuiNavigation } from '../render/sui/configuration';
|
|
4
|
-
import { SuiScoreView } from '../render/sui/scoreView';
|
|
5
|
-
import { Ref } from 'vue';
|
|
6
|
-
/**
|
|
7
|
-
* Define the base class for a modal component that resolves a promise when it is dismissed
|
|
8
|
-
* @category SuiButton
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class ModalComponent {
|
|
11
|
-
abstract closeModalPromise: Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export type keyEventCallback = (ke: KeyEvent) => void;
|
|
14
|
-
/**
|
|
15
|
-
* Define an interface that gives up event handling when a modal is active
|
|
16
|
-
* @category SuiButton
|
|
17
|
-
*/
|
|
18
|
-
export declare abstract class CompleteNotifier {
|
|
19
|
-
abstract unbindKeyboardForModal(component: ModalComponent): void;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @category SuiButton
|
|
23
|
-
*/
|
|
24
|
-
export interface RibbonLayout {
|
|
25
|
-
left: string[];
|
|
26
|
-
top: string[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @category SuiButton
|
|
30
|
-
*/
|
|
31
|
-
export interface RibbonDefinition {
|
|
32
|
-
ribbon: RibbonLayout;
|
|
33
|
-
ribbonButtons: ButtonDefinition[];
|
|
34
|
-
}
|
|
35
|
-
export interface SelectOption {
|
|
36
|
-
label: string;
|
|
37
|
-
value: string;
|
|
38
|
-
classes?: string;
|
|
39
|
-
icon?: string;
|
|
40
|
-
active?: boolean;
|
|
41
|
-
}
|
|
42
|
-
export interface SelectDefinition {
|
|
43
|
-
domId: string;
|
|
44
|
-
label: string;
|
|
45
|
-
initialValue: string;
|
|
46
|
-
selections: SelectOption[];
|
|
47
|
-
changeCb: (value: string) => void;
|
|
48
|
-
}
|
|
49
|
-
export interface DomDebugFlag {
|
|
50
|
-
category: string;
|
|
51
|
-
htmlString: string;
|
|
52
|
-
}
|
|
53
|
-
export interface CrashDialog {
|
|
54
|
-
url: string;
|
|
55
|
-
bodyText: Ref<string>;
|
|
56
|
-
show: Ref<boolean>;
|
|
57
|
-
}
|
|
58
|
-
export interface DomDialogNotifiers {
|
|
59
|
-
showSplash: Ref<boolean>;
|
|
60
|
-
showHelpDialog: Ref<boolean>;
|
|
61
|
-
splashTimer: Ref<number>;
|
|
62
|
-
debugFlags: DomDebugFlag[];
|
|
63
|
-
crashDialog: CrashDialog;
|
|
64
|
-
showAttributeDialog: Ref<boolean>;
|
|
65
|
-
}
|
|
66
|
-
export interface ExceptionParameters {
|
|
67
|
-
view: SuiScoreView;
|
|
68
|
-
navigation: SuiNavigation;
|
|
69
|
-
}
|
|
70
|
-
export declare const modalContainerId = ".vue-modal-container";
|
|
71
|
-
/**
|
|
72
|
-
* Remove and replace an element, so we can reattach Vue to it
|
|
73
|
-
* @param element the ID or element we are replacing
|
|
74
|
-
* @returns the new element id
|
|
75
|
-
*/
|
|
76
|
-
export declare const replaceVueRoot: (element: string | HTMLElement) => string;
|
|
1
|
+
import { ButtonDefinition } from '../ui/buttons/button';
|
|
2
|
+
import { KeyEvent } from '../smo/data/common';
|
|
3
|
+
import { SuiNavigation } from '../render/sui/configuration';
|
|
4
|
+
import { SuiScoreView } from '../render/sui/scoreView';
|
|
5
|
+
import { Ref } from 'vue';
|
|
6
|
+
/**
|
|
7
|
+
* Define the base class for a modal component that resolves a promise when it is dismissed
|
|
8
|
+
* @category SuiButton
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class ModalComponent {
|
|
11
|
+
abstract closeModalPromise: Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export type keyEventCallback = (ke: KeyEvent) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Define an interface that gives up event handling when a modal is active
|
|
16
|
+
* @category SuiButton
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class CompleteNotifier {
|
|
19
|
+
abstract unbindKeyboardForModal(component: ModalComponent): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @category SuiButton
|
|
23
|
+
*/
|
|
24
|
+
export interface RibbonLayout {
|
|
25
|
+
left: string[];
|
|
26
|
+
top: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @category SuiButton
|
|
30
|
+
*/
|
|
31
|
+
export interface RibbonDefinition {
|
|
32
|
+
ribbon: RibbonLayout;
|
|
33
|
+
ribbonButtons: ButtonDefinition[];
|
|
34
|
+
}
|
|
35
|
+
export interface SelectOption {
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
classes?: string;
|
|
39
|
+
icon?: string;
|
|
40
|
+
active?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface SelectDefinition {
|
|
43
|
+
domId: string;
|
|
44
|
+
label: string;
|
|
45
|
+
initialValue: string;
|
|
46
|
+
selections: SelectOption[];
|
|
47
|
+
changeCb: (value: string) => void;
|
|
48
|
+
}
|
|
49
|
+
export interface DomDebugFlag {
|
|
50
|
+
category: string;
|
|
51
|
+
htmlString: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CrashDialog {
|
|
54
|
+
url: string;
|
|
55
|
+
bodyText: Ref<string>;
|
|
56
|
+
show: Ref<boolean>;
|
|
57
|
+
}
|
|
58
|
+
export interface DomDialogNotifiers {
|
|
59
|
+
showSplash: Ref<boolean>;
|
|
60
|
+
showHelpDialog: Ref<boolean>;
|
|
61
|
+
splashTimer: Ref<number>;
|
|
62
|
+
debugFlags: DomDebugFlag[];
|
|
63
|
+
crashDialog: CrashDialog;
|
|
64
|
+
showAttributeDialog: Ref<boolean>;
|
|
65
|
+
}
|
|
66
|
+
export interface ExceptionParameters {
|
|
67
|
+
view: SuiScoreView;
|
|
68
|
+
navigation: SuiNavigation;
|
|
69
|
+
}
|
|
70
|
+
export declare const modalContainerId = ".vue-modal-container";
|
|
71
|
+
/**
|
|
72
|
+
* Remove and replace an element, so we can reattach Vue to it
|
|
73
|
+
* @param element the ID or element we are replacing
|
|
74
|
+
* @returns the new element id
|
|
75
|
+
*/
|
|
76
|
+
export declare const replaceVueRoot: (element: string | HTMLElement) => string;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure encode/decode between a SmoLyric chord-parser text string (the
|
|
3
|
-
* '^'/'%'/'@glyphKey@' token format tokenized by SmoLyric._tokenizeChordString
|
|
4
|
-
* and consumed at real render time by getVexChordBlocks, src/render/vex/smoAdapter.ts)
|
|
5
|
-
* and a neutral, ProseMirror-independent segment list. See
|
|
6
|
-
* specs/013-vue-chord-dialog/research.md §6.
|
|
7
|
-
*/
|
|
8
|
-
export type TextType = 0 | 1 | 2;
|
|
9
|
-
export type ChordSegment = {
|
|
10
|
-
kind: 'text';
|
|
11
|
-
text: string;
|
|
12
|
-
textType: TextType;
|
|
13
|
-
} | {
|
|
14
|
-
kind: 'glyph';
|
|
15
|
-
glyphKey: string;
|
|
16
|
-
textType: TextType;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Tokenize a raw chord-text string into ChordSegments, tracking the active
|
|
20
|
-
* superscript/subscript state exactly as SuiChordEditor._setSymbolModifier does.
|
|
21
|
-
*/
|
|
22
|
-
export declare function decodeChordText(raw: string): ChordSegment[];
|
|
23
|
-
/**
|
|
24
|
-
* Serialize ChordSegments back into the raw chord-text string format,
|
|
25
|
-
* emitting toggle characters for text-type transitions via the same
|
|
26
|
-
* transition table SuiChordEditor.getText() uses.
|
|
27
|
-
*/
|
|
28
|
-
export declare function encodeChordText(segments: ChordSegment[]): string;
|
|
1
|
+
/**
|
|
2
|
+
* Pure encode/decode between a SmoLyric chord-parser text string (the
|
|
3
|
+
* '^'/'%'/'@glyphKey@' token format tokenized by SmoLyric._tokenizeChordString
|
|
4
|
+
* and consumed at real render time by getVexChordBlocks, src/render/vex/smoAdapter.ts)
|
|
5
|
+
* and a neutral, ProseMirror-independent segment list. See
|
|
6
|
+
* specs/013-vue-chord-dialog/research.md §6.
|
|
7
|
+
*/
|
|
8
|
+
export type TextType = 0 | 1 | 2;
|
|
9
|
+
export type ChordSegment = {
|
|
10
|
+
kind: 'text';
|
|
11
|
+
text: string;
|
|
12
|
+
textType: TextType;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'glyph';
|
|
15
|
+
glyphKey: string;
|
|
16
|
+
textType: TextType;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Tokenize a raw chord-text string into ChordSegments, tracking the active
|
|
20
|
+
* superscript/subscript state exactly as SuiChordEditor._setSymbolModifier does.
|
|
21
|
+
*/
|
|
22
|
+
export declare function decodeChordText(raw: string): ChordSegment[];
|
|
23
|
+
/**
|
|
24
|
+
* Serialize ChordSegments back into the raw chord-text string format,
|
|
25
|
+
* emitting toggle characters for text-type transitions via the same
|
|
26
|
+
* transition table SuiChordEditor.getText() uses.
|
|
27
|
+
*/
|
|
28
|
+
export declare function encodeChordText(segments: ChordSegment[]): string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TipTap Node extension rendering a non-active SmoScoreText block as an
|
|
3
|
-
* atomic, non-editable, styled leaf inside the text group editor's document.
|
|
4
|
-
* @module /ui/components/dialogs/textBlockAtomNode
|
|
5
|
-
*/
|
|
6
|
-
import { Node } from '@tiptap/core';
|
|
7
|
-
export interface TextBlockAtomAttrs {
|
|
8
|
-
blockId: string;
|
|
9
|
-
text: string;
|
|
10
|
-
fontFamily: string;
|
|
11
|
-
fontSize: number;
|
|
12
|
-
fontWeight: string;
|
|
13
|
-
fontStyle: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Atomic, non-editable node representing one non-active SmoScoreText block.
|
|
17
|
-
* Used by textGroupHtml.ts/textGroupEditor.vue -- see
|
|
18
|
-
* contracts/textBlockAtomNode.contract.md for the full spec.
|
|
19
|
-
*/
|
|
20
|
-
export declare const TextBlockAtomNode: Node<any, any>;
|
|
1
|
+
/**
|
|
2
|
+
* TipTap Node extension rendering a non-active SmoScoreText block as an
|
|
3
|
+
* atomic, non-editable, styled leaf inside the text group editor's document.
|
|
4
|
+
* @module /ui/components/dialogs/textBlockAtomNode
|
|
5
|
+
*/
|
|
6
|
+
import { Node } from '@tiptap/core';
|
|
7
|
+
export interface TextBlockAtomAttrs {
|
|
8
|
+
blockId: string;
|
|
9
|
+
text: string;
|
|
10
|
+
fontFamily: string;
|
|
11
|
+
fontSize: number;
|
|
12
|
+
fontWeight: string;
|
|
13
|
+
fontStyle: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Atomic, non-editable node representing one non-active SmoScoreText block.
|
|
17
|
+
* Used by textGroupHtml.ts/textGroupEditor.vue -- see
|
|
18
|
+
* contracts/textBlockAtomNode.contract.md for the full spec.
|
|
19
|
+
*/
|
|
20
|
+
export declare const TextBlockAtomNode: Node<any, any>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conversion between SmoTextGroup (the score's rich-text data model) and the
|
|
3
|
-
* TipTap JSON document representation used by textGroupEditor.vue. Exactly
|
|
4
|
-
* one block (the active block, identified by id) is represented as plain
|
|
5
|
-
* editable text; every other block is represented as a read-only
|
|
6
|
-
* `textBlockAtom` node (see textBlockAtomNode.ts) carrying its own text and
|
|
7
|
-
* font/weight/style.
|
|
8
|
-
* @module /ui/components/dialogs/textGroupHtml
|
|
9
|
-
*/
|
|
10
|
-
import { JSONContent } from '@tiptap/core';
|
|
11
|
-
import { SmoTextGroup } from '../../../smo/data/scoreText';
|
|
12
|
-
/**
|
|
13
|
-
* Convert a SmoTextGroup into a TipTap JSON document suitable for
|
|
14
|
-
* `editor.commands.setContent`. The block whose id matches `activeBlockId`
|
|
15
|
-
* becomes plain editable text; every other block becomes a non-editable
|
|
16
|
-
* `textBlockAtom` node. Blocks are arranged one-paragraph-per-block when
|
|
17
|
-
* `relativePosition` is ABOVE/BELOW, or joined into a single shared
|
|
18
|
-
* paragraph when it is LEFT/RIGHT -- see research.md §3.
|
|
19
|
-
*/
|
|
20
|
-
export declare function textGroupToHtml(textGroup: SmoTextGroup, activeBlockId: string): JSONContent;
|
|
21
|
-
/**
|
|
22
|
-
* Convert a TipTap JSON document (`editor.getJSON()`) back into a
|
|
23
|
-
* SmoTextGroup. Only the active block's text can have changed (there is no
|
|
24
|
-
* formatting to read back, since the editor exposes no marks); every other
|
|
25
|
-
* field -- including every non-active block, which is structurally
|
|
26
|
-
* non-editable -- is carried over unchanged from `original`. The group
|
|
27
|
-
* keeps its original attrs.id via SmoTextGroup.deserializePreserveId.
|
|
28
|
-
*/
|
|
29
|
-
export declare function htmlToTextGroup(editorJson: JSONContent, original: SmoTextGroup): SmoTextGroup;
|
|
1
|
+
/**
|
|
2
|
+
* Conversion between SmoTextGroup (the score's rich-text data model) and the
|
|
3
|
+
* TipTap JSON document representation used by textGroupEditor.vue. Exactly
|
|
4
|
+
* one block (the active block, identified by id) is represented as plain
|
|
5
|
+
* editable text; every other block is represented as a read-only
|
|
6
|
+
* `textBlockAtom` node (see textBlockAtomNode.ts) carrying its own text and
|
|
7
|
+
* font/weight/style.
|
|
8
|
+
* @module /ui/components/dialogs/textGroupHtml
|
|
9
|
+
*/
|
|
10
|
+
import { JSONContent } from '@tiptap/core';
|
|
11
|
+
import { SmoTextGroup } from '../../../smo/data/scoreText';
|
|
12
|
+
/**
|
|
13
|
+
* Convert a SmoTextGroup into a TipTap JSON document suitable for
|
|
14
|
+
* `editor.commands.setContent`. The block whose id matches `activeBlockId`
|
|
15
|
+
* becomes plain editable text; every other block becomes a non-editable
|
|
16
|
+
* `textBlockAtom` node. Blocks are arranged one-paragraph-per-block when
|
|
17
|
+
* `relativePosition` is ABOVE/BELOW, or joined into a single shared
|
|
18
|
+
* paragraph when it is LEFT/RIGHT -- see research.md §3.
|
|
19
|
+
*/
|
|
20
|
+
export declare function textGroupToHtml(textGroup: SmoTextGroup, activeBlockId: string): JSONContent;
|
|
21
|
+
/**
|
|
22
|
+
* Convert a TipTap JSON document (`editor.getJSON()`) back into a
|
|
23
|
+
* SmoTextGroup. Only the active block's text can have changed (there is no
|
|
24
|
+
* formatting to read back, since the editor exposes no marks); every other
|
|
25
|
+
* field -- including every non-active block, which is structurally
|
|
26
|
+
* non-editable -- is carried over unchanged from `original`. The group
|
|
27
|
+
* keeps its original attrs.id via SmoTextGroup.deserializePreserveId.
|
|
28
|
+
*/
|
|
29
|
+
export declare function htmlToTextGroup(editorJson: JSONContent, original: SmoTextGroup): SmoTextGroup;
|