@design.estate/dees-catalog 21.29.0 → 21.30.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_bundle/bundle.js +2560 -1290
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-CJVVAKHG.js → chunk-NKLF624Z.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-QFJ7LA5L.js → chunk-Q2W326R5.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-YBZRR5YD.js → chunk-W57NRRM4.js} +41 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-YBZRR5YD.js.map → chunk-W57NRRM4.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-ZU5CNY4P.js → de-J7BORZFB.js} +41 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-J7BORZFB.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-NVJRWZKO.js → dees-modal-UURRHHYX.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-BSBYG5IX.js → dees-workspace-terminal-ZBGBOINI.js} +4 -4
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-dataview/dees-table/filters.d.ts +2 -0
- package/dist_ts_web/elements/00group-dataview/dees-table/filters.js +11 -13
- package/dist_ts_web/elements/00group-dataview/dees-table/styles.d.ts +6 -0
- package/dist_ts_web/elements/00group-dataview/dees-table/styles.js +33 -23
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.d.ts +80 -6
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.d.ts +1 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.js +38 -9
- package/dist_ts_web/elements/00group-kanban/dees-kanban/dees-kanban.js +502 -73
- package/dist_ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.d.ts +40 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.js +373 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.d.ts +2 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.js +35 -2
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.d.ts +5 -1
- package/dist_ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.js +24 -3
- package/dist_ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.d.ts +2 -0
- package/dist_ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.js +31 -70
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.d.ts +26 -3
- package/dist_ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.js +475 -21
- package/dist_ts_web/elements/00group-kanban/index.d.ts +1 -0
- package/dist_ts_web/elements/00group-kanban/index.js +2 -1
- package/dist_ts_web/elements/00group-kanban/interfaces.d.ts +114 -0
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.d.ts +9 -3
- package/dist_ts_web/elements/00group-kanban/kanban.demodata.js +210 -17
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.d.ts +23 -1
- package/dist_ts_web/elements/00group-kanban/kanban.helpers.js +57 -1
- package/dist_ts_web/elements/00group-kanban/kanban.styles.d.ts +2 -0
- package/dist_ts_web/elements/00group-kanban/kanban.styles.js +54 -1
- package/dist_ts_web/i18n/de.d.ts +156 -0
- package/dist_ts_web/i18n/de.js +40 -1
- package/dist_ts_web/i18n/messages.d.ts +156 -0
- package/dist_ts_web/i18n/messages.js +40 -1
- package/package.json +1 -1
- package/readme.md +59 -10
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-dataview/dees-table/filters.ts +14 -12
- package/ts_web/elements/00group-dataview/dees-table/styles.ts +33 -22
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.demo.ts +43 -8
- package/ts_web/elements/00group-kanban/dees-kanban/dees-kanban.ts +521 -60
- package/ts_web/elements/00group-kanban/dees-kanban-activity/dees-kanban-activity.ts +328 -0
- package/ts_web/elements/00group-kanban/dees-kanban-card/dees-kanban-card.ts +28 -0
- package/ts_web/elements/00group-kanban/dees-kanban-column/dees-kanban-column.ts +13 -2
- package/ts_web/elements/00group-kanban/dees-kanban-discussion/dees-kanban-discussion.ts +25 -68
- package/ts_web/elements/00group-kanban/dees-kanban-ticket-detail/dees-kanban-ticket-detail.ts +476 -17
- package/ts_web/elements/00group-kanban/index.ts +1 -0
- package/ts_web/elements/00group-kanban/interfaces.ts +98 -0
- package/ts_web/elements/00group-kanban/kanban.demodata.ts +231 -17
- package/ts_web/elements/00group-kanban/kanban.helpers.ts +79 -1
- package/ts_web/elements/00group-kanban/kanban.styles.ts +54 -0
- package/ts_web/i18n/de.ts +39 -0
- package/ts_web/i18n/messages.ts +39 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-ZU5CNY4P.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-CJVVAKHG.js.map → chunk-NKLF624Z.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-QFJ7LA5L.js.map → chunk-Q2W326R5.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-NVJRWZKO.js.map → dees-modal-UURRHHYX.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-BSBYG5IX.js.map → dees-workspace-terminal-ZBGBOINI.js.map} +0 -0
|
@@ -4,6 +4,35 @@ export type TKanbanTicketKind = 'epic' | 'task' | 'subtask';
|
|
|
4
4
|
export type TKanbanPriority = 'none' | 'low' | 'normal' | 'high' | 'urgent';
|
|
5
5
|
export interface IKanbanPerson { id: string; name: string; }
|
|
6
6
|
export interface IKanbanColumn { id: string; title: string; /** Marks completed subtasks. */ done?: boolean; }
|
|
7
|
+
/** A project tickets belong to: a ticket's `project` is its `id`, the board shows its `name`. */
|
|
8
|
+
export interface IKanbanProject { id: string; name: string; }
|
|
9
|
+
/**
|
|
10
|
+
* Where a ticket's work lives: a branch (at a commit), a commit, a release, or any page. `url`
|
|
11
|
+
* makes the link open that page; without it the link shows what it names.
|
|
12
|
+
*/
|
|
13
|
+
export type TKanbanLink =
|
|
14
|
+
| { kind: 'branch'; repo: string; branch: string; sha?: string; url?: string }
|
|
15
|
+
| { kind: 'commit'; repo: string; sha: string; url?: string }
|
|
16
|
+
| { kind: 'release'; package: string; version: string; url?: string }
|
|
17
|
+
| { kind: 'url'; url: string; label?: string };
|
|
18
|
+
export interface IKanbanAttachment {
|
|
19
|
+
name: string;
|
|
20
|
+
url: string;
|
|
21
|
+
/** MIME type. */
|
|
22
|
+
type?: string;
|
|
23
|
+
/** Size in bytes. */
|
|
24
|
+
size?: number;
|
|
25
|
+
}
|
|
26
|
+
/** What a ticket was written from: the words it started as, with their files. */
|
|
27
|
+
export interface IKanbanSource {
|
|
28
|
+
/** Whose words or what kind of source, in the host's language ("Owner's words"). */
|
|
29
|
+
label?: string;
|
|
30
|
+
text: string;
|
|
31
|
+
author?: IKanbanPerson;
|
|
32
|
+
/** ISO 8601 timestamp. */
|
|
33
|
+
createdAt?: string;
|
|
34
|
+
attachments?: IKanbanAttachment[];
|
|
35
|
+
}
|
|
7
36
|
export interface IKanbanTicket {
|
|
8
37
|
id: string;
|
|
9
38
|
key: string;
|
|
@@ -17,6 +46,15 @@ export interface IKanbanTicket {
|
|
|
17
46
|
priority?: TKanbanPriority;
|
|
18
47
|
assignee?: IKanbanPerson;
|
|
19
48
|
labels?: string[];
|
|
49
|
+
/** The `id` of the project the ticket belongs to (`IKanbanProject`). */
|
|
50
|
+
project?: string;
|
|
51
|
+
links?: TKanbanLink[];
|
|
52
|
+
source?: IKanbanSource;
|
|
53
|
+
/** ISO 8601 timestamps. */
|
|
54
|
+
createdAt?: string;
|
|
55
|
+
updatedAt?: string;
|
|
56
|
+
createdBy?: IKanbanPerson;
|
|
57
|
+
updatedBy?: IKanbanPerson;
|
|
20
58
|
/** UI capabilities; the provider must enforce authorization independently. */
|
|
21
59
|
permissions?: { edit?: boolean; move?: boolean; comment?: boolean; createChild?: boolean };
|
|
22
60
|
}
|
|
@@ -28,12 +66,38 @@ export interface IKanbanComment {
|
|
|
28
66
|
createdAt: string;
|
|
29
67
|
body: TReferenceContent;
|
|
30
68
|
}
|
|
69
|
+
export type TKanbanActivityAction =
|
|
70
|
+
| 'created'
|
|
71
|
+
| 'updated'
|
|
72
|
+
| 'moved'
|
|
73
|
+
| 'reordered'
|
|
74
|
+
| 'commented'
|
|
75
|
+
| 'linked';
|
|
76
|
+
/** One entry of a ticket's history. */
|
|
77
|
+
export interface IKanbanActivity {
|
|
78
|
+
id: string;
|
|
79
|
+
ticketId: string;
|
|
80
|
+
actor: IKanbanPerson;
|
|
81
|
+
/** ISO 8601 timestamp. */
|
|
82
|
+
createdAt: string;
|
|
83
|
+
action: TKanbanActivityAction;
|
|
84
|
+
/**
|
|
85
|
+
* The ticket fields the entry changed, by `IKanbanTicket` field name, with their values before and
|
|
86
|
+
* after in the ticket's shape: `columnId` a column id, `assignee` a person, `project` a project id.
|
|
87
|
+
* A field the board does not know shows its raw value.
|
|
88
|
+
*/
|
|
89
|
+
changes?: Record<string, { before?: unknown; after?: unknown }>;
|
|
90
|
+
/** The host's own sentence for the entry, shown in place of the board's. */
|
|
91
|
+
summary?: string;
|
|
92
|
+
}
|
|
31
93
|
export interface IKanbanTicketChanges {
|
|
32
94
|
title?: string;
|
|
33
95
|
description?: string;
|
|
34
96
|
priority?: TKanbanPriority;
|
|
35
97
|
assignee?: IKanbanPerson | null;
|
|
36
98
|
parentId?: string | null;
|
|
99
|
+
project?: string;
|
|
100
|
+
labels?: string[];
|
|
37
101
|
}
|
|
38
102
|
export interface IKanbanTicketDraft {
|
|
39
103
|
title: string;
|
|
@@ -41,6 +105,10 @@ export interface IKanbanTicketDraft {
|
|
|
41
105
|
priority: TKanbanPriority;
|
|
42
106
|
assigneeId: string;
|
|
43
107
|
parentId: string;
|
|
108
|
+
/** Left out, the ticket keeps its labels. */
|
|
109
|
+
labels?: string[];
|
|
110
|
+
/** Left out, the ticket keeps its project. */
|
|
111
|
+
project?: string;
|
|
44
112
|
}
|
|
45
113
|
export interface IKanbanMove {
|
|
46
114
|
ticketId: string;
|
|
@@ -53,12 +121,42 @@ export interface IKanbanCreate {
|
|
|
53
121
|
title: string;
|
|
54
122
|
columnId: string;
|
|
55
123
|
parentId?: string;
|
|
124
|
+
/** The board's project filter while one is chosen, else the parent's project. */
|
|
125
|
+
project?: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The board's filters, as the reader chose them. A filter left out, or empty, does not narrow the
|
|
129
|
+
* board.
|
|
130
|
+
*/
|
|
131
|
+
export interface IKanbanFilterValues {
|
|
132
|
+
/** The search: key, title, project, assignee, labels and child tickets. */
|
|
133
|
+
text?: string;
|
|
134
|
+
/** A project `id`. */
|
|
135
|
+
project?: string;
|
|
136
|
+
/** A person's `id`; `'none'` for unassigned tasks. */
|
|
137
|
+
assignee?: string;
|
|
138
|
+
label?: string;
|
|
139
|
+
/** An epic's ticket `id`. */
|
|
140
|
+
epic?: string;
|
|
141
|
+
/** Only tasks assigned to `currentPersonId`. */
|
|
142
|
+
mine?: boolean;
|
|
143
|
+
}
|
|
144
|
+
/** A fresh copy of a board: its tickets, its columns when they changed, and its revision. */
|
|
145
|
+
export interface IKanbanBoardSnapshot {
|
|
146
|
+
tickets: IKanbanTicket[];
|
|
147
|
+
columns?: IKanbanColumn[];
|
|
148
|
+
/** Increases with every change; a snapshot older than the board's is dropped. */
|
|
149
|
+
revision?: number;
|
|
56
150
|
}
|
|
57
151
|
/** Missing mutation callbacks make the corresponding controls read-only. AbortSignals cancel obsolete reads. */
|
|
58
152
|
export interface IKanbanProvider {
|
|
59
153
|
getTicket?: (id: string, signal: AbortSignal) => Promise<IKanbanTicket>;
|
|
60
154
|
searchTickets?: (query: string, signal: AbortSignal) => Promise<IKanbanTicket[]>;
|
|
61
155
|
loadComments?: (ticketId: string, signal: AbortSignal) => Promise<IKanbanComment[]>;
|
|
156
|
+
/** A ticket's history, oldest first. Without it the detail shows no history. */
|
|
157
|
+
loadActivity?: (ticketId: string, signal: AbortSignal) => Promise<IKanbanActivity[]>;
|
|
158
|
+
/** The whole board again, for `refresh()`. */
|
|
159
|
+
loadBoard?: (signal: AbortSignal) => Promise<IKanbanBoardSnapshot>;
|
|
62
160
|
addComment?: (input: { ticketId: string; body: TReferenceContent }) => Promise<IKanbanComment>;
|
|
63
161
|
updateTicket?: (input: { ticketId: string; changes: IKanbanTicketChanges }) => Promise<IKanbanTicket>;
|
|
64
162
|
/** Return all records whose order or column changed. */
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
IKanbanActivity,
|
|
2
3
|
IKanbanColumn,
|
|
3
4
|
IKanbanComment,
|
|
4
5
|
IKanbanPerson,
|
|
6
|
+
IKanbanProject,
|
|
5
7
|
IKanbanProvider,
|
|
6
8
|
IKanbanTicket,
|
|
9
|
+
TKanbanActivityAction,
|
|
7
10
|
} from './interfaces.js';
|
|
8
11
|
|
|
9
12
|
export const kanbanDemoPeople: IKanbanPerson[] = [
|
|
@@ -19,7 +22,23 @@ export const kanbanDemoColumns: IKanbanColumn[] = [
|
|
|
19
22
|
{ id: 'done', title: 'Done', done: true },
|
|
20
23
|
];
|
|
21
24
|
|
|
22
|
-
export const
|
|
25
|
+
export const kanbanDemoProjects: IKanbanProject[] = [
|
|
26
|
+
{ id: 'app', name: 'Workspace app' },
|
|
27
|
+
{ id: 'catalog', name: 'Design catalog' },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const [mara, jonas, alex] = kanbanDemoPeople;
|
|
31
|
+
|
|
32
|
+
export interface IKanbanDemo {
|
|
33
|
+
tickets: IKanbanTicket[];
|
|
34
|
+
provider: IKanbanProvider;
|
|
35
|
+
/** The board's revision the tickets are at. */
|
|
36
|
+
revision: number;
|
|
37
|
+
/** The person the provider's changes are made as from now on (Mara Chen until then). */
|
|
38
|
+
actAs: (person: IKanbanPerson) => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const createKanbanDemo = (): IKanbanDemo => {
|
|
23
42
|
let tickets: IKanbanTicket[] = [
|
|
24
43
|
{
|
|
25
44
|
id: 'epic-1',
|
|
@@ -29,6 +48,11 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
29
48
|
description: 'Make daily work feel focused, connected and easy to navigate.',
|
|
30
49
|
columnId: 'progress',
|
|
31
50
|
order: 0,
|
|
51
|
+
project: 'app',
|
|
52
|
+
createdAt: '2026-09-14T08:00:00Z',
|
|
53
|
+
createdBy: mara,
|
|
54
|
+
updatedAt: '2026-09-14T08:00:00Z',
|
|
55
|
+
updatedBy: mara,
|
|
32
56
|
},
|
|
33
57
|
{
|
|
34
58
|
id: 'epic-2',
|
|
@@ -38,6 +62,11 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
38
62
|
description: 'Keep everyone close to the work and the decisions behind it.',
|
|
39
63
|
columnId: 'progress',
|
|
40
64
|
order: 1,
|
|
65
|
+
project: 'app',
|
|
66
|
+
createdAt: '2026-09-14T08:10:00Z',
|
|
67
|
+
createdBy: mara,
|
|
68
|
+
updatedAt: '2026-09-14T08:10:00Z',
|
|
69
|
+
updatedBy: mara,
|
|
41
70
|
},
|
|
42
71
|
{
|
|
43
72
|
id: 'task-1',
|
|
@@ -49,8 +78,13 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
49
78
|
columnId: 'backlog',
|
|
50
79
|
order: 0,
|
|
51
80
|
priority: 'normal',
|
|
52
|
-
assignee:
|
|
81
|
+
assignee: mara,
|
|
53
82
|
labels: ['Design'],
|
|
83
|
+
project: 'app',
|
|
84
|
+
createdAt: '2026-09-15T09:00:00Z',
|
|
85
|
+
createdBy: mara,
|
|
86
|
+
updatedAt: '2026-09-15T09:00:00Z',
|
|
87
|
+
updatedBy: mara,
|
|
54
88
|
},
|
|
55
89
|
{
|
|
56
90
|
id: 'task-2',
|
|
@@ -62,8 +96,50 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
62
96
|
columnId: 'progress',
|
|
63
97
|
order: 0,
|
|
64
98
|
priority: 'high',
|
|
65
|
-
assignee:
|
|
99
|
+
assignee: jonas,
|
|
66
100
|
labels: ['Collaboration'],
|
|
101
|
+
project: 'app',
|
|
102
|
+
links: [
|
|
103
|
+
{
|
|
104
|
+
kind: 'branch',
|
|
105
|
+
repo: 'workspace/app',
|
|
106
|
+
branch: 'feat/ticket-references',
|
|
107
|
+
sha: '4f9c2e1a7b3d5e8f0a1b2c3d4e5f60718293a4b5',
|
|
108
|
+
url: 'https://example.com/workspace/app/src/branch/feat/ticket-references',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
kind: 'commit',
|
|
112
|
+
repo: 'workspace/app',
|
|
113
|
+
sha: '9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b',
|
|
114
|
+
url: 'https://example.com/workspace/app/commit/9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b',
|
|
115
|
+
},
|
|
116
|
+
{ kind: 'release', package: '@acme/workspace', version: '2.4.0' },
|
|
117
|
+
{ kind: 'url', url: 'https://example.com/design/references', label: 'Design notes' },
|
|
118
|
+
],
|
|
119
|
+
source: {
|
|
120
|
+
label: 'Planning notes',
|
|
121
|
+
text: 'Tickets should link to each other from the conversation. When I mention a ticket, its title must stay right even after someone renames it.',
|
|
122
|
+
author: mara,
|
|
123
|
+
createdAt: '2026-09-15T14:20:00Z',
|
|
124
|
+
attachments: [
|
|
125
|
+
{
|
|
126
|
+
name: 'reference-picker.png',
|
|
127
|
+
url: 'https://example.com/files/reference-picker.png',
|
|
128
|
+
type: 'image/png',
|
|
129
|
+
size: 248_320,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'interview-notes.pdf',
|
|
133
|
+
url: 'https://example.com/files/interview-notes.pdf',
|
|
134
|
+
type: 'application/pdf',
|
|
135
|
+
size: 1_288_490,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
createdAt: '2026-09-15T14:30:00Z',
|
|
140
|
+
createdBy: mara,
|
|
141
|
+
updatedAt: '2026-09-17T08:31:00Z',
|
|
142
|
+
updatedBy: jonas,
|
|
67
143
|
},
|
|
68
144
|
{
|
|
69
145
|
id: 'task-3',
|
|
@@ -75,8 +151,13 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
75
151
|
columnId: 'progress',
|
|
76
152
|
order: 1,
|
|
77
153
|
priority: 'normal',
|
|
78
|
-
assignee:
|
|
154
|
+
assignee: alex,
|
|
79
155
|
labels: ['Accessibility'],
|
|
156
|
+
project: 'catalog',
|
|
157
|
+
createdAt: '2026-09-15T10:00:00Z',
|
|
158
|
+
createdBy: mara,
|
|
159
|
+
updatedAt: '2026-09-16T11:00:00Z',
|
|
160
|
+
updatedBy: alex,
|
|
80
161
|
},
|
|
81
162
|
{
|
|
82
163
|
id: 'task-4',
|
|
@@ -88,7 +169,12 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
88
169
|
columnId: 'review',
|
|
89
170
|
order: 0,
|
|
90
171
|
priority: 'low',
|
|
91
|
-
assignee:
|
|
172
|
+
assignee: mara,
|
|
173
|
+
project: 'app',
|
|
174
|
+
createdAt: '2026-09-15T10:30:00Z',
|
|
175
|
+
createdBy: jonas,
|
|
176
|
+
updatedAt: '2026-09-18T16:00:00Z',
|
|
177
|
+
updatedBy: mara,
|
|
92
178
|
},
|
|
93
179
|
{
|
|
94
180
|
id: 'task-5',
|
|
@@ -99,8 +185,14 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
99
185
|
parentId: 'epic-1',
|
|
100
186
|
columnId: 'done',
|
|
101
187
|
order: 0,
|
|
102
|
-
assignee:
|
|
188
|
+
assignee: alex,
|
|
103
189
|
labels: ['Foundations'],
|
|
190
|
+
project: 'catalog',
|
|
191
|
+
links: [{ kind: 'release', package: '@acme/catalog', version: '21.4.0' }],
|
|
192
|
+
createdAt: '2026-09-14T12:00:00Z',
|
|
193
|
+
createdBy: alex,
|
|
194
|
+
updatedAt: '2026-09-17T17:45:00Z',
|
|
195
|
+
updatedBy: alex,
|
|
104
196
|
},
|
|
105
197
|
{
|
|
106
198
|
id: 'sub-1',
|
|
@@ -110,7 +202,8 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
110
202
|
parentId: 'task-2',
|
|
111
203
|
columnId: 'done',
|
|
112
204
|
order: 0,
|
|
113
|
-
assignee:
|
|
205
|
+
assignee: jonas,
|
|
206
|
+
project: 'app',
|
|
114
207
|
},
|
|
115
208
|
{
|
|
116
209
|
id: 'sub-2',
|
|
@@ -120,7 +213,8 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
120
213
|
parentId: 'task-2',
|
|
121
214
|
columnId: 'progress',
|
|
122
215
|
order: 1,
|
|
123
|
-
assignee:
|
|
216
|
+
assignee: jonas,
|
|
217
|
+
project: 'app',
|
|
124
218
|
},
|
|
125
219
|
{
|
|
126
220
|
id: 'sub-3',
|
|
@@ -130,14 +224,15 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
130
224
|
parentId: 'task-3',
|
|
131
225
|
columnId: 'done',
|
|
132
226
|
order: 0,
|
|
133
|
-
assignee:
|
|
227
|
+
assignee: alex,
|
|
228
|
+
project: 'catalog',
|
|
134
229
|
},
|
|
135
230
|
];
|
|
136
231
|
let comments: IKanbanComment[] = [
|
|
137
232
|
{
|
|
138
233
|
id: 'comment-1',
|
|
139
234
|
ticketId: 'task-2',
|
|
140
|
-
author:
|
|
235
|
+
author: mara,
|
|
141
236
|
createdAt: '2026-09-18T09:30:00Z',
|
|
142
237
|
body: [
|
|
143
238
|
{
|
|
@@ -151,7 +246,7 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
151
246
|
{
|
|
152
247
|
id: 'comment-2',
|
|
153
248
|
ticketId: 'task-2',
|
|
154
|
-
author:
|
|
249
|
+
author: jonas,
|
|
155
250
|
createdAt: '2026-09-18T09:42:00Z',
|
|
156
251
|
body: [
|
|
157
252
|
{
|
|
@@ -161,7 +256,82 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
161
256
|
],
|
|
162
257
|
},
|
|
163
258
|
];
|
|
259
|
+
let activity: IKanbanActivity[] = [
|
|
260
|
+
{
|
|
261
|
+
id: 'activity-1',
|
|
262
|
+
ticketId: 'task-2',
|
|
263
|
+
actor: mara,
|
|
264
|
+
createdAt: '2026-09-15T14:30:00Z',
|
|
265
|
+
action: 'created',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
id: 'activity-2',
|
|
269
|
+
ticketId: 'task-2',
|
|
270
|
+
actor: mara,
|
|
271
|
+
createdAt: '2026-09-15T14:34:00Z',
|
|
272
|
+
action: 'updated',
|
|
273
|
+
changes: {
|
|
274
|
+
assignee: { before: undefined, after: jonas },
|
|
275
|
+
priority: { before: 'normal', after: 'high' },
|
|
276
|
+
labels: { before: [], after: ['Collaboration'] },
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: 'activity-3',
|
|
281
|
+
ticketId: 'task-2',
|
|
282
|
+
actor: jonas,
|
|
283
|
+
createdAt: '2026-09-17T08:30:00Z',
|
|
284
|
+
action: 'moved',
|
|
285
|
+
changes: { columnId: { before: 'backlog', after: 'progress' } },
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 'activity-4',
|
|
289
|
+
ticketId: 'task-2',
|
|
290
|
+
actor: jonas,
|
|
291
|
+
createdAt: '2026-09-17T08:31:00Z',
|
|
292
|
+
action: 'linked',
|
|
293
|
+
changes: {
|
|
294
|
+
links: {
|
|
295
|
+
before: [],
|
|
296
|
+
after: [
|
|
297
|
+
{ kind: 'branch', repo: 'workspace/app', branch: 'feat/ticket-references' },
|
|
298
|
+
{ kind: 'commit', repo: 'workspace/app', sha: '9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b' },
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
id: 'activity-5',
|
|
305
|
+
ticketId: 'task-2',
|
|
306
|
+
actor: mara,
|
|
307
|
+
createdAt: '2026-09-18T09:30:00Z',
|
|
308
|
+
action: 'commented',
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
id: 'activity-6',
|
|
312
|
+
ticketId: 'task-2',
|
|
313
|
+
actor: jonas,
|
|
314
|
+
createdAt: '2026-09-18T09:42:00Z',
|
|
315
|
+
action: 'commented',
|
|
316
|
+
},
|
|
317
|
+
];
|
|
164
318
|
let nextKey = 300;
|
|
319
|
+
let revision = 1;
|
|
320
|
+
let actor = mara;
|
|
321
|
+
/** Records a change as the current actor: the ticket's history and the board's revision. */
|
|
322
|
+
const record = (
|
|
323
|
+
ticketId: string,
|
|
324
|
+
action: TKanbanActivityAction,
|
|
325
|
+
changes?: IKanbanActivity['changes'],
|
|
326
|
+
): string => {
|
|
327
|
+
const createdAt = new Date().toISOString();
|
|
328
|
+
activity = [
|
|
329
|
+
...activity,
|
|
330
|
+
{ id: crypto.randomUUID(), ticketId, actor, createdAt, action, ...changes ? { changes } : {} },
|
|
331
|
+
];
|
|
332
|
+
revision++;
|
|
333
|
+
return createdAt;
|
|
334
|
+
};
|
|
165
335
|
// Demo-only in-memory provider. Applications persist through their own authorized APIs.
|
|
166
336
|
const provider: IKanbanProvider = {
|
|
167
337
|
getTicket: async id => {
|
|
@@ -174,24 +344,47 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
174
344
|
`${ticket.key} ${ticket.title}`.toLowerCase().includes(query.toLowerCase()),
|
|
175
345
|
),
|
|
176
346
|
loadComments: async id => comments.filter(comment => comment.ticketId === id),
|
|
347
|
+
loadActivity: async id => activity.filter(entry => entry.ticketId === id),
|
|
348
|
+
loadBoard: async () => ({ tickets, revision }),
|
|
177
349
|
addComment: async input => {
|
|
178
350
|
const comment: IKanbanComment = {
|
|
179
351
|
...input,
|
|
180
352
|
id: crypto.randomUUID(),
|
|
181
|
-
author:
|
|
353
|
+
author: actor,
|
|
182
354
|
createdAt: new Date().toISOString(),
|
|
183
355
|
};
|
|
184
356
|
comments = [...comments, comment];
|
|
357
|
+
record(input.ticketId, 'commented');
|
|
185
358
|
return comment;
|
|
186
359
|
},
|
|
187
360
|
updateTicket: async ({ ticketId, changes }) => {
|
|
188
361
|
const previous = tickets.find(ticket => ticket.id === ticketId)!;
|
|
189
|
-
const
|
|
362
|
+
const next: IKanbanTicket = {
|
|
190
363
|
...previous,
|
|
191
364
|
...changes,
|
|
192
365
|
assignee: changes.assignee === null ? undefined : changes.assignee ?? previous.assignee,
|
|
193
366
|
parentId: changes.parentId === null ? undefined : changes.parentId ?? previous.parentId,
|
|
194
367
|
};
|
|
368
|
+
const changed = Object.fromEntries(
|
|
369
|
+
Object.keys(changes)
|
|
370
|
+
.filter(field =>
|
|
371
|
+
JSON.stringify(previous[field as keyof IKanbanTicket]) !==
|
|
372
|
+
JSON.stringify(next[field as keyof IKanbanTicket]),
|
|
373
|
+
)
|
|
374
|
+
.map(field => [
|
|
375
|
+
field,
|
|
376
|
+
{
|
|
377
|
+
before: previous[field as keyof IKanbanTicket],
|
|
378
|
+
after: next[field as keyof IKanbanTicket],
|
|
379
|
+
},
|
|
380
|
+
]),
|
|
381
|
+
);
|
|
382
|
+
if (!Object.keys(changed).length) return previous;
|
|
383
|
+
const ticket = {
|
|
384
|
+
...next,
|
|
385
|
+
updatedAt: record(ticketId, 'updated', changed),
|
|
386
|
+
updatedBy: actor,
|
|
387
|
+
};
|
|
195
388
|
tickets = tickets.map(item => item.id === ticketId ? ticket : item);
|
|
196
389
|
return ticket;
|
|
197
390
|
},
|
|
@@ -205,21 +398,42 @@ export const createKanbanDemo = (): { tickets: IKanbanTicket[]; provider: IKanba
|
|
|
205
398
|
const index = beforeTicketId
|
|
206
399
|
? destination.findIndex(item => item.id === beforeTicketId)
|
|
207
400
|
: destination.length;
|
|
208
|
-
|
|
401
|
+
const updatedAt = ticket.columnId === columnId
|
|
402
|
+
? record(ticketId, 'reordered')
|
|
403
|
+
: record(ticketId, 'moved', { columnId: { before: ticket.columnId, after: columnId } });
|
|
404
|
+
destination.splice(index < 0 ? destination.length : index, 0, {
|
|
405
|
+
...ticket,
|
|
406
|
+
columnId,
|
|
407
|
+
updatedAt,
|
|
408
|
+
updatedBy: actor,
|
|
409
|
+
});
|
|
209
410
|
const changed = destination.map((item, order) => ({ ...item, order }));
|
|
210
|
-
tickets = tickets.map(item => changed.find(
|
|
411
|
+
tickets = tickets.map(item => changed.find(moved => moved.id === item.id) ?? item);
|
|
211
412
|
return changed;
|
|
212
413
|
},
|
|
213
414
|
createTicket: async input => {
|
|
415
|
+
const id = crypto.randomUUID();
|
|
416
|
+
const createdAt = record(id, 'created');
|
|
214
417
|
const ticket: IKanbanTicket = {
|
|
215
418
|
...input,
|
|
216
|
-
id
|
|
419
|
+
id,
|
|
217
420
|
key: `CAT-${nextKey++}`,
|
|
218
421
|
order: tickets.length,
|
|
422
|
+
createdAt,
|
|
423
|
+
createdBy: actor,
|
|
424
|
+
updatedAt: createdAt,
|
|
425
|
+
updatedBy: actor,
|
|
219
426
|
};
|
|
220
427
|
tickets = [...tickets, ticket];
|
|
221
428
|
return ticket;
|
|
222
429
|
},
|
|
223
430
|
};
|
|
224
|
-
return {
|
|
431
|
+
return {
|
|
432
|
+
tickets,
|
|
433
|
+
provider,
|
|
434
|
+
revision,
|
|
435
|
+
actAs: person => {
|
|
436
|
+
actor = person;
|
|
437
|
+
},
|
|
438
|
+
};
|
|
225
439
|
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
IKanbanProject,
|
|
3
|
+
IKanbanTicket,
|
|
4
|
+
IKanbanTicketDraft,
|
|
5
|
+
TKanbanLink,
|
|
6
|
+
TKanbanPriority,
|
|
7
|
+
} from './interfaces.js';
|
|
8
|
+
import type { TDcLocalizer } from '../../i18n/messages.js';
|
|
2
9
|
|
|
3
10
|
export const kanbanInitials = (name: string): string =>
|
|
4
11
|
name.trim().split(/\s+/).map(part => part[0]).join('').slice(0, 2);
|
|
@@ -23,8 +30,79 @@ export const ticketDraft = (ticket: IKanbanTicket): IKanbanTicketDraft => ({
|
|
|
23
30
|
priority: ticket.priority ?? 'none',
|
|
24
31
|
assigneeId: ticket.assignee?.id ?? '',
|
|
25
32
|
parentId: ticket.parentId ?? '',
|
|
33
|
+
labels: [...ticket.labels ?? []],
|
|
34
|
+
project: ticket.project ?? '',
|
|
26
35
|
});
|
|
27
36
|
|
|
37
|
+
/** A project's name: its `IKanbanProject` name, else its id. */
|
|
38
|
+
export const kanbanProjectName = (projects: readonly IKanbanProject[], id: string): string =>
|
|
39
|
+
projects.find(project => project.id === id)?.name ?? id;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The board's projects: the ones its host names, then every other project a ticket names, by its
|
|
43
|
+
* id.
|
|
44
|
+
*/
|
|
45
|
+
export const kanbanProjects = (
|
|
46
|
+
projects: readonly IKanbanProject[],
|
|
47
|
+
tickets: readonly IKanbanTicket[],
|
|
48
|
+
): IKanbanProject[] => {
|
|
49
|
+
const known = new Set(projects.map(project => project.id));
|
|
50
|
+
const named = [...new Set(tickets.map(ticket => ticket.project).filter(Boolean) as string[])]
|
|
51
|
+
.filter(id => !known.has(id))
|
|
52
|
+
.sort((a, b) => a.localeCompare(b))
|
|
53
|
+
.map(id => ({ id, name: id }));
|
|
54
|
+
return [...projects, ...named];
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/** Whether two label lists hold the same labels, in any order. */
|
|
58
|
+
export const sameKanbanLabels = (a: readonly string[], b: readonly string[]): boolean =>
|
|
59
|
+
a.length === b.length && [...a].sort().join('\n') === [...b].sort().join('\n');
|
|
60
|
+
|
|
61
|
+
/** A link's or an attachment's address, while it opens a page: http(s), mail or relative. */
|
|
62
|
+
export const kanbanHref = (url: string | undefined): string | undefined => {
|
|
63
|
+
if (!url || /[\u0000- \u007f\\]/.test(url)) return undefined;
|
|
64
|
+
const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(url)?.[1].toLowerCase();
|
|
65
|
+
return !scheme || scheme === 'http' || scheme === 'https' || scheme === 'mailto'
|
|
66
|
+
? url
|
|
67
|
+
: undefined;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** A commit's short form, as Git abbreviates it. */
|
|
71
|
+
export const kanbanShortSha = (sha: string): string => sha.slice(0, 7);
|
|
72
|
+
|
|
73
|
+
/** A moment in full words, for the tooltip of a time the board shows shorter. */
|
|
74
|
+
export const kanbanMoment = (format: TDcLocalizer['format'], date: Date): string =>
|
|
75
|
+
format.instant(date, { date: 'long', time: 'short' });
|
|
76
|
+
|
|
77
|
+
/** A page's host, without `www.`, for a link the host named; the address itself when it is none. */
|
|
78
|
+
export const kanbanLinkHost = (url: string): string => {
|
|
79
|
+
try {
|
|
80
|
+
return new URL(url).host.replace(/^www\./, '') || url;
|
|
81
|
+
} catch {
|
|
82
|
+
return url;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** A link's icon, by its kind. */
|
|
87
|
+
export const kanbanLinkIcon = (link: TKanbanLink): string =>
|
|
88
|
+
link.kind === 'branch'
|
|
89
|
+
? 'lucide:GitBranch'
|
|
90
|
+
: link.kind === 'commit'
|
|
91
|
+
? 'lucide:GitCommitHorizontal'
|
|
92
|
+
: link.kind === 'release'
|
|
93
|
+
? 'lucide:Package'
|
|
94
|
+
: 'lucide:Link';
|
|
95
|
+
|
|
96
|
+
/** A link's words: the branch, the commit, the release or the page it names. */
|
|
97
|
+
export const kanbanLinkText = (link: TKanbanLink): string =>
|
|
98
|
+
link.kind === 'branch'
|
|
99
|
+
? `${link.repo} ${link.branch}`
|
|
100
|
+
: link.kind === 'commit'
|
|
101
|
+
? `${link.repo} ${kanbanShortSha(link.sha)}`
|
|
102
|
+
: link.kind === 'release'
|
|
103
|
+
? `${link.package}@${link.version}`
|
|
104
|
+
: link.label || link.url;
|
|
105
|
+
|
|
28
106
|
export const kanbanEvent = <T>(owner: HTMLElement, name: string, detail: T): void => {
|
|
29
107
|
owner.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true }));
|
|
30
108
|
};
|
|
@@ -152,3 +152,57 @@ export const kanbanStyles = [
|
|
|
152
152
|
}
|
|
153
153
|
`,
|
|
154
154
|
];
|
|
155
|
+
|
|
156
|
+
/** A ticket's feed, its discussion and its history alike: a header, then one entry per person's act. */
|
|
157
|
+
export const kanbanFeedStyles = css`
|
|
158
|
+
header {
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: 8px;
|
|
162
|
+
margin-bottom: 8px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
h3 {
|
|
166
|
+
font-size: var(--dees-font-footnote-size);
|
|
167
|
+
font-weight: 600;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.refresh::part(button) {
|
|
171
|
+
width: 28px;
|
|
172
|
+
height: 28px;
|
|
173
|
+
min-height: 28px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
ol {
|
|
177
|
+
list-style: none;
|
|
178
|
+
padding: 0;
|
|
179
|
+
margin: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
li {
|
|
183
|
+
display: grid;
|
|
184
|
+
grid-template-columns: 28px minmax(0, 1fr);
|
|
185
|
+
gap: 10px;
|
|
186
|
+
padding: 10px 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
li > .avatar {
|
|
190
|
+
width: 28px;
|
|
191
|
+
height: 28px;
|
|
192
|
+
margin-top: 1px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.author {
|
|
196
|
+
font-weight: 600;
|
|
197
|
+
font-size: var(--dees-font-footnote-size);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.meta {
|
|
201
|
+
gap: 4px 10px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
time {
|
|
205
|
+
font-size: var(--dees-font-caption1-size);
|
|
206
|
+
color: var(--dees-color-text-secondary);
|
|
207
|
+
}
|
|
208
|
+
`;
|