@homepages/concrete 6.2.0 → 7.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 (86) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/codemods/manifest.json +13 -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-D8eepVr-.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 +31 -8
  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 -1
  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 +0 -4
  28. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +4 -4
  29. package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +5 -1
  30. package/dist/packages/internal/section-contracts/dist/group-contract.js +1 -3
  31. package/dist/packages/internal/section-contracts/dist/index.js +0 -1
  32. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +3 -3
  33. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +1 -5
  34. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +2 -2
  35. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +3 -1
  36. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +14 -0
  37. package/dist/packages/internal/section-contracts/dist/runners.js +0 -5
  38. package/dist/packages/internal/section-contracts/dist/source-contract.js +80 -4
  39. package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +12 -6
  40. package/dist/packages/internal/source-resolution/dist/index.js +57 -20
  41. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +16 -17
  42. package/dist/packages/internal/template-contracts/dist/facts-view.js +6 -18
  43. package/dist/packages/internal/template-contracts/dist/row-sources.js +26 -0
  44. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +362 -380
  45. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +289 -289
  46. package/dist/primitives/slot-bindings.d.ts +7 -40
  47. package/dist/primitives/slot-bindings.js +10 -12
  48. package/dist/schema/define-schema.d.ts +1 -1
  49. package/dist/schema/define-schema.js +13 -1
  50. package/dist/schema/extract-fill-spec.js +15 -13
  51. package/dist/schema/fact.d.ts +2 -19
  52. package/dist/schema/fill-builders.d.ts +4 -3
  53. package/dist/schema/fill-spec.js +9 -1
  54. package/dist/schema/layout.d.ts +6 -8
  55. package/dist/schema/layout.js +3 -9
  56. package/dist/schema/property-facts.d.ts +16 -47
  57. package/dist/schema/row-fields.js +88 -0
  58. package/dist/schema/row-ref.d.ts +59 -0
  59. package/dist/schema/row-ref.js +28 -0
  60. package/dist/schema/runtime-values.d.ts +8 -13
  61. package/dist/schema/section-props.d.ts +19 -26
  62. package/dist/schema/section-schema.d.ts +6 -6
  63. package/dist/schema/section-schema.js +2 -2
  64. package/dist/schema/slot-builders.d.ts +222 -117
  65. package/dist/schema/slot-builders.js +57 -28
  66. package/dist/schema/slot-ref.d.ts +18 -2
  67. package/dist/schema/slot-ref.js +11 -3
  68. package/dist/schema/slot-types.d.ts +7 -7
  69. package/dist/schema/slot-types.js +55 -19
  70. package/dist/section/declare.d.ts +1 -1
  71. package/dist/section/section.d.ts +3 -3
  72. package/dist/template/logic-shim.d.ts +1 -1
  73. package/guide/reference/cli/INDEX.md +2 -2
  74. package/guide/reference/cli/build.md +1 -1
  75. package/guide/reference/cli/check.md +1 -1
  76. package/guide/reference/cli/dev.md +1 -1
  77. package/guide/reference/cli/property-add.md +1 -1
  78. package/guide/reference/cli/property-list.md +1 -1
  79. package/guide/reference/cli/publish.md +1 -1
  80. package/guide/reference/cli/upgrade.md +1 -1
  81. package/guide/reference/rules/INDEX.md +1 -2
  82. package/package.json +1 -1
  83. package/tsconfig.base.json +1 -0
  84. package/dist/artifact/playground/client/assets/index-Cqz-jjVw.js +0 -1101
  85. package/dist/packages/internal/section-contracts/dist/row-contract.js +0 -37
  86. package/dist/packages/internal/template-contracts/dist/layout.js +0 -10
@@ -3,7 +3,7 @@ import { VideoCollectionValue, VideoValue } from "../packages/internal/template-
3
3
  import { TourCollectionValue, TourValue } from "../packages/internal/template-contracts/dist/tour-value.js";
4
4
  import { DocumentCollectionValue, DocumentValue } from "../packages/internal/template-contracts/dist/document-value.js";
5
5
  import { PoiPhoto, PoiRow } from "../packages/internal/template-contracts/dist/poi-row.js";
6
- import { ComparableRow, Coordinates, FloorplanAssignment, Narrative, UnitRow } from "./property-facts.js";
6
+ import { ComparableRow, Coordinates, Narrative } from "./property-facts.js";
7
7
  //#region src/schema/runtime-values.d.ts
8
8
  /**
9
9
  * An image slot's runtime value after resolution: `url`/`alt` plus optional
@@ -29,20 +29,15 @@ type ImageValue = {
29
29
  responsive?: ResponsiveImage | null;
30
30
  } | null;
31
31
  responsive?: ResponsiveImage | null;
32
+ /**
33
+ * A unit's floor plan only — an element of a row field bound to `unit.floor_plans`:
34
+ * the plan's floor label ("Upper Level"), or `null` for an unlabelled plan. Absent on
35
+ * every other image.
36
+ */
37
+ floor_label?: string | null;
32
38
  };
33
39
  /** An image list slot's runtime value: an ordered array of `ImageValue`, possibly empty. */
34
40
  type ImageCollectionValue = ImageValue[];
35
- /**
36
- * The members every row of a `contacts`-bound record list carries, whatever
37
- * the slot declares: `id`, the contact's stable row identity. Every other
38
- * member of a contact row is one of the slot's own declared fields, keyed by
39
- * its declaration and typed from its builder — a contact row has no
40
- * projection-only members, so reading a field the slot does not declare is a
41
- * compile error.
42
- */
43
- type ContactRow = {
44
- id: string;
45
- };
46
41
  /**
47
42
  * A raster image the template itself ships — a build-time `import` of a file
48
43
  * under the template's own assets — resolved to its optimized responsive
@@ -73,4 +68,4 @@ type PlaybackConfig = {
73
68
  preload?: "none" | "metadata" | "auto";
74
69
  };
75
70
  //#endregion
76
- export { AuthorImage, type ComparableRow, ContactRow, type Coordinates, type DocumentCollectionValue, type DocumentValue, type FloorplanAssignment, ImageCollectionValue, ImageValue, type Narrative, PlaybackConfig, type PoiPhoto, type PoiRow, type TourCollectionValue, type TourValue, type UnitRow, type VideoCollectionValue, type VideoValue };
71
+ export { AuthorImage, type ComparableRow, type Coordinates, type DocumentCollectionValue, type DocumentValue, ImageCollectionValue, ImageValue, type Narrative, PlaybackConfig, type PoiPhoto, type PoiRow, type TourCollectionValue, type TourValue, type VideoCollectionValue, type VideoValue };
@@ -4,7 +4,7 @@ import { TourValue } from "../packages/internal/template-contracts/dist/tour-val
4
4
  import { DocumentValue } from "../packages/internal/template-contracts/dist/document-value.js";
5
5
  import { PoiRow } from "../packages/internal/template-contracts/dist/poi-row.js";
6
6
  import { ImageValue } from "./runtime-values.js";
7
- import { CollectionRowValues } from "./fact.js";
7
+ import { CollectionIdKey } from "./row-ref.js";
8
8
  import { SectionNav } from "./section-nav.js";
9
9
  import { SectionSchemaShape } from "./section-schema.js";
10
10
  //#region src/schema/section-props.d.ts
@@ -14,10 +14,10 @@ import { SectionSchemaShape } from "./section-schema.js";
14
14
  * normalized by the binding layer. String-valued kinds (`text`, `select`,
15
15
  * `url`) are plain `string` — the canonical blank is `""`, never `null`; a
16
16
  * `number`, `image`, `poi` or `document` slot's blank is `null`. A `list` slot is always an
17
- * array, never `null` — an empty list is the absent state. A record list bound
18
- * whole-row to a bakeable fact array types its rows from that collection's
19
- * projected row type (see `BakedRowValue`), not from a synthesis of its
20
- * declared fields.
17
+ * array, never `null` — an empty list is the absent state. A record list's row
18
+ * is its identity plus its declared fields and nothing else: a list bound to a
19
+ * collection carries that collection's identity key (a unit's `unit_id`, a
20
+ * contact's or comparable's `id`), every other record list the stamped `id`.
21
21
  */
22
22
  type SlotValue<S> = S extends {
23
23
  type: "text";
@@ -32,27 +32,29 @@ type SlotValue<S> = S extends {
32
32
  } ? VideoValue | null : S extends {
33
33
  type: "tour";
34
34
  } ? TourValue | null : S extends {
35
+ type: "list";
36
+ readonly __row?: infer R;
37
+ } ? (unknown extends R ? ListValue<S> : R[]) : S extends {
38
+ type: "poi";
39
+ } ? PoiRow | null : S extends {
40
+ type: "url";
41
+ } ? string : S extends {
42
+ type: "document";
43
+ } ? DocumentValue | null : never;
44
+ type ListValue<S> = S extends {
35
45
  type: "list";
36
46
  source: {
37
47
  kind: "direct";
38
48
  field: infer F extends CollectionField;
39
49
  };
40
50
  fields: infer I;
41
- } ? BakedRowValue<F, I>[] : S extends {
51
+ } ? BoundRowValue<F, I>[] : S extends {
42
52
  type: "list";
43
53
  fields: infer I;
44
54
  } ? RowValue<I>[] : S extends {
45
55
  type: "list";
46
56
  element: infer E;
47
- } ? NonNullable<SlotValue<E>>[] : S extends {
48
- type: "list";
49
- } ? unknown[] : S extends {
50
- type: "poi";
51
- } ? PoiRow | null : S extends {
52
- type: "url";
53
- } ? string : S extends {
54
- type: "document";
55
- } ? DocumentValue | null : never;
57
+ } ? NonNullable<SlotValue<E>>[] : unknown[];
56
58
  /**
57
59
  * One row of a record `list` slot, derived from the declared `fields` record:
58
60
  * the editor-stamped `id` — which every persisted row carries though `fields`
@@ -63,16 +65,7 @@ type SlotValue<S> = S extends {
63
65
  type RowValue<I> = {
64
66
  id: string;
65
67
  } & { [K in keyof I]: SlotValue<I[K]>; };
66
- /**
67
- * One row of a record `list` bound whole-row to a bakeable fact array
68
- * (`source: fact.property.units` / `fact.property.contacts`): the members the
69
- * collection projects onto every row (`CollectionRowValues[F]`), plus each
70
- * declared field the base does not already carry, typed from its builder. A
71
- * field the base does carry keeps the base's type — the bake delivers that
72
- * shape whether or not the field is also declared. A contact row's base is its
73
- * `id`, so its every other member is a declared field.
74
- */
75
- type BakedRowValue<F extends CollectionField, I> = CollectionRowValues[F] & { [K in Exclude<keyof I, keyof CollectionRowValues[F]>]: SlotValue<I[K]>; };
68
+ type BoundRowValue<C extends CollectionField, I> = { [K in CollectionIdKey<C>]: string; } & { [K in keyof I]: SlotValue<I[K]>; };
76
69
  type VariantOf<S extends SectionSchemaShape> = S["meta"] extends {
77
70
  display: {
78
71
  variant: {
@@ -93,4 +86,4 @@ type SectionProps<S extends SectionSchemaShape> = {
93
86
  variant: VariantOf<S>;
94
87
  };
95
88
  //#endregion
96
- export { BakedRowValue, RowValue, SectionProps, SlotValue };
89
+ export { BoundRowValue, RowValue, SectionProps, SlotValue };
@@ -1,11 +1,11 @@
1
+ import { Slot } from "./slot-types.js";
1
2
  import { VideoCollectionValue, VideoValue } from "../packages/internal/template-contracts/dist/video-value.js";
2
3
  import { TourCollectionValue, TourValue } from "../packages/internal/template-contracts/dist/tour-value.js";
3
4
  import { DocumentCollectionValue, DocumentValue } from "../packages/internal/template-contracts/dist/document-value.js";
4
5
  import { PoiPhoto, PoiRow } from "../packages/internal/template-contracts/dist/poi-row.js";
5
- import { ComparableRow, Coordinates, FloorplanAssignment, Narrative, UnitRow } from "./property-facts.js";
6
- import { AuthorImage, ContactRow, ImageCollectionValue, ImageValue, PlaybackConfig } from "./runtime-values.js";
7
- import { Slot } from "./slot-types.js";
8
- import { BakedRowValue, RowValue, SectionProps, SlotValue } from "./section-props.js";
6
+ import { ComparableRow, Coordinates, Narrative } from "./property-facts.js";
7
+ import { AuthorImage, ImageCollectionValue, ImageValue, PlaybackConfig } from "./runtime-values.js";
8
+ import { RowValue, SectionProps, SlotValue } from "./section-props.js";
9
9
  import { z } from "zod";
10
10
  //#region src/schema/section-schema.d.ts
11
11
  /** One `meta.display` entry as consumers read it: declared `cases` (first =
@@ -39,7 +39,7 @@ declare const SectionSchema: z.ZodObject<{
39
39
  groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
40
  id: z.ZodString;
41
41
  label: z.ZodString;
42
- members: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>;
42
+ members: z.ZodArray<z.ZodString>;
43
43
  }, z.core.$strict>>>;
44
44
  display: z.ZodOptional<z.ZodType<DisplayShape, DisplayShape, z.core.$ZodTypeInternals<DisplayShape, DisplayShape>>>;
45
45
  }, z.core.$strict>;
@@ -49,4 +49,4 @@ declare const SectionSchema: z.ZodObject<{
49
49
  /** The authored input shape of `SectionSchema` — what `as const satisfies SectionSchemaShape` checks a section's `schema.ts` against. */
50
50
  type SectionSchemaShape = z.input<typeof SectionSchema>;
51
51
  //#endregion
52
- export { type AuthorImage, type ComparableRow, type ContactRow, type Coordinates, DisplayEntryShape, DisplayShape, type DocumentCollectionValue, type DocumentValue, type FloorplanAssignment, type ImageCollectionValue, type ImageValue, type Narrative, type PlaybackConfig, type PoiPhoto, type PoiRow, type RowValue, SectionSchema, SectionSchemaShape, type Slot, type SlotValue, type TourCollectionValue, type TourValue, type UnitRow, type VideoCollectionValue, type VideoValue };
52
+ export { type AuthorImage, type ComparableRow, type Coordinates, DisplayEntryShape, DisplayShape, type DocumentCollectionValue, type DocumentValue, type ImageCollectionValue, type ImageValue, type Narrative, type PlaybackConfig, type PoiPhoto, type PoiRow, type RowValue, SectionSchema, SectionSchemaShape, type Slot, type SlotValue, type TourCollectionValue, type TourValue, type VideoCollectionValue, type VideoValue };
@@ -1,4 +1,4 @@
1
- import { CONTENT_SLOT_TYPES, REF_SLOT_TYPES, SLOT_TYPES } from "../packages/internal/template-contracts/dist/slot-catalog.js";
1
+ import { CONTENT_SLOT_TYPES, REFERRAL_FIELDS, REF_SLOT_TYPES, SLOT_TYPES } from "../packages/internal/template-contracts/dist/slot-catalog.js";
2
2
  import { SerializedReads, SlotDef, defaultForSlotType } from "./slot-types.js";
3
3
  import { z } from "zod";
4
4
 
@@ -6,7 +6,7 @@ import { z } from "zod";
6
6
  const SlotGroupDef = z.object({
7
7
  id: z.string(),
8
8
  label: z.string(),
9
- members: z.array(z.union([z.string(), z.tuple([z.string(), z.string()])])).min(1)
9
+ members: z.array(z.string()).min(1)
10
10
  }).strict();
11
11
  const DisplayEntryDef = z.object({
12
12
  cases: z.array(z.string().min(1)).min(1),