@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.
- package/CHANGELOG.md +69 -0
- package/README.md +3 -3
- package/codemods/manifest.json +14 -0
- package/codemods/registry-keys-only.mjs +113 -0
- package/codemods/steps/list-object-form.mjs +2 -3
- package/codemods/steps/registry-key-reads.mjs +276 -0
- package/dist/artifact/playground/client/assets/index-BFNHB7VM.css +1 -0
- package/dist/artifact/playground/client/assets/index-Div1yo6s.js +1259 -0
- package/dist/artifact/playground/client/index.html +2 -2
- package/dist/artifact/playground/host.mjs +42 -42
- package/dist/cli/build/artifact.js +2 -1
- package/dist/cli/build/fixtures.js +2 -1
- package/dist/cli/check/render/inputs.js +3 -3
- package/dist/cli/check/stages/sections.js +5 -6
- package/dist/cli/check/stages/workspace.js +2 -0
- package/dist/cli/check/template-key.js +16 -0
- package/dist/cli/dev/workspace-reader.js +9 -2
- package/dist/fixtures/media-store.js +3 -3
- package/dist/fixtures/resolve.js +28 -23
- package/dist/fixtures/synthesize-empties.js +3 -1
- package/dist/fixtures.d.ts +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/packages/external/concrete/package.js +1 -1
- package/dist/packages/internal/capture-settle/dist/island-markers.d.ts +1 -1
- package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +15 -27
- package/dist/packages/internal/fill-bake/dist/compute-reads.js +12 -12
- package/dist/packages/internal/fill-bake/dist/derive-source.js +7 -14
- package/dist/packages/internal/fill-bake/dist/index.js +4 -3
- package/dist/packages/internal/fill-bake/dist/item-merge.js +36 -16
- package/dist/packages/internal/fill-bake/dist/item-overrides.js +1 -28
- package/dist/packages/internal/fill-bake/dist/linked-merge.js +5 -7
- package/dist/packages/internal/fill-bake/dist/list-grammar.js +11 -34
- package/dist/packages/internal/fill-bake/dist/stored-row-reader.js +1 -0
- package/dist/packages/internal/fill-vocabulary/dist/resolved-decision.js +12 -39
- package/dist/packages/internal/fill-vocabulary/dist/verbs.js +2 -17
- package/dist/packages/internal/media-resolution/dist/document.js +16 -15
- package/dist/packages/internal/media-resolution/dist/image.js +38 -94
- package/dist/packages/internal/media-resolution/dist/index.js +1 -1
- package/dist/packages/internal/media-resolution/dist/list.js +12 -12
- package/dist/packages/internal/media-resolution/dist/media.js +17 -16
- package/dist/packages/internal/media-resolution/dist/records.js +4 -2
- package/dist/packages/internal/media-resolution/dist/slot.js +9 -6
- package/dist/packages/internal/media-resolution/dist/tour.js +12 -11
- package/dist/packages/internal/media-resolution/dist/video.js +16 -16
- package/dist/packages/internal/property-facts/dist/registry-facts.js +10 -2
- package/dist/packages/internal/section-contracts/dist/catalog.js +2 -10
- package/dist/packages/internal/section-contracts/dist/directly-linked-list-contract.js +5 -12
- package/dist/packages/internal/section-contracts/dist/fill-spec-view.js +1 -5
- package/dist/packages/internal/section-contracts/dist/fill-verb-contract.js +7 -5
- package/dist/packages/internal/section-contracts/dist/grammar-scope.js +1 -1
- package/dist/packages/internal/section-contracts/dist/index.js +0 -2
- package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +0 -29
- package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +2 -16
- package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +6 -6
- package/dist/packages/internal/section-contracts/dist/object-contract.js +4 -2
- package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +6 -2
- package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +1 -15
- package/dist/packages/internal/section-contracts/dist/row-rule-contract.js +6 -7
- package/dist/packages/internal/section-contracts/dist/row-source-contract.js +7 -8
- package/dist/packages/internal/section-contracts/dist/runners.js +5 -17
- package/dist/packages/internal/section-contracts/dist/select-contract.js +7 -1
- package/dist/packages/internal/section-contracts/dist/source-contract.js +20 -79
- package/dist/packages/internal/section-contracts/dist/sources-contract.js +1 -1
- package/dist/packages/internal/section-contracts/dist/table-member.js +5 -8
- package/dist/packages/internal/section-contracts/dist/writer-reads-fact-contract.js +5 -10
- package/dist/packages/internal/source-resolution/dist/index.js +21 -189
- package/dist/packages/internal/template-artifact/dist/index.js +2 -2
- package/dist/packages/internal/template-artifact/dist/layout.js +3 -1
- package/dist/packages/internal/template-artifact/dist/verify.js +32 -16
- package/dist/packages/internal/template-contracts/dist/content-pick.js +24 -1
- package/dist/packages/internal/template-contracts/dist/decision-fills.js +2 -6
- package/dist/packages/internal/template-contracts/dist/document-value.d.ts +2 -2
- package/dist/packages/internal/template-contracts/dist/fact-keys.d.ts +3 -2
- package/dist/packages/internal/template-contracts/dist/fact-keys.js +19 -43
- package/dist/packages/internal/template-contracts/dist/fact-registry.d.ts +24 -3
- package/dist/packages/internal/template-contracts/dist/fact-registry.js +14 -7
- package/dist/packages/internal/template-contracts/dist/fill-builders.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/fill-spec-schema.js +3 -68
- package/dist/packages/internal/template-contracts/dist/fill-spec.js +7 -6
- package/dist/packages/internal/template-contracts/dist/list-editing.js +0 -1
- package/dist/packages/internal/template-contracts/dist/list.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/list.js +7 -15
- package/dist/packages/internal/template-contracts/dist/media-candidates.js +1 -1
- package/dist/packages/internal/template-contracts/dist/mirror-kind.js +2 -2
- package/dist/packages/internal/template-contracts/dist/object.js +3 -2
- package/dist/packages/internal/template-contracts/dist/primitive-descriptors.js +2 -2
- package/dist/packages/internal/template-contracts/dist/process-builders.d.ts +2 -2
- package/dist/packages/internal/template-contracts/dist/read-graph.js +14 -51
- package/dist/packages/internal/template-contracts/dist/ref-locate.js +15 -27
- package/dist/packages/internal/template-contracts/dist/registry-facts.d.ts +3 -1
- package/dist/packages/internal/template-contracts/dist/registry-facts.js +13 -24
- package/dist/packages/internal/template-contracts/dist/registry-shape.d.ts +20 -4
- package/dist/packages/internal/template-contracts/dist/registry-shape.js +69 -11
- package/dist/packages/internal/template-contracts/dist/row-planners.js +1 -1
- package/dist/packages/internal/template-contracts/dist/row-ref.d.ts +5 -14
- package/dist/packages/internal/template-contracts/dist/row-ref.js +7 -23
- package/dist/packages/internal/template-contracts/dist/row-sources.js +6 -16
- package/dist/packages/internal/template-contracts/dist/row.d.ts +1 -1
- package/dist/packages/internal/template-contracts/dist/row.js +6 -7
- package/dist/packages/internal/template-contracts/dist/runtime-values.d.ts +5 -20
- package/dist/packages/internal/template-contracts/dist/section-schema-types.d.ts +1 -0
- package/dist/packages/internal/template-contracts/dist/slot-builders.d.ts +29 -37
- package/dist/packages/internal/template-contracts/dist/slot-builders.js +4 -7
- package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +2 -733
- package/dist/packages/internal/template-contracts/dist/slot-catalog.js +2 -502
- package/dist/packages/internal/template-contracts/dist/slot-overrides.js +4 -1
- package/dist/packages/internal/template-contracts/dist/slot-ref.d.ts +4 -4
- package/dist/packages/internal/template-contracts/dist/slot-types.js +1 -2
- package/dist/packages/internal/template-contracts/dist/slot-value.d.ts +9 -10
- package/dist/packages/internal/template-contracts/dist/table-members.d.ts +5 -12
- package/dist/packages/internal/template-contracts/dist/table-members.js +7 -37
- package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +2 -2
- package/dist/primitives/Image.d.ts +3 -3
- package/dist/primitives/slot-bindings.js +2 -2
- package/dist/primitives/slot-download.d.ts +1 -1
- package/dist/primitives/slot-media.d.ts +1 -1
- package/dist/rules/registry.js +6 -0
- package/dist/schema/fact.d.ts +19 -52
- package/dist/schema/fact.js +6 -25
- package/dist/schema/facts-view.d.ts +1 -2
- package/dist/schema/property-facts.d.ts +1 -62
- package/dist/schema/section-schema.d.ts +2 -2
- package/dist/schema/section-schema.js +1 -1
- package/dist/section/section.d.ts +2 -2
- 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 +4 -5
- package/package.json +1 -1
- package/dist/artifact/playground/client/assets/index-BUmdDDX5.js +0 -1259
- package/dist/artifact/playground/client/assets/index-DDOcM0zA.css +0 -1
- package/dist/packages/internal/fill-vocabulary/dist/row-reads.js +0 -15
- package/dist/packages/internal/section-contracts/dist/group-contract.js +0 -19
- package/dist/packages/internal/section-contracts/dist/option-source-contract.js +0 -22
- package/dist/packages/internal/template-contracts/dist/comparable-address.js +0 -19
- package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +0 -62
- package/dist/packages/internal/template-contracts/dist/legacy-facts.js +0 -167
- package/dist/packages/internal/template-contracts/dist/registry-aliases.js +0 -77
|
@@ -106,6 +106,23 @@ type FactRegistry<H extends FactHome = FactHome, P extends Readonly<Record<strin
|
|
|
106
106
|
} & (string extends keyof P ? unknown : PageRefs<H, P>);
|
|
107
107
|
/** The registry's facts, each a page: a bare declaration as a fact with no page. */
|
|
108
108
|
type FactEntries<P> = { readonly [K in keyof P]: P[K] extends FactPage<unknown> ? P[K] : PagelessFact<P[K]>; };
|
|
109
|
+
declare const libraryContacts: PagedFact<ListSlotDef<NoInfer<ObjectSlotDef<{
|
|
110
|
+
readonly headshot: ImageSlotDef & FillMark;
|
|
111
|
+
readonly name: TextSlotDef<"short"> & FillMark;
|
|
112
|
+
readonly title: TextSlotDef<"short"> & FillMark;
|
|
113
|
+
readonly org_name: TextSlotDef<"short"> & FillMark;
|
|
114
|
+
readonly email: EmailSlotDef & FillMark;
|
|
115
|
+
readonly phone: PhoneSlotDef & FillMark;
|
|
116
|
+
readonly website: UrlSlotDef & FillMark;
|
|
117
|
+
readonly address: AddressSlotDef & AddressMembers & FillMark;
|
|
118
|
+
readonly bio: TextSlotDef<"long"> & FillMark;
|
|
119
|
+
readonly logo_dark: ImageSlotDef & FillMark;
|
|
120
|
+
readonly logo_light: ImageSlotDef & FillMark;
|
|
121
|
+
readonly instagram: UrlSlotDef & FillMark;
|
|
122
|
+
readonly linkedin: UrlSlotDef & FillMark;
|
|
123
|
+
readonly x: UrlSlotDef & FillMark;
|
|
124
|
+
readonly facebook: UrlSlotDef & FillMark;
|
|
125
|
+
}>>, null, number> & FillMark>;
|
|
109
126
|
/**
|
|
110
127
|
* The org's facts: what is stored once per org and reused on every property. Today that
|
|
111
128
|
* is the contacts; a template's library facts join it later (T10).
|
|
@@ -199,7 +216,7 @@ declare const propertyFacts: FactRegistry<"property", FactEntries<{
|
|
|
199
216
|
readonly listing_intent: PagedFact<SelectSlotDef & FillMark>;
|
|
200
217
|
/** The property's description, the substrate every text decision is grounded in. Read-only. */
|
|
201
218
|
readonly description: PagedFact<TextSlotDef<"long"> & FillMark>;
|
|
202
|
-
/** Every upload the property holds — photos, floor plans, videos, tours and documents — in the list's order. A `compute()` reads it as `readonly Media[]`, each upload its
|
|
219
|
+
/** Every upload the property holds — photos, floor plans, videos, tours and documents — in the list's order. A `compute()` reads it as `readonly Media[]`, each upload its media record; a media slot picks `from` it. Read-only, and binds no slot. */
|
|
203
220
|
readonly uploads: PagedFact<ListSlotDef<NoInfer<MediaSlotDef<"image" | "video" | "tour" | "document"> & FillMark>, null, number> & FillMark>;
|
|
204
221
|
/** What shows the property — its photos, videos and tours, sorted out of the uploads. A `compute()` reads it as `readonly Media[]`; a media slot picks `from` it. */
|
|
205
222
|
readonly property_media: ListSlotDef<NoInfer<MediaSlotDef<"image" | "video" | "tour"> & FillMark>, null, number> & FillMark;
|
|
@@ -207,7 +224,7 @@ declare const propertyFacts: FactRegistry<"property", FactEntries<{
|
|
|
207
224
|
readonly floor_plans: ListSlotDef<NoInfer<ImageSlotDef & FillMark>, null, number> & FillMark;
|
|
208
225
|
/** The property's informational documents — what sets out its figures, finances, terms, legal record, condition or plans — sorted out of the uploads. A `compute()` reads it as `readonly Media[]`; a media slot picks `from` it. */
|
|
209
226
|
readonly property_documents: ListSlotDef<NoInfer<MediaSlotDef<"image" | "video" | "document"> & FillMark>, null, number> & FillMark;
|
|
210
|
-
/** The property's cover photo, picked from its media. An `image` slot binds it (`source: fact.property.hero`) and a `compute()` reads it, each as its
|
|
227
|
+
/** The property's cover photo, picked from its media. An `image` slot binds it (`source: fact.property.hero`) and a `compute()` reads it, each as its media record (`Media`). Read-only. */
|
|
211
228
|
readonly hero: ImageSlotDef & FillMark;
|
|
212
229
|
/** The property's website address, `https://` and its chosen hostname, `null` when the property has no domain. It exists from the moment a domain is chosen, before the site is first published. A `compute()` reads it (`reads: [fact.property.site_url]`). Read-only. */
|
|
213
230
|
readonly site_url: UrlSlotDef & FillMark;
|
|
@@ -276,6 +293,10 @@ declare const propertyFacts: FactRegistry<"property", FactEntries<{
|
|
|
276
293
|
type PropertyFactRegistry = typeof propertyFacts;
|
|
277
294
|
/** The library registry's type — what `libraryFacts` declares. */
|
|
278
295
|
type LibraryFactRegistry = typeof libraryFacts;
|
|
296
|
+
/** The library's tables' pages, typed apart from `libraryFacts` as the property's are: a table's name is read off them. */
|
|
297
|
+
interface LibraryTablePages {
|
|
298
|
+
readonly contacts: typeof libraryContacts;
|
|
299
|
+
}
|
|
279
300
|
/**
|
|
280
301
|
* The property's own tables' pages, typed apart from `propertyFacts`: a row's member
|
|
281
302
|
* types read their items here (./table-members), because the registry declares the
|
|
@@ -287,4 +308,4 @@ interface PropertyTablePages {
|
|
|
287
308
|
readonly commercial_spaces: typeof commercial_spaces;
|
|
288
309
|
}
|
|
289
310
|
//#endregion
|
|
290
|
-
export { FACT_HOMES, FactDeclaration, FactHead, FactHome, FactPage, FactRegistry, FactSource, LibraryFactRegistry, ListDeclaration, MediaDeclaration, ObjectDeclaration, PageHead, PagedFact, PagelessFact, PropertyFactRegistry, PropertyTablePages, RowDeclaration, ValueDeclaration, libraryFacts, propertyFacts };
|
|
311
|
+
export { FACT_HOMES, FactDeclaration, FactHead, FactHome, FactPage, FactRegistry, FactSource, LibraryFactRegistry, LibraryTablePages, ListDeclaration, MediaDeclaration, ObjectDeclaration, PageHead, PagedFact, PagelessFact, PropertyFactRegistry, PropertyTablePages, RowDeclaration, ValueDeclaration, libraryFacts, propertyFacts };
|
|
@@ -83,7 +83,7 @@ function resolveMediaLists(at, from, scope) {
|
|
|
83
83
|
function resolveMediaList(at, from, scope) {
|
|
84
84
|
const key = typeof from === "object" && from !== null ? scope.pages.get(from) : void 0;
|
|
85
85
|
const resolved = typeof from === "string" ? from : key === void 0 ? void 0 : `${scope.home}.${key}`;
|
|
86
|
-
if (resolved === void 0 || !scope.mediaLists.has(resolved)) throw new Error(`${at} picks \`from\` something other than one of this registry's media lists — a media field picks from a list of media (the \`uploads\` page, a sorted list), by its const, or owns its
|
|
86
|
+
if (resolved === void 0 || !scope.mediaLists.has(resolved)) throw new Error(`${at} picks \`from\` something other than one of this registry's media lists — a media field picks from a list of media (the \`uploads\` page, a sorted list), by its const, or owns its media.`);
|
|
87
87
|
return resolved;
|
|
88
88
|
}
|
|
89
89
|
function resolveCompute(at, binding, scope) {
|
|
@@ -105,6 +105,11 @@ function refuseHolderKeys(at, slot) {
|
|
|
105
105
|
if (slot["required"] !== void 0) throw new Error(`${at} declares \`required\` — a fact requires nothing on its own account; what a property must answer is what its templates require.`);
|
|
106
106
|
if (slot["type"] === "poi") throw new Error(`${at} is a poi — a place the platform builds is no fact.`);
|
|
107
107
|
}
|
|
108
|
+
function refuseHomeFills(at, home, slot) {
|
|
109
|
+
const fills = getFills(slot) ?? [];
|
|
110
|
+
if (home === "library" && fills.length > 0) throw new Error(`${at} declares a fill — a library's facts are the org's own, and nothing fills them.`);
|
|
111
|
+
if (fills.some((binding) => binding.verb === "find")) throw new Error(`${at} declares a \`find\` — a home's fact is answered, written or picked, never looked up.`);
|
|
112
|
+
}
|
|
108
113
|
function refuseObjectPicks(at, element) {
|
|
109
114
|
const { type, fields } = element;
|
|
110
115
|
if (type !== "object" || fields === void 0) return;
|
|
@@ -119,6 +124,7 @@ function fieldScope(objectSlot) {
|
|
|
119
124
|
}
|
|
120
125
|
function resolveDeclaration(at, slot, scope) {
|
|
121
126
|
refuseHolderKeys(at, slot);
|
|
127
|
+
refuseHomeFills(at, scope.home, slot);
|
|
122
128
|
let out = plainSlot(mapSlotRefs(slot, (read) => resolveRead(at, read, scope)));
|
|
123
129
|
if (out["from"] !== void 0 && (isMediaKind(String(out["type"])) || out["type"] === "media")) out = {
|
|
124
130
|
...out,
|
|
@@ -251,7 +257,7 @@ function comparableDistanceMeters(comp, subject) {
|
|
|
251
257
|
if (comp?.latitude == null || comp.longitude == null || subject?.latitude == null || subject.longitude == null) return null;
|
|
252
258
|
return Math.round(haversineMeters(subject.latitude, subject.longitude, comp.latitude, comp.longitude));
|
|
253
259
|
}
|
|
254
|
-
const
|
|
260
|
+
const libraryContacts = page({
|
|
255
261
|
title: "Your contacts",
|
|
256
262
|
description: "The people your listings name, with the headshots and logos they carry."
|
|
257
263
|
}, list({
|
|
@@ -297,7 +303,8 @@ const libraryFacts = defineFacts("library", { contacts: page({
|
|
|
297
303
|
}
|
|
298
304
|
});
|
|
299
305
|
}
|
|
300
|
-
}))
|
|
306
|
+
}));
|
|
307
|
+
const libraryFacts = defineFacts("library", { contacts: libraryContacts });
|
|
301
308
|
linkRegistry(libraryFacts);
|
|
302
309
|
const propertyAddress = page({
|
|
303
310
|
title: "What’s the address?",
|
|
@@ -359,7 +366,7 @@ const site_url = url({ label: "Website" });
|
|
|
359
366
|
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
367
|
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
368
|
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.",
|
|
369
|
+
"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
370
|
"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
371
|
"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
372
|
"beds, baths, sqft: exactly as printed for that dwelling; a studio has one bedroom.",
|
|
@@ -368,7 +375,7 @@ const UNITS_BRIEF = [
|
|
|
368
375
|
"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
376
|
"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
377
|
"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:
|
|
378
|
+
"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
379
|
"When the uploads present no dwelling with its own specs printed, return no items."
|
|
373
380
|
].join("\n\n");
|
|
374
381
|
const unitLabel = text.short({ label: "Unit" });
|
|
@@ -469,7 +476,7 @@ const COMMERCIAL_SPACES_BRIEF = [
|
|
|
469
476
|
"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
477
|
"floor: the floor of its building the space sits on, as printed (\"1\", \"Ground\", \"Mezzanine\"); never read off its suite number.",
|
|
471
478
|
"parking: the number of parking spaces printed for that space. Parking printed with no count, or for the building, is null.",
|
|
472
|
-
"amenities:
|
|
479
|
+
"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
480
|
"When the uploads present no commercial space with its own specs printed, return no items."
|
|
474
481
|
].join("\n\n");
|
|
475
482
|
const spaceLabel = text.short({ label: "Space" });
|
|
@@ -500,7 +507,7 @@ const commercial_spaces = page({
|
|
|
500
507
|
}
|
|
501
508
|
})
|
|
502
509
|
}));
|
|
503
|
-
const COMPARABLES_BRIEF = "The uploads may present comparable properties
|
|
510
|
+
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
511
|
const comparablePlace = address({ label: "Address" });
|
|
505
512
|
const comparableSaleDate = date({ label: "Sale date" });
|
|
506
513
|
const comparables = page({
|
|
@@ -101,7 +101,7 @@ type NoOtherKeys<O, Allowed> = { [K in Exclude<keyof O, keyof Allowed>]: never;
|
|
|
101
101
|
declare function write<const O extends WriteInput>(options: O & NoOtherKeys<O, WriteInput>): WriteFill<O>;
|
|
102
102
|
/**
|
|
103
103
|
* The model PICKS from candidates that exist: its holder's candidates — the property's
|
|
104
|
-
*
|
|
104
|
+
* media of a media slot's `from` list of its kinds, every value a select lists, a row's table
|
|
105
105
|
* — and on a list its item's one candidate-holding field, between the list's `min` and `max`. The answer always names a
|
|
106
106
|
* candidate; a pick is a set (`unique` defaults to `true`), and a list's items take the
|
|
107
107
|
* order the answer gives them: best first, or the order the brief names ("order them as
|
|
@@ -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)
|
|
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
|
-
|
|
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
|
-
])
|
|
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([]),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { DISPLAY_ENTRIES, isMediaType
|
|
1
|
+
import { DISPLAY_ENTRIES, isMediaType } from "./slot-catalog.js";
|
|
2
2
|
import { isFactRef, isSerializedSectionRef, isSiblingPage, isSiblingSlot, serializeRef } from "./slot-ref.js";
|
|
3
3
|
import { getFillSection, getFills } from "./fill-declaration.js";
|
|
4
4
|
import { fromListsOf, mediaFilterOf, mediaOf } from "./media-candidates.js";
|
|
5
|
+
import { tableOf } from "./registry-shape.js";
|
|
5
6
|
import { FINDABLE_KINDS, isFindableKind } from "./findable.js";
|
|
6
7
|
import { isValueKind } from "./value-contracts.js";
|
|
7
8
|
import { plannerForField } from "./row-planners.js";
|
|
@@ -64,7 +65,7 @@ function assertNoStatedOf(at, binding) {
|
|
|
64
65
|
function assertWriteComposes(at, element) {
|
|
65
66
|
const birthed = element !== void 0 && isMediaType(element.type ?? "") ? "a list of media" : Object.entries(element?.type === "object" ? element.fields ?? {} : {}).find(([, field]) => isMediaType(field.type ?? "") && field.source?.kind === "element")?.[0];
|
|
66
67
|
if (birthed === void 0) return;
|
|
67
|
-
throw new Error(`${at} is filled by \`fill.write\`, but ${birthed === "a list of media" ? birthed : `its item's media member "${birthed}"`} would hold what the write answers — a write composes, it does not birth
|
|
68
|
+
throw new Error(`${at} is filled by \`fill.write\`, but ${birthed === "a list of media" ? birthed : `its item's media member "${birthed}"`} would hold what the write answers — a write composes, it does not birth media: pick it (\`fill.pick\`).`);
|
|
68
69
|
}
|
|
69
70
|
const FOUND = "places and addresses";
|
|
70
71
|
const FINDABLE = FINDABLE_KINDS.map((kind) => `\`${kind}()\``).join(", ");
|
|
@@ -89,8 +90,8 @@ function heldOf(path, slot) {
|
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
92
|
const filter = mediaFilterOf(slot);
|
|
92
|
-
if (filter === null) throw new Error(`fillSpecFromSchema: ${String(slot.type)} "${path}" is picked, but holds no candidates — a pick chooses a row of a table, a select's value or a media slot's
|
|
93
|
-
if (filter.from === void 0) throw new Error(`fillSpecFromSchema: ${String(slot.type)} "${path}" is picked but names no \`from\` — a pick chooses from its holder's \`from\` (\`from: fact.property.property_media\`); a media slot without one owns its
|
|
93
|
+
if (filter === null) throw new Error(`fillSpecFromSchema: ${String(slot.type)} "${path}" is picked, but holds no candidates — a pick chooses a row of a table, a select's value or a media slot's media value.`);
|
|
94
|
+
if (filter.from === void 0) throw new Error(`fillSpecFromSchema: ${String(slot.type)} "${path}" is picked but names no \`from\` — a pick chooses from its holder's \`from\` (\`from: fact.property.property_media\`); a media slot without one owns its media.`);
|
|
94
95
|
return mediaOf(filter);
|
|
95
96
|
}
|
|
96
97
|
function holdsElement(slot) {
|
|
@@ -143,7 +144,7 @@ function collectReads(into, bindings, of) {
|
|
|
143
144
|
for (const read of serializedReads(binding.reads)) if (read.kind === "home") into.facts.add(read.key);
|
|
144
145
|
else if (isSerializedSectionRef(read) && read.section !== ownSection) into.slots.set(`${read.section} ${read.slot}`, read);
|
|
145
146
|
}
|
|
146
|
-
for (const table of Array.isArray(of) ? of : [of]) if (isFactRef(table) &&
|
|
147
|
+
for (const table of Array.isArray(of) ? of : [of]) if (isFactRef(table) && tableOf(table.key) !== null) into.facts.add(table.key);
|
|
147
148
|
}
|
|
148
149
|
function editorPickedOrigin(slot) {
|
|
149
150
|
return slot.type === "poi";
|
|
@@ -174,7 +175,7 @@ function slotDecision(path, slot, bindings) {
|
|
|
174
175
|
}
|
|
175
176
|
function itemFieldFill(path, field, bindings, tree) {
|
|
176
177
|
for (const binding of bindings) assertVerbFits(path, field, binding);
|
|
177
|
-
if (!(tree.userAnswers && field.type === "list" && bindings.every((binding) => binding.verb === "pick")) && field.type !== "row" && plannerForField(field) === void 0) throw new Error(`fillSpecFromSchema: item field "${path}" (type "${String(field.type)}") is filled, but an item cannot fill one — an item's fields are written or picked inside the list's one batched call, which plans text, a date, an email, a phone, a url, a select key,
|
|
178
|
+
if (!(tree.userAnswers && field.type === "list" && bindings.every((binding) => binding.verb === "pick")) && field.type !== "row" && plannerForField(field) === void 0) throw new Error(`fillSpecFromSchema: item field "${path}" (type "${String(field.type)}") is filled, but an item cannot fill one — an item's fields are written or picked inside the list's one batched call, which plans text, a date, an email, a phone, a url, a select key, a media value, a row, or a list of text, dates, emails, phones, urls, keys or media.`);
|
|
178
179
|
const { of, fills } = fillsOf(path, field, bindings);
|
|
179
180
|
return {
|
|
180
181
|
...of === void 0 ? {} : { of },
|
|
@@ -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 : {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RegistryTableKey } from "./slot-catalog.js";
|
|
2
1
|
import { ImageValue } from "./runtime-values.js";
|
|
2
|
+
import { RegistryTableKey } from "./registry-shape.js";
|
|
3
3
|
import { ComputeBinding } from "./compute.js";
|
|
4
4
|
import { ElementOf, ElementTableOf } from "./row-ref.js";
|
|
5
5
|
import { ListItemSlot } from "./slot-types.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isMediaKind } from "./slot-catalog.js";
|
|
2
2
|
import { ELEMENT_OF, elementOwner, isElementRef, isFactRef, isSiblingSlot, isSlotRef, rowOfMember } from "./slot-ref.js";
|
|
3
3
|
import { isComputeBinding } from "./compute.js";
|
|
4
4
|
import { fillsOfSource, isFillSource } from "./fill-builders.js";
|
|
5
5
|
import { getFills } from "./fill-declaration.js";
|
|
6
|
-
import {
|
|
6
|
+
import { tableMemberValueType, tableOf } from "./registry-shape.js";
|
|
7
7
|
import { TABLE_OF, carriedTable, rowDefinition, withTable } from "./row-ref.js";
|
|
8
8
|
import { mapSlotRefs, plainSlot } from "./resolve-scope.js";
|
|
9
9
|
import { headWith } from "./slot-builders.js";
|
|
@@ -13,7 +13,7 @@ import { itemRowTablesOf } from "./ref-locate.js";
|
|
|
13
13
|
//#region ../../internal/template-contracts/dist/list.js
|
|
14
14
|
function bakeListSource(source, label) {
|
|
15
15
|
if (isFactRef(source)) {
|
|
16
|
-
if (
|
|
16
|
+
if (tableOf(source.key) === null) throw new Error(`list: "${label}" is sourced by the fact "${source.key}", which is no table — a list's source is a table, a list slot, a list-valued member, a \`compute()\` or a fill; a list of the property's media is picked (\`fill.pick\`) from its item's \`from\`, or computed over a media list (\`compute({ reads: [fact.property.property_media] }, …)\`).`);
|
|
17
17
|
return {
|
|
18
18
|
kind: "home",
|
|
19
19
|
key: source.key
|
|
@@ -32,7 +32,7 @@ function bakeListSource(source, label) {
|
|
|
32
32
|
throw new Error(`list: "${label}" declares a source that is no list.`);
|
|
33
33
|
}
|
|
34
34
|
function elementTable(source) {
|
|
35
|
-
if (isFactRef(source)) return
|
|
35
|
+
if (isFactRef(source)) return tableOf(source.key);
|
|
36
36
|
if (isSiblingSlot(source) && source.type === "list") return carriedTable(source);
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
@@ -49,7 +49,7 @@ function kindOf(slot) {
|
|
|
49
49
|
return kind;
|
|
50
50
|
}
|
|
51
51
|
function identityItem(source, label) {
|
|
52
|
-
if (isFactRef(source) &&
|
|
52
|
+
if (isFactRef(source) && tableOf(source.key) !== null) return {
|
|
53
53
|
type: "row",
|
|
54
54
|
from: source.key,
|
|
55
55
|
source: { kind: "element" }
|
|
@@ -63,18 +63,10 @@ function identityItem(source, label) {
|
|
|
63
63
|
const member = rowOfMember(source);
|
|
64
64
|
if (member !== void 0) {
|
|
65
65
|
const table = carriedTable(member);
|
|
66
|
-
if (table !== null &&
|
|
66
|
+
if (table !== null && tableMemberValueType(table, source.field) === "image_list") return { type: "image" };
|
|
67
67
|
}
|
|
68
68
|
throw new Error(`list: "${label}" declares no \`item\`, and its source does not say what its elements are — declare \`item\`: a plain slot (\`item: image()\`), or a function of the element (\`item: (el) => object({ … })\`).`);
|
|
69
69
|
}
|
|
70
|
-
function memberValueTypeOf(table, field) {
|
|
71
|
-
if (table.reading === "legacy") {
|
|
72
|
-
const row = FACT_GRAPH[table.table].row;
|
|
73
|
-
return Object.hasOwn(row, field) ? row[field].value_type : void 0;
|
|
74
|
-
}
|
|
75
|
-
const declaration = fieldOf(linkedTableFields(table.table), field);
|
|
76
|
-
return declaration === void 0 ? void 0 : memberValueType(declaration) ?? void 0;
|
|
77
|
-
}
|
|
78
70
|
function writtenItemRefusal(label, what) {
|
|
79
71
|
return `list: "${label}" is written by a \`fill.write\` and ${what} — the item is the kind every written element is: a value slot (\`item: text.short({ cap: 80 })\`), an object exactly one field of which holds the element (\`question: text.medium({ label: "Question", cap: 48, source: el })\`), or an object declared plainly whose members the write answers (\`item: object({ label: text.short({ label: "Unit" }), fields: { … } })\`).`;
|
|
80
72
|
}
|
|
@@ -129,7 +121,7 @@ function heldElement(slot) {
|
|
|
129
121
|
function pickedTable(item, key) {
|
|
130
122
|
if (key === void 0) return null;
|
|
131
123
|
const def = rowDefinition(key === null ? item : (declaredFields(item) ?? item.fields)[key]);
|
|
132
|
-
return def.type === "row" ?
|
|
124
|
+
return def.type === "row" ? tableOf(def.from) : null;
|
|
133
125
|
}
|
|
134
126
|
function heldPickElement(item, key) {
|
|
135
127
|
if (key === null) return heldElement(item);
|
|
@@ -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) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tableOf } from "./registry-shape.js";
|
|
2
2
|
|
|
3
3
|
//#region ../../internal/template-contracts/dist/mirror-kind.js
|
|
4
4
|
const STRING_KINDS = /* @__PURE__ */ new Set([
|
|
@@ -11,7 +11,7 @@ const STRING_KINDS = /* @__PURE__ */ new Set([
|
|
|
11
11
|
]);
|
|
12
12
|
function rowOf(from) {
|
|
13
13
|
if (typeof from !== "string") return void 0;
|
|
14
|
-
return
|
|
14
|
+
return tableOf(from) ?? from;
|
|
15
15
|
}
|
|
16
16
|
function holderOf(item) {
|
|
17
17
|
if (item.type !== "object") {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { OBJECT_BINDING_OWN_KEYS
|
|
1
|
+
import { OBJECT_BINDING_OWN_KEYS } from "./slot-catalog.js";
|
|
2
2
|
import { isFactRef, isSiblingSlot, isSiblingSource, isSlotRef } from "./slot-ref.js";
|
|
3
3
|
import { isComputeBinding } from "./compute.js";
|
|
4
4
|
import { isFillBinding, isFillSource } from "./fill-builders.js";
|
|
5
5
|
import { getFills } from "./fill-declaration.js";
|
|
6
|
+
import { tableOf } from "./registry-shape.js";
|
|
6
7
|
import { mapSlotRefs, memberResolver, ownKeyRead, ownKeyRefusal, plainSlot, rowScope } from "./resolve-scope.js";
|
|
7
8
|
import { text } from "./slot-builders.js";
|
|
8
9
|
|
|
@@ -82,7 +83,7 @@ function nestedFieldRefusal(field, siblings) {
|
|
|
82
83
|
if (source === void 0) return void 0;
|
|
83
84
|
if (isComputeBinding(source)) return `a \`compute()\` — an item of a list inside an object reads its element, or a row \`from\` its member; ${NESTED_HOME}`;
|
|
84
85
|
const { kind, slot } = source;
|
|
85
|
-
if (kind === "element" && field.type === "row" &&
|
|
86
|
+
if (kind === "element" && field.type === "row" && tableOf(field.from) !== null) return "a table's row holding the element — the element of a list inside an object is a member's item: hold it in a row `from` that member (`row({ label, from: unit.floor_plans, source: entry })`)";
|
|
86
87
|
if (kind === "element") return void 0;
|
|
87
88
|
if (field.type !== "row" && kind === "row" && typeof slot === "string" && siblings[slot]?.type === "row") return void 0;
|
|
88
89
|
return "bound to something outside its item — an item of a list inside an object reads its element, a row `from` its member, or a row beside it";
|
|
@@ -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.
|
|
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()
|
|
@@ -63,9 +63,9 @@ declare function cutout<const O extends CutoutInput>(options?: O & NoOtherKeys<O
|
|
|
63
63
|
*/
|
|
64
64
|
declare function autocrop<const O extends AutocropInput>(options: O & NoOtherKeys<O, AutocropInput>): AutocropProcess;
|
|
65
65
|
/**
|
|
66
|
-
* The processes a media declaration lists in `process`, each run on every
|
|
66
|
+
* The processes a media declaration lists in `process`, each run on every media value that
|
|
67
67
|
* becomes its value: `process.cutout()` removes the background, `process.autocrop({ brief })`
|
|
68
|
-
* crops to the subject. Declare one where
|
|
68
|
+
* crops to the subject. Declare one where a file first lands; a declaration picking
|
|
69
69
|
* from a list that declares it reads the result and declares nothing. Order among them
|
|
70
70
|
* means nothing — a crop runs before every rendition.
|
|
71
71
|
*/
|