@setsquare/ui 0.11.1 → 0.13.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.
@@ -1,10 +1,15 @@
1
- import type { ReactNode } from 'react';
2
- import { type GridListItemProps as RACGridListItemProps, type GridListProps as RACGridListProps } from 'react-aria-components';
3
- export interface GridListProps<T extends object> extends Omit<RACGridListProps<T>, 'className'> {
4
- /** Required: what the list holds ("Members"). */
1
+ import { type ReactNode } from 'react';
2
+ import { type DragAndDropHooks, type GridListItemProps as RACGridListItemProps, type GridListProps as RACGridListProps, type Key } from 'react-aria-components';
3
+ import { type CardReorder } from '../lib/card-order.js';
4
+ export type { CardMove, CardReorder } from '../lib/card-order.js';
5
+ /** A list is named by a visible heading (`aria-labelledby`) or, when it has none, by `aria-label`: what it holds. */
6
+ export type GridListProps<T extends object> = Omit<RACGridListProps<T>, 'className' | 'aria-label' | 'aria-labelledby'> & ({
5
7
  'aria-label': string;
8
+ } | {
9
+ 'aria-labelledby': string;
10
+ }) & {
6
11
  className?: string;
7
- }
12
+ };
8
13
  /**
9
14
  * A list of items people act on — members, files, integrations — where each row can hold its own buttons.
10
15
  * ↑ ↓ move between rows and → through a row's own controls; Tab leaves the list. With
@@ -28,4 +33,68 @@ export interface GridListItemProps extends Omit<RACGridListItemProps, 'className
28
33
  }
29
34
  /** Selected: brand-subtle, the 3px sidebar-primary marker and a ticked box — the same signals as a table row. */
30
35
  export declare function GridListItem({ children, description, actions, dragLabel, className, ...props }: GridListItemProps): import("react").JSX.Element;
36
+ /** A card's words, for the `labels` prop. `{title}` is the card's title. */
37
+ export interface GridListCardLabels {
38
+ /** The menu button's name. */
39
+ options: string;
40
+ /** The menu's section of moves. */
41
+ moveSection: string;
42
+ moveFirst: string;
43
+ moveEarlier: string;
44
+ moveLater: string;
45
+ moveLast: string;
46
+ /** Said after a menu move of one card: "{title} moved to position {position} of {count}". */
47
+ moved: string;
48
+ /** Said after a menu move of several: the count of cards moved, and where the first now is. */
49
+ movedSeveral: string;
50
+ }
51
+ export declare const gridListCardLabels: GridListCardLabels;
52
+ /** What `useCardOrder` gives a GridList and its cards. */
53
+ export interface CardOrder {
54
+ /** For the GridList: drag and drop for reordering, with the drop line between cards. */
55
+ dragAndDropHooks: DragAndDropHooks;
56
+ /** Applies a reorder: a drag's drop, or a card menu's move. */
57
+ reorder: (reorder: CardReorder<Key>) => void;
58
+ }
59
+ export interface CardOrderOptions {
60
+ /**
61
+ * Called once per finished move, by drag or by a card's menu, with the keys moved (several when the selected cards
62
+ * move together), the card they go next to and which side. `useListData`'s `moveBefore` and `moveAfter` take it
63
+ * as it is.
64
+ */
65
+ onReorder: (reorder: CardReorder<Key>) => void;
66
+ }
67
+ /**
68
+ * Reordering cards in a GridList, by drag and without: give `dragAndDropHooks` to the GridList and `order` to each
69
+ * GridListCard. Dragging a selected card drags the selected ones; a card's menu moves it (or the selection it's in)
70
+ * to the start, a place earlier, a place later or the end, which is the single-pointer way to reorder that 2.5.7
71
+ * asks for. Both call `onReorder` once per move.
72
+ */
73
+ export declare function useCardOrder({ onReorder }: CardOrderOptions): CardOrder;
74
+ export interface GridListCardProps extends Omit<RACGridListItemProps, 'className' | 'children' | 'textValue' | 'id'> {
75
+ id: Key;
76
+ /** What the card is called: shown under its picture, its name, and what typing finds. */
77
+ title: string;
78
+ /** A picture of it: a scene's thumbnail. Decorative, the title names the card; shown 16:9. */
79
+ media?: ReactNode;
80
+ /** A line under the title: a duration, a count. */
81
+ description?: ReactNode;
82
+ /** A StatusBadge after the description. */
83
+ status?: ReactNode;
84
+ /** The product's own items for the card's menu (`MenuItem`s), before the moves. */
85
+ menu?: ReactNode;
86
+ /** From `useCardOrder`: adds the moves to the card's menu. */
87
+ order?: CardOrder;
88
+ /** Words for the drag button. React Aria's own ("Drag {title}") by default. */
89
+ dragLabel?: string;
90
+ labels?: Partial<GridListCardLabels>;
91
+ className?: string;
92
+ }
93
+ /**
94
+ * A card in a GridList with `layout="grid"`: a picture, a title, a line and a status, then a footer with its drag
95
+ * button, its selection checkbox and its menu, in that order, each a target of its own, none over the picture. The
96
+ * card is the row: arrow keys move between cards, Tab through a card's own controls. Selected: the `brand-subtle`
97
+ * ground and a 2px `brand` ring, and a ticked box; in forced colours a `Highlight` ring.
98
+ */
99
+ export declare function GridListCard({ id, title, media, description, status, menu, order, dragLabel, labels, className, ...props }: GridListCardProps): import("react").JSX.Element;
31
100
  //# sourceMappingURL=grid-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-list.d.ts","sourceRoot":"","sources":["../../src/ui/grid-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAIL,KAAK,iBAAiB,IAAI,oBAAoB,EAC9C,KAAK,aAAa,IAAI,gBAAgB,EACvC,MAAM,uBAAuB,CAAC;AAI/B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC;IAC7F,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,+BAWnF;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,WAAW,GAAG,UAAU,CAAC;IAC7F,QAAQ,EAAE,SAAS,CAAC;IACpB,sDAAsD;IACtD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,2GAA2G;IAC3G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iHAAiH;AACjH,wB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AC;IAClB,mDAAmD;IACnD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,mFAAmF;IACnF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,KAAK,EACL,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAiEnB"}
@@ -1,9 +1,17 @@
1
1
  'use client';
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { GripVertical } from 'lucide-react';
4
- import { Button as RACButton, GridList as RACGridList, GridListItem as RACGridListItem, } from 'react-aria-components';
3
+ import { useContext, useRef, useState } from 'react';
4
+ import { EllipsisVertical, GripVertical } from 'lucide-react';
5
+ import { Button as RACButton, GridList as RACGridList, GridListItem as RACGridListItem, useDragAndDrop, DragAndDropContext, } from 'react-aria-components';
6
+ import { announce } from '../lib/announce.js';
7
+ import { moveTarget } from '../lib/card-order.js';
5
8
  import { cn } from '../lib/cn.js';
9
+ import { useLabels } from '../lib/locale.js';
10
+ import { withoutSoftHyphens } from '../lib/soft-hyphen.js';
11
+ import { useHyphenated } from '../lib/use-hyphenated.js';
6
12
  import { SelectionCheckbox } from './checkbox.js';
13
+ import { DropIndicator, DropLayoutContext } from './drop-indicator.js';
14
+ import { Menu, MenuItem, MenuSection, MenuTrigger, Popover } from './menu.js';
7
15
  /**
8
16
  * A list of items people act on — members, files, integrations — where each row can hold its own buttons.
9
17
  * ↑ ↓ move between rows and → through a row's own controls; Tab leaves the list. With
@@ -15,7 +23,14 @@ import { SelectionCheckbox } from './checkbox.js';
15
23
  * button, which is how a keyboard or screen reader drag starts.
16
24
  */
17
25
  export function GridList({ className, ...props }) {
18
- return (_jsx(RACGridList, { ...props, className: cn('relative flex max-h-[inherit] flex-col overflow-auto rounded-lg border border-border bg-card text-sm outline-none data-focus-visible:focus-ring', 'data-drop-target:bg-brand-subtle data-drop-target:outline-2 data-drop-target:outline-solid data-drop-target:outline-brand data-drop-target:-outline-offset-2', className) }));
26
+ const layout = props.layout ?? 'stack';
27
+ return (_jsx(DropLayoutContext.Provider, { value: layout, children: _jsx(RACGridList, { ...props, className: cn(layout === 'grid'
28
+ ? // Cards in a wrapping row, as many as fit, `--card-gap` apart. A wrapping row rather than a CSS grid:
29
+ // while a drag is on, React Aria puts a drop indicator beside every card, and in a grid each would
30
+ // take a cell; in a row they take no room. No box of its own: the cards are boxes. Padding leaves
31
+ // room for a card's focus ring inside the scroller.
32
+ 'relative flex max-h-[inherit] flex-wrap content-start gap-(--card-gap) overflow-auto p-2 text-sm outline-none data-focus-visible:focus-ring'
33
+ : 'relative flex max-h-[inherit] flex-col overflow-auto rounded-lg border border-border bg-card text-sm outline-none data-focus-visible:focus-ring', 'data-drop-target:bg-brand-subtle data-drop-target:outline-2 data-drop-target:outline-solid data-drop-target:outline-brand data-drop-target:-outline-offset-2', className) }) }));
19
34
  }
20
35
  /** Selected: brand-subtle, the 3px sidebar-primary marker and a ticked box — the same signals as a table row. */
21
36
  export function GridListItem({ children, description, actions, dragLabel, className, ...props }) {
@@ -29,4 +44,101 @@ export function GridListItem({ children, description, actions, dragLabel, classN
29
44
  // Forced colours drop the selected ground and the inset marker: draw the marker in Highlight instead.
30
45
  "forced-colors:data-selected:before:absolute forced-colors:data-selected:before:inset-y-1 forced-colors:data-selected:before:start-0 forced-colors:data-selected:before:w-[3px] forced-colors:data-selected:before:bg-[Highlight] forced-colors:data-selected:before:forced-color-adjust-none forced-colors:data-selected:before:content-['']", className), children: ({ selectionMode, selectionBehavior, allowsDragging }) => (_jsxs(_Fragment, { children: [allowsDragging && (_jsx(RACButton, { slot: "drag", "aria-label": dragLabel, className: "group/grid-drag relative flex min-h-target min-w-target shrink-0 cursor-grab items-center justify-center outline-none", children: _jsx("span", { className: "flex size-control-sm items-center justify-center rounded-md text-muted-foreground group-data-focus-visible/grid-drag:focus-ring group-data-hovered/grid-drag:bg-muted group-data-hovered/grid-drag:text-foreground", children: _jsx(GripVertical, { "aria-hidden": "true", className: "size-4" }) }) })), selectionMode !== 'none' && selectionBehavior === 'toggle' && (_jsx(SelectionCheckbox, { className: "-ml-1" })), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "leading-5 font-medium text-foreground", children: children }), description && (_jsx("span", { className: "text-[13px] leading-5 text-muted-foreground", children: description }))] }), actions && _jsx("span", { className: "flex shrink-0 items-center gap-1", children: actions })] })) }));
31
46
  }
47
+ export const gridListCardLabels = {
48
+ options: 'Options for {title}',
49
+ moveSection: 'Move',
50
+ moveFirst: 'Move to start',
51
+ moveEarlier: 'Move earlier',
52
+ moveLater: 'Move later',
53
+ moveLast: 'Move to end',
54
+ moved: '{title} moved to position {position} of {count}',
55
+ movedSeveral: '{moved, plural, one {# card} other {# cards}} moved, starting at position {position} of {count}',
56
+ };
57
+ /**
58
+ * Reordering cards in a GridList, by drag and without: give `dragAndDropHooks` to the GridList and `order` to each
59
+ * GridListCard. Dragging a selected card drags the selected ones; a card's menu moves it (or the selection it's in)
60
+ * to the start, a place earlier, a place later or the end, which is the single-pointer way to reorder that 2.5.7
61
+ * asks for. Both call `onReorder` once per move.
62
+ */
63
+ export function useCardOrder({ onReorder }) {
64
+ const { dragAndDropHooks } = useDragAndDrop({
65
+ getItems: (dragged) => [...dragged].map((key) => ({ 'text/plain': String(key) })),
66
+ onReorder: (e) => onReorder({
67
+ keys: [...e.keys],
68
+ target: e.target.key,
69
+ position: e.target.dropPosition === 'after' ? 'after' : 'before',
70
+ }),
71
+ renderDropIndicator: (target) => _jsx(DropIndicator, { target: target }),
72
+ });
73
+ return { dragAndDropHooks, reorder: onReorder };
74
+ }
75
+ const MOVES = ['first', 'earlier', 'later', 'last'];
76
+ const MOVE_LABEL = {
77
+ first: 'moveFirst',
78
+ earlier: 'moveEarlier',
79
+ later: 'moveLater',
80
+ last: 'moveLast',
81
+ };
82
+ /**
83
+ * A card in a GridList with `layout="grid"`: a picture, a title, a line and a status, then a footer with its drag
84
+ * button, its selection checkbox and its menu, in that order, each a target of its own, none over the picture. The
85
+ * card is the row: arrow keys move between cards, Tab through a card's own controls. Selected: the `brand-subtle`
86
+ * ground and a 2px `brand` ring, and a ticked box; in forced colours a `Highlight` ring.
87
+ */
88
+ export function GridListCard({ id, title, media, description, status, menu, order, dragLabel, labels, className, ...props }) {
89
+ const t = useLabels('gridListCard', gridListCardLabels, labels);
90
+ const card = useRef(null);
91
+ const [shownTitle, titleRef] = useHyphenated(title);
92
+ const name = withoutSoftHyphens(title);
93
+ const hasMenu = !!menu || !!order;
94
+ return (_jsx(RACGridListItem, { ...props, id: id, ref: card, textValue: name, className: cn(
95
+ // Layer 1: the card is the target. Its width is the grid's, `--card-width`.
96
+ 'group/card relative flex w-(--card-width) min-w-0 cursor-default flex-col overflow-hidden rounded-lg border border-border bg-card text-card-foreground outline-none', 'data-hovered:cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-60', 'data-selected:border-brand data-selected:bg-brand-subtle data-selected:shadow-[0_0_0_1px_var(--brand)]', 'data-focus-visible:focus-ring data-dragging:opacity-50',
97
+ // Forced colours drop the ground and the shadow: a Highlight ring inside its edge instead.
98
+ "forced-colors:data-selected:after:pointer-events-none forced-colors:data-selected:after:absolute forced-colors:data-selected:after:inset-0 forced-colors:data-selected:after:rounded-lg forced-colors:data-selected:after:border-2 forced-colors:data-selected:after:border-[Highlight] forced-colors:data-selected:after:forced-color-adjust-none forced-colors:data-selected:after:content-['']", className), children: ({ selectionMode, selectionBehavior, allowsDragging }) => (_jsxs(_Fragment, { children: [media && (_jsx("span", { "aria-hidden": "true", className: "block aspect-video overflow-hidden bg-muted", children: media })), _jsxs("span", { className: "flex min-w-0 flex-col gap-0.5 px-3 pt-2", children: [_jsx("span", { className: "min-w-0 leading-5 font-semibold hyphens-auto text-foreground", children: _jsx("span", { ref: titleRef, className: "inline-block max-w-full", children: shownTitle }) }), description && (_jsx("span", { className: "text-[13px] leading-5 text-muted-foreground", children: description })), status && _jsx("span", { className: "flex flex-wrap items-center gap-1", children: status })] }), _jsxs("span", { className: "mt-auto flex items-center gap-1 px-1 pt-1 pb-1", children: [allowsDragging && (_jsx(RACButton, { slot: "drag", "aria-label": dragLabel, className: "group/card-drag relative flex min-h-target min-w-target shrink-0 cursor-grab items-center justify-center outline-none", children: _jsx("span", { className: "flex size-control-sm items-center justify-center rounded-md text-muted-foreground group-data-focus-visible/card-drag:focus-ring group-data-hovered/card-drag:bg-muted group-data-hovered/card-drag:text-foreground", children: _jsx(GripVertical, { "aria-hidden": "true", className: "size-4" }) }) })), selectionMode !== 'none' && selectionBehavior === 'toggle' && _jsx(SelectionCheckbox, {}), _jsx("span", { className: "flex-1" }), hasMenu && (_jsx(CardMenuButton, { id: id, name: name, menu: menu, order: order, card: card, t: t }))] })] })) }));
99
+ }
100
+ /**
101
+ * The card's menu button. Rendered inside the card as the list draws it, which is where the list can be read: a
102
+ * card's own body runs in React Aria's first, hidden pass, and React Aria gives an item no list state of its own (it
103
+ * clears ListStateContext there). Its drag state has the list's collection and selection, and is there whenever the
104
+ * cards can be reordered, which `useCardOrder` makes so.
105
+ */
106
+ function CardMenuButton(props) {
107
+ const { dragState } = useContext(DragAndDropContext);
108
+ const state = dragState ?? null;
109
+ const [open, setOpen] = useState(false);
110
+ return (_jsxs(MenuTrigger, { isOpen: open, onOpenChange: setOpen, children: [_jsx(RACButton, { "aria-label": props.t('options', { title: props.name }), className: "group/card-menu relative flex min-h-target min-w-target shrink-0 cursor-pointer items-center justify-center outline-none", children: _jsx("span", { className: "flex size-control-sm items-center justify-center rounded-md text-muted-foreground group-data-focus-visible/card-menu:focus-ring group-data-hovered/card-menu:bg-muted group-data-hovered/card-menu:text-foreground group-data-pressed/card-menu:bg-muted", children: _jsx(EllipsisVertical, { "aria-hidden": "true", className: "size-4" }) }) }), _jsx(Popover, { placement: "bottom end", children: _jsx(CardMenu, { ...props, state: state }) })] }));
111
+ }
112
+ function CardMenu({ id, name, menu, order, card, t, state, }) {
113
+ const keys = state
114
+ ? [...state.collection.getKeys()].filter((k) => state.collection.getItem(k)?.type === 'item')
115
+ : [id];
116
+ const selection = state?.selectionManager;
117
+ // The cards a move takes: the selection, when this card is in it, or this card alone.
118
+ const moving = !selection?.isSelected(id)
119
+ ? [id]
120
+ : selection.isSelectAll
121
+ ? keys
122
+ : keys.filter((k) => selection.selectedKeys.has(k));
123
+ const targets = Object.fromEntries(MOVES.map((m) => [m, order ? moveTarget(keys, moving, m) : null]));
124
+ const doMove = (move) => {
125
+ const reorder = targets[move];
126
+ if (!order || !reorder)
127
+ return;
128
+ order.reorder(reorder);
129
+ // Where the first moved card ends up, counted from 1.
130
+ const rest = keys.filter((k) => !reorder.keys.includes(k));
131
+ const at = rest.indexOf(reorder.target) + (reorder.position === 'after' ? 1 : 0);
132
+ announce(reorder.keys.length === 1
133
+ ? t('moved', { title: name, position: at + 1, count: keys.length })
134
+ : t('movedSeveral', { moved: reorder.keys.length, position: at + 1, count: keys.length }));
135
+ // The card moved in the page: keep focus on it, after the menu has handed focus back.
136
+ requestAnimationFrame(() => requestAnimationFrame(() => card.current?.focus()));
137
+ };
138
+ return (_jsxs(Menu, { "aria-label": t('options', { title: name }), disabledKeys: MOVES.filter((m) => !targets[m]).map((m) => `move-${m}`), onAction: (key) => {
139
+ const move = String(key).replace(/^move-/, '');
140
+ if (MOVES.includes(move))
141
+ doMove(move);
142
+ }, children: [menu, order && (_jsx(MenuSection, { title: t('moveSection'), children: MOVES.map((m) => (_jsx(MenuItem, { id: `move-${m}`, children: t(MOVE_LABEL[m]) }, m))) }))] }));
143
+ }
32
144
  //# sourceMappingURL=grid-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-list.js","sourceRoot":"","sources":["../../src/ui/grid-list.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,QAAQ,IAAI,WAAW,EACvB,YAAY,IAAI,eAAe,GAGhC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQlD;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAoB;IAClF,OAAO,CACL,KAAC,WAAW,OACN,KAAK,EACT,SAAS,EAAE,EAAE,CACX,iJAAiJ,EACjJ,8JAA8J,EAC9J,SAAS,CACV,GACD,CACH,CAAC;AACJ,CAAC;AAaD,iHAAiH;AACjH,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,OAAO,EACP,SAAS,EACT,SAAS,EACT,GAAG,KAAK,EACU;IAClB,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3F,OAAO,CACL,KAAC,eAAe,OACV,KAAK,EACT,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,CAChC,EAAE;QACA,sGAAsG;QACtG,qKAAqK;QACrK,sGAAsG;QACtG,6DAA6D;QAC7D,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAChC,4O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a,CAAC,YACjC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAChB,KAAC,QAAQ,IAAS,EAAE,EAAE,QAAQ,CAAC,EAAE,YAC9B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IADJ,CAAC,CAEL,CACZ,CAAC,GACU,CACf,IACI,CACR,CAAC;AACJ,CAAC"}
@@ -25,8 +25,32 @@ export interface TimelineLabels {
25
25
  cancelled: string;
26
26
  /** Every marker's description: the ways to move it. */
27
27
  markerHint: string;
28
+ /** The description of a marker whose press opens it (`pressAction="action"`): the ways to open and move it. */
29
+ markerActionHint: string;
30
+ /** The description of a marker that opens and can't move. */
31
+ markerOpenHint: string;
32
+ /** Added to the description of a marker with a menu: how to open it from the flag. */
33
+ markerMenuHint: string;
34
+ /** The menu button's name: "Options for {label}". */
35
+ markerMenu: string;
36
+ /** The menu item that opens a marker, when pressing it picks it up instead. A band's `actionLabel` wins. */
37
+ open: string;
38
+ /** The menu item that picks a marker up to place it without dragging, when pressing it opens it instead. */
39
+ move: string;
40
+ /** The menu item that puts a marker back at its `defaultTime`: "Reset to {time}", the time as the ruler shows it. */
41
+ reset: string;
42
+ /** Said and shown when a marker is reset. */
43
+ wasReset: string;
28
44
  }
29
45
  export declare const timelineLabels: TimelineLabels;
46
+ /** A marker being dragged or moved by key: where it started, and where it is now. */
47
+ export interface TimelineMove {
48
+ id: string;
49
+ from: number;
50
+ time: number;
51
+ /** `time - from`, in seconds. */
52
+ delta: number;
53
+ }
30
54
  /** The part of the timeline in view, for a slot to draw: times, and the scale between time and px. */
31
55
  export interface TimelineView {
32
56
  /** The timeline's first and last time. */
@@ -41,6 +65,12 @@ export interface TimelineView {
41
65
  /** A time's x in the track, in px. */
42
66
  toX: (time: number) => number;
43
67
  }
68
+ /**
69
+ * The marker being dragged or moved by key, if any: its id, where the move started, where it is now and the
70
+ * difference. Null otherwise, and for a pick-up-and-place, which moves it in one step. For drawing what moves with a
71
+ * marker at its new place, as `moveWith` does for spans and points. Inside a Timeline.
72
+ */
73
+ export declare function useTimelineMove(): TimelineMove | null;
44
74
  type TimelineName = {
45
75
  'aria-label': string;
46
76
  } | {
@@ -169,6 +199,12 @@ interface ItemBase {
169
199
  tone?: TimelineTone;
170
200
  /** More in its tooltip, under the label and time. */
171
201
  details?: ReactNode;
202
+ /**
203
+ * Markers this item moves with (a tween tied to a beat). While one of them is dragged or moved by key, a dashed
204
+ * ghost of the item shows where it would go; the item itself stays where it is, and keeps focus and its name.
205
+ * Moving it is the product's, in `onMoveEnd`.
206
+ */
207
+ moveWith?: string | readonly string[];
172
208
  className?: string;
173
209
  }
174
210
  export interface TimelineSpanProps extends ItemBase {
@@ -187,28 +223,49 @@ export interface TimelinePointProps extends ItemBase {
187
223
  * on 2.5.8's Essential exception for the time axis; keyboard focus reaches every item, in time order, whatever its
188
224
  * width. Items in a lane shouldn't overlap in time: put overlapping things in lanes of their own.
189
225
  */
190
- export declare function TimelineSpan({ id, label, start, end, tone, details, className, }: TimelineSpanProps): import("react").JSX.Element;
226
+ export declare function TimelineSpan({ id, label, start, end, tone, details, moveWith, className, }: TimelineSpanProps): import("react").JSX.Element;
191
227
  /**
192
228
  * Something that happens at an instant, `at`: a cue, an error, a release. A diamond in its tone. Its target is
193
229
  * `--target-min` wide, centred on its time, or narrower where a neighbour is closer than that, so targets never
194
230
  * overlap; the narrow case rests on 2.5.8's Essential exception, as a span's does.
195
231
  */
196
- export declare function TimelinePoint({ id, label, at, tone, details, className, }: TimelinePointProps): import("react").JSX.Element;
232
+ export declare function TimelinePoint({ id, label, at, tone, details, moveWith, className, }: TimelinePointProps): import("react").JSX.Element;
197
233
  export interface TimelineMarker {
198
234
  id: string;
199
235
  time: number;
200
236
  /** A short name, shown on its flag: "Beat 3", "Chorus", "Cut". */
201
237
  label: string;
238
+ /**
239
+ * Where it belongs, for a marker people may retime (a named beat): its menu then offers "Reset to {time}", which
240
+ * moves it back, as a finished move. Disabled while it is there.
241
+ */
242
+ defaultTime?: number;
202
243
  }
203
244
  export interface TimelineMarkersProps {
204
245
  /** Shown in the label column, and names the group of markers. */
205
246
  label: string;
206
247
  markers: readonly TimelineMarker[];
207
248
  /**
208
- * Called as a marker moves, with where it is now (snapped, unless Alt or Option is held). Leave it out for
209
- * markers that can't move: they are still focusable, and say their time.
249
+ * Called as a marker moves, with where it is now (snapped, unless Alt or Option is held): every step of a drag or
250
+ * a key. Leave it out for markers that can't move: they are still focusable, and say their time.
210
251
  */
211
252
  onMove?: (id: string, time: number) => void;
253
+ /**
254
+ * Called once when a move is finished, with where the marker ended: when a drag is dropped, a picked-up marker is
255
+ * put down, a marker is reset, or, for the keys, when they have rested for 600ms or focus leaves the flag. Not
256
+ * called when Escape puts it back, or when it ends where it started. For saving a version per move.
257
+ */
258
+ onMoveEnd?: (id: string, time: number) => void;
259
+ /** Called when a marker is opened: for markers that carry something to open (a note, a comment). */
260
+ onAction?: (id: string) => void;
261
+ /**
262
+ * What pressing a flag (a click, or Enter or Space) does. `action` (the default with `onAction`) opens it; it still
263
+ * moves by drag and by key, and its menu's Move picks it up to place without dragging (2.5.7). `move` (the default
264
+ * without) picks it up: click it, then click where it should go; with `onAction`, its menu's Open opens it.
265
+ */
266
+ pressAction?: 'move' | 'action';
267
+ /** The menu item that opens a marker when a press moves it: "Open note". Default `labels.open`. */
268
+ actionLabel?: string;
212
269
  /**
213
270
  * Points to snap to, instead of the Timeline's `snapPoints`. A marker never snaps to a point with its own label
214
271
  * at its own time, so a band's markers can be among its snap points.
@@ -224,8 +281,12 @@ export interface TimelineMarkersProps {
224
281
  * - dragging it, snapping to the snap points within 8px and otherwise to the step (a frame); Alt or Option moves it
225
282
  * freely. The point it snaps to is said, once each time it snaps.
226
283
  * - the arrow keys: a step, Shift ten, caught by any snap point on the way; Alt or Option without snapping.
227
- * - without dragging (2.5.7): click it to pick it up, then click the ruler or this band where it should go. Escape
228
- * puts it back. What happened shows, and is said, in the line under the timeline.
284
+ * - without dragging (2.5.7): pick it up, by pressing it (`pressAction="move"`) or from its menu, then click the
285
+ * ruler or this band where it should go.
286
+ *
287
+ * Escape puts a marker back where the move started: a drag, a run of keys, or a pick-up. What happened shows, and
288
+ * is said, in the line under the timeline. A flag with something in its menu (Open, Move, Reset) has a menu button
289
+ * beside it, its own tab stop; Shift+F10, the context-menu key and a right-click open it from the flag too.
229
290
  */
230
- export declare function TimelineMarkers({ label, markers, onMove, snapPoints, className, }: TimelineMarkersProps): import("react").JSX.Element;
291
+ export declare function TimelineMarkers({ label, markers, onMove, onMoveEnd, onAction, pressAction, actionLabel, snapPoints, className, }: TimelineMarkersProps): import("react").JSX.Element;
231
292
  //# sourceMappingURL=timeline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/ui/timeline.tsx"],"names":[],"mappings":"AAEA,OAAO,EAeL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EASL,KAAK,GAAG,EACR,KAAK,SAAS,IAAI,YAAY,EAC/B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EASL,KAAK,SAAS,EACd,KAAK,UAAU,EAEhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtE,sHAAsH;AACtH,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,MAAM,E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