foldkit-cms 0.2.0 → 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.
@@ -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/B,UAAU,OAAO,cAAc,SAAS;;;;;;;EAOjD,gBAAgB,QAAQ,WAAW,OAAO;WACjC,QACP,OAAO,WACP;aACc;aAAuB;aAAyB,SAAS;;;;UAI1D,aAAa;EAE5B,OACE,OAAO,MAC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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,qBAAqB,WAAW,aAAa,UAAU,QAAQ;;aAElE,iBACP,eACG,aAAa,cAAc,WAAW,aAAa;;aAE/C,aAAa,eAAe;;W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BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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(),
@@ -159,6 +180,7 @@ const makeEditor = (cms) => (name, config) => {
159
180
  saveWanted: false,
160
181
  publishId: null,
161
182
  publishWanted: false,
183
+ submit: "idle",
162
184
  scheduleAt: null,
163
185
  otherId: null,
164
186
  previewing: false,
@@ -187,6 +209,11 @@ const makeEditor = (cms) => (name, config) => {
187
209
  saveWanted: Schema.Boolean,
188
210
  publishId: Schema.NullOr(Schema.String),
189
211
  publishWanted: Schema.Boolean,
212
+ submit: Schema.Literals([
213
+ "idle",
214
+ "waiting",
215
+ "stopped"
216
+ ]),
190
217
  scheduleAt: Schema.NullOr(Schema.String),
191
218
  otherId: Schema.NullOr(Schema.String),
192
219
  previewing: Schema.Boolean,
@@ -228,11 +255,14 @@ const makeEditor = (cms) => (name, config) => {
228
255
  args: { edit: edits },
229
256
  effect: Effect.sleep(rest).pipe(Effect.as(Own.Rested({ edit: edits })))
230
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;
231
260
  const result = {
232
- model: {
261
+ model: next.model === model.form && submit === model.submit ? model : {
233
262
  ...model,
234
263
  form: next.model,
235
- edits
264
+ edits,
265
+ submit
236
266
  },
237
267
  commands
238
268
  };
@@ -247,7 +277,7 @@ const makeEditor = (cms) => (name, config) => {
247
277
  init: () => ({ model: closed }),
248
278
  update: (model, message) => {
249
279
  if (model.mode === "closed") return { model };
250
- if (!isOwn(message)) return viaForm(message._tag === "Submitted" ? {
280
+ if (!isOwn(message)) return viaForm(Predicate.isTagged(message, "Submitted") ? {
251
281
  ...model,
252
282
  scheduleAt: null
253
283
  } : model, message);
@@ -265,10 +295,10 @@ const makeEditor = (cms) => (name, config) => {
265
295
  previewing: true,
266
296
  previewedAs: null
267
297
  } };
268
- case "PreviewHidden": return { model: {
298
+ case "PreviewHidden": return model.previewing ? { model: {
269
299
  ...model,
270
300
  previewing: false
271
- } };
301
+ } } : { model };
272
302
  case "RestoreAsked": return {
273
303
  model,
274
304
  outMessage: {
@@ -280,7 +310,13 @@ const makeEditor = (cms) => (name, config) => {
280
310
  ...model,
281
311
  scheduleAt: message.at
282
312
  }, form.Message.Submitted());
283
- default: return {
313
+ case "UnscheduleAsked":
314
+ case "ArchiveAsked":
315
+ case "UnarchiveAsked":
316
+ case "DiscardAsked":
317
+ case "UnpublishAsked":
318
+ case "ReloadAsked":
319
+ case "OverwriteAsked": return {
284
320
  model,
285
321
  outMessage: asks[message._tag]
286
322
  };
@@ -305,7 +341,16 @@ const makeEditor = (cms) => (name, config) => {
305
341
  resumed: "Blank"
306
342
  } }),
307
343
  close: () => ({ model: closed })
308
- }
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
+ })
309
354
  });
310
355
  const EntryRead = Entity.select(cms.Entities.Entry, {
311
356
  type: true,
@@ -313,7 +358,10 @@ const makeEditor = (cms) => (name, config) => {
313
358
  revision: true,
314
359
  archivedAt: true
315
360
  });
316
- const EntryState = Entity.select(cms.Entities.Entry, { state: true });
361
+ const EntryState = Entity.select(cms.Entities.Entry, {
362
+ state: true,
363
+ may: true
364
+ });
317
365
  const DraftRead = Entity.select(cms.Entities.Draft, {
318
366
  values: true,
319
367
  model: true,
@@ -340,25 +388,14 @@ const makeEditor = (cms) => (name, config) => {
340
388
  const { mode, entry, saveId } = slice.get(root);
341
389
  return entry === null || mode === "closed" || mode === "new" && saveId === null ? void 0 : entry;
342
390
  };
391
+ /** What the editor reads of the open entry: each none while there is none to read. */
343
392
  const projections = {
344
- entry: (root) => {
345
- const entry = entryOf(root);
346
- return entry === void 0 ? void 0 : data.get(EntryRead, entry);
347
- },
348
- state: (root) => {
349
- const entry = entryOf(root);
350
- return entry === void 0 ? void 0 : data.get(EntryState, entry);
351
- },
352
- draft: (root) => {
353
- const entry = entryOf(root);
354
- return entry === void 0 ? void 0 : data.get(DraftRead, entry);
355
- },
356
- row: (root) => {
357
- const target = held(projections.entry(root)?.read(root))?.targetId;
358
- return target == null ? void 0 : data.get(RowRead, target);
359
- }
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))
360
397
  };
361
- const read = (root, part) => projections[part](root)?.read(root);
398
+ const read = (root, part) => Option.getOrUndefined(Option.map(projections[part](root), (projection) => projection.read(root)));
362
399
  const statusOf = (root, requestId) => requestId === null ? { _tag: "Unknown" } : data.mutation(root, requestId);
363
400
  /** Shows what was loaded, once: the draft by the ladder, else what is published. */
364
401
  const fill = (root) => {
@@ -406,7 +443,7 @@ const makeEditor = (cms) => (name, config) => {
406
443
  type: content.name,
407
444
  label: label === "" ? config.untitled ?? "Untitled" : label,
408
445
  values,
409
- model: encodeModel(editor.form),
446
+ model: encodeModel(form.settled(editor.form)),
410
447
  form: formTag,
411
448
  basedOn
412
449
  });
@@ -512,7 +549,7 @@ const makeEditor = (cms) => (name, config) => {
512
549
  if (key === void 0 || content.roles.slug?.key !== key) return root;
513
550
  const reason = slugTaken.reason(failure.error.message);
514
551
  const field = form.field(editor.form, key);
515
- if (field._tag === "Invalid" && (field.errors ?? []).includes(reason)) return root;
552
+ if (field._tag === "Invalid" && field.errors.includes(reason)) return root;
516
553
  return slice.set(root, {
517
554
  ...editor,
518
555
  form: form.bundle.update(editor.form, form.Message.Refused({
@@ -594,15 +631,11 @@ const makeEditor = (cms) => (name, config) => {
594
631
  editor.otherId
595
632
  ]) {
596
633
  const status = statusOf(root, id);
597
- if (status._tag === "Failed") return status.error;
634
+ if (status._tag === "Failed") return Option.some(status.error);
598
635
  }
636
+ return Option.none();
599
637
  };
600
- const active = (part) => ({
601
- name: `${name}.${part}`,
602
- owner: data.contract.owner ?? {},
603
- messages: [],
604
- projectionOf: projections[part]
605
- });
638
+ const active = (part) => data.active(`${name}.${part}`, projections[part]);
606
639
  return {
607
640
  /** For the placement: what the editor asked becomes the mutation, or waits its turn. */
608
641
  onOut: (out) => (root) => {
@@ -627,10 +660,10 @@ const makeEditor = (cms) => (name, config) => {
627
660
  "entry",
628
661
  "draft",
629
662
  "row"
630
- ].reduce((next, part) => {
631
- const projection = projections[part](next);
632
- return projection === void 0 ? next : data.refresh(next, projection);
633
- }, root);
663
+ ].reduce((next, part) => Option.match(projections[part](next), {
664
+ onNone: () => next,
665
+ onSome: (projection) => data.refresh(next, projection)
666
+ }), root);
634
667
  return { model: slice.set(refreshed, {
635
668
  ...closed,
636
669
  mode: "edit",
@@ -639,8 +672,10 @@ const makeEditor = (cms) => (name, config) => {
639
672
  }) };
640
673
  }
641
674
  case "Overwrite": {
642
- const projection = projections.draft(root);
643
- const refreshed = projection === void 0 ? root : data.refresh(root, projection);
675
+ const refreshed = Option.match(projections.draft(root), {
676
+ onNone: () => root,
677
+ onSome: (projection) => data.refresh(root, projection)
678
+ });
644
679
  return { model: slice.set(refreshed, {
645
680
  ...slice.get(refreshed),
646
681
  settling: "overwrite"
@@ -692,13 +727,25 @@ const makeEditor = (cms) => (name, config) => {
692
727
  * The id the application's own pages know this content by: the row's, or
693
728
  * the entry's while there is no row. It is what a preview is shown under.
694
729
  */
695
- pageId: (root) => held(read(root, "entry"))?.targetId ?? slice.get(root).entry,
696
- /** The entry being edited; `null` while closed. */
697
- 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)),
698
738
  /** How the form came to hold what it holds; `Lost` is worth telling the author. */
699
- resumed: (root) => slice.get(root).resumed,
700
- /** The entry's lifecycle state, as the server last derived it. */
701
- 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,
702
749
  /** Why the last publish, save, discard or unpublish failed. */
703
750
  error: failure,
704
751
  status: (root) => {
@@ -716,16 +763,21 @@ const makeEditor = (cms) => (name, config) => {
716
763
  const publish = statusOf(root, editor.publishId);
717
764
  const save = statusOf(root, editor.saveId);
718
765
  const later = editor.scheduleAt !== null;
719
- if (publish._tag === "Pending") return later ? "Scheduling" : "Publishing";
766
+ if (publish._tag === "Pending" || editor.submit === "waiting") return later ? "Scheduling" : "Publishing";
720
767
  if (save._tag === "Pending" || editor.settling === "overwrite") return "Saving";
768
+ if (editor.submit === "stopped") return "Incomplete";
721
769
  const conflicted = (status) => status._tag === "Failed" && status.error.message.includes("CmsConflict");
722
770
  if (editor.edits > editor.savedEdit) return "Editing";
723
771
  if (conflicted(save) || conflicted(publish)) return "Conflict";
724
- if (save._tag === "Failed") return "SaveFailed";
725
- if (publish._tag === "Failed") return later ? "ScheduleFailed" : "PublishFailed";
726
- if (publish._tag === "Applied") return later ? "Scheduled" : "Published";
727
- if (save._tag === "Applied") return "Saved";
728
- return editor.resumed === "Model" || editor.resumed === "Values" ? "Saved" : "Opened";
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
+ }
729
781
  }
730
782
  };
731
783
  }
@@ -737,7 +789,9 @@ const makeEditor = (cms) => (name, config) => {
737
789
  * The kinds a CMS adds: two controls and two displays, made with `Input.kind`
738
790
  * and `Display.kind` exactly as an application makes its own, and a renderer for
739
791
  * each to spread beside `foldkit-mixins-form`'s and `foldkit-mixins-crud`'s.
740
- * There is no CMS view package: a kind and its renderer are all a view needs.
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.
741
795
  */
742
796
  /** Text as an address: lower case, unaccented, words joined by `-`. */
743
797
  const slugify = (text) => text.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
@@ -759,7 +813,8 @@ const stateWords = {
759
813
  Unpublished: "Unpublished",
760
814
  Archived: "Archived",
761
815
  scheduled: "scheduled",
762
- overdue: "overdue"
816
+ overdue: "overdue",
817
+ withSchedule: "{state}, {schedule}"
763
818
  };
764
819
  const isState = (value) => typeof value === "object" && value !== null && "_tag" in value && "schedule" in value;
765
820
  /** What a state's schedule adds to it: nothing, `scheduled`, or `overdue`. */
@@ -772,7 +827,10 @@ const StateDisplay = Display.kind("CmsState", { text: (data, value) => {
772
827
  ...data.words
773
828
  };
774
829
  const schedule = scheduleOf(value);
775
- return schedule === void 0 ? words[value._tag] : `${words[value._tag]}, ${words[schedule]}`;
830
+ return schedule === void 0 ? words[value._tag] : fillWords(words.withSchedule, {
831
+ state: words[value._tag],
832
+ schedule: words[schedule]
833
+ });
776
834
  } });
777
835
  const units = [
778
836
  ["year", 31536e6],
@@ -832,7 +890,7 @@ const Kinds = {
832
890
  dateTime: () => DateTime.of({}),
833
891
  /** For `FormView`'s `renderers`, beside its own. */
834
892
  controlRenderers: () => ({
835
- [Slug.kind]: ({ control, state, draft, change, blurred, slots, h }) => h.span([], [h.span([h.DataAttribute("cms-slug-prefix", "")], [Slug.is(control) ? control.data.prefix : ""]), h.input(slots.text.attrs([
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([
836
894
  ...state,
837
895
  h.Type("text"),
838
896
  h.Value(String(draft)),
@@ -849,11 +907,107 @@ const Kinds = {
849
907
  }),
850
908
  /** For `ListView`'s and `DetailView`'s `renderers`: a state as a badge, a moment as a `time`. */
851
909
  displayRenderers: () => ({
852
- [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)]),
853
911
  [Moment.kind]: ({ display, value, words, h }) => h.time([h.Attribute("datetime", String(value))], [display.text(value, words)])
854
912
  })
855
913
  };
856
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
857
1011
  //#region src/index.ts
858
1012
  /**
859
1013
  * `foldkit-cms` — what a CMS adds to a domain that is already declared: audience
@@ -863,13 +1017,12 @@ const Kinds = {
863
1017
  * row holds what is published; publishing is the application's own mutation,
864
1018
  * run with the draft's value. This package is the declarations and the pure
865
1019
  * rules. It reads no database and owns no state; `foldkit-cms-drizzle` is the
866
- * server, and the screens are `foldkit-crud`'s.
1020
+ * server, and lists and forms draw through `foldkit-crud`'s views.
867
1021
  */
868
1022
  const rolesKey = Metadata.key("foldkit-cms/roles", {
869
1023
  merge: (roles) => [Object.assign({}, ...roles)],
870
1024
  summarize: (roles) => Object.keys(roles).join(",")
871
1025
  });
872
- 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);
873
1026
  const fail = (message) => {
874
1027
  throw new Error(`foldkit-cms: ${message}`);
875
1028
  };
@@ -900,7 +1053,10 @@ const Entry = Entity.define("CmsEntry", Schema.Struct({
900
1053
  archivedAt: Schema.NullOr(Schema.String),
901
1054
  /** The number of the latest published revision: what the next publish is based on. */
902
1055
  revision: Schema.NullOr(Schema.Number)
903
- })).pipe(Entity.derived({ state: Derived.make(StateSchema) }), Entity.annotateMembers({
1056
+ })).pipe(Entity.derived({
1057
+ state: Derived.make(StateSchema),
1058
+ may: Derived.make(Schema.Array(Transitions))
1059
+ }), Entity.annotateMembers({
904
1060
  id: Display.of(Display.hidden()),
905
1061
  state: Display.of(Kinds.Display.State.of({})),
906
1062
  createdAt: Display.of(Kinds.Display.Moment.of({})),
@@ -1057,7 +1213,7 @@ const Cms = {
1057
1213
  const type = Schema.toType(field.schema);
1058
1214
  if (role === "published") {
1059
1215
  if (!Schema.is(type)(null)) fail(`"${key}" of ${entity.name} admits no null, so it cannot say a row is unpublished`);
1060
- } 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}`);
1061
1217
  }
1062
1218
  const named = Object.fromEntries(Object.entries(given).filter((entry) => entry[1] !== void 0));
1063
1219
  return entity.pipe(Entity.annotate(rolesKey.of(named)));
@@ -1134,8 +1290,22 @@ const Cms = {
1134
1290
  editor,
1135
1291
  /** A form's Submodel view as its editor's, for `Bundle.withView`. */
1136
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,
1137
1305
  /** The state of an entry, from what is known of it and a clock. */
1138
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,
1139
1309
  /** The transitions an entry offers now, before anyone asks who is asking. */
1140
1310
  offers: (facts, now, content) => offers(facts, now, { unpublishes: content.roles.published !== void 0 })
1141
1311
  };