@particle-academy/react-fancy 4.14.0 → 4.14.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.
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2638,6 +2638,17 @@ interface TreeNavProps {
|
|
|
2638
2638
|
indentSize?: number;
|
|
2639
2639
|
/** Show file/folder icons (default: true) */
|
|
2640
2640
|
showIcons?: boolean;
|
|
2641
|
+
/**
|
|
2642
|
+
* Cursor shown on hover over a draggable node.
|
|
2643
|
+
* - `"none"` (default): the normal clickable cursor — no move affordance on
|
|
2644
|
+
* mere hover. A closed-hand `grabbing` cursor still appears while a drag is
|
|
2645
|
+
* actually happening. This suits click-to-select/open trees (file/nav
|
|
2646
|
+
* trees), where an always-on grab cursor wrongly implies move-first intent.
|
|
2647
|
+
* - `"grab"`: show the open-hand `grab` cursor on hover. Opt in when the whole
|
|
2648
|
+
* row is genuinely a drag handle and reordering is the primary interaction.
|
|
2649
|
+
* @default "none"
|
|
2650
|
+
*/
|
|
2651
|
+
dragCursor?: "grab" | "none";
|
|
2641
2652
|
/** Custom className */
|
|
2642
2653
|
className?: string;
|
|
2643
2654
|
}
|
|
@@ -2650,6 +2661,7 @@ interface TreeNavContextValue {
|
|
|
2650
2661
|
indentSize: number;
|
|
2651
2662
|
showIcons: boolean;
|
|
2652
2663
|
draggable: boolean;
|
|
2664
|
+
dragCursor: "grab" | "none";
|
|
2653
2665
|
dragState: DragState;
|
|
2654
2666
|
setDragState: (state: DragState) => void;
|
|
2655
2667
|
onNodeMove?: (sourceId: string, targetId: string, position: DropPosition) => void;
|
|
@@ -2669,7 +2681,7 @@ declare namespace TreeNode {
|
|
|
2669
2681
|
var displayName: string;
|
|
2670
2682
|
}
|
|
2671
2683
|
|
|
2672
|
-
declare function TreeNavRoot({ nodes, selectedId, onSelect, onNodeContextMenu, draggable, onNodeMove, acceptExternalDrops, onExternalDrop, expandedIds: controlledExpanded, defaultExpandedIds, onExpandedChange, defaultExpandAll, indentSize, showIcons, className, }: TreeNavProps): react.JSX.Element;
|
|
2684
|
+
declare function TreeNavRoot({ nodes, selectedId, onSelect, onNodeContextMenu, draggable, onNodeMove, acceptExternalDrops, onExternalDrop, expandedIds: controlledExpanded, defaultExpandedIds, onExpandedChange, defaultExpandAll, indentSize, showIcons, dragCursor, className, }: TreeNavProps): react.JSX.Element;
|
|
2673
2685
|
declare namespace TreeNavRoot {
|
|
2674
2686
|
var displayName: string;
|
|
2675
2687
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2638,6 +2638,17 @@ interface TreeNavProps {
|
|
|
2638
2638
|
indentSize?: number;
|
|
2639
2639
|
/** Show file/folder icons (default: true) */
|
|
2640
2640
|
showIcons?: boolean;
|
|
2641
|
+
/**
|
|
2642
|
+
* Cursor shown on hover over a draggable node.
|
|
2643
|
+
* - `"none"` (default): the normal clickable cursor — no move affordance on
|
|
2644
|
+
* mere hover. A closed-hand `grabbing` cursor still appears while a drag is
|
|
2645
|
+
* actually happening. This suits click-to-select/open trees (file/nav
|
|
2646
|
+
* trees), where an always-on grab cursor wrongly implies move-first intent.
|
|
2647
|
+
* - `"grab"`: show the open-hand `grab` cursor on hover. Opt in when the whole
|
|
2648
|
+
* row is genuinely a drag handle and reordering is the primary interaction.
|
|
2649
|
+
* @default "none"
|
|
2650
|
+
*/
|
|
2651
|
+
dragCursor?: "grab" | "none";
|
|
2641
2652
|
/** Custom className */
|
|
2642
2653
|
className?: string;
|
|
2643
2654
|
}
|
|
@@ -2650,6 +2661,7 @@ interface TreeNavContextValue {
|
|
|
2650
2661
|
indentSize: number;
|
|
2651
2662
|
showIcons: boolean;
|
|
2652
2663
|
draggable: boolean;
|
|
2664
|
+
dragCursor: "grab" | "none";
|
|
2653
2665
|
dragState: DragState;
|
|
2654
2666
|
setDragState: (state: DragState) => void;
|
|
2655
2667
|
onNodeMove?: (sourceId: string, targetId: string, position: DropPosition) => void;
|
|
@@ -2669,7 +2681,7 @@ declare namespace TreeNode {
|
|
|
2669
2681
|
var displayName: string;
|
|
2670
2682
|
}
|
|
2671
2683
|
|
|
2672
|
-
declare function TreeNavRoot({ nodes, selectedId, onSelect, onNodeContextMenu, draggable, onNodeMove, acceptExternalDrops, onExternalDrop, expandedIds: controlledExpanded, defaultExpandedIds, onExpandedChange, defaultExpandAll, indentSize, showIcons, className, }: TreeNavProps): react.JSX.Element;
|
|
2684
|
+
declare function TreeNavRoot({ nodes, selectedId, onSelect, onNodeContextMenu, draggable, onNodeMove, acceptExternalDrops, onExternalDrop, expandedIds: controlledExpanded, defaultExpandedIds, onExpandedChange, defaultExpandAll, indentSize, showIcons, dragCursor, className, }: TreeNavProps): react.JSX.Element;
|
|
2673
2685
|
declare namespace TreeNavRoot {
|
|
2674
2686
|
var displayName: string;
|
|
2675
2687
|
}
|
package/dist/index.js
CHANGED
|
@@ -12961,6 +12961,7 @@ function TreeNode({ node, depth }) {
|
|
|
12961
12961
|
indentSize,
|
|
12962
12962
|
showIcons,
|
|
12963
12963
|
draggable,
|
|
12964
|
+
dragCursor,
|
|
12964
12965
|
dragState,
|
|
12965
12966
|
setDragState,
|
|
12966
12967
|
onNodeMove,
|
|
@@ -13091,7 +13092,12 @@ function TreeNode({ node, depth }) {
|
|
|
13091
13092
|
isSelected ? "bg-blue-500/15 text-blue-600 dark:text-blue-400" : "text-zinc-700 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800",
|
|
13092
13093
|
node.disabled && "pointer-events-none opacity-40",
|
|
13093
13094
|
isDragging && "opacity-50",
|
|
13094
|
-
|
|
13095
|
+
// Grab affordance. By default (`dragCursor="none"`) the row keeps its
|
|
13096
|
+
// normal click cursor on hover — no open-hand "move me" cursor before
|
|
13097
|
+
// any drag — and only shows the closed-hand `grabbing` cursor while a
|
|
13098
|
+
// drag is actually underway (mousedown/drag). `dragCursor="grab"` opts
|
|
13099
|
+
// back into the always-on grab cursor for whole-row drag handles (#14).
|
|
13100
|
+
canDrag && (dragCursor === "grab" ? "cursor-grab active:cursor-grabbing" : "active:cursor-grabbing"),
|
|
13095
13101
|
isDropTarget && dropPosition === "inside" && "bg-blue-500/10 ring-1 ring-blue-500/30 ring-inset"
|
|
13096
13102
|
),
|
|
13097
13103
|
style: { paddingLeft },
|
|
@@ -13147,6 +13153,7 @@ function TreeNavRoot({
|
|
|
13147
13153
|
defaultExpandAll = false,
|
|
13148
13154
|
indentSize = 16,
|
|
13149
13155
|
showIcons = true,
|
|
13156
|
+
dragCursor = "none",
|
|
13150
13157
|
className
|
|
13151
13158
|
}) {
|
|
13152
13159
|
const [internalExpanded, setInternalExpanded] = useState(() => {
|
|
@@ -13191,6 +13198,7 @@ function TreeNavRoot({
|
|
|
13191
13198
|
indentSize,
|
|
13192
13199
|
showIcons,
|
|
13193
13200
|
draggable,
|
|
13201
|
+
dragCursor,
|
|
13194
13202
|
dragState,
|
|
13195
13203
|
setDragState,
|
|
13196
13204
|
onNodeMove,
|
|
@@ -13208,6 +13216,7 @@ function TreeNavRoot({
|
|
|
13208
13216
|
indentSize,
|
|
13209
13217
|
showIcons,
|
|
13210
13218
|
draggable,
|
|
13219
|
+
dragCursor,
|
|
13211
13220
|
dragState,
|
|
13212
13221
|
onNodeMove,
|
|
13213
13222
|
acceptExternalDrops,
|