@design.estate/dees-catalog 21.33.0 → 21.33.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.
@@ -30,6 +30,17 @@ export const kanbanDemoReleasedColumn: IKanbanColumn = {
30
30
  collapsible: 'collapsed',
31
31
  };
32
32
 
33
+ /** The columns of a delivery workflow, from the backlog to the release. */
34
+ export const kanbanDemoWorkflowColumns: IKanbanColumn[] = [
35
+ { id: 'backlog', title: 'Backlog' },
36
+ { id: 'ready', title: 'Ready' },
37
+ { id: 'progress', title: 'In progress' },
38
+ { id: 'input', title: 'Needs input' },
39
+ { id: 'review', title: 'Review' },
40
+ { id: 'done', title: 'Landed', done: true },
41
+ kanbanDemoReleasedColumn,
42
+ ];
43
+
33
44
  export const kanbanDemoProjects: IKanbanProject[] = [
34
45
  { id: 'app', name: 'Workspace app' },
35
46
  { id: 'catalog', name: 'Design catalog' },
@@ -40,6 +51,8 @@ const [mara, jonas, alex] = kanbanDemoPeople;
40
51
  export interface IKanbanDemoOptions {
41
52
  /** Adds five shipped tasks in `kanbanDemoReleasedColumn`. */
42
53
  released?: boolean;
54
+ /** Adds a third epic and a busy team's work across `kanbanDemoWorkflowColumns`. */
55
+ workflow?: boolean;
43
56
  }
44
57
 
45
58
  export interface IKanbanDemo {
@@ -77,6 +90,96 @@ const releasedTickets = (): IKanbanTicket[] =>
77
90
  updatedBy: mara,
78
91
  }));
79
92
 
93
+ /** A demo task's own fields; the helper adds its kind, key, order and history. */
94
+ type TDemoTask = Pick<
95
+ IKanbanTicket,
96
+ 'title' | 'columnId' | 'project' | 'parentId' | 'priority' | 'assignee' | 'labels'
97
+ > & {
98
+ subtasks?: [title: string, columnId: string][];
99
+ };
100
+
101
+ /**
102
+ * A busy team's work across `kanbanDemoWorkflowColumns`, after the seeded tickets of each column:
103
+ * Backlog, Ready, In progress and Landed run past the fold of a laptop screen.
104
+ */
105
+ const workflowTickets = (): IKanbanTicket[] => {
106
+ const tasks: TDemoTask[] = [
107
+ { columnId: 'backlog', title: 'Archive finished projects', parentId: 'epic-1', priority: 'low', assignee: mara, labels: ['Design'], project: 'app' },
108
+ { columnId: 'backlog', title: 'Keep comment drafts while offline', parentId: 'epic-2', priority: 'normal', labels: ['Collaboration'], project: 'app' },
109
+ { columnId: 'backlog', title: 'Move several tickets at once', parentId: 'epic-3', priority: 'normal', assignee: jonas, labels: ['Productivity'], project: 'app', subtasks: [['Select several cards', 'backlog'], ['Move them in one request', 'backlog']] },
110
+ { columnId: 'backlog', title: 'Explain each empty state with a next step', parentId: 'epic-1', priority: 'low', labels: ['Design', 'Content'], project: 'app' },
111
+ { columnId: 'backlog', title: 'Import tickets from a spreadsheet', parentId: 'epic-3', assignee: mara, labels: ['Integrations'], project: 'app' },
112
+ { columnId: 'backlog', title: 'Measure board load time in the field', parentId: 'epic-3', priority: 'normal', assignee: alex, labels: ['Performance'], project: 'catalog' },
113
+ { columnId: 'ready', title: 'Pin a ticket to the top of its column', parentId: 'epic-1', priority: 'normal', assignee: jonas, labels: ['Design'], project: 'app' },
114
+ { columnId: 'ready', title: 'Notify watchers when a ticket moves', parentId: 'epic-2', priority: 'high', assignee: mara, labels: ['Collaboration'], project: 'app', subtasks: [['Choose who is notified', 'ready'], ['Write the notification text', 'ready']] },
115
+ { columnId: 'ready', title: 'Render only the visible cards of long columns', parentId: 'epic-3', priority: 'high', assignee: alex, labels: ['Performance'], project: 'catalog' },
116
+ { columnId: 'ready', title: 'Lay the board out right to left', parentId: 'epic-1', priority: 'normal', labels: ['Accessibility'], project: 'catalog' },
117
+ { columnId: 'ready', title: 'List the keyboard shortcuts', parentId: 'epic-1', priority: 'low', assignee: alex, labels: ['Accessibility'], project: 'catalog' },
118
+ { columnId: 'ready', title: 'Share a filtered board by link', parentId: 'epic-2', priority: 'normal', assignee: jonas, labels: ['Collaboration'], project: 'app' },
119
+ { columnId: 'progress', title: 'Show who is typing in the discussion', parentId: 'epic-2', priority: 'normal', assignee: jonas, labels: ['Collaboration'], project: 'app' },
120
+ { columnId: 'progress', title: 'Keep unchanged cards on refresh', parentId: 'epic-3', priority: 'urgent', assignee: alex, labels: ['Performance', 'Bug'], project: 'catalog', subtasks: [['Profile a board of 500 tickets', 'done'], ['Reuse the cards that did not change', 'progress']] },
121
+ { columnId: 'progress', title: 'Preview attachments in the ticket', parentId: 'epic-2', priority: 'normal', assignee: mara, labels: ['Design'], project: 'app' },
122
+ { columnId: 'progress', title: 'Larger drag targets on touch screens', parentId: 'epic-1', priority: 'high', assignee: alex, labels: ['Mobile', 'Accessibility'], project: 'catalog' },
123
+ { columnId: 'progress', title: 'Keep the filters in step across tabs', parentId: 'epic-3', priority: 'low', assignee: jonas, labels: ['Bug'], project: 'app' },
124
+ { columnId: 'input', title: 'Decide the default column limits', parentId: 'epic-3', priority: 'normal', assignee: mara, labels: ['Product'], project: 'app' },
125
+ { columnId: 'input', title: 'Confirm the export format with finance', priority: 'high', assignee: jonas, labels: ['Integrations'], project: 'app' },
126
+ { columnId: 'input', title: 'Which fields should a template copy?', parentId: 'epic-2', priority: 'low', labels: ['Product'], project: 'app' },
127
+ { columnId: 'review', title: 'Return focus after closing a ticket', parentId: 'epic-1', priority: 'urgent', assignee: alex, labels: ['Bug', 'Accessibility'], project: 'catalog' },
128
+ { columnId: 'review', title: 'Suggest people when mentioning', parentId: 'epic-2', priority: 'high', assignee: jonas, labels: ['Collaboration'], project: 'app', subtasks: [['Rank recent people first', 'review'], ['Insert the mention as a chip', 'done']] },
129
+ { columnId: 'review', title: 'Cache avatars across boards', parentId: 'epic-3', priority: 'normal', assignee: alex, labels: ['Performance'], project: 'catalog' },
130
+ { columnId: 'review', title: 'Write the onboarding tour', parentId: 'epic-1', priority: 'low', assignee: mara, labels: ['Content'], project: 'app' },
131
+ { columnId: 'done', title: 'Keep column headers in view', parentId: 'epic-1', priority: 'normal', assignee: alex, labels: ['Design'], project: 'catalog' },
132
+ { columnId: 'done', title: 'Find a ticket by its key', parentId: 'epic-3', priority: 'normal', assignee: jonas, labels: ['Productivity'], project: 'app' },
133
+ { columnId: 'done', title: 'Show the assignee on every card', parentId: 'epic-2', priority: 'low', assignee: mara, labels: ['Design'], project: 'catalog' },
134
+ { columnId: 'done', title: 'Retry a move that failed', parentId: 'epic-3', priority: 'high', assignee: jonas, labels: ['Bug'], project: 'app' },
135
+ { columnId: 'done', title: 'Respect reduced motion while dragging', parentId: 'epic-1', priority: 'normal', assignee: alex, labels: ['Accessibility'], project: 'catalog' },
136
+ { columnId: 'done', title: 'Paste images into comments', parentId: 'epic-2', priority: 'normal', assignee: mara, labels: ['Collaboration'], project: 'app' },
137
+ ];
138
+ // CAT-120 to CAT-157, the epic CAT-160.
139
+ let key = 120;
140
+ const orders = new Map<string, number>();
141
+ // After the seeded tickets, which take the first two places of a column at most.
142
+ const order = (columnId: string) => {
143
+ const next = orders.get(columnId) ?? 2;
144
+ orders.set(columnId, next + 1);
145
+ return next;
146
+ };
147
+ const history = (day: number) => ({
148
+ createdAt: `2026-09-${String(day).padStart(2, '0')}T09:00:00Z`,
149
+ createdBy: mara,
150
+ updatedAt: `2026-09-${String(day + 2).padStart(2, '0')}T15:00:00Z`,
151
+ updatedBy: mara,
152
+ });
153
+ const epic: IKanbanTicket = {
154
+ id: 'epic-3',
155
+ key: 'CAT-160',
156
+ kind: 'epic',
157
+ title: 'Fast at any size',
158
+ description: 'Keep large boards quick to load, search and change.',
159
+ columnId: 'progress',
160
+ order: 2,
161
+ project: 'app',
162
+ ...history(14),
163
+ };
164
+ return [epic, ...tasks.flatMap(({ subtasks = [], ...task }, index) => {
165
+ const id = `flow-${index + 1}`;
166
+ return [
167
+ { ...task, id, key: `CAT-${key++}`, kind: 'task' as const, order: order(task.columnId), ...history(1 + index % 25) },
168
+ ...subtasks.map(([title, columnId], position) => ({
169
+ id: `${id}-${position + 1}`,
170
+ key: `CAT-${key++}`,
171
+ kind: 'subtask' as const,
172
+ title,
173
+ parentId: id,
174
+ columnId,
175
+ order: position,
176
+ assignee: task.assignee,
177
+ project: task.project,
178
+ })),
179
+ ];
180
+ })];
181
+ };
182
+
80
183
  /** The next revision of a ticket the provider changed. */
81
184
  const revised = (ticket: IKanbanTicket): IKanbanTicket => ({
82
185
  ...ticket,
@@ -273,6 +376,7 @@ export const createKanbanDemo = (options: IKanbanDemoOptions = {}): IKanbanDemo
273
376
  project: 'catalog',
274
377
  },
275
378
  ...options.released ? releasedTickets() : [],
379
+ ...options.workflow ? workflowTickets() : [],
276
380
  ];
277
381
  let tickets = seeded.map(revised);
278
382
  let comments: IKanbanComment[] = [
@@ -661,6 +661,22 @@ export class KanbanDragController {
661
661
  ? Math.min(1, Math.max(0, (point - end + edge) / edge)) * 14 * elapsed
662
662
  : 0;
663
663
  let movedX = false, movedY = false;
664
+ // The column under the pointer scrolls its own cards first, then the board and the page follow.
665
+ const lane = this.columns.find(column => {
666
+ const rect = column.getBoundingClientRect();
667
+ return gesture.x >= rect.left && gesture.x <= rect.right;
668
+ });
669
+ const cards = lane?.cardScroller;
670
+ if (lane && cards) {
671
+ const rect = cards.getBoundingClientRect();
672
+ const top = Math.max(0, rect.top), bottom = Math.min(innerHeight, rect.bottom);
673
+ if (gesture.y >= top - 56 && gesture.y <= bottom + 56) {
674
+ const y = cards.scrollTop;
675
+ cards.scrollTop += velocity(gesture.y, top, bottom, 56);
676
+ movedY = cards.scrollTop !== y;
677
+ if (movedY) lane.syncScrollEdges();
678
+ }
679
+ }
664
680
  for (const parent of this.scrollParents) {
665
681
  const rect = parent === document.scrollingElement
666
682
  ? { left: 0, top: 0, right: innerWidth, bottom: innerHeight }