@alexsun-top/opencode-chat-room 0.7.6 → 0.7.7
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/CHANGELOG.md +13 -0
- package/README.md +5 -5
- package/README.zh-CN.md +5 -5
- package/dist/cli.js +735 -164
- package/package.json +2 -1
- package/plugin.ts +15 -3
- package/server/assets/base.css +0 -2
- package/server/assets/chat/doc-preview.js +11 -2
- package/server/assets/chat/editor.js +10 -7
- package/server/assets/chat/events.js +1 -1
- package/server/assets/chat/index.js +2 -0
- package/server/assets/chat/locales/de.js +18 -0
- package/server/assets/chat/locales/es.js +18 -0
- package/server/assets/chat/locales/fr.js +18 -0
- package/server/assets/chat/locales/it.js +18 -0
- package/server/assets/chat/locales/ja.js +18 -0
- package/server/assets/chat/locales/ko.js +18 -0
- package/server/assets/chat/markdown.js +27 -1
- package/server/assets/chat/messages.js +1 -0
- package/server/assets/chat/palette.js +9 -4
- package/server/assets/chat/questions.js +1 -0
- package/server/assets/chat/rooms.js +6 -1
- package/server/assets/chat/shortcuts.js +14 -3
- package/server/assets/chat/state.js +36 -0
- package/server/assets/chat/system-messages.js +3 -1
- package/server/assets/chat/task-form.js +197 -0
- package/server/assets/chat/task-row.js +169 -0
- package/server/assets/chat/tasks.js +494 -0
- package/server/assets/responsive.css +26 -1
- package/server/assets/tasks.css +422 -0
- package/server/chat.html +97 -19
- package/server/member-routes.ts +3 -0
- package/server/sw.js +12 -2
- package/server/task-routes.ts +53 -0
- package/skills/chatroom/SKILL.md +3 -1
- package/src/README.md +3 -3
- package/src/agent/task-tool.ts +155 -0
- package/src/center/center-client.ts +44 -0
- package/src/rooms/tasks.ts +246 -0
- package/src/runtime/v2-plugin.ts +11 -2
- package/src/state/sqlite-state.ts +67 -0
- package/src/tui/app.mjs +5 -3
- package/src/tui/main.mjs +4 -4
- package/src/tui/markdown.mjs +29 -5
- package/src/tui/mentions.mjs +218 -0
- package/src/tui/message-app.mjs +3 -2
- package/src/tui/palette-app.mjs +9 -2
- package/src/tui/ui-content.mjs +9 -2
- package/src/tui/ui-mentions.mjs +44 -0
- package/src/tui/ui-suggest-view.mjs +63 -0
- package/src/tui/ui-suggest.mjs +197 -0
- package/src/tui/ui-theme.mjs +2 -1
- package/src/tui/ui-view.mjs +2 -0
- package/src/tui/ui.mjs +17 -9
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/* Room tasks: a compact task board that stays inside the dialog. */
|
|
2
|
+
#btnTasks { display: flex; align-items: center; gap: 8px; }
|
|
3
|
+
#btnTasks svg {
|
|
4
|
+
width: 15px;
|
|
5
|
+
height: 15px;
|
|
6
|
+
flex: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
#tasksDialog {
|
|
10
|
+
width: min(860px, calc(100vw - 24px));
|
|
11
|
+
max-width: none;
|
|
12
|
+
height: fit-content;
|
|
13
|
+
max-height: min(760px, 86dvh);
|
|
14
|
+
margin: auto;
|
|
15
|
+
padding: 0;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
border-radius: 22px;
|
|
18
|
+
}
|
|
19
|
+
#tasksDialog[open] { display: flex; flex-direction: column; animation: tasks-in .18s ease-out both; }
|
|
20
|
+
@keyframes tasks-in { from { opacity: 0; transform: translateY(8px); } }
|
|
21
|
+
#tasksDialog::backdrop { background: rgb(9 22 18 / .52); backdrop-filter: blur(4px); }
|
|
22
|
+
/* Wide windows keep the board beside the conversation instead of over it.
|
|
23
|
+
Keep this query in sync with PANE_QUERY in tasks.js. */
|
|
24
|
+
#tasksDialog.is-pane {
|
|
25
|
+
position: relative;
|
|
26
|
+
inset: auto;
|
|
27
|
+
grid-column: 3;
|
|
28
|
+
grid-row: 1 / -1;
|
|
29
|
+
width: auto;
|
|
30
|
+
height: auto;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
min-height: 0;
|
|
33
|
+
max-height: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
border: 0;
|
|
36
|
+
border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
|
|
37
|
+
border-radius: 0;
|
|
38
|
+
background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 84%, var(--accent-soft)), var(--surface) 32%);
|
|
39
|
+
box-shadow: none;
|
|
40
|
+
animation: none;
|
|
41
|
+
}
|
|
42
|
+
/* Markdown preview takes the third column while it is open; the task pane stays
|
|
43
|
+
open underneath and comes back when the document closes. */
|
|
44
|
+
#chatView.has-doc #tasksDialog.is-pane { display: none; }
|
|
45
|
+
#tasksDialog.is-pane .tasks-scroll { flex: 1 1 auto; }
|
|
46
|
+
#tasksDialog.is-pane .tasks-head { padding: 16px 12px 10px 18px; }
|
|
47
|
+
#tasksDialog.is-pane .tasks-toolbar { padding: 0 14px 8px 18px; }
|
|
48
|
+
#tasksDialog.is-pane .tasks-scroll { padding: 0 14px 18px 18px; scrollbar-gutter: stable; }
|
|
49
|
+
/* A narrow pane stacks the row actions so the title and steps get the full width. */
|
|
50
|
+
#tasksDialog.is-pane .task-row { grid-template-columns: minmax(0, 1fr); }
|
|
51
|
+
#tasksDialog.is-pane .task-row-actions { grid-column: 1; justify-content: flex-end; }
|
|
52
|
+
/* The pane is narrow: give every form field its own row, including the date input. */
|
|
53
|
+
#tasksDialog.is-pane .task-create-form,
|
|
54
|
+
#tasksDialog.is-pane .task-edit-form { grid-template-columns: minmax(0, 1fr); }
|
|
55
|
+
#tasksDialog.is-pane .task-create-due, #tasksDialog.is-pane .task-create-assignee,
|
|
56
|
+
#tasksDialog.is-pane .task-edit-due-field, #tasksDialog.is-pane .task-edit-assignee-field { grid-column: 1; }
|
|
57
|
+
@media (min-width: 1100px) and (min-height: 560px) {
|
|
58
|
+
#chatView.has-tasks { grid-template-columns: 252px minmax(0, 1fr) clamp(380px, 30vw, 460px); }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.tasks-head {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex: none;
|
|
64
|
+
align-items: flex-start;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
gap: 12px;
|
|
67
|
+
padding: 18px 20px 12px;
|
|
68
|
+
}
|
|
69
|
+
.tasks-heading { min-width: 0; }
|
|
70
|
+
.tasks-eyebrow {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: baseline;
|
|
73
|
+
min-width: 0;
|
|
74
|
+
margin: 0 0 2px;
|
|
75
|
+
color: var(--accent);
|
|
76
|
+
font: 700 10px/1.3 var(--font-mono);
|
|
77
|
+
letter-spacing: .1em;
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
}
|
|
80
|
+
.tasks-heading h2 {
|
|
81
|
+
margin: 0;
|
|
82
|
+
font-family: var(--font-display);
|
|
83
|
+
font-size: 23px;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
letter-spacing: -.02em;
|
|
86
|
+
overflow-wrap: anywhere;
|
|
87
|
+
}
|
|
88
|
+
.tasks-room-name {
|
|
89
|
+
min-width: 0;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
color: var(--ink-3);
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
}
|
|
96
|
+
.tasks-eyebrow > span:first-child { flex: none; white-space: nowrap; }
|
|
97
|
+
.tasks-head-actions { display: flex; flex: none; align-items: center; gap: 4px; }
|
|
98
|
+
.tasks-menu-anchor { position: relative; display: flex; }
|
|
99
|
+
.tasks-menu {
|
|
100
|
+
position: absolute;
|
|
101
|
+
top: calc(100% + 4px);
|
|
102
|
+
right: 0;
|
|
103
|
+
z-index: 6;
|
|
104
|
+
min-width: 186px;
|
|
105
|
+
padding: 4px;
|
|
106
|
+
border: 1px solid var(--line);
|
|
107
|
+
border-radius: 10px;
|
|
108
|
+
background: var(--surface);
|
|
109
|
+
box-shadow: 0 12px 32px rgb(10 25 20 / .16);
|
|
110
|
+
}
|
|
111
|
+
.tasks-menu[hidden] { display: none; }
|
|
112
|
+
.tasks-menu .menu-action { padding: 8px 9px; font-size: 12.5px; }
|
|
113
|
+
.tasks-menu .menu-action:disabled { color: var(--ink-3); background: transparent; cursor: default; opacity: .55; }
|
|
114
|
+
|
|
115
|
+
.tasks-toolbar {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex: none;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: space-between;
|
|
121
|
+
gap: 8px 12px;
|
|
122
|
+
padding: 0 20px 10px;
|
|
123
|
+
}
|
|
124
|
+
.tasks-filter { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
125
|
+
.tasks-filter-label { color: var(--ink-3); font-size: 11px; font-weight: 600; white-space: nowrap; }
|
|
126
|
+
.tasks-select {
|
|
127
|
+
min-width: 150px;
|
|
128
|
+
max-width: 250px;
|
|
129
|
+
min-height: 34px;
|
|
130
|
+
padding: 4px 28px 4px 9px;
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
}
|
|
133
|
+
.tasks-summary { margin: 0 0 0 auto; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; }
|
|
134
|
+
|
|
135
|
+
.tasks-error {
|
|
136
|
+
display: flex;
|
|
137
|
+
flex: none;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: space-between;
|
|
140
|
+
gap: 10px;
|
|
141
|
+
margin: 0 20px 8px;
|
|
142
|
+
padding: 8px 10px;
|
|
143
|
+
}
|
|
144
|
+
.tasks-error .btn { flex: none; }
|
|
145
|
+
|
|
146
|
+
.tasks-scroll {
|
|
147
|
+
flex: 0 1 auto;
|
|
148
|
+
min-height: 0;
|
|
149
|
+
padding: 0 20px 16px;
|
|
150
|
+
overflow-x: hidden;
|
|
151
|
+
overflow-y: auto;
|
|
152
|
+
overscroll-behavior: contain;
|
|
153
|
+
scrollbar-gutter: stable;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.task-create {
|
|
157
|
+
margin: 0 0 12px;
|
|
158
|
+
border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
|
|
159
|
+
border-radius: 12px;
|
|
160
|
+
background: color-mix(in srgb, var(--accent-soft) 24%, var(--surface));
|
|
161
|
+
}
|
|
162
|
+
.task-create[open] { border-style: solid; }
|
|
163
|
+
.task-create-summary {
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
gap: 7px;
|
|
167
|
+
padding: 9px 12px;
|
|
168
|
+
color: var(--accent);
|
|
169
|
+
font-size: 12.5px;
|
|
170
|
+
font-weight: 650;
|
|
171
|
+
cursor: pointer;
|
|
172
|
+
list-style: none;
|
|
173
|
+
}
|
|
174
|
+
.task-create-summary::-webkit-details-marker { display: none; }
|
|
175
|
+
.task-create-summary::before {
|
|
176
|
+
content: "+";
|
|
177
|
+
display: grid;
|
|
178
|
+
flex: none;
|
|
179
|
+
place-items: center;
|
|
180
|
+
width: 18px;
|
|
181
|
+
height: 18px;
|
|
182
|
+
border: 1px solid currentColor;
|
|
183
|
+
border-radius: 6px;
|
|
184
|
+
font: 700 13px/1 var(--font-mono);
|
|
185
|
+
}
|
|
186
|
+
.task-create[open] .task-create-summary::before { content: "−"; }
|
|
187
|
+
.task-create-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
|
|
188
|
+
|
|
189
|
+
.task-create-form {
|
|
190
|
+
display: grid;
|
|
191
|
+
grid-template-columns: minmax(0, 1fr) minmax(150px, 210px);
|
|
192
|
+
gap: 8px 10px;
|
|
193
|
+
padding: 0 12px 12px;
|
|
194
|
+
}
|
|
195
|
+
.task-create-title, .task-create-description,
|
|
196
|
+
.task-create-participants, .task-create-steps, .task-create-conclusion { grid-column: 1 / -1; }
|
|
197
|
+
.task-create-due { grid-column: 1; }
|
|
198
|
+
.task-create-assignee { grid-column: 2; }
|
|
199
|
+
.task-create-actions { grid-column: 1 / -1; display: flex; align-items: end; justify-content: flex-end; }
|
|
200
|
+
.task-field { margin: 0; gap: 4px; min-width: 0; }
|
|
201
|
+
.task-field .field-label { font-size: 11px; }
|
|
202
|
+
.task-field .input { min-height: 36px; font-size: 12.5px; }
|
|
203
|
+
.task-create-form textarea { min-height: 52px; resize: vertical; }
|
|
204
|
+
|
|
205
|
+
.task-people-field, .task-steps-field { padding: 0; border: 0; }
|
|
206
|
+
.task-people {
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-wrap: wrap;
|
|
209
|
+
gap: 4px 12px;
|
|
210
|
+
max-height: 112px;
|
|
211
|
+
padding: 6px 9px;
|
|
212
|
+
overflow: auto;
|
|
213
|
+
border: 1px solid var(--line);
|
|
214
|
+
border-radius: 10px;
|
|
215
|
+
background: var(--surface);
|
|
216
|
+
}
|
|
217
|
+
.task-person { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--ink-2); font-size: 12px; cursor: pointer; }
|
|
218
|
+
.task-person input, .task-step-done { flex: none; width: 15px; height: 15px; accent-color: var(--accent); }
|
|
219
|
+
.task-person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
220
|
+
.task-steps-editor { display: grid; gap: 6px; margin-bottom: 6px; }
|
|
221
|
+
.task-step-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
|
|
222
|
+
.task-step-row .input { min-height: 34px; padding: 5px 9px; font-size: 12.5px; }
|
|
223
|
+
.task-step-remove { width: 28px; height: 28px; }
|
|
224
|
+
.task-add-step { padding: 4px 9px; }
|
|
225
|
+
.task-steps-hint { margin: 4px 0 0; font-size: 10.5px; line-height: 1.4; }
|
|
226
|
+
|
|
227
|
+
.task-groups { display: grid; gap: 16px; }
|
|
228
|
+
.task-group-title {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
gap: 7px;
|
|
232
|
+
margin: 0 0 6px;
|
|
233
|
+
color: var(--ink-2);
|
|
234
|
+
font-size: 11px;
|
|
235
|
+
font-weight: 700;
|
|
236
|
+
letter-spacing: .08em;
|
|
237
|
+
line-height: 1.4;
|
|
238
|
+
text-transform: uppercase;
|
|
239
|
+
}
|
|
240
|
+
.task-group-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
|
|
241
|
+
.task-group-dot[data-status="doing"] { background: var(--warning); }
|
|
242
|
+
.task-group-dot[data-status="done"] { background: var(--accent); }
|
|
243
|
+
.task-group-count {
|
|
244
|
+
margin-left: auto;
|
|
245
|
+
padding: 1px 7px;
|
|
246
|
+
border-radius: 999px;
|
|
247
|
+
color: var(--ink-3);
|
|
248
|
+
background: var(--surface-2);
|
|
249
|
+
font-size: 10px;
|
|
250
|
+
letter-spacing: 0;
|
|
251
|
+
}
|
|
252
|
+
.task-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
|
|
253
|
+
|
|
254
|
+
.task-row {
|
|
255
|
+
display: grid;
|
|
256
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
257
|
+
align-items: start;
|
|
258
|
+
gap: 8px 10px;
|
|
259
|
+
min-width: 0;
|
|
260
|
+
padding: 10px 12px;
|
|
261
|
+
border: 1px solid var(--line);
|
|
262
|
+
border-radius: 12px;
|
|
263
|
+
background: var(--surface);
|
|
264
|
+
box-shadow: 0 1px 2px rgb(20 40 32 / .035);
|
|
265
|
+
animation: task-row-in .16s ease both;
|
|
266
|
+
animation-delay: calc(var(--task-i, 0) * 14ms);
|
|
267
|
+
}
|
|
268
|
+
.task-row[data-status="done"] { background: color-mix(in srgb, var(--surface-2) 42%, var(--surface)); }
|
|
269
|
+
.task-row-editing { display: block; }
|
|
270
|
+
@keyframes task-row-in { from { opacity: 0; transform: translateY(3px); } }
|
|
271
|
+
|
|
272
|
+
.task-main { min-width: 0; }
|
|
273
|
+
.task-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
|
|
274
|
+
.task-title {
|
|
275
|
+
margin: 0;
|
|
276
|
+
overflow-wrap: anywhere;
|
|
277
|
+
color: var(--ink);
|
|
278
|
+
font-size: 13.5px;
|
|
279
|
+
font-weight: 650;
|
|
280
|
+
line-height: 1.4;
|
|
281
|
+
}
|
|
282
|
+
.task-row[data-status="done"] .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 55%, transparent); }
|
|
283
|
+
.task-status {
|
|
284
|
+
flex: none;
|
|
285
|
+
padding: 2px 7px;
|
|
286
|
+
border: 1px solid var(--line);
|
|
287
|
+
border-radius: 999px;
|
|
288
|
+
color: var(--ink-3);
|
|
289
|
+
background: var(--surface-2);
|
|
290
|
+
font-size: 10px;
|
|
291
|
+
font-weight: 700;
|
|
292
|
+
letter-spacing: .03em;
|
|
293
|
+
line-height: 1.5;
|
|
294
|
+
}
|
|
295
|
+
.task-status[data-status="doing"] { border-color: color-mix(in srgb, var(--warning) 34%, var(--line)); color: var(--warning); background: color-mix(in srgb, var(--warning) 11%, var(--surface)); }
|
|
296
|
+
.task-status[data-status="done"] { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
|
|
297
|
+
|
|
298
|
+
.task-description {
|
|
299
|
+
margin: 3px 0 0;
|
|
300
|
+
color: var(--ink-2);
|
|
301
|
+
font-size: 12px;
|
|
302
|
+
line-height: 1.5;
|
|
303
|
+
overflow-wrap: anywhere;
|
|
304
|
+
white-space: pre-wrap;
|
|
305
|
+
}
|
|
306
|
+
.task-meta {
|
|
307
|
+
display: grid;
|
|
308
|
+
grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
|
|
309
|
+
gap: 2px 10px;
|
|
310
|
+
min-width: 0;
|
|
311
|
+
margin: 6px 0 0;
|
|
312
|
+
color: var(--ink-3);
|
|
313
|
+
font-size: 10.5px;
|
|
314
|
+
line-height: 1.5;
|
|
315
|
+
}
|
|
316
|
+
.task-assignee {
|
|
317
|
+
display: inline-flex;
|
|
318
|
+
align-items: flex-start;
|
|
319
|
+
gap: 3px;
|
|
320
|
+
min-width: 0;
|
|
321
|
+
color: var(--ink-2);
|
|
322
|
+
font-weight: 600;
|
|
323
|
+
overflow-wrap: anywhere;
|
|
324
|
+
}
|
|
325
|
+
.task-assignee svg { flex: none; width: 12px; height: 12px; margin-top: 2px; }
|
|
326
|
+
.task-assignee.is-unassigned { color: var(--ink-3); font-style: italic; font-weight: 500; }
|
|
327
|
+
.task-assignee > span { min-width: 0; overflow-wrap: anywhere; }
|
|
328
|
+
.task-created,
|
|
329
|
+
.task-creator,
|
|
330
|
+
.task-updated { overflow-wrap: anywhere; }
|
|
331
|
+
.task-updated { font-family: var(--font-mono); font-size: 10px; }
|
|
332
|
+
.task-due { color: var(--ink-2); font-weight: 600; }
|
|
333
|
+
.task-due.is-overdue { color: var(--danger); }
|
|
334
|
+
.task-participants { min-width: 0; overflow-wrap: anywhere; }
|
|
335
|
+
|
|
336
|
+
.task-progress { margin: 6px 0 0; }
|
|
337
|
+
.task-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 10.5px; line-height: 1.4; }
|
|
338
|
+
.task-progress-track { height: 4px; margin-top: 3px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
|
|
339
|
+
.task-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
|
|
340
|
+
.task-steps { display: grid; gap: 2px; margin: 6px 0 0; padding: 0; list-style: none; }
|
|
341
|
+
.task-step { display: flex; align-items: flex-start; gap: 6px; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
|
|
342
|
+
.task-step-toggle { flex: none; width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--accent); }
|
|
343
|
+
.task-step-toggle:disabled { cursor: default; opacity: .7; }
|
|
344
|
+
.task-step.is-done .task-step-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 55%, transparent); }
|
|
345
|
+
.task-step-text { min-width: 0; overflow-wrap: anywhere; }
|
|
346
|
+
|
|
347
|
+
.task-conclusion { margin: 7px 0 0; padding: 5px 9px; border-left: 2px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 0 8px 8px 0; color: var(--ink-2); background: color-mix(in srgb, var(--surface-2) 52%, transparent); font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
348
|
+
.task-conclusion-label { display: block; margin-bottom: 2px; color: var(--ink-3); font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
|
|
349
|
+
|
|
350
|
+
.task-row-actions { display: flex; align-items: center; gap: 4px; }
|
|
351
|
+
.task-status-select {
|
|
352
|
+
width: 104px;
|
|
353
|
+
min-height: 30px;
|
|
354
|
+
padding: 2px 24px 2px 8px;
|
|
355
|
+
font-size: 11.5px;
|
|
356
|
+
}
|
|
357
|
+
.task-action {
|
|
358
|
+
display: grid;
|
|
359
|
+
flex: none;
|
|
360
|
+
place-items: center;
|
|
361
|
+
width: 30px;
|
|
362
|
+
height: 30px;
|
|
363
|
+
padding: 0;
|
|
364
|
+
border: 1px solid transparent;
|
|
365
|
+
border-radius: 8px;
|
|
366
|
+
color: var(--ink-3);
|
|
367
|
+
background: transparent;
|
|
368
|
+
cursor: pointer;
|
|
369
|
+
transition: color .12s, border-color .12s, background .12s;
|
|
370
|
+
}
|
|
371
|
+
.task-action svg { width: 15px; height: 15px; }
|
|
372
|
+
.task-action:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 24%, transparent); background: var(--accent-soft); }
|
|
373
|
+
.task-action-delete:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, transparent); background: var(--danger-soft); }
|
|
374
|
+
.task-action:focus-visible, .task-status-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
375
|
+
|
|
376
|
+
.task-edit-form {
|
|
377
|
+
display: grid;
|
|
378
|
+
grid-template-columns: minmax(0, 1fr) minmax(150px, 200px);
|
|
379
|
+
gap: 8px 10px;
|
|
380
|
+
}
|
|
381
|
+
.task-edit-title-field, .task-edit-description-field,
|
|
382
|
+
.task-edit-participants-field, .task-edit-steps-field, .task-edit-conclusion-field { grid-column: 1 / -1; }
|
|
383
|
+
.task-edit-due-field { grid-column: 1; }
|
|
384
|
+
.task-edit-assignee-field { grid-column: 2; }
|
|
385
|
+
.task-edit-form textarea { min-height: 52px; resize: vertical; }
|
|
386
|
+
.task-edit-actions { grid-column: 1 / -1; display: flex; align-items: end; justify-content: flex-end; gap: 6px; }
|
|
387
|
+
|
|
388
|
+
.tasks-empty { margin: 0; padding: 28px 12px 32px; color: var(--ink-3); font-size: 12.5px; text-align: center; }
|
|
389
|
+
|
|
390
|
+
@media (max-width: 620px) {
|
|
391
|
+
#tasksDialog { width: calc(100vw - 12px); height: calc(100dvh - 16px); max-height: none; border-radius: 16px; }
|
|
392
|
+
.tasks-head { padding: 13px 13px 8px; }
|
|
393
|
+
.tasks-heading h2 { font-size: 19px; }
|
|
394
|
+
.tasks-toolbar { padding: 0 13px 8px; align-items: flex-start; }
|
|
395
|
+
.tasks-filter { flex-wrap: wrap; gap: 4px 8px; }
|
|
396
|
+
.tasks-select { min-width: 140px; max-width: calc(100vw - 60px); }
|
|
397
|
+
.tasks-summary { flex-basis: 100%; margin: 0; }
|
|
398
|
+
.tasks-error { margin: 0 13px 8px; }
|
|
399
|
+
.tasks-scroll { padding: 0 8px 12px; scrollbar-gutter: auto; }
|
|
400
|
+
.task-create { margin-bottom: 10px; }
|
|
401
|
+
.task-row { grid-template-columns: minmax(0, 1fr); padding: 9px; }
|
|
402
|
+
.task-row-actions { grid-column: 1; justify-content: flex-end; flex-wrap: wrap; }
|
|
403
|
+
.task-status-select { width: 112px; }
|
|
404
|
+
.task-create-form, .task-edit-form { grid-template-columns: minmax(0, 1fr); }
|
|
405
|
+
.task-create-title, .task-create-description, .task-create-due, .task-create-assignee,
|
|
406
|
+
.task-create-participants, .task-create-steps, .task-create-conclusion, .task-create-actions,
|
|
407
|
+
.task-edit-title-field, .task-edit-description-field, .task-edit-due-field, .task-edit-assignee-field,
|
|
408
|
+
.task-edit-participants-field, .task-edit-steps-field, .task-edit-conclusion-field, .task-edit-actions { grid-column: 1; }
|
|
409
|
+
.task-create-actions, .task-edit-actions { justify-content: stretch; }
|
|
410
|
+
.task-create-actions .btn, .task-edit-actions .btn { flex: 1; }
|
|
411
|
+
.task-people { max-height: 96px; }
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
@media (max-width: 380px) {
|
|
415
|
+
.tasks-head { padding: 12px 11px 7px; }
|
|
416
|
+
.task-row-actions { justify-content: flex-start; }
|
|
417
|
+
.task-status-select { flex: 1 1 120px; width: auto; }
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
@media (prefers-reduced-motion: reduce) {
|
|
421
|
+
#tasksDialog[open], .task-row { animation: none; }
|
|
422
|
+
}
|
package/server/chat.html
CHANGED
|
@@ -18,20 +18,21 @@
|
|
|
18
18
|
</script>
|
|
19
19
|
<meta name="mobile-web-app-capable" content="yes">
|
|
20
20
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
21
|
-
<link rel="stylesheet" href="/assets/icons.css">
|
|
22
|
-
<link rel="stylesheet" href="/assets/base.css">
|
|
23
|
-
<link rel="stylesheet" href="/assets/settings.css">
|
|
21
|
+
<link rel="stylesheet" href="/assets/icons.css?v={{version}}">
|
|
22
|
+
<link rel="stylesheet" href="/assets/base.css?v={{version}}">
|
|
23
|
+
<link rel="stylesheet" href="/assets/settings.css?v={{version}}">
|
|
24
24
|
|
|
25
|
-
<link rel="stylesheet" href="/assets/conversation.css">
|
|
26
|
-
<link rel="stylesheet" href="/assets/recall.css">
|
|
27
|
-
<link rel="stylesheet" href="/assets/attachments.css">
|
|
28
|
-
<link rel="stylesheet" href="/assets/responsive.css">
|
|
29
|
-
<link rel="stylesheet" href="/assets/code-highlight.css">
|
|
30
|
-
<link rel="stylesheet" href="/assets/room-create.css">
|
|
31
|
-
<link rel="stylesheet" href="/assets/edit-room.css">
|
|
32
|
-
<link rel="stylesheet" href="/assets/palette.css">
|
|
33
|
-
<link rel="stylesheet" href="/assets/files.css">
|
|
34
|
-
<link rel="stylesheet" href="/assets/
|
|
25
|
+
<link rel="stylesheet" href="/assets/conversation.css?v={{version}}">
|
|
26
|
+
<link rel="stylesheet" href="/assets/recall.css?v={{version}}">
|
|
27
|
+
<link rel="stylesheet" href="/assets/attachments.css?v={{version}}">
|
|
28
|
+
<link rel="stylesheet" href="/assets/responsive.css?v={{version}}">
|
|
29
|
+
<link rel="stylesheet" href="/assets/code-highlight.css?v={{version}}">
|
|
30
|
+
<link rel="stylesheet" href="/assets/room-create.css?v={{version}}">
|
|
31
|
+
<link rel="stylesheet" href="/assets/edit-room.css?v={{version}}">
|
|
32
|
+
<link rel="stylesheet" href="/assets/palette.css?v={{version}}">
|
|
33
|
+
<link rel="stylesheet" href="/assets/files.css?v={{version}}">
|
|
34
|
+
<link rel="stylesheet" href="/assets/tasks.css?v={{version}}">
|
|
35
|
+
<link rel="stylesheet" href="/assets/doc-preview.css?v={{version}}">
|
|
35
36
|
</head>
|
|
36
37
|
<body>
|
|
37
38
|
|
|
@@ -381,6 +382,82 @@
|
|
|
381
382
|
<p class="hint files-hint" data-i18n="filesHint">Preview images, audio, and video. Download any file.</p>
|
|
382
383
|
</footer>
|
|
383
384
|
</dialog>
|
|
385
|
+
<dialog id="tasksDialog" class="admin-dialog tasks-dialog" aria-labelledby="tasksHeading">
|
|
386
|
+
<header class="tasks-head">
|
|
387
|
+
<div class="tasks-heading">
|
|
388
|
+
<p class="tasks-eyebrow"><span data-i18n="tasksEyebrow">Room tasks</span><span id="tasksRoomName" class="tasks-room-name"></span></p>
|
|
389
|
+
<h2 id="tasksHeading" tabindex="-1" data-i18n="tasksTitle">Tasks</h2>
|
|
390
|
+
</div>
|
|
391
|
+
<div class="tasks-head-actions">
|
|
392
|
+
<div class="tasks-menu-anchor">
|
|
393
|
+
<button id="btnTasksMenu" class="icon-btn" type="button" aria-label="Task actions" data-i18n-aria-label="tasksMenuLabel" aria-haspopup="menu" aria-expanded="false" aria-controls="tasksMenu"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-more_horizontal-24"></use></svg></button>
|
|
394
|
+
<div id="tasksMenu" class="tasks-menu" role="menu" hidden>
|
|
395
|
+
<button id="btnClearCompleted" class="menu-action" type="button" role="menuitem"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-delete-24"></use></svg><span data-i18n="tasksClearCompleted">Clear completed</span></button>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
<button id="btnRefreshTasks" class="icon-btn" type="button" aria-label="Refresh tasks" data-i18n-aria-label="tasksRefresh"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_sync-24"></use></svg></button>
|
|
399
|
+
<button id="btnCloseTasks" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button>
|
|
400
|
+
</div>
|
|
401
|
+
</header>
|
|
402
|
+
<div class="tasks-toolbar">
|
|
403
|
+
<label class="tasks-filter">
|
|
404
|
+
<span class="tasks-filter-label" data-i18n="tasksFilterLabel">Show</span>
|
|
405
|
+
<select id="taskFilter" class="input tasks-select">
|
|
406
|
+
<option value="all" data-i18n="tasksFilterAll">All statuses</option>
|
|
407
|
+
<option value="todo" data-i18n="tasksStatusTodo">To do</option>
|
|
408
|
+
<option value="doing" data-i18n="tasksStatusDoing">Doing</option>
|
|
409
|
+
<option value="done" data-i18n="tasksStatusDone">Done</option>
|
|
410
|
+
</select>
|
|
411
|
+
</label>
|
|
412
|
+
<p id="tasksSummary" class="tasks-summary" role="status" aria-live="polite"></p>
|
|
413
|
+
</div>
|
|
414
|
+
<div id="tasksError" class="alert tasks-error" role="alert" hidden>
|
|
415
|
+
<span id="tasksErrorText"></span>
|
|
416
|
+
<button id="btnRetryTasks" class="btn ghost small" type="button" data-i18n="retry">Retry</button>
|
|
417
|
+
</div>
|
|
418
|
+
<div class="tasks-scroll">
|
|
419
|
+
<details id="taskCreateDetails" class="task-create">
|
|
420
|
+
<summary class="task-create-summary"><span data-i18n="tasksCreate">Add task</span></summary>
|
|
421
|
+
<form id="taskCreateForm" class="task-create-form" novalidate>
|
|
422
|
+
<label class="field task-field task-create-title">
|
|
423
|
+
<span class="field-label" data-i18n="tasksTitleLabel">Title</span>
|
|
424
|
+
<input id="taskTitle" class="input" maxlength="200" autocomplete="off" placeholder="What needs doing?" data-i18n-placeholder="tasksTitlePlaceholder">
|
|
425
|
+
</label>
|
|
426
|
+
<label class="field task-field task-create-description">
|
|
427
|
+
<span class="field-label" data-i18n="tasksDescriptionLabel">Description</span>
|
|
428
|
+
<textarea id="taskDescription" class="input" rows="2" maxlength="5000" placeholder="Add details, links, or acceptance notes" data-i18n-placeholder="tasksDescriptionPlaceholder"></textarea>
|
|
429
|
+
</label>
|
|
430
|
+
<label class="field task-field task-create-due">
|
|
431
|
+
<span class="field-label" data-i18n="tasksDueDateLabel">Due date</span>
|
|
432
|
+
<input id="taskDueDate" class="input" type="date">
|
|
433
|
+
</label>
|
|
434
|
+
<label class="field task-field task-create-assignee">
|
|
435
|
+
<span class="field-label" data-i18n="tasksAssigneeLabel">Assignee</span>
|
|
436
|
+
<select id="taskAssignee" class="input tasks-select"></select>
|
|
437
|
+
</label>
|
|
438
|
+
<fieldset class="field task-field task-people-field task-create-participants">
|
|
439
|
+
<legend class="field-label" data-i18n="tasksParticipantsLabel">Participants</legend>
|
|
440
|
+
<div id="taskCreateParticipants" class="task-people"></div>
|
|
441
|
+
</fieldset>
|
|
442
|
+
<fieldset class="field task-field task-steps-field task-create-steps">
|
|
443
|
+
<legend class="field-label" data-i18n="tasksStepsLabel">Steps</legend>
|
|
444
|
+
<div id="taskCreateSteps" class="task-steps-editor"></div>
|
|
445
|
+
<button id="btnAddCreateStep" class="btn ghost small task-add-step" type="button" data-i18n="tasksAddStep">Add step</button>
|
|
446
|
+
<p class="hint task-steps-hint" data-i18n="tasksStepsHint">Up to 30 steps. Check the ones that are done.</p>
|
|
447
|
+
</fieldset>
|
|
448
|
+
<label class="field task-field task-create-conclusion">
|
|
449
|
+
<span class="field-label" data-i18n="tasksConclusionLabel">Conclusion</span>
|
|
450
|
+
<textarea id="taskConclusion" class="input" rows="2" maxlength="5000" placeholder="What was the outcome?" data-i18n-placeholder="tasksConclusionPlaceholder"></textarea>
|
|
451
|
+
</label>
|
|
452
|
+
<div class="task-create-actions">
|
|
453
|
+
<button id="btnCreateTask" class="btn primary small" type="submit" data-i18n="tasksCreate">Add task</button>
|
|
454
|
+
</div>
|
|
455
|
+
</form>
|
|
456
|
+
</details>
|
|
457
|
+
<div id="taskGroups" class="task-groups"></div>
|
|
458
|
+
<p id="tasksEmpty" class="hint tasks-empty" hidden></p>
|
|
459
|
+
</div>
|
|
460
|
+
</dialog>
|
|
384
461
|
<dialog id="reminderDialog" class="admin-dialog reminder-dialog" aria-labelledby="reminderDialogHeading">
|
|
385
462
|
<header class="admin-dialog-head"><h2 id="reminderDialogHeading" data-i18n="reminderCreate">Create reminder</h2><div class="admin-dialog-actions"><button id="btnCloseReminder" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="fluent-icon close-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-dismiss-24"></use></svg></button></div></header>
|
|
386
463
|
<form id="reminderForm" class="admin-guide reminder-form">
|
|
@@ -460,6 +537,7 @@
|
|
|
460
537
|
<div class="panel room-options-panel" id="roomOptions" hidden>
|
|
461
538
|
<button class="menu-action" type="button" id="btnAnnouncements" aria-controls="announcementPanel"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-megaphone-24"></use></svg><span data-i18n="announcements">Announcements</span></button>
|
|
462
539
|
<button class="menu-action files-menu-action" type="button" id="btnFiles"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-folder-24"></use></svg><span data-i18n="filesTitle">Files</span></button>
|
|
540
|
+
<button class="menu-action" type="button" id="btnTasks"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-checkmark-24"></use></svg><span data-i18n="tasksTitle">Tasks</span></button>
|
|
463
541
|
<button class="menu-action" type="button" id="btnEditRoom"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-edit-24"></use></svg><span data-i18n="editRoom">Edit room</span></button>
|
|
464
542
|
<button class="menu-action" type="button" id="btnLeave"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-arrow_exit-24"></use></svg><span data-i18n="leave">Leave room</span></button>
|
|
465
543
|
<button class="menu-action danger-text" type="button" id="btnDeleteRoom"><svg class="fluent-icon" aria-hidden="true" viewBox="0 0 24 24"><use href="/assets/fluent-icons.svg#fluent-delete-24"></use></svg><span data-i18n="deleteRoom">Delete room</span></button>
|
|
@@ -577,7 +655,7 @@
|
|
|
577
655
|
<dialog id="paletteDialog" class="admin-dialog palette-dialog" aria-labelledby="paletteHeading" aria-describedby="paletteHint">
|
|
578
656
|
<header class="palette-head">
|
|
579
657
|
<div class="palette-heading">
|
|
580
|
-
<p id="paletteCombo" class="palette-eyebrow">Alt + Space</p>
|
|
658
|
+
<p id="paletteCombo" class="palette-eyebrow">Ctrl + P / Alt + Space</p>
|
|
581
659
|
<h2 id="paletteHeading" data-i18n="paletteTitle">Search and commands</h2>
|
|
582
660
|
</div>
|
|
583
661
|
<div class="palette-head-actions">
|
|
@@ -620,7 +698,7 @@
|
|
|
620
698
|
<section class="keys-section">
|
|
621
699
|
<h3 data-i18n="shortcutsSearch">Search and commands</h3>
|
|
622
700
|
<ul class="keys-list">
|
|
623
|
-
<li><span class="keys-combo"><kbd class="keys-key shortcut-mod">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">Space</kbd></span><span data-i18n="shortcutsOpenPalette">Open search and commands</span></li>
|
|
701
|
+
<li><span class="keys-combo"><kbd class="keys-key shortcut-mod">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">Space</kbd></span><span class="keys-sep">/</span><span class="keys-combo"><kbd class="keys-key">Ctrl</kbd><span class="keys-sep">+</span><kbd class="keys-key">P</kbd></span><span data-i18n="shortcutsOpenPalette">Open search and commands</span></li>
|
|
624
702
|
</ul>
|
|
625
703
|
</section>
|
|
626
704
|
<section class="keys-section">
|
|
@@ -661,10 +739,10 @@
|
|
|
661
739
|
</div>
|
|
662
740
|
</aside>
|
|
663
741
|
|
|
664
|
-
<script src="/assets/marked-18.0.4.js"></script>
|
|
665
|
-
<script src="/assets/dompurify-3.4.7.js"></script>
|
|
666
|
-
<script src="/assets/highlight-10.7.3.min.js"></script>
|
|
667
|
-
<script src="/assets/mermaid-11.12.2.min.js" defer></script>
|
|
742
|
+
<script src="/assets/marked-18.0.4.js?v={{version}}"></script>
|
|
743
|
+
<script src="/assets/dompurify-3.4.7.js?v={{version}}"></script>
|
|
744
|
+
<script src="/assets/highlight-10.7.3.min.js?v={{version}}"></script>
|
|
745
|
+
<script src="/assets/mermaid-11.12.2.min.js?v={{version}}" defer></script>
|
|
668
746
|
<script type="module" src="/assets/chat/index.js"></script>
|
|
669
747
|
</body>
|
|
670
748
|
</html>
|
package/server/member-routes.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { clearPendingAdmission } from "../src/center/queue.ts";
|
|
|
5
5
|
import { touchActive } from "./wake.ts";
|
|
6
6
|
import { announcementRoutes } from "./announcement-routes.ts";
|
|
7
7
|
import { jsonObject } from "./json-body.ts";
|
|
8
|
+
import { taskRoutes } from "./task-routes.ts";
|
|
8
9
|
|
|
9
10
|
const json = (body: unknown, status = 200) => Response.json(body, { status });
|
|
10
11
|
const states = new Set<WorkState>(["working", "idle", "waiting", "unknown"]);
|
|
@@ -15,6 +16,8 @@ function object(value: unknown): value is Record<string, unknown> {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export async function memberRoutes(req: Request, url: URL): Promise<Response | undefined> {
|
|
19
|
+
const tasks = await taskRoutes(req, url);
|
|
20
|
+
if (tasks) return tasks;
|
|
18
21
|
const announcements = await announcementRoutes(req, url);
|
|
19
22
|
if (announcements) return announcements;
|
|
20
23
|
if (req.method === "POST" && url.pathname === "/read") {
|
package/server/sw.js
CHANGED
|
@@ -16,17 +16,27 @@ const STATIC = [
|
|
|
16
16
|
"/assets/edit-room.css",
|
|
17
17
|
"/assets/palette.css",
|
|
18
18
|
"/assets/files.css",
|
|
19
|
+
"/assets/tasks.css",
|
|
19
20
|
"/assets/doc-preview.css",
|
|
20
21
|
"/assets/highlight-10.7.3.min.js",
|
|
22
|
+
"/assets/marked-18.0.4.js",
|
|
23
|
+
"/assets/dompurify-3.4.7.js",
|
|
24
|
+
"/assets/mermaid-11.12.2.min.js",
|
|
21
25
|
"/assets/icons/icon-192.png",
|
|
22
26
|
"/assets/icons/icon-512.png",
|
|
27
|
+
"/assets/icons/apple-touch-icon.png",
|
|
23
28
|
"/manifest.webmanifest",
|
|
24
29
|
];
|
|
30
|
+
const VERSIONED = new Set(STATIC.filter((path) => path.endsWith(".css") || /^\/assets\/(?:highlight|marked|dompurify|mermaid)-/.test(path)));
|
|
31
|
+
const versioned = (path) => `${path}?v=${VERSION}`;
|
|
25
32
|
|
|
26
33
|
self.addEventListener("install", (event) => {
|
|
27
34
|
event.waitUntil((async () => {
|
|
28
35
|
const cache = await caches.open(CACHE);
|
|
29
|
-
|
|
36
|
+
// Stylesheets and classic scripts carry the release version. A client still
|
|
37
|
+
// running an older worker therefore misses its old cache after a deploy instead
|
|
38
|
+
// of mixing new HTML with stale styles.
|
|
39
|
+
await cache.addAll([SHELL, ...STATIC.map((path) => VERSIONED.has(path) ? versioned(path) : path)]);
|
|
30
40
|
// The shell is a module graph, so an offline start needs the imports too. Walk them
|
|
31
41
|
// from the entry point instead of keeping a list that drifts with every new module.
|
|
32
42
|
const pending = ["/assets/chat/index.js"], seen = new Set();
|
|
@@ -38,7 +48,7 @@ self.addEventListener("install", (event) => {
|
|
|
38
48
|
if (!response?.ok) continue;
|
|
39
49
|
const source = await response.clone().text();
|
|
40
50
|
await cache.put(url, response);
|
|
41
|
-
for (const match of source.matchAll(/from\s+"(
|
|
51
|
+
for (const match of source.matchAll(/(?:from\s+"|import\(\s*")(\.\.?\/[^"]+\.js)"/g)) {
|
|
42
52
|
pending.push(new URL(match[1], `https://chat.invalid${url}`).pathname);
|
|
43
53
|
}
|
|
44
54
|
}
|