@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.
- package/CHANGELOG.md +133 -0
- package/codemods/manifest.json +13 -0
- package/codemods/object-form-only.mjs +39 -0
- package/codemods/steps/list-object-form.mjs +688 -0
- package/codemods/steps/select-object-form.mjs +210 -0
- package/dist/artifact/playground/client/assets/index-D8eepVr-.js +1101 -0
- package/dist/artifact/playground/client/index.html +1 -1
- package/dist/artifact/playground/host.mjs +14 -14
- package/dist/asset-modules.d.ts +2 -1
- package/dist/cli/check/stages/render.js +1 -1
- package/dist/cli/check/stages/sections.js +1 -1
- package/dist/fixtures/canonical.d.ts +2 -5
- package/dist/fixtures/media.js +11 -25
- package/dist/fixtures/property.js +28 -16
- package/dist/fixtures/resolve.js +31 -17
- package/dist/fixtures/rows.js +3 -83
- package/dist/fixtures.d.ts +17 -9
- package/dist/index.d.ts +9 -9
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +31 -8
- package/dist/packages/internal/fill-bake/dist/derive-source.js +15 -4
- package/dist/packages/internal/fill-bake/dist/index.js +2 -2
- package/dist/packages/internal/fill-vocabulary/dist/origination.js +6 -1
- package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +15 -0
- package/dist/packages/internal/property-facts/dist/index.js +1 -1
- package/dist/packages/internal/property-facts/dist/{property-facts-5pxZnlkh.js → property-facts-Cy7-O4p0.js} +2 -5
- package/dist/packages/internal/section-contracts/dist/catalog.js +0 -4
- package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +4 -4
- package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +5 -1
- package/dist/packages/internal/section-contracts/dist/group-contract.js +1 -3
- package/dist/packages/internal/section-contracts/dist/index.js +0 -1
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +3 -3
- package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +1 -5
- package/dist/packages/internal/section-contracts/dist/name-title-contract.js +2 -2
- package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +3 -1
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +14 -0
- package/dist/packages/internal/section-contracts/dist/runners.js +0 -5
- package/dist/packages/internal/section-contracts/dist/source-contract.js +80 -4
- package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +12 -6
- package/dist/packages/internal/source-resolution/dist/index.js +57 -20
- package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +16 -17
- package/dist/packages/internal/template-contracts/dist/facts-view.js +6 -18
- package/dist/packages/internal/template-contracts/dist/row-sources.js +26 -0
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +362 -380
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +289 -289
- package/dist/primitives/slot-bindings.d.ts +7 -40
- package/dist/primitives/slot-bindings.js +10 -12
- package/dist/schema/define-schema.d.ts +1 -1
- package/dist/schema/define-schema.js +13 -1
- package/dist/schema/extract-fill-spec.js +15 -13
- package/dist/schema/fact.d.ts +2 -19
- package/dist/schema/fill-builders.d.ts +4 -3
- package/dist/schema/fill-spec.js +9 -1
- package/dist/schema/layout.d.ts +6 -8
- package/dist/schema/layout.js +3 -9
- package/dist/schema/property-facts.d.ts +16 -47
- package/dist/schema/row-fields.js +88 -0
- package/dist/schema/row-ref.d.ts +59 -0
- package/dist/schema/row-ref.js +28 -0
- package/dist/schema/runtime-values.d.ts +8 -13
- package/dist/schema/section-props.d.ts +19 -26
- package/dist/schema/section-schema.d.ts +6 -6
- package/dist/schema/section-schema.js +2 -2
- package/dist/schema/slot-builders.d.ts +222 -117
- package/dist/schema/slot-builders.js +57 -28
- package/dist/schema/slot-ref.d.ts +18 -2
- package/dist/schema/slot-ref.js +11 -3
- package/dist/schema/slot-types.d.ts +7 -7
- package/dist/schema/slot-types.js +55 -19
- package/dist/section/declare.d.ts +1 -1
- package/dist/section/section.d.ts +3 -3
- package/dist/template/logic-shim.d.ts +1 -1
- package/guide/reference/cli/INDEX.md +2 -2
- package/guide/reference/cli/build.md +1 -1
- package/guide/reference/cli/check.md +1 -1
- package/guide/reference/cli/dev.md +1 -1
- package/guide/reference/cli/property-add.md +1 -1
- package/guide/reference/cli/property-list.md +1 -1
- package/guide/reference/cli/publish.md +1 -1
- package/guide/reference/cli/upgrade.md +1 -1
- package/guide/reference/rules/INDEX.md +1 -2
- package/package.json +1 -1
- package/tsconfig.base.json +1 -0
- package/dist/artifact/playground/client/assets/index-Cqz-jjVw.js +0 -1101
- package/dist/packages/internal/section-contracts/dist/row-contract.js +0 -37
- package/dist/packages/internal/template-contracts/dist/layout.js +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,138 @@
|
|
|
1
1
|
# @homepages/concrete
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- d4418c5: Manual: where a section reads a comparable's `photo_url`, read `photo_upload_id` and draw it as an `image` value — `{ photo_id: comp.photo_upload_id, url: "", alt: comp.address }`, declared as an `image()` row field or slot (locked, when nothing on the canvas picks it) and rendered with `<Image>`; in a fixture property, replace each comp's `photo_url` with `photo: <an imported file>`, or drop it.
|
|
8
|
+
|
|
9
|
+
BREAKING: a comparable's photo is no longer a URL. `ComparableRow` loses `photo_url` and gains `photo_upload_id: string | null` — the id of an upload the comparable itself owns, never one of the property's own photos, so no media pool offers it. A section turns it into an `image` value, and the render attaches the served URL and its responsive ladder by `photo_id` exactly as it does for any other image, so the photo is drawn through `<Image>` rather than a raw `<img src>`.
|
|
10
|
+
|
|
11
|
+
A fixture property's comparable states its photo as a file, `photo: comp360WCourt` (an imported image), the way a contact states its avatar; absent or `null` means the comp has no photo. The loader mints its id — `comparable:<comp id>:photo` — registers the file as image media with the comp's address as its alt, and refuses a `photo` that is not an imported file. `concrete dev` and `concrete build` resolve an `image` value by its `photo_id` as well as by an `{ asset_id }` reference, so a `compute()` that builds one from an upload id the facts hold — a comp's photo, a contact's logo — draws the same picture in a fixture as on the platform.
|
|
12
|
+
|
|
13
|
+
The platform's comparables wire contract changes to match: a comp row carries `photo_upload_id` and a short-lived `photo_preview_url` in place of `photo_url`, and the replace-set write carries no photo member at all. That contract reaches this tarball only as declarations, through the media library's upload types.
|
|
14
|
+
|
|
15
|
+
- 0995373: Manual: stop reading `days_on_market` from a comparable row; count it from `listed_date` instead — to the sale date on a sold comp, to the day the page is viewed on a live one — and drop the member from any fixture comp that states it.
|
|
16
|
+
|
|
17
|
+
BREAKING: a comparable row — the `comparables` fact family, `ComparableRow` and a fixture's `ComparableEntry` — no longer carries `days_on_market`. A stored running count is stale the moment it is stored and nobody could enter it; the listed date is the fact, and the count derives from it.
|
|
18
|
+
|
|
19
|
+
- f72c9a0: Manual: stop reading `source_url` and `source_name` from a comparable row; the platform no longer stores either, so a section that printed a comp's listing link or its source's name drops that line.
|
|
20
|
+
|
|
21
|
+
BREAKING: a comparable row — the `comparables` fact family, `ComparableRow` and a fixture's `ComparableEntry` — no longer carries `source_url` or `source_name`. Only the platform's retired nearby-comps suggestions ever filled them; a comp now comes from the user or an uploaded document, and neither supplies a listing page. The platform's comparables wire contract loses the same two members, and the suggestion request and response shapes are gone.
|
|
22
|
+
|
|
23
|
+
- 6335652: Manual: delete `layout` from every `list.of(…)` record options object. Declare the record's fields in the order the editor should show them, and give a field that must keep a row of its own a size that never pairs — a row title that sat alone above a `[beds, baths]` pair becomes `text.medium`. Write each `group(…)` card's members as bare slot keys, with no `[a, b]` tuples.
|
|
24
|
+
|
|
25
|
+
BREAKING: a record list's rows now lay out by the editor's own rule — declaration order, with two adjacent short fields (a short text, a number, a select or a link) sharing one row — exactly as a section's slots do. `list.of` no longer takes `layout`, a serialized record list that still carries one fails `concrete check` as an unrecognized key, `item_order` is always the declaration order, and the `contract/row` rule is retired with it. A group's `members` accept bare slot ids only.
|
|
26
|
+
|
|
27
|
+
- 020e059: Manual: where `concrete upgrade` hands back a `Manual:` line, finish it — replace each brief it generated for a record list's row field with the real one, add to a bound row's field fill the row members it uses, and give an origin to any row field it could not; then drop every `sourceFilter` from an `image`, binding a unit's floor plans from `fact.property.units` instead.
|
|
28
|
+
|
|
29
|
+
BREAKING: a list and a select each take one options object, and every row field of a record list declares where its value comes from. `list.of`, `select.of`, the display entry's positional `select(cases, opts)` and the `image` builder's `sourceFilter` option are gone:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
list({
|
|
33
|
+
label: "Highlights",
|
|
34
|
+
source: fill({ brief: "Three highlights.", count: 3 }),
|
|
35
|
+
item: text.short({ label: "Highlight", cap: 60 }),
|
|
36
|
+
});
|
|
37
|
+
list({
|
|
38
|
+
label: "Units",
|
|
39
|
+
source: fact.property.units,
|
|
40
|
+
writeback: false,
|
|
41
|
+
fields: (unit) => ({
|
|
42
|
+
unit_label: text.short({
|
|
43
|
+
label: "Unit",
|
|
44
|
+
source: unit.unit_label,
|
|
45
|
+
writeback: true,
|
|
46
|
+
}),
|
|
47
|
+
floor_plans: list({
|
|
48
|
+
label: "Floor plans",
|
|
49
|
+
source: unit.floor_plans,
|
|
50
|
+
writeback: false,
|
|
51
|
+
item: image({ label: "Floor plan" }),
|
|
52
|
+
}),
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
select({ label: "Status", options: ["for_sale", "sold"] });
|
|
56
|
+
select({
|
|
57
|
+
options: ["visible", "hidden"],
|
|
58
|
+
source: compute({ reads: [fact.photos] }, (photos) =>
|
|
59
|
+
photos.length > 0 ? "visible" : "hidden"
|
|
60
|
+
),
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`concrete check` refuses a record list's row field that declares no origin — a member of its row, a `fill()` or a `compute()` — whatever built the list. The record form of `list.of` was exempt, its list deriving the fields it left unsourced; that form and its exemption end together. An `image` slot declaring `sourceFilter` is refused: the editor's picker offers what the slot's source names.
|
|
65
|
+
|
|
66
|
+
What `concrete upgrade` does for you, through the `object-form-only` codemod: it rewrites every `select.of` and positional `select` to `select({ …, options })`, then every `list.of` to `list({ …, item })` or to a `fields` list whose row fields each declare their origin — a bound row's fields bind its members, and an AI-built row's fields each fill themselves, the field that keyed or picked the rows first. What only you can finish it names, file by file.
|
|
67
|
+
|
|
68
|
+
- 5cc3a48: Manual: a section that reads a member of a bound record list's row it never declared — `comp.value.status`, `unit.value.sqft`, a unit's `floor_plans` off an `image` field — declares that member as a row field bound to it (`status: text.short({ label: "Status", source: comp.status, writeback: false })`, `floor_plans: list({ label: "Floor plans", source: unit.floor_plans, writeback: false, item: image({ label: "Floor plan" }) })`) and reads the field; a helper typed with `UnitRow`, `ContactRow`, `FloorplanAssignment`, `CollectionRowValues` or `BakedRowValue` types its parameter from the slot instead (`ItemBinding<typeof schema.slots.units>["value"]`).
|
|
69
|
+
|
|
70
|
+
A record list's row is its identity plus the fields the list declares, and nothing else, in the types, in `bindSlots`/`bindItems`, and in `concrete dev` and `concrete check`. A list bound to `fact.property.units` gives each row its `unit_id`, one bound to contacts or comparables its `id`, and any other list the editor's `id`; a collection member no field declares is not on the row, and reading it is a type error. Floor plans are only a `list({ item: image() })` field: an `image` row field holds one image, and a list of floor-plan assignments stored there binds and renders as the empty image.
|
|
71
|
+
|
|
72
|
+
`UnitRow`, `ContactRow`, `FloorplanAssignment`, `CollectionRowValues` and `BakedRowValue` are no longer exported. `ComparableRow` stays: it is the comparable fact a `compute()` reading `fact.property.comparables` derives from, never a bound row. `BoundSlotValue<D>` is now `SlotValue<D>`.
|
|
73
|
+
|
|
74
|
+
### Minor Changes
|
|
75
|
+
|
|
76
|
+
- 681f990: `list({ … })` declares a list with one options object and exactly one of `item` or `fields`; `list.of(item, opts)` and `list.of({ …fields }, opts)` are deprecated beside it and still compile.
|
|
77
|
+
|
|
78
|
+
`list({ label, item })` is one slot per entry and emits exactly what `list.of(item, opts)` did. A select or media item says `unique: true` when no two entries may hold the same value; a list-level `unique` is refused.
|
|
79
|
+
|
|
80
|
+
`list({ label, source, fields: (row) => ({ … }) })` is a record per entry, and `row` offers what the list's `source` supplies:
|
|
81
|
+
|
|
82
|
+
- bound to `fact.property.units`, `.contacts` or `.comparables`, each member of that collection's row — `unit.beds`, `unit.floor_plans`, `contact.headshot`, `comp.photo` — typed, and legal as a row field's `source:` (with `writeback`, `true` only on a writable member) and in its `fill()` or `compute()` `reads`. A member the row does not offer, `writeback: true` on a read-only one, and a member whose value the field cannot hold are compile errors at the field. A row's type is its identity (`unit_id`, `id`) plus the fields you declare, and nothing else;
|
|
83
|
+
- sourced by a `compute()` or another slot, the members of that value's rows;
|
|
84
|
+
- sourced by a `fill()`, nothing: every field declares its own `fill()`, and a field reads an EARLIER field of its row by that field's const — reading a later one, or itself, is an error.
|
|
85
|
+
|
|
86
|
+
Every row field of a `fields` list declares its origin — a row member, a `fill()` or a `compute()` — and `concrete check` refuses one that does not. A row field's `compute()` runs once per row. A row field bound to a `fact.*` is refused: `fact.unit.*` and `fact.contact.*` name the primary row, and a property fact is the same in every row, so read it in the field's `reads`.
|
|
87
|
+
|
|
88
|
+
`unique: true` is also legal on an `image`, `video`, `tour` or `document` row field.
|
|
89
|
+
|
|
90
|
+
A workspace can move to the new form now: the codemod step `codemods/steps/list-object-form.mjs` in the installed package rewrites every `list.of`, and prints a `Manual:` line for what only you can finish — a real brief for each field it gave a generated one, and the row members each fill in a bound row reads.
|
|
91
|
+
|
|
92
|
+
- 4e7e3ba: `select` takes one options object, like every other slot builder. Write a select's choices as `options`: `select({ label, options, … })` for a slot, a record row's field or a list's item, and `select({ options, source, locked? })` for a `display:` entry, which takes no `label`. A select declares exactly one set of choices, `options` or a fact `source`, and the types refuse both or neither. Inside a list, a select item or row field accepts `unique: true`: its picked value does not repeat across the rows.
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
display: {
|
|
96
|
+
visibility: select({ options: ["visible", "hidden"], source: compute({ reads: [fact.tours] }, (tours) => (tours.length > 0 ? "visible" : "hidden")) }),
|
|
97
|
+
},
|
|
98
|
+
slots: {
|
|
99
|
+
status: select({ label: "Status", options: ["for_sale", "sold"] }),
|
|
100
|
+
measures: list.of(select({ label: "Measure", options: MEASURES, unique: true }), { label: "Measures" }),
|
|
101
|
+
},
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`select.of(values, opts)` and the positional `select(cases, opts)` still work and are deprecated. Each emits the same schema as its object form, so a rewritten section publishes unchanged. The codemod step `codemods/steps/select-object-form.mjs` rewrites both forms in a workspace; the release that removes them runs it for you.
|
|
105
|
+
|
|
106
|
+
- 7457a52: `import "./styles.css"` in a section, page or component now typechecks. The framework's ambient declarations typed every asset a module can import except a stylesheet, so an editor running TypeScript 6 — where an unresolved side-effect import is an error by default — reported `Cannot find module or type declarations for side-effect import of './styles.css'` on every section that imports its own CSS, while `concrete check` on the framework's TypeScript 5 said nothing. The declaration is now the same one Vite and Next ship (`declare module "*.css" {}`), and the framework's `tsconfig` turns `noUncheckedSideEffectImports` on, so `check` grades what the editor grades: a side-effect import of a file that does not exist is a typecheck error rather than a stylesheet that silently never compiles. One shape that check reaches: a package stylesheet imported from a module by a subpath that does not name the file (`import "swiper/css"`) resolves only when the package ships types for that subpath, as swiper does; a package that does not is imported from one of your own stylesheets instead (`@import "pkg/dist/pkg.css" layer(components);`), which is also the only place a layer can be named for it. Nothing about how a stylesheet reaches the page changes — every `.css` reachable by import from `template.ts` still compiles into the one template stylesheet, in import order.
|
|
107
|
+
|
|
108
|
+
### Patch Changes
|
|
109
|
+
|
|
110
|
+
- 9b6c482: `concrete check` understands an AI-built record list whose every row field declares its own fill. Such a list is no longer searched for a key or a pool field: its `title:` only titles rows, and any number of its media fields may each pick from their own pool. A row fill's read of its own row (`{ kind: "row", field }`) must name a field declared earlier in the row — a read of the field itself, or of a later one, is refused by name. Lists in today's form, with one unfilled field their rows are keyed or pooled on, check exactly as before.
|
|
111
|
+
- c1c58c7: `concrete dev`'s editor treats a record list field bound to a comparable's `photo` as upload-only: it offers Upload, Crop and Remove, and never the property's photo library, since a comp's photo belongs to the comp. Uploading one needs the platform, so in the playground it is refused, as every other upload is.
|
|
112
|
+
- eec2863: A `compute()` reading `fact.property.comparables` receives each comp's photo as `photo`, the name `comp.photo` gives it in a bound list, so a compute and a row field spell a comparable's members the same way. The value is still the id of the upload the comp owns; `photo_upload_id` stays beside it with the same value, so a compute written against that name keeps working.
|
|
113
|
+
|
|
114
|
+
A record list's `select({ label, options })` row field may bind a member of its row (`source: row.status`), as every other row field builder already could — the form `concrete upgrade` writes for a select row field of a computed list.
|
|
115
|
+
|
|
116
|
+
A fixture's computed list that reads a fact or a slot is now baked as the platform bakes it: each row keeps its own `id` and exactly its declared fields, and its per-row computes run. Before, such a list kept every member its compute returned, so a fixture could render a member a published site never received. A computed row's `id` is kept on every computed list, as its type always promised.
|
|
117
|
+
|
|
118
|
+
- 870c15f: The platform's comparables wire contract no longer carries the state of collecting a comp's record: a comp row drops `collection_state`, `collection_reason`, `collected_at`, `candidates` and `history`, and the add-by-address and resolve request shapes are gone. That contract reaches this tarball only as declarations, through the media library's upload types, so the bytes move without any behaviour moving with them. No template-facing member changes.
|
|
119
|
+
- 0206786: The platform's library-item wire contract, which reaches this tarball only as declarations, now documents a contact card's `avatar_upload_id`, `logo_dark_upload_id` and `logo_light_upload_id` as read-only: a read reports the upload that currently holds each image, and a write may echo them back but they are ignored. No shape changes; a section reading a contact's image ids from the facts reads them exactly as before.
|
|
120
|
+
- f8a0803: The examples shipped with the framework teach only the object-form builders: the `fill()`, `poi()` and `document()` JSDoc write a list as `list({ label, item })`, and `concrete check`'s `contract/choose-select` and row-source refusals name `select({ label, options })` and `list({ item: image() })` as the remedy — the former also offering the per-field form, every row field its own `fill()`. `list.of`, `select.of` and the positional display `select` still compile, deprecated, until the next major removes them.
|
|
121
|
+
- cd1959b: A floor plan edited in the dev playground keeps its floor label. Saving an edited image back to the content doc used to drop the plan's `floor_label`, so its selector pill fell back to "Level N" after any edit. The label now stays on the saved reference.
|
|
122
|
+
- 6adeeac: A unit's floor plan, read through a row field bound to `unit.floor_plans` (`list({ item: image(), source: unit.floor_plans })`), carries its floor label in `concrete dev` and `concrete check` as it does on the platform: each plan's `ImageValue` holds `floor_label` (`"Upper Level"`, or `null` for an unlabelled plan), and a plan with no alt of its own takes its alt from that label. `ImageValue` declares the optional `floor_label`.
|
|
123
|
+
- b05e2c3: The `list-object-form` codemod step now prints a `Manual:` line for an AI-built row field whose `source:` is not a `fill()` written in place, such as a fill built by your own helper. That field saw the whole row before. Add the row's first field to its `reads` yourself, since the step cannot reach them. Before this, the step left such a field without the read and said nothing.
|
|
124
|
+
- 6793f8a: A record list's row field may now declare a row source in a serialized schema, and `concrete check` validates it. A row source is `{ kind: "row", field }`, naming a member of the row the list supplies. A `compute()`'s `reads` may name a row member the same way when the compute belongs to a row field. Schemas that declare no row source validate and resolve exactly as before.
|
|
125
|
+
|
|
126
|
+
`check` accepts a member only if it belongs to the bound collection's row and its value type fits the field. For example, a unit's `floor_plans` must sit on a list of images, and a comparable's `photo` on an `image`. `writeback: true` is accepted only on a writable member. A list built by `fill()` offers no members. A row field's `compute()` is held under `<list>.<field>`. `check` also rejects a list that mixes row members with the older `direct` row-field bindings.
|
|
127
|
+
|
|
128
|
+
Nothing in the authoring surface emits these shapes yet. This release makes schemas that carry them readable ahead of the authoring API that will write them.
|
|
129
|
+
|
|
130
|
+
- 5168da2: The `units`, `contacts` and `comparables` row descriptors in the fact catalog now describe each row as an author sees it: every member is keyed by its author-facing name and states the storage key it reads (`website` reads `website_url`, a contact's `headshot` reads `avatar_upload_id`, a comparable's `photo` reads `photo_upload_id`), its value type (a unit's `floor_plans` is an `image_list`, the contact images and a comp's photo are `image`), whether the canvas may write it back, and which media pool the editor picks it from.
|
|
131
|
+
|
|
132
|
+
`fact.unit.*` and `fact.contact.*` are now generated from those descriptors rather than declared beside them. Every name keeps its meaning and serializes exactly as before, `fact.contact.address` still emits `contact_address`, and the row types a `compute()` reads (`FactsUnit`, `FactsContact`, a comparable row's `photo_upload_id`) are unchanged. Hovering a `fact.unit.*` or `fact.contact.*` entry now shows the row member's description.
|
|
133
|
+
|
|
134
|
+
- a2e31df: The editor now treats a record-list row field by the row member its `source` names, not by the field's key. A contact field keyed `logo` but bound to `fact.contact.logo_dark` commits its image to the contact's dark logo. A unit field bound to the unit's floor plans gets the floor-plan picker whatever it is keyed, labels sibling units by the list's `title:` field, and does not need `sourceFilter: "floorplans"` for it. A floor-plan field declared as `list.of(image())` edits with the same picker and saves each plan as an image reference carrying its floor label. Sections whose field keys already match their members edit and save exactly as before.
|
|
135
|
+
|
|
3
136
|
## 6.2.0
|
|
4
137
|
|
|
5
138
|
### Minor Changes
|
package/codemods/manifest.json
CHANGED
|
@@ -69,6 +69,19 @@
|
|
|
69
69
|
"6.2.0": {
|
|
70
70
|
"codemods": [],
|
|
71
71
|
"manual": []
|
|
72
|
+
},
|
|
73
|
+
"7.0.0": {
|
|
74
|
+
"codemods": [
|
|
75
|
+
"object-form-only"
|
|
76
|
+
],
|
|
77
|
+
"manual": [
|
|
78
|
+
"where a section reads a comparable's `photo_url`, read `photo_upload_id` and draw it as an `image` value \u2014 `{ photo_id: comp.photo_upload_id, url: \"\", alt: comp.address }`, declared as an `image()` row field or slot (locked, when nothing on the canvas picks it) and rendered with `<Image>`; in a fixture property, replace each comp's `photo_url` with `photo: <an imported file>`, or drop it.",
|
|
79
|
+
"stop reading `days_on_market` from a comparable row; count it from `listed_date` instead \u2014 to the sale date on a sold comp, to the day the page is viewed on a live one \u2014 and drop the member from any fixture comp that states it.",
|
|
80
|
+
"stop reading `source_url` and `source_name` from a comparable row; the platform no longer stores either, so a section that printed a comp's listing link or its source's name drops that line.",
|
|
81
|
+
"delete `layout` from every `list.of(\u2026)` record options object. Declare the record's fields in the order the editor should show them, and give a field that must keep a row of its own a size that never pairs \u2014 a row title that sat alone above a `[beds, baths]` pair becomes `text.medium`. Write each `group(\u2026)` card's members as bare slot keys, with no `[a, b]` tuples.",
|
|
82
|
+
"where `concrete upgrade` hands back a `Manual:` line, finish it \u2014 replace each brief it generated for a record list's row field with the real one, add to a bound row's field fill the row members it uses, and give an origin to any row field it could not; then drop every `sourceFilter` from an `image`, binding a unit's floor plans from `fact.property.units` instead.",
|
|
83
|
+
"a section that reads a member of a bound record list's row it never declared \u2014 `comp.value.status`, `unit.value.sqft`, a unit's `floor_plans` off an `image` field \u2014 declares that member as a row field bound to it (`status: text.short({ label: \"Status\", source: comp.status, writeback: false })`, `floor_plans: list({ label: \"Floor plans\", source: unit.floor_plans, writeback: false, item: image({ label: \"Floor plan\" }) })`) and reads the field; a helper typed with `UnitRow`, `ContactRow`, `FloorplanAssignment`, `CollectionRowValues` or `BakedRowValue` types its parameter from the slot instead (`ItemBinding<typeof schema.slots.units>[\"value\"]`)."
|
|
84
|
+
]
|
|
72
85
|
}
|
|
73
86
|
}
|
|
74
87
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// 7.0.0 — every list and every select takes one options object, and every row field
|
|
2
|
+
// declares its origin.
|
|
3
|
+
//
|
|
4
|
+
// 6.x deprecated `list.of(item, opts)`, `list.of({ …fields }, opts)`, `select.of(values,
|
|
5
|
+
// opts)` and the display entry's positional `select(cases, opts)` beside the object form,
|
|
6
|
+
// and shipped the rewrite for each as a codemod step. This release removes them, along
|
|
7
|
+
// with the `image` builder's `sourceFilter` option and the record form's exemption from
|
|
8
|
+
// the rule that every row field declares where its value comes from: a record list's row
|
|
9
|
+
// field with no row member, `fill()` or `compute()` is refused by `concrete check`,
|
|
10
|
+
// whatever built the list.
|
|
11
|
+
//
|
|
12
|
+
// What this codemod does is run the two steps, in one pass over the workspace:
|
|
13
|
+
//
|
|
14
|
+
// - `steps/select-object-form.mjs` — `select.of(VALUES, { … })` and `select(CASES, { … })`
|
|
15
|
+
// become `select({ …, options: … })`. First, so a record's select field is already in
|
|
16
|
+
// the object form when the list step reads which field keyed its rows.
|
|
17
|
+
// - `steps/list-object-form.mjs` — every `list.of` becomes `list({ …, item })` or a
|
|
18
|
+
// `fields` list whose every row field declares its origin.
|
|
19
|
+
//
|
|
20
|
+
// What it leaves to you is what the steps report, per file: each is a `Manual:` line on a
|
|
21
|
+
// file they rewrote (a generated brief to replace, the row members a bound row's fill now
|
|
22
|
+
// has to read), or a call they could not read. `sourceFilter` has no rewrite: drop it, and
|
|
23
|
+
// where the slot is a unit's floor plan, bind the unit's `floor_plans` member from a
|
|
24
|
+
// `fact.property.units` list, whose picker offers that unit's floor plans.
|
|
25
|
+
|
|
26
|
+
import listObjectForm from "./steps/list-object-form.mjs";
|
|
27
|
+
import selectObjectForm from "./steps/select-object-form.mjs";
|
|
28
|
+
|
|
29
|
+
/** @param {string} root @returns {Promise<{rewritten: string[], notRewritten: {file: string, reason: string}[]}>} */
|
|
30
|
+
export default async function objectFormOnly(root) {
|
|
31
|
+
const rewritten = new Set();
|
|
32
|
+
const notRewritten = [];
|
|
33
|
+
for (const step of [selectObjectForm, listObjectForm]) {
|
|
34
|
+
const report = await step(root);
|
|
35
|
+
for (const file of report.rewritten) rewritten.add(file);
|
|
36
|
+
notRewritten.push(...report.notRewritten);
|
|
37
|
+
}
|
|
38
|
+
return { rewritten: [...rewritten], notRewritten };
|
|
39
|
+
}
|