@homepages/concrete 6.2.0 → 8.0.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +152 -0
  2. package/codemods/manifest.json +19 -0
  3. package/codemods/object-form-only.mjs +39 -0
  4. package/codemods/steps/list-object-form.mjs +688 -0
  5. package/codemods/steps/select-object-form.mjs +210 -0
  6. package/dist/artifact/playground/client/assets/index-Dn_xT16-.js +1101 -0
  7. package/dist/artifact/playground/client/index.html +1 -1
  8. package/dist/artifact/playground/host.mjs +14 -14
  9. package/dist/asset-modules.d.ts +2 -1
  10. package/dist/cli/check/stages/render.js +1 -1
  11. package/dist/cli/check/stages/sections.js +1 -1
  12. package/dist/fixtures/canonical.d.ts +2 -5
  13. package/dist/fixtures/media.js +11 -25
  14. package/dist/fixtures/property.js +28 -16
  15. package/dist/fixtures/resolve.js +31 -17
  16. package/dist/fixtures/rows.js +3 -83
  17. package/dist/fixtures.d.ts +17 -9
  18. package/dist/index.d.ts +9 -9
  19. package/dist/packages/external/concrete/package.js +1 -1
  20. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +32 -10
  21. package/dist/packages/internal/fill-bake/dist/derive-source.js +15 -4
  22. package/dist/packages/internal/fill-bake/dist/index.js +2 -2
  23. package/dist/packages/internal/fill-vocabulary/dist/origination.js +6 -61
  24. package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +15 -0
  25. package/dist/packages/internal/property-facts/dist/index.js +1 -1
  26. package/dist/packages/internal/property-facts/dist/{property-facts-5pxZnlkh.js → property-facts-Cy7-O4p0.js} +2 -5
  27. package/dist/packages/internal/section-contracts/dist/catalog.js +2 -22
  28. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +6 -1
  29. package/dist/packages/internal/section-contracts/dist/group-contract.js +1 -3
  30. package/dist/packages/internal/section-contracts/dist/index.js +0 -5
  31. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +16 -7
  32. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +1 -5
  33. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +14 -0
  34. package/dist/packages/internal/section-contracts/dist/runners.js +3 -28
  35. package/dist/packages/internal/section-contracts/dist/source-contract.js +93 -20
  36. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +19 -9
  37. package/dist/packages/internal/source-resolution/dist/index.js +48 -57
  38. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +6 -17
  39. package/dist/packages/internal/template-contracts/dist/facts-view.js +4 -23
  40. package/dist/packages/internal/template-contracts/dist/row-sources.js +20 -0
  41. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +362 -380
  42. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +289 -293
  43. package/dist/primitives/slot-bindings.d.ts +7 -40
  44. package/dist/primitives/slot-bindings.js +10 -12
  45. package/dist/schema/define-schema.d.ts +1 -1
  46. package/dist/schema/define-schema.js +13 -1
  47. package/dist/schema/extract-fill-spec.js +14 -17
  48. package/dist/schema/fact.d.ts +2 -19
  49. package/dist/schema/fill-builders.d.ts +4 -3
  50. package/dist/schema/fill-spec.js +18 -1
  51. package/dist/schema/layout.d.ts +6 -8
  52. package/dist/schema/layout.js +3 -9
  53. package/dist/schema/property-facts.d.ts +17 -47
  54. package/dist/schema/row-fields.js +88 -0
  55. package/dist/schema/row-ref.d.ts +59 -0
  56. package/dist/schema/row-ref.js +28 -0
  57. package/dist/schema/runtime-values.d.ts +8 -13
  58. package/dist/schema/section-props.d.ts +19 -26
  59. package/dist/schema/section-schema.d.ts +6 -6
  60. package/dist/schema/section-schema.js +2 -2
  61. package/dist/schema/slot-builders.d.ts +247 -122
  62. package/dist/schema/slot-builders.js +57 -28
  63. package/dist/schema/slot-ref.d.ts +18 -2
  64. package/dist/schema/slot-ref.js +11 -3
  65. package/dist/schema/slot-types.d.ts +7 -7
  66. package/dist/schema/slot-types.js +55 -19
  67. package/dist/section/declare.d.ts +1 -1
  68. package/dist/section/section.d.ts +3 -3
  69. package/dist/template/logic-shim.d.ts +1 -1
  70. package/guide/reference/cli/INDEX.md +2 -2
  71. package/guide/reference/cli/build.md +1 -1
  72. package/guide/reference/cli/check.md +1 -1
  73. package/guide/reference/cli/dev.md +1 -1
  74. package/guide/reference/cli/property-add.md +1 -1
  75. package/guide/reference/cli/property-list.md +1 -1
  76. package/guide/reference/cli/publish.md +1 -1
  77. package/guide/reference/cli/upgrade.md +1 -1
  78. package/guide/reference/rules/INDEX.md +3 -8
  79. package/package.json +1 -1
  80. package/tsconfig.base.json +1 -0
  81. package/dist/artifact/playground/client/assets/index-Cqz-jjVw.js +0 -1101
  82. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +0 -20
  83. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +0 -20
  84. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +0 -20
  85. package/dist/packages/internal/section-contracts/dist/row-contract.js +0 -37
  86. package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +0 -15
  87. package/dist/packages/internal/template-contracts/dist/layout.js +0 -10
@@ -1,16 +1,25 @@
1
1
  import { mirror } from "./compute.js";
2
2
  import { isFillBinding } from "./fill-builders.js";
3
3
  import { fillMark, getFill } from "./fill-declaration.js";
4
- import { itemLayoutFromRows } from "./layout.js";
5
- import { isFactRef, isSiblingSlot, isSlotRef } from "./slot-ref.js";
4
+ import { isFactRef, isRowRef, isSiblingSlot, isSlotRef } from "./slot-ref.js";
5
+ import { rowReference } from "./row-ref.js";
6
+ import { resolveRowFields } from "./row-fields.js";
6
7
 
7
8
  //#region src/schema/slot-builders.ts
9
+ function bakedSource(source) {
10
+ if (isSlotRef(source) || isSiblingSlot(source)) return mirror(source);
11
+ if (isRowRef(source)) return {
12
+ kind: "row",
13
+ field: source.field
14
+ };
15
+ return source;
16
+ }
8
17
  function head(opts) {
9
18
  const source = opts.source;
10
19
  const baked = source !== void 0 && !isFillBinding(source);
11
20
  return {
12
21
  ...opts.locked === true ? { locked: true } : {},
13
- ...baked ? { source: isSlotRef(source) || isSiblingSlot(source) ? mirror(source) : source } : {},
22
+ ...baked ? { source: bakedSource(source) } : {},
14
23
  ...fillMark(source),
15
24
  ...opts.writeback !== void 0 ? { writeback: opts.writeback } : {},
16
25
  label: opts.label,
@@ -42,7 +51,7 @@ function number(opts) {
42
51
  ...opts.maxDigits !== void 0 ? { maxDigits: opts.maxDigits } : {}
43
52
  };
44
53
  }
45
- function selectFn(opts) {
54
+ function selectFromFact(opts) {
46
55
  const source = opts.source;
47
56
  return {
48
57
  type: "select",
@@ -51,12 +60,14 @@ function selectFn(opts) {
51
60
  ...opts.creatable !== void 0 ? { creatable: opts.creatable } : {}
52
61
  };
53
62
  }
54
- function selectOf(values, opts) {
63
+ function selectFromOptions(opts) {
64
+ if (isFactRef(opts.source)) throw new Error(`select: "${opts.label}" declares both \`options\` and a fact \`source\` — a select takes exactly one set of choices.`);
55
65
  return {
56
66
  type: "select",
57
67
  ...head(opts),
58
- values: [...values],
59
- ...opts.creatable !== void 0 ? { creatable: opts.creatable } : {}
68
+ values: [...opts.options],
69
+ ...opts.creatable !== void 0 ? { creatable: opts.creatable } : {},
70
+ ...opts.unique === true ? { unique: true } : {}
60
71
  };
61
72
  }
62
73
  function displaySelect(cases, opts) {
@@ -66,10 +77,12 @@ function displaySelect(cases, opts) {
66
77
  ...opts.source !== void 0 ? { source: opts.source } : {}
67
78
  };
68
79
  }
69
- function selectDispatch(a, b) {
70
- return Array.isArray(a) ? displaySelect(a, b) : selectFn(a);
80
+ function selectDispatch(opts) {
81
+ if (Array.isArray(opts)) throw new Error("select: takes one options object — write the choices as `options`: `select({ options: [...], … })`.");
82
+ if (opts.label === void 0 && Array.isArray(opts.options)) return displaySelect(opts.options, opts);
83
+ return opts.options !== void 0 ? selectFromOptions(opts) : selectFromFact(opts);
71
84
  }
72
- const select = Object.assign(selectDispatch, { of: selectOf });
85
+ const select = selectDispatch;
73
86
  function url(opts) {
74
87
  return {
75
88
  type: "url",
@@ -81,56 +94,71 @@ function image(opts) {
81
94
  return {
82
95
  type: "image",
83
96
  ...head(opts),
84
- ...opts.sourceFilter !== void 0 ? { sourceFilter: opts.sourceFilter } : {},
85
- ...opts.crop !== void 0 ? { crop: opts.crop } : {}
97
+ ...opts.crop !== void 0 ? { crop: opts.crop } : {},
98
+ ...uniqueOf(opts)
86
99
  };
87
100
  }
101
+ function uniqueOf(opts) {
102
+ return opts.unique === true ? { unique: true } : {};
103
+ }
88
104
  function video(opts) {
89
105
  return {
90
106
  type: "video",
91
107
  ...head(opts),
92
108
  ...opts.playback !== void 0 ? { playback: opts.playback } : {},
93
- ...opts.sources !== void 0 ? { sources: opts.sources } : {}
109
+ ...opts.sources !== void 0 ? { sources: opts.sources } : {},
110
+ ...uniqueOf(opts)
94
111
  };
95
112
  }
96
113
  function tour(opts) {
97
114
  return {
98
115
  type: "tour",
99
- ...head(opts)
116
+ ...head(opts),
117
+ ...uniqueOf(opts)
100
118
  };
101
119
  }
102
- const HEAD_KEYS = ["locked"];
120
+ const ITEM_ONLY_KEYS = ["locked", "unique"];
103
121
  function stripElementHead(element) {
104
122
  const bare = {};
105
- for (const [key, value] of Object.entries(element)) if (!HEAD_KEYS.includes(key)) bare[key] = value;
123
+ for (const [key, value] of Object.entries(element)) if (!ITEM_ONLY_KEYS.includes(key)) bare[key] = value;
106
124
  return bare;
107
125
  }
108
- function listOfElement(element, opts) {
109
- if (getFill(element) !== void 0) throw new Error(`list.of: the element of "${opts.label}" declares a fill — one decision produces the whole list, so \`source: fill(…)\` belongs on the list slot.`);
126
+ function itemList(label, element, opts, unique) {
127
+ if (getFill(element) !== void 0) throw new Error(`list: the element of "${label}" declares a fill — one decision produces the whole list, so \`source: fill(…)\` belongs on the list slot.`);
110
128
  return {
111
- type: "list",
112
- ...head(opts),
113
129
  element: stripElementHead(element),
114
130
  ...opts.min !== void 0 ? { min: opts.min } : {},
115
131
  ...opts.max !== void 0 ? { max: opts.max } : {},
116
- ...opts.unique !== void 0 ? { unique: opts.unique } : {}
132
+ ...unique !== void 0 ? { unique } : {}
117
133
  };
118
134
  }
119
- function listOfRecord(fields, opts) {
135
+ function listFromItem(opts) {
136
+ if (opts.unique !== void 0) throw new Error(`list: "${opts.label}" declares \`unique\` on the list — write it on the item, \`item: select({ …, unique: true })\`.`);
137
+ const element = opts.item;
138
+ const unique = element.unique === true ? true : void 0;
120
139
  return {
121
140
  type: "list",
122
141
  ...head(opts),
123
- fields,
124
- ...opts.layout !== void 0 ? { layout: itemLayoutFromRows(opts.layout) } : {},
142
+ ...itemList(opts.label, element, opts, unique)
143
+ };
144
+ }
145
+ function listFromFields(opts) {
146
+ const declared = opts.fields(rowReference(opts.source));
147
+ return {
148
+ type: "list",
149
+ ...head(opts),
150
+ fields: resolveRowFields(opts.label, opts.source, declared),
125
151
  ...opts.title !== void 0 ? { title: opts.title } : {},
126
152
  ...opts.min !== void 0 ? { min: opts.min } : {},
127
153
  ...opts.max !== void 0 ? { max: opts.max } : {}
128
154
  };
129
155
  }
130
- function listOf(item, opts) {
131
- return typeof item.type === "string" ? listOfElement(item, opts) : listOfRecord(item, opts);
156
+ function listDispatch(opts) {
157
+ const hasItem = opts.item !== void 0;
158
+ if (hasItem === (opts.fields !== void 0)) throw new Error(`list: "${String(opts.label)}" declares ${hasItem ? "both `item` and `fields`" : "neither `item` nor `fields`"} — a list declares exactly one: \`item\` for one slot per entry, \`fields\` for a record.`);
159
+ return hasItem ? listFromItem(opts) : listFromFields(opts);
132
160
  }
133
- const list = { of: listOf };
161
+ const list = listDispatch;
134
162
  function poi(opts) {
135
163
  return {
136
164
  type: "poi",
@@ -140,7 +168,8 @@ function poi(opts) {
140
168
  function document(opts) {
141
169
  return {
142
170
  type: "document",
143
- ...head(opts)
171
+ ...head(opts),
172
+ ...uniqueOf(opts)
144
173
  };
145
174
  }
146
175
 
@@ -31,13 +31,29 @@ interface FactRef<Key extends string = string, Value = unknown> {
31
31
  /** Phantom: the value a `compute()` callback receives for this ref. Never present at runtime. */
32
32
  readonly __value?: Value;
33
33
  }
34
+ /**
35
+ * One member of the row a record list hands each row — what `row.<member>` IS
36
+ * inside `list({ fields: (row) => … })`, and what an earlier field of the same row
37
+ * becomes once the list resolves it. Its runtime shape is its wire shape, as a fact
38
+ * ref's is: `{kind:"row", field}`, which the row field's `source:` emits verbatim.
39
+ * It resolves against the current row, never the primary one — that is what
40
+ * `fact.unit.*` / `fact.contact.*` name.
41
+ */
42
+ interface RowRef<Field extends string = string, Value = unknown, Writable extends boolean = boolean> {
43
+ readonly kind: "row";
44
+ readonly field: Field;
45
+ /** Phantom: the member's value type. Never present at runtime. */
46
+ readonly __value?: Value;
47
+ /** Phantom: whether the member writes back, which decides a row field's `writeback`. Never present at runtime. */
48
+ readonly __writable?: Writable;
49
+ }
34
50
  /**
35
51
  * A typed handle on one value the platform can resolve — what `source:`, a
36
52
  * `compute`'s `reads` and a fill decision's `reads` all take. A new kind is
37
53
  * additive: it answers where its value comes from and when it settles, and
38
54
  * changes no consumer.
39
55
  */
40
- type Ref = FactRef | SlotRef;
56
+ type Ref = FactRef | SlotRef | RowRef;
41
57
  /** A slot of the declaring section, named by its own const — see the module header. */
42
58
  type SiblingSlot = Slot;
43
59
  /** What a `compute`'s or a fill's `reads` (and a mirror's `source:`) may name: any ref, or a sibling slot. */
@@ -60,4 +76,4 @@ type ReadValue<R> = R extends SlotRef ? RefValue<R> | undefined : R extends Sibl
60
76
  */
61
77
  type RefValues<Reads extends readonly ComputeRead[]> = { -readonly [I in keyof Reads]: ReadValue<Reads[I]>; };
62
78
  //#endregion
63
- export { ComputeRead, DISPLAY_REF_PREFIX, DisplayEntryName, FactRef, ReadValue, Ref, RefValue, RefValues, SiblingSlot, SlotRef };
79
+ export { ComputeRead, DISPLAY_REF_PREFIX, DisplayEntryName, FactRef, ReadValue, Ref, RefValue, RefValues, RowRef, SiblingSlot, SlotRef };
@@ -3,6 +3,9 @@ const DISPLAY_REF_PREFIX = "display.";
3
3
  function isSlotRef(x) {
4
4
  return typeof x === "object" && x !== null && "section" in x && typeof x.section === "string" && "slot" in x && typeof x.slot === "string";
5
5
  }
6
+ function isRowRef(x) {
7
+ return typeof x === "object" && x !== null && "kind" in x && x.kind === "row" && "field" in x && typeof x.field === "string";
8
+ }
6
9
  function isFactRef(x) {
7
10
  return typeof x === "object" && x !== null && "kind" in x && x.kind === "direct" && "field" in x && typeof x.field === "string";
8
11
  }
@@ -17,17 +20,22 @@ function serializeSlotRef(ref) {
17
20
  };
18
21
  }
19
22
  function serializeRef(ref) {
20
- return isSlotRef(ref) ? serializeSlotRef(ref) : {
23
+ if (isSlotRef(ref)) return serializeSlotRef(ref);
24
+ if (isRowRef(ref)) return {
25
+ kind: "row",
26
+ field: ref.field
27
+ };
28
+ return {
21
29
  kind: "fact",
22
30
  key: ref.field
23
31
  };
24
32
  }
25
33
  function isSerializedSlotRef(ref) {
26
- return ref.kind !== "fact";
34
+ return ref.kind !== "fact" && ref.kind !== "row";
27
35
  }
28
36
  function serializedSlotRefs(reads) {
29
37
  return reads.filter(isSerializedSlotRef);
30
38
  }
31
39
 
32
40
  //#endregion
33
- export { DISPLAY_REF_PREFIX, isFactRef, isSerializedSlotRef, isSiblingSlot, isSlotRef, serializeRef, serializeSlotRef, serializedSlotRefs };
41
+ export { DISPLAY_REF_PREFIX, isFactRef, isRowRef, isSerializedSlotRef, isSiblingSlot, isSlotRef, serializeRef, serializeSlotRef, serializedSlotRefs };
@@ -43,22 +43,26 @@ type SelectSlot = SlotBase & {
43
43
  source: string;
44
44
  };
45
45
  creatable?: boolean;
46
+ /** A record field's cross-row distinctness — stored on a record's select or media field only. */
47
+ unique?: boolean;
46
48
  };
47
49
  /** Kind-level def type for an `image` slot — `SlotBinding<ImageSlot>` accepts any image slot. */
48
50
  type ImageSlot = SlotBase & {
49
51
  type: "image";
50
- sourceFilter?: string;
51
52
  crop?: unknown;
53
+ unique?: boolean;
52
54
  };
53
55
  /** Kind-level def type for a `video` slot — `SlotBinding<VideoSlot>` accepts any video slot. */
54
56
  type VideoSlot = SlotBase & {
55
57
  type: "video";
56
58
  playback?: unknown;
57
59
  sources?: unknown;
60
+ unique?: boolean;
58
61
  };
59
62
  /** Kind-level def type for a `tour` slot — `SlotBinding<TourSlot>` accepts any tour slot. */
60
63
  type TourSlot = SlotBase & {
61
64
  type: "tour";
65
+ unique?: boolean;
62
66
  };
63
67
  /** Kind-level def type for a `list` slot — the item is `element` (a single primitive) XOR `fields` (a record of slots). */
64
68
  type ListSlot = SlotBase & {
@@ -69,13 +73,8 @@ type ListSlot = SlotBase & {
69
73
  element?: Slot;
70
74
  fields?: Record<string, ListFieldSlot>;
71
75
  title?: string;
72
- /** CI-stamped order-stable field order for a record item — JSONB drops key order. */
76
+ /** CI-stamped record-item field order — the declaration order, which JSONB would drop. */
73
77
  item_order?: string[];
74
- /**
75
- * A record item's nestable field layout: a bare id is full-width, an
76
- * `[a, b]` tuple is one 2-up row. CI emits `item_order = flatten(layout)`.
77
- */
78
- layout?: (string | [string, string])[];
79
78
  };
80
79
  /** Kind-level def type for a `poi` slot — one platform-built place; `SlotBinding<PoiSlot>` accepts any poi slot. */
81
80
  type PoiSlot = SlotBase & {
@@ -89,6 +88,7 @@ type UrlSlot = SlotBase & {
89
88
  /** Kind-level def type for a `document` slot — `SlotBinding<DocumentSlot>` accepts any document slot. */
90
89
  type DocumentSlot = SlotBase & {
91
90
  type: "document";
91
+ unique?: boolean;
92
92
  };
93
93
  /** Every slot kind an author may declare at a section's top level. */
94
94
  type Slot = ListItemSlot | ListSlot;
@@ -25,14 +25,21 @@ const playbackConfigShape = { playback: z.object({
25
25
  ]).optional()
26
26
  }).strict().refine((p) => p.autoplay !== true || p.muted === true, { message: "autoplay requires muted (browsers block unmuted autoplay)" }).optional() };
27
27
  const videoSourcesShape = { sources: z.array(z.enum(VIDEO_SOURCES)).nonempty().optional() };
28
- const SerializedReads = z.array(z.union([z.object({
29
- kind: z.literal("fact"),
30
- key: z.string().min(1)
31
- }).strict(), z.object({
32
- kind: z.literal("slot").default("slot"),
33
- section: z.string().min(1),
34
- slot: z.string().min(1)
35
- }).strict()])).min(1).optional();
28
+ const SerializedReads = z.array(z.union([
29
+ z.object({
30
+ kind: z.literal("fact"),
31
+ key: z.string().min(1)
32
+ }).strict(),
33
+ z.object({
34
+ kind: z.literal("row"),
35
+ field: z.string().min(1)
36
+ }).strict(),
37
+ z.object({
38
+ kind: z.literal("slot").default("slot"),
39
+ section: z.string().min(1),
40
+ slot: z.string().min(1)
41
+ }).strict()
42
+ ])).min(1).optional();
36
43
  const slotMetadataShape = {
37
44
  label: z.string().min(1),
38
45
  placeholder: z.string().optional(),
@@ -43,6 +50,10 @@ const slotMetadataShape = {
43
50
  kind: z.literal("direct"),
44
51
  field: z.string()
45
52
  }).strict(),
53
+ z.object({
54
+ kind: z.literal("row"),
55
+ field: z.string().min(1)
56
+ }).strict(),
46
57
  z.object({
47
58
  kind: z.literal("derived"),
48
59
  transform: z.string(),
@@ -85,10 +96,7 @@ const SLOT_TYPE_DESCRIPTORS = {
85
96
  default: () => null
86
97
  },
87
98
  image: {
88
- shape: {
89
- sourceFilter: z.string().optional(),
90
- ...cropConfigShape
91
- },
99
+ shape: { ...cropConfigShape },
92
100
  default: () => ({
93
101
  url: "",
94
102
  alt: ""
@@ -122,8 +130,7 @@ const SLOT_TYPE_DESCRIPTORS = {
122
130
  element: z.lazy(() => ListItemDef).optional(),
123
131
  fields: z.record(z.string(), z.lazy(() => ListFieldDef)).optional(),
124
132
  title: z.string().optional(),
125
- item_order: z.array(z.string()).optional(),
126
- layout: z.array(z.union([z.string(), z.tuple([z.string(), z.string()])])).optional()
133
+ item_order: z.array(z.string()).optional()
127
134
  },
128
135
  default: () => []
129
136
  },
@@ -148,10 +155,8 @@ function slotMember(type, shape) {
148
155
  ...slotMetadataShape
149
156
  }).strict();
150
157
  }
151
- const LIST_ITEM_DEF_MEMBERS = [
152
- slotMember("text", SLOT_TYPE_DESCRIPTORS.text.shape),
153
- slotMember("number", SLOT_TYPE_DESCRIPTORS.number.shape),
154
- slotMember("select", SLOT_TYPE_DESCRIPTORS.select.shape),
158
+ const SCALAR_DEF_MEMBERS = [slotMember("text", SLOT_TYPE_DESCRIPTORS.text.shape), slotMember("number", SLOT_TYPE_DESCRIPTORS.number.shape)];
159
+ const MEDIA_AND_LINK_DEF_MEMBERS = [
155
160
  slotMember("image", SLOT_TYPE_DESCRIPTORS.image.shape),
156
161
  slotMember("video", SLOT_TYPE_DESCRIPTORS.video.shape),
157
162
  slotMember("tour", SLOT_TYPE_DESCRIPTORS.tour.shape),
@@ -159,6 +164,11 @@ const LIST_ITEM_DEF_MEMBERS = [
159
164
  slotMember("url", SLOT_TYPE_DESCRIPTORS.url.shape),
160
165
  slotMember("document", SLOT_TYPE_DESCRIPTORS.document.shape)
161
166
  ];
167
+ const LIST_ITEM_DEF_MEMBERS = [
168
+ ...SCALAR_DEF_MEMBERS,
169
+ slotMember("select", SLOT_TYPE_DESCRIPTORS.select.shape),
170
+ ...MEDIA_AND_LINK_DEF_MEMBERS
171
+ ];
162
172
  const ListItemDef = z.discriminatedUnion("type", [...LIST_ITEM_DEF_MEMBERS]);
163
173
  const FIELD_LIST_DEF_MEMBER = slotMember("list", {
164
174
  min: z.number().int().nonnegative().optional(),
@@ -166,7 +176,33 @@ const FIELD_LIST_DEF_MEMBER = slotMember("list", {
166
176
  unique: z.boolean().optional(),
167
177
  element: z.lazy(() => ListItemDef).optional()
168
178
  });
169
- const ListFieldDef = z.discriminatedUnion("type", [...LIST_ITEM_DEF_MEMBERS, FIELD_LIST_DEF_MEMBER]);
179
+ const ROW_UNIQUE = { unique: z.boolean().optional() };
180
+ const ListFieldDef = z.discriminatedUnion("type", [
181
+ ...SCALAR_DEF_MEMBERS,
182
+ slotMember("select", {
183
+ ...SLOT_TYPE_DESCRIPTORS.select.shape,
184
+ ...ROW_UNIQUE
185
+ }),
186
+ slotMember("image", {
187
+ ...SLOT_TYPE_DESCRIPTORS.image.shape,
188
+ ...ROW_UNIQUE
189
+ }),
190
+ slotMember("video", {
191
+ ...SLOT_TYPE_DESCRIPTORS.video.shape,
192
+ ...ROW_UNIQUE
193
+ }),
194
+ slotMember("tour", {
195
+ ...SLOT_TYPE_DESCRIPTORS.tour.shape,
196
+ ...ROW_UNIQUE
197
+ }),
198
+ slotMember("poi", SLOT_TYPE_DESCRIPTORS.poi.shape),
199
+ slotMember("url", SLOT_TYPE_DESCRIPTORS.url.shape),
200
+ slotMember("document", {
201
+ ...SLOT_TYPE_DESCRIPTORS.document.shape,
202
+ ...ROW_UNIQUE
203
+ }),
204
+ FIELD_LIST_DEF_MEMBER
205
+ ]);
170
206
  const SLOT_DEF_MEMBERS = [...LIST_ITEM_DEF_MEMBERS, slotMember("list", SLOT_TYPE_DESCRIPTORS.list.shape)];
171
207
  const SlotDef = z.discriminatedUnion("type", [...SLOT_DEF_MEMBERS]);
172
208
  function defaultForSlotType(type) {
@@ -16,7 +16,7 @@ interface SectionOptions<Key extends string, Slots extends Record<string, Slot>,
16
16
  readonly label: string;
17
17
  /** A required section is required wherever it is placed. Defaults to `false`. */
18
18
  readonly required?: boolean;
19
- /** Section `visibility` / `variant`, each an optional `select(cases, …)` entry. */
19
+ /** Section `visibility` / `variant`, each an optional `select({ options: cases, … })` entry. */
20
20
  readonly display?: Display;
21
21
  /** The slot declarations, in editor order. */
22
22
  readonly slots: Slots;
@@ -19,9 +19,9 @@ interface SectionPlacementProps {
19
19
  interface SectionRenderBindings<Slots extends Record<string, Slot>, Display extends DisplayInput> {
20
20
  /**
21
21
  * One binding per declared slot, keyed by slot id — what `bindSlots` returned to a Renderer.
22
- * There is no raw `slots` beside it: a record list bound whole-row to a collection keeps
23
- * every member the platform bakes onto its rows on the bound row itself
24
- * (`slot.comps.value[n].status`), declared as a row field or not.
22
+ * There is no raw `slots` beside it. A record list's bound row is its identity plus
23
+ * its declared fields: a collection member the section reads is declared as a row
24
+ * field bound to that member (`source: comp.status`).
25
25
  */
26
26
  readonly slot: SlotBindingMap<SectionSchemaOf<Slots, Display>>;
27
27
  /** The build-injected navigation input: this section's anchor, the anchor map, the pages. */
@@ -1,12 +1,12 @@
1
1
  import { ATTR_ISLAND_FRAMELESS, ATTR_ISLAND_ID, ATTR_ISLAND_KEY, ATTR_ISLAND_PROPS, EDITOR_BRIDGE_PROP, EDITOR_BRIDGE_PROTOCOL, EditorBridge, EditorBridgeSelection, EditorSelection, ISLAND_CAPTURE_HOLDS_GLOBAL, ISLAND_ELEMENT, IslandComponent, IslandEditor, IslandEditorOptions, IslandModule, IslandProps, IslandPropsError, IslandServerFrame, deserializeIslandProps, islandId, serializeIslandProps } from "../packages/internal/island-runtime/dist/contract.js";
2
2
  import { fill } from "../schema/fill-builders.js";
3
3
  import { Slot as Slot$1 } from "../schema/slot-types.js";
4
- import { fact } from "../schema/fact.js";
5
4
  import { compute, getComputed } from "../schema/compute.js";
6
5
  import { document, image, list, number, poi, select, text, tour, url, video } from "../schema/slot-builders.js";
7
6
  import { DisplayInput } from "../schema/define-schema.js";
8
7
  import { SectionDeclaration, SectionOptions } from "../section/declare.js";
9
8
  import { ATTR_SECTION_INSTANCE_ID, ATTR_SLOT_FIELD, ATTR_SLOT_GROUP, ATTR_SLOT_ID, ATTR_SLOT_ITEM, ATTR_SLOT_TEXT_LEAF, ATTR_SLOT_UNSELECTABLE, ATTR_TR_ENHANCE } from "../packages/internal/template-contracts/dist/markers.js";
9
+ import { fact } from "../schema/fact.js";
10
10
  import { presets } from "../schema/format-presets.js";
11
11
  import { a4Landscape, a4Portrait, deck16x9, facebookPost, halfLetterFlyer, instagramPortrait, instagramSquare, instagramStory, letterLandscape, letterPortrait, linkedinPost, postcard6x4, postcard7x5, website, xPost } from "../schema/formats.js";
12
12
  //#region src/template/logic-shim.d.ts
@@ -3,7 +3,7 @@ purpose: Every `concrete` command, with its full flag surface, exit codes and co
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [INDEX.md]
8
8
  ---
9
9
  # Command reference
@@ -79,7 +79,7 @@ of its flags.
79
79
 
80
80
  ## Versions
81
81
 
82
- These pages describe `@homepages/concrete` **>=6.0.0 <7.0.0**. The range, rather than
82
+ These pages describe `@homepages/concrete` **>=8.0.0 <9.0.0**. The range, rather than
83
83
  the exact version they were generated from: this reference is committed build output,
84
84
  so a page stamped with a patch version would be stale the day it shipped.
85
85
  `concrete --version` prints the installed one.
@@ -3,7 +3,7 @@ purpose: The `concrete build` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete build
@@ -3,7 +3,7 @@ purpose: The `concrete check` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete check
@@ -3,7 +3,7 @@ purpose: The `concrete dev` command — its flags, exit codes and constraints.
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete dev
@@ -3,7 +3,7 @@ purpose: The `concrete property add` command — its flags, exit codes and const
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete property add
@@ -3,7 +3,7 @@ purpose: The `concrete property list` command — its flags, exit codes and cons
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete property list
@@ -3,7 +3,7 @@ purpose: The `concrete publish` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete publish
@@ -3,7 +3,7 @@ purpose: The `concrete upgrade` command — its flags, exit codes and constraint
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete command table
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/INDEX.md]
8
8
  ---
9
9
  # concrete upgrade
@@ -3,7 +3,7 @@ purpose: Every rule `concrete check` grades, by the stage that grades it, in the
3
3
  mode: reference
4
4
  status: generated
5
5
  generated_from: the concrete rule registry
6
- applies_to: "@homepages/concrete >=6.0.0 <7.0.0"
6
+ applies_to: "@homepages/concrete >=8.0.0 <9.0.0"
7
7
  related: [reference/cli/check.md]
8
8
  ---
9
9
  # Rule reference
@@ -141,13 +141,10 @@ Every placed section's schema and fill spec satisfy the contract assertions publ
141
141
  | Rule | Venue | What it requires |
142
142
  |---|---|---|
143
143
  | `concrete/contract/reads-readable` | contract | Every fact a section reads is one the fact registry declares. |
144
- | `concrete/contract/decision-kind` | contract | Every fill decision names a kind the platform runs: text, pick, list or display. |
144
+ | `concrete/contract/decision-kind` | contract | Every fill decision names a kind the platform runs: text, number, pick, list or display. |
145
145
  | `concrete/contract/produces-known-slot` | contract | Every fill decision produces only slots the section declares. |
146
146
  | `concrete/contract/poi-curation` | contract | A points-of-interest curation decision produces exactly one slot, a list of points of interest. |
147
- | `concrete/contract/list-fill` | contract | A list fill declares what the slot's own origination needs: a brief where the model originates rows, a bound where it writes them, nothing on a fact-bound list. |
148
- | `concrete/contract/choose-select` | contract | A record list the model originates is keyed by its title field, else by exactly one select field with declared values. |
149
- | `concrete/contract/name-title` | contract | A list keyed by a written name needs that field to be capped text that carries no fill of its own. |
150
- | `concrete/contract/pooling-field` | contract | A list fill's record item declares at most one unbound pooled asset field. |
147
+ | `concrete/contract/list-fill` | contract | A list fill declares what the slot's own origination needs: rows bound to facts or filled field by field, a brief where the model originates rows, a bound where it writes them. |
151
148
  | `concrete/contract/row-fill` | contract | A list fill plans only unbound fields its record item declares, each of a type a row can be filled with. |
152
149
  | `concrete/contract/count-bounds` | contract | Every item count a decision requests fits the bounds of the slot or row field that holds the items. |
153
150
  | `concrete/contract/cap` | contract | Every generated text value has one character budget, declared on its slot, and a fill cap may only be lower. |
@@ -161,11 +158,9 @@ Every placed section's schema and fill spec satisfy the contract assertions publ
161
158
  | `concrete/contract/select` | contract | A select declares exactly one of values or options, and a creatable select's keys are normalized. |
162
159
  | `concrete/contract/option-source` | contract | A select with an option source names a source the platform provides. |
163
160
  | `concrete/contract/url` | contract | A url slot's accepts names a link kind or provider that a registered provider implements. |
164
- | `concrete/contract/source-filter` | contract | A media slot's source filter names a filter the platform supports. |
165
161
  | `concrete/contract/sources` | contract | Only a video slot declares sources, as a non-empty list of distinct known video sources. |
166
162
  | `concrete/contract/interpolation` | contract | A fill brief refers to its facts through reads and never interpolates one. |
167
163
  | `concrete/contract/group` | contract | Group ids are unique, every group names real slots, and no slot sits in two groups. |
168
- | `concrete/contract/row` | contract | Every two-up row pairs adjacent short slots, and a record item's layout lists each field exactly once. |
169
164
 
170
165
  ## render
171
166
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homepages/concrete",
3
- "version": "6.2.0",
3
+ "version": "8.0.0",
4
4
  "description": "Concrete, the HomePages template framework: the authoring API, the contract primitives, the styles, the lint preset and the `concrete` command in one package that owns its whole toolchain.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -7,6 +7,7 @@
7
7
  "jsx": "react-jsx",
8
8
  "strict": true,
9
9
  "noUncheckedIndexedAccess": true,
10
+ "noUncheckedSideEffectImports": true,
10
11
  "esModuleInterop": true,
11
12
  "skipLibCheck": true,
12
13
  "isolatedModules": true,