@symbiotejs/symbiote 3.9.0 → 3.10.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/README.md +12 -0
- package/core/AppRouter.js +97 -58
- package/core/PubSub.js +42 -11
- package/core/Symbiote.js +70 -46
- package/core/itemizeProcessor-keyed.js +88 -188
- package/core/itemizeProcessor.js +1 -12
- package/core/itemizeSetup.js +26 -3
- package/core/ownElements.js +1 -4
- package/core/resolveTemplate.js +12 -0
- package/core/tpl-processors.js +1 -2
- package/docs/README.md +2 -0
- package/docs/html-app-vs-htmx.md +55 -0
- package/docs/lifecycle.md +2 -0
- package/docs/list-rendering.md +10 -2
- package/docs/pubsub.md +3 -0
- package/docs/routing.md +15 -4
- package/html-app/BaseClass.js +203 -0
- package/html-app/README.md +369 -0
- package/html-app/action-data.js +168 -0
- package/html-app/actions.js +366 -0
- package/html-app/collection-actions.js +104 -0
- package/html-app/collection-data.js +234 -0
- package/html-app/collection-items.js +45 -0
- package/html-app/conditions.js +42 -0
- package/html-app/context-data.js +185 -0
- package/html-app/context-requests.js +374 -0
- package/html-app/context-storage.js +376 -0
- package/html-app/declarations.js +55 -0
- package/html-app/examples/assets/actions.html +56 -0
- package/html-app/examples/assets/collections.html +72 -0
- package/html-app/examples/assets/components.html +25 -0
- package/html-app/examples/assets/conditional.html +29 -0
- package/html-app/examples/assets/data.html +31 -0
- package/html-app/examples/assets/guide.html +4 -0
- package/html-app/examples/assets/imports.html +11 -0
- package/html-app/examples/assets/not-found.html +4 -0
- package/html-app/examples/assets/routes.json +58 -0
- package/html-app/examples/assets/routing.html +27 -0
- package/html-app/examples/assets/state.html +32 -0
- package/html-app/examples/assets/storage.html +28 -0
- package/html-app/examples/assets/tasks.json +25 -0
- package/html-app/examples/full-app.html +147 -0
- package/html-app/examples/todo-ref.html +37 -0
- package/html-app/fetch-source.js +147 -0
- package/html-app/fragment-content.js +29 -0
- package/html-app/fragment-source.js +169 -0
- package/html-app/index.js +34 -0
- package/html-app/initial-data.js +88 -0
- package/html-app/pub-map.js +93 -0
- package/html-app/router-data.js +50 -0
- package/html-app/router-navigation.js +70 -0
- package/html-app/storage-revisions.js +130 -0
- package/html-app/sym-collection.js +142 -0
- package/html-app/sym-component.js +20 -0
- package/html-app/sym-conditional.js +141 -0
- package/html-app/sym-context.js +176 -0
- package/html-app/sym-import.js +218 -0
- package/html-app/sym-router.js +107 -0
- package/package.json +18 -6
- package/scripts/check-html-app-package.js +117 -0
- package/scripts/check-html-app-size.js +91 -0
- package/scripts/update-exports.js +4 -0
- package/skills/symbiote/SKILL.md +64 -15
- package/skills/symbiote/agents/openai.yaml +1 -1
- package/types/core/AppRouter.d.ts +13 -4
- package/types/core/AppRouter.d.ts.map +1 -1
- package/types/core/PubSub.d.ts +1 -1
- package/types/core/PubSub.d.ts.map +1 -1
- package/types/core/Symbiote.d.ts +4 -1
- package/types/core/Symbiote.d.ts.map +1 -1
- package/types/core/itemizeProcessor-keyed.d.ts.map +1 -1
- package/types/core/itemizeProcessor.d.ts.map +1 -1
- package/types/core/itemizeSetup.d.ts +1 -0
- package/types/core/itemizeSetup.d.ts.map +1 -1
- package/types/core/ownElements.d.ts +1 -1
- package/types/core/ownElements.d.ts.map +1 -1
- package/types/core/resolveTemplate.d.ts +2 -0
- package/types/core/resolveTemplate.d.ts.map +1 -0
- package/types/core/tpl-processors.d.ts.map +1 -1
- package/types/html-app/BaseClass.d.ts +24 -0
- package/types/html-app/BaseClass.d.ts.map +1 -0
- package/types/html-app/action-data.d.ts +15 -0
- package/types/html-app/action-data.d.ts.map +1 -0
- package/types/html-app/actions.d.ts +104 -0
- package/types/html-app/actions.d.ts.map +1 -0
- package/types/html-app/collection-actions.d.ts +12 -0
- package/types/html-app/collection-actions.d.ts.map +1 -0
- package/types/html-app/collection-data.d.ts +13 -0
- package/types/html-app/collection-data.d.ts.map +1 -0
- package/types/html-app/collection-items.d.ts +7 -0
- package/types/html-app/collection-items.d.ts.map +1 -0
- package/types/html-app/conditions.d.ts +5 -0
- package/types/html-app/conditions.d.ts.map +1 -0
- package/types/html-app/context-data.d.ts +31 -0
- package/types/html-app/context-data.d.ts.map +1 -0
- package/types/html-app/context-requests.d.ts +97 -0
- package/types/html-app/context-requests.d.ts.map +1 -0
- package/types/html-app/context-storage.d.ts +102 -0
- package/types/html-app/context-storage.d.ts.map +1 -0
- package/types/html-app/declarations.d.ts +3 -0
- package/types/html-app/declarations.d.ts.map +1 -0
- package/types/html-app/fetch-source.d.ts +23 -0
- package/types/html-app/fetch-source.d.ts.map +1 -0
- package/types/html-app/fragment-content.d.ts +6 -0
- package/types/html-app/fragment-content.d.ts.map +1 -0
- package/types/html-app/fragment-source.d.ts +14 -0
- package/types/html-app/fragment-source.d.ts.map +1 -0
- package/types/html-app/index.d.ts +9 -0
- package/types/html-app/index.d.ts.map +1 -0
- package/types/html-app/initial-data.d.ts +8 -0
- package/types/html-app/initial-data.d.ts.map +1 -0
- package/types/html-app/pub-map.d.ts +19 -0
- package/types/html-app/pub-map.d.ts.map +1 -0
- package/types/html-app/router-data.d.ts +4 -0
- package/types/html-app/router-data.d.ts.map +1 -0
- package/types/html-app/router-navigation.d.ts +3 -0
- package/types/html-app/router-navigation.d.ts.map +1 -0
- package/types/html-app/storage-revisions.d.ts +11 -0
- package/types/html-app/storage-revisions.d.ts.map +1 -0
- package/types/html-app/sym-collection.d.ts +16 -0
- package/types/html-app/sym-collection.d.ts.map +1 -0
- package/types/html-app/sym-component.d.ts +5 -0
- package/types/html-app/sym-component.d.ts.map +1 -0
- package/types/html-app/sym-conditional.d.ts +10 -0
- package/types/html-app/sym-conditional.d.ts.map +1 -0
- package/types/html-app/sym-context.d.ts +16 -0
- package/types/html-app/sym-context.d.ts.map +1 -0
- package/types/html-app/sym-import.d.ts +19 -0
- package/types/html-app/sym-import.d.ts.map +1 -0
- package/types/html-app/sym-router.d.ts +12 -0
- package/types/html-app/sym-router.d.ts.map +1 -0
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { cloneData, recordData } from './collection-data.js';
|
|
2
|
+
import { isDataKey } from './initial-data.js';
|
|
3
|
+
import { requestLimits, SourceError } from './fetch-source.js';
|
|
4
|
+
import { commitStorageRevision } from './storage-revisions.js';
|
|
5
|
+
|
|
6
|
+
export let storageSignals = Object.freeze([
|
|
7
|
+
'storageFound',
|
|
8
|
+
'storageDirty',
|
|
9
|
+
'storageConflict',
|
|
10
|
+
'storageError',
|
|
11
|
+
'storageErrorMessage',
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
export class ContextStorage {
|
|
15
|
+
connected = false;
|
|
16
|
+
key = '';
|
|
17
|
+
fields = [];
|
|
18
|
+
/** @type {string | null | undefined} */
|
|
19
|
+
baseline;
|
|
20
|
+
/** @type {Map<string, number>} */
|
|
21
|
+
savedVersions = new Map();
|
|
22
|
+
/** @type {Set<string>} */
|
|
23
|
+
restored = new Set();
|
|
24
|
+
conflict = false;
|
|
25
|
+
/** @type {{ operation: string, code: string, message: string, status: null } | null} */
|
|
26
|
+
error = null;
|
|
27
|
+
/** @type {AbortController | undefined} */
|
|
28
|
+
controller;
|
|
29
|
+
/** @type {ReturnType<ContextStorage['performPersist']> | undefined} */
|
|
30
|
+
saving;
|
|
31
|
+
scheduled = false;
|
|
32
|
+
|
|
33
|
+
/** @param {import('./sym-context.js').SymContext} owner */
|
|
34
|
+
constructor(owner) {
|
|
35
|
+
this.owner = owner;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
status() {
|
|
39
|
+
return {
|
|
40
|
+
storageFound: typeof this.baseline === 'string',
|
|
41
|
+
storageDirty: this.fields.some((key) => !this.savedVersions.has(key)
|
|
42
|
+
|| this.savedVersions.get(key) !== (this.owner.contextData.versions.get(key) ?? 0)
|
|
43
|
+
|| this.owner.contextData.pending.has(key)),
|
|
44
|
+
storageConflict: this.conflict,
|
|
45
|
+
storageError: this.error,
|
|
46
|
+
storageErrorMessage: this.error?.message ?? '',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
connect() {
|
|
51
|
+
if (globalThis.__SYMBIOTE_SSR) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.connected = true;
|
|
55
|
+
this.owner.ownerDocument.defaultView.addEventListener('storage', this.onStorage);
|
|
56
|
+
let key = this.owner.getAttribute('storage-key');
|
|
57
|
+
let fields = this.owner.getAttribute('storage-keys')?.split(',').map((field) => field.trim());
|
|
58
|
+
if (this.key && this.key === key && this.baseline !== undefined
|
|
59
|
+
&& fields?.length === this.fields.length && fields.every((field, index) => field === this.fields[index])) {
|
|
60
|
+
try {
|
|
61
|
+
this.conflict = this.storage().getItem(this.key) !== this.baseline;
|
|
62
|
+
this.owner.requests.publish();
|
|
63
|
+
} catch (failure) {
|
|
64
|
+
this.fail('restore', failure);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
this.configure();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
disconnect() {
|
|
72
|
+
this.connected = false;
|
|
73
|
+
this.scheduled = false;
|
|
74
|
+
this.controller?.abort();
|
|
75
|
+
this.controller = undefined;
|
|
76
|
+
this.saving = undefined;
|
|
77
|
+
this.owner.ownerDocument.defaultView?.removeEventListener('storage', this.onStorage);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
configure() {
|
|
81
|
+
if (!this.connected || !this.owner.requests.ready) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.controller?.abort();
|
|
85
|
+
this.controller = undefined;
|
|
86
|
+
this.saving = undefined;
|
|
87
|
+
if (this.scheduled) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Coalesce attribute pairs; connect restores synchronously before src starts.
|
|
91
|
+
this.reset();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
schedule() {
|
|
95
|
+
if (!this.connected || this.scheduled) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.controller?.abort();
|
|
99
|
+
this.scheduled = true;
|
|
100
|
+
queueMicrotask(() => {
|
|
101
|
+
if (this.scheduled && this.connected) {
|
|
102
|
+
this.scheduled = false;
|
|
103
|
+
this.configure();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
reset() {
|
|
109
|
+
this.key = '';
|
|
110
|
+
this.fields = [];
|
|
111
|
+
this.baseline = undefined;
|
|
112
|
+
this.savedVersions.clear();
|
|
113
|
+
this.restored.clear();
|
|
114
|
+
this.conflict = false;
|
|
115
|
+
this.error = null;
|
|
116
|
+
let key = this.owner.getAttribute('storage-key');
|
|
117
|
+
let fields = this.owner.getAttribute('storage-keys');
|
|
118
|
+
try {
|
|
119
|
+
if (key !== null || fields !== null) {
|
|
120
|
+
let selected = fields?.split(',').map((field) => field.trim()) ?? [];
|
|
121
|
+
if (!key?.trim() || !selected.length || new Set(selected).size !== selected.length
|
|
122
|
+
|| selected.some((field) => !isDataKey(field))) {
|
|
123
|
+
throw new SourceError('INVALID_CONFIG', 'Browser storage requires storage-key and explicit unique storage-keys.');
|
|
124
|
+
}
|
|
125
|
+
this.key = key;
|
|
126
|
+
this.fields = selected;
|
|
127
|
+
this.restore(false);
|
|
128
|
+
}
|
|
129
|
+
} catch (failure) {
|
|
130
|
+
this.fail('restore', failure);
|
|
131
|
+
}
|
|
132
|
+
this.owner.requests.publish();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** @param {StorageEvent} event */
|
|
136
|
+
onStorage = (event) => {
|
|
137
|
+
if (!this.key || (event.key !== null && event.key !== this.key)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
if (event.storageArea === this.storage()) {
|
|
142
|
+
this.conflict = this.storage().getItem(this.key) !== this.baseline;
|
|
143
|
+
this.owner.requests.publish();
|
|
144
|
+
}
|
|
145
|
+
} catch (failure) {
|
|
146
|
+
this.fail('restore', failure);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
storage() {
|
|
151
|
+
return this.owner.ownerDocument.defaultView.localStorage;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** @param {string | null} raw */
|
|
155
|
+
envelope(raw) {
|
|
156
|
+
if (raw === null) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
if (new TextEncoder().encode(raw).byteLength > requestLimits(this.owner).maxBytes) {
|
|
160
|
+
throw new SourceError('TOO_LARGE', 'The stored envelope exceeds max-bytes.');
|
|
161
|
+
}
|
|
162
|
+
let envelope;
|
|
163
|
+
try {
|
|
164
|
+
envelope = recordData(JSON.parse(raw));
|
|
165
|
+
} catch {
|
|
166
|
+
throw new SourceError('INVALID_STORAGE', 'The stored envelope must contain valid JSON data.');
|
|
167
|
+
}
|
|
168
|
+
if (envelope.version !== 1 || typeof envelope.revision !== 'string' || !envelope.revision
|
|
169
|
+
|| !Array.isArray(envelope.keys) || envelope.keys.length !== this.fields.length
|
|
170
|
+
|| new Set(envelope.keys).size !== this.fields.length
|
|
171
|
+
|| this.fields.some((key) => !envelope.keys.includes(key))) {
|
|
172
|
+
throw new SourceError('INCOMPATIBLE_STORAGE', 'The stored version or selected fields do not match this context.');
|
|
173
|
+
}
|
|
174
|
+
let data = recordData(envelope.data);
|
|
175
|
+
if (Object.keys(data).length !== this.fields.length || this.fields.some((key) => !Object.hasOwn(data, key))) {
|
|
176
|
+
throw new SourceError('INCOMPATIBLE_STORAGE', 'Stored data must match storage-keys exactly.');
|
|
177
|
+
}
|
|
178
|
+
this.owner.contextData.validate(data);
|
|
179
|
+
return data;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Startup protects drafts; the explicit restore action accepts saved fields.
|
|
184
|
+
* @param {boolean} [replace]
|
|
185
|
+
*/
|
|
186
|
+
restore(replace = true) {
|
|
187
|
+
if (!this.connected || !this.owner.isConnected) {
|
|
188
|
+
return {
|
|
189
|
+
ok: false,
|
|
190
|
+
cancelled: true,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
this.controller?.abort();
|
|
194
|
+
this.controller = undefined;
|
|
195
|
+
this.saving = undefined;
|
|
196
|
+
try {
|
|
197
|
+
this.requireConfig();
|
|
198
|
+
let raw = this.storage().getItem(this.key);
|
|
199
|
+
let data = this.envelope(raw);
|
|
200
|
+
this.error = null;
|
|
201
|
+
/** @type {Record<string, unknown>} */
|
|
202
|
+
let accepted = {};
|
|
203
|
+
let state = this.owner.contextData;
|
|
204
|
+
for (let key of Object.keys(data ?? {})) {
|
|
205
|
+
if (!state.bound.has(key) && (replace || (!state.edited.has(key) && !state.pending.has(key)))) {
|
|
206
|
+
accepted[key] = data[key];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
this.owner.mergeSource(cloneData(accepted));
|
|
210
|
+
this.savedVersions.clear();
|
|
211
|
+
for (let key of Object.keys(accepted)) {
|
|
212
|
+
this.restored.add(key);
|
|
213
|
+
state.edited.add(key);
|
|
214
|
+
this.savedVersions.set(key, state.versions.get(key) ?? 0);
|
|
215
|
+
}
|
|
216
|
+
this.baseline = raw;
|
|
217
|
+
this.conflict = false;
|
|
218
|
+
this.owner.requests.publish();
|
|
219
|
+
let result = {
|
|
220
|
+
ok: true,
|
|
221
|
+
operation: 'restore',
|
|
222
|
+
found: data !== null,
|
|
223
|
+
applied: Object.keys(accepted),
|
|
224
|
+
retained: this.fields.filter((key) => data && !Object.hasOwn(accepted, key)),
|
|
225
|
+
};
|
|
226
|
+
this.owner.dispatchEvent(new CustomEvent('restore', {
|
|
227
|
+
detail: result,
|
|
228
|
+
}));
|
|
229
|
+
return result;
|
|
230
|
+
} catch (failure) {
|
|
231
|
+
return this.fail('restore', failure);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
requireConfig() {
|
|
236
|
+
if (!this.key || !this.fields.length) {
|
|
237
|
+
throw new SourceError('INVALID_CONFIG', 'Browser storage requires storage-key and storage-keys.');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** @param {boolean} [overwrite] */
|
|
242
|
+
persist(overwrite = false) {
|
|
243
|
+
if (this.saving) {
|
|
244
|
+
return this.saving;
|
|
245
|
+
}
|
|
246
|
+
let saving = this.performPersist(overwrite);
|
|
247
|
+
this.saving = saving;
|
|
248
|
+
void saving.finally(() => {
|
|
249
|
+
if (this.saving === saving) {
|
|
250
|
+
this.saving = undefined;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
return saving;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** @param {boolean} overwrite */
|
|
257
|
+
async performPersist(overwrite) {
|
|
258
|
+
if (!this.connected || !this.owner.isConnected || globalThis.__SYMBIOTE_SSR) {
|
|
259
|
+
return {
|
|
260
|
+
ok: false,
|
|
261
|
+
cancelled: true,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
let controller = new AbortController();
|
|
265
|
+
this.controller = controller;
|
|
266
|
+
try {
|
|
267
|
+
this.requireConfig();
|
|
268
|
+
let locks = this.owner.ownerDocument.defaultView.navigator.locks;
|
|
269
|
+
if (!locks) {
|
|
270
|
+
throw new SourceError('LOCK_UNAVAILABLE', 'Browser persistence requires Web Locks in a secure context.');
|
|
271
|
+
}
|
|
272
|
+
this.error = null;
|
|
273
|
+
this.owner.requests.publish();
|
|
274
|
+
return await locks.request('symbiote:html-app:storage:' + this.key, {
|
|
275
|
+
signal: controller.signal,
|
|
276
|
+
}, () => {
|
|
277
|
+
if (this.controller !== controller || !this.owner.isConnected) {
|
|
278
|
+
return {
|
|
279
|
+
ok: false,
|
|
280
|
+
cancelled: true,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
let storage = this.storage();
|
|
284
|
+
let current = storage.getItem(this.key);
|
|
285
|
+
if (!overwrite) {
|
|
286
|
+
this.envelope(current);
|
|
287
|
+
if (current !== this.baseline) {
|
|
288
|
+
this.conflict = true;
|
|
289
|
+
throw new SourceError('STORAGE_CONFLICT', 'Stored data changed; explicitly restore it or overwrite it with this draft.');
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (this.fields.some((key) => this.owner.contextData.pending.has(key))) {
|
|
293
|
+
throw new SourceError('PENDING_DRAFT', 'Submit the editing form or finish pending edits before persisting.');
|
|
294
|
+
}
|
|
295
|
+
let snapshot = this.owner.contextData.snapshot(this.fields);
|
|
296
|
+
let revision = crypto.randomUUID();
|
|
297
|
+
let raw = JSON.stringify({
|
|
298
|
+
version: 1,
|
|
299
|
+
revision,
|
|
300
|
+
keys: this.fields,
|
|
301
|
+
data: snapshot.data,
|
|
302
|
+
});
|
|
303
|
+
if (new TextEncoder().encode(raw).byteLength > requestLimits(this.owner).maxBytes) {
|
|
304
|
+
throw new SourceError('TOO_LARGE', 'The storage envelope exceeds max-bytes.');
|
|
305
|
+
}
|
|
306
|
+
return commitStorageRevision(this.owner.ownerDocument.defaultView, {
|
|
307
|
+
key: this.key,
|
|
308
|
+
expected: typeof this.baseline === 'string' ? JSON.parse(this.baseline).revision : null,
|
|
309
|
+
next: revision,
|
|
310
|
+
overwrite,
|
|
311
|
+
signal: controller.signal,
|
|
312
|
+
}, () => {
|
|
313
|
+
if (this.controller !== controller || !this.owner.isConnected) {
|
|
314
|
+
throw new DOMException('The browser save was cancelled.', 'AbortError');
|
|
315
|
+
}
|
|
316
|
+
storage.setItem(this.key, raw);
|
|
317
|
+
this.baseline = raw;
|
|
318
|
+
this.savedVersions = snapshot.versions;
|
|
319
|
+
for (let key of this.fields) {
|
|
320
|
+
this.restored.add(key);
|
|
321
|
+
}
|
|
322
|
+
this.conflict = false;
|
|
323
|
+
this.owner.requests.publish();
|
|
324
|
+
let result = {
|
|
325
|
+
ok: true,
|
|
326
|
+
operation: 'persist',
|
|
327
|
+
revision: snapshot.revision,
|
|
328
|
+
};
|
|
329
|
+
this.owner.dispatchEvent(new CustomEvent('persist', {
|
|
330
|
+
detail: result,
|
|
331
|
+
}));
|
|
332
|
+
return result;
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
} catch (failure) {
|
|
336
|
+
if (this.controller !== controller || controller.signal.aborted) {
|
|
337
|
+
return {
|
|
338
|
+
ok: false,
|
|
339
|
+
cancelled: true,
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
if (failure instanceof SourceError && failure.code === 'STORAGE_CONFLICT') {
|
|
343
|
+
this.conflict = true;
|
|
344
|
+
}
|
|
345
|
+
return this.fail('persist', failure);
|
|
346
|
+
} finally {
|
|
347
|
+
if (this.controller === controller) {
|
|
348
|
+
this.controller = undefined;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @param {string} operation
|
|
355
|
+
* @param {unknown} failure
|
|
356
|
+
*/
|
|
357
|
+
fail(operation, failure) {
|
|
358
|
+
let error = {
|
|
359
|
+
operation,
|
|
360
|
+
code: failure instanceof SourceError ? failure.code
|
|
361
|
+
: failure instanceof DOMException ? (failure.name === 'QuotaExceededError' ? 'STORAGE_QUOTA' : 'STORAGE_UNAVAILABLE')
|
|
362
|
+
: 'INVALID_DATA',
|
|
363
|
+
message: failure instanceof Error ? failure.message : 'Browser storage could not be accessed.',
|
|
364
|
+
status: null,
|
|
365
|
+
};
|
|
366
|
+
this.error = error;
|
|
367
|
+
this.owner.requests.publish();
|
|
368
|
+
this.owner.dispatchEvent(new CustomEvent('error', {
|
|
369
|
+
detail: error,
|
|
370
|
+
}));
|
|
371
|
+
return {
|
|
372
|
+
ok: false,
|
|
373
|
+
error,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { resolveTemplate } from '../core/resolveTemplate.js';
|
|
2
|
+
|
|
3
|
+
/** @type {Map<string, { template: string, type: typeof import('./BaseClass.js').BaseClass }>} */
|
|
4
|
+
let definitions = new Map();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Register a static declaration without rendering it or processing its actions.
|
|
8
|
+
* @param {Element} element
|
|
9
|
+
* @param {typeof import('./BaseClass.js').BaseClass} Base
|
|
10
|
+
*/
|
|
11
|
+
export function registerDeclaration(element, Base) {
|
|
12
|
+
let name = element.getAttribute('reg')?.trim();
|
|
13
|
+
if (!name) {
|
|
14
|
+
throw new TypeError('A component declaration requires a custom element name.');
|
|
15
|
+
}
|
|
16
|
+
let selector = element.getAttribute('use-template');
|
|
17
|
+
let templates = [
|
|
18
|
+
...element.children,
|
|
19
|
+
].filter((child) => child.localName === 'template');
|
|
20
|
+
let source = selector ? resolveTemplate(element, selector) : templates[0];
|
|
21
|
+
if (!(source?.localName === 'template') || (!selector && templates.length !== 1)) {
|
|
22
|
+
throw new TypeError('A component declaration requires one template or a valid use-template reference.');
|
|
23
|
+
}
|
|
24
|
+
let template = source.innerHTML;
|
|
25
|
+
let existing = window.customElements.get(name);
|
|
26
|
+
let definition = definitions.get(name);
|
|
27
|
+
if (existing) {
|
|
28
|
+
if (definition?.type !== existing || definition.template !== template) {
|
|
29
|
+
throw new TypeError('A different component is already registered: ' + name);
|
|
30
|
+
}
|
|
31
|
+
element.setAttribute('hidden', '');
|
|
32
|
+
return definition.type;
|
|
33
|
+
}
|
|
34
|
+
class Feature extends Base {}
|
|
35
|
+
Feature.template = template;
|
|
36
|
+
// Native registration validates custom element names and reserved names.
|
|
37
|
+
Feature.reg(name);
|
|
38
|
+
definitions.set(name, {
|
|
39
|
+
template,
|
|
40
|
+
type: Feature,
|
|
41
|
+
});
|
|
42
|
+
element.setAttribute('hidden', '');
|
|
43
|
+
return Feature;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Register declarations in a cloned template before native Itemize consumes it.
|
|
48
|
+
* @param {Element | DocumentFragment} root
|
|
49
|
+
* @param {import('./BaseClass.js').BaseClass} owner
|
|
50
|
+
*/
|
|
51
|
+
export function declarationProcessor(root, owner) {
|
|
52
|
+
for (let declaration of root.querySelectorAll('sym-component[reg]')) {
|
|
53
|
+
registerDeclaration(declaration, owner.Symbiote);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<section class="grid gap-5">
|
|
2
|
+
<p class="max-w-3xl text-sm leading-relaxed text-muted">Event descriptors replace application handlers. <code>[pub-to]</code> publishes immediately; a millisecond suffix delays publication until you stop typing. A valid form submission flushes its draft before <code>[set]</code> reads it. Native controls preserve strings, booleans and numbers.</p>
|
|
3
|
+
<sym-context ctx="ACTIONS">
|
|
4
|
+
<script type="application/json">
|
|
5
|
+
{
|
|
6
|
+
"immediate": "",
|
|
7
|
+
"delay200": "",
|
|
8
|
+
"delay1000": "",
|
|
9
|
+
"draft": "",
|
|
10
|
+
"submitted": "",
|
|
11
|
+
"open": false,
|
|
12
|
+
"ready": false,
|
|
13
|
+
"amount": 1
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
<div class="grid gap-4 md:grid-cols-3">
|
|
17
|
+
<div class="panel grid content-start gap-3">
|
|
18
|
+
<label>Immediate<input bind="value: immediate; oninput: [pub-to]immediate"></label>
|
|
19
|
+
<code class="text-sm text-muted">[pub-to]</code>
|
|
20
|
+
<p class="break-words text-sm">Published: <strong>{{immediate}}</strong></p>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="panel grid content-start gap-3">
|
|
23
|
+
<label>200 ms<input bind="value: delay200; oninput: [pub-to-200]delay200"></label>
|
|
24
|
+
<code class="text-sm text-muted">[pub-to-200]</code>
|
|
25
|
+
<p class="break-words text-sm">Published: <strong>{{delay200}}</strong></p>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="panel grid content-start gap-3">
|
|
28
|
+
<label>1000 ms<input bind="value: delay1000; oninput: [pub-to-1000]delay1000"></label>
|
|
29
|
+
<code class="text-sm text-muted">[pub-to-1000]</code>
|
|
30
|
+
<p class="break-words text-sm">Published: <strong>{{delay1000}}</strong></p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="grid gap-5 lg:grid-cols-2">
|
|
34
|
+
<form class="panel grid gap-4" action-data="ACTIONS/draft" bind="onsubmit: [set]ACTIONS/submitted">
|
|
35
|
+
<h2 class="font-semibold">Debounced input and native submission</h2>
|
|
36
|
+
<label>Message<input required placeholder="Type, then submit immediately" bind="value: draft; oninput: [pub-to-200]draft"></label>
|
|
37
|
+
<div class="field-row">
|
|
38
|
+
<button class="primary">Submit</button>
|
|
39
|
+
<button type="button" value="" bind="onclick: [set]submitted">Clear result</button>
|
|
40
|
+
</div>
|
|
41
|
+
<p>Submitted: <strong>{{submitted}}</strong></p>
|
|
42
|
+
</form>
|
|
43
|
+
<div class="panel grid content-start gap-4">
|
|
44
|
+
<h2 class="font-semibold">Typed values and boolean actions</h2>
|
|
45
|
+
<label>Amount<input type="number" min="0" bind="value: amount; oninput: [pub-to]amount"></label>
|
|
46
|
+
<label class="field-row"><input type="checkbox" bind="checked: ready; onchange: [pub-to]ready">Ready</label>
|
|
47
|
+
<div class="field-row flex-wrap">
|
|
48
|
+
<button type="button" value="true" bind="onclick: [set]ready">Set ready</button>
|
|
49
|
+
<button type="button" bind="onclick: [toggle]open">Toggle message</button>
|
|
50
|
+
</div>
|
|
51
|
+
<p class="text-sm text-muted">Amount: {{amount}} / ready: {{ready}}</p>
|
|
52
|
+
<sym-conditional when="ACTIONS/open"><p class="rounded-lg bg-accent/10 p-3 text-accent">Shown by a boolean toggle.</p></sym-conditional>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</sym-context>
|
|
56
|
+
</section>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<section class="grid gap-5">
|
|
2
|
+
<p class="max-w-3xl text-sm leading-relaxed text-muted"><code>sym-collection</code> projects shared records through filters, search and sorting, then native Itemize renders a reusable item. Item actions publish immutable updates by ID. Counts leave the controller through <code>pub-map</code>; page changes keep the source data.</p>
|
|
3
|
+
<p class="max-w-3xl text-sm leading-relaxed text-muted">Load tasks from a JSON object containing <code>tasks</code>, edit the list, then save it in this browser. <strong>Reload JSON</strong> replaces the current list without changing your saved copy. <strong>Restore saved tasks</strong> discards unsaved edits and restores your last browser save.</p>
|
|
4
|
+
<div class="panel grid gap-3">
|
|
5
|
+
<label>JSON source<input bind="value: ENDPOINTS/source; onchange: [pub-to]ENDPOINTS/source"></label>
|
|
6
|
+
<button type="button" class="justify-self-start" action-overwrite bind="onclick: [load]APP; disabled: APP/+busy">Reload JSON</button>
|
|
7
|
+
</div>
|
|
8
|
+
<sym-conditional when="APP/+loading"><p class="text-sm text-accent">Loading tasks...</p></sym-conditional>
|
|
9
|
+
<sym-conditional when="APP/+loadError"><p class="text-sm text-rose-500" bind="textContent: APP/+loadErrorMessage"></p></sym-conditional>
|
|
10
|
+
<div class="flex items-center justify-between gap-4">
|
|
11
|
+
<h2 class="text-2xl font-semibold">{{PREFERENCES/title}}</h2>
|
|
12
|
+
<sym-conditional when="PREFERENCES/showCounts" is="true"><span class="rounded-full bg-accent/10 px-3 py-1 text-sm text-accent">{{APP/shown}} / {{APP/total}} tasks</span></sym-conditional>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="panel grid gap-4">
|
|
15
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
16
|
+
<input type="search" class="max-w-xs" placeholder="Search title or notes" bind="value: APP/query; oninput: [pub-to-200]APP/query">
|
|
17
|
+
<button type="button" action-data="APP/allFilter" bind="onclick: [set]APP/filter">All</button>
|
|
18
|
+
<button type="button" action-data="APP/activeFilter" bind="onclick: [set]APP/filter">Active</button>
|
|
19
|
+
<button type="button" action-data="APP/completedFilter" bind="onclick: [set]APP/filter">Completed</button>
|
|
20
|
+
<sym-context bind="$: APP/sort" pub-to="APP/sort">
|
|
21
|
+
<label class="field-row whitespace-nowrap">Task order<select class="w-auto" bind="value: direction; onchange: [pub-to]direction">
|
|
22
|
+
<option value="asc">Title, ascending</option><option value="desc">Title, descending</option>
|
|
23
|
+
</select></label>
|
|
24
|
+
</sym-context>
|
|
25
|
+
</div>
|
|
26
|
+
<sym-context bind="$: APP/draft" pub-to="APP/draft">
|
|
27
|
+
<form class="field-row" action-data="APP/draft" action-reset="APP/draft" bind="onsubmit: [append]APP/tasks; inert: APP/+loading">
|
|
28
|
+
<input name="title" placeholder="New task" required pattern=".*\S.*" bind="value: title; oninput: [pub-to-200]title">
|
|
29
|
+
<button class="primary">Add task</button>
|
|
30
|
+
</form>
|
|
31
|
+
</sym-context>
|
|
32
|
+
</div>
|
|
33
|
+
<form class="grid gap-5" bind="onsubmit: [persist]APP">
|
|
34
|
+
<sym-collection data="APP/tasks" filter="APP/filter" search="APP/query" search-fields="title,note" sort="APP/sort"
|
|
35
|
+
pub-map="APP/shown: count; APP/total: totalCount">
|
|
36
|
+
<div class="grid gap-3" itemize="items" item-tag="task-card"></div>
|
|
37
|
+
<sym-conditional when="^empty"><p class="panel text-muted">No matching tasks.</p></sym-conditional>
|
|
38
|
+
</sym-collection>
|
|
39
|
+
<div class="field-row flex-wrap">
|
|
40
|
+
<button type="submit" class="primary" bind="disabled: APP/+busy">Save tasks</button>
|
|
41
|
+
<button type="button" bind="onclick: [restore]APP; disabled: APP/+busy">Restore saved tasks</button>
|
|
42
|
+
<button type="button" action-match="APP/allFilter" action-data="APP/completePatch" bind="onclick: [patch-matching]APP/tasks">Complete all</button>
|
|
43
|
+
<button type="button" action-match="APP/completedFilter" bind="onclick: [remove-matching]APP/tasks">Clear completed</button>
|
|
44
|
+
</div>
|
|
45
|
+
<p class="text-sm text-muted" bind="hidden: APP/+storageFound">No browser save yet. Use Save tasks to create one.</p>
|
|
46
|
+
<p class="text-sm text-amber-500" bind="hidden: !APP/+storageDirty">Changes are not saved in this browser.</p>
|
|
47
|
+
<p class="text-sm text-muted" bind="hidden: APP/+storageDirty">No unsaved browser changes.</p>
|
|
48
|
+
<sym-conditional when="APP/+storageError">
|
|
49
|
+
<p class="text-sm text-rose-500" bind="textContent: APP/+storageErrorMessage"></p>
|
|
50
|
+
<sym-conditional when="APP/+storageConflict">
|
|
51
|
+
<p class="text-sm text-muted">Another tab changed the saved data. Restore its version or explicitly overwrite it.</p>
|
|
52
|
+
</sym-conditional>
|
|
53
|
+
<button type="submit" action-overwrite>Overwrite browser save</button>
|
|
54
|
+
</sym-conditional>
|
|
55
|
+
</form>
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
<sym-component reg="task-card" use-template="#task-card"></sym-component>
|
|
59
|
+
<template id="task-card">
|
|
60
|
+
<script type="application/json">{"expanded": false}</script>
|
|
61
|
+
<div class="field-row">
|
|
62
|
+
<input type="checkbox" bind="checked: done; onchange: [item-pub]done">
|
|
63
|
+
<input name="title" required pattern=".*\S.*" class="border-transparent bg-transparent font-medium" bind="value: title; oninput: [item-pub]title">
|
|
64
|
+
<button type="button" bind="onclick: [item-toggle]pinned">
|
|
65
|
+
<sym-conditional when="^pinned">Unpin</sym-conditional>
|
|
66
|
+
<sym-conditional when="^pinned" behavior="hide">Pin</sym-conditional>
|
|
67
|
+
</button>
|
|
68
|
+
<button type="button" bind="onclick: [toggle]expanded">Notes</button>
|
|
69
|
+
<button type="button" class="text-muted hover:text-rose-500" bind="onclick: [item-remove]">Delete</button>
|
|
70
|
+
</div>
|
|
71
|
+
<sym-conditional when="^expanded"><textarea class="mt-3" rows="2" placeholder="Task notes" bind="value: ^note; oninput: [item-pub]note"></textarea></sym-conditional>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<section class="grid gap-5">
|
|
2
|
+
<p class="max-w-3xl text-sm leading-relaxed text-muted"><code>sym-component reg</code> registers an authored template as a custom element. Each instance gets independent JSON defaults and local state. The declaration and ordinary components both accept native <code>use-template</code> references.</p>
|
|
3
|
+
<div class="grid gap-5 lg:grid-cols-2">
|
|
4
|
+
<feature-note class="panel block">
|
|
5
|
+
<script type="application/json">{"title": "First instance", "message": "This instance owns its expanded state."}</script>
|
|
6
|
+
</feature-note>
|
|
7
|
+
<feature-note class="panel block">
|
|
8
|
+
<script type="application/json">{"title": "Second instance", "message": "Opening the other instance does not change this one."}</script>
|
|
9
|
+
</feature-note>
|
|
10
|
+
</div>
|
|
11
|
+
<sym-component use-template="#notice-template"></sym-component>
|
|
12
|
+
</section>
|
|
13
|
+
|
|
14
|
+
<sym-component reg="feature-note" use-template="#feature-note-template"></sym-component>
|
|
15
|
+
<template id="feature-note-template">
|
|
16
|
+
<script type="application/json">{"title": "Note", "message": "", "expanded": false}</script>
|
|
17
|
+
<div class="grid gap-4">
|
|
18
|
+
<h2 class="font-semibold">{{title}}</h2>
|
|
19
|
+
<button type="button" bind="onclick: [toggle]expanded">Toggle details</button>
|
|
20
|
+
<sym-conditional when="^expanded"><p class="text-sm text-muted">{{^message}}</p></sym-conditional>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
<template id="notice-template">
|
|
24
|
+
<div class="panel text-sm text-muted">This notice uses an extracted template without registering another tag.</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<section class="grid gap-5">
|
|
2
|
+
<p class="max-w-3xl text-sm leading-relaxed text-muted"><code>show</code> and <code>hide</code> retain the same DOM and input drafts. <code>dom-add</code> and <code>dom-remove</code> dispose inactive content; returning creates fresh controls. Boolean <code>is="true"</code> is typed, while other literal comparisons are strings.</p>
|
|
3
|
+
<sym-context ctx="CONDITIONS">
|
|
4
|
+
<script type="application/json">{"open": true, "status": "review"}</script>
|
|
5
|
+
<div class="panel field-row mb-5 flex-wrap">
|
|
6
|
+
<button type="button" class="primary" bind="onclick: [toggle]open">Toggle open</button>
|
|
7
|
+
<label class="field-row whitespace-nowrap">Status<select class="w-auto" bind="value: status; onchange: [pub-to]status"><option>review</option><option>published</option></select></label>
|
|
8
|
+
<sym-conditional when="CONDITIONS/status" is="published"><span class="text-sm text-accent">Published status matched.</span></sym-conditional>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="grid gap-5 lg:grid-cols-2">
|
|
11
|
+
<div class="panel grid content-start gap-3">
|
|
12
|
+
<h2 class="font-semibold">show</h2>
|
|
13
|
+
<sym-conditional when="CONDITIONS/open" is="true"><input placeholder="Kept while hidden"></sym-conditional>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="panel grid content-start gap-3">
|
|
16
|
+
<h2 class="font-semibold">hide</h2>
|
|
17
|
+
<sym-conditional when="CONDITIONS/open" is="true" behavior="hide"><input placeholder="Kept in the inverse view"></sym-conditional>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="panel grid content-start gap-3">
|
|
20
|
+
<h2 class="font-semibold">dom-add</h2>
|
|
21
|
+
<sym-conditional when="CONDITIONS/open" is="true" behavior="dom-add"><input placeholder="Fresh after remount"></sym-conditional>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="panel grid content-start gap-3">
|
|
24
|
+
<h2 class="font-semibold">dom-remove</h2>
|
|
25
|
+
<sym-conditional when="CONDITIONS/open" is="true" behavior="dom-remove"><input placeholder="Fresh in the inverse view"></sym-conditional>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</sym-context>
|
|
29
|
+
</section>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<section class="grid gap-5">
|
|
2
|
+
<p class="max-w-3xl text-sm leading-relaxed text-muted">The shared context loads initial tasks from a JSON file through <code>src</code>. Change the source URL to load another JSON object containing <code>tasks</code>; local edits and restored browser data remain protected. Collections saves to local storage. Here, <code>[sync]</code> optionally sends only <code>sync-keys</code> to an HTTP endpoint.</p>
|
|
3
|
+
<div class="grid gap-5 lg:grid-cols-2">
|
|
4
|
+
<div class="panel grid content-start gap-4">
|
|
5
|
+
<h2 class="font-semibold">Request configuration</h2>
|
|
6
|
+
<label>JSON source<input bind="value: ENDPOINTS/source; onchange: [pub-to]ENDPOINTS/source"></label>
|
|
7
|
+
<label>Write endpoint<input bind="value: ENDPOINTS/destination; onchange: [pub-to]ENDPOINTS/destination"></label>
|
|
8
|
+
<label>Request method<select bind="value: ENDPOINTS/method; onchange: [pub-to]ENDPOINTS/method">
|
|
9
|
+
<option>PUT</option><option>POST</option><option>PATCH</option>
|
|
10
|
+
</select></label>
|
|
11
|
+
<div class="field-row">
|
|
12
|
+
<button type="button" bind="onclick: [load]APP; disabled: APP/+busy">Reload</button>
|
|
13
|
+
<button type="button" class="primary" bind="onclick: [sync]APP; disabled: APP/+busy">Send tasks</button>
|
|
14
|
+
</div>
|
|
15
|
+
<p class="text-sm text-muted">Sending requires a server that accepts the selected method. The checkout's development server provides an optional in-memory API at <code>/api/tasks</code>. Static hosting needs only the JSON source and browser storage.</p>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="panel grid content-start gap-4">
|
|
18
|
+
<h2 class="font-semibold">Data and request state</h2>
|
|
19
|
+
<sym-collection data="APP/tasks">
|
|
20
|
+
<p class="text-sm text-muted">{{count}} shared task records</p>
|
|
21
|
+
<ul class="grid gap-2 text-sm" itemize="items"><template><li>{{title}}</li></template></ul>
|
|
22
|
+
</sym-collection>
|
|
23
|
+
<sym-conditional when="APP/+loading"><p class="text-sm text-accent">Loading...</p></sym-conditional>
|
|
24
|
+
<sym-conditional when="APP/+saving"><p class="text-sm text-accent">Saving...</p></sym-conditional>
|
|
25
|
+
<sym-conditional when="APP/+dirty"><p class="text-sm text-amber-500">Task changes have not been sent.</p></sym-conditional>
|
|
26
|
+
<p class="text-sm text-muted">Revision {{APP/+revision}} / acknowledged {{APP/+savedRevision}}</p>
|
|
27
|
+
<sym-conditional when="APP/+loadError"><p class="text-sm text-rose-500" bind="textContent: APP/+loadErrorMessage"></p></sym-conditional>
|
|
28
|
+
<sym-conditional when="APP/+syncError"><p class="text-sm text-rose-500" bind="textContent: APP/+syncErrorMessage"></p></sym-conditional>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<section class="grid gap-4 text-sm leading-relaxed">
|
|
2
|
+
<p>This fragment loads relative to its importing section. Its checkbox publishes to <code>PREFERENCES/showCounts</code>, which the Collections section also reads.</p>
|
|
3
|
+
<label class="field-row"><input type="checkbox" bind="checked: PREFERENCES/showCounts; onchange: [pub-to]PREFERENCES/showCounts">Show task counts</label>
|
|
4
|
+
</section>
|