foldkit-cms 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -7
- package/dist/index.d.mts +363 -122
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +235 -70
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -15
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lifecycle.ts","../src/editor.ts","../../bundle/src/link.d.ts","../../bundle/src/placed.d.ts","../../bundle/src/collection.d.ts","../../bundle/src/bundle.d.ts","../src/kinds.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;UASiB;;WAEN;;WAEA;;WAEA;aACE;aACA;;;;UAKI;WACN;;WAEA;;WAEA;;KAGC;;;;;;;;;;UAWK;WACN,MAAM;WACN,UAAU;;;KAIT;;;;KCZA;;;;;;;;;;;KAYA;;;;;;;;;;;;;;UA2BK,YAAY;WAClB,MAAM;WACN;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;KAIC;WACG;;WACA;;WACA;;WACA;WAA0B;;WAC1B;;WACA;;WACA;;WACA;;WACA;;WACA;;;UAGE,WAAW,WAAW,aAAa;WACzC;WACA;aAAkB,QAAQ,OAAO;;WACjC;aACE,OAAO,OAAO,MAAM;aACpB,SAAS,OAAO,MAAM;aACtB,SACP,OAAO,WACP,SAAS,aACT,eACG,OAAO,qBAAqB,WAAW,aAAa,UAAU;;WAE5D;aACE,iBAAiB;aACjB,UAAU;eAAoB;eAAqB;UAAoB;aACvE,QAAQ;eAAoB,SAAS,SAAS;UAA8B;;WAE9E,SAAS;WACT,OAAO,OAAO,WAAW,QAAQ,QAAQ;aAAsB,OAAO;;WACtE,UAAU,OAAO,cAAc,QAAQ;WACvC,UAAU,OAAO,cAAc;;WAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaP,SAAA,qBAAqB,UAAU,WAAS,SAAW,QAAQ,MAAM,+CAAiB,mBAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lifecycle.ts","../src/editor.ts","../../bundle/src/placed.d.ts","../../bundle/src/link.d.ts","../../bundle/src/collection.d.ts","../../bundle/src/bundle.d.ts","../src/views.ts","../src/kinds.ts","../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;UAUiB;;WAEN;;WAEA;;WAEA;aACE;aACA;;;;UAKI;WACN;;WAEA;;WAEA;;KAGC;;;;;;;;;;UAWK;WACN,MAAM;WACN,UAAU;;;cAIR,aAAW,OAAA;KAWZ,oBAAoB,YAAY;;;;KCrBhC;;;;;;;;;;;KAYA;;;;;;;;;;;;;;;;;;;UAgCK,YAAY;WAClB,MAAM;WACN;WACA;WACA;WACA,SAAS;WACT;WACA;WACA;WACA;WACA;WACA;;;;;WAKA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;KAIC;WACG;;WACA;;WACA;;WACA;WAA0B;;WAC1B;;WACA;;WACA;;WACA;;WACA;;WACA;;;;UAIE,WAAW,WAAW,aAAa,OAAO,gBAAgB;WAChE;WACA;aAAkB,QAAQ,OAAO;;WACjC;aACE,OAAO,OAAO,MAAM;aACpB,SAAS,OAAO,MAAM;aACtB,SACP,OAAO,WACP,SAAS,aACT,eACG,OAAO,qB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sB;;aACxC,UAAU,QAAQ,MAAM,GAAG,QAAQ,QAAQ;QAErD,QAAQ,MAAM,GAAG,OAAO,UAAU;;EASrB,kBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaP,SAAA,qBAAqB,UAAU,WAAS,SAAW,QAAQ,MAAM,+CAAiB,mBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
|
-
import { Effect, Option, Schema } from "effect";
|
|
2
|
-
import { Derived, Entity, Expr, Order, Relation } from "foldkit-entity";
|
|
1
|
+
import { Effect, Option, Predicate, Schema } from "effect";
|
|
2
|
+
import { Derived, Entity, Expr, Order, Relation, SchemaShape } from "foldkit-entity";
|
|
3
3
|
import { Metadata } from "foldkit-metadata";
|
|
4
4
|
import { Mutation, Query, Remote } from "foldkit-remote";
|
|
5
5
|
import { Bundle } from "foldkit-bundle";
|
|
6
|
+
import * as ManagedResource from "foldkit/managedResource";
|
|
6
7
|
import { defineMessageUnion } from "foldkit/message";
|
|
8
|
+
import * as Subscription from "foldkit/subscription";
|
|
7
9
|
import * as Submodel from "foldkit/submodel";
|
|
8
10
|
import { Display } from "foldkit-crud";
|
|
9
|
-
import { Input } from "foldkit-form";
|
|
11
|
+
import { Input, fillWords } from "foldkit-form";
|
|
10
12
|
//#region src/lifecycle.ts
|
|
13
|
+
/**
|
|
14
|
+
* The lifecycle of a piece of content, derived. Nothing stores a status: a state
|
|
15
|
+
* is a pure function of facts (is there a row, can a visitor see it, is there a
|
|
16
|
+
* draft, has the entry been archived) and a clock, so it cannot disagree with
|
|
17
|
+
* them. A scheduled publish that failed reads scheduled and overdue, which is
|
|
18
|
+
* true, and not published, which would not be.
|
|
19
|
+
*/
|
|
20
|
+
/** What an author may ask of an entry. Each is an operation the server runs after asking `allow`. */
|
|
21
|
+
const Transitions = Schema.Literals([
|
|
22
|
+
"save",
|
|
23
|
+
"discard",
|
|
24
|
+
"publish",
|
|
25
|
+
"schedule",
|
|
26
|
+
"unschedule",
|
|
27
|
+
"unpublish",
|
|
28
|
+
"archive",
|
|
29
|
+
"unarchive",
|
|
30
|
+
"restore"
|
|
31
|
+
]);
|
|
11
32
|
const scheduleOf$1 = (draft, now) => draft === null || draft.scheduledFor === null ? null : {
|
|
12
33
|
at: draft.scheduledFor,
|
|
13
34
|
overdue: new Date(draft.scheduledFor).getTime() <= now.getTime(),
|
|
@@ -109,12 +130,6 @@ const addressFree = (content) => {
|
|
|
109
130
|
* saves have got. What the server holds is read from Remote, never copied: the
|
|
110
131
|
* draft's `updatedAt` a save is based on, and the entry's `revision` a publish is.
|
|
111
132
|
*/
|
|
112
|
-
const isEdit = (message) => message._tag === "Nested" ? isEdit(message.message) : [
|
|
113
|
-
"Changed",
|
|
114
|
-
"RowAdded",
|
|
115
|
-
"RowRemoved",
|
|
116
|
-
"Reset"
|
|
117
|
-
].includes(message._tag);
|
|
118
133
|
const held = (read) => read?._tag === "Ready" || read?._tag === "Refreshing" ? read.value : void 0;
|
|
119
134
|
/** Read, and not being read again: what the server said last, not what it said before. */
|
|
120
135
|
const fresh = (read) => read?._tag === "Ready" || read?._tag === "NotFound";
|
|
@@ -165,6 +180,7 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
165
180
|
saveWanted: false,
|
|
166
181
|
publishId: null,
|
|
167
182
|
publishWanted: false,
|
|
183
|
+
submit: "idle",
|
|
168
184
|
scheduleAt: null,
|
|
169
185
|
otherId: null,
|
|
170
186
|
previewing: false,
|
|
@@ -193,6 +209,11 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
193
209
|
saveWanted: Schema.Boolean,
|
|
194
210
|
publishId: Schema.NullOr(Schema.String),
|
|
195
211
|
publishWanted: Schema.Boolean,
|
|
212
|
+
submit: Schema.Literals([
|
|
213
|
+
"idle",
|
|
214
|
+
"waiting",
|
|
215
|
+
"stopped"
|
|
216
|
+
]),
|
|
196
217
|
scheduleAt: Schema.NullOr(Schema.String),
|
|
197
218
|
otherId: Schema.NullOr(Schema.String),
|
|
198
219
|
previewing: Schema.Boolean,
|
|
@@ -227,18 +248,21 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
227
248
|
};
|
|
228
249
|
const viaForm = (model, message) => {
|
|
229
250
|
const next = form.bundle.update(model.form, message, void 0);
|
|
230
|
-
const edited =
|
|
251
|
+
const edited = form.authoredChanged(model.form, next.model);
|
|
231
252
|
const edits = edited ? model.edits + 1 : model.edits;
|
|
232
253
|
const commands = [...next.commands ?? [], ...edited ? [{
|
|
233
254
|
name: `${name}.rest`,
|
|
234
255
|
args: { edit: edits },
|
|
235
256
|
effect: Effect.sleep(rest).pipe(Effect.as(Own.Rested({ edit: edits })))
|
|
236
257
|
}] : []];
|
|
258
|
+
const validating = form.engine.isValidating(next.model);
|
|
259
|
+
const submit = next.outMessage !== void 0 || edited ? "idle" : Predicate.isTagged(message, "Submitted") ? validating ? "waiting" : "stopped" : model.submit === "waiting" && !validating ? "stopped" : model.submit;
|
|
237
260
|
const result = {
|
|
238
|
-
model: {
|
|
261
|
+
model: next.model === model.form && submit === model.submit ? model : {
|
|
239
262
|
...model,
|
|
240
263
|
form: next.model,
|
|
241
|
-
edits
|
|
264
|
+
edits,
|
|
265
|
+
submit
|
|
242
266
|
},
|
|
243
267
|
commands
|
|
244
268
|
};
|
|
@@ -253,7 +277,7 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
253
277
|
init: () => ({ model: closed }),
|
|
254
278
|
update: (model, message) => {
|
|
255
279
|
if (model.mode === "closed") return { model };
|
|
256
|
-
if (!isOwn(message)) return viaForm(message
|
|
280
|
+
if (!isOwn(message)) return viaForm(Predicate.isTagged(message, "Submitted") ? {
|
|
257
281
|
...model,
|
|
258
282
|
scheduleAt: null
|
|
259
283
|
} : model, message);
|
|
@@ -271,10 +295,10 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
271
295
|
previewing: true,
|
|
272
296
|
previewedAs: null
|
|
273
297
|
} };
|
|
274
|
-
case "PreviewHidden": return { model: {
|
|
298
|
+
case "PreviewHidden": return model.previewing ? { model: {
|
|
275
299
|
...model,
|
|
276
300
|
previewing: false
|
|
277
|
-
} };
|
|
301
|
+
} } : { model };
|
|
278
302
|
case "RestoreAsked": return {
|
|
279
303
|
model,
|
|
280
304
|
outMessage: {
|
|
@@ -286,7 +310,13 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
286
310
|
...model,
|
|
287
311
|
scheduleAt: message.at
|
|
288
312
|
}, form.Message.Submitted());
|
|
289
|
-
|
|
313
|
+
case "UnscheduleAsked":
|
|
314
|
+
case "ArchiveAsked":
|
|
315
|
+
case "UnarchiveAsked":
|
|
316
|
+
case "DiscardAsked":
|
|
317
|
+
case "UnpublishAsked":
|
|
318
|
+
case "ReloadAsked":
|
|
319
|
+
case "OverwriteAsked": return {
|
|
290
320
|
model,
|
|
291
321
|
outMessage: asks[message._tag]
|
|
292
322
|
};
|
|
@@ -311,7 +341,16 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
311
341
|
resumed: "Blank"
|
|
312
342
|
} }),
|
|
313
343
|
close: () => ({ model: closed })
|
|
314
|
-
}
|
|
344
|
+
},
|
|
345
|
+
subscriptions: () => form.bundle.subscriptions === void 0 ? {} : Subscription.lift(form.bundle.subscriptions(void 0))({
|
|
346
|
+
toChildModel: (model) => model.form,
|
|
347
|
+
toParentMessage: (message) => message,
|
|
348
|
+
when: (model) => model.mode !== "closed"
|
|
349
|
+
}),
|
|
350
|
+
resources: () => form.bundle.resources === void 0 ? {} : ManagedResource.lift(form.bundle.resources(void 0))({
|
|
351
|
+
toChildModel: (model) => model.mode === "closed" ? Option.none() : Option.some(model.form),
|
|
352
|
+
toParentMessage: (message) => message
|
|
353
|
+
})
|
|
315
354
|
});
|
|
316
355
|
const EntryRead = Entity.select(cms.Entities.Entry, {
|
|
317
356
|
type: true,
|
|
@@ -319,7 +358,10 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
319
358
|
revision: true,
|
|
320
359
|
archivedAt: true
|
|
321
360
|
});
|
|
322
|
-
const EntryState = Entity.select(cms.Entities.Entry, {
|
|
361
|
+
const EntryState = Entity.select(cms.Entities.Entry, {
|
|
362
|
+
state: true,
|
|
363
|
+
may: true
|
|
364
|
+
});
|
|
323
365
|
const DraftRead = Entity.select(cms.Entities.Draft, {
|
|
324
366
|
values: true,
|
|
325
367
|
model: true,
|
|
@@ -346,25 +388,14 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
346
388
|
const { mode, entry, saveId } = slice.get(root);
|
|
347
389
|
return entry === null || mode === "closed" || mode === "new" && saveId === null ? void 0 : entry;
|
|
348
390
|
};
|
|
391
|
+
/** What the editor reads of the open entry: each none while there is none to read. */
|
|
349
392
|
const projections = {
|
|
350
|
-
entry: (root) =>
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
state: (root) => {
|
|
355
|
-
const entry = entryOf(root);
|
|
356
|
-
return entry === void 0 ? void 0 : data.get(EntryState, entry);
|
|
357
|
-
},
|
|
358
|
-
draft: (root) => {
|
|
359
|
-
const entry = entryOf(root);
|
|
360
|
-
return entry === void 0 ? void 0 : data.get(DraftRead, entry);
|
|
361
|
-
},
|
|
362
|
-
row: (root) => {
|
|
363
|
-
const target = held(projections.entry(root)?.read(root))?.targetId;
|
|
364
|
-
return target == null ? void 0 : data.get(RowRead, target);
|
|
365
|
-
}
|
|
393
|
+
entry: (root) => Option.map(Option.fromUndefinedOr(entryOf(root)), (entry) => data.get(EntryRead, entry)),
|
|
394
|
+
state: (root) => Option.map(Option.fromUndefinedOr(entryOf(root)), (entry) => data.get(EntryState, entry)),
|
|
395
|
+
draft: (root) => Option.map(Option.fromUndefinedOr(entryOf(root)), (entry) => data.get(DraftRead, entry)),
|
|
396
|
+
row: (root) => Option.map(Option.fromNullishOr(held(read(root, "entry"))?.targetId), (target) => data.get(RowRead, target))
|
|
366
397
|
};
|
|
367
|
-
const read = (root, part) => projections[part](root)
|
|
398
|
+
const read = (root, part) => Option.getOrUndefined(Option.map(projections[part](root), (projection) => projection.read(root)));
|
|
368
399
|
const statusOf = (root, requestId) => requestId === null ? { _tag: "Unknown" } : data.mutation(root, requestId);
|
|
369
400
|
/** Shows what was loaded, once: the draft by the ladder, else what is published. */
|
|
370
401
|
const fill = (root) => {
|
|
@@ -412,7 +443,7 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
412
443
|
type: content.name,
|
|
413
444
|
label: label === "" ? config.untitled ?? "Untitled" : label,
|
|
414
445
|
values,
|
|
415
|
-
model: encodeModel(editor.form),
|
|
446
|
+
model: encodeModel(form.settled(editor.form)),
|
|
416
447
|
form: formTag,
|
|
417
448
|
basedOn
|
|
418
449
|
});
|
|
@@ -518,7 +549,7 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
518
549
|
if (key === void 0 || content.roles.slug?.key !== key) return root;
|
|
519
550
|
const reason = slugTaken.reason(failure.error.message);
|
|
520
551
|
const field = form.field(editor.form, key);
|
|
521
|
-
if (field._tag === "Invalid" &&
|
|
552
|
+
if (field._tag === "Invalid" && field.errors.includes(reason)) return root;
|
|
522
553
|
return slice.set(root, {
|
|
523
554
|
...editor,
|
|
524
555
|
form: form.bundle.update(editor.form, form.Message.Refused({
|
|
@@ -600,14 +631,11 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
600
631
|
editor.otherId
|
|
601
632
|
]) {
|
|
602
633
|
const status = statusOf(root, id);
|
|
603
|
-
if (status._tag === "Failed") return status.error;
|
|
634
|
+
if (status._tag === "Failed") return Option.some(status.error);
|
|
604
635
|
}
|
|
636
|
+
return Option.none();
|
|
605
637
|
};
|
|
606
|
-
const active = (part) => ({
|
|
607
|
-
name: `${name}.${part}`,
|
|
608
|
-
owner: data.contract.owner ?? {},
|
|
609
|
-
projectionOf: projections[part]
|
|
610
|
-
});
|
|
638
|
+
const active = (part) => data.active(`${name}.${part}`, projections[part]);
|
|
611
639
|
return {
|
|
612
640
|
/** For the placement: what the editor asked becomes the mutation, or waits its turn. */
|
|
613
641
|
onOut: (out) => (root) => {
|
|
@@ -632,10 +660,10 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
632
660
|
"entry",
|
|
633
661
|
"draft",
|
|
634
662
|
"row"
|
|
635
|
-
].reduce((next, part) => {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}, root);
|
|
663
|
+
].reduce((next, part) => Option.match(projections[part](next), {
|
|
664
|
+
onNone: () => next,
|
|
665
|
+
onSome: (projection) => data.refresh(next, projection)
|
|
666
|
+
}), root);
|
|
639
667
|
return { model: slice.set(refreshed, {
|
|
640
668
|
...closed,
|
|
641
669
|
mode: "edit",
|
|
@@ -644,8 +672,10 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
644
672
|
}) };
|
|
645
673
|
}
|
|
646
674
|
case "Overwrite": {
|
|
647
|
-
const
|
|
648
|
-
|
|
675
|
+
const refreshed = Option.match(projections.draft(root), {
|
|
676
|
+
onNone: () => root,
|
|
677
|
+
onSome: (projection) => data.refresh(root, projection)
|
|
678
|
+
});
|
|
649
679
|
return { model: slice.set(refreshed, {
|
|
650
680
|
...slice.get(refreshed),
|
|
651
681
|
settling: "overwrite"
|
|
@@ -697,13 +727,25 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
697
727
|
* The id the application's own pages know this content by: the row's, or
|
|
698
728
|
* the entry's while there is no row. It is what a preview is shown under.
|
|
699
729
|
*/
|
|
700
|
-
pageId: (root) => held(read(root, "entry"))?.targetId ?? slice.get(root).entry,
|
|
701
|
-
/** The entry being edited;
|
|
702
|
-
entry: (root) => slice.get(root).entry,
|
|
730
|
+
pageId: (root) => Option.fromNullishOr(held(read(root, "entry"))?.targetId ?? slice.get(root).entry),
|
|
731
|
+
/** The entry being edited; none while closed. */
|
|
732
|
+
entry: (root) => Option.fromNullOr(slice.get(root).entry),
|
|
733
|
+
/**
|
|
734
|
+
* The entry as the server knows it: none while closed, and while
|
|
735
|
+
* something new is not saved yet, so a link naming it would find nothing.
|
|
736
|
+
*/
|
|
737
|
+
storedEntry: (root) => Option.fromUndefinedOr(entryOf(root)),
|
|
703
738
|
/** How the form came to hold what it holds; `Lost` is worth telling the author. */
|
|
704
|
-
resumed: (root) => slice.get(root).resumed,
|
|
705
|
-
/** The entry's lifecycle state, as the server last derived it. */
|
|
706
|
-
state: (root) => held(read(root, "state"))?.state,
|
|
739
|
+
resumed: (root) => Option.fromNullOr(slice.get(root).resumed),
|
|
740
|
+
/** The entry's lifecycle state, as the server last derived it; none until it is read. */
|
|
741
|
+
state: (root) => Option.fromUndefinedOr(held(read(root, "state"))?.state),
|
|
742
|
+
/**
|
|
743
|
+
* Whether the signed-in principal may ask this transition of the open
|
|
744
|
+
* entry, by the server's `allow`, as the server said with the entry: false
|
|
745
|
+
* until it is read. Whether the entry offers it now is its `state`'s to
|
|
746
|
+
* say. For hiding what would be refused; the server still decides.
|
|
747
|
+
*/
|
|
748
|
+
may: (root, transition) => held(read(root, "state"))?.may.includes(transition) === true,
|
|
707
749
|
/** Why the last publish, save, discard or unpublish failed. */
|
|
708
750
|
error: failure,
|
|
709
751
|
status: (root) => {
|
|
@@ -721,16 +763,21 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
721
763
|
const publish = statusOf(root, editor.publishId);
|
|
722
764
|
const save = statusOf(root, editor.saveId);
|
|
723
765
|
const later = editor.scheduleAt !== null;
|
|
724
|
-
if (publish._tag === "Pending") return later ? "Scheduling" : "Publishing";
|
|
766
|
+
if (publish._tag === "Pending" || editor.submit === "waiting") return later ? "Scheduling" : "Publishing";
|
|
725
767
|
if (save._tag === "Pending" || editor.settling === "overwrite") return "Saving";
|
|
768
|
+
if (editor.submit === "stopped") return "Incomplete";
|
|
726
769
|
const conflicted = (status) => status._tag === "Failed" && status.error.message.includes("CmsConflict");
|
|
727
770
|
if (editor.edits > editor.savedEdit) return "Editing";
|
|
728
771
|
if (conflicted(save) || conflicted(publish)) return "Conflict";
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
772
|
+
switch (save._tag) {
|
|
773
|
+
case "Failed": return "SaveFailed";
|
|
774
|
+
case "Unknown":
|
|
775
|
+
case "Applied": switch (publish._tag) {
|
|
776
|
+
case "Failed": return later ? "ScheduleFailed" : "PublishFailed";
|
|
777
|
+
case "Applied": return later ? "Scheduled" : "Published";
|
|
778
|
+
case "Unknown": return save._tag === "Applied" || editor.resumed === "Model" || editor.resumed === "Values" ? "Saved" : "Opened";
|
|
779
|
+
}
|
|
780
|
+
}
|
|
734
781
|
}
|
|
735
782
|
};
|
|
736
783
|
}
|
|
@@ -742,7 +789,9 @@ const makeEditor = (cms) => (name, config) => {
|
|
|
742
789
|
* The kinds a CMS adds: two controls and two displays, made with `Input.kind`
|
|
743
790
|
* and `Display.kind` exactly as an application makes its own, and a renderer for
|
|
744
791
|
* each to spread beside `foldkit-mixins-form`'s and `foldkit-mixins-crud`'s.
|
|
745
|
-
*
|
|
792
|
+
* Entry-level views (its state badge, published history, remaining
|
|
793
|
+
* transitions) live in `./views.js`: they draw on the application's own slot
|
|
794
|
+
* builders, so the application keeps its slots and styles.
|
|
746
795
|
*/
|
|
747
796
|
/** Text as an address: lower case, unaccented, words joined by `-`. */
|
|
748
797
|
const slugify = (text) => text.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -764,7 +813,8 @@ const stateWords = {
|
|
|
764
813
|
Unpublished: "Unpublished",
|
|
765
814
|
Archived: "Archived",
|
|
766
815
|
scheduled: "scheduled",
|
|
767
|
-
overdue: "overdue"
|
|
816
|
+
overdue: "overdue",
|
|
817
|
+
withSchedule: "{state}, {schedule}"
|
|
768
818
|
};
|
|
769
819
|
const isState = (value) => typeof value === "object" && value !== null && "_tag" in value && "schedule" in value;
|
|
770
820
|
/** What a state's schedule adds to it: nothing, `scheduled`, or `overdue`. */
|
|
@@ -777,7 +827,10 @@ const StateDisplay = Display.kind("CmsState", { text: (data, value) => {
|
|
|
777
827
|
...data.words
|
|
778
828
|
};
|
|
779
829
|
const schedule = scheduleOf(value);
|
|
780
|
-
return schedule === void 0 ? words[value._tag] :
|
|
830
|
+
return schedule === void 0 ? words[value._tag] : fillWords(words.withSchedule, {
|
|
831
|
+
state: words[value._tag],
|
|
832
|
+
schedule: words[schedule]
|
|
833
|
+
});
|
|
781
834
|
} });
|
|
782
835
|
const units = [
|
|
783
836
|
["year", 31536e6],
|
|
@@ -837,7 +890,7 @@ const Kinds = {
|
|
|
837
890
|
dateTime: () => DateTime.of({}),
|
|
838
891
|
/** For `FormView`'s `renderers`, beside its own. */
|
|
839
892
|
controlRenderers: () => ({
|
|
840
|
-
[Slug.kind]: ({ control, state, draft, change, blurred, slots, h }) => h.
|
|
893
|
+
[Slug.kind]: ({ control, state, draft, change, blurred, slots, h }) => h.div(slots.group.attrs(), [h.span(slots.affix.attrs(), [Slug.is(control) ? control.data.prefix : ""]), h.input(slots.text.attrs([
|
|
841
894
|
...state,
|
|
842
895
|
h.Type("text"),
|
|
843
896
|
h.Value(String(draft)),
|
|
@@ -854,11 +907,107 @@ const Kinds = {
|
|
|
854
907
|
}),
|
|
855
908
|
/** For `ListView`'s and `DetailView`'s `renderers`: a state as a badge, a moment as a `time`. */
|
|
856
909
|
displayRenderers: () => ({
|
|
857
|
-
[StateDisplay.kind]: ({ display, value, words, h }) => h.span(isState(value) ? [h.DataAttribute("cms-state", value._tag), ...scheduleOf(value) === void 0 ? [] : [h.DataAttribute("cms-schedule", scheduleOf(value))]] : [], [display.text(value, words)]),
|
|
910
|
+
[StateDisplay.kind]: ({ display, value, words, h, badge }) => h.span(badge.attrs(isState(value) ? [h.DataAttribute("cms-state", value._tag), ...scheduleOf(value) === void 0 ? [] : [h.DataAttribute("cms-schedule", scheduleOf(value))]] : []), [display.text(value, words)]),
|
|
858
911
|
[Moment.kind]: ({ display, value, words, h }) => h.time([h.Attribute("datetime", String(value))], [display.text(value, words)])
|
|
859
912
|
})
|
|
860
913
|
};
|
|
861
914
|
//#endregion
|
|
915
|
+
//#region src/views.ts
|
|
916
|
+
/**
|
|
917
|
+
* The entry-level views every CMS studio draws: its state badge, its
|
|
918
|
+
* published revisions, and what can still happen to it. An application passes
|
|
919
|
+
* its own slot builders and keeps its slots and styles; the interfaces below
|
|
920
|
+
* are the builders each view reads. Words for states come from
|
|
921
|
+
* `Cms.Display`, so a studio and its lists say them one way.
|
|
922
|
+
*/
|
|
923
|
+
/** Whether the entry's state is one of `tags`; an entry with no state yet is none of them. */
|
|
924
|
+
const stateIs = (state, ...tags) => Option.exists(state, (known) => tags.includes(known._tag));
|
|
925
|
+
/** An entry's state as a badge: its tag is its color, its words the CMS's. */
|
|
926
|
+
const stateBadge = (badge, h, state, attribute = "state") => Option.match(state, {
|
|
927
|
+
onNone: () => h.span(badge.attrs([h.DataAttribute(attribute, "New")]), ["New"]),
|
|
928
|
+
onSome: (known) => h.span(badge.attrs([h.DataAttribute(attribute, known._tag)]), [Display.show(Kinds.Display.State.of({}), known)])
|
|
929
|
+
});
|
|
930
|
+
const revisionsOf = (model, history) => Option.match(history(model), {
|
|
931
|
+
onNone: () => ({
|
|
932
|
+
_tag: "Ready",
|
|
933
|
+
revisions: []
|
|
934
|
+
}),
|
|
935
|
+
onSome: (projection) => {
|
|
936
|
+
const read = projection.read(model);
|
|
937
|
+
switch (read._tag) {
|
|
938
|
+
case "Ready":
|
|
939
|
+
case "Refreshing": return {
|
|
940
|
+
_tag: "Ready",
|
|
941
|
+
revisions: read.value.revisions
|
|
942
|
+
};
|
|
943
|
+
case "Failed": return { _tag: "Failed" };
|
|
944
|
+
case "NotFound": return {
|
|
945
|
+
_tag: "Ready",
|
|
946
|
+
revisions: []
|
|
947
|
+
};
|
|
948
|
+
case "Initial":
|
|
949
|
+
case "Loading": return { _tag: "Loading" };
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
});
|
|
953
|
+
/** A moment as the History says it: "Sep 27, 2026" and "9:12 PM", apart. */
|
|
954
|
+
const momentOf = (iso) => {
|
|
955
|
+
const at = new Date(iso);
|
|
956
|
+
return {
|
|
957
|
+
day: at.toLocaleDateString(void 0, {
|
|
958
|
+
month: "short",
|
|
959
|
+
day: "numeric",
|
|
960
|
+
year: "numeric"
|
|
961
|
+
}),
|
|
962
|
+
time: at.toLocaleTimeString(void 0, {
|
|
963
|
+
hour: "numeric",
|
|
964
|
+
minute: "2-digit"
|
|
965
|
+
})
|
|
966
|
+
};
|
|
967
|
+
};
|
|
968
|
+
/**
|
|
969
|
+
* What was published, newest first, as a timeline: each revision on a line
|
|
970
|
+
* down to the first, with when and by whom. The newest is marked Live while
|
|
971
|
+
* the entry is on the site; restoring it is offered only while a draft sits
|
|
972
|
+
* over it, since otherwise it changes nothing. A history still being read
|
|
973
|
+
* says it is loading, and one that failed says so: neither is mistaken for
|
|
974
|
+
* nothing published. Who published is the application's to name
|
|
975
|
+
* (`authorName`), as only it knows its chairs.
|
|
976
|
+
*/
|
|
977
|
+
const historyCard = (slots, h, history, entry) => {
|
|
978
|
+
const live = stateIs(entry.state, "Published", "Changed");
|
|
979
|
+
const drafted = stateIs(entry.state, "Changed");
|
|
980
|
+
const body = history._tag === "Failed" ? h.p(slots.muted.attrs(), ["The history could not be read."]) : history._tag === "Loading" ? h.p(slots.muted.attrs(), ["Loading…"]) : history.revisions.length === 0 ? h.p(slots.muted.attrs(), ["Nothing has been published yet."]) : h.ol(slots.timeline.attrs([h.AriaLabel("Published revisions, newest first")]), history.revisions.map((revision, index) => {
|
|
981
|
+
const newest = index === 0;
|
|
982
|
+
const { day, time } = momentOf(revision.publishedAt);
|
|
983
|
+
const isLive = newest && live;
|
|
984
|
+
return h.li(slots.revision.attrs(isLive ? [h.DataAttribute("live", "")] : []), [
|
|
985
|
+
h.span(slots.revisionMark.attrs([h.AriaHidden(true)]), []),
|
|
986
|
+
h.div(slots.revisionBody.attrs(), [h.p(slots.revisionTitle.attrs(), [`Revision ${revision.n}`, ...isLive ? [h.span(slots.revisionLive.attrs(), ["Live"])] : []]), h.p(slots.revisionMeta.attrs(), [h.time([h.Attribute("datetime", revision.publishedAt)], [`${day} · ${time}`]), ...revision.publishedBy === null ? [] : [` · ${entry.authorName(revision.publishedBy)}`]])]),
|
|
987
|
+
...isLive && !drafted ? [] : [h.button(slots.revisionRestore.attrs([h.OnClick(entry.restore(revision.n)), h.AriaLabel(`Restore revision ${revision.n}`)]), ["Restore"])]
|
|
988
|
+
]);
|
|
989
|
+
}));
|
|
990
|
+
return h.section(slots.card.attrs([h.Id("history")]), [h.h2(slots.cardTitle.attrs(), ["History"]), body]);
|
|
991
|
+
};
|
|
992
|
+
/**
|
|
993
|
+
* The rest of what can happen to an entry: its draft discarded, taken off the
|
|
994
|
+
* site, put away or brought back. Discard and unpublish are each offered only
|
|
995
|
+
* where the server would allow them; archive is always offered, with unarchive
|
|
996
|
+
* taking its place once put away. None for something never saved, which has
|
|
997
|
+
* nothing to discard or put away. The archive button's icon is the
|
|
998
|
+
* application's, drawn its way.
|
|
999
|
+
*/
|
|
1000
|
+
const moreCard = (slots, h, entry) => {
|
|
1001
|
+
const { state, may, asks } = entry;
|
|
1002
|
+
if (Option.isNone(state)) return [];
|
|
1003
|
+
const action = (id, label, message) => h.button(slots.button.attrs([h.Id(id), h.OnClick(message)]), [label]);
|
|
1004
|
+
return [h.section(slots.card.attrs(), [h.h2(slots.cardTitle.attrs(), ["More"]), h.div(slots.toolbar.attrs(), [
|
|
1005
|
+
...may("discard") && stateIs(state, "Changed", "New") ? [action("discard", "Discard draft", asks.discard)] : [],
|
|
1006
|
+
...may("unpublish") && stateIs(state, "Published", "Changed") ? [action("unpublish", "Unpublish", asks.unpublish)] : [],
|
|
1007
|
+
stateIs(state, "Archived") ? action("unarchive", "Unarchive", asks.unarchive) : h.button(slots.danger.attrs([h.Id("archive"), h.OnClick(asks.archive)]), [entry.archiveIcon, "Archive"])
|
|
1008
|
+
])])];
|
|
1009
|
+
};
|
|
1010
|
+
//#endregion
|
|
862
1011
|
//#region src/index.ts
|
|
863
1012
|
/**
|
|
864
1013
|
* `foldkit-cms` — what a CMS adds to a domain that is already declared: audience
|
|
@@ -868,13 +1017,12 @@ const Kinds = {
|
|
|
868
1017
|
* row holds what is published; publishing is the application's own mutation,
|
|
869
1018
|
* run with the draft's value. This package is the declarations and the pure
|
|
870
1019
|
* rules. It reads no database and owns no state; `foldkit-cms-drizzle` is the
|
|
871
|
-
* server, and
|
|
1020
|
+
* server, and lists and forms draw through `foldkit-crud`'s views.
|
|
872
1021
|
*/
|
|
873
1022
|
const rolesKey = Metadata.key("foldkit-cms/roles", {
|
|
874
1023
|
merge: (roles) => [Object.assign({}, ...roles)],
|
|
875
1024
|
summarize: (roles) => Object.keys(roles).join(",")
|
|
876
1025
|
});
|
|
877
|
-
const isText = (ast) => ast._tag === "String" || ast._tag === "TemplateLiteral" || ast._tag === "Literal" && typeof ast.literal === "string" || ast._tag === "Union" && (ast.types ?? []).length > 0 && (ast.types ?? []).every(isText);
|
|
878
1026
|
const fail = (message) => {
|
|
879
1027
|
throw new Error(`foldkit-cms: ${message}`);
|
|
880
1028
|
};
|
|
@@ -905,7 +1053,10 @@ const Entry = Entity.define("CmsEntry", Schema.Struct({
|
|
|
905
1053
|
archivedAt: Schema.NullOr(Schema.String),
|
|
906
1054
|
/** The number of the latest published revision: what the next publish is based on. */
|
|
907
1055
|
revision: Schema.NullOr(Schema.Number)
|
|
908
|
-
})).pipe(Entity.derived({
|
|
1056
|
+
})).pipe(Entity.derived({
|
|
1057
|
+
state: Derived.make(StateSchema),
|
|
1058
|
+
may: Derived.make(Schema.Array(Transitions))
|
|
1059
|
+
}), Entity.annotateMembers({
|
|
909
1060
|
id: Display.of(Display.hidden()),
|
|
910
1061
|
state: Display.of(Kinds.Display.State.of({})),
|
|
911
1062
|
createdAt: Display.of(Kinds.Display.Moment.of({})),
|
|
@@ -1062,7 +1213,7 @@ const Cms = {
|
|
|
1062
1213
|
const type = Schema.toType(field.schema);
|
|
1063
1214
|
if (role === "published") {
|
|
1064
1215
|
if (!Schema.is(type)(null)) fail(`"${key}" of ${entity.name} admits no null, so it cannot say a row is unpublished`);
|
|
1065
|
-
} else if (!isText(type.ast)) fail(`"${key}" of ${entity.name} is not text, so it cannot be its ${role}`);
|
|
1216
|
+
} else if (!SchemaShape.isText(type.ast)) fail(`"${key}" of ${entity.name} is not text, so it cannot be its ${role}`);
|
|
1066
1217
|
}
|
|
1067
1218
|
const named = Object.fromEntries(Object.entries(given).filter((entry) => entry[1] !== void 0));
|
|
1068
1219
|
return entity.pipe(Entity.annotate(rolesKey.of(named)));
|
|
@@ -1139,8 +1290,22 @@ const Cms = {
|
|
|
1139
1290
|
editor,
|
|
1140
1291
|
/** A form's Submodel view as its editor's, for `Bundle.withView`. */
|
|
1141
1292
|
editorView,
|
|
1293
|
+
/**
|
|
1294
|
+
* The entry-level views every studio draws, on its own slot builders: its
|
|
1295
|
+
* state badge, its published revisions, what was published, and the rest of
|
|
1296
|
+
* what can happen to it. Words for states come from `Cms.Display`, so a
|
|
1297
|
+
* studio and its lists say them one way.
|
|
1298
|
+
*/
|
|
1299
|
+
stateBadge,
|
|
1300
|
+
/** Whether the entry's state is one of the given tags; no state yet is none of them. */
|
|
1301
|
+
stateIs,
|
|
1302
|
+
revisionsOf,
|
|
1303
|
+
historyCard,
|
|
1304
|
+
moreCard,
|
|
1142
1305
|
/** The state of an entry, from what is known of it and a clock. */
|
|
1143
1306
|
state: (facts, now) => state(facts, now),
|
|
1307
|
+
/** Every transition an author may ask, in order: what `allow` is asked about. */
|
|
1308
|
+
transitions: Transitions.literals,
|
|
1144
1309
|
/** The transitions an entry offers now, before anyone asks who is asking. */
|
|
1145
1310
|
offers: (facts, now, content) => offers(facts, now, { unpublishes: content.roles.published !== void 0 })
|
|
1146
1311
|
};
|