smoosic 2.0.3 → 2.0.5

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.
Files changed (260) hide show
  1. package/build/smoosic.js +408 -69
  2. package/changes.md +95 -0
  3. package/package.json +19 -1
  4. package/release/smoosic.js +408 -69
  5. package/specs/032-split-multimeasure-rests/checklists/requirements.md +40 -0
  6. package/specs/032-split-multimeasure-rests/contracts/grouping-contract.md +53 -0
  7. package/specs/032-split-multimeasure-rests/data-model.md +70 -0
  8. package/specs/032-split-multimeasure-rests/plan.md +81 -0
  9. package/specs/032-split-multimeasure-rests/quickstart.md +46 -0
  10. package/specs/032-split-multimeasure-rests/research.md +63 -0
  11. package/specs/032-split-multimeasure-rests/spec.md +127 -0
  12. package/specs/032-split-multimeasure-rests/tasks.md +174 -0
  13. package/specs/033-key-distance-transposition/checklists/requirements.md +35 -0
  14. package/specs/033-key-distance-transposition/contracts/spelling-api.md +36 -0
  15. package/specs/033-key-distance-transposition/data-model.md +49 -0
  16. package/specs/033-key-distance-transposition/plan.md +87 -0
  17. package/specs/033-key-distance-transposition/quickstart.md +40 -0
  18. package/specs/033-key-distance-transposition/research.md +82 -0
  19. package/specs/033-key-distance-transposition/spec.md +132 -0
  20. package/specs/033-key-distance-transposition/tasks.md +139 -0
  21. package/specs/034-smz-compressed-scores/checklists/requirements.md +35 -0
  22. package/specs/034-smz-compressed-scores/contracts/archive-api.md +30 -0
  23. package/specs/034-smz-compressed-scores/data-model.md +48 -0
  24. package/specs/034-smz-compressed-scores/plan.md +89 -0
  25. package/specs/034-smz-compressed-scores/quickstart.md +44 -0
  26. package/specs/034-smz-compressed-scores/research.md +86 -0
  27. package/specs/034-smz-compressed-scores/spec.md +137 -0
  28. package/specs/034-smz-compressed-scores/tasks.md +148 -0
  29. package/specs/035-paste-special/checklists/requirements.md +35 -0
  30. package/specs/035-paste-special/contracts/paste-special-api.md +50 -0
  31. package/specs/035-paste-special/data-model.md +47 -0
  32. package/specs/035-paste-special/plan.md +83 -0
  33. package/specs/035-paste-special/quickstart.md +51 -0
  34. package/specs/035-paste-special/research.md +97 -0
  35. package/specs/035-paste-special/spec.md +170 -0
  36. package/specs/035-paste-special/tasks.md +149 -0
  37. package/specs/036-autosave-recovery/checklists/requirements.md +36 -0
  38. package/specs/036-autosave-recovery/contracts/autosave-api.md +111 -0
  39. package/specs/036-autosave-recovery/data-model.md +70 -0
  40. package/specs/036-autosave-recovery/plan.md +87 -0
  41. package/specs/036-autosave-recovery/quickstart.md +65 -0
  42. package/specs/036-autosave-recovery/research.md +105 -0
  43. package/specs/036-autosave-recovery/spec.md +143 -0
  44. package/specs/036-autosave-recovery/tasks.md +165 -0
  45. package/specs/037-fix-new-part-dialog/checklists/requirements.md +38 -0
  46. package/specs/037-fix-new-part-dialog/contracts/create-part-api.md +84 -0
  47. package/specs/037-fix-new-part-dialog/data-model.md +68 -0
  48. package/specs/037-fix-new-part-dialog/plan.md +83 -0
  49. package/specs/037-fix-new-part-dialog/quickstart.md +58 -0
  50. package/specs/037-fix-new-part-dialog/research.md +86 -0
  51. package/specs/037-fix-new-part-dialog/spec.md +144 -0
  52. package/specs/037-fix-new-part-dialog/tasks.md +174 -0
  53. package/specs/038-per-measure-beam-groups/checklists/requirements.md +36 -0
  54. package/specs/038-per-measure-beam-groups/contracts/beam-groups-api.md +74 -0
  55. package/specs/038-per-measure-beam-groups/data-model.md +75 -0
  56. package/specs/038-per-measure-beam-groups/plan.md +84 -0
  57. package/specs/038-per-measure-beam-groups/quickstart.md +53 -0
  58. package/specs/038-per-measure-beam-groups/research.md +72 -0
  59. package/specs/038-per-measure-beam-groups/spec.md +146 -0
  60. package/specs/038-per-measure-beam-groups/tasks.md +132 -0
  61. package/specs/039-measure-fill-submenu/checklists/requirements.md +35 -0
  62. package/specs/039-measure-fill-submenu/contracts/measure-fill-api.md +56 -0
  63. package/specs/039-measure-fill-submenu/data-model.md +79 -0
  64. package/specs/039-measure-fill-submenu/plan.md +81 -0
  65. package/specs/039-measure-fill-submenu/quickstart.md +62 -0
  66. package/specs/039-measure-fill-submenu/research.md +68 -0
  67. package/specs/039-measure-fill-submenu/spec.md +153 -0
  68. package/specs/039-measure-fill-submenu/tasks.md +121 -0
  69. package/specs/040-dynamics-dialog-cleanup/checklists/requirements.md +36 -0
  70. package/specs/040-dynamics-dialog-cleanup/contracts/dynamics-dialog.md +52 -0
  71. package/specs/040-dynamics-dialog-cleanup/data-model.md +48 -0
  72. package/specs/040-dynamics-dialog-cleanup/plan.md +89 -0
  73. package/specs/040-dynamics-dialog-cleanup/quickstart.md +69 -0
  74. package/specs/040-dynamics-dialog-cleanup/research.md +80 -0
  75. package/specs/040-dynamics-dialog-cleanup/spec.md +120 -0
  76. package/specs/040-dynamics-dialog-cleanup/tasks.md +114 -0
  77. package/specs/041-delete-special/checklists/requirements.md +35 -0
  78. package/specs/041-delete-special/contracts/delete-special-api.md +41 -0
  79. package/specs/041-delete-special/data-model.md +40 -0
  80. package/specs/041-delete-special/plan.md +93 -0
  81. package/specs/041-delete-special/quickstart.md +41 -0
  82. package/specs/041-delete-special/research.md +75 -0
  83. package/specs/041-delete-special/spec.md +136 -0
  84. package/specs/041-delete-special/tasks.md +106 -0
  85. package/specs/042-preserve-music-time-signature/checklists/requirements.md +35 -0
  86. package/specs/042-preserve-music-time-signature/contracts/rebar-api.md +66 -0
  87. package/specs/042-preserve-music-time-signature/data-model.md +73 -0
  88. package/specs/042-preserve-music-time-signature/plan.md +93 -0
  89. package/specs/042-preserve-music-time-signature/quickstart.md +37 -0
  90. package/specs/042-preserve-music-time-signature/research.md +102 -0
  91. package/specs/042-preserve-music-time-signature/spec.md +153 -0
  92. package/specs/042-preserve-music-time-signature/tasks.md +104 -0
  93. package/src/application/application.ts +13 -2
  94. package/src/application/exports.ts +402 -395
  95. package/src/application/generateVexTests.ts +2 -2
  96. package/src/render/sui/NoteEntryCaret.ts +117 -16
  97. package/src/render/sui/autosave.ts +265 -0
  98. package/src/render/sui/formatter.ts +12 -2
  99. package/src/render/sui/renderState.ts +4 -4
  100. package/src/render/sui/scoreChangeState.ts +8 -3
  101. package/src/render/sui/scoreView.ts +47 -2
  102. package/src/render/sui/scoreViewOperations.ts +2761 -2555
  103. package/src/render/sui/staffLineGeometry.ts +82 -0
  104. package/src/render/sui/tracker.ts +18 -23
  105. package/src/render/vex/vxMeasure.ts +22 -8
  106. package/src/render/vex/vxNote.ts +2 -4
  107. package/src/smo/data/measure.ts +58 -1
  108. package/src/smo/data/measureModifiers.ts +81 -1
  109. package/src/smo/data/music.ts +169 -359
  110. package/src/smo/data/note.ts +1 -1
  111. package/src/smo/data/noteModifiers.ts +12 -0
  112. package/src/smo/data/score.ts +179 -7
  113. package/src/smo/data/scoreModifiers.ts +46 -1
  114. package/src/smo/data/systemStaff.ts +43 -0
  115. package/src/smo/xform/beamers.ts +80 -6
  116. package/src/smo/xform/copypaste.ts +207 -47
  117. package/src/smo/xform/measureFill.ts +89 -0
  118. package/src/smo/xform/operations.ts +452 -61
  119. package/src/smo/xform/rebar.ts +490 -0
  120. package/src/smo/xform/selections.ts +73 -0
  121. package/src/ui/components/dialogs/beamGroups.vue +106 -0
  122. package/src/ui/components/dialogs/deleteSpecial.vue +38 -0
  123. package/src/ui/components/dialogs/dynamics.vue +16 -3
  124. package/src/ui/components/dialogs/fileUpload.vue +2 -2
  125. package/src/ui/components/dialogs/hairpin.vue +3 -3
  126. package/src/ui/components/dialogs/newPart.vue +148 -184
  127. package/src/ui/components/dialogs/pasteSpecial.vue +49 -0
  128. package/src/ui/components/dialogs/recovery.vue +66 -0
  129. package/src/ui/components/dialogs/save.vue +11 -4
  130. package/src/ui/components/dialogs/scorePreferences.vue +23 -1
  131. package/src/ui/components/dialogs/slur.vue +6 -6
  132. package/src/ui/components/dialogs/tempo.vue +11 -3
  133. package/src/ui/components/dialogs/timeSignature.vue +18 -3
  134. package/src/ui/components/dialogs/volta.vue +3 -3
  135. package/src/ui/dialogs/annotationVue.ts +1 -1
  136. package/src/ui/dialogs/beamGroupsVue.ts +69 -0
  137. package/src/ui/dialogs/createPartHelpers.ts +68 -0
  138. package/src/ui/dialogs/deleteSpecial.ts +57 -0
  139. package/src/ui/dialogs/dynamicsVue.ts +87 -60
  140. package/src/ui/dialogs/factory.ts +0 -2
  141. package/src/ui/dialogs/fileDialogs.ts +63 -22
  142. package/src/ui/dialogs/instrument.ts +37 -30
  143. package/src/ui/dialogs/pasteSpecial.ts +59 -0
  144. package/src/ui/dialogs/preferences.ts +41 -40
  145. package/src/ui/dialogs/recovery.ts +49 -0
  146. package/src/ui/dialogs/timeSignature.ts +27 -39
  147. package/src/ui/fileio/fileInput.ts +12 -3
  148. package/src/ui/fileio/scoreArchive.ts +151 -0
  149. package/src/ui/fileio/xhrLoader.ts +26 -0
  150. package/src/ui/i18n/language.ts +1 -1
  151. package/src/ui/menus/beams.ts +181 -112
  152. package/src/ui/menus/edit.ts +44 -6
  153. package/src/ui/menus/file.ts +21 -1
  154. package/src/ui/menus/measure.ts +40 -1
  155. package/tests/autosave.ts +332 -0
  156. package/tests/beamDotted.ts +56 -0
  157. package/tests/beamGroups.ts +338 -0
  158. package/tests/createPart.ts +292 -0
  159. package/tests/deleteSpecial.ts +350 -0
  160. package/tests/dynamicsFontSize.ts +132 -0
  161. package/tests/keyDistanceTransposition.ts +351 -0
  162. package/tests/measureFill.ts +295 -0
  163. package/tests/movePart.ts +94 -0
  164. package/tests/multimeasureRest.ts +338 -0
  165. package/tests/pasteIntoMeasure.ts +103 -0
  166. package/tests/pasteSpecial.ts +541 -0
  167. package/tests/quickBeam.ts +126 -0
  168. package/tests/rebarMeasures.ts +492 -0
  169. package/tests/scoreArchive.ts +218 -0
  170. package/tests/scoreChangeState.ts +2 -0
  171. package/tests/staffLineGeometry.ts +179 -0
  172. package/tests/timeRangeSelect.ts +111 -0
  173. package/tests/timeSignatureDisplay.ts +58 -0
  174. package/tools/smoosic-schema.json +37 -0
  175. package/typedoc.ts +2 -1
  176. package/types/src/application/exports.d.ts +454 -447
  177. package/types/src/common/promiseHelpers.d.ts +30 -30
  178. package/types/src/common/vex.d.ts +224 -224
  179. package/types/src/render/sui/NoteEntryCaret.d.ts +107 -107
  180. package/types/src/render/sui/autosave.d.ts +99 -0
  181. package/types/src/render/sui/scoreView.d.ts +23 -0
  182. package/types/src/render/sui/scoreViewOperations.d.ts +776 -639
  183. package/types/src/render/sui/svgHelpers.d.ts +88 -88
  184. package/types/src/render/sui/svgPageMap.d.ts +344 -344
  185. package/types/src/render/sui/textEdit.d.ts +96 -96
  186. package/types/src/render/sui/textRender.d.ts +199 -199
  187. package/types/src/render/vex/smoAdapter.d.ts +47 -47
  188. package/types/src/render/vex/vxMeasure.d.ts +97 -97
  189. package/types/src/render/vex/vxNote.d.ts +56 -56
  190. package/types/src/render/vex/vxSystem.d.ts +71 -71
  191. package/types/src/smo/data/measure.d.ts +30 -0
  192. package/types/src/smo/data/measureModifiers.d.ts +568 -513
  193. package/types/src/smo/data/music.d.ts +74 -32
  194. package/types/src/smo/data/note.d.ts +498 -498
  195. package/types/src/smo/data/noteModifiers.d.ts +615 -606
  196. package/types/src/smo/data/score.d.ts +479 -421
  197. package/types/src/smo/data/scoreModifiers.d.ts +30 -0
  198. package/types/src/smo/data/scoreText.d.ts +334 -334
  199. package/types/src/smo/data/systemStaff.d.ts +14 -0
  200. package/types/src/smo/xform/beamers.d.ts +23 -1
  201. package/types/src/smo/xform/copypaste.d.ts +138 -2
  202. package/types/src/smo/xform/measureFill.d.ts +21 -0
  203. package/types/src/smo/xform/operations.d.ts +269 -129
  204. package/types/src/smo/xform/rebar.d.ts +53 -0
  205. package/types/src/smo/xform/selections.d.ts +168 -154
  206. package/types/src/smo/xform/undo.d.ts +142 -142
  207. package/types/src/ui/buttons/button.d.ts +100 -100
  208. package/types/src/ui/buttons/ribbon.d.ts +70 -70
  209. package/types/src/ui/common.d.ts +76 -76
  210. package/types/src/ui/components/dialogs/chordText.d.ts +28 -28
  211. package/types/src/ui/components/dialogs/textBlockAtomNode.d.ts +20 -20
  212. package/types/src/ui/components/dialogs/textGroupHtml.d.ts +29 -29
  213. package/types/src/ui/composable/draggable.d.ts +15 -15
  214. package/types/src/ui/dialogs/adapter.d.ts +120 -120
  215. package/types/src/ui/dialogs/annotationVue.d.ts +9 -9
  216. package/types/src/ui/dialogs/audioSettings.d.ts +32 -32
  217. package/types/src/ui/dialogs/beamGroupsVue.d.ts +20 -0
  218. package/types/src/ui/dialogs/chordChangeVue.d.ts +8 -8
  219. package/types/src/ui/dialogs/createPartHelpers.d.ts +29 -0
  220. package/types/src/ui/dialogs/customTupletsVue.d.ts +9 -9
  221. package/types/src/ui/dialogs/deleteSpecial.d.ts +8 -0
  222. package/types/src/ui/dialogs/dialog.d.ts +203 -203
  223. package/types/src/ui/dialogs/dynamicsVue.d.ts +10 -10
  224. package/types/src/ui/dialogs/factory.d.ts +15 -15
  225. package/types/src/ui/dialogs/fileDialogs.d.ts +4 -4
  226. package/types/src/ui/dialogs/hairpin.d.ts +35 -35
  227. package/types/src/ui/dialogs/hairpinVue.d.ts +7 -7
  228. package/types/src/ui/dialogs/instrument.d.ts +3 -3
  229. package/types/src/ui/dialogs/keySignatureVue.d.ts +7 -7
  230. package/types/src/ui/dialogs/libraryVue.d.ts +15 -15
  231. package/types/src/ui/dialogs/lyricVue.d.ts +8 -8
  232. package/types/src/ui/dialogs/pasteSpecial.d.ts +8 -0
  233. package/types/src/ui/dialogs/pedalMarkingVue.d.ts +7 -7
  234. package/types/src/ui/dialogs/recovery.d.ts +8 -0
  235. package/types/src/ui/dialogs/rehearsalMark.d.ts +25 -25
  236. package/types/src/ui/dialogs/rehearsalMarkVue.d.ts +7 -7
  237. package/types/src/ui/dialogs/slur.d.ts +57 -57
  238. package/types/src/ui/dialogs/slurVue.d.ts +7 -7
  239. package/types/src/ui/dialogs/tempo.d.ts +50 -50
  240. package/types/src/ui/dialogs/tempoVue.d.ts +10 -10
  241. package/types/src/ui/dialogs/textBlockVue.d.ts +8 -8
  242. package/types/src/ui/dialogs/textBracket.d.ts +35 -35
  243. package/types/src/ui/dialogs/textBracketVue.d.ts +7 -7
  244. package/types/src/ui/dialogs/tie.d.ts +41 -41
  245. package/types/src/ui/dialogs/volta.d.ts +40 -40
  246. package/types/src/ui/dialogs/voltaVue.d.ts +7 -7
  247. package/types/src/ui/fileio/fileInput.d.ts +7 -1
  248. package/types/src/ui/fileio/library.d.ts +40 -40
  249. package/types/src/ui/fileio/scoreArchive.d.ts +55 -0
  250. package/types/src/ui/fileio/xhrLoader.d.ts +7 -0
  251. package/types/src/ui/menus/file.d.ts +8 -8
  252. package/types/src/ui/menus/language.d.ts +7 -7
  253. package/types/src/ui/menus/manager.d.ts +58 -58
  254. package/types/src/ui/menus/menu.d.ts +159 -159
  255. package/types/src/ui/menus/partSelection.d.ts +14 -14
  256. package/types/src/ui/menus/score.d.ts +8 -8
  257. package/types/src/ui/menus/staffModifier.d.ts +17 -17
  258. package/types/typedoc.d.ts +148 -147
  259. package/src/ui/dialogs/dynamics.ts +0 -141
  260. package/types/src/ui/dialogs/dynamics.d.ts +0 -37
@@ -1,10 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, Ref } from 'vue';
3
- import { SmoScorePreferences } from '../../../smo/data/scoreModifiers';
3
+ import { SmoScorePreferences, autosaveLimits, clampAutosaveInterval, clampAutosaveCount } from '../../../smo/data/scoreModifiers';
4
4
  import { SelectOption } from '../../common';
5
5
  import selectComp from './select.vue';
6
6
  import dialogContainer from './dialogContainer.vue';
7
7
  import toggle from './toggle.vue';
8
+ import numberInput from './numberInput.vue';
8
9
 
9
10
  interface Props {
10
11
  domId: string,
@@ -27,6 +28,12 @@ const defaultTripleDurations: SelectOption[] = [
27
28
  { label: '1/8', value: '2048' }
28
29
  ];
29
30
 
31
+ const updateAutosaveInterval = async (value: number) => {
32
+ preferences.autosaveInterval = clampAutosaveInterval(value);
33
+ }
34
+ const updateAutosaveCount = async (value: number) => {
35
+ preferences.autosaveCount = clampAutosaveCount(value);
36
+ }
30
37
  const getDomId = () => {
31
38
  return `attr-modal-dialog-${domId}`;
32
39
  }
@@ -91,5 +98,20 @@ const updateNumber = (type: numberTypes) => {
91
98
  :changeCb="updateNumber('defaultTripleDuration')" />
92
99
  </div>
93
100
  </div>
101
+ <div class="row mt-3">
102
+ <div class="col text-start fw-bold">Autosave</div>
103
+ </div>
104
+ <div class="row align-items-baseline" :id="getId('autosave-row')">
105
+ <div class="col col-6 text-start">
106
+ <numberInput :domId="getId('autosave-interval')" label="Minutes between autosaves" :precision="0"
107
+ :minValue="autosaveLimits.minInterval" :maxValue="autosaveLimits.maxInterval"
108
+ :initialValue="preferences.autosaveInterval" :changeCb="updateAutosaveInterval" />
109
+ </div>
110
+ <div class="col col-6 text-start">
111
+ <numberInput :domId="getId('autosave-count')" label="Autosaves to keep" :precision="0"
112
+ :minValue="autosaveLimits.minCount" :maxValue="autosaveLimits.maxCount"
113
+ :initialValue="preferences.autosaveCount" :changeCb="updateAutosaveCount" />
114
+ </div>
115
+ </div>
94
116
  </dialogContainer>
95
117
  </template>
@@ -62,9 +62,9 @@ const orientationOptions: SelectOption[] = [
62
62
  </div>
63
63
  <div class="group">
64
64
  <div class="grow-row">
65
- <numberInputApp :domId="getId('x-offset')" :initialValue="xOffset" :precision="0" label="X Offset"
65
+ <numberInputApp :domId="getId('x-offset')" :initialValue="xOffset" :precision="0" :minValue="-1000" :maxValue="1000" label="X Offset"
66
66
  :changeCb="(value: number) => updateNumberCb('xOffset', value)" :inline="true" />
67
- <numberInputApp :domId="getId('y-offset')" :initialValue="yOffset" :precision="0" label="Y Offset"
67
+ <numberInputApp :domId="getId('y-offset')" :initialValue="yOffset" :precision="0" :minValue="-1000" :maxValue="1000" label="Y Offset"
68
68
  :changeCb="(value: number) => updateNumberCb('yOffset', value)" :inline="true" />
69
69
  </div>
70
70
  </div>
@@ -96,17 +96,17 @@ const orientationOptions: SelectOption[] = [
96
96
  </div>
97
97
  <div class="group">
98
98
  <div class="grow-row">
99
- <numberInputApp :domId="getId('cp1x')" :initialValue="cp1x" :precision="0" label="Control Point 1 X"
99
+ <numberInputApp :domId="getId('cp1x')" :initialValue="cp1x" :precision="0" :minValue="-1000" :maxValue="1000" label="Control Point 1 X"
100
100
  :changeCb="(value: number) => updateNumberCb('cp1x', value)" :inline="true" />
101
- <numberInputApp :domId="getId('cp1y')" :initialValue="cp1y" :precision="0" label="Control Point 1 Y"
101
+ <numberInputApp :domId="getId('cp1y')" :initialValue="cp1y" :precision="0" :minValue="-1000" :maxValue="1000" label="Control Point 1 Y"
102
102
  :changeCb="(value: number) => updateNumberCb('cp1y', value)" :inline="true" />
103
103
  </div>
104
104
  </div>
105
105
  <div class="group">
106
106
  <div class="grow-row">
107
- <numberInputApp :domId="getId('cp2x')" :initialValue="cp2x" :precision="0" label="Control Point 2 X"
107
+ <numberInputApp :domId="getId('cp2x')" :initialValue="cp2x" :precision="0" :minValue="-1000" :maxValue="1000" label="Control Point 2 X"
108
108
  :changeCb="(value: number) => updateNumberCb('cp2x', value)" :inline="true" />
109
- <numberInputApp :domId="getId('cp2y')" :initialValue="cp2y" :precision="0" label="Control Point 2 Y"
109
+ <numberInputApp :domId="getId('cp2y')" :initialValue="cp2y" :precision="0" :minValue="-1000" :maxValue="1000" label="Control Point 2 Y"
110
110
  :changeCb="(value: number) => updateNumberCb('cp2y', value)" :inline="true" />
111
111
  </div>
112
112
  </div>
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ import { ref, Ref } from 'vue';
2
3
  import numberInputApp from './numberInput.vue';
3
4
  import selectComp from './select.vue';
4
5
  import toggle from './toggle.vue';
@@ -30,6 +31,13 @@ const { domId, label, commitCb, cancelCb } = { ...props };
30
31
  const getId = (str: string) => {
31
32
  return `${domId}-${str}`;
32
33
  }
34
+ // The dialog is mounted with the values as they were when it opened, and the props don't change
35
+ // as the user edits. Keep the mode locally so the custom text field appears as soon as it is chosen.
36
+ const currentMode: Ref<string> = ref(props.tempoMode);
37
+ const changeMode = (value: string) => {
38
+ currentMode.value = value;
39
+ props.updateSelectCb('tempoMode', value);
40
+ }
33
41
  const tempoModeOptions: SelectOption[] = [
34
42
  { value: 'duration', label: 'Duration (Beats/Minute)' },
35
43
  { value: 'text', label: 'Tempo Text' },
@@ -66,10 +74,10 @@ const tempoTextOptions: SelectOption[] = [
66
74
  <div class="row mb-2">
67
75
  <div class="col col-12">
68
76
  <selectComp :domId="getId('tempo-mode')" :label="'Tempo Mode'" :selections="tempoModeOptions"
69
- :initialValue="tempoMode" :changeCb="(value: string) => updateSelectCb('tempoMode', value)" />
77
+ :initialValue="currentMode" :changeCb="changeMode" />
70
78
  </div>
71
79
  </div>
72
- <div v-if="tempoMode === 'custom'" class="row mb-2">
80
+ <div v-if="currentMode === 'custom'" class="row mb-2">
73
81
  <div class="col col-9">
74
82
  <input type="text" class="form-control" :id="getId('custom-text')" :value="customText"
75
83
  @change="($event) => updateTextCb(($event.target as HTMLInputElement).value)">
@@ -112,7 +120,7 @@ const tempoTextOptions: SelectOption[] = [
112
120
  </div>
113
121
  <div class="group">
114
122
  <div class="grow-row">
115
- <numberInputApp :domId="getId('y-offset')" :initialValue="yOffset" :precision="0" label="Y Offset"
123
+ <numberInputApp :domId="getId('y-offset')" :initialValue="yOffset" :precision="0" :minValue="-1000" :maxValue="1000" label="Y Offset"
116
124
  :changeCb="(value: number) => updateNumberCb('yOffset', value)" :inline="true" />
117
125
  </div>
118
126
  </div>
@@ -15,16 +15,22 @@ interface Props {
15
15
  timeSignature: Ref<SmoTimeSignature>,
16
16
  updateTimeSignatureCb: (mf: SmoTimeSignature) => Promise<void>,
17
17
  updateApplyTo: (value: string) => Promise<void>,
18
+ updatePreserve: (value: boolean) => Promise<void>,
18
19
  commitCb: () => Promise<void>,
19
20
  cancelCb: () => Promise<void>
20
21
  }
21
22
  const props = defineProps<Props>();
22
23
  const { domId, label, commitCb, cancelCb, } = { ...props };
23
24
 
25
+ // None of the fields change the score. The dialog applies them all when OK is clicked.
24
26
  const timeSignature = props.timeSignature;
25
- watch(timeSignature, () => {
26
- console.log('changed!');
27
- })
27
+ const preserveMusic: Ref<boolean> = ref(true);
28
+ watch(preserveMusic, async (newValue: boolean, oldValue: boolean) => {
29
+ if (newValue === oldValue) {
30
+ return;
31
+ }
32
+ await props.updatePreserve(newValue);
33
+ });
28
34
  const isCompound: Ref<boolean> = ref(false);
29
35
  isCompound.value = timeSignature.value.times.length > 1;
30
36
  watch(isCompound, async (newValue, oldValue) => {
@@ -78,6 +84,11 @@ watch(displayString, async (newValue: string, oldValue: string) => {
78
84
  if (newValue === oldValue) {
79
85
  return;
80
86
  }
87
+ // The string is changed one key at a time. Wait until it is a valid time signature (or empty,
88
+ // to remove it) before updating the score.
89
+ if (newValue.length > 0 && !SmoTimeSignature.isValidDisplayString(newValue)) {
90
+ return;
91
+ }
81
92
  const ts = new SmoTimeSignature(timeSignature.value);
82
93
  ts.displayString = newValue;
83
94
  await props.updateTimeSignatureCb(ts);
@@ -130,6 +141,10 @@ const getId = (str: string) => {
130
141
  <toggle :domId="getId('display-compound')" :label="'Compound Time Signature'" :initialValue="isCompound"
131
142
  :changeCb="(value: boolean) => { isCompound = value }" />
132
143
  </div>
144
+ <div class="tgl-row">
145
+ <toggle :domId="getId('preserve-music')" :label="'Preserve music'" :initialValue="preserveMusic"
146
+ :changeCb="(value: boolean) => { preserveMusic = value }" />
147
+ </div>
133
148
  </div>
134
149
  <div class="row justify-content-center">
135
150
  <div class="col col-2" v-for="(time, index) in timeSignature.times">
@@ -29,15 +29,15 @@ const getId = (str: string) => {
29
29
  <div class="grow-row">
30
30
  <numberInputApp :domId="getId('number')" :initialValue="number" :precision="0" label="number"
31
31
  :changeCb="(value: number) => updateFieldCb('number', value)" :inline="true" />
32
- <numberInputApp :domId="getId('x1-offset')" :initialValue="xOffsetStart" :precision="0" label="X1 Offset"
32
+ <numberInputApp :domId="getId('x1-offset')" :initialValue="xOffsetStart" :precision="0" :minValue="-1000" :maxValue="1000" label="X1 Offset"
33
33
  :changeCb="(value: number) => updateFieldCb('xOffsetStart', value)" :inline="true" />
34
34
  </div>
35
35
  </div>
36
36
  <div class="group">
37
37
  <div class="grow-row">
38
- <numberInputApp :domId="getId('x2-offset')" :initialValue="xOffsetEnd" :precision="0" label="X2 Offset"
38
+ <numberInputApp :domId="getId('x2-offset')" :initialValue="xOffsetEnd" :precision="0" :minValue="-1000" :maxValue="1000" label="X2 Offset"
39
39
  :changeCb="(value: number) => updateFieldCb('xOffsetEnd', value)" :inline="true" />
40
- <numberInputApp :domId="getId('y-offset')" :initialValue="yOffset" :precision="0" label="Y Offset"
40
+ <numberInputApp :domId="getId('y-offset')" :initialValue="yOffset" :precision="0" :minValue="-1000" :maxValue="1000" label="Y Offset"
41
41
  :changeCb="(value: number) => updateFieldCb('yOffset', value)" :inline="true" />
42
42
  </div>
43
43
  </div>
@@ -9,7 +9,7 @@ import { replaceVueRoot, modalContainerId } from '../common';
9
9
  * Vue-based dialog for note text annotations (SmoLyric, parser 'annotation').
10
10
  * Structurally modeled on SuiLyricDialogVue (src/ui/dialogs/lyricVue.ts), minus
11
11
  * note-to-note navigation, plus multi-selection propagation modeled on
12
- * SuiDynamicDialogAdapter's syncModifiers (src/ui/dialogs/dynamics.ts).
12
+ * the way SuiDynamicModifierDialogVue does it (src/ui/dialogs/dynamicsVue.ts).
13
13
  * See specs/017-text-annotations.
14
14
  */
15
15
  export const SuiAnnotationDialogVue = (parameters: SuiDialogParams) => {
@@ -0,0 +1,69 @@
1
+ // [Smoosic](https://github.com/AaronDavidNewman/Smoosic)
2
+ // Copyright (c) Aaron David Newman 2026.
3
+ import { SuiDialogParams, InstallDialog } from './dialog';
4
+ import { SmoSelection } from '../../smo/xform/selections';
5
+ import { SuiScoreViewOperations } from '../../render/sui/scoreViewOperations';
6
+ import beamGroupsComp from '../components/dialogs/beamGroups.vue';
7
+ import { replaceVueRoot, modalContainerId } from '../common';
8
+
9
+ /**
10
+ * Collects the beam grouping and where to apply it, then applies it to the score.
11
+ * @category SuiDialog
12
+ */
13
+ export class SuiBeamGroupsAdapter {
14
+ view: SuiScoreViewOperations;
15
+ /** the grouping set in the dialog; empty means the default for the meter */
16
+ groups: number[];
17
+ applyTo: 'selections' | 'all' = 'selections';
18
+ constructor(view: SuiScoreViewOperations, groups: number[]) {
19
+ this.view = view;
20
+ this.groups = groups;
21
+ }
22
+ async commit() {
23
+ await this.view.setBeamGroups(this.groups, this.applyTo);
24
+ }
25
+ async cancel() {
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Dialog for setting the beam grouping of measures, for compound or irregular meters.
31
+ * Follows the creation-function pattern of SuiKeySignatureDialogVue.
32
+ */
33
+ export const SuiBeamGroupsDialogVue = (parameters: SuiDialogParams) => {
34
+ const rootId = replaceVueRoot(modalContainerId);
35
+ const measures = SmoSelection.getMeasureList(parameters.view.tracker.selections);
36
+ const initial = measures.length > 0 ? measures[0].measure.getBeamGroups() : [];
37
+ const adapter = new SuiBeamGroupsAdapter(parameters.view, initial);
38
+
39
+ const setGroupsCb = (groups: number[]) => {
40
+ adapter.groups = groups;
41
+ };
42
+ const setApplyToCb = (value: string) => {
43
+ adapter.applyTo = value === 'all' ? 'all' : 'selections';
44
+ };
45
+ const commitCb = async () => {
46
+ await adapter.commit();
47
+ };
48
+ const cancelCb = async () => {
49
+ await adapter.cancel();
50
+ };
51
+
52
+ const appParams = {
53
+ domId: rootId,
54
+ label: 'Beam Groups',
55
+ initialGroups: initial,
56
+ applyTo: adapter.applyTo,
57
+ setGroupsCb,
58
+ setApplyToCb
59
+ };
60
+
61
+ InstallDialog({
62
+ root: rootId,
63
+ app: beamGroupsComp,
64
+ appParams,
65
+ dialogParams: parameters,
66
+ commitCb,
67
+ cancelCb
68
+ });
69
+ };
@@ -0,0 +1,68 @@
1
+ // [Smoosic](https://github.com/AaronDavidNewman/Smoosic)
2
+ // Copyright (c) Aaron David Newman 2026.
3
+ /**
4
+ * Small pieces of the Create Part dialog that need no Vue or DOM, so they can be tested.
5
+ * @module /ui/dialogs/createPartHelpers
6
+ */
7
+ import type { SelectOption } from '../common';
8
+
9
+ /**
10
+ * The instruments that can be chosen for a new part. The label is also the part's name if the
11
+ * user does not type one.
12
+ * @category SuiDialog
13
+ */
14
+ export const instrumentChoices: SelectOption[] = [
15
+ { value: 'piano', label: 'Grand Piano' },
16
+ { value: 'electricPiano', label: 'Electric Piano' },
17
+ { value: 'accordion', label: 'Accordion' },
18
+ { value: 'bass', label: 'Bass (bowed)' },
19
+ { value: 'jazzBass', label: 'Bass (plucked)' },
20
+ { value: 'eGuitar', label: 'Electric Guitar' },
21
+ { value: 'cello', label: 'Cello' },
22
+ { value: 'violin', label: 'Violin' },
23
+ { value: 'trumpet', label: 'Bb Trumpet' },
24
+ { value: 'horn', label: 'F Horn' },
25
+ { value: 'trombone', label: 'Trombone' },
26
+ { value: 'tuba', label: 'Tuba' },
27
+ { value: 'clarinet', label: 'Bb Clarinet' },
28
+ { value: 'flute', label: 'Flute' },
29
+ { value: 'altoSax', label: 'Eb Alto Sax' },
30
+ { value: 'tenorSax', label: 'Bb Tenor Sax' },
31
+ { value: 'bariSax', label: 'Eb Bari Sax' },
32
+ { value: 'pad', label: 'Synth Pad' },
33
+ { value: 'percussion', label: 'Percussion' },
34
+ { value: 'none', label: 'None' }
35
+ ];
36
+
37
+ /**
38
+ * @param value the instrument's value in the list
39
+ * @returns the instrument's display name, or the value itself if it is not in the list
40
+ */
41
+ export const instrumentLabelFor = (value: string): string => {
42
+ const choice = instrumentChoices.find((cc) => cc.value === value);
43
+ return choice ? choice.label : value;
44
+ }
45
+
46
+ /**
47
+ * Hold the Staff Location to the places a new part can go.
48
+ * @param value what the user entered
49
+ * @param staffCount the number of staves in the score now
50
+ * @returns a whole number from 1 to one more than the number of staves; the last of those if the value is not a number
51
+ */
52
+ export const clampPartLocation = (value: unknown, staffCount: number): number => {
53
+ const last = staffCount + 1;
54
+ if (typeof (value) !== 'number' || !Number.isFinite(value)) {
55
+ return last;
56
+ }
57
+ return Math.min(Math.max(Math.round(value), 1), last);
58
+ }
59
+
60
+ /**
61
+ * @param typed the name the user typed, possibly empty
62
+ * @param instrumentLabel the display name of the chosen instrument
63
+ * @returns the typed name without surrounding spaces, or the instrument's name if there is none
64
+ */
65
+ export const resolvePartName = (typed: string, instrumentLabel: string): string => {
66
+ const name = (typed ?? '').trim();
67
+ return name.length > 0 ? name : instrumentLabel;
68
+ }
@@ -0,0 +1,57 @@
1
+ // [Smoosic](https://github.com/AaronDavidNewman/Smoosic)
2
+ // Copyright (c) Aaron David Newman 2021.
3
+ import { SmoOperation, DeleteAttributeKind } from '../../smo/xform/operations';
4
+ import { replaceVueRoot, modalContainerId } from '../common';
5
+ import deleteSpecialApp from '../components/dialogs/deleteSpecial.vue';
6
+ import { reactive } from 'vue';
7
+ import { SuiDialogParams, InstallDialog } from './dialog';
8
+
9
+ /** The names of the kinds of marking in the dialog */
10
+ const deleteKindLabels: Record<DeleteAttributeKind, string> = {
11
+ dynamics: 'Dynamics',
12
+ lyrics: 'Lyrics',
13
+ annotations: 'Annotations',
14
+ chords: 'Chords',
15
+ articulations: 'Articulations',
16
+ ornaments: 'Ornaments',
17
+ graceNotes: 'Grace Notes',
18
+ arpeggios: 'Arpeggios',
19
+ microtones: 'Microtones'
20
+ };
21
+
22
+ /**
23
+ * Delete Special. Choose which kinds of marking attached to the selected notes (dynamics, lyrics,
24
+ * annotations, chords, articulations, ornaments, grace notes, arpeggios, microtones) to remove. The notes
25
+ * themselves are not changed.
26
+ * @category SuiDialog
27
+ */
28
+ export const SuiDeleteSpecialDialog = async (parameters: SuiDialogParams) => {
29
+ // nothing is chosen at first, so a delete is always a deliberate choice
30
+ const selected: Record<string, boolean> = reactive({});
31
+ SmoOperation.deleteAttributeKinds.forEach((kind) => {
32
+ selected[kind] = false;
33
+ });
34
+ const commitCb = async () => {
35
+ const kinds = SmoOperation.deleteAttributeKinds.filter((kind) => selected[kind]);
36
+ await parameters.view.deleteNoteAttributes(kinds);
37
+ }
38
+ const cancelCb = async () => {
39
+ }
40
+ const rootId = replaceVueRoot(modalContainerId);
41
+ const appParams = {
42
+ domId: rootId,
43
+ label: 'Delete Special',
44
+ kinds: SmoOperation.deleteAttributeKinds.map((kind) => ({ id: kind, label: deleteKindLabels[kind] })),
45
+ selected,
46
+ commitCb,
47
+ cancelCb
48
+ };
49
+ InstallDialog({
50
+ app: deleteSpecialApp,
51
+ appParams,
52
+ root: rootId,
53
+ dialogParams: parameters,
54
+ commitCb,
55
+ cancelCb
56
+ });
57
+ }
@@ -1,60 +1,87 @@
1
- // [Smoosic](https://github.com/AaronDavidNewman/Smoosic)
2
- // Copyright (c) Aaron David Newman 2026.
3
- import { SuiDialogParams, InstallDialog } from './dialog';
4
- import { SuiDynamicDialogAdapter } from './dynamics';
5
- import { getModifierDialogPosition } from './adapter';
6
- import dynamicsComp from '../components/dialogs/dynamics.vue';
7
- import { replaceVueRoot, modalContainerId } from '../common';
8
-
9
- /**
10
- * Vue-based replacement for SuiDynamicModifierDialog (src/ui/dialogs/dynamics.ts),
11
- * following the SuiTimeSignatureDialogVue creation-function pattern.
12
- * SuiDynamicDialogAdapter is reused unchanged; only the presentation layer is new.
13
- * `parameters.modifier` is always an already score-attached SmoDynamicText by the time
14
- * this runs — the menu handler in src/ui/menus/text.ts creates and adds a default
15
- * marking to every selected note before opening the dialog when none exists yet.
16
- */
17
- export const SuiDynamicModifierDialogVue = (parameters: SuiDialogParams) => {
18
- const rootId = replaceVueRoot(modalContainerId);
19
- const view = parameters.view;
20
- view.groupUndo(true);
21
- const adapter = new SuiDynamicDialogAdapter(view, parameters.modifier);
22
-
23
- const updateNumberCb = (param: 'yOffsetLine' | 'yOffsetPixels' | 'xOffset', value: number) => {
24
- adapter[param] = value;
25
- };
26
- const updateTextCb = (value: string) => {
27
- adapter.text = value;
28
- };
29
- const commitCb = async () => {
30
- await adapter.commit();
31
- };
32
- const cancelCb = async () => {
33
- await adapter.cancel();
34
- };
35
- const removeCb = async () => {
36
- await adapter.remove();
37
- };
38
-
39
- const appParams = {
40
- domId: rootId,
41
- label: 'Dynamics Properties',
42
- initialPosition: getModifierDialogPosition(view, parameters.modifier),
43
- yOffsetLine: adapter.yOffsetLine,
44
- yOffsetPixels: adapter.yOffsetPixels,
45
- xOffset: adapter.xOffset,
46
- text: adapter.text,
47
- updateNumberCb,
48
- updateTextCb
49
- };
50
-
51
- InstallDialog({
52
- root: rootId,
53
- app: dynamicsComp,
54
- appParams,
55
- dialogParams: parameters,
56
- commitCb,
57
- cancelCb,
58
- removeCb
59
- });
60
- };
1
+ // [Smoosic](https://github.com/AaronDavidNewman/Smoosic)
2
+ // Copyright (c) Aaron David Newman 2026.
3
+ import { SuiDialogParams, InstallDialog } from './dialog';
4
+ import { getModifierDialogPosition } from './adapter';
5
+ import { SmoDynamicText } from '../../smo/data/noteModifiers';
6
+ import { SmoSelection } from '../../smo/xform/selections';
7
+ import dynamicsComp from '../components/dialogs/dynamics.vue';
8
+ import { replaceVueRoot, modalContainerId } from '../common';
9
+
10
+ /**
11
+ * Vue-based dialog for the dynamic marking (p, mf, ff...) of the selected notes, following the
12
+ * SuiTimeSignatureDialogVue creation-function pattern. The dialog's state is kept in local variables and
13
+ * each edit is applied to the score as it is made, so there is no separate adapter object.
14
+ * `parameters.modifier` is always an already score-attached SmoDynamicText by the time
15
+ * this runs — the menu handler in src/ui/menus/text.ts creates and adds a default
16
+ * marking to every selected note before opening the dialog when none exists yet.
17
+ */
18
+ export const SuiDynamicModifierDialogVue = (parameters: SuiDialogParams) => {
19
+ const rootId = replaceVueRoot(modalContainerId);
20
+ const view = parameters.view;
21
+ const modifier = parameters.modifier as SmoDynamicText;
22
+ // All the edits made in this dialog are one undo step, and Cancel undoes them.
23
+ view.groupUndo(true);
24
+ view.undoTrackerMeasureSelections('Dynamics');
25
+ // Edit the notes of a selected marking, if a marking itself is selected on the score, otherwise the
26
+ // selected notes.
27
+ let selections: SmoSelection[] = [];
28
+ if (view.tracker.modifierSelections.length) {
29
+ view.tracker.modifierSelections.forEach((ms) => {
30
+ if (ms.selection) {
31
+ selections.push(ms.selection);
32
+ }
33
+ });
34
+ } else {
35
+ selections = view.tracker.selections;
36
+ }
37
+
38
+ /** put the marking, as it is now, on every note being edited */
39
+ const syncModifiers = () => {
40
+ selections.forEach((selection) => {
41
+ view.addDynamic(selection, modifier);
42
+ });
43
+ };
44
+ const updateNumberCb = async (param: 'yOffsetLine' | 'yOffsetPixels' | 'xOffset' | 'fontSize', value: number) => {
45
+ // A size that cannot be used is ignored; the marking keeps its last good size
46
+ if (param === 'fontSize' && !SmoDynamicText.isValidFontSize(value)) {
47
+ return;
48
+ }
49
+ modifier[param] = value;
50
+ syncModifiers();
51
+ };
52
+ const updateTextCb = (value: string) => {
53
+ modifier.text = value;
54
+ syncModifiers();
55
+ };
56
+ const commitCb = async () => {
57
+ };
58
+ const cancelCb = async () => {
59
+ await view.undo();
60
+ };
61
+ const removeCb = async () => {
62
+ await view.removeDynamic(modifier);
63
+ };
64
+
65
+ const appParams = {
66
+ domId: rootId,
67
+ label: 'Dynamics Properties',
68
+ initialPosition: getModifierDialogPosition(view, parameters.modifier),
69
+ yOffsetLine: modifier.yOffsetLine,
70
+ yOffsetPixels: modifier.yOffsetPixels,
71
+ xOffset: modifier.xOffset,
72
+ fontSize: modifier.fontSize,
73
+ text: modifier.text,
74
+ updateNumberCb,
75
+ updateTextCb
76
+ };
77
+
78
+ InstallDialog({
79
+ root: rootId,
80
+ app: dynamicsComp,
81
+ appParams,
82
+ dialogParams: parameters,
83
+ commitCb,
84
+ cancelCb,
85
+ removeCb
86
+ });
87
+ };
@@ -9,7 +9,6 @@ import { SuiVoltaAttributeDialog } from './volta';
9
9
  import { SuiLyricDialogVue } from './lyricVue';
10
10
  import { SuiChordChangeDialogVue } from './chordChangeVue';
11
11
  import { SuiTieAttributesDialog } from './tie';
12
- import { SuiDynamicModifierDialog } from './dynamics';
13
12
  import { SuiDialogNotifier, SmoDynamicComponentCtor, SuiBaseComponentParams } from './components/baseComponent';
14
13
  import { SuiButtonComponent, SuiButtonComposite, SuiButtonCompositeParams, SuiButtonComponentParams } from './components/button';
15
14
  import { CheckboxDropdownComponent, CheckboxDropdownComponentParams } from './components/checkdrop';
@@ -147,7 +146,6 @@ export const initDialogTranslationElements = () => {
147
146
  DialogTranslations.push(suiDialogTranslate(SuiPedalMarkingDialog.dialogElements, 'SuiPedalMarkingDialog'));
148
147
  DialogTranslations.push(suiDialogTranslate(SuiTieAttributesDialog.dialogElements, 'SuiTieAttributesDialog'));
149
148
  DialogTranslations.push(suiDialogTranslate(SuiSlurAttributesDialog.dialogElements, 'SuiSlurAttributesDialog'));
150
- DialogTranslations.push(suiDialogTranslate(SuiDynamicModifierDialog.dialogElements, 'SuiDynamicModifierDialog'));
151
149
  DialogTranslations.push(suiDialogTranslate(SuiVoltaAttributeDialog.dialogElements, 'SuiVoltaAttributeDialog'));
152
150
  }
153
151
  export const initDialogConstructors = () => {