@homepages/concrete 9.0.0 → 9.1.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 (67) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +2 -2
  3. package/codemods/manifest.json +4 -0
  4. package/dist/artifact/playground/client/assets/index-BOYbgBnP.js +1259 -0
  5. package/dist/artifact/playground/client/index.html +1 -1
  6. package/dist/artifact/playground/host.mjs +24 -24
  7. package/dist/cli/check/stages/workspace.js +2 -0
  8. package/dist/cli/check/template-key.js +16 -0
  9. package/dist/fixtures/resolve.js +4 -7
  10. package/dist/packages/external/concrete/package.js +1 -1
  11. package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +1 -1
  12. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +8 -22
  13. package/dist/packages/internal/fill-bake/dist/compute-reads.js +4 -8
  14. package/dist/packages/internal/fill-bake/dist/derive-source.js +7 -14
  15. package/dist/packages/internal/fill-bake/dist/index.js +3 -2
  16. package/dist/packages/internal/fill-bake/dist/item-merge.js +4 -10
  17. package/dist/packages/internal/fill-bake/dist/item-overrides.js +1 -28
  18. package/dist/packages/internal/fill-bake/dist/linked-merge.js +1 -3
  19. package/dist/packages/internal/fill-bake/dist/list-grammar.js +10 -11
  20. package/dist/packages/internal/fill-bake/dist/stored-row-reader.js +1 -0
  21. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +11 -38
  22. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +2 -17
  23. package/dist/packages/internal/media-resolution/dist/image.js +6 -8
  24. package/dist/packages/internal/media-resolution/dist/list.js +1 -1
  25. package/dist/packages/internal/media-resolution/dist/slot.js +4 -1
  26. package/dist/packages/internal/media-resolution/dist/tour.js +1 -1
  27. package/dist/packages/internal/media-resolution/dist/video.js +1 -1
  28. package/dist/packages/internal/property-facts/dist/registry-facts.js +2 -1
  29. package/dist/packages/internal/section-contracts/dist/catalog.js +1 -5
  30. package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +4 -10
  31. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +1 -5
  32. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +2 -2
  33. package/dist/packages/internal/section-contracts/dist/grammar-scope.js +1 -1
  34. package/dist/packages/internal/section-contracts/dist/index.js +0 -1
  35. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +0 -29
  36. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +2 -16
  37. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +6 -6
  38. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +6 -2
  39. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +0 -14
  40. package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +3 -6
  41. package/dist/packages/internal/section-contracts/dist/runners.js +4 -9
  42. package/dist/packages/internal/section-contracts/dist/source-contract.js +10 -73
  43. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +5 -10
  44. package/dist/packages/internal/source-resolution/dist/index.js +7 -8
  45. package/dist/packages/internal/template-contracts/dist/decision-fills.js +2 -6
  46. package/dist/packages/internal/template-contracts/dist/fact-registry.js +4 -4
  47. package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +3 -68
  48. package/dist/packages/internal/template-contracts/dist/list-editing.js +0 -1
  49. package/dist/packages/internal/template-contracts/dist/media-candidates.js +1 -1
  50. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +2 -2
  51. package/dist/packages/internal/template-contracts/dist/read-graph.js +9 -19
  52. package/dist/packages/internal/template-contracts/dist/ref-locate.js +8 -24
  53. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +2 -0
  54. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +2 -8
  55. package/dist/packages/internal/template-contracts/dist/row-sources.js +3 -13
  56. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +1 -32
  57. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +0 -4
  58. package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -2
  59. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +7 -9
  60. package/dist/primitives/slot-bindings.js +2 -2
  61. package/dist/rules/registry.js +6 -0
  62. package/dist/section/section.d.ts +2 -2
  63. package/guide/reference/rules/INDEX.md +2 -2
  64. package/package.json +1 -1
  65. package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +0 -1259
  66. package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +0 -15
  67. package/dist/packages/internal/section-contracts/dist/group-contract.js +0 -19
@@ -359,7 +359,7 @@ const site_url = url({ label: "Website" });
359
359
  const UNIT_PLANS_BRIEF = "Is this floor plan labelled for this unit? Its label is read from its name and the text printed on it, never from the rooms drawn or any figures. It belongs when its label names this unit: the unit's label or a plain variant of it (\"Unit 3\", \"#3\", \"Apt 3\" and \"Residence 3\" all label \"Unit 3\"); a descriptor the unit's label carries in brackets, like \"(PH)\", may be left off. A plan labelling several units, such as a shared floor printed \"Unit 1/2/3\", belongs to each of them. It is excluded when it labels other units and not this one. When it labels no unit, you cannot tell. Order what belongs from the lowest floor to the highest.";
360
360
  const UNIT_PHOTOS_BRIEF = "Is this photo labelled for this unit? Its label is read from its name, the text printed on it and a caption its account records, never from the rooms it shows, any figures, how much it looks like the unit or where it falls among the uploads. It belongs when its label names this unit: the unit's label or a plain variant of it (\"Unit 3\", \"#3\", \"Apt 3\" and \"Residence 3\" all label \"Unit 3\"); a descriptor the unit's label carries in brackets, like \"(PH)\", may be left off. A photo labelled for several units belongs to each of them. It is excluded when it labels other units and not this one. When it labels no unit, you cannot tell.";
361
361
  const UNITS_BRIEF = [
362
- "List every dwelling the uploads present with its own specs printed — its beds, baths, square feet, asking price or rent written out for that dwelling: the home a listing describes, or each unit a building's documents name or number. A dwelling the uploads only name, picture or mark with a status, with no specs of its own, is not listed. A plan or row printed for several units (\"Unit 4/6\") lists each of those units, each with what is printed for it. A dwelling named in several uploads, or on several pages, is one item carrying everything they print for it. A unit-mix row standing for several unnamed units is not a dwelling; neither is a whole building, a comparable property, a market average or a portfolio total.",
362
+ "List every dwelling the uploads present with its own specs printed — its beds, baths, square feet, asking price or rent written out for that dwelling: the home a listing describes, or each unit a building's documents name or number. A dwelling the uploads only name, picture or mark with a status, with no specs of its own, is not listed. A plan or row printed for several units (\"Unit 4/6\") lists each of those units, each with what is printed for it. A dwelling named in several uploads, or on several pages, is one item carrying everything they print for it. A unit-mix row standing for several unnamed units is not a dwelling; neither is a commercial space, a whole building, a comparable property, a market average or a portfolio total.",
363
363
  "Every member is what an upload prints as text for that dwelling, and nothing else. An upload's own text, as its account quotes it (a document's or a sheet's content, an image's printed words), is what it prints; the account's description of what a drawing, a photo or a map shows (the rooms, the doors, the spaces) is never a member's source. Never count rooms; never compute, round or convert a figure; never carry one across from another dwelling, a unit-mix average or the building's totals; never add what is usual for a dwelling of its kind. A figure printed for a neighbourhood, a development or the building is never a dwelling's, and a count or fee is 0 only where the uploads print none for that dwelling. A member no upload prints for that dwelling is null, and a null is always better than a guess.",
364
364
  "label: the unit's own name as printed — its unit number or name (\"201\", \"Residence 201\", \"4B\", \"Penthouse 501\"), without a word marking its status (\"model\", \"available\") — and never its street address. A dwelling presented alone, with no unit name, is always labelled \"Home\", whatever name the uploads print for the home itself.",
365
365
  "beds, baths, sqft: exactly as printed for that dwelling; a studio has one bedroom.",
@@ -368,7 +368,7 @@ const UNITS_BRIEF = [
368
368
  "hoa_monthly: the HOA, condo or strata fee printed per month for that dwelling. A fee printed for another period, or for the building, is null.",
369
369
  "parking: the number of parking spaces printed for that dwelling (\"1 deeded space\" is 1, \"two-car garage\" is 2). Parking printed with no count, or for the building, is null.",
370
370
  "lot_sqft: the lot size printed in square feet for that dwelling: a home's own lot. A lot in another unit, or the lot of a building several dwellings share, is null.",
371
- "amenities: the real selling points of that dwelling, the qualitative features a client would notice that its beds, baths, size, floor, parking and price do not already say, such as \"Private roof deck\", \"Harbor views\", \"Corner exposure\". Name only what an upload says about that dwelling, in a few words. Never make one up and never add one just to fill the list: a feature the whole building shares, a routine fitting or finish, a note printed on a plan (which way a door opens, extra space) or a restated size is not a selling point. Most dwellings have none to three; leave the list empty when nothing stands out.",
371
+ "amenities: a feature this dwelling has that the other dwellings in its building do not, in a few words as an upload states it, such as \"Private roof deck\", \"Corner unit\", \"Harbor views\". Check each one against the other dwellings: a feature printed for two of them, or for the building, is the building's and goes on no dwelling, however a sheet praises it; a routine fitting or finish, a note printed on a plan, or what its other members already say sets nothing apart. Most dwellings have none. Leave the list empty when nothing is this one's alone.",
372
372
  "When the uploads present no dwelling with its own specs printed, return no items."
373
373
  ].join("\n\n");
374
374
  const unitLabel = text.short({ label: "Unit" });
@@ -469,7 +469,7 @@ const COMMERCIAL_SPACES_BRIEF = [
469
469
  "price: the rent or price as written for that space (\"$45/SF/yr\", \"$8,500/mo\"), or its status word (\"Leased\", \"Call for pricing\").",
470
470
  "floor: the floor of its building the space sits on, as printed (\"1\", \"Ground\", \"Mezzanine\"); never read off its suite number.",
471
471
  "parking: the number of parking spaces printed for that space. Parking printed with no count, or for the building, is null.",
472
- "amenities: the real selling points of that space, the qualitative features a tenant would notice that its use, size, floor, parking and price do not already say, such as \"Corner frontage\", \"Drive-thru\", \"Grease trap\". Name only what an upload says about that space, in a few words. Never make one up and never add one just to fill the list: a feature the whole building shares, a routine fitting or finish, a note printed on a plan or a restated size is not a selling point. Most spaces have none to three; leave the list empty when nothing stands out.",
472
+ "amenities: a feature this space has that the other spaces in its building do not, in a few words as an upload states it, such as \"Corner frontage\", \"Drive-thru\", \"Grease trap\". Check each one against the other spaces: a feature printed for two of them, or for the building, is the building's and goes on no space, however a sheet praises it; a routine fitting or finish, a note printed on a plan, or what its other members already say sets nothing apart. Most spaces have none. Leave the list empty when nothing is this one's alone.",
473
473
  "When the uploads present no commercial space with its own specs printed, return no items."
474
474
  ].join("\n\n");
475
475
  const spaceLabel = text.short({ label: "Space" });
@@ -500,7 +500,7 @@ const commercial_spaces = page({
500
500
  }
501
501
  })
502
502
  }));
503
- const COMPARABLES_BRIEF = "The uploads may present comparable properties — other properties set beside the one being marketed for comparison. Find every one and return it as an item. A comparable may appear as a row in a sales or rent comparables table, as a panel with its own photo and figures, as a numbered pin in a map legend, or as a line in a survey of recent trades. Read every upload whole, including tables that continue from one page to the next. Copy each figure exactly as an upload states it for that property, and each listing's remarks word for word. Specs come only from what is printed as text: never count rooms or take a figure from what a floor plan drawing, a photo or a map shows; a studio has one bedroom. Never compute one: not by multiplying a price per unit by a unit count, not by dividing a price by a size, not by counting the days between two dates, not by converting a yearly fee to a monthly one, not by averaging rows, and never by carrying a figure across from a neighbouring row, a summary or the subject. If a property is listed in more than one place — on several pages, or in several uploads — return one item carrying every figure those places state. A figure no upload states for that property is null; a null is always better than a guess. Do not return the subject property — the one at the read address, which the uploads are marketing — even where it appears in a comparables table or at the centre of a comparables map, and do not return a market, submarket or area average, a portfolio total, or anything that is not an individual property. When no upload presents a comparable property, return no items.";
503
+ const COMPARABLES_BRIEF = "The uploads may present comparable properties: other properties an upload sets beside the subject for comparison. The subject is the property the uploads are marketing, at the read address; in a building, that is the building and every unit the uploads market in it. Find every comparable and return it as an item. A property is a comparable because an upload compares it with the subject, and it may appear as a row in a sales or rent comparables table, as a panel with its own photo and figures, as a numbered pin in a map legend, or as a line in a survey of recent trades. An upload presenting the subject or one of its units for itself, such as its listing sheet, brochure, price list or market history, presents the subject, whatever unit line it prints beside the read street. Read every upload whole, including tables that continue from one page to the next. Copy each figure exactly as an upload states it for that property, and each listing's remarks word for word. Specs come only from what is printed as text: never count rooms or take a figure from what a floor plan drawing, a photo or a map shows; a studio has one bedroom. Never compute one: not by multiplying a price per unit by a unit count, not by dividing a price by a size, not by counting the days between two dates, not by converting a yearly fee to a monthly one, not by averaging rows, and never by carrying a figure across from a neighbouring row, a summary or the subject. If a property is listed in more than one place — on several pages, or in several uploads — return one item carrying every figure those places state. A figure no upload states for that property is null; a null is always better than a guess. Never return the subject, even where it appears in a comparables table or at the centre of a comparables map. Another unit of the subject's building is a comparable only where an upload sets it beside the subject as one, such as a sister unit's earlier sale in a comps table. Do not return a market, submarket or area average, a portfolio total, or anything that is not an individual property. When no upload compares another property with the subject, return no items.";
504
504
  const comparablePlace = address({ label: "Address" });
505
505
  const comparableSaleDate = date({ label: "Sale date" });
506
506
  const comparables = page({
@@ -12,7 +12,6 @@ const Verb = z.enum([
12
12
  "find"
13
13
  ]);
14
14
  const Of = z.union([
15
- HomeRefDef,
16
15
  z.array(HomeRefDef).min(1),
17
16
  SectionRefDef,
18
17
  z.object({
@@ -35,97 +34,39 @@ function fillOf(verbs) {
35
34
  }).strict();
36
35
  }
37
36
  function fillsOf(verbs) {
38
- return z.array(fillOf(verbs)).min(1).optional();
39
- }
40
- const FLAT_FILL_KEYS = [
41
- "verb",
42
- "unique",
43
- "brief",
44
- "none",
45
- "reads"
46
- ];
47
- function oneSpelling(node, ctx, at, fillable) {
48
- const flat = FLAT_FILL_KEYS.filter((key) => node[key] !== void 0 && !(key === "reads" && node["kind"] === "display"));
49
- if (node["fills"] !== void 0 && flat.length > 0) {
50
- ctx.addIssue({
51
- code: "custom",
52
- path: at,
53
- message: `carries both \`fills\` and the flat ${flat.map((key) => `\`${key}\``).join(", ")} — one spelling of its fills`
54
- });
55
- return;
56
- }
57
- if (node["fills"] !== void 0) return;
58
- const hasFlatFill = node["verb"] !== void 0 || node["brief"] !== void 0;
59
- if (hasFlatFill && node["brief"] === void 0) ctx.addIssue({
60
- code: "custom",
61
- path: at,
62
- message: "declares a verb with no `brief`"
63
- });
64
- if (hasFlatFill && node["verb"] === void 0 && fillable === "always") ctx.addIssue({
65
- code: "custom",
66
- path: at,
67
- message: "declares a `brief` with no verb"
68
- });
69
- if (!hasFlatFill && fillable === "always") ctx.addIssue({
70
- code: "custom",
71
- path: at,
72
- message: "declares no fill — `fills`, or the flat `verb` and `brief`"
73
- });
37
+ return z.array(fillOf(verbs)).min(1);
74
38
  }
75
39
  const ItemFieldDecision = z.object({
76
- verb: Verb.optional(),
77
40
  of: Of,
78
- unique: Unique,
79
- brief: Brief.optional(),
80
- none: Abstention,
81
- reads: DecisionReads,
82
41
  fills: fillsOf(Verb)
83
42
  }).strict();
84
43
  const TextDecision = z.object({
85
44
  id: z.string(),
86
45
  kind: z.literal("text"),
87
- verb: z.literal("write").optional(),
88
46
  of: Of,
89
47
  produces: z.array(z.string()).min(1),
90
- brief: Brief.optional(),
91
- none: Abstention,
92
- reads: DecisionReads,
93
48
  fills: fillsOf(z.literal("write"))
94
49
  }).strict();
95
50
  const NumberDecision = z.object({
96
51
  id: z.string(),
97
52
  kind: z.literal("number"),
98
- verb: z.literal("write").optional(),
99
53
  of: Of,
100
54
  produces: z.array(z.string()).min(1),
101
- brief: Brief.optional(),
102
- none: Abstention,
103
- reads: DecisionReads,
104
55
  fills: fillsOf(z.literal("write"))
105
56
  }).strict();
106
57
  const PickDecision = z.object({
107
58
  id: z.string(),
108
59
  kind: z.literal("pick"),
109
- verb: z.enum(["pick", "find"]).optional(),
110
60
  of: Of,
111
- unique: Unique,
112
61
  produces: z.array(z.string()).min(1),
113
- brief: Brief.optional(),
114
- none: Abstention,
115
- reads: DecisionReads,
116
62
  fills: fillsOf(z.enum(["pick", "find"]))
117
63
  }).strict();
118
64
  const ListDecision = z.object({
119
65
  id: z.string(),
120
66
  kind: z.literal("list"),
121
- verb: Verb.optional(),
122
67
  of: Of,
123
- unique: Unique,
124
68
  produces: z.array(z.string()).min(1),
125
- brief: Brief.optional(),
126
- none: Abstention,
127
- reads: DecisionReads,
128
- fills: fillsOf(Verb),
69
+ fills: fillsOf(Verb).optional(),
129
70
  fields: z.record(z.string(), ItemFieldDecision).optional()
130
71
  }).strict();
131
72
  const DisplayDecision = z.object({
@@ -141,13 +82,7 @@ const Decision = z.discriminatedUnion("kind", [
141
82
  PickDecision,
142
83
  ListDecision,
143
84
  DisplayDecision
144
- ]).superRefine((decision, ctx) => {
145
- if (decision.kind === "display") return;
146
- const node = decision;
147
- oneSpelling(node, ctx, [], decision.kind === "list" ? "optional" : "always");
148
- const fields = node["fields"] ?? {};
149
- for (const [key, field] of Object.entries(fields)) oneSpelling(field, ctx, ["fields", key], "always");
150
- });
85
+ ]);
151
86
  const FillSpec = z.object({
152
87
  reads: z.array(z.string()).default([]),
153
88
  slot_reads: z.array(SectionRefDef).default([]),
@@ -32,7 +32,6 @@ function isAnnotatedMediaItem(fields) {
32
32
  return media.length === 1 && rest.length <= 2 && rest.every(isShortField);
33
33
  }
34
34
  function objectFieldsOf(def) {
35
- if (def.fields != null) return def.fields;
36
35
  if (def.element?.type !== "object") return null;
37
36
  const fields = def.element.fields;
38
37
  return fields !== null && typeof fields === "object" ? fields : {};
@@ -23,7 +23,7 @@ function readMediaOf(of) {
23
23
  type: "media",
24
24
  kinds: record["kinds"]
25
25
  }) !== null) return null;
26
- if (record["from"] !== void 0 && fromListsOf(record["from"]) === void 0) return null;
26
+ if (record["from"] !== void 0 && (!Array.isArray(record["from"]) || fromListsOf(record["from"]) === void 0)) return null;
27
27
  return mediaFilterOf(record);
28
28
  }
29
29
  function mediaOf(filter) {
@@ -25,10 +25,10 @@ const playbackConfigShape = { playback: z.object({
25
25
  "auto"
26
26
  ]).optional()
27
27
  }).strict().refine((p) => p.autoplay !== true || p.muted === true, { message: "autoplay requires muted (browsers block unmuted autoplay)" }).optional() };
28
- const processEntry = z.union([z.enum(PROCESS_VERBS), z.object({
28
+ const processEntry = z.object({
29
29
  kind: z.literal("process"),
30
30
  verb: z.enum(PROCESS_VERBS)
31
- }).catchall(z.unknown())]);
31
+ }).catchall(z.unknown());
32
32
  const mediaFilterShape = {
33
33
  from: z.union([z.string().min(1), z.array(z.string().min(1)).min(2)]).optional(),
34
34
  process: z.array(processEntry).nonempty().optional()
@@ -45,8 +45,7 @@ function fromList(from) {
45
45
  return from === void 0 ? [] : typeof from === "string" ? [from] : [...from];
46
46
  }
47
47
  function rowPathsOf(slot) {
48
- const from = fromList(slot.from);
49
- return (from.length > 0 ? from : slot.source?.kind === "home" && slot.source.key !== void 0 ? [slot.source.key] : []).map(rowBaseOf).filter((path) => path !== null);
48
+ return fromList(slot.from).map(rowBaseOf).filter((path) => path !== null);
50
49
  }
51
50
  function rowsIn(slots, outer) {
52
51
  const rows = new Map(outer);
@@ -71,11 +70,10 @@ function unique(paths) {
71
70
  return [...new Set(paths)];
72
71
  }
73
72
  function fillsOfDecision(decision) {
74
- if (decision.fills !== void 0) return decision.fills;
75
- return decision.verb !== void 0 || decision.brief !== void 0 ? [decision] : [];
73
+ return decision.fills ?? [];
76
74
  }
77
75
  function ofTables(of) {
78
- return (Array.isArray(of) ? of : [of]).filter((ref) => typeof ref === "object" && ref !== null && ref.kind === "home");
76
+ return (Array.isArray(of) ? of : []).filter((ref) => typeof ref === "object" && ref !== null && ref.kind === "home");
79
77
  }
80
78
  function fillsByPath(spec) {
81
79
  const byPath = /* @__PURE__ */ new Map();
@@ -143,15 +141,12 @@ function graphSlot(path, slot, scope, fill) {
143
141
  slot: source.slot ?? ""
144
142
  }
145
143
  };
146
- case "row": {
147
- const bases = source.slot === void 0 ? scope.listRows : scope.rows.get(source.slot) ?? [];
148
- return {
149
- ...head,
150
- kind: "member",
151
- reads: memberPaths(bases, source.field ?? ""),
152
- requires: []
153
- };
154
- }
144
+ case "row": return {
145
+ ...head,
146
+ kind: "member",
147
+ reads: memberPaths(scope.rows.get(source.slot ?? "") ?? [], source.field ?? ""),
148
+ requires: []
149
+ };
155
150
  case "element": return {
156
151
  ...head,
157
152
  kind: slot.type === "row" ? "row" : "element",
@@ -178,7 +173,6 @@ function walk(path, slot, scope, fills, into) {
178
173
  const fields = slot.fields ?? {};
179
174
  const inner = {
180
175
  rows: rowsIn(fields, scope.rows),
181
- listRows: scope.listRows,
182
176
  when: whenOf(slot, scope.when)
183
177
  };
184
178
  for (const [field, def] of Object.entries(fields)) walk(`${path}.${field}`, def, inner, fills, into);
@@ -187,10 +181,8 @@ function walk(path, slot, scope, fills, into) {
187
181
  into.push(graphSlot(path, slot, scope, fills.get(path)));
188
182
  const element = slot.element;
189
183
  if (slot.type !== "list" || element === void 0) return;
190
- const listRows = slot.source?.kind === "home" && slot.source.key !== void 0 ? [rowBaseOf(slot.source.key)].filter((p) => p !== null) : [];
191
184
  const item = {
192
185
  rows: scope.rows,
193
- listRows,
194
186
  when: whenOf(slot, scope.when)
195
187
  };
196
188
  if (element.type !== "object") {
@@ -200,7 +192,6 @@ function walk(path, slot, scope, fills, into) {
200
192
  const fields = element.fields ?? {};
201
193
  const inner = {
202
194
  rows: rowsIn(fields, scope.rows),
203
- listRows,
204
195
  when: whenOf(element, item.when)
205
196
  };
206
197
  for (const [field, def] of Object.entries(fields)) walk(`${path}[].${field}`, def, inner, fills, into);
@@ -231,7 +222,6 @@ function sectionGraphOf(schema, fillSpec) {
231
222
  const slots = schema.slots;
232
223
  const top = {
233
224
  rows: rowsIn(slots, /* @__PURE__ */ new Map()),
234
- listRows: [],
235
225
  when: void 0
236
226
  };
237
227
  const fills = fillsByPath(fillSpec);
@@ -1,4 +1,4 @@
1
- import { TABLES, isLegacyTable, tableKeyOf, tableKeyOfSource } from "./slot-catalog.js";
1
+ import { tableKeyOf, tableKeyOfSource } from "./slot-catalog.js";
2
2
  import "./mirror-kind.js";
3
3
 
4
4
  //#region ../../internal/template-contracts/dist/ref-locate.js
@@ -132,19 +132,15 @@ function isElementSource(source) {
132
132
  function slotTableOf(scope, id) {
133
133
  return oneTable(tablesAt(scope, scope.section, scope.slots, id, /* @__PURE__ */ new Set()));
134
134
  }
135
- function listTableOf(scope, list, pickedOf) {
136
- return oneTable(listTablesOf(scope, list, pickedOf));
135
+ function listTableOf(scope, list) {
136
+ return oneTable(listTablesOf(scope, list));
137
137
  }
138
- function listTablesOf(scope, list, pickedOf) {
139
- if (list.fields !== void 0 && list.source === void 0) return pickedTables(pickedOf);
138
+ function listTablesOf(scope, list) {
140
139
  return listTables(scope, scope.section, scope.slots, list, /* @__PURE__ */ new Set());
141
140
  }
142
141
  function oneTable(tables) {
143
142
  return tables.length === 1 ? tables[0] : null;
144
143
  }
145
- function pickedTables(pickedOf) {
146
- return (Array.isArray(pickedOf) ? pickedOf : [pickedOf]).flatMap((ref) => isRecord(ref) ? tableKeyOfSource(ref) ?? [] : []);
147
- }
148
144
  function tablesAt(scope, section, slots, id, seen) {
149
145
  const visit = `${section ?? ""}\u0000${id}`;
150
146
  if (seen.has(visit)) return [];
@@ -166,27 +162,15 @@ function listTables(scope, section, slots, list, seen) {
166
162
  return other === void 0 ? [] : tablesAt(scope, target, other, slot, seen);
167
163
  }
168
164
  const nonEmpty = (value) => typeof value === "string" && value !== "" ? value : null;
169
- function elementIdentityKey(table) {
170
- return table === null || !isLegacyTable(table) ? "id" : TABLES[table].idKey;
171
- }
172
- const LEGACY_IDENTITY_KEYS = [...new Set(Object.values(TABLES).map((table) => table.idKey))].filter((key) => key !== "id");
173
165
  function elementIdentity(element, table = null) {
174
166
  if (typeof element === "string") return table === null ? null : nonEmpty(element);
175
- const field = elementIdentityField(element, table);
167
+ const field = elementIdentityField(element);
176
168
  return field === null ? null : nonEmpty(element[field]);
177
169
  }
178
- function elementIdentityField(element, table = null) {
170
+ function elementIdentityField(element) {
179
171
  if (!isRecord(element)) return null;
180
- return (table === null ? [
181
- "id",
182
- "asset_id",
183
- ...LEGACY_IDENTITY_KEYS
184
- ] : [
185
- elementIdentityKey(table.table),
186
- "id",
187
- "asset_id"
188
- ]).find((key) => nonEmpty(element[key]) !== null) ?? null;
172
+ return ["id", "asset_id"].find((key) => nonEmpty(element[key]) !== null) ?? null;
189
173
  }
190
174
 
191
175
  //#endregion
192
- export { attributedRows, elementIdentity, elementIdentityField, elementIdentityKey, heldRowTableOf, holderOf, isHolderKind, itemHolderOf, itemRowTablesOf, listTableOf, listTablesOf, mirrorRefOf, placementOf, refSectionKey, rowTableOf, rowTablesOf, sectionSlotAt, slotInScope, slotTableOf };
176
+ export { attributedRows, elementIdentity, elementIdentityField, heldRowTableOf, holderOf, isHolderKind, itemHolderOf, itemRowTablesOf, listTableOf, listTablesOf, mirrorRefOf, placementOf, refSectionKey, rowTableOf, rowTablesOf, sectionSlotAt, slotInScope, slotTableOf };
@@ -174,6 +174,8 @@ interface HomeMediaValue {
174
174
  interface RenditionInputs {
175
175
  crop: MediaCrop | null;
176
176
  options: Record<string, unknown>;
177
+ /** The version of the pass that cut it, where that pass is versioned (the cut-out's); a newer pass re-cuts. */
178
+ version?: string;
177
179
  }
178
180
  /** A rendition a place's own processing cut, with the inputs it was cut at. */
179
181
  interface PlaceRendition extends Rendition {
@@ -1,5 +1,5 @@
1
1
  import { AddressMember, AddressValue } from "./address-value.js";
2
- import { LIBRARY_TABLE_KEYS, REGISTRY_TABLE_KEYS, RegistryTable, RegistryTableKey, TABLES, TableField } from "./slot-catalog.js";
2
+ import { LIBRARY_TABLE_KEYS, REGISTRY_TABLE_KEYS, RegistryTable, RegistryTableKey } from "./slot-catalog.js";
3
3
  import { PoiRow } from "./poi-row.js";
4
4
  import { ImageValue } from "./runtime-values.js";
5
5
  import { MemberValueTypeOf, TableFieldsOf } from "./registry-shape.js";
@@ -13,12 +13,6 @@ import { DocumentMediaValue } from "./registry-facts.js";
13
13
  type LibraryKeyOf<T extends RegistryTable> = T extends keyof typeof LIBRARY_TABLE_KEYS ? (typeof LIBRARY_TABLE_KEYS)[T] : never;
14
14
  /** The table a registry table key names — `units` for `property.units`, `contacts` for `library.contacts`. */
15
15
  type TableOfKey<K extends RegistryTableKey> = { [T in RegistryTable]: K extends (typeof REGISTRY_TABLE_KEYS)[T] | LibraryKeyOf<T> ? T : never; }[RegistryTable];
16
- /**
17
- * The identity key a table's items carry in a section's content — `TABLES[t].idKey`,
18
- * `unit_id` on a unit — or `id` for a table with no legacy entry. It does not move with the
19
- * reading: only what a `compute()` sees does.
20
- */
21
- type TableIdKey<K extends RegistryTableKey> = TableOfKey<K> extends TableField ? (typeof TABLES)[TableOfKey<K>]["idKey"] : "id";
22
16
  /**
23
17
  * The keys a row slot's definition owns (`RowSlotDef`'s, ./row.ts). A row answers each
24
18
  * from its definition — present or not — and never as a member, but where its table has
@@ -130,4 +124,4 @@ type OriginTableOf<Source> = Source extends ElementRef<infer V, infer T> ? T ext
130
124
  */
131
125
  type AddressMembers = { readonly [M in AddressMember]: RowRef<M, AddressValue[M]>; };
132
126
  //#endregion
133
- export { AddressMembers, AddressPartRefs, ElementOf, ElementTableOf, MemberListItem, MemberListRow, OriginTableOf, ROW_OWN_KEYS, RowId, RowOwnKey, TableIdKey, TableOfKey, TableRow };
127
+ export { AddressMembers, AddressPartRefs, ElementOf, ElementTableOf, MemberListItem, MemberListRow, OriginTableOf, ROW_OWN_KEYS, RowId, RowOwnKey, TableOfKey, TableRow };
@@ -4,11 +4,6 @@ import { tableKeyOf } from "./slot-catalog.js";
4
4
  function sourceRecord(source) {
5
5
  return source !== null && typeof source === "object" ? source : null;
6
6
  }
7
- function rowMemberOf(source) {
8
- const src = sourceRecord(source);
9
- if (src?.["kind"] !== "row" || "slot" in src) return null;
10
- return typeof src["field"] === "string" ? src["field"] : null;
11
- }
12
7
  function memberSourceOf(source) {
13
8
  const src = sourceRecord(source);
14
9
  if (src?.["kind"] !== "row") return null;
@@ -26,17 +21,12 @@ function rowMemberSources(fields) {
26
21
  const elementRows = new Set(elementRowKeys(fields));
27
22
  const map = {};
28
23
  for (const [key, field] of Object.entries(fields ?? {})) {
29
- const member = rowMemberOf(field.source) ?? elementMemberOf(field.source, elementRows);
30
- if (member !== null) map[key] = member;
24
+ const member = memberSourceOf(field.source);
25
+ if (member !== null && elementRows.has(member.slot)) map[key] = member.field;
31
26
  }
32
27
  return map;
33
28
  }
34
- function elementMemberOf(source, elementRows) {
35
- const member = memberSourceOf(source);
36
- return member !== null && elementRows.has(member.slot) ? member.field : null;
37
- }
38
29
  function listItemFieldsOf(list) {
39
- if (list.fields !== void 0) return list.fields;
40
30
  if (list.element?.type === "object") return list.element.fields;
41
31
  }
42
32
  function listSourceOf(list) {
@@ -63,4 +53,4 @@ function listSourceOf(list) {
63
53
  }
64
54
 
65
55
  //#endregion
66
- export { elementRowKeys, listItemFieldsOf, listSourceOf, memberSourceOf, rowMemberOf, rowMemberSources };
56
+ export { elementRowKeys, listItemFieldsOf, listSourceOf, memberSourceOf, rowMemberSources };
@@ -800,37 +800,6 @@ type BindableFacts<G> = { [K in keyof G as G[K] extends {
800
800
  declare const SOURCE_FIELDS: BindableFacts<typeof FACT_GRAPH>;
801
801
  /** A canonical field name a `direct` source may bind to — a key of `SOURCE_FIELDS`. */
802
802
  type SourceFieldName = keyof typeof SOURCE_FIELDS;
803
- /**
804
- * The registry of tables a slot may be directly linked to (a slot is a directly linked list iff `source.kind === "home"` and `source.key` is a key here).
805
- *
806
- * @remarks
807
- * The single home for per-kind mechanics; other layers implement their
808
- * operations keyed by these entries rather than restating them. `idKey`
809
- * names the stable canonical row id (used for merge, markers, and editor
810
- * identity). `cap`/`min`, when present, are the membership ceiling/floor a
811
- * directly linked list inherits: declared, not enforced (a list is stored at
812
- * any count). `ownership` is the property-owned vs. library-shared
813
- * discriminator that gates writeback/fan-out strategy per layer — never a
814
- * shared physical table.
815
- */
816
- declare const TABLES: {
817
- readonly units: {
818
- readonly idKey: "unit_id";
819
- readonly ownership: "property";
820
- };
821
- readonly contacts: {
822
- readonly idKey: "id";
823
- readonly cap: 12;
824
- readonly min: 1;
825
- readonly ownership: "library";
826
- };
827
- readonly comparables: {
828
- readonly idKey: "id";
829
- readonly ownership: "property";
830
- };
831
- };
832
- /** A table name a list may bind to — one of `TABLES`' keys. */
833
- type TableField = keyof typeof TABLES;
834
803
  /** Each registry table's key — the table's path in the registry, home first. */
835
804
  declare const REGISTRY_TABLE_KEYS: {
836
805
  readonly units: "property.units";
@@ -972,4 +941,4 @@ declare const VIDEO_SOURCES: readonly ["upload", "link"];
972
941
  /** A video's storage/origin kind — one of `VIDEO_SOURCES`. */
973
942
  type VideoSource = (typeof VIDEO_SOURCES)[number];
974
943
  //#endregion
975
- export { BindableFactEntry, BindableFacts, FACT_GRAPH, FACT_PROJECTIONS, FactGraphName, FactMemberDescriptor, FactProjections, FactShapeDescriptor, FactValueType, HolderProcessVerb, LIBRARY_TABLE_KEYS, LINK_KINDS, LINK_PROVIDERS, LinkKind, LinkProviderId, MEDIA_KINDS, MediaKind, OBJECT_BINDING_OWN_KEYS, ObjectBindingOwnKey, PROCESS_CATALOG, ProcessOf, ProcessVerb, REGISTRY_TABLE_KEYS, RegistryTable, RegistryTableKey, RowMemberWriteback, SOURCE_FIELDS, SourceFieldContainer, SourceFieldName, SourceFieldValueType, TABLES, TableField, TableMemberDescriptor, TableRowDescriptor, VIDEO_SOURCES, VideoSource, WritebackTarget };
944
+ export { BindableFactEntry, BindableFacts, FACT_GRAPH, FACT_PROJECTIONS, FactGraphName, FactMemberDescriptor, FactProjections, FactShapeDescriptor, FactValueType, HolderProcessVerb, LIBRARY_TABLE_KEYS, LINK_KINDS, LINK_PROVIDERS, LinkKind, LinkProviderId, MEDIA_KINDS, MediaKind, OBJECT_BINDING_OWN_KEYS, ObjectBindingOwnKey, PROCESS_CATALOG, ProcessOf, ProcessVerb, REGISTRY_TABLE_KEYS, RegistryTable, RegistryTableKey, RowMemberWriteback, SOURCE_FIELDS, SourceFieldContainer, SourceFieldName, SourceFieldValueType, TableMemberDescriptor, TableRowDescriptor, VIDEO_SOURCES, VideoSource, WritebackTarget };
@@ -148,10 +148,6 @@ function isProcessVerb(value) {
148
148
  return typeof value === "string" && Object.hasOwn(PROCESS_CATALOG, value);
149
149
  }
150
150
  function processBindingOf(entry) {
151
- if (typeof entry === "string") return isProcessVerb(entry) ? {
152
- kind: "process",
153
- verb: entry
154
- } : null;
155
151
  if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return null;
156
152
  const { kind, verb } = entry;
157
153
  return kind === "process" && isProcessVerb(verb) ? entry : null;
@@ -48,8 +48,7 @@ const slotMetadataShape = {
48
48
  z.object({ kind: z.literal("authored") }),
49
49
  SerializedRefDef,
50
50
  DerivedSourceDef
51
- ]).optional(),
52
- writeback: z.boolean().optional()
51
+ ]).optional()
53
52
  };
54
53
  function slotMember(type, shape) {
55
54
  return z.object({
@@ -5,7 +5,7 @@ import { TourValue } from "./tour-value.js";
5
5
  import { VideoValue } from "./video-value.js";
6
6
  import { PoiRow } from "./poi-row.js";
7
7
  import { ImageValue, MediaValue } from "./runtime-values.js";
8
- import { RowId, TableIdKey } from "./row-ref.js";
8
+ import { RowId } from "./row-ref.js";
9
9
  //#region ../../internal/template-contracts/dist/slot-value.d.ts
10
10
  /**
11
11
  * Maps one slot definition (as authored under a section schema's `slots`) to
@@ -15,9 +15,8 @@ import { RowId, TableIdKey } from "./row-ref.js";
15
15
  * `null`; a `number`, `date`, `image`, `poi`, `address` or `document` slot's blank is `null`. A `list` slot is always an
16
16
  * array, never `null` — an empty list is the absent state. An `object` is its fields'
17
17
  * values by key; a `row` is its element's identity, or `null`. An item of a list of
18
- * objects is its identity plus its fields: a fact row's identity key (a unit's
19
- * `unit_id`, a contact's or comparable's `id`) where the elements are a table's rows,
20
- * the platform-minted `id` otherwise.
18
+ * objects is its identity plus its fields under `id`: a fact row's identity where the
19
+ * elements are a table's rows, the platform-minted id otherwise.
21
20
  */
22
21
  type SlotValue<S> = S extends {
23
22
  type: "text";
@@ -86,12 +85,11 @@ type ListValue<S> = S extends {
86
85
  */
87
86
  type ObjectValue<F> = { -readonly [K in keyof F]: SlotValue<F[K]>; };
88
87
  /**
89
- * The identity an item of a list of objects carries beside its fields: the table's own
90
- * key where the elements are a table's rows (a unit names its unit by `unit_id`), the
91
- * platform-minted `id` otherwise.
88
+ * The identity an item of a list of objects carries beside its fields: `id` — the row's
89
+ * identity where the elements are table `T`'s rows, the platform-minted id otherwise.
92
90
  */
93
- type ItemIdentity<T> = T extends RegistryTableKey ? { [K in TableIdKey<T>]: string; } : {
91
+ type ItemIdentity<T = unknown> = T extends unknown ? {
94
92
  id: string;
95
- };
93
+ } : never;
96
94
  //#endregion
97
95
  export { ItemIdentity, ObjectValue, SlotValue };
@@ -1,5 +1,5 @@
1
1
  import { normalizeAddressValue } from "../packages/internal/template-contracts/dist/address-value.js";
2
- import { OBJECT_BINDING_OWN_KEYS, TABLES, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isPhoneValue } from "../packages/internal/template-contracts/dist/slot-catalog.js";
2
+ import { OBJECT_BINDING_OWN_KEYS, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isPhoneValue } from "../packages/internal/template-contracts/dist/slot-catalog.js";
3
3
 
4
4
  //#region src/primitives/slot-bindings.ts
5
5
  const blankVideo = () => ({
@@ -93,7 +93,7 @@ function normalizeMedia(slot, value) {
93
93
  default: return null;
94
94
  }
95
95
  }
96
- const IDENTITY_KEYS = [.../* @__PURE__ */ new Set(["id", ...Object.values(TABLES).map((table) => table.idKey)])];
96
+ const IDENTITY_KEYS = ["id"];
97
97
  function normalizeFields(fields, value, identity) {
98
98
  const source = isRecord(value) ? value : {};
99
99
  const normalized = {};
@@ -74,6 +74,12 @@ const AUTHORED_RULES = [
74
74
  stage: "workspace",
75
75
  summary: "A workspace module fails to build or throws when it is evaluated."
76
76
  },
77
+ {
78
+ id: "workspace/key-not-name",
79
+ venue: "tree",
80
+ stage: "workspace",
81
+ summary: "The template key is not its display name in lowercase kebab-case (`Block Website` → `block-website`)."
82
+ },
77
83
  {
78
84
  id: "workspace/duplicate-section-key",
79
85
  venue: "tree",
@@ -57,8 +57,8 @@ interface SectionValue<Key extends string, Slots extends Record<string, Slot>, D
57
57
  * slots: {
58
58
  * headline: text.medium({ cap: 60, label: "Headline", source: fill.write({ brief: "A confident one-line headline." }) }),
59
59
  * address: object({ label: fact.property.address, fields: {
60
- * street: text.short({ source: fact.property.address_street, label: "Street" }),
61
- * city: text.short({ source: fact.property.address_city, label: "City" }),
60
+ * street: text.short({ source: fact.property.address.street, label: "Street" }),
61
+ * city: text.short({ source: fact.property.address.city, label: "City" }),
62
62
  * } }),
63
63
  * },
64
64
  * }, ({ slot, nav }) => (
@@ -29,6 +29,7 @@ The workspace loads: `template.ts` default-exports a `defineTemplate` value and
29
29
  | `concrete/workspace/template-missing` | tree | The workspace root has no `template.ts`. |
30
30
  | `concrete/workspace/template-invalid` | tree | `template.ts` does not default-export a `defineTemplate` value. |
31
31
  | `concrete/workspace/module-invalid` | tree | A workspace module fails to build or throws when it is evaluated. |
32
+ | `concrete/workspace/key-not-name` | tree | The template key is not its display name in lowercase kebab-case (`Block Website` → `block-website`). |
32
33
  | `concrete/workspace/duplicate-section-key` | tree | Two different exported sections declare the same key. |
33
34
  | `concrete/workspace/crlf-text` | tree | A text file in the workspace has CRLF line endings, so the same commit would build a different version than an LF checkout. |
34
35
  | `concrete/workspace/unportable-name` | tree | A source file name, the template key, a section key or a fixture id would not name the same file on Windows and macOS: two differ only by case or Unicode form, or one is a reserved device name (`con`, `nul`, `com1`…), ends in a dot or a space, or carries a character Windows refuses in a file name (`:`, `\`, `?`, `*`, a control character…). A key or id must also be NFC. |
@@ -152,7 +153,7 @@ Every placed section's schema and fill spec satisfy the contract assertions publ
152
153
  | `concrete/contract/display` | contract | Display entries declare one origin and legal cases, and every slot variant gate names a declared case. |
153
154
  | `concrete/contract/display-evidence` | contract | A filled display entry has a declared fact read to judge its case from. |
154
155
  | `concrete/contract/source` | contract | Every slot and item field source names a known fact, another slot or its own compute binding; the uploads are read, never bound. |
155
- | `concrete/contract/object` | contract | An object groups value slots, rows, lists of value slots and lists of objects one level deep, holds no value of its own, is labelled by a string or its label field, and names no field like its binding's own keys. |
156
+ | `concrete/contract/object` | contract | An object groups value slots, rows, lists of value slots and lists of objects one level deep, holds no value of its own, is labelled by its label field, and names no field like its binding's own keys. |
156
157
  | `concrete/contract/list-source` | contract | A list's source is a list, a table, a list slot or a compute, and its item can take the source's element. |
157
158
  | `concrete/contract/row-source` | contract | A row names its table in `from`; its source is a row slot it mirrors, a compute, the element inside an item, or a pick, and is never a table or a list. |
158
159
  | `concrete/contract/row-rule` | contract | A member is read only through a row slot or an address in scope that offers it, and fits the slot that reads it. |
@@ -165,7 +166,6 @@ Every placed section's schema and fill spec satisfy the contract assertions publ
165
166
  | `concrete/contract/url` | contract | A url slot's accepts names a link kind or provider that a registered provider implements. |
166
167
  | `concrete/contract/sources` | contract | No slot declares sources, since a media slot takes a pasted link wherever a link provider claims its kind; a media slot picks `from` a media list of the property, or owns its asset without one, and processes only what its kind takes; a slot bound to a fact states neither. |
167
168
  | `concrete/contract/interpolation` | contract | A fill brief refers to its facts through reads and never interpolates one. |
168
- | `concrete/contract/group` | contract | Group ids are unique, every group names real slots, and no slot sits in two groups. |
169
169
 
170
170
  ## render
171
171
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homepages/concrete",
3
- "version": "9.0.0",
3
+ "version": "9.1.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",