@behindthemusictree/genre-tree-view 5.0.0 → 6.2.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/dist/index.cjs +467 -547
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -18
- package/dist/index.d.ts +15 -18
- package/dist/index.js +462 -542
- package/dist/index.js.map +1 -1
- package/dist/styles.css +71 -24
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -23,6 +23,9 @@ interface GenreTreeNode {
|
|
|
23
23
|
/** A grouping node that no item is filed under directly. Read by InfoPanel (badge), GenreTreeOutline
|
|
24
24
|
* and the stacked/wheel node labels (italic); the pop-core labels ignore it. */
|
|
25
25
|
umbrella?: boolean;
|
|
26
|
+
/** Which scene a genre belongs to. GenreTreeWheelRadialPopCore draws an "underground" node and its
|
|
27
|
+
* descendants in a darker shade of their usual color, over a darker background slice. */
|
|
28
|
+
scene?: "commercial" | "underground";
|
|
26
29
|
}
|
|
27
30
|
type GenreTreePlayState = "playing" | "paused" | "loading";
|
|
28
31
|
/** "stacked" is the linear/card tree (GenreTree); "wheel"/"pop-core" are the radial layouts
|
|
@@ -71,7 +74,7 @@ interface InfoPanelSections {
|
|
|
71
74
|
toolbar: ReactNode;
|
|
72
75
|
/** Ancestor chips, root-first — null for a root. */
|
|
73
76
|
ancestors: ReactNode;
|
|
74
|
-
/** Parent, node and children mini tree
|
|
77
|
+
/** Parent, node and children mini tree. */
|
|
75
78
|
family: ReactNode;
|
|
76
79
|
/** The `itemCountLabel` row. */
|
|
77
80
|
itemCount: ReactNode;
|
|
@@ -133,6 +136,12 @@ interface GenreTreeProps {
|
|
|
133
136
|
/** Stacks the floating zoom/pop/fit controls vertically ("vertical", the default) or lays them
|
|
134
137
|
* out in a row ("horizontal"). */
|
|
135
138
|
controlsOrientation?: ControlsOrientation;
|
|
139
|
+
/** Host content rendered in the floating controls box, beside the zoom buttons ("horizontal")
|
|
140
|
+
* or above them ("vertical"); stacked above them in narrow containers. */
|
|
141
|
+
floatingControlsLeading?: ReactNode;
|
|
142
|
+
/** Shows a small spinner beside the zoom buttons (after a short delay, so fast operations don't
|
|
143
|
+
* flash) and marks the tree `aria-busy`. Use it while the host is updating the tree in place. */
|
|
144
|
+
busy?: boolean;
|
|
136
145
|
/** Multiplies the spacing between depth levels along the tree's growth axis. Defaults to 1
|
|
137
146
|
* (no change). */
|
|
138
147
|
depthSpacingScale?: number;
|
|
@@ -165,23 +174,11 @@ interface GenreTreeProps {
|
|
|
165
174
|
* (by clearing `selectedNodeId`), e.g. from its own search bar. Defaults to false. */
|
|
166
175
|
hideInfoPanelClose?: boolean;
|
|
167
176
|
/** Hides the info panel header's node name — for a consumer that already shows it, e.g. in its own
|
|
168
|
-
* search bar floated over the header (see `--gtv-info-panel-header-inset`).
|
|
169
|
-
* shows in edit mode. Defaults to false. */
|
|
177
|
+
* search bar floated over the header (see `--gtv-info-panel-header-inset`). Defaults to false. */
|
|
170
178
|
hideInfoPanelTitle?: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* edit-mode slots below inactive. Defaults to false. */
|
|
179
|
+
/** Keeps `renderDangerZone` inactive. Defaults to false. */
|
|
173
180
|
readOnly?: boolean;
|
|
174
|
-
/**
|
|
175
|
-
* `renderParentsEditor` and `renderDangerZone` rendered. Defaults to false. */
|
|
176
|
-
editMode?: boolean;
|
|
177
|
-
/** When set (and `readOnly` is false), the info panel header shows an Edit/Done toggle firing
|
|
178
|
-
* this with the requested mode. */
|
|
179
|
-
onEditModeChange?: (on: boolean) => void;
|
|
180
|
-
/** Edit mode only: replaces the info panel header's title, e.g. with an inline rename field. */
|
|
181
|
-
renderTitleEditor?: (node: GenreTreeNode) => ReactNode;
|
|
182
|
-
/** Edit mode only: replaces the info panel's Parent section. */
|
|
183
|
-
renderParentsEditor?: (node: GenreTreeNode) => ReactNode;
|
|
184
|
-
/** Edit mode only: rendered at the bottom of the info panel. */
|
|
181
|
+
/** Rendered at the bottom of the info panel unless `readOnly`. */
|
|
185
182
|
renderDangerZone?: (node: GenreTreeNode) => ReactNode;
|
|
186
183
|
/** Whether the info panel fills the tree container (controlled), splitting into a narrow left
|
|
187
184
|
* column (the body's `aside`, then the danger zone) and a wide right one (its `primary`). Selecting
|
|
@@ -240,7 +237,7 @@ interface GenreTreeOverlayPanel {
|
|
|
240
237
|
* Purely presentational: fetching, mutations, and popups are the consumer's responsibility,
|
|
241
238
|
* wired through the callback props.
|
|
242
239
|
*/
|
|
243
|
-
declare function GenreTree({ nodes, className, rootColor, orientation, hideRoot, playingNodeId, playState, reparentingNodeId, onPlayPause, onAddChild, onRenameRequest, onDeleteRequest, onReparentRequest, onReparent, onNodeClick, additionalActions, interactive, depthSpacingScale, showToolbar, selectedNodeId: selectedNodeIdProp, renderInfoPanelBody, onSelectedNodeChange, hideInfoPanelClose, hideInfoPanelTitle, itemCountLabel, readOnly,
|
|
240
|
+
declare function GenreTree({ nodes, className, rootColor, orientation, hideRoot, playingNodeId, playState, reparentingNodeId, onPlayPause, onAddChild, onRenameRequest, onDeleteRequest, onReparentRequest, onReparent, onNodeClick, additionalActions, interactive, depthSpacingScale, showToolbar, selectedNodeId: selectedNodeIdProp, renderInfoPanelBody, onSelectedNodeChange, hideInfoPanelClose, hideInfoPanelTitle, itemCountLabel, readOnly, renderDangerZone, expanded, onExpandedChange, collapsed, hideExpandButton, overlayPanel, wheelZoom, defaultViewport, onViewportChange, controlsOrientation, floatingControlsLeading, busy, }: GenreTreeProps): react.JSX.Element;
|
|
244
241
|
|
|
245
242
|
interface GenreTreeWheelProps extends Omit<GenreTreeProps, "nodes" | "rootColor" | "orientation"> {
|
|
246
243
|
nodes: GenreTreeNode[];
|
|
@@ -341,7 +338,7 @@ type GenreTreeWheelRadialPopCoreProps = WheelRadialPopCoreProps;
|
|
|
341
338
|
*/
|
|
342
339
|
declare function GenreTreeWheelRadialPopCore(props: GenreTreeWheelRadialPopCoreProps): react.JSX.Element;
|
|
343
340
|
|
|
344
|
-
type GenreTreeOutlineProps = Omit<GenreTreeProps, "rootColor" | "orientation" | "hideRoot" | "interactive" | "depthSpacingScale" | "wheelZoom" | "controlsOrientation">;
|
|
341
|
+
type GenreTreeOutlineProps = Omit<GenreTreeProps, "rootColor" | "orientation" | "hideRoot" | "interactive" | "depthSpacingScale" | "wheelZoom" | "controlsOrientation" | "floatingControlsLeading" | "busy">;
|
|
345
342
|
/**
|
|
346
343
|
* Text counterpart of `GenreTreeWheelRadialPopCore`: the same forest as nested collapsible lists
|
|
347
344
|
* (`<details>`), "Mainstream Pop" first, then every other root with its direct children split
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,9 @@ interface GenreTreeNode {
|
|
|
23
23
|
/** A grouping node that no item is filed under directly. Read by InfoPanel (badge), GenreTreeOutline
|
|
24
24
|
* and the stacked/wheel node labels (italic); the pop-core labels ignore it. */
|
|
25
25
|
umbrella?: boolean;
|
|
26
|
+
/** Which scene a genre belongs to. GenreTreeWheelRadialPopCore draws an "underground" node and its
|
|
27
|
+
* descendants in a darker shade of their usual color, over a darker background slice. */
|
|
28
|
+
scene?: "commercial" | "underground";
|
|
26
29
|
}
|
|
27
30
|
type GenreTreePlayState = "playing" | "paused" | "loading";
|
|
28
31
|
/** "stacked" is the linear/card tree (GenreTree); "wheel"/"pop-core" are the radial layouts
|
|
@@ -71,7 +74,7 @@ interface InfoPanelSections {
|
|
|
71
74
|
toolbar: ReactNode;
|
|
72
75
|
/** Ancestor chips, root-first — null for a root. */
|
|
73
76
|
ancestors: ReactNode;
|
|
74
|
-
/** Parent, node and children mini tree
|
|
77
|
+
/** Parent, node and children mini tree. */
|
|
75
78
|
family: ReactNode;
|
|
76
79
|
/** The `itemCountLabel` row. */
|
|
77
80
|
itemCount: ReactNode;
|
|
@@ -133,6 +136,12 @@ interface GenreTreeProps {
|
|
|
133
136
|
/** Stacks the floating zoom/pop/fit controls vertically ("vertical", the default) or lays them
|
|
134
137
|
* out in a row ("horizontal"). */
|
|
135
138
|
controlsOrientation?: ControlsOrientation;
|
|
139
|
+
/** Host content rendered in the floating controls box, beside the zoom buttons ("horizontal")
|
|
140
|
+
* or above them ("vertical"); stacked above them in narrow containers. */
|
|
141
|
+
floatingControlsLeading?: ReactNode;
|
|
142
|
+
/** Shows a small spinner beside the zoom buttons (after a short delay, so fast operations don't
|
|
143
|
+
* flash) and marks the tree `aria-busy`. Use it while the host is updating the tree in place. */
|
|
144
|
+
busy?: boolean;
|
|
136
145
|
/** Multiplies the spacing between depth levels along the tree's growth axis. Defaults to 1
|
|
137
146
|
* (no change). */
|
|
138
147
|
depthSpacingScale?: number;
|
|
@@ -165,23 +174,11 @@ interface GenreTreeProps {
|
|
|
165
174
|
* (by clearing `selectedNodeId`), e.g. from its own search bar. Defaults to false. */
|
|
166
175
|
hideInfoPanelClose?: boolean;
|
|
167
176
|
/** Hides the info panel header's node name — for a consumer that already shows it, e.g. in its own
|
|
168
|
-
* search bar floated over the header (see `--gtv-info-panel-header-inset`).
|
|
169
|
-
* shows in edit mode. Defaults to false. */
|
|
177
|
+
* search bar floated over the header (see `--gtv-info-panel-header-inset`). Defaults to false. */
|
|
170
178
|
hideInfoPanelTitle?: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* edit-mode slots below inactive. Defaults to false. */
|
|
179
|
+
/** Keeps `renderDangerZone` inactive. Defaults to false. */
|
|
173
180
|
readOnly?: boolean;
|
|
174
|
-
/**
|
|
175
|
-
* `renderParentsEditor` and `renderDangerZone` rendered. Defaults to false. */
|
|
176
|
-
editMode?: boolean;
|
|
177
|
-
/** When set (and `readOnly` is false), the info panel header shows an Edit/Done toggle firing
|
|
178
|
-
* this with the requested mode. */
|
|
179
|
-
onEditModeChange?: (on: boolean) => void;
|
|
180
|
-
/** Edit mode only: replaces the info panel header's title, e.g. with an inline rename field. */
|
|
181
|
-
renderTitleEditor?: (node: GenreTreeNode) => ReactNode;
|
|
182
|
-
/** Edit mode only: replaces the info panel's Parent section. */
|
|
183
|
-
renderParentsEditor?: (node: GenreTreeNode) => ReactNode;
|
|
184
|
-
/** Edit mode only: rendered at the bottom of the info panel. */
|
|
181
|
+
/** Rendered at the bottom of the info panel unless `readOnly`. */
|
|
185
182
|
renderDangerZone?: (node: GenreTreeNode) => ReactNode;
|
|
186
183
|
/** Whether the info panel fills the tree container (controlled), splitting into a narrow left
|
|
187
184
|
* column (the body's `aside`, then the danger zone) and a wide right one (its `primary`). Selecting
|
|
@@ -240,7 +237,7 @@ interface GenreTreeOverlayPanel {
|
|
|
240
237
|
* Purely presentational: fetching, mutations, and popups are the consumer's responsibility,
|
|
241
238
|
* wired through the callback props.
|
|
242
239
|
*/
|
|
243
|
-
declare function GenreTree({ nodes, className, rootColor, orientation, hideRoot, playingNodeId, playState, reparentingNodeId, onPlayPause, onAddChild, onRenameRequest, onDeleteRequest, onReparentRequest, onReparent, onNodeClick, additionalActions, interactive, depthSpacingScale, showToolbar, selectedNodeId: selectedNodeIdProp, renderInfoPanelBody, onSelectedNodeChange, hideInfoPanelClose, hideInfoPanelTitle, itemCountLabel, readOnly,
|
|
240
|
+
declare function GenreTree({ nodes, className, rootColor, orientation, hideRoot, playingNodeId, playState, reparentingNodeId, onPlayPause, onAddChild, onRenameRequest, onDeleteRequest, onReparentRequest, onReparent, onNodeClick, additionalActions, interactive, depthSpacingScale, showToolbar, selectedNodeId: selectedNodeIdProp, renderInfoPanelBody, onSelectedNodeChange, hideInfoPanelClose, hideInfoPanelTitle, itemCountLabel, readOnly, renderDangerZone, expanded, onExpandedChange, collapsed, hideExpandButton, overlayPanel, wheelZoom, defaultViewport, onViewportChange, controlsOrientation, floatingControlsLeading, busy, }: GenreTreeProps): react.JSX.Element;
|
|
244
241
|
|
|
245
242
|
interface GenreTreeWheelProps extends Omit<GenreTreeProps, "nodes" | "rootColor" | "orientation"> {
|
|
246
243
|
nodes: GenreTreeNode[];
|
|
@@ -341,7 +338,7 @@ type GenreTreeWheelRadialPopCoreProps = WheelRadialPopCoreProps;
|
|
|
341
338
|
*/
|
|
342
339
|
declare function GenreTreeWheelRadialPopCore(props: GenreTreeWheelRadialPopCoreProps): react.JSX.Element;
|
|
343
340
|
|
|
344
|
-
type GenreTreeOutlineProps = Omit<GenreTreeProps, "rootColor" | "orientation" | "hideRoot" | "interactive" | "depthSpacingScale" | "wheelZoom" | "controlsOrientation">;
|
|
341
|
+
type GenreTreeOutlineProps = Omit<GenreTreeProps, "rootColor" | "orientation" | "hideRoot" | "interactive" | "depthSpacingScale" | "wheelZoom" | "controlsOrientation" | "floatingControlsLeading" | "busy">;
|
|
345
342
|
/**
|
|
346
343
|
* Text counterpart of `GenreTreeWheelRadialPopCore`: the same forest as nested collapsible lists
|
|
347
344
|
* (`<details>`), "Mainstream Pop" first, then every other root with its direct children split
|