@weasel-js/ui 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/chunks/{Badge-BXTDs-zi.js → Badge-7yQseqZb.js} +233 -263
  2. package/dist/chunks/Badge-7yQseqZb.js.map +1 -0
  3. package/dist/chunks/BandEditor-DjOi4ldl.js +252 -0
  4. package/dist/chunks/BandEditor-DjOi4ldl.js.map +1 -0
  5. package/dist/chunks/{CurveEditor-Cpuvl_iN.js → CurveEditor-DoX5Q0_V.js} +192 -195
  6. package/dist/chunks/CurveEditor-DoX5Q0_V.js.map +1 -0
  7. package/dist/chunks/{DataGrid-BWZZUekH.js → DataGrid-DHV0chfL.js} +2 -5
  8. package/dist/chunks/DataGrid-DHV0chfL.js.map +1 -0
  9. package/dist/chunks/{DetentSlider--tQdVQj_.js → DetentSlider-Cd5360U3.js} +2 -2
  10. package/dist/chunks/{DetentSlider--tQdVQj_.js.map → DetentSlider-Cd5360U3.js.map} +1 -1
  11. package/dist/chunks/{GradientEditor-C5pPbMa_.js → GradientEditor-CPeTbkFE.js} +11 -9
  12. package/dist/chunks/{GradientEditor-C5pPbMa_.js.map → GradientEditor-CPeTbkFE.js.map} +1 -1
  13. package/dist/chunks/{LayerStack-htMwIsJ6.js → LayerStack-BVdwhAhG.js} +2 -5
  14. package/dist/chunks/{LayerStack-htMwIsJ6.js.map → LayerStack-BVdwhAhG.js.map} +1 -1
  15. package/dist/chunks/{PaintInput-DtCSGda0.js → PaintInput-6HTUAFL1.js} +2 -2
  16. package/dist/chunks/{PaintInput-DtCSGda0.js.map → PaintInput-6HTUAFL1.js.map} +1 -1
  17. package/dist/chunks/{PointPlotter-CR-QGCIf.js → PointPlotter-CZJE8Ccu.js} +2 -2
  18. package/dist/chunks/{PointPlotter-CR-QGCIf.js.map → PointPlotter-CZJE8Ccu.js.map} +1 -1
  19. package/dist/chunks/{Powerline--gx4j0Zr.js → Powerline-BY_ADnqq.js} +2 -2
  20. package/dist/chunks/{Powerline--gx4j0Zr.js.map → Powerline-BY_ADnqq.js.map} +1 -1
  21. package/dist/chunks/{Properties-BEGlt0Z2.js → Properties-BuNzy7Hb.js} +2 -2
  22. package/dist/chunks/{Properties-BEGlt0Z2.js.map → Properties-BuNzy7Hb.js.map} +1 -1
  23. package/dist/chunks/ResizeHandle-DfqqfaZz.js +79 -0
  24. package/dist/chunks/ResizeHandle-DfqqfaZz.js.map +1 -0
  25. package/dist/chunks/{SelectionPanel-OfbtyDJH.js → SelectionPanel-BU2cmRtp.js} +2 -2
  26. package/dist/chunks/{SelectionPanel-OfbtyDJH.js.map → SelectionPanel-BU2cmRtp.js.map} +1 -1
  27. package/dist/chunks/Slider-BE6jaxyU.js +303 -0
  28. package/dist/chunks/Slider-BE6jaxyU.js.map +1 -0
  29. package/dist/chunks/{Timeline-BE7UWajy.js → Timeline-CWuh0nV0.js} +219 -205
  30. package/dist/chunks/Timeline-CWuh0nV0.js.map +1 -0
  31. package/dist/chunks/useReorderDragList-UvHJFjTZ.js +106 -0
  32. package/dist/chunks/useReorderDragList-UvHJFjTZ.js.map +1 -0
  33. package/dist/components/Badge/Badge.d.ts.map +1 -1
  34. package/dist/components/Badge/index.js +1 -1
  35. package/dist/components/Badge/shapes/Perforated.d.ts.map +1 -1
  36. package/dist/components/Badge/shapes/Shield.d.ts.map +1 -1
  37. package/dist/components/Badge/useSvgBox.d.ts +10 -0
  38. package/dist/components/Badge/useSvgBox.d.ts.map +1 -0
  39. package/dist/components/BandEditor/BandEditor.d.ts.map +1 -1
  40. package/dist/components/BandEditor/index.js +1 -1
  41. package/dist/components/CurveEditor/LayeredCurveEditor.d.ts.map +1 -1
  42. package/dist/components/CurveEditor/index.js +1 -1
  43. package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
  44. package/dist/components/DataGrid/index.js +1 -1
  45. package/dist/components/DetentSlider/index.js +1 -1
  46. package/dist/components/GradientEditor/index.js +1 -1
  47. package/dist/components/LayerStack/LayerStack.d.ts.map +1 -1
  48. package/dist/components/LayerStack/index.js +1 -1
  49. package/dist/components/PaintInput/index.js +1 -1
  50. package/dist/components/PointPlotter/index.js +1 -1
  51. package/dist/components/Powerline/index.js +2 -2
  52. package/dist/components/Properties/index.js +1 -1
  53. package/dist/components/ResizeHandle/ResizeHandle.d.ts.map +1 -1
  54. package/dist/components/ResizeHandle/index.js +1 -1
  55. package/dist/components/SelectionPanel/index.js +1 -1
  56. package/dist/components/Slider/Slider.d.ts.map +1 -1
  57. package/dist/components/Slider/index.js +1 -1
  58. package/dist/components/Timeline/Lane.d.ts.map +1 -1
  59. package/dist/components/Timeline/Ruler.d.ts.map +1 -1
  60. package/dist/components/Timeline/index.js +1 -1
  61. package/dist/index.js +16 -16
  62. package/dist/useReorderDragList.d.ts +20 -7
  63. package/dist/useReorderDragList.d.ts.map +1 -1
  64. package/package.json +6 -6
  65. package/dist/chunks/Badge-BXTDs-zi.js.map +0 -1
  66. package/dist/chunks/BandEditor-CfLW44uR.js +0 -248
  67. package/dist/chunks/BandEditor-CfLW44uR.js.map +0 -1
  68. package/dist/chunks/CurveEditor-Cpuvl_iN.js.map +0 -1
  69. package/dist/chunks/DataGrid-BWZZUekH.js.map +0 -1
  70. package/dist/chunks/ResizeHandle-DjGZkPpx.js +0 -81
  71. package/dist/chunks/ResizeHandle-DjGZkPpx.js.map +0 -1
  72. package/dist/chunks/Slider-CSwL-Nj9.js +0 -296
  73. package/dist/chunks/Slider-CSwL-Nj9.js.map +0 -1
  74. package/dist/chunks/Timeline-BE7UWajy.js.map +0 -1
  75. package/dist/chunks/useReorderDragList-nQMVwNBd.js +0 -109
  76. package/dist/chunks/useReorderDragList-nQMVwNBd.js.map +0 -1
@@ -17,9 +17,20 @@ export interface UseReorderDragListOptions {
17
17
  items: LayerListItem[];
18
18
  selectedIds: string[];
19
19
  onReorder(ids: string[], targetIndex: number): void;
20
+ /** A press that was released without ever engaging a drag — the click a
21
+ * list row means by it. Fires for locked rows too, which can be selected
22
+ * but not dragged. Modifiers are read at press, not at release. */
23
+ onPress?(id: string, mods: PressModifiers): void;
20
24
  /** Pointer-move distance (px) before pending drag engages. Default 4. */
21
25
  threshold?: number;
22
26
  }
27
+ /** Modifier keys held when a press began. */
28
+ export interface PressModifiers {
29
+ shiftKey: boolean;
30
+ ctrlKey: boolean;
31
+ metaKey: boolean;
32
+ altKey: boolean;
33
+ }
23
34
  /**
24
35
  * Live drag state for rendering feedback: which ids are being dragged and the
25
36
  * insertion index the drop would use. Both `null` when no drag is engaged.
@@ -29,8 +40,10 @@ export interface ReorderDragState {
29
40
  targetIndex: number | null;
30
41
  }
31
42
  /**
32
- * Props to spread onto the list container and each row, plus the live
33
- * {@link ReorderDragState}.
43
+ * A `ref` for the list container, an `onPointerDown` for each row, and the
44
+ * live {@link ReorderDragState}. The container ref is required, not optional
45
+ * decoration: it is what the drop index is measured against and what the
46
+ * pointer session is opened on.
34
47
  */
35
48
  export interface ReorderDragHandlers {
36
49
  rowProps(id: string, index: number): {
@@ -38,9 +51,6 @@ export interface ReorderDragHandlers {
38
51
  };
39
52
  containerProps: {
40
53
  ref: RefCallback<HTMLElement>;
41
- onPointerMove(e: ReactPointerEvent): void;
42
- onPointerUp(e: ReactPointerEvent): void;
43
- onPointerCancel(e: ReactPointerEvent): void;
44
54
  };
45
55
  state: ReorderDragState;
46
56
  }
@@ -51,8 +61,11 @@ export interface ReorderDragHandlers {
51
61
  * drop. A drop that would leave a contiguous block where it already is does
52
62
  * not call `onReorder`.
53
63
  *
54
- * The pointer is captured on the row, so a drag that leaves the list still
55
- * tracks and still releases cleanly.
64
+ * A press opens an `openPointerSession` on the *container*, which owns the
65
+ * rest of the gesture: a drag that leaves the list still tracks, a release
66
+ * anywhere still drops, and a release the window never delivered still ends
67
+ * the drag. The container is the origin rather than the row because rows come
68
+ * and go as the list re-renders, and a drag must outlive the row it grabbed.
56
69
  */
57
70
  export declare function useReorderDragList(opts: UseReorderDragListOptions): ReorderDragHandlers;
58
71
  //# sourceMappingURL=useReorderDragList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useReorderDragList.d.ts","sourceRoot":"","sources":["../src/useReorderDragList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,IAAI,iBAAiB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEvF,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB;8DAC0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;QAAE,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;KAAE,CAAC;IACnF,cAAc,EAAE;QACd,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;QAC9B,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;QAC1C,WAAW,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;QACxC,eAAe,CAAC,CAAC,EAAE,iBAAiB,GAAG,I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B;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;QAAE,aAAa,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;KAAE,CAAC;IACnF,cAAc,EAAE;QACd,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;KAC/B,CAAC;IACF,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAyCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,yBAAyB,GAAG,mBAAmB,CA+FvF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weasel-js/ui",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "UI chrome primitives for weasel apps (properties panel, etc.)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,15 +23,15 @@
23
23
  "./package.json": "./package.json"
24
24
  },
25
25
  "dependencies": {
26
- "@weasel-js/font": "1.4.0",
27
- "@weasel-js/modes": "1.4.0",
28
- "@weasel-js/svg": "1.4.0",
26
+ "@weasel-js/font": "1.4.1",
27
+ "@weasel-js/modes": "1.4.1",
28
+ "@weasel-js/svg": "1.4.1",
29
29
  "react-aria-components": "^1.5.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=18",
33
33
  "react-dom": ">=18",
34
- "@weasel-js/core": "1.4.0"
34
+ "@weasel-js/core": "1.4.1"
35
35
  },
36
36
  "author": "orochi235",
37
37
  "homepage": "https://orochi235.github.io/weasel/",
@@ -59,6 +59,6 @@
59
59
  "provenance": true
60
60
  },
61
61
  "devDependencies": {
62
- "@weasel-js/cursor": "1.4.0"
62
+ "@weasel-js/cursor": "1.4.1"
63
63
  }
64
64
  }