solid-pianoroll 0.0.25 → 0.0.26

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/index.js CHANGED
@@ -5,8 +5,8 @@ import { createStore } from 'solid-js/store';
5
5
  var __defProp = Object.defineProperty;
6
6
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
7
 
8
- // src/PianoRoll.module.css
9
- var _default = {};
8
+ // css-module:./PianoRoll.module.css#css-module
9
+ var PianoRoll_module_default = { "PianoRoll": "_PianoRoll_1v1e7_1", "PianoRollContainer": "_PianoRollContainer_1v1e7_10", "PianoRollLeftColumn": "_PianoRollLeftColumn_1v1e7_17", "showTrackList": "_showTrackList_1v1e7_24", "PianoRollRightColumn": "_PianoRollRightColumn_1v1e7_29" };
10
10
  var defaultState = {
11
11
  ppq: 0,
12
12
  mode: "keys",
@@ -148,8 +148,8 @@ var usePianoRollContext = /* @__PURE__ */ __name(() => {
148
148
  }, "usePianoRollContext");
149
149
  var splitContextProps = /* @__PURE__ */ __name((allProps) => splitProps(allProps, [...pianoRollStatePropNames, "showAllTracks", "showTrackList"]), "splitContextProps");
150
150
 
151
- // src/PianoRollKeys.module.css
152
- var _default2 = {};
151
+ // css-module:./PianoRollKeys.module.css#css-module
152
+ var PianoRollKeys_module_default = { "PianoRollKeys": "_PianoRollKeys_1ne9i_1", "Key": "_Key_1ne9i_14", "black": "_black_1ne9i_29", "white": "_white_1ne9i_38", "down": "_down_1ne9i_46" };
153
153
  function createViewPortDimension(getState) {
154
154
  const getStateWithFunctions = /* @__PURE__ */ __name(() => {
155
155
  const state2 = getState();
@@ -242,8 +242,8 @@ var useViewPortDimension = /* @__PURE__ */ __name((name) => {
242
242
  return viewPort;
243
243
  }, "useViewPortDimension");
244
244
 
245
- // src/viewport/ScrollZoomContainer.module.css
246
- var _default3 = {};
245
+ // css-module:./ScrollZoomContainer.module.css#css-module
246
+ var ScrollZoomContainer_module_default = { "ScrollZoomContainer": "_ScrollZoomContainer_f395r_1" };
247
247
 
248
248
  // src/viewport/ScrollZoomContainer.tsx
249
249
  var _tmpl$ = /* @__PURE__ */ template(`<div><div><div><div></div></div></div></div>`, 8);
@@ -333,7 +333,7 @@ var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
333
333
  },
334
334
  get classList() {
335
335
  return {
336
- [_default3.ScrollZoomContainer]: true,
336
+ [ScrollZoomContainer_module_default.ScrollZoomContainer]: true,
337
337
  ...divProps.classList
338
338
  };
339
339
  }
@@ -419,10 +419,10 @@ var PianoRollKeys = /* @__PURE__ */ __name(() => {
419
419
  };
420
420
  effect((_p$) => {
421
421
  const _v$3 = {
422
- [_default2["Key"]]: true,
423
- [_default2["black"]]: key().isBlack,
424
- [_default2["white"]]: !key().isBlack,
425
- [_default2["down"]]: isDown()
422
+ [PianoRollKeys_module_default["Key"]]: true,
423
+ [PianoRollKeys_module_default["black"]]: key().isBlack,
424
+ [PianoRollKeys_module_default["white"]]: !key().isBlack,
425
+ [PianoRollKeys_module_default["down"]]: isDown()
426
426
  }, _v$4 = key().name, _v$5 = key().number % 12, _v$6 = `${virtualDimensions().offset - virtualDimensions().size * (!key().isBlack ? nextIsBlack ? 1 / 2 : 0 : 0)}px`, _v$7 = `${virtualDimensions().size + (!key().isBlack && nextIsBlack ? virtualDimensions().size / 2 : 0) + (!key().isBlack && previousIsBlack ? virtualDimensions().size / 2 : 0)}px`, _v$8 = `0px 0px ${Math.min(virtualDimensions().size / 20, 1)}px ${Math.min(virtualDimensions().size / 50, 1)}px rgba(0, 0, 0, 0.5) ${key().isBlack ? "" : "inset"}` + isDown() ? `0px 0px ${Math.min(virtualDimensions().size / 8, 2)}px ${Math.min(virtualDimensions().size / 20, 2)}px rgba(0, 0, 0, 0.5) inset` : "";
427
427
  _p$._v$3 = classList(_el$2, _v$3, _p$._v$3);
428
428
  _v$4 !== _p$._v$4 && setAttribute(_el$2, "title", _p$._v$4 = _v$4);
@@ -447,7 +447,7 @@ var PianoRollKeys = /* @__PURE__ */ __name(() => {
447
447
  }
448
448
  }));
449
449
  effect((_p$) => {
450
- const _v$ = _default2.PianoRollKeys, _v$2 = `${horizontalViewPort().pixelSize}px`;
450
+ const _v$ = PianoRollKeys_module_default.PianoRollKeys, _v$2 = `${horizontalViewPort().pixelSize}px`;
451
451
  _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
452
452
  _v$2 !== _p$._v$2 && _el$.style.setProperty("width", _p$._v$2 = _v$2);
453
453
  return _p$;
@@ -470,8 +470,8 @@ var keys = Array.from({
470
470
  var PianoRollKeys_default = PianoRollKeys;
471
471
  delegateEvents(["mousedown", "mouseup"]);
472
472
 
473
- // src/PianoRollNotes.module.css
474
- var _default4 = {};
473
+ // css-module:./PianoRollNotes.module.css#css-module
474
+ var PianoRollNotes_module_default = { "PianoRollNotes": "_PianoRollNotes_u3pew_1", "Note": "_Note_u3pew_12", "trimStart": "_trimStart_u3pew_22", "trimEnd": "_trimEnd_u3pew_26" };
475
475
 
476
476
  // src/PianoRollNotes.tsx
477
477
  var _tmpl$3 = /* @__PURE__ */ template(`<div></div>`, 2);
@@ -548,7 +548,7 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
548
548
  window.addEventListener("mouseup", stopDragging);
549
549
  }, "startDragging");
550
550
  const getClasses = /* @__PURE__ */ __name((noteDragMode2) => {
551
- return noteDragMode2 ? [_default4.Note, _default4[noteDragMode2]] : [_default4.Note];
551
+ return noteDragMode2 ? [PianoRollNotes_module_default.Note, PianoRollNotes_module_default[noteDragMode2]] : [PianoRollNotes_module_default.Note];
552
552
  }, "getClasses");
553
553
  return (() => {
554
554
  const _el$ = _tmpl$3.cloneNode(true);
@@ -655,7 +655,7 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
655
655
  }
656
656
  }));
657
657
  effect((_$p) => classList(_el$, {
658
- [_default4.PianoRollNotes]: true
658
+ [PianoRollNotes_module_default.PianoRollNotes]: true
659
659
  }, _$p));
660
660
  return _el$;
661
661
  })();
@@ -663,8 +663,8 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
663
663
  var PianoRollNotes_default = PianoRollNotes;
664
664
  delegateEvents(["mousedown", "mousemove", "dblclick"]);
665
665
 
666
- // src/PianoRollGrid.module.css
667
- var _default5 = {};
666
+ // css-module:./PianoRollGrid.module.css#css-module
667
+ var PianoRollGrid_module_default = { "PianoRollGrid": "_PianoRollGrid_qke5f_1", "PianoRollGrid-Row": "_PianoRollGrid-Row_qke5f_7", "IsDark": "_IsDark_qke5f_14", "Key": "_Key_qke5f_18", "IsBlackAndNextIsWhite": "_IsBlackAndNextIsWhite_qke5f_21", "PianoRollGrid-Time": "_PianoRollGrid-Time_qke5f_26", "Highlighted": "_Highlighted_qke5f_37", "HighlightedBorder": "_HighlightedBorder_qke5f_41" };
668
668
  var usePianoRollGrid = /* @__PURE__ */ __name(() => {
669
669
  const context = usePianoRollContext();
670
670
  const horizontalViewPort = createMemo(() => useViewPortDimension("horizontal"));
@@ -735,9 +735,9 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
735
735
  const _el$2 = _tmpl$4.cloneNode(true);
736
736
  effect((_p$) => {
737
737
  const _v$ = {
738
- [_default5["PianoRollGrid-Time"]]: true,
739
- [_default5["Highlighted"]]: entry().isHighlighted,
740
- [_default5["HighlightedBorder"]]: entry().hasHighlightedBorder
738
+ [PianoRollGrid_module_default["PianoRollGrid-Time"]]: true,
739
+ [PianoRollGrid_module_default["Highlighted"]]: entry().isHighlighted,
740
+ [PianoRollGrid_module_default["HighlightedBorder"]]: entry().hasHighlightedBorder
741
741
  }, _v$2 = `${entry().virtualDimensions.offset}px`, _v$3 = `${entry().virtualDimensions.size}px`;
742
742
  _p$._v$ = classList(_el$2, _v$, _p$._v$);
743
743
  _v$2 !== _p$._v$2 && _el$2.style.setProperty("left", _p$._v$2 = _v$2);
@@ -770,10 +770,10 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
770
770
  const _el$3 = _tmpl$4.cloneNode(true);
771
771
  effect((_p$) => {
772
772
  const _v$4 = {
773
- [_default5["PianoRollGrid-Row"]]: true,
774
- [_default5["Key"]]: true,
775
- [_default5["IsDark"]]: key().isBlack,
776
- [_default5["IsBlackAndNextIsWhite"]]: !key().isBlack && !blackKeys.includes((key().number + 1) % 12)
773
+ [PianoRollGrid_module_default["PianoRollGrid-Row"]]: true,
774
+ [PianoRollGrid_module_default["Key"]]: true,
775
+ [PianoRollGrid_module_default["IsDark"]]: key().isBlack,
776
+ [PianoRollGrid_module_default["IsBlackAndNextIsWhite"]]: !key().isBlack && !blackKeys.includes((key().number + 1) % 12)
777
777
  }, _v$5 = `${virtualDimensions().offset}px`, _v$6 = `${virtualDimensions().size}px`;
778
778
  _p$._v$4 = classList(_el$3, _v$4, _p$._v$4);
779
779
  _v$5 !== _p$._v$5 && _el$3.style.setProperty("top", _p$._v$5 = _v$5);
@@ -810,8 +810,8 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
810
810
  const _el$4 = _tmpl$4.cloneNode(true);
811
811
  effect((_p$) => {
812
812
  const _v$7 = {
813
- [_default5["PianoRollGrid-Row"]]: true,
814
- [_default5["IsDark"]]: index() % 2 === 0
813
+ [PianoRollGrid_module_default["PianoRollGrid-Row"]]: true,
814
+ [PianoRollGrid_module_default["IsDark"]]: index() % 2 === 0
815
815
  }, _v$8 = `${virtualDimensions().offset}px`, _v$9 = `${virtualDimensions().size}px`;
816
816
  _p$._v$7 = classList(_el$4, _v$7, _p$._v$7);
817
817
  _v$8 !== _p$._v$8 && _el$4.style.setProperty("top", _p$._v$8 = _v$8);
@@ -829,7 +829,7 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
829
829
  });
830
830
  }
831
831
  }), null);
832
- effect(() => className(_el$, _default5.PianoRollGrid));
832
+ effect(() => className(_el$, PianoRollGrid_module_default.PianoRollGrid));
833
833
  return _el$;
834
834
  })();
835
835
  }, "PianoRollGrid");
@@ -886,8 +886,8 @@ var ZoomSliderControl = /* @__PURE__ */ __name((props) => {
886
886
  }, "ZoomSliderControl");
887
887
  var ZoomSliderControl_default = ZoomSliderControl;
888
888
 
889
- // src/PianoRollTrackList.module.css
890
- var _default6 = {};
889
+ // css-module:./PianoRollTrackList.module.css#css-module
890
+ var PianoRollTrackList_module_default = { "PianoRollTrackList": "_PianoRollTrackList_11kti_1", "Track": "_Track_11kti_7", "selected": "_selected_11kti_21" };
891
891
  var _tmpl$6 = /* @__PURE__ */ template(`<div></div>`, 2);
892
892
  var _tmpl$22 = /* @__PURE__ */ template(`<div> </div>`, 2);
893
893
  var PianoRollTrackList = /* @__PURE__ */ __name(() => {
@@ -912,8 +912,8 @@ var PianoRollTrackList = /* @__PURE__ */ __name(() => {
912
912
  insert(_el$2, () => track().name || "[unnamed track]", null);
913
913
  effect((_p$) => {
914
914
  const _v$ = {
915
- [_default6["Track"]]: true,
916
- [_default6["selected"]]: index === context.selectedTrackIndex
915
+ [PianoRollTrackList_module_default["Track"]]: true,
916
+ [PianoRollTrackList_module_default["selected"]]: index === context.selectedTrackIndex
917
917
  }, _v$2 = track().name, _v$3 = `${virtualDimensions().offset}px`, _v$4 = `${virtualDimensions().size}px`;
918
918
  _p$._v$ = classList(_el$2, _v$, _p$._v$);
919
919
  _v$2 !== _p$._v$2 && setAttribute(_el$2, "title", _p$._v$2 = _v$2);
@@ -931,7 +931,7 @@ var PianoRollTrackList = /* @__PURE__ */ __name(() => {
931
931
  });
932
932
  }
933
933
  }));
934
- effect(() => className(_el$, _default6.PianoRollTrackList));
934
+ effect(() => className(_el$, PianoRollTrackList_module_default.PianoRollTrackList));
935
935
  return _el$;
936
936
  })();
937
937
  }, "PianoRollTrackList");
@@ -1059,8 +1059,8 @@ var PianoRollTrackListScroller = /* @__PURE__ */ __name((props) => {
1059
1059
  }, "PianoRollTrackListScroller");
1060
1060
  var PianoRollTrackListScroller_default = PianoRollTrackListScroller;
1061
1061
 
1062
- // src/PianoRollScale.module.css
1063
- var _default7 = {};
1062
+ // css-module:./PianoRollScale.module.css#css-module
1063
+ var PianoRollScale_module_default = { "PianoRollScale": "_PianoRollScale_1khhn_1", "PianoRollScale-Time": "_PianoRollScale-Time_1khhn_7", "PianoRollScale-Label": "_PianoRollScale-Label_1khhn_23", "Highlighted": "_Highlighted_1khhn_31", "HighlightedBorder": "_HighlightedBorder_1khhn_35" };
1064
1064
 
1065
1065
  // src/PianoRollScale.tsx
1066
1066
  var _tmpl$7 = /* @__PURE__ */ template(`<div></div>`, 2);
@@ -1101,15 +1101,15 @@ var PianoRollScale = /* @__PURE__ */ __name(() => {
1101
1101
  get children() {
1102
1102
  const _el$3 = _tmpl$7.cloneNode(true);
1103
1103
  insert(_el$3, () => entry().label);
1104
- effect(() => className(_el$3, _default7["PianoRollScale-Label"]));
1104
+ effect(() => className(_el$3, PianoRollScale_module_default["PianoRollScale-Label"]));
1105
1105
  return _el$3;
1106
1106
  }
1107
1107
  }));
1108
1108
  effect((_p$) => {
1109
1109
  const _v$ = {
1110
- [_default7["PianoRollScale-Time"]]: true,
1111
- [_default7["Highlighted"]]: entry().isHighlighted,
1112
- [_default7["HighlightedBorder"]]: entry().hasHighlightedBorder
1110
+ [PianoRollScale_module_default["PianoRollScale-Time"]]: true,
1111
+ [PianoRollScale_module_default["Highlighted"]]: entry().isHighlighted,
1112
+ [PianoRollScale_module_default["HighlightedBorder"]]: entry().hasHighlightedBorder
1113
1113
  }, _v$2 = `${entry().virtualDimensions.offset}px`, _v$3 = `${entry().virtualDimensions.size}px`;
1114
1114
  _p$._v$ = classList(_el$2, _v$, _p$._v$);
1115
1115
  _v$2 !== _p$._v$2 && _el$2.style.setProperty("left", _p$._v$2 = _v$2);
@@ -1125,7 +1125,7 @@ var PianoRollScale = /* @__PURE__ */ __name(() => {
1125
1125
  });
1126
1126
  }
1127
1127
  }));
1128
- effect(() => className(_el$, _default7.PianoRollScale));
1128
+ effect(() => className(_el$, PianoRollScale_module_default.PianoRollScale));
1129
1129
  return _el$;
1130
1130
  })();
1131
1131
  }, "PianoRollScale");
@@ -1148,7 +1148,7 @@ var PianoRoll = /* @__PURE__ */ __name((allProps) => {
1148
1148
  const _el$ = _tmpl$42.cloneNode(true);
1149
1149
  spread(_el$, mergeProps$1(divProps, {
1150
1150
  get ["class"]() {
1151
- return _default.PianoRoll;
1151
+ return PianoRoll_module_default.PianoRoll;
1152
1152
  }
1153
1153
  }), false, true);
1154
1154
  insert(_el$, createComponent(PianoRollScrollZoomViewPort_default, {
@@ -1227,9 +1227,9 @@ var PianoRoll = /* @__PURE__ */ __name((allProps) => {
1227
1227
  }
1228
1228
  }), null);
1229
1229
  effect((_p$) => {
1230
- const _v$ = _default.PianoRollContainer, _v$2 = {
1231
- [_default.PianoRollLeftColumn]: true,
1232
- [_default.showTrackList]: context.showTrackList
1230
+ const _v$ = PianoRoll_module_default.PianoRollContainer, _v$2 = {
1231
+ [PianoRoll_module_default.PianoRollLeftColumn]: true,
1232
+ [PianoRoll_module_default.showTrackList]: context.showTrackList
1233
1233
  };
1234
1234
  _v$ !== _p$._v$ && className(_el$2, _p$._v$ = _v$);
1235
1235
  _p$._v$2 = classList(_el$3, _v$2, _p$._v$2);
package/dist/index.jsx CHANGED
@@ -1,8 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
- // src/PianoRoll.module.css
5
- var _default = {};
4
+ // css-module:./PianoRoll.module.css#css-module
5
+ var PianoRoll_module_default = { "PianoRoll": "_PianoRoll_1v1e7_1", "PianoRollContainer": "_PianoRollContainer_1v1e7_10", "PianoRollLeftColumn": "_PianoRollLeftColumn_1v1e7_17", "showTrackList": "_showTrackList_1v1e7_24", "PianoRollRightColumn": "_PianoRollRightColumn_1v1e7_29" };
6
6
 
7
7
  // src/PianoRoll.tsx
8
8
  import { Show as Show6, mergeProps as mergeProps4 } from "solid-js";
@@ -154,8 +154,8 @@ var usePianoRollContext = /* @__PURE__ */ __name(() => {
154
154
  }, "usePianoRollContext");
155
155
  var splitContextProps = /* @__PURE__ */ __name((allProps) => splitProps(allProps, [...pianoRollStatePropNames, "showAllTracks", "showTrackList"]), "splitContextProps");
156
156
 
157
- // src/PianoRollKeys.module.css
158
- var _default2 = {};
157
+ // css-module:./PianoRollKeys.module.css#css-module
158
+ var PianoRollKeys_module_default = { "PianoRollKeys": "_PianoRollKeys_1ne9i_1", "Key": "_Key_1ne9i_14", "black": "_black_1ne9i_29", "white": "_white_1ne9i_38", "down": "_down_1ne9i_46" };
159
159
 
160
160
  // src/PianoRollKeys.tsx
161
161
  import { createEffect as createEffect3, createMemo as createMemo2, createSignal, Index, Show } from "solid-js";
@@ -256,8 +256,8 @@ var useViewPortDimension = /* @__PURE__ */ __name((name) => {
256
256
  // src/viewport/ScrollZoomContainer.tsx
257
257
  import { createEffect as createEffect2, createMemo, mergeProps as mergeProps2, splitProps as splitProps2 } from "solid-js";
258
258
 
259
- // src/viewport/ScrollZoomContainer.module.css
260
- var _default3 = {};
259
+ // css-module:./ScrollZoomContainer.module.css#css-module
260
+ var ScrollZoomContainer_module_default = { "ScrollZoomContainer": "_ScrollZoomContainer_f395r_1" };
261
261
 
262
262
  // src/viewport/ScrollZoomContainer.tsx
263
263
  var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
@@ -356,7 +356,7 @@ var ScrollZoomContainer = /* @__PURE__ */ __name((props) => {
356
356
  ...typeof divProps.style === "object" && divProps.style
357
357
  }}
358
358
  classList={{
359
- [_default3.ScrollZoomContainer]: true,
359
+ [ScrollZoomContainer_module_default.ScrollZoomContainer]: true,
360
360
  ...divProps.classList
361
361
  }}
362
362
  ><div ref={scrollContentRef}><div
@@ -394,7 +394,7 @@ var PianoRollKeys = /* @__PURE__ */ __name(() => {
394
394
  window.removeEventListener("mouseup", handleMouseUp);
395
395
  }
396
396
  });
397
- return <div class={_default2.PianoRollKeys} style={{ width: `${horizontalViewPort().pixelSize}px` }}><ScrollZoomContainer_default horizontalDimensionName="horizontalKeys" showScrollbar={false}><Index each={keys}>{(key) => {
397
+ return <div class={PianoRollKeys_module_default.PianoRollKeys} style={{ width: `${horizontalViewPort().pixelSize}px` }}><ScrollZoomContainer_default horizontalDimensionName="horizontalKeys" showScrollbar={false}><Index each={keys}>{(key) => {
398
398
  const isDown = createMemo2(
399
399
  () => context.isKeyDown(context.selectedTrackIndex, key().number)
400
400
  );
@@ -405,10 +405,10 @@ var PianoRollKeys = /* @__PURE__ */ __name(() => {
405
405
  const nextIsBlack = blackKeys.includes((key().number + 1) % 12);
406
406
  return <Show when={verticalViewPort().isVisible(virtualDimensions())}><div
407
407
  classList={{
408
- [_default2["Key"]]: true,
409
- [_default2["black"]]: key().isBlack,
410
- [_default2["white"]]: !key().isBlack,
411
- [_default2["down"]]: isDown()
408
+ [PianoRollKeys_module_default["Key"]]: true,
409
+ [PianoRollKeys_module_default["black"]]: key().isBlack,
410
+ [PianoRollKeys_module_default["white"]]: !key().isBlack,
411
+ [PianoRollKeys_module_default["down"]]: isDown()
412
412
  }}
413
413
  onMouseDown={() => {
414
414
  setIsMouseDown(true);
@@ -455,8 +455,8 @@ var PianoRollKeys_default = PianoRollKeys;
455
455
  // src/PianoRollNotes.tsx
456
456
  import { createMemo as createMemo3, createSignal as createSignal2, For, Show as Show2 } from "solid-js";
457
457
 
458
- // src/PianoRollNotes.module.css
459
- var _default4 = {};
458
+ // css-module:./PianoRollNotes.module.css#css-module
459
+ var PianoRollNotes_module_default = { "PianoRollNotes": "_PianoRollNotes_u3pew_1", "Note": "_Note_u3pew_12", "trimStart": "_trimStart_u3pew_22", "trimEnd": "_trimEnd_u3pew_26" };
460
460
 
461
461
  // src/PianoRollNotes.tsx
462
462
  var PianoRollNotes = /* @__PURE__ */ __name((props) => {
@@ -541,10 +541,10 @@ var PianoRollNotes = /* @__PURE__ */ __name((props) => {
541
541
  window.addEventListener("mouseup", stopDragging);
542
542
  }, "startDragging");
543
543
  const getClasses = /* @__PURE__ */ __name((noteDragMode2) => {
544
- return noteDragMode2 ? [_default4.Note, _default4[noteDragMode2]] : [_default4.Note];
544
+ return noteDragMode2 ? [PianoRollNotes_module_default.Note, PianoRollNotes_module_default[noteDragMode2]] : [PianoRollNotes_module_default.Note];
545
545
  }, "getClasses");
546
546
  return <div
547
- classList={{ [_default4.PianoRollNotes]: true }}
547
+ classList={{ [PianoRollNotes_module_default.PianoRollNotes]: true }}
548
548
  ref={props.ref}
549
549
  onMouseDown={(mouseDownEvent) => {
550
550
  mouseDownEvent.preventDefault();
@@ -639,8 +639,8 @@ var PianoRollNotes_default = PianoRollNotes;
639
639
  // src/PianoRollGrid.tsx
640
640
  import { createMemo as createMemo5, For as For2, Index as Index2, Show as Show3 } from "solid-js";
641
641
 
642
- // src/PianoRollGrid.module.css
643
- var _default5 = {};
642
+ // css-module:./PianoRollGrid.module.css#css-module
643
+ var PianoRollGrid_module_default = { "PianoRollGrid": "_PianoRollGrid_qke5f_1", "PianoRollGrid-Row": "_PianoRollGrid-Row_qke5f_7", "IsDark": "_IsDark_qke5f_14", "Key": "_Key_qke5f_18", "IsBlackAndNextIsWhite": "_IsBlackAndNextIsWhite_qke5f_21", "PianoRollGrid-Time": "_PianoRollGrid-Time_qke5f_26", "Highlighted": "_Highlighted_qke5f_37", "HighlightedBorder": "_HighlightedBorder_qke5f_41" };
644
644
 
645
645
  // src/usePianoRollGrid.ts
646
646
  import { createMemo as createMemo4 } from "solid-js";
@@ -700,13 +700,13 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
700
700
  );
701
701
  const horizontalViewPort = createMemo5(() => useViewPortDimension("horizontal"));
702
702
  const gridArray = usePianoRollGrid_default();
703
- return <div class={_default5.PianoRollGrid}>
703
+ return <div class={PianoRollGrid_module_default.PianoRollGrid}>
704
704
  <Index2 each={gridArray()}>{(entry) => {
705
705
  return <Show3 when={horizontalViewPort().isVisible(entry().virtualDimensions)}><div
706
706
  classList={{
707
- [_default5["PianoRollGrid-Time"]]: true,
708
- [_default5["Highlighted"]]: entry().isHighlighted,
709
- [_default5["HighlightedBorder"]]: entry().hasHighlightedBorder
707
+ [PianoRollGrid_module_default["PianoRollGrid-Time"]]: true,
708
+ [PianoRollGrid_module_default["Highlighted"]]: entry().isHighlighted,
709
+ [PianoRollGrid_module_default["HighlightedBorder"]]: entry().hasHighlightedBorder
710
710
  }}
711
711
  style={{
712
712
  left: `${entry().virtualDimensions.offset}px`,
@@ -720,10 +720,10 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
720
720
  );
721
721
  return <Show3 when={verticalViewPort().isVisible(virtualDimensions())}><div
722
722
  classList={{
723
- [_default5["PianoRollGrid-Row"]]: true,
724
- [_default5["Key"]]: true,
725
- [_default5["IsDark"]]: key().isBlack,
726
- [_default5["IsBlackAndNextIsWhite"]]: !key().isBlack && !blackKeys.includes((key().number + 1) % 12)
723
+ [PianoRollGrid_module_default["PianoRollGrid-Row"]]: true,
724
+ [PianoRollGrid_module_default["Key"]]: true,
725
+ [PianoRollGrid_module_default["IsDark"]]: key().isBlack,
726
+ [PianoRollGrid_module_default["IsBlackAndNextIsWhite"]]: !key().isBlack && !blackKeys.includes((key().number + 1) % 12)
727
727
  }}
728
728
  style={{
729
729
  top: `${virtualDimensions().offset}px`,
@@ -737,8 +737,8 @@ var PianoRollGrid = /* @__PURE__ */ __name(() => {
737
737
  );
738
738
  return <Show3 when={verticalViewPort().isVisible(virtualDimensions())}><div
739
739
  classList={{
740
- [_default5["PianoRollGrid-Row"]]: true,
741
- [_default5["IsDark"]]: index() % 2 === 0
740
+ [PianoRollGrid_module_default["PianoRollGrid-Row"]]: true,
741
+ [PianoRollGrid_module_default["IsDark"]]: index() % 2 === 0
742
742
  }}
743
743
  style={{
744
744
  top: `${virtualDimensions().offset}px`,
@@ -790,20 +790,20 @@ var ZoomSliderControl = /* @__PURE__ */ __name((props) => {
790
790
  }, "ZoomSliderControl");
791
791
  var ZoomSliderControl_default = ZoomSliderControl;
792
792
 
793
- // src/PianoRollTrackList.module.css
794
- var _default6 = {};
793
+ // css-module:./PianoRollTrackList.module.css#css-module
794
+ var PianoRollTrackList_module_default = { "PianoRollTrackList": "_PianoRollTrackList_11kti_1", "Track": "_Track_11kti_7", "selected": "_selected_11kti_21" };
795
795
 
796
796
  // src/PianoRollTrackList.tsx
797
797
  import { createMemo as createMemo7, Index as Index3, Show as Show4 } from "solid-js";
798
798
  var PianoRollTrackList = /* @__PURE__ */ __name(() => {
799
799
  const viewPort = createMemo7(() => useViewPortDimension("verticalTracks"));
800
800
  const context = usePianoRollContext();
801
- return <div class={_default6.PianoRollTrackList}><Index3 each={context.tracks}>{(track, index) => {
801
+ return <div class={PianoRollTrackList_module_default.PianoRollTrackList}><Index3 each={context.tracks}>{(track, index) => {
802
802
  const virtualDimensions = createMemo7(() => viewPort().calculatePixelDimensions(index, 1));
803
803
  return <Show4 when={virtualDimensions().size > 0}><div
804
804
  classList={{
805
- [_default6["Track"]]: true,
806
- [_default6["selected"]]: index === context.selectedTrackIndex
805
+ [PianoRollTrackList_module_default["Track"]]: true,
806
+ [PianoRollTrackList_module_default["selected"]]: index === context.selectedTrackIndex
807
807
  }}
808
808
  title={track().name}
809
809
  style={{
@@ -944,8 +944,8 @@ var PianoRollTrackListScroller_default = PianoRollTrackListScroller;
944
944
  // src/PianoRollScale.tsx
945
945
  import { createMemo as createMemo8, Index as Index4, Show as Show5 } from "solid-js";
946
946
 
947
- // src/PianoRollScale.module.css
948
- var _default7 = {};
947
+ // css-module:./PianoRollScale.module.css#css-module
948
+ var PianoRollScale_module_default = { "PianoRollScale": "_PianoRollScale_1khhn_1", "PianoRollScale-Time": "_PianoRollScale-Time_1khhn_7", "PianoRollScale-Label": "_PianoRollScale-Label_1khhn_23", "Highlighted": "_Highlighted_1khhn_31", "HighlightedBorder": "_HighlightedBorder_1khhn_35" };
949
949
 
950
950
  // src/PianoRollScale.tsx
951
951
  var PianoRollScale = /* @__PURE__ */ __name(() => {
@@ -957,7 +957,7 @@ var PianoRollScale = /* @__PURE__ */ __name(() => {
957
957
  context.onPlayHeadPositionChange(position, event);
958
958
  }, "updatePlayheadPosition");
959
959
  return <div
960
- class={_default7.PianoRollScale}
960
+ class={PianoRollScale_module_default.PianoRollScale}
961
961
  onMouseDown={(event) => {
962
962
  updatePlayheadPosition(event);
963
963
  const handleMouseUp = /* @__PURE__ */ __name(() => {
@@ -970,15 +970,15 @@ var PianoRollScale = /* @__PURE__ */ __name(() => {
970
970
  ><Index4 each={grid()}>{(entry) => {
971
971
  return <Show5 when={horizontalViewPort().isVisible(entry().virtualDimensions)}><div
972
972
  classList={{
973
- [_default7["PianoRollScale-Time"]]: true,
974
- [_default7["Highlighted"]]: entry().isHighlighted,
975
- [_default7["HighlightedBorder"]]: entry().hasHighlightedBorder
973
+ [PianoRollScale_module_default["PianoRollScale-Time"]]: true,
974
+ [PianoRollScale_module_default["Highlighted"]]: entry().isHighlighted,
975
+ [PianoRollScale_module_default["HighlightedBorder"]]: entry().hasHighlightedBorder
976
976
  }}
977
977
  style={{
978
978
  left: `${entry().virtualDimensions.offset}px`,
979
979
  width: `${entry().virtualDimensions.size}px`
980
980
  }}
981
- ><Show5 when={entry().showLabel}><div class={_default7["PianoRollScale-Label"]}>{entry().label}</div></Show5></div></Show5>;
981
+ ><Show5 when={entry().showLabel}><div class={PianoRollScale_module_default["PianoRollScale-Label"]}>{entry().label}</div></Show5></div></Show5>;
982
982
  }}</Index4></div>;
983
983
  }, "PianoRollScale");
984
984
  var PianoRollScale_default = PianoRollScale;
@@ -987,13 +987,13 @@ var PianoRollScale_default = PianoRollScale;
987
987
  var PianoRoll = /* @__PURE__ */ __name((allProps) => {
988
988
  const propsWithDefaults = mergeProps4({ showAllTracks: false }, allProps);
989
989
  const [context, divProps] = splitContextProps(propsWithDefaults);
990
- return <PianoRollContextProvider value={context}><div {...divProps} class={_default.PianoRoll}><PianoRollScrollZoomViewPort_default>
991
- <div class={_default.PianoRollContainer}>
990
+ return <PianoRollContextProvider value={context}><div {...divProps} class={PianoRoll_module_default.PianoRoll}><PianoRollScrollZoomViewPort_default>
991
+ <div class={PianoRoll_module_default.PianoRollContainer}>
992
992
  <ZoomSliderControl_default orientation="vertical" dimensionName="verticalTracks" />
993
993
  <div
994
994
  classList={{
995
- [_default.PianoRollLeftColumn]: true,
996
- [_default.showTrackList]: context.showTrackList
995
+ [PianoRoll_module_default.PianoRollLeftColumn]: true,
996
+ [PianoRoll_module_default.showTrackList]: context.showTrackList
997
997
  }}
998
998
  >
999
999
  <Show6 when={context.showTrackList}><div
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.25",
2
+ "version": "0.0.26",
3
3
  "name": "solid-pianoroll",
4
4
  "description": "Pianoroll UI Control for Solid JS apps",
5
5
  "license": "MIT",
@@ -63,10 +63,13 @@
63
63
  "solid-js": "^1.6.0"
64
64
  },
65
65
  "devDependencies": {
66
+ "autoprefixer": "^10.4.13",
66
67
  "concurrently": "^7.6.0",
67
68
  "esbuild": "^0.17.5",
68
69
  "esbuild-plugin-solid": "^0.5.0",
69
70
  "jsdom": "^21.1.0",
71
+ "postcss": "^8.4.21",
72
+ "postcss-modules": "^6.0.0",
70
73
  "prettier": "2.8.3",
71
74
  "sass": "^1.57.1",
72
75
  "solid-js": "^1.6.9",