solid-pianoroll 0.0.27 → 0.0.29

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/dist/dev.jsx CHANGED
@@ -1,7 +1,4 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-4lSEurKZS4xC/solid-pianoroll/src/PianoRoll.module.css.js
1
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-EoFgjaMDTdLJ/solid-pianoroll/src/PianoRoll.module.css.js
5
2
  var digest = "1768455784e6754f5fb57107bf43cc8478bbe0ec2ced0bc6aeb796949dcc4906";
6
3
  var css = `._PianoRoll_1v1e7_1 {
7
4
  box-sizing: border-box;
@@ -50,7 +47,7 @@ var css = `._PianoRoll_1v1e7_1 {
50
47
  document.head.appendChild(el);
51
48
  }
52
49
  })();
53
- var PianoRoll_module_css_default = { "pianoRoll": "_PianoRoll_1v1e7_1", "pianoRollContainer": "_PianoRollContainer_1v1e7_10", "pianoRollLeftColumn": "_PianoRollLeftColumn_1v1e7_17", "showTrackList": "_showTrackList_1v1e7_24", "pianoRollRightColumn": "_PianoRollRightColumn_1v1e7_29" };
50
+ var PianoRoll_module_css_default = { "PianoRoll": "_PianoRoll_1v1e7_1", "pianoRoll": "_PianoRoll_1v1e7_1", "PianoRollContainer": "_PianoRollContainer_1v1e7_10", "pianoRollContainer": "_PianoRollContainer_1v1e7_10", "PianoRollLeftColumn": "_PianoRollLeftColumn_1v1e7_17", "pianoRollLeftColumn": "_PianoRollLeftColumn_1v1e7_17", "showTrackList": "_showTrackList_1v1e7_24", "PianoRollRightColumn": "_PianoRollRightColumn_1v1e7_29", "pianoRollRightColumn": "_PianoRollRightColumn_1v1e7_29" };
54
51
 
55
52
  // src/PianoRoll.tsx
56
53
  import { Show as Show6, mergeProps as mergeProps4 } from "solid-js";
@@ -80,7 +77,7 @@ var defaultState = {
80
77
  notesScrollerClientRect: { left: 0, width: 0, top: 0, height: 0 },
81
78
  tracksScrollerClientRect: { left: 0, width: 0, top: 0, height: 0 }
82
79
  };
83
- var propNameToHandlerName = /* @__PURE__ */ __name((name) => `on${name[0]?.toUpperCase()}${name.slice(1)}Change`, "propNameToHandlerName");
80
+ var propNameToHandlerName = (name) => `on${name[0]?.toUpperCase()}${name.slice(1)}Change`;
84
81
  var pianoRollStatePropNames = [
85
82
  ...Object.keys(defaultState),
86
83
  ...Object.keys(defaultState).map(propNameToHandlerName),
@@ -92,7 +89,7 @@ var pianoRollStatePropNames = [
92
89
  "isKeyDown",
93
90
  "snapValueToGridIfEnabled"
94
91
  ];
95
- var createPianoRollstate = /* @__PURE__ */ __name((initialState) => {
92
+ var createPianoRollstate = (initialState) => {
96
93
  const [state, setState] = createStore({
97
94
  ...defaultState,
98
95
  ...initialState
@@ -112,12 +109,12 @@ var createPianoRollstate = /* @__PURE__ */ __name((initialState) => {
112
109
  ];
113
110
  })
114
111
  );
115
- const onPlayheadPositionChange = /* @__PURE__ */ __name((playheadPosition, originalEvent) => {
112
+ const onPlayheadPositionChange = (playheadPosition, originalEvent) => {
116
113
  handlers.onPlayHeadPositionChange(
117
114
  snapValueToGridIfEnabled(playheadPosition, !!originalEvent?.altKey)
118
115
  );
119
- }, "onPlayheadPositionChange");
120
- const updateNotes = /* @__PURE__ */ __name(async (trackIndex, getNotes) => {
116
+ };
117
+ const updateNotes = async (trackIndex, getNotes) => {
121
118
  const track = state.tracks[trackIndex];
122
119
  if (!track)
123
120
  return;
@@ -127,15 +124,15 @@ var createPianoRollstate = /* @__PURE__ */ __name((initialState) => {
127
124
  { ...track, notes: getNotes(notes) },
128
125
  ...state.tracks.slice(trackIndex + 1)
129
126
  ]);
130
- }, "updateNotes");
131
- const onNoteChange = /* @__PURE__ */ __name((trackIndex, noteIndex, note) => {
127
+ };
128
+ const onNoteChange = (trackIndex, noteIndex, note) => {
132
129
  updateNotes(trackIndex, (notes) => [
133
130
  ...notes.slice(0, noteIndex),
134
131
  note,
135
132
  ...notes.slice(noteIndex + 1)
136
133
  ]);
137
- }, "onNoteChange");
138
- const onInsertNote = /* @__PURE__ */ __name((trackIndex, note) => {
134
+ };
135
+ const onInsertNote = (trackIndex, note) => {
139
136
  const track = state.tracks[trackIndex];
140
137
  if (!track)
141
138
  return -1;
@@ -150,14 +147,14 @@ var createPianoRollstate = /* @__PURE__ */ __name((initialState) => {
150
147
  ...notes2.slice(newNoteIndex)
151
148
  ]);
152
149
  return newNoteIndex;
153
- }, "onInsertNote");
154
- const onRemoveNote = /* @__PURE__ */ __name((trackIndex, noteIndex) => {
150
+ };
151
+ const onRemoveNote = (trackIndex, noteIndex) => {
155
152
  updateNotes(trackIndex, (notes) => [
156
153
  ...notes.slice(0, noteIndex),
157
154
  ...notes.slice(noteIndex + 1)
158
155
  ]);
159
- }, "onRemoveNote");
160
- const updateKeyPressedState = /* @__PURE__ */ __name((trackIndex, keyNumber, value) => {
156
+ };
157
+ const updateKeyPressedState = (trackIndex, keyNumber, value) => {
161
158
  handlers.onPressedKeysChange?.({
162
159
  ...state.pressedKeys,
163
160
  [trackIndex]: {
@@ -165,18 +162,18 @@ var createPianoRollstate = /* @__PURE__ */ __name((initialState) => {
165
162
  [keyNumber]: value
166
163
  }
167
164
  });
168
- }, "updateKeyPressedState");
169
- const onNoteDown = /* @__PURE__ */ __name((trackIndex, keyNumber) => {
165
+ };
166
+ const onNoteDown = (trackIndex, keyNumber) => {
170
167
  updateKeyPressedState(trackIndex, keyNumber, true);
171
- }, "onNoteDown");
172
- const onNoteUp = /* @__PURE__ */ __name((trackIndex, keyNumber) => {
168
+ };
169
+ const onNoteUp = (trackIndex, keyNumber) => {
173
170
  updateKeyPressedState(trackIndex, keyNumber, false);
174
- }, "onNoteUp");
175
- const isKeyDown = /* @__PURE__ */ __name((trackIndex, keyNumber) => !!state.pressedKeys[trackIndex]?.[keyNumber], "isKeyDown");
176
- const snapValueToGridIfEnabled = /* @__PURE__ */ __name((value, altKey) => {
171
+ };
172
+ const isKeyDown = (trackIndex, keyNumber) => !!state.pressedKeys[trackIndex]?.[keyNumber];
173
+ const snapValueToGridIfEnabled = (value, altKey) => {
177
174
  const gridDivisionTicks = state.ppq * 4 / state.gridDivision;
178
175
  return state.snapToGrid && !altKey ? Math.round(value / gridDivisionTicks) * gridDivisionTicks : value;
179
- }, "snapValueToGridIfEnabled");
176
+ };
180
177
  return mergeProps(state, {
181
178
  ...handlers,
182
179
  onNoteChange,
@@ -188,22 +185,22 @@ var createPianoRollstate = /* @__PURE__ */ __name((initialState) => {
188
185
  snapValueToGridIfEnabled,
189
186
  onPlayheadPositionChange
190
187
  });
191
- }, "createPianoRollstate");
188
+ };
192
189
  var usePianoRollState_default = createPianoRollstate;
193
190
 
194
191
  // src/PianoRollContext.tsx
195
192
  var PianoRollContext = createContext();
196
193
  var PianoRollContextProvider = PianoRollContext.Provider;
197
- var usePianoRollContext = /* @__PURE__ */ __name(() => {
194
+ var usePianoRollContext = () => {
198
195
  const context = useContext(PianoRollContext);
199
196
  if (!context)
200
197
  throw new Error("No PianoRollContext found");
201
198
  return context;
202
- }, "usePianoRollContext");
203
- var splitContextProps = /* @__PURE__ */ __name((allProps) => splitProps(allProps, [...pianoRollStatePropNames, "showAllTracks", "showTrackList"]), "splitContextProps");
199
+ };
200
+ var splitContextProps = (allProps) => splitProps(allProps, [...pianoRollStatePropNames, "showAllTracks", "showTrackList"]);
204
201
 
205
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-giqIfMskMsUC/solid-pianoroll/src/PianoRollKeys.module.css.js
206
- var digest2 = "a2160cefc96d2c57ab5bc57c0dfc1f009ceabf6981d7bd2c88f333621de2e52f";
202
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-vPA2rVvQAkSS/solid-pianoroll/src/PianoRollKeys.module.css.js
203
+ var digest2 = "bbaa0942ecbee6a492845a23ecdbace9bcda1f540a5ba6682de5afbdbda272f4";
207
204
  var css2 = `._PianoRollKeys_1ne9i_1 {
208
205
  position: relative;
209
206
  height: 100%;
@@ -266,74 +263,69 @@ var css2 = `._PianoRollKeys_1ne9i_1 {
266
263
  document.head.appendChild(el);
267
264
  }
268
265
  })();
269
- var PianoRollKeys_module_css_default = { "pianoRollKeys": "_PianoRollKeys_1ne9i_1", "key": "_Key_1ne9i_14", "black": "_black_1ne9i_29", "white": "_white_1ne9i_38", "down": "_down_1ne9i_46" };
266
+ var PianoRollKeys_module_css_default = { "PianoRollKeys": "_PianoRollKeys_1ne9i_1", "pianoRollKeys": "_PianoRollKeys_1ne9i_1", "Key": "_Key_1ne9i_14", "key": "_Key_1ne9i_14", "black": "_black_1ne9i_29", "white": "_white_1ne9i_38", "down": "_down_1ne9i_46" };
270
267
 
271
268
  // src/PianoRollKeys.tsx
272
- import { createEffect as createEffect3, createMemo as createMemo2, createSignal, Index, Show } from "solid-js";
269
+ import { createEffect as createEffect2, createMemo as createMemo2, createSignal, Index, Show } from "solid-js";
273
270
 
274
271
  // src/viewport/ScrollZoomViewPort.tsx
275
272
  import { createContext as createContext2, useContext as useContext2 } from "solid-js";
276
273
 
277
274
  // src/viewport/createViewPortDimension.ts
278
- import { createEffect } from "solid-js";
279
- import { createStore as createStore2 } from "solid-js/store";
275
+ import { createViewPortAxis } from "solid-viewport";
280
276
  function createViewPortDimension(getState) {
281
- const getStateWithFunctions = /* @__PURE__ */ __name(() => {
282
- const state2 = getState();
283
- const onZoomChange = /* @__PURE__ */ __name((zoom) => state2.onZoomChange?.(clamp(zoom, state2.minZoom, state2.maxZoom)), "onZoomChange");
284
- const onPositionChange = /* @__PURE__ */ __name((position) => state2.onPositionChange?.(position), "onPositionChange");
277
+ const axis = createViewPortAxis(() => {
278
+ const s = getState();
285
279
  return {
286
- ...state2,
287
- onZoomChange,
288
- onPositionChange,
289
- calculatePixelOffset,
290
- calculatePixelValue,
291
- calculatePosition,
292
- calculatePixelDimensions,
293
- calculateVisibleRange,
294
- calculateMaxPosition,
295
- isVisible
280
+ name: s.name,
281
+ position: s.position,
282
+ range: s.range,
283
+ pixelOffset: s.pixelOffset,
284
+ pixelSize: s.pixelSize,
285
+ zoom: s.zoom,
286
+ minZoom: s.minZoom,
287
+ maxZoom: s.maxZoom,
288
+ onPositionChange: s.onPositionChange,
289
+ onZoomChange: s.onZoomChange
296
290
  };
297
- }, "getStateWithFunctions");
298
- const [state, setState] = createStore2(getStateWithFunctions());
299
- createEffect(() => setState(getStateWithFunctions()));
300
- function calculatePixelValue(position = state.position) {
301
- const virtualSize = state.pixelSize * state.zoom;
302
- return position / state.range * virtualSize;
303
- }
304
- __name(calculatePixelValue, "calculatePixelValue");
305
- function calculatePixelOffset(position) {
306
- return calculatePixelValue(position) - calculatePixelValue(state.position);
307
- }
308
- __name(calculatePixelOffset, "calculatePixelOffset");
309
- function calculatePosition(offset) {
310
- const percentX = (offset - state.pixelOffset) / state.pixelSize;
311
- const position = state.position + percentX * calculateVisibleRange();
312
- return position;
313
- }
314
- __name(calculatePosition, "calculatePosition");
315
- function calculateVisibleRange() {
316
- return state.range / state.zoom;
317
- }
318
- __name(calculateVisibleRange, "calculateVisibleRange");
319
- function calculateMaxPosition() {
320
- return state.range - state.range / state.zoom;
321
- }
322
- __name(calculateMaxPosition, "calculateMaxPosition");
323
- function calculatePixelDimensions(position, length) {
324
- const offset = calculatePixelOffset(position);
325
- const size = calculatePixelValue(length);
326
- return { offset, size };
327
- }
328
- __name(calculatePixelDimensions, "calculatePixelDimensions");
329
- function isVisible({ offset, size }) {
330
- return offset + size > 0 && offset < state.pixelSize;
331
- }
332
- __name(isVisible, "isVisible");
333
- return state;
291
+ });
292
+ return {
293
+ get name() {
294
+ return axis.name;
295
+ },
296
+ get position() {
297
+ return axis.position;
298
+ },
299
+ get range() {
300
+ return axis.range;
301
+ },
302
+ get pixelOffset() {
303
+ return axis.pixelOffset;
304
+ },
305
+ get pixelSize() {
306
+ return axis.pixelSize;
307
+ },
308
+ get zoom() {
309
+ return axis.zoom;
310
+ },
311
+ get minZoom() {
312
+ return axis.minZoom;
313
+ },
314
+ get maxZoom() {
315
+ return axis.maxZoom;
316
+ },
317
+ onPositionChange: (position) => axis.onPositionChange?.(position),
318
+ onZoomChange: (zoom) => axis.onZoomChange?.(zoom),
319
+ calculatePixelValue: (position) => axis.toPixels(position),
320
+ calculatePixelOffset: (position) => axis.toPixelOffset(position),
321
+ calculatePosition: (offset) => axis.toPosition(offset),
322
+ calculatePixelDimensions: (position, length) => axis.dimensions(position, length),
323
+ calculateVisibleRange: () => axis.visibleRange(),
324
+ calculateMaxPosition: () => axis.maxPosition(),
325
+ isVisible: (dimensions) => axis.isVisible(dimensions)
326
+ };
334
327
  }
335
- __name(createViewPortDimension, "createViewPortDimension");
336
- var clamp = /* @__PURE__ */ __name((value, min, max) => Math.max(min, Math.min(max, value)), "clamp");
328
+ var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
337
329
 
338
330
  // src/viewport/ScrollZoomViewPort.tsx
339
331
  var defaultViewPortProps = {
@@ -344,7 +336,7 @@ var defaultViewPortProps = {
344
336
  minZoom: 1,
345
337
  maxZoom: Infinity
346
338
  };
347
- var ScrollZoomViewPort = /* @__PURE__ */ __name((props) => {
339
+ var ScrollZoomViewPort = (props) => {
348
340
  const viewPorts = Object.entries(props.dimensions).map(
349
341
  ([name, viewPortProps]) => createViewPortDimension(() => ({
350
342
  name,
@@ -354,21 +346,21 @@ var ScrollZoomViewPort = /* @__PURE__ */ __name((props) => {
354
346
  );
355
347
  const parentViewPorts = useContext2(ScrollZoomViewPortContext);
356
348
  return <ScrollZoomViewPortContext.Provider value={[...parentViewPorts, ...viewPorts]}>{props.children}</ScrollZoomViewPortContext.Provider>;
357
- }, "ScrollZoomViewPort");
349
+ };
358
350
  var ScrollZoomViewPortContext = createContext2([]);
359
- var useViewPortDimension = /* @__PURE__ */ __name((name) => {
351
+ var useViewPortDimension = (name) => {
360
352
  const viewPorts = useContext2(ScrollZoomViewPortContext);
361
353
  const viewPort = name ? viewPorts.find((viewPort2) => viewPort2.name === name) : viewPorts[viewPorts.length - 1];
362
354
  if (!viewPort)
363
355
  throw new Error(`ViewPort dimension "${name}" not found.`);
364
356
  return viewPort;
365
- }, "useViewPortDimension");
357
+ };
366
358
 
367
359
  // src/viewport/ScrollZoomContainer.tsx
368
- import { createEffect as createEffect2, createMemo, mergeProps as mergeProps2, splitProps as splitProps2 } from "solid-js";
360
+ import { createEffect, createMemo, mergeProps as mergeProps2, splitProps as splitProps2 } from "solid-js";
369
361
 
370
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-DACyjAWFEZua/solid-pianoroll/src/viewport/ScrollZoomContainer.module.css.js
371
- var digest3 = "da87d2f74ba194d0dab11eb617c56efea90f00f122f089820383ed1269e10936";
362
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-GTKRXRld1CFO/solid-pianoroll/src/viewport/ScrollZoomContainer.module.css.js
363
+ var digest3 = "a0ed6c48dc62240340708ba5e4bf3a8fc0a0cdc27a7217d4f6dd1ed6d3319ba8";
372
364
  var css3 = `._ScrollZoomContainer_f395r_1 {
373
365
  height: 100%;
374
366
  width: 100%;
@@ -386,10 +378,10 @@ var css3 = `._ScrollZoomContainer_f395r_1 {
386
378
  document.head.appendChild(el);
387
379
  }
388
380
  })();
389
- var ScrollZoomContainer_module_css_default = { "scrollZoomContainer": "_ScrollZoomContainer_f395r_1" };
381
+ var ScrollZoomContainer_module_css_default = { "ScrollZoomContainer": "_ScrollZoomContainer_f395r_1", "scrollZoomContainer": "_ScrollZoomContainer_f395r_1" };
390
382
 
391
383
  // src/viewport/ScrollZoomContainer.tsx
392
- var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
384
+ var ScrollZoomContainer = (props) => {
393
385
  let scrollContentRef;
394
386
  const [ownProps, divProps] = splitProps2(props, [
395
387
  "ref",
@@ -411,8 +403,7 @@ var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
411
403
  const horizontalViewPort = createMemo(
412
404
  () => useViewPortDimension(propsWithDefaults.horizontalDimensionName)
413
405
  );
414
- const handleScroll = /* @__PURE__ */ __name((event) => {
415
- event.preventDefault();
406
+ const handleScroll = (event) => {
416
407
  if (didUpdateScroll) {
417
408
  didUpdateScroll = false;
418
409
  return;
@@ -426,35 +417,28 @@ var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
426
417
  const scrollLeftAmount = scrollLeft / (scrollWidth - width);
427
418
  verticalViewPort().onPositionChange?.(maxVerticalPosition * scrollTopAmount);
428
419
  horizontalViewPort().onPositionChange?.(maxPosition * scrollLeftAmount);
429
- }, "handleScroll");
430
- const handleWheel = /* @__PURE__ */ __name((event) => {
420
+ };
421
+ const handleWheel = (event) => {
431
422
  if (event.altKey) {
432
423
  event.preventDefault();
433
- if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
434
- horizontalViewPort()?.onZoomChange?.(
435
- horizontalViewPort().zoom / (1 + event.deltaX / horizontalViewPort().pixelSize)
436
- );
437
- const maxPosition = horizontalViewPort().calculateMaxPosition();
438
- horizontalViewPort()?.onPositionChange?.(
439
- Math.min(maxPosition, horizontalViewPort()?.position)
440
- );
441
- } else {
442
- verticalViewPort()?.onZoomChange?.(
443
- verticalViewPort().zoom / (1 + event.deltaY / verticalViewPort().pixelSize)
444
- );
445
- const maxVerticalPosition = verticalViewPort().calculateMaxPosition();
446
- verticalViewPort()?.onPositionChange?.(
447
- Math.min(maxVerticalPosition, verticalViewPort()?.position)
448
- );
449
- }
424
+ const horizontal = Math.abs(event.deltaX) > Math.abs(event.deltaY);
425
+ const viewPort = horizontal ? horizontalViewPort() : verticalViewPort();
426
+ const delta = horizontal ? event.deltaX : event.deltaY;
427
+ const pointer = horizontal ? event.clientX : event.clientY;
428
+ const valueAtPointer = viewPort.calculatePosition(pointer);
429
+ const newZoom = viewPort.zoom / (1 + delta / viewPort.pixelSize);
430
+ const newVisibleRange = viewPort.range / newZoom;
431
+ const fraction = (pointer - viewPort.pixelOffset) / viewPort.pixelSize;
432
+ viewPort.onZoomChange?.(newZoom);
433
+ viewPort.onPositionChange?.(valueAtPointer - fraction * newVisibleRange);
450
434
  } else if (!props.showScrollbar) {
451
435
  event.preventDefault();
452
436
  event.currentTarget.scrollLeft += event.deltaX;
453
437
  event.currentTarget.scrollTop += event.deltaY;
454
438
  }
455
- }, "handleWheel");
439
+ };
456
440
  let didUpdateScroll = false;
457
- createEffect2(() => {
441
+ createEffect(() => {
458
442
  const maxVerticalPosition = verticalViewPort().calculateMaxPosition();
459
443
  const maxPosition = horizontalViewPort().calculateMaxPosition();
460
444
  const scrollTopAmount = maxVerticalPosition > 0 ? verticalViewPort().position / maxVerticalPosition : 0;
@@ -504,19 +488,19 @@ var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
504
488
  width: `${horizontalViewPort().pixelSize}px`
505
489
  }}
506
490
  >{props.children}</div></div></div></div>;
507
- }, "ScrollZoomContainer");
491
+ };
508
492
  var ScrollZoomContainer_default = ScrollZoomContainer;
509
493
 
510
494
  // src/PianoRollKeys.tsx
511
- var PianoRollKeys = /* @__PURE__ */ __name(() => {
495
+ var PianoRollKeys = () => {
512
496
  const verticalViewPort = createMemo2(() => useViewPortDimension("vertical"));
513
497
  const horizontalViewPort = createMemo2(() => useViewPortDimension("horizontalKeys"));
514
498
  const [isMouseDown, setIsMouseDown] = createSignal(false);
515
499
  const context = usePianoRollContext();
516
- const handleMouseUp = /* @__PURE__ */ __name(() => {
500
+ const handleMouseUp = () => {
517
501
  setIsMouseDown(false);
518
- }, "handleMouseUp");
519
- createEffect3(() => {
502
+ };
503
+ createEffect2(() => {
520
504
  if (isMouseDown()) {
521
505
  window.addEventListener("mouseup", handleMouseUp);
522
506
  } else {
@@ -571,7 +555,7 @@ var PianoRollKeys = /* @__PURE__ */ __name(() => {
571
555
  }}
572
556
  /></Show>;
573
557
  }}</Index></ScrollZoomContainer_default></div>;
574
- }, "PianoRollKeys");
558
+ };
575
559
  var blackKeys = [1, 3, 6, 8, 10];
576
560
  var keyNames = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"];
577
561
  var keys = Array.from({ length: 128 }).map((_, index) => ({
@@ -584,8 +568,8 @@ var PianoRollKeys_default = PianoRollKeys;
584
568
  // src/PianoRollNotes.tsx
585
569
  import { createMemo as createMemo3, createSignal as createSignal2, For, Show as Show2 } from "solid-js";
586
570
 
587
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-H6bkIm6VjhJs/solid-pianoroll/src/PianoRollNotes.module.css.js
588
- var digest4 = "fb03dfb9f9735042f035cb3dc6f116588f2ff84bccb7b1eaafbf1e04d0d357c2";
571
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-4XxVYQ8EHiTc/solid-pianoroll/src/PianoRollNotes.module.css.js
572
+ var digest4 = "8dddfe05bee5a327753f5688eb499ab297b646fb4ce3f45f86b502855b551810";
589
573
  var css4 = `._PianoRollNotes_u3pew_1 {
590
574
  position: absolute;
591
575
  flex: 1;
@@ -626,10 +610,10 @@ var css4 = `._PianoRollNotes_u3pew_1 {
626
610
  document.head.appendChild(el);
627
611
  }
628
612
  })();
629
- var PianoRollNotes_module_css_default = { "pianoRollNotes": "_PianoRollNotes_u3pew_1", "note": "_Note_u3pew_12", "trimStart": "_trimStart_u3pew_22", "trimEnd": "_trimEnd_u3pew_26" };
613
+ var PianoRollNotes_module_css_default = { "PianoRollNotes": "_PianoRollNotes_u3pew_1", "pianoRollNotes": "_PianoRollNotes_u3pew_1", "Note": "_Note_u3pew_12", "note": "_Note_u3pew_12", "trimStart": "_trimStart_u3pew_22", "trimEnd": "_trimEnd_u3pew_26" };
630
614
 
631
615
  // src/PianoRollNotes.tsx
632
- var PianoRollNotes = /* @__PURE__ */ __name((props) => {
616
+ var PianoRollNotes = (props) => {
633
617
  const context = usePianoRollContext();
634
618
  const verticalViewPort = createMemo3(
635
619
  () => useViewPortDimension(context.mode === "keys" ? "vertical" : "verticalTracks")
@@ -642,7 +626,7 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
642
626
  const [currentNoteTrackIndex, setCurrentNoteTrackIndex] = createSignal2(-1);
643
627
  const [diffPosition, setDiffPosition] = createSignal2(0);
644
628
  const [getInitialNote, setInitialNote] = createSignal2();
645
- const calculateNoteDragValues = /* @__PURE__ */ __name((event) => {
629
+ const calculateNoteDragValues = (event) => {
646
630
  const targetTrackIndex = context.mode === "tracks" ? clamp(
647
631
  Math.floor(verticalViewPort().calculatePosition(event.clientY)),
648
632
  0,
@@ -655,8 +639,8 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
655
639
  midi,
656
640
  horiontalPosition
657
641
  };
658
- }, "calculateNoteDragValues");
659
- const handleMouseMove = /* @__PURE__ */ __name((mouseMoveEvent) => {
642
+ };
643
+ const handleMouseMove = (mouseMoveEvent) => {
660
644
  mouseMoveEvent.preventDefault();
661
645
  mouseMoveEvent.stopPropagation();
662
646
  const note = getInitialNote();
@@ -698,21 +682,21 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
698
682
  setCurrentNoteIndex(newNoteIndex);
699
683
  }
700
684
  }
701
- }, "handleMouseMove");
702
- const stopDragging = /* @__PURE__ */ __name(() => {
685
+ };
686
+ const stopDragging = () => {
703
687
  window.removeEventListener("mousemove", handleMouseMove);
704
688
  window.removeEventListener("mouseup", stopDragging);
705
689
  setIsDragging(false);
706
690
  setCurrentNoteIndex(-1);
707
691
  setCurrentNoteTrackIndex(-1);
708
- }, "stopDragging");
709
- const startDragging = /* @__PURE__ */ __name(() => {
692
+ };
693
+ const startDragging = () => {
710
694
  window.addEventListener("mousemove", handleMouseMove);
711
695
  window.addEventListener("mouseup", stopDragging);
712
- }, "startDragging");
713
- const getClasses = /* @__PURE__ */ __name((noteDragMode2) => {
696
+ };
697
+ const getClasses = (noteDragMode2) => {
714
698
  return noteDragMode2 ? [PianoRollNotes_module_css_default.Note, PianoRollNotes_module_css_default[noteDragMode2]] : [PianoRollNotes_module_css_default.Note];
715
- }, "getClasses");
699
+ };
716
700
  return <div
717
701
  classList={{ [PianoRollNotes_module_css_default.PianoRollNotes]: true }}
718
702
  ref={props.ref}
@@ -803,14 +787,14 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
803
787
  /></Show2>;
804
788
  }}</For></Show2>;
805
789
  }}</For></div>;
806
- }, "PianoRollNotes");
790
+ };
807
791
  var PianoRollNotes_default = PianoRollNotes;
808
792
 
809
793
  // src/PianoRollGrid.tsx
810
794
  import { createMemo as createMemo5, For as For2, Index as Index2, Show as Show3 } from "solid-js";
811
795
 
812
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-6elOn94vcLry/solid-pianoroll/src/PianoRollGrid.module.css.js
813
- var digest5 = "b0952315b4fe36c31ed82062cb6cba74437c761ac8863b381025d697a4c4b98e";
796
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-9qgGLYKKXfs8/solid-pianoroll/src/PianoRollGrid.module.css.js
797
+ var digest5 = "efa34c6b5207c399897cfd150bae18d5711548b652f1a3cf8a3084679c2a8e21";
814
798
  var css5 = `._PianoRollGrid_qke5f_1 {
815
799
  position: relative;
816
800
  width: 100%;
@@ -866,11 +850,11 @@ var css5 = `._PianoRollGrid_qke5f_1 {
866
850
  document.head.appendChild(el);
867
851
  }
868
852
  })();
869
- var PianoRollGrid_module_css_default = { "pianoRollGrid": "_PianoRollGrid_qke5f_1", "pianoRollGridRow": "_PianoRollGrid-Row_qke5f_7", "isDark": "_IsDark_qke5f_14", "key": "_Key_qke5f_18", "isBlackAndNextIsWhite": "_IsBlackAndNextIsWhite_qke5f_21", "pianoRollGridTime": "_PianoRollGrid-Time_qke5f_26", "highlighted": "_Highlighted_qke5f_37", "highlightedBorder": "_HighlightedBorder_qke5f_41" };
853
+ var PianoRollGrid_module_css_default = { "PianoRollGrid": "_PianoRollGrid_qke5f_1", "pianoRollGrid": "_PianoRollGrid_qke5f_1", "PianoRollGrid-Row": "_PianoRollGrid-Row_qke5f_7", "pianoRollGridRow": "_PianoRollGrid-Row_qke5f_7", "IsDark": "_IsDark_qke5f_14", "isDark": "_IsDark_qke5f_14", "Key": "_Key_qke5f_18", "key": "_Key_qke5f_18", "IsBlackAndNextIsWhite": "_IsBlackAndNextIsWhite_qke5f_21", "isBlackAndNextIsWhite": "_IsBlackAndNextIsWhite_qke5f_21", "PianoRollGrid-Time": "_PianoRollGrid-Time_qke5f_26", "pianoRollGridTime": "_PianoRollGrid-Time_qke5f_26", "Highlighted": "_Highlighted_qke5f_37", "highlighted": "_Highlighted_qke5f_37", "HighlightedBorder": "_HighlightedBorder_qke5f_41", "highlightedBorder": "_HighlightedBorder_qke5f_41" };
870
854
 
871
855
  // src/usePianoRollGrid.ts
872
856
  import { createMemo as createMemo4 } from "solid-js";
873
- var usePianoRollGrid = /* @__PURE__ */ __name(() => {
857
+ var usePianoRollGrid = () => {
874
858
  const context = usePianoRollContext();
875
859
  const horizontalViewPort = createMemo4(() => useViewPortDimension("horizontal"));
876
860
  const measureTicks = createMemo4(() => context.ppq * 4);
@@ -887,7 +871,6 @@ var usePianoRollGrid = /* @__PURE__ */ __name(() => {
887
871
  }
888
872
  return value;
889
873
  }
890
- __name(calculateVisibleGridDivisorTicks, "calculateVisibleGridDivisorTicks");
891
874
  const gridDivisorTicks = createMemo4(
892
875
  () => calculateVisibleGridDivisorTicks(selectedGridDivisorTicks())
893
876
  );
@@ -915,11 +898,11 @@ var usePianoRollGrid = /* @__PURE__ */ __name(() => {
915
898
  });
916
899
  });
917
900
  return gridArray;
918
- }, "usePianoRollGrid");
901
+ };
919
902
  var usePianoRollGrid_default = usePianoRollGrid;
920
903
 
921
904
  // src/PianoRollGrid.tsx
922
- var PianoRollGrid = /* @__PURE__ */ __name(() => {
905
+ var PianoRollGrid = () => {
923
906
  const context = usePianoRollContext();
924
907
  const verticalViewPort = createMemo5(
925
908
  () => useViewPortDimension(context.mode === "keys" ? "vertical" : "verticalTracks")
@@ -973,12 +956,12 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
973
956
  /></Show3>;
974
957
  }}</For2></Show3>
975
958
  </div>;
976
- }, "PianoRollGrid");
959
+ };
977
960
  var PianoRollGrid_default = PianoRollGrid;
978
961
 
979
962
  // src/viewport/ZoomSliderControl.tsx
980
963
  import { createMemo as createMemo6, mergeProps as mergeProps3 } from "solid-js";
981
- var ZoomSliderControl = /* @__PURE__ */ __name((props) => {
964
+ var ZoomSliderControl = (props) => {
982
965
  const propsWithDefaults = mergeProps3({ orientation: "horizontal" }, props);
983
966
  const dimension = createMemo6(
984
967
  () => useViewPortDimension(props.dimensionName ?? propsWithDefaults.orientation)
@@ -1013,11 +996,11 @@ var ZoomSliderControl = /* @__PURE__ */ __name((props) => {
1013
996
  ...typeof props.style === "object" && props.style
1014
997
  }}
1015
998
  />;
1016
- }, "ZoomSliderControl");
999
+ };
1017
1000
  var ZoomSliderControl_default = ZoomSliderControl;
1018
1001
 
1019
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-s5a7xEDYct3c/solid-pianoroll/src/PianoRollTrackList.module.css.js
1020
- var digest6 = "77f61e2e770dc69815f8561e41ee5519ceb2eb971ed938593e2695d0b0edc716";
1002
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-GGWiIf0qvcx3/solid-pianoroll/src/PianoRollTrackList.module.css.js
1003
+ var digest6 = "e9f8961ee037e20fa2a8071f60eb91f8e32adde4fe62014efe90839a5e4f61fc";
1021
1004
  var css6 = `._PianoRollTrackList_11kti_1 {
1022
1005
  position: relative;
1023
1006
  height: 100%;
@@ -1053,11 +1036,11 @@ Track._selected_11kti_21 {
1053
1036
  document.head.appendChild(el);
1054
1037
  }
1055
1038
  })();
1056
- var PianoRollTrackList_module_css_default = { "pianoRollTrackList": "_PianoRollTrackList_11kti_1", "track": "_Track_11kti_7", "selected": "_selected_11kti_21" };
1039
+ var PianoRollTrackList_module_css_default = { "PianoRollTrackList": "_PianoRollTrackList_11kti_1", "pianoRollTrackList": "_PianoRollTrackList_11kti_1", "Track": "_Track_11kti_7", "track": "_Track_11kti_7", "selected": "_selected_11kti_21" };
1057
1040
 
1058
1041
  // src/PianoRollTrackList.tsx
1059
1042
  import { createMemo as createMemo7, Index as Index3, Show as Show4 } from "solid-js";
1060
- var PianoRollTrackList = /* @__PURE__ */ __name(() => {
1043
+ var PianoRollTrackList = () => {
1061
1044
  const viewPort = createMemo7(() => useViewPortDimension("verticalTracks"));
1062
1045
  const context = usePianoRollContext();
1063
1046
  return <div class={PianoRollTrackList_module_css_default.PianoRollTrackList}><Index3 each={context.tracks}>{(track, index) => {
@@ -1079,11 +1062,11 @@ var PianoRollTrackList = /* @__PURE__ */ __name(() => {
1079
1062
  {track().name || "[unnamed track]"}
1080
1063
  </div></Show4>;
1081
1064
  }}</Index3></div>;
1082
- }, "PianoRollTrackList");
1065
+ };
1083
1066
  var PianoRollTrackList_default = PianoRollTrackList;
1084
1067
 
1085
1068
  // src/PianoRollScrollZoomViewPort.tsx
1086
- var PianoRollScrollZoomViewPort = /* @__PURE__ */ __name((props) => {
1069
+ var PianoRollScrollZoomViewPort = (props) => {
1087
1070
  const zoomFactor = 500;
1088
1071
  const context = usePianoRollContext();
1089
1072
  return <ScrollZoomViewPort
@@ -1132,14 +1115,14 @@ var PianoRollScrollZoomViewPort = /* @__PURE__ */ __name((props) => {
1132
1115
  horizontalKeys: () => ({ pixelSize: 60 })
1133
1116
  }}
1134
1117
  >{props.children}</ScrollZoomViewPort>;
1135
- }, "PianoRollScrollZoomViewPort");
1118
+ };
1136
1119
  var PianoRollScrollZoomViewPort_default = PianoRollScrollZoomViewPort;
1137
1120
 
1138
1121
  // src/PianoRollNotesScroller.tsx
1139
- import { createEffect as createEffect5, createSignal as createSignal4 } from "solid-js";
1122
+ import { createEffect as createEffect4, createSignal as createSignal4 } from "solid-js";
1140
1123
 
1141
1124
  // src/useBoundingClientRect.ts
1142
- import { createEffect as createEffect4, createSignal as createSignal3 } from "solid-js";
1125
+ import { createEffect as createEffect3, createSignal as createSignal3 } from "solid-js";
1143
1126
  var defaultRect = {
1144
1127
  left: 0,
1145
1128
  width: 0,
@@ -1152,13 +1135,13 @@ var defaultRect = {
1152
1135
  };
1153
1136
  function useBoundingClientRect(containerRef) {
1154
1137
  const [boundingClientRect, setBoundingClientRect] = createSignal3(defaultRect);
1155
- createEffect4(() => {
1138
+ createEffect3(() => {
1156
1139
  const container = containerRef();
1157
1140
  if (!container)
1158
1141
  return;
1159
- const updateBoundingClientRect = /* @__PURE__ */ __name(() => {
1142
+ const updateBoundingClientRect = () => {
1160
1143
  setBoundingClientRect(container.getBoundingClientRect() ?? defaultRect);
1161
- }, "updateBoundingClientRect");
1144
+ };
1162
1145
  const resizeObserver = new ResizeObserver(updateBoundingClientRect);
1163
1146
  resizeObserver.observe(container);
1164
1147
  updateBoundingClientRect();
@@ -1168,30 +1151,29 @@ function useBoundingClientRect(containerRef) {
1168
1151
  });
1169
1152
  return boundingClientRect;
1170
1153
  }
1171
- __name(useBoundingClientRect, "useBoundingClientRect");
1172
1154
 
1173
1155
  // src/PianoRollNotesScroller.tsx
1174
- var PianoRollNotesScroller = /* @__PURE__ */ __name((props) => {
1156
+ var PianoRollNotesScroller = (props) => {
1175
1157
  const context = usePianoRollContext();
1176
1158
  const [ref, setRef] = createSignal4();
1177
1159
  const clientRect = useBoundingClientRect(ref);
1178
- createEffect5(() => {
1160
+ createEffect4(() => {
1179
1161
  context.onNotesScrollerClientRectChange(clientRect());
1180
1162
  });
1181
1163
  return <ScrollZoomContainer_default
1182
1164
  ref={setRef}
1183
1165
  verticalDimensionName={context.mode === "keys" ? "vertical" : "verticalTracks"}
1184
1166
  >{props.children}</ScrollZoomContainer_default>;
1185
- }, "PianoRollNotesScroller");
1167
+ };
1186
1168
  var PianoRollNotesScroller_default = PianoRollNotesScroller;
1187
1169
 
1188
1170
  // src/PianoRollTrackListScroller.tsx
1189
- import { createEffect as createEffect6, createSignal as createSignal5 } from "solid-js";
1190
- var PianoRollTrackListScroller = /* @__PURE__ */ __name((props) => {
1171
+ import { createEffect as createEffect5, createSignal as createSignal5 } from "solid-js";
1172
+ var PianoRollTrackListScroller = (props) => {
1191
1173
  const context = usePianoRollContext();
1192
1174
  const [ref, setRef] = createSignal5();
1193
1175
  const clientRect = useBoundingClientRect(ref);
1194
- createEffect6(() => {
1176
+ createEffect5(() => {
1195
1177
  context.onTracksScrollerClientRectChange(clientRect());
1196
1178
  });
1197
1179
  return <ScrollZoomContainer_default
@@ -1200,14 +1182,14 @@ var PianoRollTrackListScroller = /* @__PURE__ */ __name((props) => {
1200
1182
  verticalDimensionName="verticalTracks"
1201
1183
  showScrollbar={context.mode === "keys"}
1202
1184
  >{props.children}</ScrollZoomContainer_default>;
1203
- }, "PianoRollTrackListScroller");
1185
+ };
1204
1186
  var PianoRollTrackListScroller_default = PianoRollTrackListScroller;
1205
1187
 
1206
1188
  // src/PianoRollScale.tsx
1207
1189
  import { createMemo as createMemo8, Index as Index4, Show as Show5 } from "solid-js";
1208
1190
 
1209
- // esbuild-css-modules-plugin-namespace:/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-88608-ZNE7lRttL9wJ/solid-pianoroll/src/PianoRollScale.module.css.js
1210
- var digest7 = "cb997b7e12c7761253708bd6ddeeafac5c949397b9c43741d4bdf2d93d534714";
1191
+ // esbuild-css-modules-plugin-namespace:/private/var/folders/hn/m5r9jj0x3zb28s_y23nrnhmc0000gn/T/tmp-90536-1Z6Wo8jxrF0k/solid-pianoroll/src/PianoRollScale.module.css.js
1192
+ var digest7 = "686c303be8798fdc2579a63c350e335a21042ce3150552866a5896a2f019951a";
1211
1193
  var css7 = `._PianoRollScale_1khhn_1 {
1212
1194
  position: relative;
1213
1195
  width: 100%;
@@ -1257,25 +1239,25 @@ var css7 = `._PianoRollScale_1khhn_1 {
1257
1239
  document.head.appendChild(el);
1258
1240
  }
1259
1241
  })();
1260
- var PianoRollScale_module_css_default = { "pianoRollScale": "_PianoRollScale_1khhn_1", "pianoRollScaleTime": "_PianoRollScale-Time_1khhn_7", "pianoRollScaleLabel": "_PianoRollScale-Label_1khhn_23", "highlighted": "_Highlighted_1khhn_31", "highlightedBorder": "_HighlightedBorder_1khhn_35" };
1242
+ var PianoRollScale_module_css_default = { "PianoRollScale": "_PianoRollScale_1khhn_1", "pianoRollScale": "_PianoRollScale_1khhn_1", "PianoRollScale-Time": "_PianoRollScale-Time_1khhn_7", "pianoRollScaleTime": "_PianoRollScale-Time_1khhn_7", "PianoRollScale-Label": "_PianoRollScale-Label_1khhn_23", "pianoRollScaleLabel": "_PianoRollScale-Label_1khhn_23", "Highlighted": "_Highlighted_1khhn_31", "highlighted": "_Highlighted_1khhn_31", "HighlightedBorder": "_HighlightedBorder_1khhn_35", "highlightedBorder": "_HighlightedBorder_1khhn_35" };
1261
1243
 
1262
1244
  // src/PianoRollScale.tsx
1263
- var PianoRollScale = /* @__PURE__ */ __name(() => {
1245
+ var PianoRollScale = () => {
1264
1246
  const horizontalViewPort = createMemo8(() => useViewPortDimension("horizontal"));
1265
1247
  const grid = usePianoRollGrid_default();
1266
1248
  const context = usePianoRollContext();
1267
- const updatePlayheadPosition = /* @__PURE__ */ __name((event) => {
1249
+ const updatePlayheadPosition = (event) => {
1268
1250
  const position = horizontalViewPort().calculatePosition(event.clientX);
1269
1251
  context.onPlayHeadPositionChange(position, event);
1270
- }, "updatePlayheadPosition");
1252
+ };
1271
1253
  return <div
1272
1254
  class={PianoRollScale_module_css_default.PianoRollScale}
1273
1255
  onMouseDown={(event) => {
1274
1256
  updatePlayheadPosition(event);
1275
- const handleMouseUp = /* @__PURE__ */ __name(() => {
1257
+ const handleMouseUp = () => {
1276
1258
  window.removeEventListener("mousemove", updatePlayheadPosition);
1277
1259
  window.removeEventListener("mouseup", handleMouseUp);
1278
- }, "handleMouseUp");
1260
+ };
1279
1261
  window.addEventListener("mousemove", updatePlayheadPosition);
1280
1262
  window.addEventListener("mouseup", handleMouseUp);
1281
1263
  }}
@@ -1292,11 +1274,11 @@ var PianoRollScale = /* @__PURE__ */ __name(() => {
1292
1274
  }}
1293
1275
  ><Show5 when={entry().showLabel}><div class={PianoRollScale_module_css_default["PianoRollScale-Label"]}>{entry().label}</div></Show5></div></Show5>;
1294
1276
  }}</Index4></div>;
1295
- }, "PianoRollScale");
1277
+ };
1296
1278
  var PianoRollScale_default = PianoRollScale;
1297
1279
 
1298
1280
  // src/PianoRoll.tsx
1299
- var PianoRoll = /* @__PURE__ */ __name((allProps) => {
1281
+ var PianoRoll = (allProps) => {
1300
1282
  const propsWithDefaults = mergeProps4({ showAllTracks: false }, allProps);
1301
1283
  const [context, divProps] = splitContextProps(propsWithDefaults);
1302
1284
  return <PianoRollContextProvider value={context}><div {...divProps} class={PianoRoll_module_css_default.PianoRoll}><PianoRollScrollZoomViewPort_default>
@@ -1356,12 +1338,12 @@ var PianoRoll = /* @__PURE__ */ __name((allProps) => {
1356
1338
  }}
1357
1339
  />
1358
1340
  </PianoRollScrollZoomViewPort_default></div></PianoRollContextProvider>;
1359
- }, "PianoRoll");
1341
+ };
1360
1342
  var PianoRoll_default = PianoRoll;
1361
1343
 
1362
1344
  // src/viewport/PlayHead.tsx
1363
- import { createEffect as createEffect7, createMemo as createMemo9, splitProps as splitProps3 } from "solid-js";
1364
- var PlayHead = /* @__PURE__ */ __name((allProps) => {
1345
+ import { createEffect as createEffect6, createMemo as createMemo9, splitProps as splitProps3 } from "solid-js";
1346
+ var PlayHead = (allProps) => {
1365
1347
  const [props, divProps] = splitProps3(allProps, [
1366
1348
  "position",
1367
1349
  "sync",
@@ -1369,7 +1351,7 @@ var PlayHead = /* @__PURE__ */ __name((allProps) => {
1369
1351
  "dimensionName"
1370
1352
  ]);
1371
1353
  const viewPort = useViewPortDimension(props.dimensionName ?? "horizontal");
1372
- createEffect7(() => {
1354
+ createEffect6(() => {
1373
1355
  if (!props.sync)
1374
1356
  return;
1375
1357
  const maxPosition = viewPort.range;
@@ -1392,39 +1374,39 @@ var PlayHead = /* @__PURE__ */ __name((allProps) => {
1392
1374
  onMouseDown={(event) => {
1393
1375
  event.preventDefault();
1394
1376
  event.stopPropagation();
1395
- const handleMouseMove = /* @__PURE__ */ __name((event2) => {
1377
+ const handleMouseMove = (event2) => {
1396
1378
  const newPosition = viewPort.calculatePosition(event2.clientX);
1397
1379
  props.onPositionChange?.(newPosition, event2);
1398
- }, "handleMouseMove");
1399
- const handleMouseUp = /* @__PURE__ */ __name(() => {
1380
+ };
1381
+ const handleMouseUp = () => {
1400
1382
  window.removeEventListener("mousemove", handleMouseMove);
1401
1383
  window.removeEventListener("mouseup", handleMouseUp);
1402
- }, "handleMouseUp");
1384
+ };
1403
1385
  window.addEventListener("mousemove", handleMouseMove);
1404
1386
  window.addEventListener("mouseup", handleMouseUp);
1405
1387
  }}
1406
1388
  />;
1407
- }, "PlayHead");
1389
+ };
1408
1390
  var PlayHead_default = PlayHead;
1409
1391
 
1410
1392
  // src/useNotes.ts
1411
1393
  import { createSignal as createSignal6 } from "solid-js";
1412
- var useNotes = /* @__PURE__ */ __name(() => {
1394
+ var useNotes = () => {
1413
1395
  const [notes, onNotesChange] = createSignal6([]);
1414
- const onNoteChange = /* @__PURE__ */ __name((index, note) => {
1396
+ const onNoteChange = (index, note) => {
1415
1397
  onNotesChange([...notes().slice(0, index), note, ...notes().splice(index + 1)]);
1416
- }, "onNoteChange");
1417
- const onInsertNote = /* @__PURE__ */ __name((note) => {
1398
+ };
1399
+ const onInsertNote = (note) => {
1418
1400
  const index = Math.max(
1419
1401
  notes().findIndex(({ ticks }) => ticks > note.ticks),
1420
1402
  0
1421
1403
  );
1422
1404
  onNotesChange([...notes().slice(0, index), note, ...notes().splice(index)]);
1423
1405
  return index;
1424
- }, "onInsertNote");
1425
- const onRemoveNote = /* @__PURE__ */ __name((index) => {
1406
+ };
1407
+ const onRemoveNote = (index) => {
1426
1408
  onNotesChange([...notes().slice(0, index), ...notes().splice(index + 1)]);
1427
- }, "onRemoveNote");
1409
+ };
1428
1410
  return {
1429
1411
  notes,
1430
1412
  onNotesChange,
@@ -1432,7 +1414,7 @@ var useNotes = /* @__PURE__ */ __name(() => {
1432
1414
  onInsertNote,
1433
1415
  onRemoveNote
1434
1416
  };
1435
- }, "useNotes");
1417
+ };
1436
1418
  var useNotes_default = useNotes;
1437
1419
  export {
1438
1420
  PianoRoll_default as PianoRoll,