@dsebastien/music-notation 0.13.0 → 0.14.0
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/README.md +2 -2
- package/dist/index.js +661 -431
- package/dist/index.js.map +9 -7
- package/dist/music-notation.css +93 -50
- package/dist/music-notation.publish.min.js +120 -77
- package/dist/music-notation.tab.min.js +94 -51
- package/dist/playback/bar-parts.d.ts +46 -0
- package/dist/playback/block-bar.d.ts +80 -0
- package/dist/playback/controls.d.ts +32 -9
- package/dist/playback/progression-bar.d.ts +3 -2
- package/dist/playback/strum-bar.d.ts +4 -4
- package/dist/publish/index.js +568 -381
- package/dist/publish/index.js.map +9 -7
- package/dist/render/dom.d.ts +2 -0
- package/dist/tab/index.js +2 -1
- package/dist/tab/index.js.map +3 -3
- package/dist/voicings/index.js +2 -1
- package/dist/voicings/index.js.map +3 -3
- package/package.json +1 -1
package/dist/music-notation.css
CHANGED
|
@@ -84,14 +84,38 @@
|
|
|
84
84
|
stroke-width: 2;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/* Playback: a
|
|
88
|
-
|
|
87
|
+
/* Playback (#58): a playable diagram is a button (a click plays it); one bar below the block
|
|
88
|
+
plays its diagrams. Host styles (Obsidian's buttons, selects and sliders) are reset inside the
|
|
89
|
+
bars. */
|
|
89
90
|
.mn-playable {
|
|
90
91
|
position: relative;
|
|
91
92
|
display: inline-block;
|
|
93
|
+
/* No line-box gap under the drawing, before the bar. */
|
|
94
|
+
vertical-align: top;
|
|
92
95
|
max-width: 100%;
|
|
96
|
+
border-radius: 6px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* The selected diagram of a row (the one the bar plays and names) and the focused one: outlines
|
|
100
|
+
drawn inside the edge (the block's scroll box, overflow-x, never cuts them) and over the
|
|
101
|
+
drawing (keys and chips reach the edge), kept in forced-colors mode. */
|
|
102
|
+
.mn-playable.mn-selected {
|
|
103
|
+
outline: 2px solid color-mix(in srgb, var(--mn-accent) 45%, transparent);
|
|
104
|
+
outline-offset: -2px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.mn-playable:focus-visible {
|
|
108
|
+
outline: 2px solid var(--mn-accent);
|
|
109
|
+
outline-offset: -2px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* A mouse click focuses the diagram too: only the selection shows then. */
|
|
113
|
+
.mn-playable:focus:not(:focus-visible):not(.mn-selected) {
|
|
114
|
+
outline: none;
|
|
93
115
|
}
|
|
94
116
|
|
|
117
|
+
/* The tab and score bar (#82 gives it the block bar's look): a strip at the bottom of the score,
|
|
118
|
+
shown on hover, keyboard focus or a tap. */
|
|
95
119
|
.mn-play {
|
|
96
120
|
position: absolute;
|
|
97
121
|
left: 2px;
|
|
@@ -114,13 +138,6 @@
|
|
|
114
138
|
transition: opacity 120ms ease;
|
|
115
139
|
}
|
|
116
140
|
|
|
117
|
-
.mn-playable:hover .mn-play,
|
|
118
|
-
.mn-playable:focus-within .mn-play,
|
|
119
|
-
.mn-playable.mn-play-open .mn-play {
|
|
120
|
-
opacity: 1;
|
|
121
|
-
pointer-events: auto;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
141
|
.mn-play button,
|
|
125
142
|
.mn-play select {
|
|
126
143
|
all: unset;
|
|
@@ -134,6 +151,22 @@
|
|
|
134
151
|
font-size: 10px;
|
|
135
152
|
color: inherit;
|
|
136
153
|
border-radius: 4px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/* The hand on everything that plays or sets something (#81), with a class in every selector so it
|
|
157
|
+
outranks host element rules such as Obsidian's `button { cursor: var(--cursor) }`, and again
|
|
158
|
+
under `.mn-block` for hosts with class rules; no !important. Without playback there is no
|
|
159
|
+
.mn-playable: diagrams and notes keep the arrow. */
|
|
160
|
+
.mn-playable,
|
|
161
|
+
.mn-playable *,
|
|
162
|
+
.mn-play button,
|
|
163
|
+
.mn-play select,
|
|
164
|
+
.mn-play input[type='range'],
|
|
165
|
+
.mn-block .mn-playable,
|
|
166
|
+
.mn-block .mn-playable *,
|
|
167
|
+
.mn-block .mn-play button,
|
|
168
|
+
.mn-block .mn-play select,
|
|
169
|
+
.mn-block .mn-play input[type='range'] {
|
|
137
170
|
cursor: pointer;
|
|
138
171
|
}
|
|
139
172
|
|
|
@@ -162,7 +195,7 @@
|
|
|
162
195
|
}
|
|
163
196
|
|
|
164
197
|
.mn-play-icon-loop,
|
|
165
|
-
.mn-play-icon-
|
|
198
|
+
.mn-play-icon-line {
|
|
166
199
|
fill: none;
|
|
167
200
|
stroke: currentColor;
|
|
168
201
|
stroke-width: 1.6;
|
|
@@ -176,11 +209,34 @@
|
|
|
176
209
|
gap: 2px;
|
|
177
210
|
}
|
|
178
211
|
|
|
212
|
+
.mn-play-field[hidden] {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* The tab bar's glyph before a slider. */
|
|
179
217
|
.mn-play-label {
|
|
180
218
|
display: inline-flex;
|
|
181
219
|
opacity: 0.8;
|
|
182
220
|
}
|
|
183
221
|
|
|
222
|
+
/* A slider's value after it ("90 BPM", "12 ms"), in digits of one width so the bar doesn't move
|
|
223
|
+
while it changes. */
|
|
224
|
+
.mn-play-value {
|
|
225
|
+
min-width: 7ch;
|
|
226
|
+
font-variant-numeric: tabular-nums;
|
|
227
|
+
white-space: nowrap;
|
|
228
|
+
opacity: 0.85;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* The selected diagram's name on the bar of a row. */
|
|
232
|
+
.mn-play-name {
|
|
233
|
+
max-width: 16ch;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
text-overflow: ellipsis;
|
|
236
|
+
white-space: nowrap;
|
|
237
|
+
font-weight: 600;
|
|
238
|
+
}
|
|
239
|
+
|
|
184
240
|
.mn-play input[type='range'] {
|
|
185
241
|
all: unset;
|
|
186
242
|
appearance: none;
|
|
@@ -190,7 +246,6 @@
|
|
|
190
246
|
height: 9px;
|
|
191
247
|
margin: 0;
|
|
192
248
|
background: linear-gradient(var(--mn-faint), var(--mn-faint)) center / 100% 3px no-repeat;
|
|
193
|
-
cursor: pointer;
|
|
194
249
|
}
|
|
195
250
|
|
|
196
251
|
.mn-play input[type='range']::-webkit-slider-runnable-track {
|
|
@@ -233,11 +288,6 @@
|
|
|
233
288
|
background: var(--mn-accent);
|
|
234
289
|
}
|
|
235
290
|
|
|
236
|
-
.mn-playable [data-midi],
|
|
237
|
-
.mn-playable .mn-hit {
|
|
238
|
-
cursor: pointer;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
291
|
/* A playable mark's hit area: invisible, but it takes clicks and taps (an open string's circle is
|
|
242
292
|
only a ring), centered on the mark. */
|
|
243
293
|
.mn-svg .mn-hit {
|
|
@@ -251,30 +301,6 @@
|
|
|
251
301
|
pointer-events: none;
|
|
252
302
|
}
|
|
253
303
|
|
|
254
|
-
/* The bar's empty space lets clicks through to the dots under it; its controls take them. */
|
|
255
|
-
.mn-playable:hover .mn-play,
|
|
256
|
-
.mn-playable:focus-within .mn-play,
|
|
257
|
-
.mn-playable.mn-play-open .mn-play {
|
|
258
|
-
pointer-events: none;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
.mn-playable:hover .mn-play > *,
|
|
262
|
-
.mn-playable:focus-within .mn-play > *,
|
|
263
|
-
.mn-playable.mn-play-open .mn-play > * {
|
|
264
|
-
pointer-events: auto;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
/* Touch screens: hover sticks after a tap, so only a tap opens the bar. */
|
|
268
|
-
@media (hover: none) {
|
|
269
|
-
.mn-playable:hover:not(.mn-play-open) .mn-play {
|
|
270
|
-
opacity: 0;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.mn-playable:hover:not(.mn-play-open) .mn-play > * {
|
|
274
|
-
pointer-events: none;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
304
|
/* Tabs and scores: the player bar stays at the bottom of the screen while the score scrolls. */
|
|
279
305
|
.mn-tab {
|
|
280
306
|
position: relative;
|
|
@@ -818,12 +844,12 @@
|
|
|
818
844
|
|
|
819
845
|
/* Following a strumming pattern: the slot that plays gets a band and its strum the playing
|
|
820
846
|
color (the band keeps it visible for a muted strum and in any theme). */
|
|
821
|
-
.mn-
|
|
847
|
+
.mn-timed .mn-svg .mn-strum-slot.mn-playing .mn-strum-cell {
|
|
822
848
|
fill: color-mix(in srgb, var(--mn-playing) 35%, transparent);
|
|
823
849
|
}
|
|
824
850
|
|
|
825
|
-
.mn-
|
|
826
|
-
.mn-
|
|
851
|
+
.mn-timed .mn-svg .mn-strum-slot.mn-playing .mn-strum-arrow,
|
|
852
|
+
.mn-timed .mn-svg .mn-strum-slot.mn-playing .mn-strum-mute {
|
|
827
853
|
stroke: var(--mn-fg);
|
|
828
854
|
stroke-width: 3;
|
|
829
855
|
}
|
|
@@ -1017,16 +1043,33 @@
|
|
|
1017
1043
|
white-space: pre-wrap;
|
|
1018
1044
|
}
|
|
1019
1045
|
|
|
1020
|
-
/*
|
|
1046
|
+
/* Every bar but the tab bar (#58): below what it plays, in the flow, always shown, at the left
|
|
1047
|
+
of the block even when a wide row scrolls. */
|
|
1021
1048
|
.mn-play.mn-play-static {
|
|
1022
|
-
position:
|
|
1023
|
-
|
|
1049
|
+
position: sticky;
|
|
1050
|
+
left: 0;
|
|
1051
|
+
right: auto;
|
|
1052
|
+
bottom: auto;
|
|
1053
|
+
display: flex;
|
|
1054
|
+
width: fit-content;
|
|
1055
|
+
max-width: 100%;
|
|
1056
|
+
box-sizing: border-box;
|
|
1024
1057
|
justify-content: flex-start;
|
|
1025
|
-
|
|
1058
|
+
gap: 4px 8px;
|
|
1059
|
+
margin: 6px 0 0;
|
|
1060
|
+
padding: 3px 6px;
|
|
1061
|
+
font-size: 11px;
|
|
1026
1062
|
opacity: 1;
|
|
1027
1063
|
pointer-events: auto;
|
|
1028
1064
|
}
|
|
1029
1065
|
|
|
1066
|
+
.mn-timed {
|
|
1067
|
+
display: inline-flex;
|
|
1068
|
+
flex-direction: column;
|
|
1069
|
+
align-items: flex-start;
|
|
1070
|
+
max-width: 100%;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1030
1073
|
.mn-progression-chord.mn-playing {
|
|
1031
1074
|
border-radius: 6px;
|
|
1032
1075
|
background: color-mix(in srgb, var(--mn-playing) 22%, transparent);
|
|
@@ -1075,15 +1118,15 @@
|
|
|
1075
1118
|
stroke: none;
|
|
1076
1119
|
}
|
|
1077
1120
|
|
|
1078
|
-
.mn-
|
|
1121
|
+
.mn-timed .mn-svg .mn-picking-slot.mn-playing .mn-picking-cell {
|
|
1079
1122
|
fill: color-mix(in srgb, var(--mn-playing) 35%, transparent);
|
|
1080
1123
|
}
|
|
1081
1124
|
|
|
1082
|
-
.mn-
|
|
1125
|
+
.mn-timed .mn-svg .mn-picking-slot.mn-playing .mn-picking-gap {
|
|
1083
1126
|
fill: var(--mn-playing);
|
|
1084
1127
|
}
|
|
1085
1128
|
|
|
1086
|
-
.mn-
|
|
1129
|
+
.mn-timed .mn-svg .mn-picking-slot.mn-playing .mn-picking-fret {
|
|
1087
1130
|
fill: var(--mn-on-playing);
|
|
1088
1131
|
}
|
|
1089
1132
|
|