@homepages/concrete 9.0.0 → 10.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 (143) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +3 -3
  3. package/codemods/manifest.json +14 -0
  4. package/codemods/registry-keys-only.mjs +113 -0
  5. package/codemods/steps/list-object-form.mjs +2 -3
  6. package/codemods/steps/registry-key-reads.mjs +276 -0
  7. package/dist/artifact/playground/client/assets/index-BFNHB7VM.css +1 -0
  8. package/dist/artifact/playground/client/assets/index-Div1yo6s.js +1259 -0
  9. package/dist/artifact/playground/client/index.html +2 -2
  10. package/dist/artifact/playground/host.mjs +42 -42
  11. package/dist/cli/build/artifact.js +2 -1
  12. package/dist/cli/build/fixtures.js +2 -1
  13. package/dist/cli/check/render/inputs.js +3 -3
  14. package/dist/cli/check/stages/sections.js +5 -6
  15. package/dist/cli/check/stages/workspace.js +2 -0
  16. package/dist/cli/check/template-key.js +16 -0
  17. package/dist/cli/dev/workspace-reader.js +9 -2
  18. package/dist/fixtures/media-store.js +3 -3
  19. package/dist/fixtures/resolve.js +28 -23
  20. package/dist/fixtures/synthesize-empties.js +3 -1
  21. package/dist/fixtures.d.ts +1 -1
  22. package/dist/index.d.ts +3 -4
  23. package/dist/packages/external/concrete/package.js +1 -1
  24. package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +1 -1
  25. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +15 -27
  26. package/dist/packages/internal/fill-bake/dist/compute-reads.js +12 -12
  27. package/dist/packages/internal/fill-bake/dist/derive-source.js +7 -14
  28. package/dist/packages/internal/fill-bake/dist/index.js +4 -3
  29. package/dist/packages/internal/fill-bake/dist/item-merge.js +36 -16
  30. package/dist/packages/internal/fill-bake/dist/item-overrides.js +1 -28
  31. package/dist/packages/internal/fill-bake/dist/linked-merge.js +5 -7
  32. package/dist/packages/internal/fill-bake/dist/list-grammar.js +11 -34
  33. package/dist/packages/internal/fill-bake/dist/stored-row-reader.js +1 -0
  34. package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +12 -39
  35. package/dist/packages/internal/fill-vocabulary/dist/verbs.js +2 -17
  36. package/dist/packages/internal/media-resolution/dist/document.js +16 -15
  37. package/dist/packages/internal/media-resolution/dist/image.js +38 -94
  38. package/dist/packages/internal/media-resolution/dist/index.js +1 -1
  39. package/dist/packages/internal/media-resolution/dist/list.js +12 -12
  40. package/dist/packages/internal/media-resolution/dist/media.js +17 -16
  41. package/dist/packages/internal/media-resolution/dist/records.js +4 -2
  42. package/dist/packages/internal/media-resolution/dist/slot.js +9 -6
  43. package/dist/packages/internal/media-resolution/dist/tour.js +12 -11
  44. package/dist/packages/internal/media-resolution/dist/video.js +16 -16
  45. package/dist/packages/internal/property-facts/dist/registry-facts.js +10 -2
  46. package/dist/packages/internal/section-contracts/dist/catalog.js +2 -10
  47. package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +5 -12
  48. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +1 -5
  49. package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +7 -5
  50. package/dist/packages/internal/section-contracts/dist/grammar-scope.js +1 -1
  51. package/dist/packages/internal/section-contracts/dist/index.js +0 -2
  52. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +0 -29
  53. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +2 -16
  54. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +6 -6
  55. package/dist/packages/internal/section-contracts/dist/object-contract.js +4 -2
  56. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +6 -2
  57. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -15
  58. package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +6 -7
  59. package/dist/packages/internal/section-contracts/dist/row-source-contract.js +7 -8
  60. package/dist/packages/internal/section-contracts/dist/runners.js +5 -17
  61. package/dist/packages/internal/section-contracts/dist/select-contract.js +7 -1
  62. package/dist/packages/internal/section-contracts/dist/source-contract.js +20 -79
  63. package/dist/packages/internal/section-contracts/dist/sources-contract.js +1 -1
  64. package/dist/packages/internal/section-contracts/dist/table-member.js +5 -8
  65. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +5 -10
  66. package/dist/packages/internal/source-resolution/dist/index.js +21 -189
  67. package/dist/packages/internal/template-artifact/dist/index.js +2 -2
  68. package/dist/packages/internal/template-artifact/dist/layout.js +3 -1
  69. package/dist/packages/internal/template-artifact/dist/verify.js +32 -16
  70. package/dist/packages/internal/template-contracts/dist/content-pick.js +24 -1
  71. package/dist/packages/internal/template-contracts/dist/decision-fills.js +2 -6
  72. package/dist/packages/internal/template-contracts/dist/document-value.d.ts +2 -2
  73. package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +3 -2
  74. package/dist/packages/internal/template-contracts/dist/fact-keys.js +19 -43
  75. package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +24 -3
  76. package/dist/packages/internal/template-contracts/dist/fact-registry.js +14 -7
  77. package/dist/packages/internal/template-contracts/dist/fill-builders.d.ts +1 -1
  78. package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +3 -68
  79. package/dist/packages/internal/template-contracts/dist/fill-spec.js +7 -6
  80. package/dist/packages/internal/template-contracts/dist/list-editing.js +0 -1
  81. package/dist/packages/internal/template-contracts/dist/list.d.ts +1 -1
  82. package/dist/packages/internal/template-contracts/dist/list.js +7 -15
  83. package/dist/packages/internal/template-contracts/dist/media-candidates.js +1 -1
  84. package/dist/packages/internal/template-contracts/dist/mirror-kind.js +2 -2
  85. package/dist/packages/internal/template-contracts/dist/object.js +3 -2
  86. package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +2 -2
  87. package/dist/packages/internal/template-contracts/dist/process-builders.d.ts +2 -2
  88. package/dist/packages/internal/template-contracts/dist/read-graph.js +14 -51
  89. package/dist/packages/internal/template-contracts/dist/ref-locate.js +15 -27
  90. package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +3 -1
  91. package/dist/packages/internal/template-contracts/dist/registry-facts.js +13 -24
  92. package/dist/packages/internal/template-contracts/dist/registry-shape.d.ts +20 -4
  93. package/dist/packages/internal/template-contracts/dist/registry-shape.js +69 -11
  94. package/dist/packages/internal/template-contracts/dist/row-planners.js +1 -1
  95. package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +5 -14
  96. package/dist/packages/internal/template-contracts/dist/row-ref.js +7 -23
  97. package/dist/packages/internal/template-contracts/dist/row-sources.js +6 -16
  98. package/dist/packages/internal/template-contracts/dist/row.d.ts +1 -1
  99. package/dist/packages/internal/template-contracts/dist/row.js +6 -7
  100. package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +5 -20
  101. package/dist/packages/internal/template-contracts/dist/section-schema-types.d.ts +1 -0
  102. package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +29 -37
  103. package/dist/packages/internal/template-contracts/dist/slot-builders.js +4 -7
  104. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +2 -733
  105. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +2 -502
  106. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +4 -1
  107. package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +4 -4
  108. package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -2
  109. package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +9 -10
  110. package/dist/packages/internal/template-contracts/dist/table-members.d.ts +5 -12
  111. package/dist/packages/internal/template-contracts/dist/table-members.js +7 -37
  112. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +2 -2
  113. package/dist/primitives/Image.d.ts +3 -3
  114. package/dist/primitives/slot-bindings.js +2 -2
  115. package/dist/primitives/slot-download.d.ts +1 -1
  116. package/dist/primitives/slot-media.d.ts +1 -1
  117. package/dist/rules/registry.js +6 -0
  118. package/dist/schema/fact.d.ts +19 -52
  119. package/dist/schema/fact.js +6 -25
  120. package/dist/schema/facts-view.d.ts +1 -2
  121. package/dist/schema/property-facts.d.ts +1 -62
  122. package/dist/schema/section-schema.d.ts +2 -2
  123. package/dist/schema/section-schema.js +1 -1
  124. package/dist/section/section.d.ts +2 -2
  125. package/guide/reference/cli/INDEX.md +2 -2
  126. package/guide/reference/cli/build.md +1 -1
  127. package/guide/reference/cli/check.md +1 -1
  128. package/guide/reference/cli/dev.md +1 -1
  129. package/guide/reference/cli/property-add.md +1 -1
  130. package/guide/reference/cli/property-list.md +1 -1
  131. package/guide/reference/cli/publish.md +1 -1
  132. package/guide/reference/cli/upgrade.md +1 -1
  133. package/guide/reference/rules/INDEX.md +4 -5
  134. package/package.json +1 -1
  135. package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +0 -1259
  136. package/dist/artifact/playground/client/assets/index-DDOcM0zA.css +0 -1
  137. package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +0 -15
  138. package/dist/packages/internal/section-contracts/dist/group-contract.js +0 -19
  139. package/dist/packages/internal/section-contracts/dist/option-source-contract.js +0 -22
  140. package/dist/packages/internal/template-contracts/dist/comparable-address.js +0 -19
  141. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +0 -62
  142. package/dist/packages/internal/template-contracts/dist/legacy-facts.js +0 -167
  143. package/dist/packages/internal/template-contracts/dist/registry-aliases.js +0 -77
@@ -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;
@@ -162,7 +158,7 @@ function processOptionsProblem(binding) {
162
158
  const listed = takes.length > 0 ? `it takes ${takes.map((key) => `\`${key}\``).join(", ")}` : "it takes none";
163
159
  for (const [key, value] of Object.entries(binding)) {
164
160
  if (key === "kind" || key === "verb" || value === void 0) continue;
165
- if (key === "reads") return `\`${binding.verb}\` takes no \`reads\` — a process is about one asset, never the property`;
161
+ if (key === "reads") return `\`${binding.verb}\` takes no \`reads\` — a process is about one media value, never the property`;
166
162
  const option = entry.options[key];
167
163
  if (option === void 0) {
168
164
  const hint = key === "aspect" && binding.verb === "autocrop" ? "; its aspect is the holder's `crop` — the aspect it locks, free form where it locks none" : "";
@@ -211,502 +207,6 @@ function mediaDeclarationProblem(declaration) {
211
207
  }
212
208
  return null;
213
209
  }
214
- const REFERRAL_FIELDS = [
215
- "name",
216
- "title",
217
- "org_name",
218
- "email",
219
- "phone",
220
- "website",
221
- "instagram",
222
- "linkedin",
223
- "x",
224
- "facebook",
225
- "headshot",
226
- "logo_dark",
227
- "logo_light"
228
- ];
229
- const REFERRAL_IMAGE_FIELDS = [
230
- "headshot",
231
- "logo_dark",
232
- "logo_light"
233
- ];
234
- const FACT_PROJECTIONS = {
235
- property: {
236
- latitude: "lat",
237
- longitude: "lon"
238
- },
239
- contact: { address: "contact_address" }
240
- };
241
- const PROPERTY_ROOT_FACTS = {
242
- address: {
243
- role: "bindable",
244
- container: "property",
245
- value_type: "text",
246
- fields: {
247
- display: { value_type: "text" },
248
- street: { value_type: "text" },
249
- street_no_type: { value_type: "text" },
250
- city: { value_type: "text" },
251
- state: { value_type: "text" },
252
- postal: { value_type: "text" },
253
- unit: { value_type: "text" }
254
- }
255
- },
256
- address_street: {
257
- role: "bindable",
258
- container: "property",
259
- value_type: "text"
260
- },
261
- address_unit: {
262
- role: "bindable",
263
- container: "property",
264
- value_type: "text"
265
- },
266
- address_city: {
267
- role: "bindable",
268
- container: "property",
269
- value_type: "text"
270
- },
271
- address_state: {
272
- role: "bindable",
273
- container: "property",
274
- value_type: "text"
275
- },
276
- address_postal: {
277
- role: "bindable",
278
- container: "property",
279
- value_type: "text"
280
- },
281
- listing_intent: {
282
- role: "bindable",
283
- container: "property",
284
- value_type: "text",
285
- writeback: {
286
- kind: "property",
287
- column: "listing_intent"
288
- }
289
- },
290
- lat: {
291
- role: "bindable",
292
- container: "property",
293
- value_type: "number"
294
- },
295
- lon: {
296
- role: "bindable",
297
- container: "property",
298
- value_type: "number"
299
- }
300
- };
301
- const TABLE_FACTS = {
302
- units: {
303
- role: "bindable",
304
- container: "property",
305
- value_type: "unit_list",
306
- row: {
307
- unit_id: {
308
- path: "unit_id",
309
- value_type: "text"
310
- },
311
- position: {
312
- path: "position",
313
- value_type: "number"
314
- },
315
- floor_plans: {
316
- path: "floor_plans",
317
- value_type: "image_list",
318
- row: {
319
- id: { value_type: "text" },
320
- floor_label: { value_type: "text" },
321
- position: { value_type: "number" }
322
- }
323
- },
324
- unit_label: {
325
- path: "unit_label",
326
- value_type: "text",
327
- primary: true,
328
- writeback: { column: "unit_label" }
329
- },
330
- beds: {
331
- path: "beds",
332
- value_type: "number",
333
- primary: true,
334
- writeback: { column: "beds" }
335
- },
336
- baths: {
337
- path: "baths",
338
- value_type: "number",
339
- primary: true,
340
- writeback: { column: "baths" }
341
- },
342
- sqft: {
343
- path: "sqft",
344
- value_type: "number",
345
- primary: true,
346
- writeback: { column: "sqft" }
347
- },
348
- price: {
349
- path: "price",
350
- value_type: "text",
351
- primary: true,
352
- writeback: { column: "price" }
353
- }
354
- }
355
- },
356
- comparables: {
357
- role: "bindable",
358
- container: "property",
359
- value_type: "comparable_list",
360
- row: {
361
- id: {
362
- path: "id",
363
- value_type: "text"
364
- },
365
- address_street: {
366
- path: "address_street",
367
- value_type: "text"
368
- },
369
- address_city: {
370
- path: "address_city",
371
- value_type: "text"
372
- },
373
- address_state: {
374
- path: "address_state",
375
- value_type: "text"
376
- },
377
- address_postal: {
378
- path: "address_postal",
379
- value_type: "text"
380
- },
381
- address: {
382
- path: "address",
383
- value_type: "text"
384
- },
385
- lat: {
386
- path: "lat",
387
- value_type: "number"
388
- },
389
- lng: {
390
- path: "lng",
391
- value_type: "number"
392
- },
393
- distance_m: {
394
- path: "distance_m",
395
- value_type: "number"
396
- },
397
- status: {
398
- path: "status",
399
- value_type: "text"
400
- },
401
- price: {
402
- path: "price",
403
- value_type: "number",
404
- writeback: { column: "price" }
405
- },
406
- price_period: {
407
- path: "price_period",
408
- value_type: "text"
409
- },
410
- sale_date: {
411
- path: "sale_date",
412
- value_type: "text",
413
- writeback: { column: "sale_date" }
414
- },
415
- beds: {
416
- path: "beds",
417
- value_type: "number",
418
- writeback: { column: "beds" }
419
- },
420
- baths: {
421
- path: "baths",
422
- value_type: "number",
423
- writeback: { column: "baths" }
424
- },
425
- sqft: {
426
- path: "sqft",
427
- value_type: "number",
428
- writeback: { column: "sqft" }
429
- },
430
- photo: {
431
- path: "photo_upload_id",
432
- value_type: "image"
433
- },
434
- year_built: {
435
- path: "year_built",
436
- value_type: "number"
437
- },
438
- lot_sqft: {
439
- path: "lot_sqft",
440
- value_type: "number"
441
- },
442
- stories: {
443
- path: "stories",
444
- value_type: "number"
445
- },
446
- units: {
447
- path: "units",
448
- value_type: "number"
449
- },
450
- hoa_monthly: {
451
- path: "hoa_monthly",
452
- value_type: "number"
453
- },
454
- list_price: {
455
- path: "list_price",
456
- value_type: "number"
457
- },
458
- listed_date: {
459
- path: "listed_date",
460
- value_type: "text"
461
- },
462
- mls_number: {
463
- path: "mls_number",
464
- value_type: "text"
465
- },
466
- description: {
467
- path: "description",
468
- value_type: "text"
469
- }
470
- }
471
- },
472
- contacts: {
473
- role: "bindable",
474
- container: "property",
475
- value_type: "contact_list",
476
- row: {
477
- id: {
478
- path: "id",
479
- value_type: "text"
480
- },
481
- primary: {
482
- path: "primary",
483
- value_type: "boolean"
484
- },
485
- name: {
486
- path: "name",
487
- value_type: "text",
488
- primary: true,
489
- writeback: { column: "name" }
490
- },
491
- title: {
492
- path: "title",
493
- value_type: "text",
494
- primary: true,
495
- writeback: { column: "title" }
496
- },
497
- org_name: {
498
- path: "org_name",
499
- value_type: "text",
500
- primary: true,
501
- writeback: { column: "org_name" }
502
- },
503
- bio: {
504
- path: "bio",
505
- value_type: "text",
506
- primary: true,
507
- writeback: { column: "bio" }
508
- },
509
- address: {
510
- path: "address",
511
- value_type: "text",
512
- primary: true
513
- },
514
- email: {
515
- path: "email",
516
- value_type: "text",
517
- primary: true,
518
- writeback: { column: "email" }
519
- },
520
- phone: {
521
- path: "phone",
522
- value_type: "text",
523
- primary: true,
524
- writeback: { column: "phone" }
525
- },
526
- website: {
527
- path: "website_url",
528
- value_type: "text",
529
- primary: true,
530
- writeback: { column: "website" }
531
- },
532
- instagram: {
533
- path: "instagram_url",
534
- value_type: "text",
535
- primary: true,
536
- writeback: { column: "socials.instagram" }
537
- },
538
- linkedin: {
539
- path: "linkedin_url",
540
- value_type: "text",
541
- primary: true,
542
- writeback: { column: "socials.linkedin" }
543
- },
544
- x: {
545
- path: "x_url",
546
- value_type: "text",
547
- primary: true,
548
- writeback: { column: "socials.x" }
549
- },
550
- facebook: {
551
- path: "facebook_url",
552
- value_type: "text",
553
- primary: true,
554
- writeback: { column: "socials.facebook" }
555
- },
556
- headshot: {
557
- path: "avatar_upload_id",
558
- value_type: "image",
559
- primary: true
560
- },
561
- logo_dark: {
562
- path: "logo_dark_upload_id",
563
- value_type: "image",
564
- primary: true
565
- },
566
- logo_light: {
567
- path: "logo_light_upload_id",
568
- value_type: "image",
569
- primary: true
570
- }
571
- }
572
- }
573
- };
574
- const READABLE_FACTS = {
575
- description: {
576
- role: "readable",
577
- path: "narrative.description",
578
- value_type: "text"
579
- },
580
- unit: {
581
- role: "readable",
582
- path: "units",
583
- value_type: "row",
584
- primary_of: "units"
585
- },
586
- contact: {
587
- role: "readable",
588
- path: "contacts",
589
- value_type: "row",
590
- primary_of: "contacts"
591
- }
592
- };
593
- function primaryRowFacts(container) {
594
- const table = TABLE_FACTS[READABLE_FACTS[container].primary_of];
595
- const aliases = FACT_PROJECTIONS[container] ?? {};
596
- const facts = {};
597
- for (const [name, member] of Object.entries(table.row)) {
598
- if (member.primary !== true) continue;
599
- const fact = {
600
- role: "bindable",
601
- container,
602
- value_type: member.value_type
603
- };
604
- if (member.value_type === "image") fact.image = true;
605
- if (member.writeback !== void 0) fact.writeback = container === "unit" ? {
606
- kind: "unit",
607
- column: member.writeback.column
608
- } : {
609
- kind: "contact",
610
- field: member.writeback.column
611
- };
612
- facts[aliases[name] ?? name] = fact;
613
- }
614
- return facts;
615
- }
616
- function composeFactGraph() {
617
- return {
618
- ...PROPERTY_ROOT_FACTS,
619
- ...primaryRowFacts("unit"),
620
- ...TABLE_FACTS,
621
- ...primaryRowFacts("contact"),
622
- ...READABLE_FACTS
623
- };
624
- }
625
- const FACT_GRAPH = /* @__PURE__ */ composeFactGraph();
626
- function projectBindableFacts(graph) {
627
- const projected = {};
628
- for (const [name, entry] of Object.entries(graph)) {
629
- if (entry.role !== "bindable") continue;
630
- const descriptor = {
631
- container: entry.container,
632
- value_type: entry.value_type
633
- };
634
- if (entry.image === true) descriptor.image = true;
635
- if (entry.writeback !== void 0) descriptor.writeback = entry.writeback;
636
- projected[name] = descriptor;
637
- }
638
- return projected;
639
- }
640
- const SOURCE_FIELDS = /* @__PURE__ */ projectBindableFacts(FACT_GRAPH);
641
- const OPTION_SOURCES = ["listing_intent"];
642
- function isOptionSource(value) {
643
- return OPTION_SOURCES.includes(value);
644
- }
645
- const TABLES = {
646
- units: {
647
- idKey: "unit_id",
648
- ownership: "property"
649
- },
650
- contacts: {
651
- idKey: "id",
652
- cap: 12,
653
- min: 1,
654
- ownership: "library"
655
- },
656
- comparables: {
657
- idKey: "id",
658
- ownership: "property"
659
- }
660
- };
661
- const REGISTRY_TABLE_KEYS = {
662
- units: "property.units",
663
- contacts: "property.contacts",
664
- comparables: "property.comparables",
665
- commercial_spaces: "property.commercial_spaces"
666
- };
667
- const LIBRARY_TABLE_KEYS = { contacts: "library.contacts" };
668
- function isLegacyTable(table) {
669
- return Object.hasOwn(TABLES, table);
670
- }
671
- const TABLE_OF_REGISTRY_KEY = /* @__PURE__ */ Object.fromEntries([...Object.entries(REGISTRY_TABLE_KEYS), ...Object.entries(LIBRARY_TABLE_KEYS)].map(([table, key]) => [key, table]));
672
- function tableKeyOf(key) {
673
- if (typeof key !== "string") return null;
674
- if (Object.hasOwn(TABLES, key)) return {
675
- table: key,
676
- reading: "legacy"
677
- };
678
- const table = Object.hasOwn(TABLE_OF_REGISTRY_KEY, key) ? TABLE_OF_REGISTRY_KEY[key] : void 0;
679
- return table === void 0 ? null : {
680
- table,
681
- reading: "registry"
682
- };
683
- }
684
- function tableKeyOfSource(source) {
685
- return source?.kind === "home" ? tableKeyOf(source.key) : null;
686
- }
687
- function tableForSlot(slot) {
688
- return tableKeyOfSource(slot.source)?.table ?? null;
689
- }
690
- function rowMemberWriteback(table, member) {
691
- return FACT_GRAPH[table].row[member]?.writeback ?? null;
692
- }
693
- function tableBounds(field) {
694
- if (!isLegacyTable(field)) return {};
695
- const entry = TABLES[field];
696
- return {
697
- ...entry.min !== void 0 ? { min: entry.min } : {},
698
- ...entry.cap !== void 0 ? { max: entry.cap } : {}
699
- };
700
- }
701
- function stampTableBounds(slots) {
702
- for (const slot of Object.values(slots)) {
703
- const table = tableForSlot(slot);
704
- if (table === null) continue;
705
- const inherited = tableBounds(table);
706
- if (slot.min === void 0 && inherited.min !== void 0) slot.min = inherited.min;
707
- if (slot.max === void 0 && inherited.max !== void 0) slot.max = inherited.max;
708
- }
709
- }
710
210
  const DISPLAY_ENTRIES = ["visibility", "variant"];
711
211
  const VISIBILITY_CASES = ["visible", "hidden"];
712
212
  const LINK_KINDS = [
@@ -885,4 +385,4 @@ const PASSTHROUGH_TOUR_PROVIDERS = /* @__PURE__ */ new Set([
885
385
  ]);
886
386
 
887
387
  //#endregion
888
- export { CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, FACT_GRAPH, FACT_PROJECTIONS, HOLDER_PROCESS_VERBS, LIBRARY_TABLE_KEYS, LINK_KINDS, LINK_PROVIDERS, LIST_SLOT_TYPES, MEDIA_KINDS, OBJECT_BINDING_OWN_KEYS, OPTION_SOURCES, PROCESS_CATALOG, PROCESS_VERBS, REFERRAL_FIELDS, REFERRAL_IMAGE_FIELDS, REF_SLOT_TYPES, REGISTRY_TABLE_KEYS, SLOT_TYPES, SOURCE_FIELDS, TABLES, VISIBILITY_CASES, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isLegacyTable, isLinkAccepts, isListSlotType, isMediaKind, isMediaType, isOptionSource, isPhoneValue, isProcessVerb, matchLinkProvider, mediaDeclarationProblem, processBindingOf, processOptionsProblem, rowMemberWriteback, stampTableBounds, tableBounds, tableForSlot, tableKeyOf, tableKeyOfSource, tourEmbedUrl, videoEmbedUrl };
388
+ export { CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, HOLDER_PROCESS_VERBS, LINK_KINDS, LINK_PROVIDERS, LIST_SLOT_TYPES, MEDIA_KINDS, OBJECT_BINDING_OWN_KEYS, PROCESS_CATALOG, PROCESS_VERBS, REF_SLOT_TYPES, SLOT_TYPES, VISIBILITY_CASES, acceptsLink, declaredKinds, isEmailValue, isIsoDateValue, isLinkAccepts, isListSlotType, isMediaKind, isMediaType, isPhoneValue, isProcessVerb, matchLinkProvider, mediaDeclarationProblem, processBindingOf, processOptionsProblem, tourEmbedUrl, videoEmbedUrl };
@@ -1,4 +1,7 @@
1
1
  //#region ../../internal/template-contracts/dist/slot-overrides.js
2
+ function isOrderOverridden(overrides, slotId) {
3
+ return overrides?.order?.[slotId] === true;
4
+ }
2
5
  function isSlotOverridden(overrides, slotId) {
3
6
  return overrides?.scalar?.[slotId] === true;
4
7
  }
@@ -18,4 +21,4 @@ function itemOverridesForSlot(overrides, slotId) {
18
21
  }
19
22
 
20
23
  //#endregion
21
- export { isSlotOverridden, itemOverridesForSlot, objectFieldOf, objectFieldSlotId };
24
+ export { isOrderOverridden, isSlotOverridden, itemOverridesForSlot, objectFieldOf, objectFieldSlotId };
@@ -51,8 +51,8 @@ interface RowRef<Field extends string = string, Value = unknown, Read = Value> {
51
51
  readonly __value?: Value;
52
52
  /**
53
53
  * Phantom: what the member holds as a `compute()` reads it — its value, but on a table's
54
- * row what the facts document holds (an image's `{ asset_id }`, which `ReadValue` hands
55
- * as its asset's record). Never present at runtime.
54
+ * row what the facts document holds (an image's value or `{ media }` reference, which `ReadValue` hands
55
+ * as its media record). Never present at runtime.
56
56
  */
57
57
  readonly __read?: Read;
58
58
  }
@@ -112,12 +112,12 @@ type RefValue<R> = R extends {
112
112
  } ? V : unknown;
113
113
  /**
114
114
  * `V` as a read hands it: each media value in it — a reference, or a slot's media value —
115
- * its asset's record, narrowed by kind where the value says it, at any depth. The type
115
+ * its media record, narrowed by kind where the value says it, at any depth. The type
116
116
  * half of the read step (./registry-facts `readAsRecords`).
117
117
  */
118
118
  type AsRead<V> = V extends ImageValue ? ImageMedia : V extends VideoValue ? VideoMedia : V extends TourValue ? TourMedia : V extends DocumentValue ? DocumentMedia : V extends DocumentMediaValue ? Media : V extends readonly unknown[] ? { [I in keyof V]: AsRead<V[I]>; } : V extends object ? { [K in keyof V]: AsRead<V[K]>; } : V;
119
119
  /**
120
- * The value ONE ref hands a declaration that reads it, each media value in it its asset's
120
+ * The value ONE ref hands a declaration that reads it, each media value in it its media
121
121
  * record (`AsRead`). A slot read is always `| undefined` — the upstream section's page may
122
122
  * be disabled, the section unplaced on a given composition, the slot empty — so a body
123
123
  * must say what it does with nothing. A fact settles at intake and carries its own 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({
@@ -1,11 +1,12 @@
1
1
  import { AddressValue } from "./address-value.js";
2
2
  import { DocumentValue } from "./document-value.js";
3
- import { MediaKind, RegistryTableKey } from "./slot-catalog.js";
3
+ import { MediaKind } from "./slot-catalog.js";
4
4
  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 { RegistryTableKey } from "./registry-shape.js";
9
+ import { RowId } from "./row-ref.js";
9
10
  //#region ../../internal/template-contracts/dist/slot-value.d.ts
10
11
  /**
11
12
  * Maps one slot definition (as authored under a section schema's `slots`) to
@@ -15,9 +16,8 @@ import { RowId, TableIdKey } from "./row-ref.js";
15
16
  * `null`; a `number`, `date`, `image`, `poi`, `address` or `document` slot's blank is `null`. A `list` slot is always an
16
17
  * array, never `null` — an empty list is the absent state. An `object` is its fields'
17
18
  * 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.
19
+ * objects is its identity plus its fields under `id`: a fact row's identity where the
20
+ * elements are a table's rows, the platform-minted id otherwise.
21
21
  */
22
22
  type SlotValue<S> = S extends {
23
23
  type: "text";
@@ -86,12 +86,11 @@ type ListValue<S> = S extends {
86
86
  */
87
87
  type ObjectValue<F> = { -readonly [K in keyof F]: SlotValue<F[K]>; };
88
88
  /**
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.
89
+ * The identity an item of a list of objects carries beside its fields: `id` — the row's
90
+ * identity where the elements are table `T`'s rows, the platform-minted id otherwise.
92
91
  */
93
- type ItemIdentity<T> = T extends RegistryTableKey ? { [K in TableIdKey<T>]: string; } : {
92
+ type ItemIdentity<T = unknown> = T extends unknown ? {
94
93
  id: string;
95
- };
94
+ } : never;
96
95
  //#endregion
97
96
  export { ItemIdentity, ObjectValue, SlotValue };
@@ -1,25 +1,18 @@
1
1
  import { AddressValue } from "./address-value.js";
2
- import { RegistryTable } from "./slot-catalog.js";
3
- import { MemberValueTypeOf, TableFieldsOf } from "./registry-shape.js";
4
- import { LibraryFactRegistry, PropertyTablePages } from "./fact-registry.js";
2
+ import { MemberValueTypeOf, RegistryTable, RegistryTableKey, TableElementOf, TableFieldsOf } from "./registry-shape.js";
3
+ import "./fact-registry.js";
5
4
  import { FactItem } from "./registry-facts.js";
6
5
  //#region ../../internal/template-contracts/dist/table-members.d.ts
7
- interface RegistryItems {
8
- units: FactItem<PropertyTablePages["units"]["declaration"]["element"]>;
9
- comparables: FactItem<PropertyTablePages["comparables"]["declaration"]["element"]>;
10
- commercial_spaces: FactItem<PropertyTablePages["commercial_spaces"]["declaration"]["element"]>;
11
- contacts: FactItem<LibraryFactRegistry["pages"]["contacts"]["declaration"]["element"]>;
12
- }
13
- type RegistryItem<T extends RegistryTable> = RegistryItems[T];
6
+ type RegistryItem<T extends RegistryTable> = FactItem<TableElementOf<T>>;
14
7
  type AddressMemberOf<T extends RegistryTable> = { [M in keyof TableFieldsOf<T>]: TableFieldsOf<T>[M] extends {
15
8
  readonly type: "address";
16
9
  } ? M : never; }[keyof TableFieldsOf<T>];
17
10
  /**
18
- * One row of table `T` under its registry reading: the facts document's item, its
11
+ * One row of table `T`: the facts document's item, its
19
12
  * identity `id` beside its members, an address-valued member read as an address slot
20
13
  * holds it (`AddressValue`, `null` when it holds no place). What a `compute()` reading
21
14
  * the table's registry key receives per row, and what each member read reads.
22
15
  */
23
16
  type RegistryTableRow<T extends RegistryTable> = Omit<RegistryItem<T>, AddressMemberOf<T>> & { [M in AddressMemberOf<T> & string]: AddressValue | null; };
24
17
  //#endregion
25
- export { RegistryTableRow };
18
+ export { type RegistryTable, RegistryTableRow };