pith-ui 0.1.1 → 0.2.0-app.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.
- package/AI.md +33 -8
- package/API.md +424 -268
- package/APP-API.md +2019 -0
- package/APP.md +137 -0
- package/README.md +37 -4
- package/dist/app/files.d.ts +68 -0
- package/dist/app/files.d.ts.map +1 -0
- package/dist/app/files.js +177 -0
- package/dist/app/files.js.map +1 -0
- package/dist/app/index.d.ts +57 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +300 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/internal.d.ts +31 -0
- package/dist/app/internal.d.ts.map +1 -0
- package/dist/app/internal.js +2 -0
- package/dist/app/internal.js.map +1 -0
- package/dist/app/resources.d.ts +89 -0
- package/dist/app/resources.d.ts.map +1 -0
- package/dist/app/resources.js +190 -0
- package/dist/app/resources.js.map +1 -0
- package/dist/app/session.d.ts +14 -0
- package/dist/app/session.d.ts.map +1 -0
- package/dist/app/session.js +12 -0
- package/dist/app/session.js.map +1 -0
- package/dist/app/settings.d.ts +109 -0
- package/dist/app/settings.d.ts.map +1 -0
- package/dist/app/settings.js +279 -0
- package/dist/app/settings.js.map +1 -0
- package/dist/app/workspace.d.ts +228 -0
- package/dist/app/workspace.d.ts.map +1 -0
- package/dist/app/workspace.js +402 -0
- package/dist/app/workspace.js.map +1 -0
- package/dist/composer.d.ts.map +1 -1
- package/dist/composer.js +37 -27
- package/dist/composer.js.map +1 -1
- package/dist/content/conversation-reader.d.ts.map +1 -1
- package/dist/content/conversation-reader.js +8 -1
- package/dist/content/conversation-reader.js.map +1 -1
- package/dist/content/conversation-view.d.ts.map +1 -1
- package/dist/content/conversation-view.js +34 -8
- package/dist/content/conversation-view.js.map +1 -1
- package/dist/content/image-viewer.d.ts.map +1 -1
- package/dist/content/image-viewer.js +11 -3
- package/dist/content/image-viewer.js.map +1 -1
- package/dist/content/paged-preview.d.ts +1 -1
- package/dist/content/paged-preview.d.ts.map +1 -1
- package/dist/content/paged-preview.js +4 -2
- package/dist/content/paged-preview.js.map +1 -1
- package/dist/content/views.d.ts +3 -0
- package/dist/content/views.d.ts.map +1 -1
- package/dist/content/views.js +110 -41
- package/dist/content/views.js.map +1 -1
- package/dist/content/welcome.d.ts.map +1 -1
- package/dist/content/welcome.js +5 -2
- package/dist/content/welcome.js.map +1 -1
- package/dist/dom.js +1 -1
- package/dist/dom.js.map +1 -1
- package/dist/files/panels.d.ts +2 -0
- package/dist/files/panels.d.ts.map +1 -1
- package/dist/files/panels.js +202 -128
- package/dist/files/panels.js.map +1 -1
- package/dist/files/systems.d.ts.map +1 -1
- package/dist/files/systems.js +37 -64
- package/dist/files/systems.js.map +1 -1
- package/dist/forms/actions.d.ts +24 -2
- package/dist/forms/actions.d.ts.map +1 -1
- package/dist/forms/actions.js +54 -25
- package/dist/forms/actions.js.map +1 -1
- package/dist/forms/custom-connection.d.ts.map +1 -1
- package/dist/forms/custom-connection.js +3 -2
- package/dist/forms/custom-connection.js.map +1 -1
- package/dist/forms/history.d.ts +1 -1
- package/dist/forms/history.d.ts.map +1 -1
- package/dist/forms/history.js +78 -15
- package/dist/forms/history.js.map +1 -1
- package/dist/forms/identity.d.ts.map +1 -1
- package/dist/forms/identity.js +9 -25
- package/dist/forms/identity.js.map +1 -1
- package/dist/forms/model-editor.js +3 -3
- package/dist/forms/model-editor.js.map +1 -1
- package/dist/forms/panels.d.ts +9 -2
- package/dist/forms/panels.d.ts.map +1 -1
- package/dist/forms/panels.js +79 -88
- package/dist/forms/panels.js.map +1 -1
- package/dist/forms/provider-login.d.ts.map +1 -1
- package/dist/forms/provider-login.js +20 -36
- package/dist/forms/provider-login.js.map +1 -1
- package/dist/forms/resource-editor.js +5 -4
- package/dist/forms/resource-editor.js.map +1 -1
- package/dist/foundations.d.ts +1 -1
- package/dist/foundations.d.ts.map +1 -1
- package/dist/foundations.js +22 -38
- package/dist/foundations.js.map +1 -1
- package/dist/navigation/context-menu.d.ts +7 -1
- package/dist/navigation/context-menu.d.ts.map +1 -1
- package/dist/navigation/context-menu.js +60 -57
- package/dist/navigation/context-menu.js.map +1 -1
- package/dist/navigation/navigation.d.ts +13 -0
- package/dist/navigation/navigation.d.ts.map +1 -1
- package/dist/navigation/navigation.js +96 -130
- package/dist/navigation/navigation.js.map +1 -1
- package/dist/operation.d.ts +12 -0
- package/dist/operation.d.ts.map +1 -0
- package/dist/operation.js +49 -0
- package/dist/operation.js.map +1 -0
- package/dist/primitives.d.ts +8 -1
- package/dist/primitives.d.ts.map +1 -1
- package/dist/primitives.js +114 -143
- package/dist/primitives.js.map +1 -1
- package/dist/reconcile.d.ts +11 -0
- package/dist/reconcile.d.ts.map +1 -0
- package/dist/reconcile.js +36 -0
- package/dist/reconcile.js.map +1 -0
- package/dist/select.d.ts +14 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +304 -0
- package/dist/select.js.map +1 -0
- package/dist/styles.css +439 -370
- package/dist/surface.d.ts +31 -0
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +193 -3
- package/dist/surface.js.map +1 -1
- package/dist/tasks/approval.d.ts.map +1 -1
- package/dist/tasks/approval.js +83 -45
- package/dist/tasks/approval.js.map +1 -1
- package/dist/tasks/permission-element.d.ts +3 -0
- package/dist/tasks/permission-element.d.ts.map +1 -0
- package/dist/tasks/permission-element.js +10 -0
- package/dist/tasks/permission-element.js.map +1 -0
- package/dist/tasks/permission.d.ts.map +1 -1
- package/dist/tasks/permission.js +37 -18
- package/dist/tasks/permission.js.map +1 -1
- package/dist/tasks/runtime.d.ts.map +1 -1
- package/dist/tasks/runtime.js +32 -15
- package/dist/tasks/runtime.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +93 -40
- package/dist/workspace.js.map +1 -1
- package/package.json +42 -8
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { scopeIds } from '../forms/identity.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Lifetime } from '../core.js';
|
|
3
3
|
import { dialogHeading, escape, icon, uniqueId } from '../dom.js';
|
|
4
4
|
import { adoptProductParts } from '../foundations.js';
|
|
5
5
|
import { installDialogLifecycle } from '../surface.js';
|
|
6
|
+
import { createOperation } from '../operation.js';
|
|
7
|
+
import { reconcileKeyed } from '../reconcile.js';
|
|
6
8
|
export function createWorkspaceNavigation(initial, options = {}) {
|
|
7
9
|
const element = options.element || document.createElement('nav');
|
|
8
10
|
if (!options.element) {
|
|
@@ -140,6 +142,7 @@ export function createWorkspaceNavigation(initial, options = {}) {
|
|
|
140
142
|
}
|
|
141
143
|
else
|
|
142
144
|
emptyWorkspace.remove();
|
|
145
|
+
parts.action(emptyWorkspace).update({ disabled: !!state.disabled });
|
|
143
146
|
if (state.empty === 'search') {
|
|
144
147
|
if (emptySearch.parentElement !== element)
|
|
145
148
|
element.append(emptySearch);
|
|
@@ -148,10 +151,29 @@ export function createWorkspaceNavigation(initial, options = {}) {
|
|
|
148
151
|
emptySearch.remove();
|
|
149
152
|
parts.update();
|
|
150
153
|
};
|
|
151
|
-
element.addEventListener('click', event => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
element.addEventListener('click', event => {
|
|
155
|
+
const target = event.target.closest('button');
|
|
156
|
+
if (!target || target.disabled)
|
|
157
|
+
return;
|
|
158
|
+
if (target.dataset.toggleWorkspace && options.onToggle) {
|
|
159
|
+
event.stopPropagation();
|
|
160
|
+
options.onToggle(target.dataset.toggleWorkspace);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (target.dataset.conversation && options.onSelect) {
|
|
164
|
+
event.stopPropagation();
|
|
165
|
+
options.onSelect(target.dataset.conversation);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const action = target === emptyWorkspace ? { action: 'add-workspace', trigger: target }
|
|
169
|
+
: target.dataset.newWorkspace ? { action: 'new-conversation', workspaceId: target.dataset.newWorkspace, trigger: target }
|
|
170
|
+
: target.dataset.workspaceMenu ? { action: 'workspace-menu', workspaceId: target.dataset.workspaceMenu, trigger: target }
|
|
171
|
+
: target.dataset.conversationMenu ? { action: 'conversation-menu', conversationId: target.dataset.conversationMenu, trigger: target } : undefined;
|
|
172
|
+
if (action && options.onAction) {
|
|
173
|
+
event.stopPropagation();
|
|
174
|
+
options.onAction(action);
|
|
175
|
+
}
|
|
176
|
+
}, { signal: abort.signal });
|
|
155
177
|
update(initial);
|
|
156
178
|
return { element, update, destroy() { if (destroyed)
|
|
157
179
|
return; destroyed = true; abort.abort(); parts.destroy(); workspaces.clear(); conversations.clear(); if (!options.element)
|
|
@@ -171,57 +193,45 @@ export function createRenameConversation(initial, options = {}) {
|
|
|
171
193
|
const feedback = parts.feedback(error);
|
|
172
194
|
const button = form.querySelector('button[type="submit"]');
|
|
173
195
|
const action = parts.action(button);
|
|
174
|
-
const generation = new Generation();
|
|
175
196
|
const life = new Lifetime();
|
|
176
197
|
let current = initial;
|
|
177
198
|
let targetId = initial.id;
|
|
178
|
-
let pending = false;
|
|
179
199
|
let destroyed = false;
|
|
180
|
-
const sync = () => { action.update({ disabled: !!current.disabled || !!options.unavailable?.(), pending }); feedback.update({ message: current.error || '', tone: 'error' }); };
|
|
181
|
-
const
|
|
200
|
+
const sync = () => { action.update({ disabled: !!current.disabled || !!options.unavailable?.(), pending: operation.pending }); feedback.update({ message: current.error || '', tone: 'error' }); };
|
|
201
|
+
const operation = createOperation({ unavailable: () => destroyed || !!current.disabled || !!options.unavailable?.(), onPending: sync, onError(message) { current = { ...current, error: message }; sync(); } });
|
|
202
|
+
const lifecycle = options.dialog ? installDialogLifecycle(options.dialog, { onOpen() { operation.invalidate(); }, onClose() { operation.invalidate(); } }) : undefined;
|
|
182
203
|
const update = (next) => { if (destroyed)
|
|
183
204
|
return; current = { ...next, error: next.error ?? current.error }; sync(); };
|
|
184
205
|
const reset = (next) => { if (destroyed)
|
|
185
|
-
return;
|
|
186
|
-
const close = () => {
|
|
206
|
+
return; operation.invalidate(); targetId = next.id; current = next; control.reset(next.title); button.dataset.idleConversation = next.id; sync(); };
|
|
207
|
+
const close = () => { operation.invalidate(); lifecycle?.close(); };
|
|
187
208
|
if (options.onSubmit)
|
|
188
|
-
life.listen(form, 'submit', (
|
|
209
|
+
life.listen(form, 'submit', (event => {
|
|
189
210
|
event.preventDefault();
|
|
190
211
|
const title = control.getValue().trim();
|
|
191
|
-
if (
|
|
212
|
+
if (!title)
|
|
192
213
|
return;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
if (!generation.current(seq) || (options.dialog && !options.dialog.open))
|
|
205
|
-
return;
|
|
206
|
-
pending = false;
|
|
207
|
-
if (result.ok) {
|
|
208
|
-
lifecycle?.close();
|
|
209
|
-
options.onSubmitted?.();
|
|
210
|
-
}
|
|
211
|
-
else
|
|
212
|
-
current = { ...current, error: result.error };
|
|
213
|
-
sync();
|
|
214
|
+
operation.run(() => { current = { ...current, error: '' }; sync(); return options.onSubmit({ id: targetId, title }); }, result => {
|
|
215
|
+
if (options.dialog && !options.dialog.open)
|
|
216
|
+
return;
|
|
217
|
+
if (result.ok) {
|
|
218
|
+
lifecycle?.close();
|
|
219
|
+
options.onSubmitted?.();
|
|
220
|
+
}
|
|
221
|
+
else
|
|
222
|
+
current = { ...current, error: result.error };
|
|
223
|
+
sync();
|
|
224
|
+
});
|
|
214
225
|
}));
|
|
215
226
|
life.listen(element, 'click', (event => { if (event.target.closest('[data-close]')) {
|
|
216
|
-
|
|
217
|
-
pending = false;
|
|
227
|
+
operation.invalidate();
|
|
218
228
|
options.onCancel?.();
|
|
219
229
|
lifecycle?.close();
|
|
220
230
|
} }));
|
|
221
231
|
update(initial);
|
|
222
232
|
return { element, input, form, update, read: () => ({ id: targetId, title: control.getValue() }), reset, open(next) { if (next)
|
|
223
233
|
reset(next); lifecycle?.open(); input.select(); }, close, focus() { input.select(); }, destroy() { if (destroyed)
|
|
224
|
-
return; destroyed = true;
|
|
234
|
+
return; destroyed = true; operation.destroy(); life.destroy(); lifecycle?.close(); lifecycle?.destroy(); parts.destroy(); element.remove(); } };
|
|
225
235
|
}
|
|
226
236
|
export function createWorkspacePicker(initial, options = {}) {
|
|
227
237
|
const state = initial;
|
|
@@ -239,130 +249,86 @@ export function createWorkspacePicker(initial, options = {}) {
|
|
|
239
249
|
const control = parts.control(input);
|
|
240
250
|
const feedback = parts.feedback(error);
|
|
241
251
|
const submitButton = form.querySelector('button[type="submit"]');
|
|
242
|
-
const generation = new Generation();
|
|
243
252
|
const life = new Lifetime();
|
|
244
253
|
let current = initial;
|
|
245
|
-
let pending = false;
|
|
246
254
|
let destroyed = false;
|
|
247
|
-
const
|
|
255
|
+
const unavailable = () => destroyed || !!current.disabled || !!options.unavailable?.();
|
|
256
|
+
const sync = () => { const disabled = unavailable(), pending = pickOperation.pending || submitOperation.pending; parts.action(submitButton).update({ disabled, pending }); parts.action(pickButton).update({ disabled, pending }); for (const row of rows.values())
|
|
248
257
|
parts.action(row).update({ disabled: disabled || pending }); feedback.update({ message: current.error || '', tone: 'error' }); };
|
|
249
|
-
const
|
|
258
|
+
const fail = (message) => { current = { ...current, error: message }; sync(); };
|
|
259
|
+
const pickOperation = createOperation({ unavailable: () => unavailable() || submitOperation.pending, onPending: sync, onError(message) { fail(`${message} You can enter the path below.`); control.focus(); } });
|
|
260
|
+
const submitOperation = createOperation({ unavailable: () => unavailable() || pickOperation.pending, onPending: sync, onError: fail });
|
|
261
|
+
const invalidate = () => { pickOperation.invalidate(); submitOperation.invalidate(); };
|
|
262
|
+
const lifecycle = options.dialog ? installDialogLifecycle(options.dialog, { onOpen: invalidate, onClose: invalidate }) : undefined;
|
|
250
263
|
const update = (next) => {
|
|
251
264
|
if (destroyed)
|
|
252
265
|
return;
|
|
253
266
|
current = { ...next, error: next.error ?? current.error };
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
row.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
row = document.createElement('button');
|
|
265
|
-
row.type = 'button';
|
|
266
|
-
row.className = 'pui-modal-workspace';
|
|
267
|
-
row.dataset.modalWorkspace = entry.id;
|
|
268
|
-
row.innerHTML = `${icon('folder')}<span><strong></strong><small></small></span>${icon('chevron')}`;
|
|
269
|
-
rows.set(entry.id, row);
|
|
270
|
-
}
|
|
271
|
-
const name = row.querySelector('strong');
|
|
272
|
-
const path = row.querySelector('small');
|
|
273
|
-
if (name.textContent !== entry.name)
|
|
274
|
-
name.textContent = entry.name;
|
|
275
|
-
if (path.textContent !== entry.path)
|
|
276
|
-
path.textContent = entry.path;
|
|
277
|
-
if (cursor !== row)
|
|
278
|
-
list.insertBefore(row, cursor);
|
|
279
|
-
cursor = row.nextElementSibling;
|
|
280
|
-
}
|
|
267
|
+
reconcileKeyed(list, rows, next.workspaces, { key: entry => entry.id, element: row => row,
|
|
268
|
+
create(entry) { const row = document.createElement('button'); row.type = 'button'; row.className = 'pui-modal-workspace'; row.dataset.modalWorkspace = entry.id; row.innerHTML = `${icon('folder')}<span><strong></strong><small></small></span>${icon('chevron')}`; return row; },
|
|
269
|
+
update(row, entry) {
|
|
270
|
+
const name = row.querySelector('strong');
|
|
271
|
+
const path = row.querySelector('small');
|
|
272
|
+
if (name.textContent !== entry.name)
|
|
273
|
+
name.textContent = entry.name;
|
|
274
|
+
if (path.textContent !== entry.path)
|
|
275
|
+
path.textContent = entry.path;
|
|
276
|
+
}, destroy() { }, });
|
|
281
277
|
parts.update();
|
|
282
278
|
sync();
|
|
283
279
|
};
|
|
284
|
-
const submit =
|
|
285
|
-
if (!options.onSubmit ||
|
|
286
|
-
return;
|
|
287
|
-
const seq = owner ?? generation.next();
|
|
288
|
-
pending = true;
|
|
289
|
-
current = { ...current, error: '' };
|
|
290
|
-
sync();
|
|
291
|
-
let result;
|
|
292
|
-
try {
|
|
293
|
-
result = await options.onSubmit(path.trim());
|
|
294
|
-
}
|
|
295
|
-
catch (reason) {
|
|
296
|
-
result = { ok: false, error: reason instanceof Error ? reason.message : String(reason) };
|
|
297
|
-
}
|
|
298
|
-
if (!generation.current(seq) || (options.dialog && !options.dialog.open))
|
|
280
|
+
const submit = (path) => {
|
|
281
|
+
if (!options.onSubmit || !path.trim())
|
|
299
282
|
return;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
283
|
+
submitOperation.run(() => { current = { ...current, error: '' }; sync(); return options.onSubmit(path.trim()); }, result => {
|
|
284
|
+
if (options.dialog && !options.dialog.open)
|
|
285
|
+
return;
|
|
286
|
+
if (result.ok) {
|
|
287
|
+
lifecycle?.close();
|
|
288
|
+
options.onSubmitted?.();
|
|
289
|
+
}
|
|
290
|
+
else
|
|
291
|
+
current = { ...current, error: result.error };
|
|
292
|
+
sync();
|
|
293
|
+
});
|
|
308
294
|
};
|
|
309
295
|
if (options.onSubmit)
|
|
310
296
|
life.listen(form, 'submit', (event => { event.preventDefault(); void submit(control.getValue()); }));
|
|
311
297
|
if (options.onPick)
|
|
312
|
-
life.listen(pickButton, 'click', (
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
catch (reason) {
|
|
324
|
-
result = { error: `${reason instanceof Error ? reason.message : String(reason)} You can enter the path below.` };
|
|
325
|
-
}
|
|
326
|
-
if (!generation.current(seq) || (options.dialog && !options.dialog.open))
|
|
327
|
-
return;
|
|
328
|
-
if (result.error) {
|
|
329
|
-
pending = false;
|
|
330
|
-
current = { ...current, error: result.error };
|
|
331
|
-
sync();
|
|
332
|
-
control.focus();
|
|
333
|
-
}
|
|
334
|
-
else if (result.path) {
|
|
335
|
-
control.reset(result.path);
|
|
336
|
-
if (options.onSubmit)
|
|
337
|
-
await submit(result.path, seq);
|
|
338
|
-
else {
|
|
339
|
-
pending = false;
|
|
340
|
-
sync();
|
|
298
|
+
life.listen(pickButton, 'click', (() => {
|
|
299
|
+
pickOperation.run(() => { current = { ...current, error: '' }; sync(); return options.onPick(); }, result => {
|
|
300
|
+
// End the picker ownership before handing a valid path to submission.
|
|
301
|
+
// A newly disabled target can refuse the write without retaining pending.
|
|
302
|
+
pickOperation.invalidate();
|
|
303
|
+
if (options.dialog && !options.dialog.open)
|
|
304
|
+
return;
|
|
305
|
+
if (result.error) {
|
|
306
|
+
fail(result.error);
|
|
307
|
+
control.focus();
|
|
341
308
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
}
|
|
309
|
+
else if (result.path) {
|
|
310
|
+
control.reset(result.path);
|
|
311
|
+
submit(result.path);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
347
314
|
}));
|
|
348
315
|
life.listen(element, 'click', (event => {
|
|
349
316
|
const target = event.target;
|
|
350
317
|
const selection = target.closest('[data-modal-workspace]');
|
|
351
318
|
if (selection && options.onSelect) {
|
|
352
319
|
event.stopPropagation();
|
|
353
|
-
if (!pending && !
|
|
320
|
+
if (!pickOperation.pending && !submitOperation.pending && !unavailable())
|
|
354
321
|
options.onSelect(selection.dataset.modalWorkspace);
|
|
355
322
|
}
|
|
356
323
|
if (target.closest('[data-close]')) {
|
|
357
|
-
|
|
358
|
-
pending = false;
|
|
324
|
+
invalidate();
|
|
359
325
|
options.onCancel?.();
|
|
360
326
|
lifecycle?.close();
|
|
361
327
|
}
|
|
362
328
|
}));
|
|
363
329
|
update(initial);
|
|
364
330
|
return { element, input, form, pickButton, update, read: () => ({ path: control.getValue() }), reset(path = '') { if (destroyed)
|
|
365
|
-
return;
|
|
366
|
-
return; destroyed = true;
|
|
331
|
+
return; invalidate(); current = { ...current, error: '' }; control.reset(path); sync(); }, open() { lifecycle?.open(); }, close() { invalidate(); lifecycle?.close(); }, focus: control.focus, destroy() { if (destroyed)
|
|
332
|
+
return; destroyed = true; pickOperation.destroy(); submitOperation.destroy(); life.destroy(); lifecycle?.close(); lifecycle?.destroy(); parts.destroy(); element.remove(); } };
|
|
367
333
|
}
|
|
368
334
|
//# sourceMappingURL=navigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/navigation/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAmC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAMvD,MAAM,UAAU,yBAAyB,CAAC,OAAiC,EAAE,UAAwH,EAAE;IACrM,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAAA,OAAO,CAAC,SAAS,GAAG,2CAA2C,CAAC;QAAC,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,8BAA8B,CAAC,CAAC;IAAA,CAAC;IAC5J,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC;IAC7D,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAAC,IAAI,SAAS,GAAG,KAAK,CAAC;IAC3D,MAAM,KAAK,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAwB,C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AC,OAAO,GAAG,KAAK,CAAC,CAAC,OAAO,GAAG,EAAC,GAAG,OAAO,EAAE,KAAK,EAAE,EAAE,EAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA,CAAC,EAAE,IAAI,KAAI,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA,CAAC,EAAE,KAAK,KAAI,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,KAAI,IAAI,SAAS;YAAE,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,EAAC,CAAC;AAC/hB,CAAC","sourcesContent":["import {scopeIds} from '../forms/identity.js';\nimport { Generation, Lifetime, type ActionResult, type UIBlock } from '../core.js';\nimport {dialogHeading, escape, icon, uniqueId} from '../dom.js';\nimport { adoptProductParts } from '../foundations.js';\nimport { installDialogLifecycle } from '../surface.js';\nexport interface NavigationConversation {id: string; title?: string; active: boolean; menuOpen?: boolean; status?: Node | null}\nexport interface NavigationWorkspace {id: string; name: string; path: string; expanded: boolean; selected: boolean; menuOpen?: boolean; children: readonly NavigationConversation[]}\nexport interface WorkspaceNavigationState {groups: readonly NavigationWorkspace[]; empty: 'workspaces' | 'search' | null; disabled?: boolean}\ntype ConversationDOM = {element: HTMLElement; button: HTMLButtonElement; title: HTMLElement; more: HTMLButtonElement; status: Node[]; statusSignature: string; statusSource?: Node | null};\ntype WorkspaceDOM = {element: HTMLElement; heading: HTMLElement; toggle: HTMLButtonElement; title: HTMLElement; more: HTMLButtonElement; create: HTMLButtonElement; children: HTMLElement; empty: HTMLElement};\nexport function createWorkspaceNavigation(initial: WorkspaceNavigationState, options: {element?: HTMLElement; idPrefix?: string; onToggle?: (id: string) => void; onSelect?: (id: string) => void} = {}): UIBlock<WorkspaceNavigationState> {\n const element = options.element || document.createElement('nav');\n if (!options.element) {element.className = 'pui-history-list pui-workspace-navigation'; element.setAttribute('aria-label', 'Workspaces and conversations');}\n const prefix = options.idPrefix ?? uniqueId('pui-nav') + '-';\n const abort = new AbortController(); let destroyed = false;\n const parts = adoptProductParts(element);\n const workspaces = new Map<string, WorkspaceDOM>(); const conversations = new Map<string, ConversationDOM>();\n const emptyWorkspace = document.createElement('button'); emptyWorkspace.type = 'button'; emptyWorkspace.className = 'pui-workspace-item pui-empty-workspace'; emptyWorkspace.dataset.action = 'workspace'; emptyWorkspace.innerHTML = `${icon('folder')}<span>Add a workspace</span>`;\n const emptySearch = document.createElement('p'); emptySearch.className = 'pui-history-empty'; emptySearch.textContent = 'No matching conversations.';\n function createWorkspace(): WorkspaceDOM {\n const root = document.createElement('section'); root.className = 'pui-workspace-group';\n root.innerHTML = `<div class=\"pui-workspace-heading\"><button class=\"pui-workspace-toggle\">${icon('chevron', 'pui-workspace-chevron')}${icon('folder')}<span></span></button><button class=\"pui-quiet-icon pui-workspace-more\" aria-haspopup=\"menu\">${icon('more')}</button><button class=\"pui-quiet-icon pui-workspace-new\" title=\"New conversation\">${icon('compose')}</button></div><div class=\"pui-workspace-children\"></div>`;\n const buttons = root.querySelectorAll<HTMLButtonElement>('button'); const empty = document.createElement('p'); empty.className = 'pui-workspace-empty'; empty.textContent = 'No conversations yet';\n return {element:root,heading:root.firstElementChild as HTMLElement,toggle:buttons[0],title:buttons[0].querySelector('span')!,more:buttons[1],create:buttons[2],children:root.lastElementChild as HTMLElement,empty};\n }\n function createConversation(): ConversationDOM {\n const root = document.createElement('div'); root.className = 'pui-history-row';\n root.innerHTML = `<button class=\"pui-history-item\"><span></span></button><button class=\"pui-quiet-icon pui-history-more\" aria-haspopup=\"menu\">${icon('more')}</button>`;\n const buttons = root.querySelectorAll<HTMLButtonElement>('button'); return {element:root,button:buttons[0],title:buttons[0].querySelector('span')!,more:buttons[1],status:[],statusSignature:''};\n }\n function statusSignature(node?: Node | null): string {\n if (!node) return ''; const holder = document.createElement('div'); holder.append(node.cloneNode(true)); return holder.innerHTML;\n }\n const update = (state: Readonly<WorkspaceNavigationState>) => {\n if (destroyed) return; const currentWorkspaces = new Set<string>(); const currentConversations = new Set<string>(); let groupCursor: Element | null = element.firstElementChild;\n for (const workspace of state.groups) {\n currentWorkspaces.add(workspace.id); let group = workspaces.get(workspace.id); if (!group) {group = createWorkspace(); workspaces.set(workspace.id,group);}\n group.element.setAttribute('aria-label',workspace.name); group.heading.classList.toggle('pui-selected',workspace.selected);\n group.toggle.dataset.toggleWorkspace = workspace.id; group.toggle.setAttribute('aria-expanded',String(workspace.expanded)); group.toggle.setAttribute('aria-controls',prefix+'workspace-children-'+workspace.id); group.toggle.title = workspace.path;\n if (group.title.textContent !== workspace.name) group.title.textContent = workspace.name;\n group.more.id = prefix+'workspace-actions-'+workspace.id; group.more.dataset.workspaceMenu = workspace.id; group.more.setAttribute('aria-label','Actions for workspace '+workspace.name); group.more.setAttribute('aria-expanded',String(!!workspace.menuOpen)); parts.action(group.more).update({disabled: !!state.disabled});\n group.create.dataset.newWorkspace = workspace.id; group.create.setAttribute('aria-label','New conversation in '+workspace.name); parts.action(group.create).update({disabled: !!state.disabled});\n group.children.id = prefix+'workspace-children-'+workspace.id; group.children.hidden = !workspace.expanded; let rowCursor: Element | null = group.children.firstElementChild;\n for (const entry of workspace.children) {\n currentConversations.add(entry.id); let row = conversations.get(entry.id); if (!row) {row = createConversation(); conversations.set(entry.id,row);}\n const title = entry.title || 'Untitled conversation'; row.element.classList.toggle('pui-active',entry.active); row.button.dataset.conversation = entry.id; parts.action(row.button).update({title, disabled: !!state.disabled});\n if (entry.active) row.button.setAttribute('aria-current','page'); else row.button.removeAttribute('aria-current'); if (row.title.textContent !== title) row.title.textContent = title;\n row.more.id = prefix+'conversation-actions-'+entry.id; row.more.dataset.conversationMenu = entry.id; row.more.setAttribute('aria-label','Actions for '+title); row.more.setAttribute('aria-expanded',String(!!entry.menuOpen)); parts.action(row.more).update({disabled: !!state.disabled});\n const signature = entry.status === row.statusSource && entry.status instanceof DocumentFragment && entry.status.childNodes.length === 0 ? row.statusSignature : statusSignature(entry.status);\n row.statusSource = entry.status;\n if (signature !== row.statusSignature) {for (const node of row.status) node.parentNode?.removeChild(node); row.status = entry.status ? entry.status instanceof DocumentFragment ? [...entry.status.childNodes] : [entry.status] : []; row.button.append(...row.status); row.statusSignature = signature;}\n if (row.element !== rowCursor) group.children.insertBefore(row.element,rowCursor); rowCursor = row.element.nextElementSibling;\n }\n if (!workspace.children.length) {if (group.empty.parentElement !== group.children) group.children.append(group.empty);} else group.empty.remove();\n if (group.element !== groupCursor) element.insertBefore(group.element,groupCursor); groupCursor = group.element.nextElementSibling;\n }\n for (const [id,row] of conversations) if (!currentConversations.has(id)) {row.element.remove(); conversations.delete(id);}\n for (const [id,group] of workspaces) if (!currentWorkspaces.has(id)) {group.element.remove(); workspaces.delete(id);}\n if (state.empty === 'workspaces') {if (emptyWorkspace.parentElement !== element) element.append(emptyWorkspace);} else emptyWorkspace.remove();\n if (state.empty === 'search') {if (emptySearch.parentElement !== element) element.append(emptySearch);} else emptySearch.remove();\n parts.update();\n };\n element.addEventListener('click',event => {const target = (event.target as HTMLElement).closest<HTMLButtonElement>('button'); if (target?.disabled) return; if (target?.dataset.toggleWorkspace) options.onToggle?.(target.dataset.toggleWorkspace); if (target?.dataset.conversation) options.onSelect?.(target.dataset.conversation);},{signal:abort.signal});\n update(initial); return {element,update,destroy() {if (destroyed) return; destroyed = true; abort.abort(); parts.destroy(); workspaces.clear(); conversations.clear(); if (!options.element) element.remove();}};\n}\nexport interface RenameConversationState {id: string; title: string; error?: string; disabled?: boolean}\nexport interface RenameConversationDraft {id: string; title: string}\nexport interface RenameConversationOptions {\n idPrefix?: string;\n dialog?: HTMLDialogElement;\n unavailable?: () => boolean;\n onSubmit?: (draft: RenameConversationDraft) => Promise<ActionResult> | ActionResult;\n onSubmitted?: () => void;\n onCancel?: () => void;\n}\nexport interface RenameConversationBlock extends UIBlock<RenameConversationState> {\n readonly input: HTMLInputElement;\n readonly form: HTMLFormElement;\n read(): RenameConversationDraft;\n reset(state: RenameConversationState): void;\n open(state?: RenameConversationState): void;\n close(): void;\n focus(): void;\n}\nexport function createRenameConversation(initial: RenameConversationState, options: RenameConversationOptions = {}): RenameConversationBlock {\n const state = initial; const element = document.createElement('div'); element.className = 'pui-rename-conversation'; element.innerHTML = `${dialogHeading('Rename conversation', 'rename-title', 'rename-dialog', 'CONVERSATION')}<form id=\"rename-form\"><label class=\"pui-field-label\" for=\"conversation-title\">Title</label><input id=\"conversation-title\" name=\"title\" value=\"${escape(state.title)}\" required autocomplete=\"off\" /><div id=\"rename-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button type=\"button\" class=\"pui-secondary-button\" data-close=\"rename-dialog\">Cancel</button><button type=\"submit\" class=\"pui-primary-button\" data-idle-action data-idle-conversation=\"${escape(state.id)}\">Save title</button></div></form>`;\n const input = element.querySelector<HTMLInputElement>('#conversation-title')!; const form = element.querySelector<HTMLFormElement>('#rename-form')!; const error = element.querySelector<HTMLElement>('#rename-error')!;\n scopeIds(element, options.idPrefix ?? uniqueId('pui-rename') + '-');\n const parts = adoptProductParts(element); const control = parts.control(input); const feedback = parts.feedback(error);\n const button = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]')!; const action = parts.action(button);\n const generation = new Generation(); const life = new Lifetime();\n let current = initial; let targetId = initial.id; let pending = false; let destroyed = false;\n const sync = () => {action.update({disabled: !!current.disabled || !!options.unavailable?.(), pending}); feedback.update({message: current.error || '', tone: 'error'});};\n const lifecycle = options.dialog ? installDialogLifecycle(options.dialog, {onOpen() {generation.invalidate(); pending = false; sync();}, onClose() {generation.invalidate(); pending = false; sync();}}) : undefined;\n const update = (next: Readonly<RenameConversationState>) => {if (destroyed) return; current = {...next, error: next.error ?? current.error}; sync();};\n const reset = (next: RenameConversationState) => {if (destroyed) return; generation.invalidate(); pending = false; targetId = next.id; current = next; control.reset(next.title); button.dataset.idleConversation = next.id; sync();};\n const close = () => {generation.invalidate(); pending = false; lifecycle?.close(); sync();};\n if (options.onSubmit) life.listen(form, 'submit', (async event => {\n event.preventDefault();\n const title = control.getValue().trim();\n if (destroyed || pending || current.disabled || options.unavailable?.() || !title) return;\n const seq = generation.next(); pending = true; current = {...current, error: ''}; sync();\n let result: ActionResult;\n try {result = await options.onSubmit!({id: targetId, title});}\n catch (reason) {result = {ok: false, error: reason instanceof Error ? reason.message : String(reason)};}\n if (!generation.current(seq) || (options.dialog && !options.dialog.open)) return;\n pending = false;\n if (result.ok) {lifecycle?.close(); options.onSubmitted?.();}\n else current = {...current, error: result.error};\n sync();\n }) as EventListener);\n life.listen(element, 'click', (event => {if ((event.target as Element).closest('[data-close]')) {generation.invalidate(); pending = false; options.onCancel?.(); lifecycle?.close();}}) as EventListener);\n update(initial);\n return {element, input, form, update, read: () => ({id: targetId, title: control.getValue()}), reset, open(next) {if (next) reset(next); lifecycle?.open(); input.select();}, close, focus() {input.select();}, destroy() {if (destroyed) return; destroyed = true; generation.destroy(); life.destroy(); lifecycle?.close(); lifecycle?.destroy(); parts.destroy(); element.remove();}};\n}\nexport interface WorkspacePickerState {workspaces: readonly {id: string; name: string; path: string}[]; error?: string; disabled?: boolean}\nexport interface WorkspacePickerOptions {\n idPrefix?: string;\n dialog?: HTMLDialogElement;\n unavailable?: () => boolean;\n onSubmit?: (path: string) => Promise<ActionResult> | ActionResult;\n onPick?: () => Promise<{path?: string; error?: string}>;\n onSelect?: (id: string) => void;\n onSubmitted?: () => void;\n onCancel?: () => void;\n}\nexport interface WorkspacePickerBlock extends UIBlock<WorkspacePickerState> {\n readonly input: HTMLInputElement;\n readonly form: HTMLFormElement;\n readonly pickButton: HTMLButtonElement;\n read(): {path: string};\n reset(path?: string): void;\n open(): void;\n close(): void;\n focus(): void;\n}\nexport function createWorkspacePicker(initial: WorkspacePickerState, options: WorkspacePickerOptions = {}): WorkspacePickerBlock {\n const state = initial; const element = document.createElement('div'); element.className = 'pui-workspace-picker'; element.innerHTML = `${dialogHeading('Workspaces', 'workspace-title', 'workspace-dialog', 'A PLACE TO WORK')}<p class=\"pui-modal-description\">Choose a local folder. Conversations belong to a workspace, so Pith knows where to read and create files.</p><div class=\"pui-modal-workspaces\">${state.workspaces.map((entry) => `<button class=\"pui-modal-workspace\" data-modal-workspace=\"${escape(entry.id)}\">${icon('folder')}<span><strong>${escape(entry.name)}</strong><small>${escape(entry.path)}</small></span>${icon('chevron')}</button>`).join('')}</div><div class=\"pui-workspace-add\"><button class=\"pui-picker-button\" id=\"pick-folder\" type=\"button\">${icon('folder')}Choose a folder…</button><div class=\"pui-path-divider\"><span>or enter a folder path</span></div><form id=\"workspace-form\"><label class=\"pui-sr-only\" for=\"workspace-path\">Absolute folder path</label><input id=\"workspace-path\" name=\"path\" placeholder=\"/Users/you/Documents/my-work\" required autocomplete=\"off\" spellcheck=\"false\" /><p class=\"pui-field-hint\">Use an existing folder on this computer. Pith will work inside it.</p><div id=\"workspace-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button class=\"pui-secondary-button\" type=\"button\" data-close=\"workspace-dialog\">Cancel</button><button class=\"pui-primary-button\" id=\"add-workspace\" type=\"submit\">Add workspace</button></div></form></div>`;\n const input = element.querySelector<HTMLInputElement>('#workspace-path')!; const form = element.querySelector<HTMLFormElement>('#workspace-form')!; const pickButton = element.querySelector<HTMLButtonElement>('#pick-folder')!; const error = element.querySelector<HTMLElement>('#workspace-error')!;\n scopeIds(element, options.idPrefix ?? uniqueId('pui-workspace') + '-');\n const list = element.querySelector<HTMLElement>('.pui-modal-workspaces')!;\n const rows = new Map([...list.querySelectorAll<HTMLButtonElement>('[data-modal-workspace]')].map(row => [row.dataset.modalWorkspace!, row]));\n const parts = adoptProductParts(element); const control = parts.control(input); const feedback = parts.feedback(error);\n const submitButton = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]')!;\n const generation = new Generation(); const life = new Lifetime();\n let current = initial; let pending = false; let destroyed = false;\n const sync = () => {const disabled = !!current.disabled || !!options.unavailable?.(); parts.action(submitButton).update({disabled, pending}); parts.action(pickButton).update({disabled, pending}); for (const row of rows.values()) parts.action(row).update({disabled: disabled || pending}); feedback.update({message: current.error || '', tone: 'error'});};\n const lifecycle = options.dialog ? installDialogLifecycle(options.dialog, {onOpen() {generation.invalidate(); pending = false; sync();}, onClose() {generation.invalidate(); pending = false; sync();}}) : undefined;\n const update = (next: Readonly<WorkspacePickerState>) => {\n if (destroyed) return; current = {...next, error: next.error ?? current.error};\n const keep = new Set(next.workspaces.map(entry => entry.id));\n for (const [id, row] of rows) if (!keep.has(id)) {row.remove(); rows.delete(id);}\n let cursor = list.firstElementChild;\n for (const entry of next.workspaces) {\n let row = rows.get(entry.id);\n if (!row) {row = document.createElement('button'); row.type = 'button'; row.className = 'pui-modal-workspace'; row.dataset.modalWorkspace = entry.id; row.innerHTML = `${icon('folder')}<span><strong></strong><small></small></span>${icon('chevron')}`; rows.set(entry.id, row);}\n const name = row.querySelector('strong')!; const path = row.querySelector('small')!;\n if (name.textContent !== entry.name) name.textContent = entry.name;\n if (path.textContent !== entry.path) path.textContent = entry.path;\n if (cursor !== row) list.insertBefore(row, cursor); cursor = row.nextElementSibling;\n }\n parts.update(); sync();\n };\n const submit = async (path: string, owner?: number): Promise<void> => {\n if (!options.onSubmit || destroyed || (pending && owner === undefined) || current.disabled || options.unavailable?.() || !path.trim()) return;\n const seq = owner ?? generation.next(); pending = true; current = {...current, error: ''}; sync();\n let result: ActionResult;\n try {result = await options.onSubmit(path.trim());}\n catch (reason) {result = {ok: false, error: reason instanceof Error ? reason.message : String(reason)};}\n if (!generation.current(seq) || (options.dialog && !options.dialog.open)) return;\n pending = false;\n if (result.ok) {lifecycle?.close(); options.onSubmitted?.();}\n else current = {...current, error: result.error};\n sync();\n };\n if (options.onSubmit) life.listen(form, 'submit', (event => {event.preventDefault(); void submit(control.getValue());}) as EventListener);\n if (options.onPick) life.listen(pickButton, 'click', (async () => {\n if (destroyed || pending || current.disabled || options.unavailable?.()) return;\n const seq = generation.next(); pending = true; current = {...current, error: ''}; sync();\n let result: {path?: string; error?: string};\n try {result = await options.onPick!();}\n catch (reason) {result = {error: `${reason instanceof Error ? reason.message : String(reason)} You can enter the path below.`};}\n if (!generation.current(seq) || (options.dialog && !options.dialog.open)) return;\n if (result.error) {pending = false; current = {...current, error: result.error}; sync(); control.focus();}\n else if (result.path) {control.reset(result.path); if (options.onSubmit) await submit(result.path, seq); else {pending = false; sync();}}\n else {pending = false; sync();}\n }) as EventListener);\n life.listen(element, 'click', (event => {\n const target = event.target as Element;\n const selection = target.closest<HTMLButtonElement>('[data-modal-workspace]');\n if (selection && options.onSelect) {event.stopPropagation(); if (!pending && !current.disabled && !options.unavailable?.()) options.onSelect(selection.dataset.modalWorkspace!);}\n if (target.closest('[data-close]')) {generation.invalidate(); pending = false; options.onCancel?.(); lifecycle?.close();}\n }) as EventListener);\n update(initial);\n return {element, input, form, pickButton, update, read: () => ({path: control.getValue()}), reset(path = '') {if (destroyed) return; generation.invalidate(); pending = false; current = {...current, error: ''}; control.reset(path); sync();}, open() {lifecycle?.open();}, close() {generation.invalidate(); pending = false; lifecycle?.close(); sync();}, focus: control.focus, destroy() {if (destroyed) return; destroyed = true; generation.destroy(); life.destroy(); lifecycle?.close(); lifecycle?.destroy(); parts.destroy(); element.remove();}};\n}\n"]}
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../src/navigation/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA,CAAC,EAAC,CAAC;AAC7f,CAAC","sourcesContent":["import {scopeIds} from '../forms/identity.js';\nimport { Lifetime, type ActionResult, type UIBlock } from '../core.js';\nimport {dialogHeading, escape, icon, uniqueId} from '../dom.js';\nimport { adoptProductParts } from '../foundations.js';\nimport { installDialogLifecycle } from '../surface.js';\nimport { createOperation } from '../operation.js';\nimport { reconcileKeyed } from '../reconcile.js';\nexport interface NavigationConversation {id: string; title?: string; active: boolean; menuOpen?: boolean; status?: Node | null}\nexport interface NavigationWorkspace {id: string; name: string; path: string; expanded: boolean; selected: boolean; menuOpen?: boolean; children: readonly NavigationConversation[]}\nexport interface WorkspaceNavigationState {groups: readonly NavigationWorkspace[]; empty: 'workspaces' | 'search' | null; disabled?: boolean}\nexport type WorkspaceNavigationAction =\n | {action: 'add-workspace'; trigger: HTMLButtonElement}\n | {action: 'new-conversation' | 'workspace-menu'; workspaceId: string; trigger: HTMLButtonElement}\n | {action: 'conversation-menu'; conversationId: string; trigger: HTMLButtonElement};\ntype ConversationDOM = {element: HTMLElement; button: HTMLButtonElement; title: HTMLElement; more: HTMLButtonElement; status: Node[]; statusSignature: string; statusSource?: Node | null};\ntype WorkspaceDOM = {element: HTMLElement; heading: HTMLElement; toggle: HTMLButtonElement; title: HTMLElement; more: HTMLButtonElement; create: HTMLButtonElement; children: HTMLElement; empty: HTMLElement};\nexport function createWorkspaceNavigation(initial: WorkspaceNavigationState, options: {element?: HTMLElement; idPrefix?: string; onToggle?: (id: string) => void; onSelect?: (id: string) => void; onAction?: (action: WorkspaceNavigationAction) => void} = {}): UIBlock<WorkspaceNavigationState> {\n const element = options.element || document.createElement('nav');\n if (!options.element) {element.className = 'pui-history-list pui-workspace-navigation'; element.setAttribute('aria-label', 'Workspaces and conversations');}\n const prefix = options.idPrefix ?? uniqueId('pui-nav') + '-';\n const abort = new AbortController(); let destroyed = false;\n const parts = adoptProductParts(element);\n const workspaces = new Map<string, WorkspaceDOM>(); const conversations = new Map<string, ConversationDOM>();\n const emptyWorkspace = document.createElement('button'); emptyWorkspace.type = 'button'; emptyWorkspace.className = 'pui-workspace-item pui-empty-workspace'; emptyWorkspace.dataset.action = 'workspace'; emptyWorkspace.innerHTML = `${icon('folder')}<span>Add a workspace</span>`;\n const emptySearch = document.createElement('p'); emptySearch.className = 'pui-history-empty'; emptySearch.textContent = 'No matching conversations.';\n function createWorkspace(): WorkspaceDOM {\n const root = document.createElement('section'); root.className = 'pui-workspace-group';\n root.innerHTML = `<div class=\"pui-workspace-heading\"><button class=\"pui-workspace-toggle\">${icon('chevron', 'pui-workspace-chevron')}${icon('folder')}<span></span></button><button class=\"pui-quiet-icon pui-workspace-more\" aria-haspopup=\"menu\">${icon('more')}</button><button class=\"pui-quiet-icon pui-workspace-new\" title=\"New conversation\">${icon('compose')}</button></div><div class=\"pui-workspace-children\"></div>`;\n const buttons = root.querySelectorAll<HTMLButtonElement>('button'); const empty = document.createElement('p'); empty.className = 'pui-workspace-empty'; empty.textContent = 'No conversations yet';\n return {element:root,heading:root.firstElementChild as HTMLElement,toggle:buttons[0],title:buttons[0].querySelector('span')!,more:buttons[1],create:buttons[2],children:root.lastElementChild as HTMLElement,empty};\n }\n function createConversation(): ConversationDOM {\n const root = document.createElement('div'); root.className = 'pui-history-row';\n root.innerHTML = `<button class=\"pui-history-item\"><span></span></button><button class=\"pui-quiet-icon pui-history-more\" aria-haspopup=\"menu\">${icon('more')}</button>`;\n const buttons = root.querySelectorAll<HTMLButtonElement>('button'); return {element:root,button:buttons[0],title:buttons[0].querySelector('span')!,more:buttons[1],status:[],statusSignature:''};\n }\n function statusSignature(node?: Node | null): string {\n if (!node) return ''; const holder = document.createElement('div'); holder.append(node.cloneNode(true)); return holder.innerHTML;\n }\n const update = (state: Readonly<WorkspaceNavigationState>) => {\n if (destroyed) return; const currentWorkspaces = new Set<string>(); const currentConversations = new Set<string>(); let groupCursor: Element | null = element.firstElementChild;\n for (const workspace of state.groups) {\n currentWorkspaces.add(workspace.id); let group = workspaces.get(workspace.id); if (!group) {group = createWorkspace(); workspaces.set(workspace.id,group);}\n group.element.setAttribute('aria-label',workspace.name); group.heading.classList.toggle('pui-selected',workspace.selected);\n group.toggle.dataset.toggleWorkspace = workspace.id; group.toggle.setAttribute('aria-expanded',String(workspace.expanded)); group.toggle.setAttribute('aria-controls',prefix+'workspace-children-'+workspace.id); group.toggle.title = workspace.path;\n if (group.title.textContent !== workspace.name) group.title.textContent = workspace.name;\n group.more.id = prefix+'workspace-actions-'+workspace.id; group.more.dataset.workspaceMenu = workspace.id; group.more.setAttribute('aria-label','Actions for workspace '+workspace.name); group.more.setAttribute('aria-expanded',String(!!workspace.menuOpen)); parts.action(group.more).update({disabled: !!state.disabled});\n group.create.dataset.newWorkspace = workspace.id; group.create.setAttribute('aria-label','New conversation in '+workspace.name); parts.action(group.create).update({disabled: !!state.disabled});\n group.children.id = prefix+'workspace-children-'+workspace.id; group.children.hidden = !workspace.expanded; let rowCursor: Element | null = group.children.firstElementChild;\n for (const entry of workspace.children) {\n currentConversations.add(entry.id); let row = conversations.get(entry.id); if (!row) {row = createConversation(); conversations.set(entry.id,row);}\n const title = entry.title || 'Untitled conversation'; row.element.classList.toggle('pui-active',entry.active); row.button.dataset.conversation = entry.id; parts.action(row.button).update({title, disabled: !!state.disabled});\n if (entry.active) row.button.setAttribute('aria-current','page'); else row.button.removeAttribute('aria-current'); if (row.title.textContent !== title) row.title.textContent = title;\n row.more.id = prefix+'conversation-actions-'+entry.id; row.more.dataset.conversationMenu = entry.id; row.more.setAttribute('aria-label','Actions for '+title); row.more.setAttribute('aria-expanded',String(!!entry.menuOpen)); parts.action(row.more).update({disabled: !!state.disabled});\n const signature = entry.status === row.statusSource && entry.status instanceof DocumentFragment && entry.status.childNodes.length === 0 ? row.statusSignature : statusSignature(entry.status);\n row.statusSource = entry.status;\n if (signature !== row.statusSignature) {for (const node of row.status) node.parentNode?.removeChild(node); row.status = entry.status ? entry.status instanceof DocumentFragment ? [...entry.status.childNodes] : [entry.status] : []; row.button.append(...row.status); row.statusSignature = signature;}\n if (row.element !== rowCursor) group.children.insertBefore(row.element,rowCursor); rowCursor = row.element.nextElementSibling;\n }\n if (!workspace.children.length) {if (group.empty.parentElement !== group.children) group.children.append(group.empty);} else group.empty.remove();\n if (group.element !== groupCursor) element.insertBefore(group.element,groupCursor); groupCursor = group.element.nextElementSibling;\n }\n for (const [id,row] of conversations) if (!currentConversations.has(id)) {row.element.remove(); conversations.delete(id);}\n for (const [id,group] of workspaces) if (!currentWorkspaces.has(id)) {group.element.remove(); workspaces.delete(id);}\n if (state.empty === 'workspaces') {if (emptyWorkspace.parentElement !== element) element.append(emptyWorkspace);} else emptyWorkspace.remove();\n parts.action(emptyWorkspace).update({disabled: !!state.disabled});\n if (state.empty === 'search') {if (emptySearch.parentElement !== element) element.append(emptySearch);} else emptySearch.remove();\n parts.update();\n };\n element.addEventListener('click',event => {\n const target = (event.target as Element).closest<HTMLButtonElement>('button'); if (!target || target.disabled) return;\n if (target.dataset.toggleWorkspace && options.onToggle) {event.stopPropagation(); options.onToggle(target.dataset.toggleWorkspace); return;}\n if (target.dataset.conversation && options.onSelect) {event.stopPropagation(); options.onSelect(target.dataset.conversation); return;}\n const action: WorkspaceNavigationAction | undefined = target === emptyWorkspace ? {action:'add-workspace',trigger:target}\n : target.dataset.newWorkspace ? {action:'new-conversation',workspaceId:target.dataset.newWorkspace,trigger:target}\n : target.dataset.workspaceMenu ? {action:'workspace-menu',workspaceId:target.dataset.workspaceMenu,trigger:target}\n : target.dataset.conversationMenu ? {action:'conversation-menu',conversationId:target.dataset.conversationMenu,trigger:target} : undefined;\n if (action && options.onAction) {event.stopPropagation(); options.onAction(action);}\n },{signal:abort.signal});\n update(initial); return {element,update,destroy() {if (destroyed) return; destroyed = true; abort.abort(); parts.destroy(); workspaces.clear(); conversations.clear(); if (!options.element) element.remove();}};\n}\nexport interface RenameConversationState {id: string; title: string; error?: string; disabled?: boolean}\nexport interface RenameConversationDraft {id: string; title: string}\nexport interface RenameConversationOptions {\n idPrefix?: string;\n dialog?: HTMLDialogElement;\n unavailable?: () => boolean;\n onSubmit?: (draft: RenameConversationDraft) => Promise<ActionResult> | ActionResult;\n onSubmitted?: () => void;\n onCancel?: () => void;\n}\nexport interface RenameConversationBlock extends UIBlock<RenameConversationState> {\n readonly input: HTMLInputElement;\n readonly form: HTMLFormElement;\n read(): RenameConversationDraft;\n reset(state: RenameConversationState): void;\n open(state?: RenameConversationState): void;\n close(): void;\n focus(): void;\n}\nexport function createRenameConversation(initial: RenameConversationState, options: RenameConversationOptions = {}): RenameConversationBlock {\n const state = initial; const element = document.createElement('div'); element.className = 'pui-rename-conversation'; element.innerHTML = `${dialogHeading('Rename conversation', 'rename-title', 'rename-dialog', 'CONVERSATION')}<form id=\"rename-form\"><label class=\"pui-field-label\" for=\"conversation-title\">Title</label><input id=\"conversation-title\" name=\"title\" value=\"${escape(state.title)}\" required autocomplete=\"off\" /><div id=\"rename-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button type=\"button\" class=\"pui-secondary-button\" data-close=\"rename-dialog\">Cancel</button><button type=\"submit\" class=\"pui-primary-button\" data-idle-action data-idle-conversation=\"${escape(state.id)}\">Save title</button></div></form>`;\n const input = element.querySelector<HTMLInputElement>('#conversation-title')!; const form = element.querySelector<HTMLFormElement>('#rename-form')!; const error = element.querySelector<HTMLElement>('#rename-error')!;\n scopeIds(element, options.idPrefix ?? uniqueId('pui-rename') + '-');\n const parts = adoptProductParts(element); const control = parts.control(input); const feedback = parts.feedback(error);\n const button = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]')!; const action = parts.action(button);\n const life = new Lifetime();\n let current = initial; let targetId = initial.id; let destroyed = false;\n const sync = () => {action.update({disabled: !!current.disabled || !!options.unavailable?.(), pending:operation.pending}); feedback.update({message: current.error || '', tone: 'error'});};\n const operation = createOperation({unavailable:()=>destroyed || !!current.disabled || !!options.unavailable?.(),onPending:sync,onError(message) {current={...current,error:message};sync();}});\n const lifecycle = options.dialog ? installDialogLifecycle(options.dialog, {onOpen() {operation.invalidate();}, onClose() {operation.invalidate();}}) : undefined;\n const update = (next: Readonly<RenameConversationState>) => {if (destroyed) return; current = {...next, error: next.error ?? current.error}; sync();};\n const reset = (next: RenameConversationState) => {if (destroyed) return; operation.invalidate(); targetId = next.id; current = next; control.reset(next.title); button.dataset.idleConversation = next.id; sync();};\n const close = () => {operation.invalidate(); lifecycle?.close();};\n if (options.onSubmit) life.listen(form, 'submit', (event => {\n event.preventDefault();\n const title = control.getValue().trim();\n if (!title) return;\n operation.run(()=>{current = {...current, error: ''}; sync(); return options.onSubmit!({id: targetId, title});},result=>{\n if (options.dialog && !options.dialog.open) return;\n if (result.ok) {lifecycle?.close(); options.onSubmitted?.();}\n else current = {...current, error: result.error};\n sync();\n });\n }) as EventListener);\n life.listen(element, 'click', (event => {if ((event.target as Element).closest('[data-close]')) {operation.invalidate(); options.onCancel?.(); lifecycle?.close();}}) as EventListener);\n update(initial);\n return {element, input, form, update, read: () => ({id: targetId, title: control.getValue()}), reset, open(next) {if (next) reset(next); lifecycle?.open(); input.select();}, close, focus() {input.select();}, destroy() {if (destroyed) return; destroyed = true; operation.destroy(); life.destroy(); lifecycle?.close(); lifecycle?.destroy(); parts.destroy(); element.remove();}};\n}\nexport interface WorkspacePickerState {workspaces: readonly {id: string; name: string; path: string}[]; error?: string; disabled?: boolean}\nexport interface WorkspacePickerOptions {\n idPrefix?: string;\n dialog?: HTMLDialogElement;\n unavailable?: () => boolean;\n onSubmit?: (path: string) => Promise<ActionResult> | ActionResult;\n onPick?: () => Promise<{path?: string; error?: string}>;\n onSelect?: (id: string) => void;\n onSubmitted?: () => void;\n onCancel?: () => void;\n}\nexport interface WorkspacePickerBlock extends UIBlock<WorkspacePickerState> {\n readonly input: HTMLInputElement;\n readonly form: HTMLFormElement;\n readonly pickButton: HTMLButtonElement;\n read(): {path: string};\n reset(path?: string): void;\n open(): void;\n close(): void;\n focus(): void;\n}\nexport function createWorkspacePicker(initial: WorkspacePickerState, options: WorkspacePickerOptions = {}): WorkspacePickerBlock {\n const state = initial; const element = document.createElement('div'); element.className = 'pui-workspace-picker'; element.innerHTML = `${dialogHeading('Workspaces', 'workspace-title', 'workspace-dialog', 'A PLACE TO WORK')}<p class=\"pui-modal-description\">Choose a local folder. Conversations belong to a workspace, so Pith knows where to read and create files.</p><div class=\"pui-modal-workspaces\">${state.workspaces.map((entry) => `<button class=\"pui-modal-workspace\" data-modal-workspace=\"${escape(entry.id)}\">${icon('folder')}<span><strong>${escape(entry.name)}</strong><small>${escape(entry.path)}</small></span>${icon('chevron')}</button>`).join('')}</div><div class=\"pui-workspace-add\"><button class=\"pui-picker-button\" id=\"pick-folder\" type=\"button\">${icon('folder')}Choose a folder…</button><div class=\"pui-path-divider\"><span>or enter a folder path</span></div><form id=\"workspace-form\"><label class=\"pui-sr-only\" for=\"workspace-path\">Absolute folder path</label><input id=\"workspace-path\" name=\"path\" placeholder=\"/Users/you/Documents/my-work\" required autocomplete=\"off\" spellcheck=\"false\" /><p class=\"pui-field-hint\">Use an existing folder on this computer. Pith will work inside it.</p><div id=\"workspace-error\" class=\"pui-form-error\" role=\"alert\"></div><div class=\"pui-modal-footer\"><button class=\"pui-secondary-button\" type=\"button\" data-close=\"workspace-dialog\">Cancel</button><button class=\"pui-primary-button\" id=\"add-workspace\" type=\"submit\">Add workspace</button></div></form></div>`;\n const input = element.querySelector<HTMLInputElement>('#workspace-path')!; const form = element.querySelector<HTMLFormElement>('#workspace-form')!; const pickButton = element.querySelector<HTMLButtonElement>('#pick-folder')!; const error = element.querySelector<HTMLElement>('#workspace-error')!;\n scopeIds(element, options.idPrefix ?? uniqueId('pui-workspace') + '-');\n const list = element.querySelector<HTMLElement>('.pui-modal-workspaces')!;\n const rows = new Map([...list.querySelectorAll<HTMLButtonElement>('[data-modal-workspace]')].map(row => [row.dataset.modalWorkspace!, row]));\n const parts = adoptProductParts(element); const control = parts.control(input); const feedback = parts.feedback(error);\n const submitButton = form.querySelector<HTMLButtonElement>('button[type=\"submit\"]')!;\n const life = new Lifetime();\n let current = initial; let destroyed = false;\n const unavailable = () => destroyed || !!current.disabled || !!options.unavailable?.();\n const sync = () => {const disabled = unavailable(), pending = pickOperation.pending || submitOperation.pending; parts.action(submitButton).update({disabled, pending}); parts.action(pickButton).update({disabled, pending}); for (const row of rows.values()) parts.action(row).update({disabled: disabled || pending}); feedback.update({message: current.error || '', tone: 'error'});};\n const fail = (message: string) => {current={...current,error:message};sync();};\n const pickOperation = createOperation({unavailable:()=>unavailable() || submitOperation.pending,onPending:sync,onError(message) {fail(`${message} You can enter the path below.`);control.focus();}});\n const submitOperation = createOperation({unavailable:()=>unavailable() || pickOperation.pending,onPending:sync,onError:fail});\n const invalidate = () => {pickOperation.invalidate();submitOperation.invalidate();};\n const lifecycle = options.dialog ? installDialogLifecycle(options.dialog, {onOpen:invalidate,onClose:invalidate}) : undefined;\n const update = (next: Readonly<WorkspacePickerState>) => {\n if (destroyed) return; current = {...next, error: next.error ?? current.error};\n reconcileKeyed(list,rows,next.workspaces,{key:entry=>entry.id,element:row=>row,\n create(entry) {const row=document.createElement('button'); row.type = 'button'; row.className = 'pui-modal-workspace'; row.dataset.modalWorkspace = entry.id; row.innerHTML = `${icon('folder')}<span><strong></strong><small></small></span>${icon('chevron')}`;return row;},\n update(row,entry) {\n const name = row.querySelector('strong')!; const path = row.querySelector('small')!;\n if (name.textContent !== entry.name) name.textContent = entry.name;\n if (path.textContent !== entry.path) path.textContent = entry.path;\n },destroy() {},\n });\n parts.update(); sync();\n };\n const submit = (path: string): void => {\n if (!options.onSubmit || !path.trim()) return;\n submitOperation.run(()=>{current = {...current, error: ''}; sync(); return options.onSubmit!(path.trim());},result=>{\n if (options.dialog && !options.dialog.open) return;\n if (result.ok) {lifecycle?.close(); options.onSubmitted?.();}\n else current = {...current, error: result.error};\n sync();\n });\n };\n if (options.onSubmit) life.listen(form, 'submit', (event => {event.preventDefault(); void submit(control.getValue());}) as EventListener);\n if (options.onPick) life.listen(pickButton, 'click', (() => {\n pickOperation.run(()=>{current = {...current, error: ''}; sync(); return options.onPick!();},result=>{\n // End the picker ownership before handing a valid path to submission.\n // A newly disabled target can refuse the write without retaining pending.\n pickOperation.invalidate();\n if (options.dialog && !options.dialog.open) return;\n if (result.error) {fail(result.error);control.focus();}\n else if (result.path) {control.reset(result.path);submit(result.path);}\n });\n }) as EventListener);\n life.listen(element, 'click', (event => {\n const target = event.target as Element;\n const selection = target.closest<HTMLButtonElement>('[data-modal-workspace]');\n if (selection && options.onSelect) {event.stopPropagation(); if (!pickOperation.pending && !submitOperation.pending && !unavailable()) options.onSelect(selection.dataset.modalWorkspace!);}\n if (target.closest('[data-close]')) {invalidate(); options.onCancel?.(); lifecycle?.close();}\n }) as EventListener);\n update(initial);\n return {element, input, form, pickButton, update, read: () => ({path: control.getValue()}), reset(path = '') {if (destroyed) return; invalidate(); current = {...current, error: ''}; control.reset(path); sync();}, open() {lifecycle?.open();}, close() {invalidate(); lifecycle?.close();}, focus: control.focus, destroy() {if (destroyed) return; destroyed = true; pickOperation.destroy(); submitOperation.destroy(); life.destroy(); lifecycle?.close(); lifecycle?.destroy(); parts.destroy(); element.remove();}};\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** One owned operation. Invalidating UI never retries or cancels a business write. */
|
|
2
|
+
export declare function createOperation(options?: {
|
|
3
|
+
unavailable?: () => boolean;
|
|
4
|
+
onPending?: (pending: boolean) => void;
|
|
5
|
+
onError?: (message: string) => void;
|
|
6
|
+
}): {
|
|
7
|
+
readonly pending: boolean;
|
|
8
|
+
run<Value>(task: () => Value | PromiseLike<Value>, onResult?: (value: Value) => void): boolean;
|
|
9
|
+
invalidate(): void;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,OAAO,GAAE;IACvC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;sBAKa,OAAO;QAClB,KAAK,QAAQ,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO;kBAchF,IAAI;eACP,IAAI;EAElB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Generation } from './core.js';
|
|
2
|
+
/** One owned operation. Invalidating UI never retries or cancels a business write. */
|
|
3
|
+
export function createOperation(options = {}) {
|
|
4
|
+
const generation = new Generation();
|
|
5
|
+
let pending = false, disposed = false;
|
|
6
|
+
const message = (error) => error instanceof Error ? error.message : String(error);
|
|
7
|
+
return {
|
|
8
|
+
get pending() { return pending; },
|
|
9
|
+
run(task, onResult) {
|
|
10
|
+
if (disposed || pending || options.unavailable?.())
|
|
11
|
+
return false;
|
|
12
|
+
const sequence = generation.next();
|
|
13
|
+
pending = true;
|
|
14
|
+
options.onPending?.(true);
|
|
15
|
+
const finish = () => { if (generation.current(sequence)) {
|
|
16
|
+
pending = false;
|
|
17
|
+
options.onPending?.(false);
|
|
18
|
+
} };
|
|
19
|
+
const complete = (value) => { if (generation.current(sequence))
|
|
20
|
+
onResult?.(value); };
|
|
21
|
+
const fail = (error) => { if (generation.current(sequence))
|
|
22
|
+
options.onError?.(message(error)); };
|
|
23
|
+
try {
|
|
24
|
+
const result = task();
|
|
25
|
+
if (result != null && typeof result === 'object' && 'then' in result) {
|
|
26
|
+
void Promise.resolve(result).then(complete).catch(fail).finally(finish);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
complete(result);
|
|
30
|
+
finish();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
try {
|
|
35
|
+
fail(error);
|
|
36
|
+
}
|
|
37
|
+
finally {
|
|
38
|
+
finish();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
},
|
|
43
|
+
invalidate() { if (disposed)
|
|
44
|
+
return; generation.invalidate(); pending = false; options.onPending?.(false); },
|
|
45
|
+
destroy() { if (disposed)
|
|
46
|
+
return; disposed = true; generation.destroy(); pending = false; },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,sFAAsF;AACtF,MAAM,UAAU,eAAe,CAAC,UAI5B,EAAE;IACJ,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,IAAI,OAAO,GAAG,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAC;IACtC,MAAM,OAAO,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3F,OAAO;QACL,IAAI,OAAO,KAAc,OAAO,OAAO,CAAC,CAAC,CAAC;QAC1C,GAAG,CAAQ,IAAsC,EAAE,QAAiC;YAClF,IAAI,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE;gBAAE,OAAO,KAAK,CAAC;YACjE,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;YAAC,OAAO,GAAG,IAAI,CAAC;YAAC,OAAO,CAAC,SAAS,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KAAW,IAAI,QAAQ;YAAE,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClH,OAAO,KAAW,IAAI,QAAQ;YAAE,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;KAClG,CAAC;AACJ,CAAC","sourcesContent":["import { Generation } from './core.js';\n\n/** One owned operation. Invalidating UI never retries or cancels a business write. */\nexport function createOperation(options: {\n unavailable?: () => boolean;\n onPending?: (pending: boolean) => void;\n onError?: (message: string) => void;\n} = {}) {\n const generation = new Generation();\n let pending = false, disposed = false;\n const message = (error: unknown) => error instanceof Error ? error.message : String(error);\n return {\n get pending(): boolean { return pending; },\n run<Value>(task: () => Value | PromiseLike<Value>, onResult?: (value: Value) => void): boolean {\n if (disposed || pending || options.unavailable?.()) return false;\n const sequence = generation.next(); pending = true; options.onPending?.(true);\n const finish = () => { if (generation.current(sequence)) { pending = false; options.onPending?.(false); } };\n const complete = (value: Value) => { if (generation.current(sequence)) onResult?.(value); };\n const fail = (error: unknown) => { if (generation.current(sequence)) options.onError?.(message(error)); };\n try {\n const result = task();\n if (result != null && typeof result === 'object' && 'then' in result) {\n void Promise.resolve(result).then(complete).catch(fail).finally(finish);\n } else { complete(result as Value); finish(); }\n } catch (error) { try { fail(error); } finally { finish(); } }\n return true;\n },\n invalidate(): void { if (disposed) return; generation.invalidate(); pending = false; options.onPending?.(false); },\n destroy(): void { if (disposed) return; disposed = true; generation.destroy(); pending = false; },\n };\n}\n"]}
|