@hussmartinez/audio-sdk 0.5.0 → 0.7.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 +105 -22
- package/dist/assets/audio/audio.worker.js +1 -1
- package/dist/element.d.ts +1010 -1
- package/dist/element.js +121 -0
- package/dist/element.js.map +1 -0
- package/dist/index.d.ts +761 -149
- package/dist/index.js +321 -1782
- package/dist/index.js.map +1 -1
- package/dist/lazy/inline-worker-CVcXmYih.js +30 -0
- package/dist/lazy/{inline-worker-CR5UIkzK.js.map → inline-worker-CVcXmYih.js.map} +1 -1
- package/dist/react.d.ts +1957 -3
- package/dist/react.js +1 -0
- package/dist/shared/AudioEditor-C9yohR_Z.js +2801 -0
- package/dist/shared/AudioEditor-C9yohR_Z.js.map +1 -0
- package/dist/shared/text-CgDrmmTa.js +2663 -0
- package/dist/shared/text-CgDrmmTa.js.map +1 -0
- package/dist/styles.css +329 -0
- package/formats/hm-audio-command/v2.schema.json +381 -0
- package/formats/hm-audio-plan/v2.schema.json +226 -0
- package/package.json +10 -6
- package/dist/lazy/inline-worker-CR5UIkzK.js +0 -30
package/dist/styles.css
CHANGED
|
@@ -7,3 +7,332 @@
|
|
|
7
7
|
* host's unlayered CSS beats every hm layer without !important (ADR 0005).
|
|
8
8
|
*/
|
|
9
9
|
@layer hm.tokens, hm.base, hm.components, hm.sdk;
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* The editor (docs/adr/0005). Layout rules apply unless the root has
|
|
13
|
+
* data-hm-unstyled, and every value comes from ui's tokens, so themes and
|
|
14
|
+
* densities apply. Its text takes ui's type and colour from the root's
|
|
15
|
+
* hm-text class.
|
|
16
|
+
*/
|
|
17
|
+
@layer hm.sdk {
|
|
18
|
+
/* The element is a block the host sizes; the editor fills it. */
|
|
19
|
+
hm-audio-editor {
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.hm-audio-editor {
|
|
24
|
+
container-type: inline-size;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.hm-audio-editor:not([data-hm-unstyled]) {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--hm-gap-normal);
|
|
31
|
+
min-block-size: 0;
|
|
32
|
+
padding: var(--hm-gap-normal);
|
|
33
|
+
background: var(--hm-color-bg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-notices ul {
|
|
37
|
+
display: grid;
|
|
38
|
+
gap: var(--hm-gap-tight);
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
list-style: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-notices li {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: var(--hm-gap-tight);
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
padding: var(--hm-gap-tight) var(--hm-gap-normal);
|
|
50
|
+
border: var(--hm-border-width) solid var(--hm-color-warning);
|
|
51
|
+
border-radius: var(--hm-radius-surface);
|
|
52
|
+
background: var(--hm-color-warning-subtle);
|
|
53
|
+
color: var(--hm-color-warning-text);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-notices p {
|
|
57
|
+
margin: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* The stage and transport, then the inspector: side by side where the
|
|
62
|
+
* editor leaves the timeline its full layout, 720px, beside the
|
|
63
|
+
* inspector, and the inspector below them otherwise.
|
|
64
|
+
*/
|
|
65
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-main {
|
|
66
|
+
flex: 1 1 auto;
|
|
67
|
+
display: grid;
|
|
68
|
+
grid-template-columns: minmax(0, 1fr);
|
|
69
|
+
gap: var(--hm-gap-normal);
|
|
70
|
+
min-block-size: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-work {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: var(--hm-gap-normal);
|
|
77
|
+
min-block-size: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@container (inline-size >= 1080px) {
|
|
81
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-main {
|
|
82
|
+
grid-template-columns: minmax(0, 1fr) calc(var(--hm-space-12) * 3);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-inspector {
|
|
87
|
+
display: flex;
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: var(--hm-gap-normal);
|
|
90
|
+
align-self: start;
|
|
91
|
+
min-inline-size: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-inspector-title {
|
|
95
|
+
margin: 0;
|
|
96
|
+
font-weight: var(--hm-font-weight-strong);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-inspector-gain,
|
|
100
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-inspector-fade {
|
|
101
|
+
display: grid;
|
|
102
|
+
gap: var(--hm-gap-tight);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-facts {
|
|
106
|
+
display: grid;
|
|
107
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
108
|
+
gap: var(--hm-gap-tight) var(--hm-gap-normal);
|
|
109
|
+
margin: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-facts dd {
|
|
113
|
+
margin: 0;
|
|
114
|
+
font-variant-numeric: tabular-nums;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-stage {
|
|
118
|
+
flex: 1 1 auto;
|
|
119
|
+
display: grid;
|
|
120
|
+
gap: var(--hm-gap-normal);
|
|
121
|
+
align-content: start;
|
|
122
|
+
min-block-size: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-stage[data-hm-empty] {
|
|
126
|
+
align-content: stretch;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-progress {
|
|
130
|
+
display: flex;
|
|
131
|
+
gap: var(--hm-gap-normal);
|
|
132
|
+
align-items: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-progress > :first-child {
|
|
136
|
+
flex: 1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-error {
|
|
140
|
+
margin: 0;
|
|
141
|
+
padding: var(--hm-gap-tight) var(--hm-gap-normal);
|
|
142
|
+
border-radius: var(--hm-radius-surface);
|
|
143
|
+
background: var(--hm-color-danger-subtle);
|
|
144
|
+
color: var(--hm-color-danger-text);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-summary {
|
|
148
|
+
margin: 0;
|
|
149
|
+
color: var(--hm-color-text-muted);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/*
|
|
153
|
+
* A clip lets its track's waveform and selected range show through it:
|
|
154
|
+
* its outline, and the accent one when it's selected, mark where it is.
|
|
155
|
+
*/
|
|
156
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-timeline {
|
|
157
|
+
--hm-timeline-clip-bg: transparent;
|
|
158
|
+
--hm-timeline-clip-selected-bg: transparent;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* Its title keeps ui's clip background, so the text never sits on the waveform. */
|
|
162
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-clip-title {
|
|
163
|
+
background: var(--hm-color-control);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.hm-audio-editor:not([data-hm-unstyled]) [aria-selected="true"] > .hm-audio-editor-clip-title {
|
|
167
|
+
background: var(--hm-color-accent-subtle);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-timeline {
|
|
171
|
+
display: grid;
|
|
172
|
+
gap: var(--hm-gap-tight);
|
|
173
|
+
min-inline-size: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-toolbar {
|
|
177
|
+
flex-wrap: wrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* A long name is cut with an ellipsis; its button's name holds it whole. */
|
|
181
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-track-name bdi {
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
max-inline-size: var(--hm-space-12);
|
|
184
|
+
text-overflow: ellipsis;
|
|
185
|
+
white-space: nowrap;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-track-gain {
|
|
189
|
+
inline-size: var(--hm-space-12);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/*
|
|
193
|
+
* The waveform: a canvas as wide as the view, placed over the part of the
|
|
194
|
+
* track in view by the CSSOM. Layout, not paint, so in any mode.
|
|
195
|
+
*/
|
|
196
|
+
.hm-audio-editor-wave-layer {
|
|
197
|
+
position: relative;
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.hm-audio-editor-waveform {
|
|
202
|
+
position: absolute;
|
|
203
|
+
inset-block: 0;
|
|
204
|
+
block-size: 100%;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-waveform {
|
|
209
|
+
color: var(--hm-color-accent);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* A muted track, or one a solo leaves out, is drawn dim; its name says so. */
|
|
213
|
+
.hm-audio-editor:not([data-hm-unstyled]) [data-hm-silent] .hm-audio-editor-waveform {
|
|
214
|
+
color: var(--hm-color-text-disabled);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@media (forced-colors: active) {
|
|
218
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-waveform {
|
|
219
|
+
color: CanvasText;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/*
|
|
224
|
+
* The selected range: a band on each of its lanes, under the clips. A
|
|
225
|
+
* press passes through it to the track, which selects and seeks.
|
|
226
|
+
*/
|
|
227
|
+
/* Takes the presses the lanes let through, to select and seek. */
|
|
228
|
+
.hm-audio-editor-press-layer {
|
|
229
|
+
touch-action: pan-x pan-y;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.hm-audio-editor-range-layer {
|
|
233
|
+
position: relative;
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.hm-audio-editor-range {
|
|
238
|
+
position: absolute;
|
|
239
|
+
inset-block: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-range {
|
|
243
|
+
border-inline: var(--hm-border-width) solid var(--hm-color-accent);
|
|
244
|
+
background: var(--hm-color-accent-subtle);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* The lanes Ripple would move, when it leaves others behind; the header says so in text. */
|
|
248
|
+
.hm-audio-editor:not([data-hm-unstyled]) [data-hm-ripple] {
|
|
249
|
+
box-shadow: inset var(--hm-border-width-2) 0 0 var(--hm-color-warning);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-track-ripple {
|
|
253
|
+
padding-inline: var(--hm-space-1);
|
|
254
|
+
border-radius: var(--hm-radius-sm);
|
|
255
|
+
background: var(--hm-color-warning-subtle);
|
|
256
|
+
color: var(--hm-color-warning-text);
|
|
257
|
+
font-size: var(--hm-font-size-small);
|
|
258
|
+
white-space: nowrap;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@media (forced-colors: active) {
|
|
262
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-range {
|
|
263
|
+
border-color: Highlight;
|
|
264
|
+
background: transparent;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-track-ripple {
|
|
268
|
+
border: var(--hm-border-width) solid CanvasText;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-selection {
|
|
273
|
+
margin: 0 0 0 var(--hm-gap-normal);
|
|
274
|
+
font-variant-numeric: tabular-nums;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* The export dialog: what will be written, then the choice, then what happened. */
|
|
278
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-summary {
|
|
279
|
+
display: grid;
|
|
280
|
+
gap: var(--hm-gap-tight);
|
|
281
|
+
margin-block-end: var(--hm-gap-normal);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-summary p,
|
|
285
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-result,
|
|
286
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-error,
|
|
287
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-clipped p {
|
|
288
|
+
margin: 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-clipped {
|
|
292
|
+
display: grid;
|
|
293
|
+
gap: var(--hm-gap-tight);
|
|
294
|
+
justify-items: start;
|
|
295
|
+
margin-block-start: var(--hm-gap-normal);
|
|
296
|
+
padding: var(--hm-gap-normal);
|
|
297
|
+
border-radius: var(--hm-radius-md);
|
|
298
|
+
background: var(--hm-color-warning-subtle);
|
|
299
|
+
color: var(--hm-color-warning-text);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-error {
|
|
303
|
+
margin-block-start: var(--hm-gap-normal);
|
|
304
|
+
color: var(--hm-color-danger-text);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
@media (forced-colors: active) {
|
|
308
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-export-clipped {
|
|
309
|
+
border: var(--hm-border-width) solid CanvasText;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-transport {
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-wrap: wrap;
|
|
316
|
+
gap: var(--hm-gap-tight);
|
|
317
|
+
align-items: center;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-time {
|
|
321
|
+
margin: 0 0 0 var(--hm-gap-normal);
|
|
322
|
+
font-variant-numeric: tabular-nums;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-transport-notice {
|
|
326
|
+
flex-basis: 100%;
|
|
327
|
+
margin: 0;
|
|
328
|
+
color: var(--hm-color-warning-text);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Narrow editors: the time takes its own line, under the buttons. */
|
|
332
|
+
@container (inline-size < 720px) {
|
|
333
|
+
.hm-audio-editor:not([data-hm-unstyled]) .hm-audio-editor-time {
|
|
334
|
+
flex-basis: 100%;
|
|
335
|
+
margin: 0;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|