@vectoriox/iox-ui 5.97.0 → 5.99.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/fesm2022/vectoriox-iox-ui-generation-core.mjs +1114 -223
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +115 -42
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-identity-core.mjs +535 -0
- package/fesm2022/vectoriox-iox-ui-identity-core.mjs.map +1 -0
- package/generation-core/index.d.ts +515 -17
- package/harness-core/index.d.ts +66 -6
- package/identity-core/index.d.ts +364 -0
- package/identity-core/package.json +3 -0
- package/package.json +5 -1
- package/src/generation-core/audit-site.ts +8 -0
- package/src/generation-core/compose-site.ts +130 -4
- package/src/generation-core/nav-shape.ts +4 -2
- package/src/generation-core/patterns.ts +25 -1
- package/src/generation-core/pictures.ts +1 -1
- package/src/generation-core/plan-derived.ts +10 -5
- package/src/generation-core/plan-edits.ts +8 -7
- package/src/generation-core/plan-wire.ts +59 -10
- package/src/generation-core/plan-words.ts +18 -1
- package/src/generation-core/public-api.ts +1 -0
- package/src/generation-core/shop-plan.ts +165 -0
- package/src/generation-core/showcase.ts +29 -4
- package/src/generation-core/site-build-run.ts +25 -0
- package/src/generation-core/site-plan.model.ts +49 -1
- package/src/generation-core/site-spec.generated.ts +330 -2
- package/src/generation-core/stock-photos.ts +19 -2
- package/src/generation-core/validate-site-plan.ts +146 -8
- package/src/harness-core/business-types.ts +13 -0
- package/src/harness-core/harness-spec.generated.ts +69 -39
- package/src/harness-core/needs.ts +30 -1
- package/src/harness-core/site-reading.ts +8 -2
- package/src/identity-core/guards.ts +87 -0
- package/src/identity-core/public-api.ts +13 -0
- package/src/identity-core/sign-in.ts +223 -0
- package/src/identity-core/site-auth.ts +172 -0
- package/src/identity-core/words.ts +194 -0
|
@@ -2,7 +2,8 @@ import { NEW_NODE_STYLE_DEFAULTS, defaultElementStyleFor, elementStyleById, owne
|
|
|
2
2
|
import { formPresetById, FormPresetId, FormAfterSend, FORM_AFTER_SEND_TRAIT, FORM_ACTIONS_ROLE, channelOpensNewTab, FORM_CHANNEL_ROLE, planFormPresetIds, ControlType, FORM_NODE_TYPE, collectFormSpec, FIELD_NODE_TYPE, isChannelFilled } from '@vectoriox/iox-ui/forms-core';
|
|
3
3
|
import { normalizeFrameSequence, filmScreensFor, FILM_PREPARED_PICTURES, FrameExtension } from '@vectoriox/iox-ui/media-core';
|
|
4
4
|
import { SEO_DESCRIPTION_MAX, SEO_TITLE_MAX } from '@vectoriox/iox-ui/seo-core';
|
|
5
|
-
import {
|
|
5
|
+
import { VARIANT_NAME_SEPARATOR } from '@vectoriox/iox-ui/commerce-core';
|
|
6
|
+
import { pickTabsAutoBinds, pickAccordionAutoBinds, ShopRole, NO_ELEMENT_STYLE, SLIDER_PLACEMENT_TRAIT, SliderPlacement, syncSliderParts, SliderRole, buildMarqueeRecipe, SceneRole, segmentedOptions, ITEM_OPEN_STATE, CardPart, CardRole, CardLayout, CARD_LAYOUTS, CARD_PARTS, BADGE_TONES, buildCardRecipe, findByRole, buildSegmentedRecipe, AccordionRole, buildAccordionRecipe, ACCORDION_WORDS, accordionItems, accordionQuestionOf, accordionAnswerOf, ACCORDION_BIND_PROP, ACCORDION_CONTENT_LIMIT, buildTabsRecipe, TABS_WORDS, tabsTriggers, tabLabelNodeOf, TABS_LABEL_BIND_PROP, tabsPanels, tabPanelTextOf, TABS_TEXT_BIND_PROP, tabPanelImageOf, tabsListOf, tabsPanelsOf, TABS_CONTENT_LIMIT, TABS_IMAGE_BIND_PROP, ShopRecipe, ShopBindTarget, SHOP_RECIPES, bindShopPart, buildCarouselRecipe, SLIDE_TYPE, buildLightboxRecipe, LIGHTBOX_LABEL, SLIDE_TO_ROW, setHeaderBehaviour } from '@vectoriox/iox-ui/composite-core';
|
|
6
7
|
import { ParallaxDepth, parallaxShift, rangeDistance, ScrollRange, normalizeParallaxPhone, parallaxRest, rangeProgress, parallaxOffset } from '@vectoriox/iox-ui/scene-core';
|
|
7
8
|
import { ELEMENT_ACTION_DESCRIPTORS, resolveActionAvailability } from '@vectoriox/iox-ui/actions-core';
|
|
8
9
|
|
|
@@ -18,7 +19,8 @@ const SPEC_SITE_PLAN_SHAPE = {
|
|
|
18
19
|
"locale?": "'en' | 'he' — the site's language (site.locales): every page's locale; 'he' reads right to left (absent = en)",
|
|
19
20
|
"design": "design",
|
|
20
21
|
"contentTypes": "contentType[]",
|
|
21
|
-
"dataSources": "(cmsDataSource | relativeDataSource)[] — merged by alias into the org library",
|
|
22
|
+
"dataSources": "(cmsDataSource | relativeDataSource | shopDataSource)[] — merged by alias into the org library",
|
|
23
|
+
"shop?": "shop — what the business sells (commerce C-D21): its products are the studio's SHOP, never a content type; a plan with a shop is a whole store (product pages, the cart button and the cart drawer, the fixed checkout)",
|
|
22
24
|
"pages": "page[]",
|
|
23
25
|
"globals": "globals",
|
|
24
26
|
"film?": "film — the owner's film as pictures (SC6b), set by the build and placed by placeFilm; never a model's",
|
|
@@ -113,6 +115,28 @@ const SPEC_SITE_PLAN_SHAPE = {
|
|
|
113
115
|
"limit?": "integer ≥ 1",
|
|
114
116
|
"filterByRouteParam?": "{ field, routeParam } — single only: the route param that picks the item"
|
|
115
117
|
},
|
|
118
|
+
"shopDataSource": {
|
|
119
|
+
"alias": "string — unique",
|
|
120
|
+
"type": "'shop'",
|
|
121
|
+
"mode": "'query' | 'single'",
|
|
122
|
+
"resource": "'products' | 'categories' — the shop's own list (generation-core ShopResource)",
|
|
123
|
+
"limit?": "integer ≥ 1",
|
|
124
|
+
"filterByRouteParam?": "{ field, routeParam } — single only: the field ('slug' or '_id') the route param matches"
|
|
125
|
+
},
|
|
126
|
+
"shop": {
|
|
127
|
+
"categories": "string[] — the categories, in order (each product's category; written by the plan, never invented beyond them)",
|
|
128
|
+
"products": "shopProduct[] — at most 6 sample products, by name: what the business sells. Never a price, stock, a fee or a claim — the owner sets those in the product editor"
|
|
129
|
+
},
|
|
130
|
+
"shopProduct": {
|
|
131
|
+
"name": "string — the product as the business would name it",
|
|
132
|
+
"category": "string — one of shop.categories",
|
|
133
|
+
"description": "string — one line about it, in the owner's voice; never a price, a size chart or a claim",
|
|
134
|
+
"options": "shopOption[] — how it varies (size, colour…); [] = one kind only"
|
|
135
|
+
},
|
|
136
|
+
"shopOption": {
|
|
137
|
+
"name": "string — the option's name (Size, Colour)",
|
|
138
|
+
"values": "string[] — its values, in order (S, M, L)"
|
|
139
|
+
},
|
|
116
140
|
"relativeDataSource": {
|
|
117
141
|
"alias": "string — unique",
|
|
118
142
|
"type": "'relative'",
|
|
@@ -167,7 +191,9 @@ const SPEC_SITE_ROLES = {
|
|
|
167
191
|
"image": "its picture — the card picture, the item page's hero",
|
|
168
192
|
"meta": "a short line beside its name — a place, a price, a duration",
|
|
169
193
|
"date": "when — a year or a date",
|
|
170
|
-
"gallery": "its pictures (a list) — the item page's gallery"
|
|
194
|
+
"gallery": "its pictures (a list) — the item page's gallery",
|
|
195
|
+
"price": "its price — the shop's own field, shown through the money pipe in the studio currency",
|
|
196
|
+
"compareAt": "its earlier price, struck through beside the price (the shop's own field)"
|
|
171
197
|
};
|
|
172
198
|
const SPEC_SITE_REQUIRED_ROLES = [
|
|
173
199
|
"title"
|
|
@@ -194,6 +220,7 @@ const SPEC_SITE_DENSITY_COPY = {
|
|
|
194
220
|
};
|
|
195
221
|
const SPEC_SITE_NEED_IDS = [
|
|
196
222
|
"collection",
|
|
223
|
+
"products",
|
|
197
224
|
"detail",
|
|
198
225
|
"services",
|
|
199
226
|
"prices",
|
|
@@ -2163,6 +2190,293 @@ const SPEC_SITE_PATTERNS = {
|
|
|
2163
2190
|
]
|
|
2164
2191
|
}
|
|
2165
2192
|
},
|
|
2193
|
+
"commerce.product-grid": {
|
|
2194
|
+
"family": "collection",
|
|
2195
|
+
"shop": true,
|
|
2196
|
+
"label": "Products, three across",
|
|
2197
|
+
"intent": "The products the shop sells as cards — picture, name and price — each linking to its own page.",
|
|
2198
|
+
"node": {
|
|
2199
|
+
"t": "Section",
|
|
2200
|
+
"es": "section",
|
|
2201
|
+
"c": [
|
|
2202
|
+
{
|
|
2203
|
+
"t": "Container",
|
|
2204
|
+
"es": "box",
|
|
2205
|
+
"optional": "header",
|
|
2206
|
+
"lay": {
|
|
2207
|
+
"display": "flex",
|
|
2208
|
+
"justifyContent": "space-between",
|
|
2209
|
+
"alignItems": "baseline",
|
|
2210
|
+
"gap": "16px",
|
|
2211
|
+
"flexWrap": "wrap"
|
|
2212
|
+
},
|
|
2213
|
+
"c": [
|
|
2214
|
+
{
|
|
2215
|
+
"t": "Heading",
|
|
2216
|
+
"es": "h2",
|
|
2217
|
+
"level": "h2",
|
|
2218
|
+
"slot": "title",
|
|
2219
|
+
"max": 52,
|
|
2220
|
+
"text": "New in",
|
|
2221
|
+
"enter": "heading"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
"t": "Link",
|
|
2225
|
+
"es": "link",
|
|
2226
|
+
"href": "/shop",
|
|
2227
|
+
"slot": "more",
|
|
2228
|
+
"max": 28,
|
|
2229
|
+
"text": "Shop all"
|
|
2230
|
+
}
|
|
2231
|
+
]
|
|
2232
|
+
},
|
|
2233
|
+
{
|
|
2234
|
+
"t": "Repeater",
|
|
2235
|
+
"src": "$binding",
|
|
2236
|
+
"lay": {
|
|
2237
|
+
"display": "grid",
|
|
2238
|
+
"gridTemplateColumns": "repeat(3, minmax(0, 1fr))",
|
|
2239
|
+
"gap": "var(--iox-space-gap)"
|
|
2240
|
+
},
|
|
2241
|
+
"resp": {
|
|
2242
|
+
"mobile": {
|
|
2243
|
+
"gridTemplateColumns": "minmax(0, 1fr)"
|
|
2244
|
+
}
|
|
2245
|
+
},
|
|
2246
|
+
"c": [
|
|
2247
|
+
{
|
|
2248
|
+
"t": "Container",
|
|
2249
|
+
"recipe": "card",
|
|
2250
|
+
"layout": "top",
|
|
2251
|
+
"parts": {
|
|
2252
|
+
"badge": false,
|
|
2253
|
+
"eyebrow": false,
|
|
2254
|
+
"text": false,
|
|
2255
|
+
"actions": false
|
|
2256
|
+
},
|
|
2257
|
+
"detail": "item",
|
|
2258
|
+
"enter": "items",
|
|
2259
|
+
"binds": {
|
|
2260
|
+
"image": "item.@image?",
|
|
2261
|
+
"title": "item.@title"
|
|
2262
|
+
},
|
|
2263
|
+
"c": [
|
|
2264
|
+
{
|
|
2265
|
+
"t": "Container",
|
|
2266
|
+
"recipe": "price",
|
|
2267
|
+
"binds": {
|
|
2268
|
+
"price": "item.@price",
|
|
2269
|
+
"compareAt": "item.@compareAt?"
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
]
|
|
2273
|
+
}
|
|
2274
|
+
]
|
|
2275
|
+
}
|
|
2276
|
+
],
|
|
2277
|
+
"lay": {
|
|
2278
|
+
"display": "flex",
|
|
2279
|
+
"flexDirection": "column",
|
|
2280
|
+
"gap": "32px"
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
},
|
|
2284
|
+
"commerce.featured": {
|
|
2285
|
+
"family": "collection",
|
|
2286
|
+
"shop": true,
|
|
2287
|
+
"label": "One product, its picture beside its words",
|
|
2288
|
+
"intent": "One product brought forward — its picture beside its name, price and a line — linking to its own page.",
|
|
2289
|
+
"node": {
|
|
2290
|
+
"t": "Section",
|
|
2291
|
+
"es": "section",
|
|
2292
|
+
"c": [
|
|
2293
|
+
{
|
|
2294
|
+
"t": "Repeater",
|
|
2295
|
+
"src": "$binding",
|
|
2296
|
+
"limit": 1,
|
|
2297
|
+
"lay": {
|
|
2298
|
+
"display": "flex",
|
|
2299
|
+
"flexDirection": "column",
|
|
2300
|
+
"gap": "0px"
|
|
2301
|
+
},
|
|
2302
|
+
"c": [
|
|
2303
|
+
{
|
|
2304
|
+
"t": "Container",
|
|
2305
|
+
"es": "box",
|
|
2306
|
+
"lay": {
|
|
2307
|
+
"display": "grid",
|
|
2308
|
+
"gridTemplateColumns": "1fr 1fr",
|
|
2309
|
+
"gap": "48px",
|
|
2310
|
+
"alignItems": "center"
|
|
2311
|
+
},
|
|
2312
|
+
"resp": {
|
|
2313
|
+
"mobile": {
|
|
2314
|
+
"gridTemplateColumns": "minmax(0, 1fr)"
|
|
2315
|
+
}
|
|
2316
|
+
},
|
|
2317
|
+
"c": [
|
|
2318
|
+
{
|
|
2319
|
+
"t": "Image",
|
|
2320
|
+
"es": "media",
|
|
2321
|
+
"bind": "item.@image?",
|
|
2322
|
+
"aspect": "4 / 5"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
"t": "Container",
|
|
2326
|
+
"es": "box",
|
|
2327
|
+
"lay": {
|
|
2328
|
+
"display": "flex",
|
|
2329
|
+
"flexDirection": "column",
|
|
2330
|
+
"gap": "16px"
|
|
2331
|
+
},
|
|
2332
|
+
"c": [
|
|
2333
|
+
{
|
|
2334
|
+
"t": "Text",
|
|
2335
|
+
"es": "eyebrow",
|
|
2336
|
+
"slot": "eyebrow",
|
|
2337
|
+
"max": 32,
|
|
2338
|
+
"text": "Featured"
|
|
2339
|
+
},
|
|
2340
|
+
{
|
|
2341
|
+
"t": "Heading",
|
|
2342
|
+
"es": "h2",
|
|
2343
|
+
"level": "h2",
|
|
2344
|
+
"bind": "item.@title",
|
|
2345
|
+
"enter": "heading"
|
|
2346
|
+
},
|
|
2347
|
+
{
|
|
2348
|
+
"t": "Container",
|
|
2349
|
+
"recipe": "price",
|
|
2350
|
+
"binds": {
|
|
2351
|
+
"price": "item.@price",
|
|
2352
|
+
"compareAt": "item.@compareAt?"
|
|
2353
|
+
}
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
"t": "Text",
|
|
2357
|
+
"es": "body",
|
|
2358
|
+
"bind": "item.@summary?"
|
|
2359
|
+
},
|
|
2360
|
+
{
|
|
2361
|
+
"t": "Container",
|
|
2362
|
+
"es": "box",
|
|
2363
|
+
"lay": {
|
|
2364
|
+
"display": "flex",
|
|
2365
|
+
"flexWrap": "wrap",
|
|
2366
|
+
"gap": "12px",
|
|
2367
|
+
"alignItems": "center"
|
|
2368
|
+
},
|
|
2369
|
+
"c": [
|
|
2370
|
+
{
|
|
2371
|
+
"t": "ButtonBlock",
|
|
2372
|
+
"es": "button-primary",
|
|
2373
|
+
"detail": "item",
|
|
2374
|
+
"slot": "action",
|
|
2375
|
+
"max": 24,
|
|
2376
|
+
"text": "See it"
|
|
2377
|
+
}
|
|
2378
|
+
]
|
|
2379
|
+
}
|
|
2380
|
+
]
|
|
2381
|
+
}
|
|
2382
|
+
]
|
|
2383
|
+
}
|
|
2384
|
+
]
|
|
2385
|
+
}
|
|
2386
|
+
]
|
|
2387
|
+
}
|
|
2388
|
+
},
|
|
2389
|
+
"commerce.product-detail": {
|
|
2390
|
+
"family": "detail",
|
|
2391
|
+
"shop": true,
|
|
2392
|
+
"label": "A product — its picture, price, options and Add to cart",
|
|
2393
|
+
"intent": "One product on its own page: picture, name, price, its line, its options, quantity, Add to cart and Buy now.",
|
|
2394
|
+
"node": {
|
|
2395
|
+
"t": "Section",
|
|
2396
|
+
"es": "section",
|
|
2397
|
+
"c": [
|
|
2398
|
+
{
|
|
2399
|
+
"t": "Container",
|
|
2400
|
+
"es": "box",
|
|
2401
|
+
"lay": {
|
|
2402
|
+
"display": "grid",
|
|
2403
|
+
"gridTemplateColumns": "1.1fr 0.9fr",
|
|
2404
|
+
"gap": "48px",
|
|
2405
|
+
"alignItems": "start"
|
|
2406
|
+
},
|
|
2407
|
+
"resp": {
|
|
2408
|
+
"mobile": {
|
|
2409
|
+
"gridTemplateColumns": "minmax(0, 1fr)"
|
|
2410
|
+
}
|
|
2411
|
+
},
|
|
2412
|
+
"c": [
|
|
2413
|
+
{
|
|
2414
|
+
"t": "Image",
|
|
2415
|
+
"es": "media",
|
|
2416
|
+
"bind": "route.@image?",
|
|
2417
|
+
"aspect": "4 / 5",
|
|
2418
|
+
"enter": "media"
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
"t": "Container",
|
|
2422
|
+
"es": "box",
|
|
2423
|
+
"lay": {
|
|
2424
|
+
"display": "flex",
|
|
2425
|
+
"flexDirection": "column",
|
|
2426
|
+
"gap": "20px"
|
|
2427
|
+
},
|
|
2428
|
+
"c": [
|
|
2429
|
+
{
|
|
2430
|
+
"t": "Heading",
|
|
2431
|
+
"es": "h1",
|
|
2432
|
+
"level": "h1",
|
|
2433
|
+
"bind": "route.@title",
|
|
2434
|
+
"enter": "heading"
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
"t": "Container",
|
|
2438
|
+
"recipe": "price"
|
|
2439
|
+
},
|
|
2440
|
+
{
|
|
2441
|
+
"t": "Text",
|
|
2442
|
+
"es": "body",
|
|
2443
|
+
"bind": "route.@summary?"
|
|
2444
|
+
},
|
|
2445
|
+
{
|
|
2446
|
+
"t": "Container",
|
|
2447
|
+
"recipe": "variants"
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
"t": "Container",
|
|
2451
|
+
"es": "box",
|
|
2452
|
+
"lay": {
|
|
2453
|
+
"display": "flex",
|
|
2454
|
+
"flexWrap": "nowrap",
|
|
2455
|
+
"gap": "12px",
|
|
2456
|
+
"alignItems": "stretch"
|
|
2457
|
+
},
|
|
2458
|
+
"c": [
|
|
2459
|
+
{
|
|
2460
|
+
"t": "Container",
|
|
2461
|
+
"recipe": "quantity"
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
"t": "ButtonBlock",
|
|
2465
|
+
"recipe": "add"
|
|
2466
|
+
}
|
|
2467
|
+
]
|
|
2468
|
+
},
|
|
2469
|
+
{
|
|
2470
|
+
"t": "ButtonBlock",
|
|
2471
|
+
"recipe": "buyNow"
|
|
2472
|
+
}
|
|
2473
|
+
]
|
|
2474
|
+
}
|
|
2475
|
+
]
|
|
2476
|
+
}
|
|
2477
|
+
]
|
|
2478
|
+
}
|
|
2479
|
+
},
|
|
2166
2480
|
"feature.triad": {
|
|
2167
2481
|
"family": "feature",
|
|
2168
2482
|
"label": "Three services",
|
|
@@ -5758,6 +6072,21 @@ const SPEC_SITE_LIBRARY = [
|
|
|
5758
6072
|
"family": "collection",
|
|
5759
6073
|
"composed": true
|
|
5760
6074
|
},
|
|
6075
|
+
{
|
|
6076
|
+
"id": "commerce.product-grid",
|
|
6077
|
+
"family": "collection",
|
|
6078
|
+
"composed": true
|
|
6079
|
+
},
|
|
6080
|
+
{
|
|
6081
|
+
"id": "commerce.featured",
|
|
6082
|
+
"family": "collection",
|
|
6083
|
+
"composed": true
|
|
6084
|
+
},
|
|
6085
|
+
{
|
|
6086
|
+
"id": "commerce.product-detail",
|
|
6087
|
+
"family": "detail",
|
|
6088
|
+
"composed": true
|
|
6089
|
+
},
|
|
5761
6090
|
{
|
|
5762
6091
|
"id": "story.long-form",
|
|
5763
6092
|
"family": "story",
|
|
@@ -12284,7 +12613,13 @@ var ContentRole;
|
|
|
12284
12613
|
ContentRole["Meta"] = "meta";
|
|
12285
12614
|
ContentRole["Date"] = "date";
|
|
12286
12615
|
ContentRole["Gallery"] = "gallery";
|
|
12616
|
+
/** Commerce C-D21: the shop's own price — played only by the shop's fields (`SHOP_ROLES`), never a content type's. */
|
|
12617
|
+
ContentRole["Price"] = "price";
|
|
12618
|
+
/** Commerce C-D21: the shop's earlier price, struck through. */
|
|
12619
|
+
ContentRole["CompareAt"] = "compareAt";
|
|
12287
12620
|
})(ContentRole || (ContentRole = {}));
|
|
12621
|
+
/** The roles only the shop plays (contract `site.roles` less `planShape.roles`): a content type never names them. */
|
|
12622
|
+
const SHOP_ONLY_CONTENT_ROLES = [ContentRole.Price, ContentRole.CompareAt];
|
|
12288
12623
|
/** What each role means, verbatim from the contract — what the model reads. */
|
|
12289
12624
|
const CONTENT_ROLE_MEANINGS = SPEC_SITE_ROLES;
|
|
12290
12625
|
const REQUIRED_CONTENT_ROLES = SPEC_SITE_REQUIRED_ROLES;
|
|
@@ -12300,7 +12635,15 @@ var PlanDataSourceType;
|
|
|
12300
12635
|
(function (PlanDataSourceType) {
|
|
12301
12636
|
PlanDataSourceType["Cms"] = "cms";
|
|
12302
12637
|
PlanDataSourceType["Relative"] = "relative";
|
|
12638
|
+
/** Commerce C-D21 (shop-aware A-D1): the studio's SHOP — products a visitor buys are never a content type. */
|
|
12639
|
+
PlanDataSourceType["Shop"] = "shop";
|
|
12303
12640
|
})(PlanDataSourceType || (PlanDataSourceType = {}));
|
|
12641
|
+
/** The shop lists a plan's shop source may read (closed, so a plan can never name `orders`). */
|
|
12642
|
+
var ShopResource;
|
|
12643
|
+
(function (ShopResource) {
|
|
12644
|
+
ShopResource["Products"] = "products";
|
|
12645
|
+
ShopResource["Categories"] = "categories";
|
|
12646
|
+
})(ShopResource || (ShopResource = {}));
|
|
12304
12647
|
var PlanDataSourceMode;
|
|
12305
12648
|
(function (PlanDataSourceMode) {
|
|
12306
12649
|
PlanDataSourceMode["Query"] = "query";
|
|
@@ -12348,7 +12691,20 @@ var PatternRecipe;
|
|
|
12348
12691
|
PatternRecipe["Carousel"] = "carousel";
|
|
12349
12692
|
/** CC3: the Lightbox — a Dialog holding a Slider over the node's `src` (the gallery's own source). */
|
|
12350
12693
|
PatternRecipe["Lightbox"] = "lightbox";
|
|
12694
|
+
/** Commerce G1 (E1c `SHOP_RECIPES`): the product's price — its own on a product page (`$variant`), the row's in a
|
|
12695
|
+
* list (`binds`: `price`, `compareAt`). */
|
|
12696
|
+
PatternRecipe["Price"] = "price";
|
|
12697
|
+
PatternRecipe["Variants"] = "variants";
|
|
12698
|
+
PatternRecipe["Quantity"] = "quantity";
|
|
12699
|
+
PatternRecipe["Add"] = "add";
|
|
12700
|
+
PatternRecipe["BuyNow"] = "buyNow";
|
|
12351
12701
|
})(PatternRecipe || (PatternRecipe = {}));
|
|
12702
|
+
/** A price recipe's `binds` keys → the part each binds (E1c `ShopBindTarget`). */
|
|
12703
|
+
var PriceBindTarget;
|
|
12704
|
+
(function (PriceBindTarget) {
|
|
12705
|
+
PriceBindTarget["Price"] = "price";
|
|
12706
|
+
PriceBindTarget["CompareAt"] = "compareAt";
|
|
12707
|
+
})(PriceBindTarget || (PriceBindTarget = {}));
|
|
12352
12708
|
/** A recipe node's `binds` keys → the part each binds (Card v2). */
|
|
12353
12709
|
var CardBindTarget;
|
|
12354
12710
|
(function (CardBindTarget) {
|
|
@@ -12506,7 +12862,8 @@ const SITE_LIBRARY = SPEC_SITE_LIBRARY;
|
|
|
12506
12862
|
*/
|
|
12507
12863
|
function patternManifest(density, options = {}) {
|
|
12508
12864
|
const scenes = !('animate' in options) || options.animate === SCENE_LEVEL;
|
|
12509
|
-
|
|
12865
|
+
const store = options.sells !== false;
|
|
12866
|
+
return Object.entries(SITE_PATTERNS).filter(([, p]) => !p.film && (scenes || !p.scene) && (store || !p.shop)).map(([id, p]) => ({
|
|
12510
12867
|
id, family: p.family, label: p.label, intent: p.intent, ...(p.global ? { global: p.global } : {}),
|
|
12511
12868
|
slots: Object.fromEntries(Object.keys(patternSlotBudgets(p)).map(slot => [slot, slotBudget(p, slot, density)])),
|
|
12512
12869
|
links: patternLinkSlots(p),
|
|
@@ -12515,6 +12872,7 @@ function patternManifest(density, options = {}) {
|
|
|
12515
12872
|
optionalParts: patternOptionalParts(p),
|
|
12516
12873
|
form: patternHasForm(p),
|
|
12517
12874
|
...(p.scene ? { scene: true } : {}),
|
|
12875
|
+
...(p.shop ? { shop: true } : {}),
|
|
12518
12876
|
}));
|
|
12519
12877
|
}
|
|
12520
12878
|
/** The bind scopes a pattern reads (`route`, `next`, …) — what its page must provide. */
|
|
@@ -12777,11 +13135,270 @@ function jsonSchemaObjects(node, out = []) {
|
|
|
12777
13135
|
}
|
|
12778
13136
|
|
|
12779
13137
|
/**
|
|
12780
|
-
*
|
|
12781
|
-
*
|
|
12782
|
-
*
|
|
12783
|
-
*
|
|
12784
|
-
*
|
|
13138
|
+
* The plan stage's word checks (AI plan §3d / §3h, M1-3): every text a model WROTE into a plan — the tagline, page
|
|
13139
|
+
* names, section slots, content-type labels, sample values — scanned for the words the owner and their kind of
|
|
13140
|
+
* business must not use (`avoidWords`, the analysis's + the type's `words`), and for a fact the owner never gave
|
|
13141
|
+
* (an email, phone number, price or opening time that is not one of the owner's own facts). A finding is a refusal
|
|
13142
|
+
* with a path — the model rewrites; nothing here repairs a word. Pure.
|
|
13143
|
+
*/
|
|
13144
|
+
var PlanWordIssueCode;
|
|
13145
|
+
(function (PlanWordIssueCode) {
|
|
13146
|
+
/** A word the owner (or their kind of business) must not use. */
|
|
13147
|
+
PlanWordIssueCode["AvoidWord"] = "avoid-word";
|
|
13148
|
+
/** Something that looks like a fact — an email, phone, price or time — that is not one of the owner's facts. */
|
|
13149
|
+
PlanWordIssueCode["InventedFact"] = "invented-fact";
|
|
13150
|
+
/** `business.facts` holds a fact the owner did not give, or not in the owner's words. */
|
|
13151
|
+
PlanWordIssueCode["FactNotTheOwners"] = "fact-not-the-owners";
|
|
13152
|
+
})(PlanWordIssueCode || (PlanWordIssueCode = {}));
|
|
13153
|
+
/** Every text in a plan a model writes (never ids, routes, field names or pattern ids). */
|
|
13154
|
+
function writtenTexts(plan) {
|
|
13155
|
+
const out = [];
|
|
13156
|
+
const add = (path, text) => { if (typeof text === 'string' && text.trim())
|
|
13157
|
+
out.push({ path, text }); };
|
|
13158
|
+
add('business.tagline', plan.business?.tagline);
|
|
13159
|
+
plan.pages?.forEach((page, p) => {
|
|
13160
|
+
add(`pages[${p}].name`, page.name);
|
|
13161
|
+
page.sections?.forEach((section, s) => {
|
|
13162
|
+
for (const [slot, text] of Object.entries(section.slots ?? {}))
|
|
13163
|
+
add(`pages[${p}].sections[${s}].slots.${slot}`, text);
|
|
13164
|
+
});
|
|
13165
|
+
});
|
|
13166
|
+
plan.contentTypes?.forEach((type, t) => {
|
|
13167
|
+
add(`contentTypes[${t}].label`, type.label);
|
|
13168
|
+
const { perItem, ...seed } = type.seed ?? {};
|
|
13169
|
+
for (const [field, list] of Object.entries(perItem ?? {}))
|
|
13170
|
+
list.forEach((v, k) => add(`contentTypes[${t}].seed.perItem.${field}[${k}]`, v));
|
|
13171
|
+
for (const [field, value] of Object.entries(seed)) {
|
|
13172
|
+
const values = Array.isArray(value) ? value : [value];
|
|
13173
|
+
values.forEach((v, k) => add(`contentTypes[${t}].seed.${field}${Array.isArray(value) ? `[${k}]` : ''}`, v));
|
|
13174
|
+
}
|
|
13175
|
+
});
|
|
13176
|
+
plan.shop?.products?.forEach((product, i) => {
|
|
13177
|
+
const at = `shop.products[${i}]`;
|
|
13178
|
+
add(`${at}.name`, product.name);
|
|
13179
|
+
add(`${at}.category`, product.category);
|
|
13180
|
+
add(`${at}.description`, product.description);
|
|
13181
|
+
product.options?.forEach((option, j) => {
|
|
13182
|
+
add(`${at}.options[${j}].name`, option.name);
|
|
13183
|
+
option.values?.forEach((v, k) => add(`${at}.options[${j}].values[${k}]`, v));
|
|
13184
|
+
});
|
|
13185
|
+
});
|
|
13186
|
+
return out;
|
|
13187
|
+
}
|
|
13188
|
+
const HEBREW$1 = /[-]/;
|
|
13189
|
+
/** Hebrew joins up to two one-letter words (and, the, in, to, from, that, as) to the next: "והטוב" holds "טוב". The
|
|
13190
|
+
* ONE rule — the intake's keyword match (harness-core) uses it too. */
|
|
13191
|
+
const HEBREW_PREFIXES = '[והבלמשכ]{0,2}';
|
|
13192
|
+
const escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
13193
|
+
const normalise = (s) => s.normalize('NFKC').toLowerCase();
|
|
13194
|
+
/** A word (or phrase) as a whole-word pattern; Hebrew allows its one-letter prefixes. */
|
|
13195
|
+
function wordPattern(word) {
|
|
13196
|
+
const w = escape(normalise(word.trim())).replace(/\s+/g, '\\s+');
|
|
13197
|
+
const prefix = HEBREW$1.test(word) ? HEBREW_PREFIXES : '';
|
|
13198
|
+
return new RegExp(`(?<![\\p{L}\\p{N}])${prefix}${w}(?![\\p{L}\\p{N}])`, 'u');
|
|
13199
|
+
}
|
|
13200
|
+
const PRICE_SHAPE = { kind: 'price', pattern: /(?:[$€£₪]\s?\d[\d,.]*|\d[\d,.]*\s?(?:[$€£₪]|ש"ח|NIS|USD|EUR|GBP))/gu, key: (m) => m.replace(/[^\d]/g, '') };
|
|
13201
|
+
/** What a fact looks like when a model writes one — each judged against the owner's facts. */
|
|
13202
|
+
const FACT_SHAPES = [
|
|
13203
|
+
{ kind: 'email', pattern: /[\p{L}\p{N}._%+-]+@[\p{L}\p{N}-]+(?:\.[\p{L}\p{N}-]+)+/gu, key: m => m.toLowerCase() },
|
|
13204
|
+
{ kind: 'phone', pattern: /\+?\d[\d\s().-]{6,}\d/g, key: m => m.replace(/\D/g, '') },
|
|
13205
|
+
PRICE_SHAPE,
|
|
13206
|
+
{ kind: 'time', pattern: /(?<!\d)\d{1,2}[:.]\d{2}(?!\d)/g, key: m => m.replace(/\D/g, '') },
|
|
13207
|
+
];
|
|
13208
|
+
/** Every price written in `text` (commerce C-D21: what a business sells never carries one — the owner sets prices). */
|
|
13209
|
+
function pricesIn(text) {
|
|
13210
|
+
return (text.match(PRICE_SHAPE.pattern) ?? []).map(m => m.trim());
|
|
13211
|
+
}
|
|
13212
|
+
const MIN_PHONE_DIGITS = 8;
|
|
13213
|
+
/** "2019 – 2024" is two years, not a phone number. */
|
|
13214
|
+
const YEAR_RANGE = /^\s*\d{4}\s*[-–]\s*\d{4}\s*$/;
|
|
13215
|
+
function ownedKeys(facts) {
|
|
13216
|
+
const keys = new Set();
|
|
13217
|
+
for (const value of Object.values(facts)) {
|
|
13218
|
+
if (typeof value !== 'string')
|
|
13219
|
+
continue;
|
|
13220
|
+
for (const shape of FACT_SHAPES)
|
|
13221
|
+
for (const m of value.match(shape.pattern) ?? [])
|
|
13222
|
+
keys.add(`${shape.kind}:${shape.key(m)}`);
|
|
13223
|
+
}
|
|
13224
|
+
return keys;
|
|
13225
|
+
}
|
|
13226
|
+
/** The words to avoid and the facts never given, in every written text of the plan. */
|
|
13227
|
+
function planWordIssues(plan, ctx) {
|
|
13228
|
+
const issues = [];
|
|
13229
|
+
const avoid = [...new Set(ctx.avoidWords.map(w => w.trim()).filter(Boolean))].map(w => ({ word: w, pattern: wordPattern(w) }));
|
|
13230
|
+
const owned = ownedKeys(ctx.facts);
|
|
13231
|
+
for (const { path, text } of writtenTexts(plan)) {
|
|
13232
|
+
const words = normalise(text);
|
|
13233
|
+
for (const a of avoid)
|
|
13234
|
+
if (a.pattern.test(words))
|
|
13235
|
+
issues.push({ code: PlanWordIssueCode.AvoidWord, path, message: `uses "${a.word}" — a word this site must not use` });
|
|
13236
|
+
for (const shape of FACT_SHAPES) {
|
|
13237
|
+
for (const m of text.match(shape.pattern) ?? []) {
|
|
13238
|
+
const key = shape.key(m);
|
|
13239
|
+
if (shape.kind === 'phone' && (key.length < MIN_PHONE_DIGITS || YEAR_RANGE.test(m)))
|
|
13240
|
+
continue;
|
|
13241
|
+
if (!owned.has(`${shape.kind}:${key}`))
|
|
13242
|
+
issues.push({ code: PlanWordIssueCode.InventedFact, path, message: `"${m.trim()}" looks like a ${shape.kind} the owner never gave — leave it out` });
|
|
13243
|
+
}
|
|
13244
|
+
}
|
|
13245
|
+
}
|
|
13246
|
+
for (const [key, value] of Object.entries(plan.business?.facts ?? {})) {
|
|
13247
|
+
const own = ctx.facts[key];
|
|
13248
|
+
if (!FACT_KEYS.includes(key))
|
|
13249
|
+
continue;
|
|
13250
|
+
if (typeof own !== 'string' || normalise(own).trim() !== normalise(String(value)).trim()) {
|
|
13251
|
+
issues.push({ code: PlanWordIssueCode.FactNotTheOwners, path: `business.facts.${key}`, message: own ? `must be the owner's own words: "${own}"` : 'the owner did not give it — leave it out (it becomes a placeholder)' });
|
|
13252
|
+
}
|
|
13253
|
+
}
|
|
13254
|
+
return issues;
|
|
13255
|
+
}
|
|
13256
|
+
|
|
13257
|
+
/**
|
|
13258
|
+
* Commerce C-D21 (track G1; shop-aware A-D1, A-D2): a selling business's products are the studio's SHOP — never a
|
|
13259
|
+
* content type of the plan. What a plan says about the shop is only WHAT the business sells (`plan.shop`: up to six
|
|
13260
|
+
* sample products by name, their categories, how they vary — never a price, stock or a fee). Everything that follows
|
|
13261
|
+
* from selling is derived here, never asked: the shop's data sources (the list, the newest, one product by its slug), the
|
|
13262
|
+
* roles its rows play (fixed — the shop's own fields), and that the site is a whole store (the composer's cart button and
|
|
13263
|
+
* cart drawer). Pure.
|
|
13264
|
+
*/
|
|
13265
|
+
/** The need a reading names for a business that sells (harness-core `NEEDS.products`). */
|
|
13266
|
+
const SHOP_NEED = 'products';
|
|
13267
|
+
/** At most this many sample products in a plan (commerce §3j: "≤ 6 sample products by name"). */
|
|
13268
|
+
const SHOP_PRODUCTS_MAX = 6;
|
|
13269
|
+
/** The field each role is on a shop row — the storefront's own fields (iox-cms `storefront-projection.ts`). */
|
|
13270
|
+
const SHOP_ROLES = {
|
|
13271
|
+
[ShopResource.Products]: {
|
|
13272
|
+
title: 'title', summary: 'description', image: 'mainImage', gallery: 'media', price: 'pricing.price', compareAt: 'pricing.compareat',
|
|
13273
|
+
},
|
|
13274
|
+
[ShopResource.Categories]: { title: 'label' },
|
|
13275
|
+
};
|
|
13276
|
+
const field = (name, controller) => ({ name, type: FIELD_TYPE_OF_CONTROL[controller], controller });
|
|
13277
|
+
/** The shop's fields as a pattern's list rules read them (`patternListGap`): its own, fixed. */
|
|
13278
|
+
const SHOP_FIELDS = {
|
|
13279
|
+
[ShopResource.Products]: [
|
|
13280
|
+
field('title', ContentFieldControl.Text), field('slug', ContentFieldControl.Text), field('description', ContentFieldControl.Textarea),
|
|
13281
|
+
field('mainImage', ContentFieldControl.Media), field('media', ContentFieldControl.Gallery),
|
|
13282
|
+
field('pricing.price', ContentFieldControl.Number), field('pricing.compareat', ContentFieldControl.Number),
|
|
13283
|
+
],
|
|
13284
|
+
[ShopResource.Categories]: [field('label', ContentFieldControl.Text), field('slug', ContentFieldControl.Text)],
|
|
13285
|
+
};
|
|
13286
|
+
const SHOP_LABELS = { [ShopResource.Products]: 'Products', [ShopResource.Categories]: 'Categories' };
|
|
13287
|
+
/** The shop list as the composer and the validator read a content type: its fixed roles and fields. Never written. */
|
|
13288
|
+
function shopContentType(resource) {
|
|
13289
|
+
return { name: resource, label: SHOP_LABELS[resource], roles: SHOP_ROLES[resource], fields: SHOP_FIELDS[resource] };
|
|
13290
|
+
}
|
|
13291
|
+
const isShopResource = (value) => Object.values(ShopResource).includes(value);
|
|
13292
|
+
/** The field a product page's route param matches (the shop's slug, shop-aware §3d). */
|
|
13293
|
+
const SHOP_SLUG_FIELD = 'slug';
|
|
13294
|
+
/** How many products the shop's list shows (shop-aware §8: one page, no paging until Plan B). */
|
|
13295
|
+
const SHOP_LIST_LIMIT = 24;
|
|
13296
|
+
/** How many the newest list shows (a home page's row of cards). */
|
|
13297
|
+
const SHOP_LATEST_LIMIT = 3;
|
|
13298
|
+
/** The shop's sources a selling plan holds — derived (`derivedShopSources`), each by its part in the store. */
|
|
13299
|
+
var ShopSourceRole;
|
|
13300
|
+
(function (ShopSourceRole) {
|
|
13301
|
+
/** Every product (the shop page). */
|
|
13302
|
+
ShopSourceRole["List"] = "list";
|
|
13303
|
+
/** The newest few (the home page). */
|
|
13304
|
+
ShopSourceRole["Latest"] = "latest";
|
|
13305
|
+
/** One product, by the route's `:slug` (the product page). */
|
|
13306
|
+
ShopSourceRole["Item"] = "item";
|
|
13307
|
+
})(ShopSourceRole || (ShopSourceRole = {}));
|
|
13308
|
+
const SHOP_SOURCE_SPECS = {
|
|
13309
|
+
[ShopSourceRole.List]: { alias: 'products', mode: PlanDataSourceMode.Query, limit: SHOP_LIST_LIMIT },
|
|
13310
|
+
[ShopSourceRole.Latest]: { alias: 'productsLatest', mode: PlanDataSourceMode.Query, limit: SHOP_LATEST_LIMIT },
|
|
13311
|
+
[ShopSourceRole.Item]: { alias: 'product', mode: PlanDataSourceMode.Single, byRoute: true },
|
|
13312
|
+
};
|
|
13313
|
+
const SHOP_ROUTE_PARAM = 'slug';
|
|
13314
|
+
/** The source a role is: the products list it reads, its mode, its limit, its route lookup. */
|
|
13315
|
+
function shopSourceOf(role, alias) {
|
|
13316
|
+
const spec = SHOP_SOURCE_SPECS[role];
|
|
13317
|
+
return {
|
|
13318
|
+
alias, type: PlanDataSourceType.Shop, mode: spec.mode, resource: ShopResource.Products,
|
|
13319
|
+
...(spec.limit ? { limit: spec.limit } : {}),
|
|
13320
|
+
...(spec.byRoute ? { filterByRouteParam: { field: SHOP_SLUG_FIELD, routeParam: SHOP_ROUTE_PARAM } } : {}),
|
|
13321
|
+
};
|
|
13322
|
+
}
|
|
13323
|
+
/** The role a source plays in the store, or null (a source of some other shape stays the plan's own). */
|
|
13324
|
+
function roleOfSource(raw) {
|
|
13325
|
+
if (!isPlainObject(raw) || raw['type'] !== PlanDataSourceType.Shop || raw['resource'] !== ShopResource.Products)
|
|
13326
|
+
return null;
|
|
13327
|
+
for (const [role, spec] of Object.entries(SHOP_SOURCE_SPECS)) {
|
|
13328
|
+
if (raw['mode'] !== spec.mode)
|
|
13329
|
+
continue;
|
|
13330
|
+
const byRoute = isPlainObject(raw['filterByRouteParam']);
|
|
13331
|
+
if (spec.byRoute ? byRoute : !byRoute && raw['limit'] === spec.limit)
|
|
13332
|
+
return role;
|
|
13333
|
+
}
|
|
13334
|
+
return null;
|
|
13335
|
+
}
|
|
13336
|
+
/** True when `plan` (a plan, or a part of one being written) says the business sells: its `shop` names a product. */
|
|
13337
|
+
function planSells(plan) {
|
|
13338
|
+
const shop = isPlainObject(plan) ? plan['shop'] : undefined;
|
|
13339
|
+
return isPlainObject(shop) && Array.isArray(shop['products']) && shop['products'].length > 0;
|
|
13340
|
+
}
|
|
13341
|
+
/** The store's sources a plan holds, by role (the first of each) — the aliases the pages bind. */
|
|
13342
|
+
function shopSourceAliases(plan) {
|
|
13343
|
+
const out = {};
|
|
13344
|
+
const list = isPlainObject(plan) && Array.isArray(plan['dataSources']) ? plan['dataSources'] : [];
|
|
13345
|
+
for (const raw of list) {
|
|
13346
|
+
const role = roleOfSource(raw);
|
|
13347
|
+
if (role && !out[role] && isNonEmptyString(raw['alias']))
|
|
13348
|
+
out[role] = raw['alias'];
|
|
13349
|
+
}
|
|
13350
|
+
return out;
|
|
13351
|
+
}
|
|
13352
|
+
/** The alias itself, else the first of `<alias>2`, `<alias>3`… no source has. */
|
|
13353
|
+
function freeAlias$1(base, taken) {
|
|
13354
|
+
let alias = base;
|
|
13355
|
+
for (let n = 2; taken.has(alias); n++)
|
|
13356
|
+
alias = `${base}${n}`;
|
|
13357
|
+
return alias;
|
|
13358
|
+
}
|
|
13359
|
+
/**
|
|
13360
|
+
* The shop sources a selling plan lacks (shop-aware A-D1, the derived-not-asked rule of `plan-derived.ts`): the list,
|
|
13361
|
+
* the newest and one product by its slug. Idempotent — a plan holding one of each gains nothing; a plan that sells
|
|
13362
|
+
* nothing gains nothing. Tolerates any value.
|
|
13363
|
+
*/
|
|
13364
|
+
function derivedShopSources(plan) {
|
|
13365
|
+
if (!planSells(plan) || !Array.isArray(plan['dataSources']))
|
|
13366
|
+
return [];
|
|
13367
|
+
const have = shopSourceAliases(plan);
|
|
13368
|
+
const taken = new Set(plan['dataSources'].map(d => (isPlainObject(d) ? d['alias'] : undefined)).filter(isNonEmptyString));
|
|
13369
|
+
const out = [];
|
|
13370
|
+
for (const role of Object.values(ShopSourceRole)) {
|
|
13371
|
+
if (have[role])
|
|
13372
|
+
continue;
|
|
13373
|
+
const alias = freeAlias$1(SHOP_SOURCE_SPECS[role].alias, taken);
|
|
13374
|
+
taken.add(alias);
|
|
13375
|
+
out.push(shopSourceOf(role, alias));
|
|
13376
|
+
}
|
|
13377
|
+
return out;
|
|
13378
|
+
}
|
|
13379
|
+
/** The categories of a plan's products, in order, each once (what the wire derives from the products). */
|
|
13380
|
+
function shopCategoriesOf(products) {
|
|
13381
|
+
return [...new Set(products.map(p => p.category).filter(isNonEmptyString).map(c => c.trim()))];
|
|
13382
|
+
}
|
|
13383
|
+
/** True when `plan` holds a shop source (a whole store's data). */
|
|
13384
|
+
function planHasShopSource(plan) {
|
|
13385
|
+
return plan.dataSources.some(d => d.type === PlanDataSourceType.Shop);
|
|
13386
|
+
}
|
|
13387
|
+
/** A product's variants by name — one per combination of its options' values, in order (`Glaze-Sand-24 cm`'s shape, the
|
|
13388
|
+
* shop's own: `VARIANT_NAME_SEPARATOR`). No options: none (the shop keeps its one Default). */
|
|
13389
|
+
function variantNamesOf(options) {
|
|
13390
|
+
const lists = options.map(o => o.values).filter(v => v.length);
|
|
13391
|
+
if (!lists.length)
|
|
13392
|
+
return [];
|
|
13393
|
+
return lists.reduce((combos, values) => combos.flatMap(c => values.map(v => [...c, v])), [[]]).map(c => c.join(VARIANT_NAME_SEPARATOR));
|
|
13394
|
+
}
|
|
13395
|
+
|
|
13396
|
+
/**
|
|
13397
|
+
* A site's ART DIRECTION (premium-components M7, premium sites PS4): what every picture made for the site shares, so its
|
|
13398
|
+
* pictures read as one photographer's and never as a stock pool. A closed WORLD (the contract's `site.pictureWorlds`)
|
|
13399
|
+
* gives the five parts — medium, light, grade, texture and a negative list — and ONE preamble built from them is carried
|
|
13400
|
+
* VERBATIM at the head of every picture prompt of the site (`artDirectionPreamble`).
|
|
13401
|
+
*
|
|
12785
13402
|
* Decided here, not by a model: the world is the business type's (harness-core `BusinessType.world`), a dark look moves it
|
|
12786
13403
|
* to the world's `dark`, and the brand's hue joins the grade. Zero tokens, the same site always gets the same direction,
|
|
12787
13404
|
* and the quality lever — each world's wording — is written once in the contract, as the proof sites' briefs were.
|
|
@@ -12961,6 +13578,13 @@ var SitePlanIssueCode;
|
|
|
12961
13578
|
SitePlanIssueCode["Compose"] = "compose";
|
|
12962
13579
|
/** M8 gate 2: a composed page's layout (`checkLayout`'s issues, each at its path under `layout`). */
|
|
12963
13580
|
SitePlanIssueCode["Layout"] = "layout";
|
|
13581
|
+
/** Commerce C-D21: what the business sells — a selling business without its products, one that sells nothing with a
|
|
13582
|
+
* shop, a product past the sixth, a shop source with no shop, or a content type named after a shop list. */
|
|
13583
|
+
SitePlanIssueCode["Shop"] = "shop";
|
|
13584
|
+
/** Commerce C-D21: a selling site has a product page — a page at a `:slug` route reading the shop's one product. */
|
|
13585
|
+
SitePlanIssueCode["ProductPage"] = "product-page";
|
|
13586
|
+
/** Commerce C-D21: a price, a stock count or a fee written into what the business sells — the owner sets those. */
|
|
13587
|
+
SitePlanIssueCode["Price"] = "price";
|
|
12964
13588
|
})(SitePlanIssueCode || (SitePlanIssueCode = {}));
|
|
12965
13589
|
class SitePlanError extends Error {
|
|
12966
13590
|
constructor(issues) {
|
|
@@ -12989,6 +13613,10 @@ const SLUG_FIELD = 'slug';
|
|
|
12989
13613
|
const SEED_FIXED_KEYS = shapeKeys(SHAPE['seed']);
|
|
12990
13614
|
const CMS_SOURCE_KEYS = shapeKeys(SHAPE['cmsDataSource']);
|
|
12991
13615
|
const RELATIVE_SOURCE_KEYS = shapeKeys(SHAPE['relativeDataSource']);
|
|
13616
|
+
const SHOP_SOURCE_KEYS = shapeKeys(SHAPE['shopDataSource']);
|
|
13617
|
+
const SHOP_KEYS = shapeKeys(SHAPE['shop']);
|
|
13618
|
+
const SHOP_PRODUCT_KEYS = shapeKeys(SHAPE['shopProduct']);
|
|
13619
|
+
const SHOP_OPTION_KEYS = shapeKeys(SHAPE['shopOption']);
|
|
12992
13620
|
const PAGE_KEYS = shapeKeys(SHAPE['page']);
|
|
12993
13621
|
const FILM_KEYS = shapeKeys(SHAPE['film']);
|
|
12994
13622
|
const ART_DIRECTION_KEYS = shapeKeys(SHAPE['artDirection']);
|
|
@@ -13187,6 +13815,9 @@ function validateRoles(c, roles, path, typeName, fields, fieldTypes) {
|
|
|
13187
13815
|
c.add(SitePlanIssueCode.MissingRole, `${path}.${role}`, `every content type names its ${role} field`);
|
|
13188
13816
|
return out;
|
|
13189
13817
|
}
|
|
13818
|
+
/** A source a page may read ONE item from by its route (`routeSource`), or bind a list to — a cms one or the shop's. */
|
|
13819
|
+
const isItemSource = (s) => !!s && (s.type === PlanDataSourceType.Cms || s.type === PlanDataSourceType.Shop) && s.mode === PlanDataSourceMode.Single;
|
|
13820
|
+
const isListSource = (s) => !!s && (s.type === PlanDataSourceType.Cms || s.type === PlanDataSourceType.Shop) && s.mode === PlanDataSourceMode.Query;
|
|
13190
13821
|
function validateDataSources(c, list, types) {
|
|
13191
13822
|
const sources = new Map();
|
|
13192
13823
|
list.forEach((raw, i) => {
|
|
@@ -13235,8 +13866,13 @@ function validateDataSources(c, list, types) {
|
|
|
13235
13866
|
if (alias && !sources.has(alias))
|
|
13236
13867
|
sources.set(alias, { type: PlanDataSourceType.Relative, of: raw['of'], op: raw['op'] });
|
|
13237
13868
|
}
|
|
13869
|
+
else if (raw['type'] === PlanDataSourceType.Shop) {
|
|
13870
|
+
const routeParam = validateShopSource(c, raw, path);
|
|
13871
|
+
if (alias && !sources.has(alias))
|
|
13872
|
+
sources.set(alias, { type: PlanDataSourceType.Shop, mode: raw['mode'], contentType: raw['resource'], routeParam });
|
|
13873
|
+
}
|
|
13238
13874
|
else {
|
|
13239
|
-
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.type`, `must be
|
|
13875
|
+
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.type`, `must be one of ${Object.values(PlanDataSourceType).map(t => `"${t}"`).join(', ')}`);
|
|
13240
13876
|
}
|
|
13241
13877
|
});
|
|
13242
13878
|
c.unique(list.map(r => (isPlainObject(r) && isNonEmptyString(r['alias']) ? r['alias'] : null)), i => `dataSources[${i}].alias`, 'alias');
|
|
@@ -13255,6 +13891,122 @@ function validateDataSources(c, list, types) {
|
|
|
13255
13891
|
});
|
|
13256
13892
|
return sources;
|
|
13257
13893
|
}
|
|
13894
|
+
/** A shop source (derived — `derivedShopSources` — so a bad one is the plan's own writing): a list of the shop or one row of
|
|
13895
|
+
* it by its slug. Returns the route param it is looked up by. */
|
|
13896
|
+
function validateShopSource(c, raw, path) {
|
|
13897
|
+
c.keys(raw, SHOP_SOURCE_KEYS, path);
|
|
13898
|
+
const mode = raw['mode'];
|
|
13899
|
+
if (mode !== PlanDataSourceMode.Query && mode !== PlanDataSourceMode.Single)
|
|
13900
|
+
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.mode`, `must be "${PlanDataSourceMode.Query}" or "${PlanDataSourceMode.Single}"`);
|
|
13901
|
+
if (!isShopResource(raw['resource']))
|
|
13902
|
+
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.resource`, `must be one of ${Object.values(ShopResource).join(', ')}`);
|
|
13903
|
+
if (raw['limit'] !== undefined && (!Number.isInteger(raw['limit']) || raw['limit'] < 1))
|
|
13904
|
+
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.limit`, 'must be a positive whole number');
|
|
13905
|
+
const byRoute = raw['filterByRouteParam'];
|
|
13906
|
+
if (byRoute === undefined)
|
|
13907
|
+
return undefined;
|
|
13908
|
+
if (!isPlainObject(byRoute)) {
|
|
13909
|
+
c.add(SitePlanIssueCode.Shape, `${path}.filterByRouteParam`, 'must be an object');
|
|
13910
|
+
return undefined;
|
|
13911
|
+
}
|
|
13912
|
+
c.keys(byRoute, ['field', 'routeParam'], `${path}.filterByRouteParam`);
|
|
13913
|
+
const field = c.string(byRoute, 'field', `${path}.filterByRouteParam`);
|
|
13914
|
+
const routeParam = c.string(byRoute, 'routeParam', `${path}.filterByRouteParam`) ?? undefined;
|
|
13915
|
+
if (field && field !== SHOP_SLUG_FIELD)
|
|
13916
|
+
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.filterByRouteParam.field`, `a shop row is looked up by its ${SHOP_SLUG_FIELD}`);
|
|
13917
|
+
if (mode !== PlanDataSourceMode.Single)
|
|
13918
|
+
c.add(SitePlanIssueCode.InvalidDataSource, `${path}.filterByRouteParam`, 'only a single source is looked up by a route param');
|
|
13919
|
+
return routeParam;
|
|
13920
|
+
}
|
|
13921
|
+
/**
|
|
13922
|
+
* Commerce C-D21: what the business sells — up to six products by name, each in one of the categories, how each varies;
|
|
13923
|
+
* never a price, a stock count or a fee (the owner sets those, shop-aware §3i). A selling business must say what it
|
|
13924
|
+
* sells, one that sells nothing holds no shop, and a shop list is never a content type's name (its collection is the
|
|
13925
|
+
* shop's). Returns whether the plan sells.
|
|
13926
|
+
*/
|
|
13927
|
+
function validateShop(c, plan, ctx) {
|
|
13928
|
+
c.array(plan, 'contentTypes', '').forEach((t, i) => {
|
|
13929
|
+
if (isPlainObject(t) && isShopResource(t['name']))
|
|
13930
|
+
c.add(SitePlanIssueCode.Shop, `contentTypes[${i}].name`, `"${t['name']}" is the shop's own list — what the business sells goes in shop, never a content type`);
|
|
13931
|
+
});
|
|
13932
|
+
const shop = plan['shop'];
|
|
13933
|
+
const sells = planSells(plan);
|
|
13934
|
+
if (ctx.sells === true && !sells)
|
|
13935
|
+
c.add(SitePlanIssueCode.Shop, 'shop', `this business sells — name what (1–${SHOP_PRODUCTS_MAX} products, each in a category)`);
|
|
13936
|
+
if (ctx.sells === false && shop !== undefined)
|
|
13937
|
+
c.add(SitePlanIssueCode.Shop, 'shop', 'this business sells nothing online — no shop');
|
|
13938
|
+
if (!sells) {
|
|
13939
|
+
c.array(plan, 'dataSources', '').forEach((d, i) => {
|
|
13940
|
+
if (isPlainObject(d) && d['type'] === PlanDataSourceType.Shop)
|
|
13941
|
+
c.add(SitePlanIssueCode.Shop, `dataSources[${i}]`, 'a shop source on a plan that sells nothing');
|
|
13942
|
+
});
|
|
13943
|
+
}
|
|
13944
|
+
if (shop === undefined)
|
|
13945
|
+
return sells;
|
|
13946
|
+
if (!isPlainObject(shop)) {
|
|
13947
|
+
c.add(SitePlanIssueCode.Shape, 'shop', 'must be an object');
|
|
13948
|
+
return false;
|
|
13949
|
+
}
|
|
13950
|
+
c.keys(shop, SHOP_KEYS, 'shop');
|
|
13951
|
+
const categories = c.array(shop, 'categories', 'shop');
|
|
13952
|
+
categories.forEach((name, i) => { if (!isNonEmptyString(name))
|
|
13953
|
+
c.add(SitePlanIssueCode.Shape, `shop.categories[${i}]`, 'must be a name'); });
|
|
13954
|
+
c.unique(categories.map(n => (isNonEmptyString(n) ? n : null)), i => `shop.categories[${i}]`, 'category');
|
|
13955
|
+
const products = c.array(shop, 'products', 'shop');
|
|
13956
|
+
if (!products.length)
|
|
13957
|
+
c.add(SitePlanIssueCode.Shop, 'shop.products', 'name what the business sells, or hold no shop');
|
|
13958
|
+
if (products.length > SHOP_PRODUCTS_MAX)
|
|
13959
|
+
c.add(SitePlanIssueCode.Shop, 'shop.products', `${products.length} products — at most ${SHOP_PRODUCTS_MAX} samples`);
|
|
13960
|
+
const price = (path, text) => {
|
|
13961
|
+
if (typeof text === 'string' && pricesIn(text).length)
|
|
13962
|
+
c.add(SitePlanIssueCode.Price, path, `"${pricesIn(text)[0]}" — never a price, stock or fee: the owner sets those`);
|
|
13963
|
+
};
|
|
13964
|
+
products.forEach((raw, i) => {
|
|
13965
|
+
const path = `shop.products[${i}]`;
|
|
13966
|
+
if (!isPlainObject(raw))
|
|
13967
|
+
return c.add(SitePlanIssueCode.Shape, path, 'must be an object');
|
|
13968
|
+
c.keys(raw, SHOP_PRODUCT_KEYS, path);
|
|
13969
|
+
price(`${path}.name`, c.string(raw, 'name', path));
|
|
13970
|
+
const category = c.string(raw, 'category', path);
|
|
13971
|
+
if (category && !categories.includes(category))
|
|
13972
|
+
c.add(SitePlanIssueCode.Shop, `${path}.category`, `"${category}" is not one of the shop's categories`);
|
|
13973
|
+
const description = raw['description'];
|
|
13974
|
+
if (typeof description !== 'string')
|
|
13975
|
+
c.add(SitePlanIssueCode.Shape, `${path}.description`, 'must be a string (one line)');
|
|
13976
|
+
else
|
|
13977
|
+
price(`${path}.description`, description);
|
|
13978
|
+
const options = c.array(raw, 'options', path);
|
|
13979
|
+
options.forEach((o, j) => {
|
|
13980
|
+
const op = `${path}.options[${j}]`;
|
|
13981
|
+
if (!isPlainObject(o))
|
|
13982
|
+
return c.add(SitePlanIssueCode.Shape, op, 'must be an object');
|
|
13983
|
+
c.keys(o, SHOP_OPTION_KEYS, op);
|
|
13984
|
+
c.string(o, 'name', op);
|
|
13985
|
+
const values = c.array(o, 'values', op);
|
|
13986
|
+
if (!values.length)
|
|
13987
|
+
c.add(SitePlanIssueCode.Shop, `${op}.values`, 'an option names its values (sizes, colours…)');
|
|
13988
|
+
values.forEach((v, k) => { if (!isNonEmptyString(v))
|
|
13989
|
+
c.add(SitePlanIssueCode.Shape, `${op}.values[${k}]`, 'must be a name');
|
|
13990
|
+
else
|
|
13991
|
+
price(`${op}.values[${k}]`, v); });
|
|
13992
|
+
c.unique(values.map(v => (isNonEmptyString(v) ? v : null)), k => `${op}.values[${k}]`, 'value');
|
|
13993
|
+
});
|
|
13994
|
+
c.unique(options.map(o => (isPlainObject(o) && isNonEmptyString(o['name']) ? o['name'] : null)), j => `${path}.options[${j}].name`, 'option');
|
|
13995
|
+
});
|
|
13996
|
+
c.unique(products.map(p => (isPlainObject(p) && isNonEmptyString(p['name']) ? p['name'] : null)), i => `shop.products[${i}].name`, 'product');
|
|
13997
|
+
return sells;
|
|
13998
|
+
}
|
|
13999
|
+
/** A selling site has a product page: a page whose route item is the shop's one product (`/shop/:slug`). */
|
|
14000
|
+
function validateProductPage(c, pages, sources) {
|
|
14001
|
+
const hasProductPage = pages.some(p => {
|
|
14002
|
+
const source = isPlainObject(p) && typeof p['routeSource'] === 'string' ? sources.get(p['routeSource']) : undefined;
|
|
14003
|
+
return source?.type === PlanDataSourceType.Shop && source.mode === PlanDataSourceMode.Single && source.contentType === ShopResource.Products;
|
|
14004
|
+
});
|
|
14005
|
+
if (!hasProductPage) {
|
|
14006
|
+
const item = [...sources].find(([, s]) => s.type === PlanDataSourceType.Shop && s.mode === PlanDataSourceMode.Single)?.[0] ?? 'product';
|
|
14007
|
+
c.add(SitePlanIssueCode.ProductPage, 'pages', `this site sells — it needs a product page: a page at /shop/:slug whose routeSource is "${item}" and template "${ShopResource.Products}"`);
|
|
14008
|
+
}
|
|
14009
|
+
}
|
|
13258
14010
|
function validatePages(c, list, types, sources, density) {
|
|
13259
14011
|
const homes = [];
|
|
13260
14012
|
const routes = new Set(list.map(p => (isPlainObject(p) && typeof p['route'] === 'string' ? p['route'] : null)).filter((r) => !!r));
|
|
@@ -13284,7 +14036,7 @@ function validatePages(c, list, types, sources, density) {
|
|
|
13284
14036
|
const template = c.string(raw, 'template', path, false);
|
|
13285
14037
|
const routeSourceAlias = c.string(raw, 'routeSource', path, false);
|
|
13286
14038
|
const routeSource = routeSourceAlias ? sources.get(routeSourceAlias) : undefined;
|
|
13287
|
-
const routeSourceOk =
|
|
14039
|
+
const routeSourceOk = isItemSource(routeSource);
|
|
13288
14040
|
if (template && !types.has(template))
|
|
13289
14041
|
c.add(SitePlanIssueCode.UnknownContentType, `${path}.template`, `no content type "${template}" in the plan`);
|
|
13290
14042
|
if (params.length > 1)
|
|
@@ -13293,7 +14045,7 @@ function validatePages(c, list, types, sources, density) {
|
|
|
13293
14045
|
c.add(SitePlanIssueCode.RouteSource, `${path}.routeSource`, `a route with :${params[0]} names the source that reads it`);
|
|
13294
14046
|
if (routeSourceAlias) {
|
|
13295
14047
|
if (!routeSourceOk) {
|
|
13296
|
-
c.add(SitePlanIssueCode.RouteSource, `${path}.routeSource`, `"${routeSourceAlias}" must be a single
|
|
14048
|
+
c.add(SitePlanIssueCode.RouteSource, `${path}.routeSource`, `"${routeSourceAlias}" must be a single source of the plan`);
|
|
13297
14049
|
}
|
|
13298
14050
|
else {
|
|
13299
14051
|
if (!params.length || routeSource.routeParam !== params[0])
|
|
@@ -13384,7 +14136,7 @@ function validatePages(c, list, types, sources, density) {
|
|
|
13384
14136
|
const src = sources.get(binding);
|
|
13385
14137
|
if (!src)
|
|
13386
14138
|
c.add(SitePlanIssueCode.UnknownDataSource, `${sp}.binding`, `no data source "${binding}"`);
|
|
13387
|
-
else if (src
|
|
14139
|
+
else if (!isListSource(src))
|
|
13388
14140
|
c.add(SitePlanIssueCode.Binding, `${sp}.binding`, `"${binding}" is not a list source`);
|
|
13389
14141
|
else {
|
|
13390
14142
|
const listed = src.contentType ? types.get(src.contentType) : undefined;
|
|
@@ -13396,6 +14148,15 @@ function validatePages(c, list, types, sources, density) {
|
|
|
13396
14148
|
}
|
|
13397
14149
|
else if (binding)
|
|
13398
14150
|
c.add(SitePlanIssueCode.Binding, `${sp}.binding`, `"${patternId}" repeats nothing — it takes no binding`);
|
|
14151
|
+
// Commerce G1: a store section reads the shop — its list from a shop source, its product from the page's.
|
|
14152
|
+
if (pattern.shop) {
|
|
14153
|
+
const listed = binding ? sources.get(binding) : undefined;
|
|
14154
|
+
if (listed && listed.type !== PlanDataSourceType.Shop)
|
|
14155
|
+
c.add(SitePlanIssueCode.Binding, `${sp}.binding`, `"${patternId}" shows the shop's products — bind a shop source, not "${binding}"`);
|
|
14156
|
+
if (patternScopes(pattern).has(BindScope.Route) && routeSourceOk && routeSource.type !== PlanDataSourceType.Shop) {
|
|
14157
|
+
c.add(SitePlanIssueCode.RouteSource, `${sp}.pattern`, `"${patternId}" shows one product — its page reads a shop source, not "${routeSourceAlias}"`);
|
|
14158
|
+
}
|
|
14159
|
+
}
|
|
13399
14160
|
// A pattern reading the route item needs a routeSource (an INVALID one is reported above, once).
|
|
13400
14161
|
const scopes = patternScopes(pattern);
|
|
13401
14162
|
const readsRoute = scopes.has(BindScope.Route) || scopes.has(BindScope.Next);
|
|
@@ -13525,7 +14286,7 @@ function validateGlobals(c, globals) {
|
|
|
13525
14286
|
}
|
|
13526
14287
|
}
|
|
13527
14288
|
/** Check a Site Plan against the plan shape and the pattern library. Never throws, never repairs. */
|
|
13528
|
-
function validateSitePlan(plan) {
|
|
14289
|
+
function validateSitePlan(plan, ctx = {}) {
|
|
13529
14290
|
const c = new Collector$1();
|
|
13530
14291
|
if (!isPlainObject(plan)) {
|
|
13531
14292
|
c.add(SitePlanIssueCode.Shape, '', 'a site plan is an object');
|
|
@@ -13540,8 +14301,11 @@ function validateSitePlan(plan) {
|
|
|
13540
14301
|
validateDesign(c, plan['design']);
|
|
13541
14302
|
const types = validateContentTypes(c, c.array(plan, 'contentTypes', ''));
|
|
13542
14303
|
const sources = validateDataSources(c, c.array(plan, 'dataSources', ''), types);
|
|
14304
|
+
const sells = validateShop(c, plan, ctx);
|
|
13543
14305
|
const design = isPlainObject(plan['design']) ? plan['design'] : {};
|
|
13544
|
-
validatePages(c, c.array(plan, 'pages', ''), types, sources, typeof design['density'] === 'string' ? design['density'] : null);
|
|
14306
|
+
validatePages(c, c.array(plan, 'pages', ''), withShopTypes(types, sources), sources, typeof design['density'] === 'string' ? design['density'] : null);
|
|
14307
|
+
if (sells)
|
|
14308
|
+
validateProductPage(c, c.array(plan, 'pages', ''), sources);
|
|
13545
14309
|
validateGlobals(c, plan['globals']);
|
|
13546
14310
|
validateScenes(c, c.array(plan, 'pages', ''), typeof design['animate'] === 'string' ? design['animate'] : null);
|
|
13547
14311
|
validateFilm(c, plan['film'], c.array(plan, 'pages', ''));
|
|
@@ -13600,6 +14364,17 @@ function validateComposed(c, pages) {
|
|
|
13600
14364
|
if (composed > COMPOSED_PAGES_MAX)
|
|
13601
14365
|
c.add(SitePlanIssueCode.Compose, 'pages', `${composed} composed pages — the home page and at most ${COMPOSED_PAGES_MAX - 1} other`);
|
|
13602
14366
|
}
|
|
14367
|
+
/** The plan's content types and, for each shop list a source reads, the shop's own (fixed fields and roles). */
|
|
14368
|
+
function withShopTypes(types, sources) {
|
|
14369
|
+
const out = new Map(types);
|
|
14370
|
+
for (const s of sources.values()) {
|
|
14371
|
+
if (s.type !== PlanDataSourceType.Shop || !isShopResource(s.contentType) || out.has(s.contentType))
|
|
14372
|
+
continue;
|
|
14373
|
+
const shop = shopContentType(s.contentType);
|
|
14374
|
+
out.set(s.contentType, { fields: new Set(shop.fields.map(f => f.name)), described: shop.fields.map(f => ({ ...f })), roles: { ...shop.roles } });
|
|
14375
|
+
}
|
|
14376
|
+
return out;
|
|
14377
|
+
}
|
|
13603
14378
|
/** Throw a `SitePlanError` carrying every issue unless the plan is valid. */
|
|
13604
14379
|
function assertValidSitePlan(plan) {
|
|
13605
14380
|
const result = validateSitePlan(plan);
|
|
@@ -14184,9 +14959,10 @@ function removeRole(node, role) {
|
|
|
14184
14959
|
visit(node);
|
|
14185
14960
|
return removed;
|
|
14186
14961
|
}
|
|
14187
|
-
/** The root's own parts that hide at the phone width: everything but the brand, the menu button
|
|
14962
|
+
/** The root's own parts that hide at the phone width: everything but the brand, the menu button, the drawer and a
|
|
14963
|
+
* store's bag (commerce G1 — a phone visitor reaches the cart from every page). */
|
|
14188
14964
|
function phoneHiddenParts(root) {
|
|
14189
|
-
const keep = new Set([NavRole.Brand, NavRole.MenuButton, NavRole.Drawer]);
|
|
14965
|
+
const keep = new Set([NavRole.Brand, NavRole.MenuButton, NavRole.Drawer, ShopRole.CartButton]);
|
|
14190
14966
|
return (root.children ?? []).filter((c, i) => !keep.has(roleOf(c)) && !(i === 0 && !c.role && c.type === LINKED));
|
|
14191
14967
|
}
|
|
14192
14968
|
/** Board 2 / board 8: five items either way — five pages (Bottom bar) or four pages + More (Both). */
|
|
@@ -14879,7 +15655,7 @@ const GRID$1 = 12;
|
|
|
14879
15655
|
const COLUMN_PX$1 = LAYOUT_CHECK_VIEWPORT.width / GRID$1;
|
|
14880
15656
|
/** A line of words stands its size × this tall. */
|
|
14881
15657
|
const LAYOUT_LINE_HEIGHT = 1.2;
|
|
14882
|
-
const HEBREW
|
|
15658
|
+
const HEBREW = /[-]/;
|
|
14883
15659
|
/** A button's ink, as tall as its padding and one line. */
|
|
14884
15660
|
const BUTTON_PX = 56;
|
|
14885
15661
|
/** How far the screens mend lowers a section at a time, and how often it tries. */
|
|
@@ -14898,7 +15674,7 @@ const meets = (a, b) => {
|
|
|
14898
15674
|
return ov(a.col ?? [0, 0], b.col ?? [0, 0]) && ov(a.row ?? [0, 0], b.row ?? [0, 0]);
|
|
14899
15675
|
};
|
|
14900
15676
|
const textOf$2 = (l) => String(l.text ?? (l.items ?? []).join(' '));
|
|
14901
|
-
const advanceOf = (text) => (HEBREW
|
|
15677
|
+
const advanceOf = (text) => (HEBREW.test(text) ? LIM$1.advance.hebrew : LIM$1.advance.latin);
|
|
14902
15678
|
/** A grid box's size in px on the laptop. */
|
|
14903
15679
|
function layoutBoxPx(col, row, s) {
|
|
14904
15680
|
const height = (s.pin ? 1 : s.screens) * LAYOUT_CHECK_VIEWPORT.height;
|
|
@@ -16354,7 +17130,7 @@ function detailLinkOf(scope, repeater, ctx, nodeId) {
|
|
|
16354
17130
|
const type = typeSource ? contentTypeOfSource(typeSource, ctx.plan) : undefined;
|
|
16355
17131
|
const page = type ? ctx.plan.pages.find(p => p.template === type.name && !!p.routeSource) : undefined;
|
|
16356
17132
|
const byRoute = page ? ctx.plan.dataSources.find(d => d.alias === page.routeSource) : undefined;
|
|
16357
|
-
const filter = byRoute && byRoute.type
|
|
17133
|
+
const filter = byRoute && byRoute.type !== PlanDataSourceType.Relative ? byRoute.filterByRouteParam : undefined;
|
|
16358
17134
|
const [param] = page ? routeParams(page.route) : [];
|
|
16359
17135
|
if (!page || !filter || !param)
|
|
16360
17136
|
return null;
|
|
@@ -16377,6 +17153,8 @@ function contentTypeOfSource(alias, plan) {
|
|
|
16377
17153
|
return undefined;
|
|
16378
17154
|
if (ds.type === PlanDataSourceType.Relative)
|
|
16379
17155
|
return contentTypeOfSource(ds.within, plan);
|
|
17156
|
+
if (ds.type === PlanDataSourceType.Shop)
|
|
17157
|
+
return shopContentType(ds.resource);
|
|
16380
17158
|
return plan.contentTypes.find(t => t.name === ds.contentType);
|
|
16381
17159
|
}
|
|
16382
17160
|
/** Every list a composed gallery could name (the plan's query sources), in plan order: what it is called and whether its
|
|
@@ -16714,6 +17492,11 @@ function composeNode(given, id, repeater, ctx) {
|
|
|
16714
17492
|
else if (pn.alt !== undefined) {
|
|
16715
17493
|
throw new ComposeError(`${id}: "alt" belongs on a bound Image`);
|
|
16716
17494
|
}
|
|
17495
|
+
if (pn.limit !== undefined) {
|
|
17496
|
+
if (type !== REPEATER)
|
|
17497
|
+
throw new ComposeError(`${id}: "limit" belongs on a Repeater`);
|
|
17498
|
+
setProp(node, 'limit', pn.limit);
|
|
17499
|
+
}
|
|
16717
17500
|
// Layout.
|
|
16718
17501
|
applyLayout(node, pn);
|
|
16719
17502
|
if (pn.shownWhen)
|
|
@@ -16800,6 +17583,8 @@ const CARD_BINDS = {
|
|
|
16800
17583
|
* through its title (`href` + `param`, the stretched link). Ids derive from the recipe's keys.
|
|
16801
17584
|
*/
|
|
16802
17585
|
function composeRecipe(pn, id, repeater, ctx) {
|
|
17586
|
+
if (SHOP_PATTERN_RECIPES.has(pn.recipe))
|
|
17587
|
+
return composeShopRecipe(pn, id, repeater, ctx);
|
|
16803
17588
|
if (pn.recipe === PatternRecipe.Accordion)
|
|
16804
17589
|
return composeAccordion(pn, id, ctx);
|
|
16805
17590
|
if (pn.recipe === PatternRecipe.Tabs)
|
|
@@ -17026,6 +17811,90 @@ function composeTabs(pn, id, ctx) {
|
|
|
17026
17811
|
return root;
|
|
17027
17812
|
}
|
|
17028
17813
|
/** A recipe's node factory for this composer: ids derive from the recipe's keys (`<id>-<key>`, the root `<id>`). */
|
|
17814
|
+
/** Commerce G1: a pattern's shop recipes, each E1c's `SHOP_RECIPES` entry and the key its root is built with. */
|
|
17815
|
+
const SHOP_PATTERN_RECIPES = new Map([
|
|
17816
|
+
[PatternRecipe.Price, { recipe: ShopRecipe.Price, rootKey: 'price' }],
|
|
17817
|
+
[PatternRecipe.Variants, { recipe: ShopRecipe.Variants, rootKey: 'variants' }],
|
|
17818
|
+
[PatternRecipe.Quantity, { recipe: ShopRecipe.Quantity, rootKey: 'quantity' }],
|
|
17819
|
+
[PatternRecipe.Add, { recipe: ShopRecipe.Add, rootKey: 'add' }],
|
|
17820
|
+
[PatternRecipe.BuyNow, { recipe: ShopRecipe.BuyNow, rootKey: 'buy-now' }],
|
|
17821
|
+
]);
|
|
17822
|
+
const PRICE_BINDS = {
|
|
17823
|
+
[PriceBindTarget.Price]: ShopBindTarget.Price,
|
|
17824
|
+
[PriceBindTarget.CompareAt]: ShopBindTarget.CompareAt,
|
|
17825
|
+
};
|
|
17826
|
+
/** E1c's root keys of the recipes a site holds outside its sections — the header's bag and the one cart drawer. */
|
|
17827
|
+
const CART_BUTTON_KEY = 'cart-button';
|
|
17828
|
+
const CART_DRAWER_KEY = 'cart-drawer';
|
|
17829
|
+
/** The ids the composer gives them (the header's bag; the drawer, a global after the page). */
|
|
17830
|
+
const SHOP_CART_BUTTON_ID = 'header-cart';
|
|
17831
|
+
const SHOP_CART_DRAWER_ID = 'cart';
|
|
17832
|
+
/**
|
|
17833
|
+
* Commerce G1: a shop part stamped whole from E1c's recipe (`SHOP_RECIPES`) — the product page's own reading the page's
|
|
17834
|
+
* product (`$variant`, the runtime's), a list's price re-bound to its ROW (`binds`: `item.@price` → `pricing.price`,
|
|
17835
|
+
* through `bindShopPart`, the money pipe kept). A compare-at the row's type cannot show is left out. Never an entrance.
|
|
17836
|
+
*/
|
|
17837
|
+
function composeShopRecipe(pn, id, repeater, ctx) {
|
|
17838
|
+
const spec = SHOP_PATTERN_RECIPES.get(pn.recipe);
|
|
17839
|
+
const root = SHOP_RECIPES[spec.recipe](recipeFactory(id, spec.rootKey));
|
|
17840
|
+
if (root.id !== id)
|
|
17841
|
+
throw new ComposeError(`${id}: the ${pn.recipe} recipe's root is not "${spec.rootKey}"`);
|
|
17842
|
+
for (const [key, path] of Object.entries(pn.binds ?? {})) {
|
|
17843
|
+
const target = PRICE_BINDS[key];
|
|
17844
|
+
if (spec.recipe !== ShopRecipe.Price || !target)
|
|
17845
|
+
throw new ComposeError(`${id}: a ${pn.recipe} cannot bind "${key}"`);
|
|
17846
|
+
const scoped = resolveScopedPath(path, repeater, ctx, id);
|
|
17847
|
+
if (scoped) {
|
|
17848
|
+
bindShopPart(root, target, scoped.source, scoped.path);
|
|
17849
|
+
continue;
|
|
17850
|
+
}
|
|
17851
|
+
if (target === ShopBindTarget.Price)
|
|
17852
|
+
throw new ComposeError(`${id}: a price cannot be left out`);
|
|
17853
|
+
root.children = (root.children ?? []).filter(c => c.role !== ShopRole.PriceCompare);
|
|
17854
|
+
}
|
|
17855
|
+
if (pn.lay)
|
|
17856
|
+
setStyleProps(root, pn.lay);
|
|
17857
|
+
return root;
|
|
17858
|
+
}
|
|
17859
|
+
/**
|
|
17860
|
+
* Commerce G1 (C-D21): a selling site is a whole store on every page — the header holds the bag (before the menu
|
|
17861
|
+
* button; the brand takes the row's free space, so the bag sits at the end on every width, either direction), and the
|
|
17862
|
+
* site holds the ONE cart drawer as a global after the page (`SHOP_GLOBAL_RECIPES`), which every bag opens. Check out
|
|
17863
|
+
* is the drawer's own (the fixed checkout). Pure: new globals.
|
|
17864
|
+
*/
|
|
17865
|
+
function withStore(globals) {
|
|
17866
|
+
const out = [...globals];
|
|
17867
|
+
const header = out.find(g => g.id === GlobalSlot.Header);
|
|
17868
|
+
if (header) {
|
|
17869
|
+
const kids = header.children ?? (header.children = []);
|
|
17870
|
+
const bag = SHOP_RECIPES[ShopRecipe.CartButton](recipeFactory(SHOP_CART_BUTTON_ID, CART_BUTTON_KEY));
|
|
17871
|
+
const menu = kids.findIndex(k => k.role === NavRole.MenuButton);
|
|
17872
|
+
kids.splice(menu >= 0 ? menu : kids.length, 0, bag);
|
|
17873
|
+
const brand = kids.find(k => k.role === NavRole.Brand);
|
|
17874
|
+
if (brand)
|
|
17875
|
+
setStyleProps(brand, { flexGrow: '1' });
|
|
17876
|
+
}
|
|
17877
|
+
const drawer = SHOP_RECIPES[ShopRecipe.CartDrawer](recipeFactory(SHOP_CART_DRAWER_ID, CART_DRAWER_KEY));
|
|
17878
|
+
drawer.isGlobal = true;
|
|
17879
|
+
drawer.globalPosition = PatternGlobalPosition.After;
|
|
17880
|
+
out.push(drawer);
|
|
17881
|
+
return out;
|
|
17882
|
+
}
|
|
17883
|
+
/** The plan's products as the build writes them — samples, published, each with no price (the owner's to set). */
|
|
17884
|
+
function composeShop(plan) {
|
|
17885
|
+
if (!planSells(plan) || !plan.shop)
|
|
17886
|
+
return null;
|
|
17887
|
+
return {
|
|
17888
|
+
categories: shopCategoriesOf(plan.shop.products).map(label => ({ label })),
|
|
17889
|
+
products: plan.shop.products.map(p => ({
|
|
17890
|
+
title: p.name.trim(), category: p.category.trim(), description: p.description.trim(),
|
|
17891
|
+
options: p.options.map(o => ({ name: o.name.trim(), values: o.values.map(v => v.trim()) })),
|
|
17892
|
+
productVariants: variantNamesOf(p.options).length > 0,
|
|
17893
|
+
variants: variantNamesOf(p.options.map(o => ({ values: o.values.map(v => v.trim()) }))).map(name => ({ name, enable: true })),
|
|
17894
|
+
pricing: { price: null, compareat: null }, isSample: true, isPublished: true,
|
|
17895
|
+
})),
|
|
17896
|
+
};
|
|
17897
|
+
}
|
|
17029
17898
|
function recipeFactory(id, rootKey) {
|
|
17030
17899
|
return spec => create(spec.key === rootKey ? id : `${id}-${spec.key}`, spec.type, { ...(spec.props ?? {}) }, spec.elementStyle ?? null);
|
|
17031
17900
|
}
|
|
@@ -17167,6 +18036,14 @@ function composeDataSource(ds) {
|
|
|
17167
18036
|
cms['filterByRouteParam'] = { ...ds.filterByRouteParam };
|
|
17168
18037
|
return { id, alias: ds.alias, type: PlanDataSourceType.Cms, mode: ds.mode, request: { cms } };
|
|
17169
18038
|
}
|
|
18039
|
+
if (ds.type === PlanDataSourceType.Shop) {
|
|
18040
|
+
const shop = { contentType: ds.resource };
|
|
18041
|
+
if (ds.limit !== undefined)
|
|
18042
|
+
shop['limit'] = ds.limit;
|
|
18043
|
+
if (ds.filterByRouteParam)
|
|
18044
|
+
shop['filterByRouteParam'] = { ...ds.filterByRouteParam };
|
|
18045
|
+
return { id, alias: ds.alias, type: PlanDataSourceType.Shop, mode: ds.mode, request: { shop } };
|
|
18046
|
+
}
|
|
17170
18047
|
const pick = ds.op === RelativeOp.SiblingsNext ? 'next' : 'prev';
|
|
17171
18048
|
return {
|
|
17172
18049
|
id, alias: ds.alias, type: PlanDataSourceType.Relative, mode: PlanDataSourceMode.Single,
|
|
@@ -17342,6 +18219,8 @@ function composeSite(plan, context) {
|
|
|
17342
18219
|
if (header && root)
|
|
17343
18220
|
setHeaderBehaviour(root, header.behaviour, header.edge ?? null);
|
|
17344
18221
|
}
|
|
18222
|
+
if (planSells(plan))
|
|
18223
|
+
globals = withStore(globals);
|
|
17345
18224
|
return {
|
|
17346
18225
|
source: clone$1(plan.source),
|
|
17347
18226
|
business: clone$1(plan.business),
|
|
@@ -17354,6 +18233,7 @@ function composeSite(plan, context) {
|
|
|
17354
18233
|
routes: plan.pages.map(p => ({ key: p.key, path: p.route, isHome: p.isHome === true })),
|
|
17355
18234
|
placeholders,
|
|
17356
18235
|
issues,
|
|
18236
|
+
shop: composeShop(plan),
|
|
17357
18237
|
};
|
|
17358
18238
|
}
|
|
17359
18239
|
// ── The site header on its own (CC1.1) ──────────────────────────────────────────────────────────
|
|
@@ -17495,6 +18375,89 @@ function describePlanData(plan) {
|
|
|
17495
18375
|
return plan.pages.map(page => ({ pageKey: page.key, lines: pageLines(page, plan, label) }));
|
|
17496
18376
|
}
|
|
17497
18377
|
|
|
18378
|
+
/**
|
|
18379
|
+
* What a plan reads but no model is asked to write (vectoriox/iox-cms#49): the data sources that follow from the pages
|
|
18380
|
+
* alone. A per-item page whose sections read the NEXT item (`project.next`) needs a `$siblings.next` source of its route
|
|
18381
|
+
* source — a fact of the pages, while data sources are the plan's STRUCTURE, asked first and fixed once accepted. Asking
|
|
18382
|
+
* the structure for it made the pages' answer unfixable by construction (a re-ask of the pages cannot add a source), so
|
|
18383
|
+
* it is derived, the same way for the plan wire's expansion (`expandPlanWire`) and for a sentence's page edits
|
|
18384
|
+
* (`applyPlanEdits`). Pure and idempotent: a plan that already holds the source gains nothing; a source is derived only
|
|
18385
|
+
* where it is valid by construction (its subject a single cms source of a type of the plan), so it never adds an issue
|
|
18386
|
+
* at a structure path. Its siblings are walked within an unlimited list of the same type — the structure's first, else a
|
|
18387
|
+
* derived one.
|
|
18388
|
+
*/
|
|
18389
|
+
const NEXT_SUFFIX = 'Next';
|
|
18390
|
+
const LIST_SUFFIX = 'All';
|
|
18391
|
+
/** The sources by alias, as the validator reads them (the first of an alias wins). */
|
|
18392
|
+
function sourceViews(list) {
|
|
18393
|
+
const views = new Map();
|
|
18394
|
+
for (const raw of list) {
|
|
18395
|
+
if (isPlainObject(raw) && isNonEmptyString(raw['alias']) && !views.has(raw['alias']))
|
|
18396
|
+
views.set(raw['alias'], raw);
|
|
18397
|
+
}
|
|
18398
|
+
return views;
|
|
18399
|
+
}
|
|
18400
|
+
const readsNext = (page) => Array.isArray(page['sections']) && page['sections'].some(s => {
|
|
18401
|
+
const pattern = isPlainObject(s) && typeof s['pattern'] === 'string' ? patternById(s['pattern']) : undefined;
|
|
18402
|
+
return !!pattern && patternScopes(pattern).has(BindScope.Next);
|
|
18403
|
+
});
|
|
18404
|
+
/** The alias itself, else the first of `<alias>2`, `<alias>3`… no source has. */
|
|
18405
|
+
function freeAlias(base, taken) {
|
|
18406
|
+
let alias = base;
|
|
18407
|
+
for (let n = 2; taken.has(alias); n++)
|
|
18408
|
+
alias = `${base}${n}`;
|
|
18409
|
+
return alias;
|
|
18410
|
+
}
|
|
18411
|
+
/** The unlimited list of `contentType` the plan holds (its first), or null. */
|
|
18412
|
+
function fullListOf(views, contentType) {
|
|
18413
|
+
for (const [alias, s] of views) {
|
|
18414
|
+
if (s.type === PlanDataSourceType.Cms && s.mode === PlanDataSourceMode.Query && s.contentType === contentType && s.limit === undefined)
|
|
18415
|
+
return alias;
|
|
18416
|
+
}
|
|
18417
|
+
return null;
|
|
18418
|
+
}
|
|
18419
|
+
/**
|
|
18420
|
+
* The data sources `plan` lacks and its pages need, in page order (appended after the plan's own). Tolerates any
|
|
18421
|
+
* value: what is not a well-formed plan gains nothing, for the validator to judge as written.
|
|
18422
|
+
*/
|
|
18423
|
+
function derivedDataSources(plan) {
|
|
18424
|
+
if (!isPlainObject(plan) || !Array.isArray(plan['dataSources']) || !Array.isArray(plan['pages']) || !Array.isArray(plan['contentTypes']))
|
|
18425
|
+
return [];
|
|
18426
|
+
const types = new Set(plan['contentTypes'].map(t => (isPlainObject(t) ? t['name'] : undefined)).filter(isNonEmptyString));
|
|
18427
|
+
const views = sourceViews(plan['dataSources']);
|
|
18428
|
+
const derived = [];
|
|
18429
|
+
const add = (source) => { derived.push(source); views.set(source.alias, source); };
|
|
18430
|
+
for (const page of plan['pages']) {
|
|
18431
|
+
if (!isPlainObject(page) || !isNonEmptyString(page['routeSource']) || !readsNext(page))
|
|
18432
|
+
continue;
|
|
18433
|
+
const subject = page['routeSource'];
|
|
18434
|
+
const route = views.get(subject);
|
|
18435
|
+
if (!route || route.type !== PlanDataSourceType.Cms || route.mode !== PlanDataSourceMode.Single)
|
|
18436
|
+
continue;
|
|
18437
|
+
if (!isNonEmptyString(route.contentType) || !types.has(route.contentType) || nextSourceOf(views, subject))
|
|
18438
|
+
continue;
|
|
18439
|
+
let within = fullListOf(views, route.contentType);
|
|
18440
|
+
if (!within) {
|
|
18441
|
+
within = freeAlias(`${subject}${LIST_SUFFIX}`, views);
|
|
18442
|
+
add({ alias: within, type: PlanDataSourceType.Cms, mode: PlanDataSourceMode.Query, contentType: route.contentType });
|
|
18443
|
+
}
|
|
18444
|
+
add({ alias: freeAlias(`${subject}${NEXT_SUFFIX}`, views), type: PlanDataSourceType.Relative, of: subject, op: RelativeOp.SiblingsNext, within });
|
|
18445
|
+
}
|
|
18446
|
+
return derived;
|
|
18447
|
+
}
|
|
18448
|
+
/**
|
|
18449
|
+
* `plan` with the data sources that follow from it appended: a selling plan's shop sources (`derivedShopSources`, commerce
|
|
18450
|
+
* C-D21), then those its pages need (`derivedDataSources`). The same object when it lacks none.
|
|
18451
|
+
*/
|
|
18452
|
+
function withDerivedSources(plan) {
|
|
18453
|
+
const shop = derivedShopSources(plan);
|
|
18454
|
+
const withShop = shop.length ? { ...plan, dataSources: [...plan['dataSources'], ...shop] } : plan;
|
|
18455
|
+
const derived = derivedDataSources(withShop);
|
|
18456
|
+
if (!derived.length)
|
|
18457
|
+
return withShop;
|
|
18458
|
+
return { ...withShop, dataSources: [...withShop['dataSources'], ...derived] };
|
|
18459
|
+
}
|
|
18460
|
+
|
|
17498
18461
|
/** SC6b: a film's description for the showcase — as many pictures as the build prepares; nothing is fetched to compose it. */
|
|
17499
18462
|
const SHOWCASE_FILM = {
|
|
17500
18463
|
base: 'https://showcase.iox.invalid/film', ext: FrameExtension.Webp,
|
|
@@ -17519,7 +18482,7 @@ function showcasePages() {
|
|
|
17519
18482
|
const byFamily = new Map();
|
|
17520
18483
|
const onItemPage = [];
|
|
17521
18484
|
for (const [id, p] of Object.entries(SITE_PATTERNS)) {
|
|
17522
|
-
if (p.global || p.scene)
|
|
18485
|
+
if (p.global || p.scene || p.shop)
|
|
17523
18486
|
continue;
|
|
17524
18487
|
if (readsRouteItem(id)) {
|
|
17525
18488
|
onItemPage.push(id);
|
|
@@ -17548,10 +18511,29 @@ function showcaseGlobals() {
|
|
|
17548
18511
|
function showcaseScenes() {
|
|
17549
18512
|
return Object.entries(SITE_PATTERNS).filter(([, p]) => p.scene && !p.global).map(([id]) => id);
|
|
17550
18513
|
}
|
|
18514
|
+
/** Commerce G1: what the showcase's store sells — three samples in two categories, one with options; never a price. */
|
|
18515
|
+
const SHOWCASE_PRODUCTS = [
|
|
18516
|
+
{ name: 'Tall speckled vase', category: 'Vases', description: 'Thrown by hand, glazed in two tones.', options: [{ name: 'Glaze', values: ['Sand', 'Charcoal'] }, { name: 'Size', values: ['24 cm', '32 cm'] }] },
|
|
18517
|
+
{ name: 'Low serving bowl', category: 'Tableware', description: 'Wide and shallow, for the middle of the table.', options: [] },
|
|
18518
|
+
{ name: 'Bud vase', category: 'Vases', description: 'One stem, one shelf.', options: [] },
|
|
18519
|
+
];
|
|
18520
|
+
const SHOWCASE_SHOP = { categories: shopCategoriesOf(SHOWCASE_PRODUCTS), products: SHOWCASE_PRODUCTS };
|
|
18521
|
+
/** The store patterns (`shop`), each on the page a store shows it on: a list on the shop page, one product on its own. */
|
|
18522
|
+
function showcaseStorePages(sources) {
|
|
18523
|
+
const store = Object.entries(SITE_PATTERNS).filter(([, p]) => p.shop && !p.global);
|
|
18524
|
+
const list = store.filter(([id]) => !readsRouteItem(id)).map(([id]) => ({ pattern: id, binding: sources[ShopSourceRole.List] }));
|
|
18525
|
+
const item = store.filter(([id]) => readsRouteItem(id)).map(([id]) => ({ pattern: id }));
|
|
18526
|
+
return [
|
|
18527
|
+
{ key: 'home', name: 'Home', route: '/', isHome: true, inNav: false, sections: [] },
|
|
18528
|
+
{ key: 'shop', name: 'Shop', route: '/shop', inNav: true, sections: list },
|
|
18529
|
+
{ key: 'product', name: 'Product', route: '/shop/:slug', inNav: false, template: ShopResource.Products, routeSource: sources[ShopSourceRole.Item], sections: item },
|
|
18530
|
+
];
|
|
18531
|
+
}
|
|
17551
18532
|
/**
|
|
17552
18533
|
* The showcase as Site Plans — as many as it takes for every header and every footer to be composed once, then one per
|
|
17553
18534
|
* Scene pattern (SC6): its home page holds that Scene and nothing else, at How animated Expressive, the only level a
|
|
17554
|
-
* Scene is composed at; the film's Scene with a film (SC6b)
|
|
18535
|
+
* Scene is composed at; the film's Scene with a film (SC6b); then the store (commerce G1): the store patterns over the
|
|
18536
|
+
* shop's derived sources, with the bag in the header and the cart drawer.
|
|
17555
18537
|
*/
|
|
17556
18538
|
function showcasePlans(input) {
|
|
17557
18539
|
const { headers, footers } = showcaseGlobals();
|
|
@@ -17573,7 +18555,9 @@ function showcasePlans(input) {
|
|
|
17573
18555
|
// A film's Scene plays a film (SC6b): the plan carries one, as the build's would.
|
|
17574
18556
|
return SITE_PATTERNS[id].film ? { ...scene, film: { sequence: JSON.parse(JSON.stringify(input.film ?? SHOWCASE_FILM)) } } : scene;
|
|
17575
18557
|
});
|
|
17576
|
-
|
|
18558
|
+
const selling = withDerivedSources({ ...plan(0, [], input.design), shop: JSON.parse(JSON.stringify(SHOWCASE_SHOP)) });
|
|
18559
|
+
const store = { ...selling, pages: showcaseStorePages(shopSourceAliases(selling)) };
|
|
18560
|
+
return [...Array.from({ length: count }, (_, i) => plan(i, pages, input.design)), ...scenes, store];
|
|
17577
18561
|
}
|
|
17578
18562
|
|
|
17579
18563
|
/**
|
|
@@ -17605,12 +18589,19 @@ var BuildStep;
|
|
|
17605
18589
|
/** I2: the curated stock photos the plan's empty picture slots take, copied into the studio (never hot-linked). */
|
|
17606
18590
|
BuildStep["StockPhotos"] = "stock-photos";
|
|
17607
18591
|
BuildStep["Items"] = "items";
|
|
18592
|
+
/** Commerce G1: what the business sells, into the studio's SHOP — its categories, then sample products (no price). */
|
|
18593
|
+
BuildStep["Shop"] = "shop";
|
|
17608
18594
|
BuildStep["DataSources"] = "data-sources";
|
|
17609
18595
|
BuildStep["Pages"] = "pages";
|
|
17610
18596
|
BuildStep["Globals"] = "globals";
|
|
17611
18597
|
BuildStep["Look"] = "look";
|
|
17612
18598
|
})(BuildStep || (BuildStep = {}));
|
|
17613
18599
|
const BUILD_STEPS = Object.values(BuildStep);
|
|
18600
|
+
/** The steps a build of `plan` takes, in order: every one, the shop's only when the plan sells (commerce G1). */
|
|
18601
|
+
function buildStepsOf(plan) {
|
|
18602
|
+
const sells = planSells(plan);
|
|
18603
|
+
return BUILD_STEPS.filter(step => step !== BuildStep.Shop || sells);
|
|
18604
|
+
}
|
|
17614
18605
|
var StepState;
|
|
17615
18606
|
(function (StepState) {
|
|
17616
18607
|
StepState["Wait"] = "wait";
|
|
@@ -17628,6 +18619,10 @@ var CreatedKind;
|
|
|
17628
18619
|
/** A stock photo copied into the studio's storage (`media/stock/…`), with its assets row. */
|
|
17629
18620
|
CreatedKind["StockPhoto"] = "stock-photo";
|
|
17630
18621
|
CreatedKind["Item"] = "item";
|
|
18622
|
+
/** Commerce G1: a shop category the build added (one the studio had is reused, never recorded). */
|
|
18623
|
+
CreatedKind["ShopCategory"] = "shop-category";
|
|
18624
|
+
/** Commerce G1: a sample product, written through the shop's own write path. */
|
|
18625
|
+
CreatedKind["ShopProduct"] = "shop-product";
|
|
17631
18626
|
CreatedKind["DataSource"] = "data-source";
|
|
17632
18627
|
CreatedKind["Page"] = "page";
|
|
17633
18628
|
CreatedKind["Global"] = "global";
|
|
@@ -17656,6 +18651,11 @@ var BuildNoticeCode;
|
|
|
17656
18651
|
/** M7: a picture made for the site was refused by its review twice (or its second try did not fit the cost shown):
|
|
17657
18652
|
* stock or the empty box stands in, and the run says so. */
|
|
17658
18653
|
BuildNoticeCode["PictureFallback"] = "picture-fallback";
|
|
18654
|
+
/** Commerce G1 (shop-aware A-D9): the studio already sells products — the site shows them, and no sample is added. */
|
|
18655
|
+
BuildNoticeCode["ShopHasProducts"] = "shop-has-products";
|
|
18656
|
+
/** Commerce G1: the studio had never set its currency and VAT — the build stored the ones its language implies
|
|
18657
|
+
* (Hebrew: ILS and 18%), said here so the owner checks them in Settings ▸ General before setting prices. */
|
|
18658
|
+
BuildNoticeCode["ShopMoneyInferred"] = "shop-money-inferred";
|
|
17659
18659
|
})(BuildNoticeCode || (BuildNoticeCode = {}));
|
|
17660
18660
|
var PreflightRefusalCode;
|
|
17661
18661
|
(function (PreflightRefusalCode) {
|
|
@@ -17686,6 +18686,8 @@ const buildKeys = {
|
|
|
17686
18686
|
contentType: (name) => `schema:${name}`,
|
|
17687
18687
|
contentTypeFields: (name) => `schema-fields:${name}`,
|
|
17688
18688
|
item: (contentType, n) => `item:${contentType}:${n}`,
|
|
18689
|
+
shopCategory: (n) => `shop-category:${n}`,
|
|
18690
|
+
shopProduct: (n) => `shop-product:${n}`,
|
|
17689
18691
|
sampleImage: (n) => `sample-image:${n}`,
|
|
17690
18692
|
stockPhoto: (libraryKey) => `stock-photo:${libraryKey}`,
|
|
17691
18693
|
dataSource: (alias) => `data-source:${alias}`,
|
|
@@ -17729,6 +18731,8 @@ function buildStepFacts(plan, actions = {}) {
|
|
|
17729
18731
|
contentTypes: plan.contentTypes.map(t => t.label),
|
|
17730
18732
|
contentTypeActions,
|
|
17731
18733
|
items: plan.contentTypes.reduce((n, t) => n + (t.seed?.count ?? 0), 0),
|
|
18734
|
+
products: plan.shop?.products.length ?? 0,
|
|
18735
|
+
categories: plan.shop?.categories.length ?? 0,
|
|
17732
18736
|
pages: plan.pages.length,
|
|
17733
18737
|
routes: plan.pages.map(p => p.route),
|
|
17734
18738
|
navLinks: plan.pages.filter(p => p.inNav).length,
|
|
@@ -17736,85 +18740,6 @@ function buildStepFacts(plan, actions = {}) {
|
|
|
17736
18740
|
};
|
|
17737
18741
|
}
|
|
17738
18742
|
|
|
17739
|
-
/**
|
|
17740
|
-
* What a plan reads but no model is asked to write (vectoriox/iox-cms#49): the data sources that follow from the pages
|
|
17741
|
-
* alone. A per-item page whose sections read the NEXT item (`project.next`) needs a `$siblings.next` source of its route
|
|
17742
|
-
* source — a fact of the pages, while data sources are the plan's STRUCTURE, asked first and fixed once accepted. Asking
|
|
17743
|
-
* the structure for it made the pages' answer unfixable by construction (a re-ask of the pages cannot add a source), so
|
|
17744
|
-
* it is derived, the same way for the plan wire's expansion (`expandPlanWire`) and for a sentence's page edits
|
|
17745
|
-
* (`applyPlanEdits`). Pure and idempotent: a plan that already holds the source gains nothing; a source is derived only
|
|
17746
|
-
* where it is valid by construction (its subject a single cms source of a type of the plan), so it never adds an issue
|
|
17747
|
-
* at a structure path. Its siblings are walked within an unlimited list of the same type — the structure's first, else a
|
|
17748
|
-
* derived one.
|
|
17749
|
-
*/
|
|
17750
|
-
const NEXT_SUFFIX = 'Next';
|
|
17751
|
-
const LIST_SUFFIX = 'All';
|
|
17752
|
-
/** The sources by alias, as the validator reads them (the first of an alias wins). */
|
|
17753
|
-
function sourceViews(list) {
|
|
17754
|
-
const views = new Map();
|
|
17755
|
-
for (const raw of list) {
|
|
17756
|
-
if (isPlainObject(raw) && isNonEmptyString(raw['alias']) && !views.has(raw['alias']))
|
|
17757
|
-
views.set(raw['alias'], raw);
|
|
17758
|
-
}
|
|
17759
|
-
return views;
|
|
17760
|
-
}
|
|
17761
|
-
const readsNext = (page) => Array.isArray(page['sections']) && page['sections'].some(s => {
|
|
17762
|
-
const pattern = isPlainObject(s) && typeof s['pattern'] === 'string' ? patternById(s['pattern']) : undefined;
|
|
17763
|
-
return !!pattern && patternScopes(pattern).has(BindScope.Next);
|
|
17764
|
-
});
|
|
17765
|
-
/** The alias itself, else the first of `<alias>2`, `<alias>3`… no source has. */
|
|
17766
|
-
function freeAlias(base, taken) {
|
|
17767
|
-
let alias = base;
|
|
17768
|
-
for (let n = 2; taken.has(alias); n++)
|
|
17769
|
-
alias = `${base}${n}`;
|
|
17770
|
-
return alias;
|
|
17771
|
-
}
|
|
17772
|
-
/** The unlimited list of `contentType` the plan holds (its first), or null. */
|
|
17773
|
-
function fullListOf(views, contentType) {
|
|
17774
|
-
for (const [alias, s] of views) {
|
|
17775
|
-
if (s.type === PlanDataSourceType.Cms && s.mode === PlanDataSourceMode.Query && s.contentType === contentType && s.limit === undefined)
|
|
17776
|
-
return alias;
|
|
17777
|
-
}
|
|
17778
|
-
return null;
|
|
17779
|
-
}
|
|
17780
|
-
/**
|
|
17781
|
-
* The data sources `plan` lacks and its pages need, in page order (appended after the plan's own). Tolerates any
|
|
17782
|
-
* value: what is not a well-formed plan gains nothing, for the validator to judge as written.
|
|
17783
|
-
*/
|
|
17784
|
-
function derivedDataSources(plan) {
|
|
17785
|
-
if (!isPlainObject(plan) || !Array.isArray(plan['dataSources']) || !Array.isArray(plan['pages']) || !Array.isArray(plan['contentTypes']))
|
|
17786
|
-
return [];
|
|
17787
|
-
const types = new Set(plan['contentTypes'].map(t => (isPlainObject(t) ? t['name'] : undefined)).filter(isNonEmptyString));
|
|
17788
|
-
const views = sourceViews(plan['dataSources']);
|
|
17789
|
-
const derived = [];
|
|
17790
|
-
const add = (source) => { derived.push(source); views.set(source.alias, source); };
|
|
17791
|
-
for (const page of plan['pages']) {
|
|
17792
|
-
if (!isPlainObject(page) || !isNonEmptyString(page['routeSource']) || !readsNext(page))
|
|
17793
|
-
continue;
|
|
17794
|
-
const subject = page['routeSource'];
|
|
17795
|
-
const route = views.get(subject);
|
|
17796
|
-
if (!route || route.type !== PlanDataSourceType.Cms || route.mode !== PlanDataSourceMode.Single)
|
|
17797
|
-
continue;
|
|
17798
|
-
if (!isNonEmptyString(route.contentType) || !types.has(route.contentType) || nextSourceOf(views, subject))
|
|
17799
|
-
continue;
|
|
17800
|
-
let within = fullListOf(views, route.contentType);
|
|
17801
|
-
if (!within) {
|
|
17802
|
-
within = freeAlias(`${subject}${LIST_SUFFIX}`, views);
|
|
17803
|
-
add({ alias: within, type: PlanDataSourceType.Cms, mode: PlanDataSourceMode.Query, contentType: route.contentType });
|
|
17804
|
-
}
|
|
17805
|
-
add({ alias: freeAlias(`${subject}${NEXT_SUFFIX}`, views), type: PlanDataSourceType.Relative, of: subject, op: RelativeOp.SiblingsNext, within });
|
|
17806
|
-
}
|
|
17807
|
-
return derived;
|
|
17808
|
-
}
|
|
17809
|
-
/** `plan` with the data sources its pages need appended (`derivedDataSources`); the same object when it lacks none. */
|
|
17810
|
-
function withDerivedSources(plan) {
|
|
17811
|
-
const derived = derivedDataSources(plan);
|
|
17812
|
-
if (!derived.length)
|
|
17813
|
-
return plan;
|
|
17814
|
-
const own = plan;
|
|
17815
|
-
return { ...own, dataSources: [...own['dataSources'], ...derived] };
|
|
17816
|
-
}
|
|
17817
|
-
|
|
17818
18743
|
/**
|
|
17819
18744
|
* The plan WIRE (AI plan M1-3, vectoriox/iox-cms#45, #47): what a model writes when it plans a site — a compact format
|
|
17820
18745
|
* inside the Claude API's structured-output limits (≤ 24 optional parameters and ≤ 16 unions per request, and a compiled
|
|
@@ -17873,6 +18798,9 @@ var PlanWireEntry;
|
|
|
17873
18798
|
PlanWireEntry["SlotLink"] = "slotLink";
|
|
17874
18799
|
PlanWireEntry["Globals"] = "globals";
|
|
17875
18800
|
PlanWireEntry["Direction"] = "direction";
|
|
18801
|
+
/** Commerce C-D21: one product the business sells, by name. */
|
|
18802
|
+
PlanWireEntry["ShopProduct"] = "shopProduct";
|
|
18803
|
+
PlanWireEntry["ShopOption"] = "shopOption";
|
|
17876
18804
|
})(PlanWireEntry || (PlanWireEntry = {}));
|
|
17877
18805
|
const PLAN_SHAPE = SPEC_SITE_PLAN_SHAPE;
|
|
17878
18806
|
const key = (ref, none) => ({ refs: [ref], ...(none !== undefined ? { none } : {}) });
|
|
@@ -17884,7 +18812,11 @@ const WIRE_KEYS = {
|
|
|
17884
18812
|
plan: {
|
|
17885
18813
|
business: inPart(PlanPart.Structure, key('plan.business')),
|
|
17886
18814
|
contentTypes: inPart(PlanPart.Structure, key('plan.contentTypes')),
|
|
17887
|
-
dataSources: inPart(PlanPart.Structure, { refs: ['plan.dataSources'], text: "dataSource[] — merged by alias into the org library; a per-item page's $siblings.next source (what a section reading the next item needs) is added for you" }),
|
|
18815
|
+
dataSources: inPart(PlanPart.Structure, { refs: ['plan.dataSources'], text: "dataSource[] — merged by alias into the org library; a per-item page's $siblings.next source (what a section reading the next item needs) is added for you, and so are the shop's sources when the business sells" }),
|
|
18816
|
+
shop: inPart(PlanPart.Structure, {
|
|
18817
|
+
refs: ['plan.shop', 'shop.products'],
|
|
18818
|
+
text: `shopProduct[] — what the business sells, when it sells (the need "products"): at most 6 sample products by name, each in a category — never a price, stock or a fee. [] = it sells nothing. Its categories, the shop's data sources (the products, the newest, one product by its :slug) and the store's parts are added for you`,
|
|
18819
|
+
}),
|
|
17888
18820
|
pages: inPart(PlanPart.Pages, key('plan.pages')),
|
|
17889
18821
|
globals: inPart(PlanPart.Pages, key('plan.globals')),
|
|
17890
18822
|
direction: inPart(PlanPart.Pages, key('plan.direction')),
|
|
@@ -17928,13 +18860,13 @@ const WIRE_KEYS = {
|
|
|
17928
18860
|
each: { refs: ['seed.perItem'], text: 'string[] — one value per sample, in order, when each sample has its own content', none: '[]' },
|
|
17929
18861
|
},
|
|
17930
18862
|
dataSource: {
|
|
17931
|
-
alias: { refs: ['cmsDataSource.alias', 'relativeDataSource.alias'] },
|
|
17932
|
-
type: { refs: ['cmsDataSource.type', 'relativeDataSource.type'], text: "'cms' | 'relative' — which of the keys below are read" },
|
|
17933
|
-
mode:
|
|
17934
|
-
contentType:
|
|
17935
|
-
limit:
|
|
17936
|
-
filterField: { refs: ['cmsDataSource.filterByRouteParam'], text: "string — single only: the field that holds the route param's value (e.g. slug)", none: "''" },
|
|
17937
|
-
routeParam: { refs: ['cmsDataSource.filterByRouteParam'], text: 'string — single only: the route param that picks the item (the :param of its page route)', none: "''" },
|
|
18863
|
+
alias: { refs: ['cmsDataSource.alias', 'relativeDataSource.alias', 'shopDataSource.alias'] },
|
|
18864
|
+
type: { refs: ['cmsDataSource.type', 'relativeDataSource.type', 'shopDataSource.type'], text: "'cms' | 'relative' | 'shop' — which of the keys below are read ('shop' sources are added for you)" },
|
|
18865
|
+
mode: { refs: ['cmsDataSource.mode', 'shopDataSource.mode'], none: "'' (relative)" },
|
|
18866
|
+
contentType: { refs: ['cmsDataSource.contentType', 'shopDataSource.resource'], text: "string — a content type of the plan (cms); the shop's list, 'products' or 'categories' (shop)", none: "'' (relative)" },
|
|
18867
|
+
limit: { refs: ['cmsDataSource.limit', 'shopDataSource.limit'], none: '0 (all, or relative)' },
|
|
18868
|
+
filterField: { refs: ['cmsDataSource.filterByRouteParam', 'shopDataSource.filterByRouteParam'], text: "string — single only: the field that holds the route param's value (e.g. slug)", none: "''" },
|
|
18869
|
+
routeParam: { refs: ['cmsDataSource.filterByRouteParam', 'shopDataSource.filterByRouteParam'], text: 'string — single only: the route param that picks the item (the :param of its page route)', none: "''" },
|
|
17938
18870
|
of: key('relativeDataSource.of', "'' (cms)"),
|
|
17939
18871
|
op: key('relativeDataSource.op', "'' (cms)"),
|
|
17940
18872
|
within: key('relativeDataSource.within', "'' (cms)"),
|
|
@@ -17977,6 +18909,16 @@ const WIRE_KEYS = {
|
|
|
17977
18909
|
header: key('globals.header'),
|
|
17978
18910
|
footer: key('globals.footer'),
|
|
17979
18911
|
},
|
|
18912
|
+
shopProduct: {
|
|
18913
|
+
name: key('shopProduct.name'),
|
|
18914
|
+
category: key('shopProduct.category'),
|
|
18915
|
+
description: key('shopProduct.description'),
|
|
18916
|
+
options: key('shopProduct.options'),
|
|
18917
|
+
},
|
|
18918
|
+
shopOption: {
|
|
18919
|
+
name: key('shopOption.name'),
|
|
18920
|
+
values: key('shopOption.values'),
|
|
18921
|
+
},
|
|
17980
18922
|
};
|
|
17981
18923
|
/** The plan keys the model does not write, and where the expander takes each from. */
|
|
17982
18924
|
const PLAN_WIRE_DERIVED = {
|
|
@@ -17996,6 +18938,7 @@ const PLAN_WIRE_DERIVED = {
|
|
|
17996
18938
|
'plan.artDirection': 'the generation, from the business type and the look (M7 — artDirectionFor)',
|
|
17997
18939
|
artDirection: 'the generation, from the business type and the look (M7 — artDirectionFor)',
|
|
17998
18940
|
'page.layout': 'the layout step: one request per composed page, after the pages (M8 gate 2)',
|
|
18941
|
+
'shop.categories': "the products' own categories, in order (shopCategoriesOf)",
|
|
17999
18942
|
layoutPage: 'the layout step: one request per composed page, after the pages (M8 gate 2)',
|
|
18000
18943
|
};
|
|
18001
18944
|
const wireText = (spec) => {
|
|
@@ -18122,7 +19065,15 @@ const PLAN_TOP_SCHEMAS = {
|
|
|
18122
19065
|
[GlobalSlot.Footer]: jsonOneOf(globalIds(PatternGlobalPosition.After)),
|
|
18123
19066
|
}),
|
|
18124
19067
|
direction: () => shaped(PlanWireEntry.Direction, { idea: jsonText(), cliche: jsonText(), flip: jsonText(), rules: jsonListOf(jsonText()) }),
|
|
19068
|
+
shop: () => jsonListOf(wireShopProductJsonSchema()),
|
|
18125
19069
|
};
|
|
19070
|
+
/** Commerce C-D21: one product the business sells, as the structure writes it — never a price, stock or a fee. */
|
|
19071
|
+
function wireShopProductJsonSchema() {
|
|
19072
|
+
return shaped(PlanWireEntry.ShopProduct, {
|
|
19073
|
+
name: jsonText(), category: jsonText(), description: jsonText(),
|
|
19074
|
+
options: jsonListOf(shaped(PlanWireEntry.ShopOption, { name: jsonText(), values: jsonListOf(jsonText()) })),
|
|
19075
|
+
});
|
|
19076
|
+
}
|
|
18126
19077
|
/** The plan's top-level shape for one part (its keys only) — what that part's request shows and is built from. */
|
|
18127
19078
|
function planWirePartShape(part) {
|
|
18128
19079
|
return Object.fromEntries(Object.entries(PLAN_WIRE_SHAPE.plan).filter(([k]) => PLAN_PART_KEYS[part].includes(k)));
|
|
@@ -18199,8 +19150,21 @@ function expandWireDataSource(wire) {
|
|
|
18199
19150
|
}
|
|
18200
19151
|
if (type === PlanDataSourceType.Relative)
|
|
18201
19152
|
return { ...rest, alias, type, of, op, within };
|
|
19153
|
+
if (type === PlanDataSourceType.Shop) {
|
|
19154
|
+
const filter = isNone(filterField) && isNone(routeParam) ? {} : { filterByRouteParam: { field: filterField, routeParam } };
|
|
19155
|
+
return { ...rest, alias, type, mode, resource: contentType, ...optional('limit', limit, v => v === undefined || v === 0), ...filter };
|
|
19156
|
+
}
|
|
18202
19157
|
return wire;
|
|
18203
19158
|
}
|
|
19159
|
+
/** The structure's products → the plan's `shop`: the products as written, their categories derived; `[]` = it sells nothing. */
|
|
19160
|
+
function expandWireShop(wire) {
|
|
19161
|
+
if (!Array.isArray(wire))
|
|
19162
|
+
return wire;
|
|
19163
|
+
if (!wire.length)
|
|
19164
|
+
return undefined;
|
|
19165
|
+
const products = wire.filter(isPlainObject);
|
|
19166
|
+
return { categories: products.length === wire.length ? shopCategoriesOf(products) : [], products: wire };
|
|
19167
|
+
}
|
|
18204
19168
|
function expandWireSection(wire) {
|
|
18205
19169
|
if (!isPlainObject(wire))
|
|
18206
19170
|
return wire;
|
|
@@ -18251,9 +19215,11 @@ function expandPlanWire(parts, context) {
|
|
|
18251
19215
|
if (odd !== undefined)
|
|
18252
19216
|
return odd;
|
|
18253
19217
|
const wire = Object.assign({}, ...written);
|
|
18254
|
-
const { business, contentTypes, dataSources, pages, direction, ...rest } = wire;
|
|
19218
|
+
const { business, contentTypes, dataSources, pages, direction, shop, ...rest } = wire;
|
|
19219
|
+
const sells = expandWireShop(shop);
|
|
18255
19220
|
return withDerivedSources({
|
|
18256
19221
|
...rest,
|
|
19222
|
+
...(sells === undefined ? {} : { shop: sells }),
|
|
18257
19223
|
...(isPlainObject(direction) && direction['idea'] === NONE$1 ? {} : direction === undefined ? {} : { direction }),
|
|
18258
19224
|
version: SITE_PLAN_VERSION,
|
|
18259
19225
|
source: { ...context.source },
|
|
@@ -18282,6 +19248,12 @@ function dataSourceToWire(source) {
|
|
|
18282
19248
|
const blank = { alias: source.alias, type: source.type, mode: NONE$1, contentType: NONE$1, limit: 0, filterField: NONE$1, routeParam: NONE$1, of: NONE$1, op: NONE$1, within: NONE$1 };
|
|
18283
19249
|
if (source.type === PlanDataSourceType.Relative)
|
|
18284
19250
|
return { ...blank, of: source.of, op: source.op, within: source.within };
|
|
19251
|
+
if (source.type === PlanDataSourceType.Shop) {
|
|
19252
|
+
return {
|
|
19253
|
+
...blank, mode: source.mode, contentType: source.resource, limit: source.limit ?? 0,
|
|
19254
|
+
filterField: source.filterByRouteParam?.field ?? NONE$1, routeParam: source.filterByRouteParam?.routeParam ?? NONE$1,
|
|
19255
|
+
};
|
|
19256
|
+
}
|
|
18285
19257
|
return {
|
|
18286
19258
|
...blank, mode: source.mode, contentType: source.contentType, limit: source.limit ?? 0,
|
|
18287
19259
|
filterField: source.filterByRouteParam?.field ?? NONE$1, routeParam: source.filterByRouteParam?.routeParam ?? NONE$1,
|
|
@@ -18309,6 +19281,7 @@ const PLAN_TO_WIRE = {
|
|
|
18309
19281
|
pages: plan => plan.pages.map(page => pageToWire(page)),
|
|
18310
19282
|
globals: plan => ({ ...plan.globals }),
|
|
18311
19283
|
direction: plan => ({ idea: plan.direction?.idea ?? NONE$1, cliche: plan.direction?.cliche ?? NONE$1, flip: plan.direction?.flip ?? NONE$1, rules: [...(plan.direction?.rules ?? [])] }),
|
|
19284
|
+
shop: plan => (plan.shop?.products ?? []).map(p => ({ name: p.name, category: p.category, description: p.description, options: p.options.map(o => ({ name: o.name, values: [...o.values] })) })),
|
|
18312
19285
|
};
|
|
18313
19286
|
/** One part of the plan on the wire: what that part's request would have answered. */
|
|
18314
19287
|
function planPartToWire(plan, part) {
|
|
@@ -18995,7 +19968,7 @@ const APPLY = {
|
|
|
18995
19968
|
if (at < 0 || !findSection(d, at, e.index, c, `${path}.index`))
|
|
18996
19969
|
return;
|
|
18997
19970
|
const source = d.dataSources.find(s => s.alias === e.binding);
|
|
18998
|
-
if (!source || source.type
|
|
19971
|
+
if (!source || source.type === PlanDataSourceType.Relative || source.mode !== PlanDataSourceMode.Query) {
|
|
18999
19972
|
return c.add(PlanEditIssueCode.UnknownDataSource, `${path}.binding`, `no list source "${String(e.binding)}" in the plan`);
|
|
19000
19973
|
}
|
|
19001
19974
|
setSections(d, at, d.pages[at].sections.map((s, i) => (i === e.index ? { ...s, binding: e.binding } : s)));
|
|
@@ -19023,7 +19996,7 @@ function recomposeAsks(edits) {
|
|
|
19023
19996
|
/**
|
|
19024
19997
|
* Apply a set of edits to a plan — all of them, or none (any issue refuses the set and returns the plan unchanged). The
|
|
19025
19998
|
* sources only removed pages and sections read are dropped with them; sources nothing read before are kept; the sources
|
|
19026
|
-
* the pages now need and no model writes are derived (`
|
|
19999
|
+
* the pages now need and no model writes are derived (`withDerivedSources` — a page edit adding `project.next`, as the
|
|
19027
20000
|
* plan wire's expansion does, vectoriox/iox-cms#49). The result still has to pass `validateSitePlan`.
|
|
19028
20001
|
*/
|
|
19029
20002
|
function applyPlanEdits(plan, edits) {
|
|
@@ -19039,15 +20012,16 @@ function applyPlanEdits(plan, edits) {
|
|
|
19039
20012
|
const before = withDependencies(aliasesOf(plan.pages), plan.dataSources);
|
|
19040
20013
|
const after = withDependencies(aliasesOf(draft.pages), draft.dataSources);
|
|
19041
20014
|
const added = new Set(changed.filter(ch => ch.kind === PlanChangeKind.DataSource).map(ch => ch.name));
|
|
19042
|
-
|
|
20015
|
+
// A shop source follows from what the business sells, never from which page reads it (commerce G1): it stays.
|
|
20016
|
+
const dataSources = draft.dataSources.filter(s => s.type === PlanDataSourceType.Shop || after.has(s.alias) || !before.has(s.alias) || added.has(s.alias));
|
|
19043
20017
|
for (const s of draft.dataSources)
|
|
19044
20018
|
if (!dataSources.includes(s))
|
|
19045
20019
|
changed.push({ kind: PlanChangeKind.DataSource, action: PlanChangeAction.Removed, name: s.alias });
|
|
19046
20020
|
const edited = { ...plan, pages: draft.pages, contentTypes: draft.contentTypes, dataSources };
|
|
19047
|
-
const
|
|
19048
|
-
for (const s of
|
|
20021
|
+
const whole = withDerivedSources(edited);
|
|
20022
|
+
for (const s of whole.dataSources.slice(dataSources.length))
|
|
19049
20023
|
changed.push({ kind: PlanChangeKind.DataSource, action: PlanChangeAction.Added, name: s.alias });
|
|
19050
|
-
return { plan:
|
|
20024
|
+
return { plan: whole, changed, issues: [] };
|
|
19051
20025
|
}
|
|
19052
20026
|
// ── The format a model writes edits in ─────────────────────────────────────────────────────────────────
|
|
19053
20027
|
/** Each part's answer format name. */
|
|
@@ -19258,111 +20232,6 @@ function planEditsFromWire(answer) {
|
|
|
19258
20232
|
return { ...answer, edits: answer['edits'].map(expandWireEdit) };
|
|
19259
20233
|
}
|
|
19260
20234
|
|
|
19261
|
-
/**
|
|
19262
|
-
* The plan stage's word checks (AI plan §3d / §3h, M1-3): every text a model WROTE into a plan — the tagline, page
|
|
19263
|
-
* names, section slots, content-type labels, sample values — scanned for the words the owner and their kind of
|
|
19264
|
-
* business must not use (`avoidWords`, the analysis's + the type's `words`), and for a fact the owner never gave
|
|
19265
|
-
* (an email, phone number, price or opening time that is not one of the owner's own facts). A finding is a refusal
|
|
19266
|
-
* with a path — the model rewrites; nothing here repairs a word. Pure.
|
|
19267
|
-
*/
|
|
19268
|
-
var PlanWordIssueCode;
|
|
19269
|
-
(function (PlanWordIssueCode) {
|
|
19270
|
-
/** A word the owner (or their kind of business) must not use. */
|
|
19271
|
-
PlanWordIssueCode["AvoidWord"] = "avoid-word";
|
|
19272
|
-
/** Something that looks like a fact — an email, phone, price or time — that is not one of the owner's facts. */
|
|
19273
|
-
PlanWordIssueCode["InventedFact"] = "invented-fact";
|
|
19274
|
-
/** `business.facts` holds a fact the owner did not give, or not in the owner's words. */
|
|
19275
|
-
PlanWordIssueCode["FactNotTheOwners"] = "fact-not-the-owners";
|
|
19276
|
-
})(PlanWordIssueCode || (PlanWordIssueCode = {}));
|
|
19277
|
-
/** Every text in a plan a model writes (never ids, routes, field names or pattern ids). */
|
|
19278
|
-
function writtenTexts(plan) {
|
|
19279
|
-
const out = [];
|
|
19280
|
-
const add = (path, text) => { if (typeof text === 'string' && text.trim())
|
|
19281
|
-
out.push({ path, text }); };
|
|
19282
|
-
add('business.tagline', plan.business?.tagline);
|
|
19283
|
-
plan.pages?.forEach((page, p) => {
|
|
19284
|
-
add(`pages[${p}].name`, page.name);
|
|
19285
|
-
page.sections?.forEach((section, s) => {
|
|
19286
|
-
for (const [slot, text] of Object.entries(section.slots ?? {}))
|
|
19287
|
-
add(`pages[${p}].sections[${s}].slots.${slot}`, text);
|
|
19288
|
-
});
|
|
19289
|
-
});
|
|
19290
|
-
plan.contentTypes?.forEach((type, t) => {
|
|
19291
|
-
add(`contentTypes[${t}].label`, type.label);
|
|
19292
|
-
const { perItem, ...seed } = type.seed ?? {};
|
|
19293
|
-
for (const [field, list] of Object.entries(perItem ?? {}))
|
|
19294
|
-
list.forEach((v, k) => add(`contentTypes[${t}].seed.perItem.${field}[${k}]`, v));
|
|
19295
|
-
for (const [field, value] of Object.entries(seed)) {
|
|
19296
|
-
const values = Array.isArray(value) ? value : [value];
|
|
19297
|
-
values.forEach((v, k) => add(`contentTypes[${t}].seed.${field}${Array.isArray(value) ? `[${k}]` : ''}`, v));
|
|
19298
|
-
}
|
|
19299
|
-
});
|
|
19300
|
-
return out;
|
|
19301
|
-
}
|
|
19302
|
-
const HEBREW = /[-]/;
|
|
19303
|
-
/** Hebrew joins up to two one-letter words (and, the, in, to, from, that, as) to the next: "והטוב" holds "טוב". The
|
|
19304
|
-
* ONE rule — the intake's keyword match (harness-core) uses it too. */
|
|
19305
|
-
const HEBREW_PREFIXES = '[והבלמשכ]{0,2}';
|
|
19306
|
-
const escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
19307
|
-
const normalise = (s) => s.normalize('NFKC').toLowerCase();
|
|
19308
|
-
/** A word (or phrase) as a whole-word pattern; Hebrew allows its one-letter prefixes. */
|
|
19309
|
-
function wordPattern(word) {
|
|
19310
|
-
const w = escape(normalise(word.trim())).replace(/\s+/g, '\\s+');
|
|
19311
|
-
const prefix = HEBREW.test(word) ? HEBREW_PREFIXES : '';
|
|
19312
|
-
return new RegExp(`(?<![\\p{L}\\p{N}])${prefix}${w}(?![\\p{L}\\p{N}])`, 'u');
|
|
19313
|
-
}
|
|
19314
|
-
/** What a fact looks like when a model writes one — each judged against the owner's facts. */
|
|
19315
|
-
const FACT_SHAPES = [
|
|
19316
|
-
{ kind: 'email', pattern: /[\p{L}\p{N}._%+-]+@[\p{L}\p{N}-]+(?:\.[\p{L}\p{N}-]+)+/gu, key: m => m.toLowerCase() },
|
|
19317
|
-
{ kind: 'phone', pattern: /\+?\d[\d\s().-]{6,}\d/g, key: m => m.replace(/\D/g, '') },
|
|
19318
|
-
{ kind: 'price', pattern: /(?:[$€£₪]\s?\d[\d,.]*|\d[\d,.]*\s?(?:[$€£₪]|ש"ח|NIS|USD|EUR|GBP))/gu, key: m => m.replace(/[^\d]/g, '') },
|
|
19319
|
-
{ kind: 'time', pattern: /(?<!\d)\d{1,2}[:.]\d{2}(?!\d)/g, key: m => m.replace(/\D/g, '') },
|
|
19320
|
-
];
|
|
19321
|
-
const MIN_PHONE_DIGITS = 8;
|
|
19322
|
-
/** "2019 – 2024" is two years, not a phone number. */
|
|
19323
|
-
const YEAR_RANGE = /^\s*\d{4}\s*[-–]\s*\d{4}\s*$/;
|
|
19324
|
-
function ownedKeys(facts) {
|
|
19325
|
-
const keys = new Set();
|
|
19326
|
-
for (const value of Object.values(facts)) {
|
|
19327
|
-
if (typeof value !== 'string')
|
|
19328
|
-
continue;
|
|
19329
|
-
for (const shape of FACT_SHAPES)
|
|
19330
|
-
for (const m of value.match(shape.pattern) ?? [])
|
|
19331
|
-
keys.add(`${shape.kind}:${shape.key(m)}`);
|
|
19332
|
-
}
|
|
19333
|
-
return keys;
|
|
19334
|
-
}
|
|
19335
|
-
/** The words to avoid and the facts never given, in every written text of the plan. */
|
|
19336
|
-
function planWordIssues(plan, ctx) {
|
|
19337
|
-
const issues = [];
|
|
19338
|
-
const avoid = [...new Set(ctx.avoidWords.map(w => w.trim()).filter(Boolean))].map(w => ({ word: w, pattern: wordPattern(w) }));
|
|
19339
|
-
const owned = ownedKeys(ctx.facts);
|
|
19340
|
-
for (const { path, text } of writtenTexts(plan)) {
|
|
19341
|
-
const words = normalise(text);
|
|
19342
|
-
for (const a of avoid)
|
|
19343
|
-
if (a.pattern.test(words))
|
|
19344
|
-
issues.push({ code: PlanWordIssueCode.AvoidWord, path, message: `uses "${a.word}" — a word this site must not use` });
|
|
19345
|
-
for (const shape of FACT_SHAPES) {
|
|
19346
|
-
for (const m of text.match(shape.pattern) ?? []) {
|
|
19347
|
-
const key = shape.key(m);
|
|
19348
|
-
if (shape.kind === 'phone' && (key.length < MIN_PHONE_DIGITS || YEAR_RANGE.test(m)))
|
|
19349
|
-
continue;
|
|
19350
|
-
if (!owned.has(`${shape.kind}:${key}`))
|
|
19351
|
-
issues.push({ code: PlanWordIssueCode.InventedFact, path, message: `"${m.trim()}" looks like a ${shape.kind} the owner never gave — leave it out` });
|
|
19352
|
-
}
|
|
19353
|
-
}
|
|
19354
|
-
}
|
|
19355
|
-
for (const [key, value] of Object.entries(plan.business?.facts ?? {})) {
|
|
19356
|
-
const own = ctx.facts[key];
|
|
19357
|
-
if (!FACT_KEYS.includes(key))
|
|
19358
|
-
continue;
|
|
19359
|
-
if (typeof own !== 'string' || normalise(own).trim() !== normalise(String(value)).trim()) {
|
|
19360
|
-
issues.push({ code: PlanWordIssueCode.FactNotTheOwners, path: `business.facts.${key}`, message: own ? `must be the owner's own words: "${own}"` : 'the owner did not give it — leave it out (it becomes a placeholder)' });
|
|
19361
|
-
}
|
|
19362
|
-
}
|
|
19363
|
-
return issues;
|
|
19364
|
-
}
|
|
19365
|
-
|
|
19366
20235
|
/**
|
|
19367
20236
|
* THE Publishable gate (AI plan §3e, M1-7): ONE pure function over a snapshot of a site — its pages, globals, the
|
|
19368
20237
|
* connectors' health, the look's token rows, what a build left to fill — run by the Publish dialog, the builder's
|
|
@@ -19405,6 +20274,9 @@ var SiteFindingCode;
|
|
|
19405
20274
|
SiteFindingCode["UnfilledFact"] = "unfilled-fact";
|
|
19406
20275
|
SiteFindingCode["CopyPlaceholder"] = "copy-placeholder";
|
|
19407
20276
|
SiteFindingCode["SampleItems"] = "sample-items";
|
|
20277
|
+
/** Commerce G1 (shop-aware §3i): a sample product the build added still has no price — a price is a fact a buyer is
|
|
20278
|
+
* held to, so the owner sets it (or removes the sample) before the store goes live. */
|
|
20279
|
+
SiteFindingCode["SamplePrice"] = "sample-price";
|
|
19408
20280
|
SiteFindingCode["StockPhoto"] = "stock-photo";
|
|
19409
20281
|
/** M7: a picture made with AI for the site still stands where one of the studio's own could. */
|
|
19410
20282
|
SiteFindingCode["MadePicture"] = "made-picture";
|
|
@@ -19433,6 +20305,7 @@ const FINDING_SEVERITY = {
|
|
|
19433
20305
|
[SiteFindingCode.UnfilledFact]: CheckSeverity.Block,
|
|
19434
20306
|
[SiteFindingCode.CopyPlaceholder]: CheckSeverity.Ask,
|
|
19435
20307
|
[SiteFindingCode.SampleItems]: CheckSeverity.Ask,
|
|
20308
|
+
[SiteFindingCode.SamplePrice]: CheckSeverity.Block,
|
|
19436
20309
|
[SiteFindingCode.StockPhoto]: CheckSeverity.Ask,
|
|
19437
20310
|
[SiteFindingCode.MadePicture]: CheckSeverity.Ask,
|
|
19438
20311
|
[SiteFindingCode.PictureMissing]: CheckSeverity.Warn,
|
|
@@ -19458,6 +20331,7 @@ const CHECK_OF = {
|
|
|
19458
20331
|
[SiteFindingCode.UnfilledFact]: SiteCheckId.Facts,
|
|
19459
20332
|
[SiteFindingCode.CopyPlaceholder]: SiteCheckId.Facts,
|
|
19460
20333
|
[SiteFindingCode.SampleItems]: SiteCheckId.Facts,
|
|
20334
|
+
[SiteFindingCode.SamplePrice]: SiteCheckId.Facts,
|
|
19461
20335
|
[SiteFindingCode.StockPhoto]: SiteCheckId.Facts,
|
|
19462
20336
|
[SiteFindingCode.MadePicture]: SiteCheckId.Facts,
|
|
19463
20337
|
[SiteFindingCode.PictureMissing]: SiteCheckId.Facts,
|
|
@@ -19581,6 +20455,8 @@ function checkFacts(ctx, snapshot, pages, personal) {
|
|
|
19581
20455
|
}
|
|
19582
20456
|
for (const s of snapshot.samples ?? [])
|
|
19583
20457
|
add(ctx, SiteFindingCode.SampleItems, `"${s.label ?? s.id}" is a sample — replace or remove it.`, { nodeId: s.id });
|
|
20458
|
+
for (const s of snapshot.unpricedSamples ?? [])
|
|
20459
|
+
add(ctx, SiteFindingCode.SamplePrice, `"${s.label ?? s.id}" has no price yet — set yours, or remove the sample.`, { nodeId: s.id });
|
|
19584
20460
|
for (const s of (snapshot.stock ?? []).filter(inScope))
|
|
19585
20461
|
add(ctx, SiteFindingCode.StockPhoto, 'A stock photo stands in for one of yours.', { pageId: s.pageId, nodeId: s.nodeId, owner: s.owner });
|
|
19586
20462
|
for (const s of (snapshot.made ?? []).filter(inScope))
|
|
@@ -20144,6 +21020,15 @@ function stockSlots(plan, composed) {
|
|
|
20144
21020
|
*/
|
|
20145
21021
|
function stockItemSlots(plan, composed) {
|
|
20146
21022
|
const out = [];
|
|
21023
|
+
// Commerce G1: a sample product's picture (the shop's `image` role) — its name is what the photo must show.
|
|
21024
|
+
(composed.shop?.products ?? []).forEach((product, index) => {
|
|
21025
|
+
if (product.mainImage)
|
|
21026
|
+
return;
|
|
21027
|
+
out.push({
|
|
21028
|
+
kind: StockSlotKind.Item, contentType: ShopResource.Products, index, field: SHOP_IMAGE_FIELD, intent: StockIntent.Product, aspect: STOCK_ITEM_ASPECT,
|
|
21029
|
+
words: stockWords(product.title, product.category, product.description), subject: stockWords(product.title),
|
|
21030
|
+
});
|
|
21031
|
+
});
|
|
20147
21032
|
for (const type of plan.contentTypes) {
|
|
20148
21033
|
const field = roleField(type, ContentRole.Image);
|
|
20149
21034
|
if (!field)
|
|
@@ -20157,6 +21042,7 @@ function stockItemSlots(plan, composed) {
|
|
|
20157
21042
|
}
|
|
20158
21043
|
return out;
|
|
20159
21044
|
}
|
|
21045
|
+
const SHOP_IMAGE_FIELD = SHOP_ROLES[ShopResource.Products].image;
|
|
20160
21046
|
/** How far below the best score a photo may be and still be the seed's choice (one word of the plan's, about). */
|
|
20161
21047
|
const STOCK_SEED_MARGIN = 2;
|
|
20162
21048
|
/** A stable 32-bit hash (FNV-1a) — the seed's order of the library, the same in every runtime. */
|
|
@@ -20233,6 +21119,11 @@ function applyStockPhotos(trees, placed) {
|
|
|
20233
21119
|
});
|
|
20234
21120
|
return changed;
|
|
20235
21121
|
}
|
|
21122
|
+
/** The sample rows a build gives pictures to, by list: the content types' items and (commerce G1) the shop's products. */
|
|
21123
|
+
function pictureItemsOf(composed) {
|
|
21124
|
+
const products = composed.shop?.products;
|
|
21125
|
+
return products ? { ...composed.items, [ShopResource.Products]: products } : { ...composed.items };
|
|
21126
|
+
}
|
|
20236
21127
|
/** Put the studio's copy of each photo into its sample item's image field. Returns the items changed. */
|
|
20237
21128
|
function applyStockItemPhotos(items, placed) {
|
|
20238
21129
|
let changed = 0;
|
|
@@ -22966,5 +23857,5 @@ function layoutRepairJsonSchema() {
|
|
|
22966
23857
|
* Generated bundle index. Do not edit.
|
|
22967
23858
|
*/
|
|
22968
23859
|
|
|
22969
|
-
export { ACTION_START_SCALE, ACTIVE_BUILD_STATUSES, AI_REFUSAL_NEXT, AI_REFUSAL_STATUS, AI_STEPS, AI_STEP_LABELS, AI_STEP_NEEDS, AI_STEP_PART_TOKENS, AI_STEP_TYPICAL_TOKENS, ART_DIRECTION_PARTS, AiCallStatus, AiCapability, AiFeature, AiGenerationStage, AiKeyMode, AiLimit, AiNextKind, AiProviderId, AiRefusalCode, AiStep, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BUILD_STEPS, BaselineRole, BindScope, BuildNoticeCode, BuildStep, CONTENT_ROLE_MEANINGS, CREDITS_PER_USD, CardBindTarget, CheckSeverity, ComposeError, ComposeIssueCode, ContentFieldControl, ContentFieldType, ContentRole, ContentTypeAction, CreatedKind, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, DEFAULT_SITE_LOCALE, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, EntranceSide, FACT_KEYS, FIELD_TYPE_OF_CONTROL, FILL_ASPECT, FILM_PATTERN, FINAL_GENERATION_STAGES, FINDING_SEVERITY, FilmUnplaced, GRAMMAR_TOO_LARGE_MESSAGE, GlobalSlot, HEBREW_PREFIXES, JSON_SCHEMA_BANNED_KEYWORDS, JsonSchemaShapeError, KeptReason, LAYOUT_ACCENT_TEXT, LAYOUT_BEAT_DELAY, LAYOUT_CHECK_VIEWPORT, LAYOUT_COLOUR_TOKEN, LAYOUT_COLUMN_GAP, LAYOUT_DEPTH_ON_PHONE, LAYOUT_DRIFT, LAYOUT_EASING, LAYOUT_ENTRANCE_MAX_MS, LAYOUT_FONT_SIZE, LAYOUT_GUTTER, LAYOUT_HIDDEN_OPACITY, LAYOUT_KINETIC_KINDS, LAYOUT_LINE_HEIGHT, LAYOUT_OPERATED, LAYOUT_PACE, LAYOUT_PHONE_BREAKPOINT, LAYOUT_PHONE_PADDING, LAYOUT_PHOTO_ASPECT, LAYOUT_READY_MADE_TOKEN, LAYOUT_RISE, LAYOUT_SCREEN_PX, LAYOUT_TEXT_KINDS, LAYOUT_TOOLTIP_TRAIT, LAYOUT_VIEWPORTS, LAYOUT_WIRE_AUTOPLAY_MS, LayoutAlign, LayoutBleed, LayoutButtonVariant, LayoutColour, LayoutColourMode, LayoutDepth, LayoutDial, LayoutEase, LayoutEditOp, LayoutEnter, LayoutGalleryEffect, LayoutGapCode, LayoutIssueCode, LayoutLayerKind, LayoutMendKind, LayoutNavKind, LayoutPace, LayoutPhotoShape, LayoutPhotoSource, LayoutRole, LayoutSectionKind, LayoutSequenceToken, LayoutSide, LayoutSignatureId, LayoutSize, LayoutSourceChoice, LayoutTrackProp, LayoutTransition, LayoutViewport, MAX_SITE_PICTURES, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NO_TOKENS, NavPagesSource, NavRole, NavShape, NavShapeError, PAGE_ARCHETYPES, PHOTO_ANALYSIS_WIDTH, PHOTO_CALM_DETAIL, PHOTO_GRID, PHOTO_LIGHT_LUMINANCE, PICTURE_ASPECTS, PICTURE_NEVER, PICTURE_REAL_PLACE_FAMILIES, PICTURE_REROLL_EVERY, PICTURE_REVIEW_FORMAT, PICTURE_REVIEW_SHAPE, PICTURE_TEXT_CONTRAST, PICTURE_WORLDS, PICTURE_WORLD_IDS, PLAN_EDITS_ANSWER_SHAPES, PLAN_EDITS_PART_SCHEMA_NAMES, PLAN_EDIT_OP_PART, PLAN_EDIT_SHAPE, PLAN_EDIT_WIRE_KEYS, PLAN_PARTS, PLAN_PART_KEYS, PLAN_WIRE_DERIVED, PLAN_WIRE_PART_SCHEMA_NAMES, PLAN_WIRE_SHAPE, PRICING_PATTERN, PROOF_FINGERPRINTS, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PhotoTone, PictureRefusal, PictureWorld, PlaceholderKind, PlanChangeAction, PlanChangeKind, PlanDataSourceMode, PlanDataSourceType, PlanEditIssueCode, PlanEditOp, PlanEditsOutcome, PlanPart, PlanWireEntry, PlanWireShapeError, PlanWordIssueCode, PreflightRefusalCode, PublishRefusalCode, RENDER_CHECK, REQUIRED_CONTENT_ROLES, RelativeOp, SAMPLE_IMAGE_REF, SCENE_LEVEL, SCENE_OTHER_PAGES, SCRIM_BACKGROUND, SCRIM_COVER, SCRIM_LEVELS, SHOWCASE_FILM, SITE_CHECKS, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_LIBRARY, SITE_LOCALES, SITE_NEED_IDS, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_ARCHETYPES, SPEC_SITE_COPY_LENGTHS, SPEC_SITE_DENSITY_COPY, SPEC_SITE_FACTS, SPEC_SITE_LAYOUT, SPEC_SITE_LIBRARY, SPEC_SITE_LOCALES, SPEC_SITE_NEED_IDS, SPEC_SITE_PATTERNS, SPEC_SITE_PICTURE_NEVER, SPEC_SITE_PICTURE_WORLDS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_REQUIRED_ROLES, SPEC_SITE_ROLES, SPEC_SITE_TEMPLATES, STOCK_FAMILIES, STOCK_FAMILY_INTENTS, STOCK_INTENT_ORDER, STOCK_INTENT_SUBJECTS, STOCK_ITEM_ASPECT, STOCK_MIN_KEPT, STOCK_PROVIDER_TERMS, STOCK_SEED_MARGIN, STOCK_SUBJECT_WORDS, STRICT_SCHEMA_BUDGET, STRICT_SCHEMA_LIMITS, STUDIO_TEMPLATE, ScrimLevel, SectionFallbackLastResort, SectionSwapAction, SectionSwapRule, SiteBuildKind, SiteBuildStatus, SiteCheckId, SiteFindingCode, SiteLocale, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, StepState, StockIntent, StockOrientation, StockProviderId, StockReviewFlag, StockReviewVerdict, StockSlotKind, StockSubject, WORDS_AREA_DEFAULT_SHARE, WordsEdge, addBarItem, addStockCredits, aiRefusalNext, aiStepParts, applyLayoutEdits, applyOwnPhotoGalleries, applyPictureScrims, applyPlanEdits, applyStockItemPhotos, applyStockPhotos, archetypeIssues, areaLuminance, artDirectionFor, artDirectionIssues, artDirectionPreamble, aspectRatioOf, assertStyleSlots, assertValidSitePlan, auditLayoutMotion, auditSite, barIconForRoute, blocksPublish, brandHueWord, buildKeys, buildStepFacts, builtHomePageId, calmParts, calmUnder, checkLayout, chooseScrim, composeContextOf, composeLayout, composeNavHeader, composePresetForm, composeSection, composeSite, contentTypeOfSource, contentTypePreviewFields, contentTypeToWire, copyLengthOf, costUsd, coverCrop, createSerializedNode, creditsOfUsd, dataSourceToWire, derivedBeats, derivedDataSources, describeInventoryForPrompt, describePlanData, describeShapeKey, driftAt, driftOverlap, emptyAreaPhrase, entranceAction, entranceInteraction, estimatePictures, estimateStepCredits, expandLayoutWire, expandPlanWire, expandWireContentType, expandWireDataSource, expandWireEdit, expandWireField, expandWirePage, expandWireSection, failedBuildStep, fallBackBySection, fieldToWire, filmOfPlan, filmPlacement, findNavRoot, fingerprintOf, frameWords, isActiveBuild, isLayoutRule, isNonEmptyString, isPictureWorld, isPlainObject, isRtlLocale, jsonAnyOf, jsonBoolean, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonSchemaKeywords, jsonSchemaObjects, jsonShapedObject, jsonText, judgeLayoutRender, layerShownSpans, layoutBandScheme, layoutBoxPx, layoutColumnsVw, layoutDesignOf, layoutDialOf, layoutDriftPhoto, layoutElementStyle, layoutGalleryLists, layoutGallerySources, layoutGlideDepth, layoutHeldStill, layoutLookChanges, layoutLookOf, layoutMotionOf, layoutNodeClass, layoutOpeningDisplayMend, layoutOpeningDisplays, layoutPathSteps, layoutPhotoIds, layoutPresetColours, layoutPresetOf, layoutRepairJsonSchema, layoutRoomPx, layoutRuleEdge, layoutShapeHasPurpose, layoutStillLine, layoutTextFits, layoutTextWidthEm, layoutToWire, layoutVoidScreens, layoutVoids, layoutWireJsonSchema, luminanceOf, measureLayout, mendLayout, modelCanDo, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, orientationOfRatio, ownPhotoFit, pageToWire, parseLayoutPhotoId, parsePatternPath, parseSampleImageRef, pathAt, patternById, patternHasForm, patternLinkSlots, patternListGap, patternManifest, patternNeedsBinding, patternNodes, patternOptionalParts, patternRoleNeeds, patternScopes, patternSlotBudgets, patternSlots, patternTakesBinding, phoneGapBefore, phoneMenuPages, phoneWordsColour, photoInventory, photoShapeOf, pictureAspect, picturePrompt, pictureRefusalOf, pictureRerolls, pictureReviewIssues, pictureReviewJsonSchema, pictureReviewPasses, pictureSlotKey, pictureTargets, pictureTryFits, pixelsUnder, placeFilm, planEditOps, planEditToWire, planEditWireGaps, planEditWireKeys, planEditWireOps, planEditWireShape, planEditsFromWire, planEditsJsonSchema, planEditsToWire, planEntrances, planFromTemplate, planLayoutPhotos, planNavShape, planOwnPhotos, planPartOfPath, planPartToWire, planPictures, planStockPhotos, planToWire, planWireGaps, planWirePartJsonSchema, planWirePartShape, planWordIssues, publishRefusal, publishVerdict, readyMadeColumn, recipeListBinds, recomposeAsks, releasedLayoutDefaults, removeBarItem, requiredAcknowledgements, requiredShapeKeys, roleField, routeMatches, routeParams, samenessIssues, sampleImageRef, scoreStockPhoto, screenFontSize, screenWordColumns, screenWordMisfit, screenWordOverflowPx, sectionEntrances, sectionPatternIds, sectionToWire, sectionsNamed, sequenceShare, sequenceTokenOf, setStyleProps, shapeKeys, showcaseGlobals, showcasePages, showcasePlans, showcaseScenes, shownTogether, signatureOf, siteNavPages, slotBudget, splitSide, stockCopyKey, stockCreditLine, stockCreditLines, stockCreditNode, stockCreditNodeId, stockFits, stockGroupOf, stockItemSlots, stockKept, stockPhotoRatio, stockPhotoSubject, stockPhotoUsable, stockPhotoWords, stockSlots, stockWord, stockWords, strictSchemaComplexity, strictSchemaRefusal, toneOf, typicalStepTokens, validatePlanEdits, validateSitePlan, walkSerialized, wireContentTypeJsonSchema, wireDataSourceJsonSchema, wireFieldJsonSchema, wirePageJsonSchema, wireSectionJsonSchema, withDerivedSources, wordPattern, wordsOverPhotos, wordsOverPicture, writtenTexts };
|
|
23860
|
+
export { ACTION_START_SCALE, ACTIVE_BUILD_STATUSES, AI_REFUSAL_NEXT, AI_REFUSAL_STATUS, AI_STEPS, AI_STEP_LABELS, AI_STEP_NEEDS, AI_STEP_PART_TOKENS, AI_STEP_TYPICAL_TOKENS, ART_DIRECTION_PARTS, AiCallStatus, AiCapability, AiFeature, AiGenerationStage, AiKeyMode, AiLimit, AiNextKind, AiProviderId, AiRefusalCode, AiStep, BAR_ITEMS_MAX, BAR_ITEMS_MIN, BASELINE_ROLES, BUILD_STEPS, BaselineRole, BindScope, BuildNoticeCode, BuildStep, CONTENT_ROLE_MEANINGS, CREDITS_PER_USD, CardBindTarget, CheckSeverity, ComposeError, ComposeIssueCode, ContentFieldControl, ContentFieldType, ContentRole, ContentTypeAction, CreatedKind, DANGLING_LINK_CODES, DEFAULT_PHONE_MENU_BREAKPOINT, DEFAULT_SITE_LOCALE, ENTRANCE_EASING, ENTRANCE_ORIGIN_LOOK, ENTRANCE_TRIGGER, EntrancePart, EntranceSide, FACT_KEYS, FIELD_TYPE_OF_CONTROL, FILL_ASPECT, FILM_PATTERN, FINAL_GENERATION_STAGES, FINDING_SEVERITY, FilmUnplaced, GRAMMAR_TOO_LARGE_MESSAGE, GlobalSlot, HEBREW_PREFIXES, JSON_SCHEMA_BANNED_KEYWORDS, JsonSchemaShapeError, KeptReason, LAYOUT_ACCENT_TEXT, LAYOUT_BEAT_DELAY, LAYOUT_CHECK_VIEWPORT, LAYOUT_COLOUR_TOKEN, LAYOUT_COLUMN_GAP, LAYOUT_DEPTH_ON_PHONE, LAYOUT_DRIFT, LAYOUT_EASING, LAYOUT_ENTRANCE_MAX_MS, LAYOUT_FONT_SIZE, LAYOUT_GUTTER, LAYOUT_HIDDEN_OPACITY, LAYOUT_KINETIC_KINDS, LAYOUT_LINE_HEIGHT, LAYOUT_OPERATED, LAYOUT_PACE, LAYOUT_PHONE_BREAKPOINT, LAYOUT_PHONE_PADDING, LAYOUT_PHOTO_ASPECT, LAYOUT_READY_MADE_TOKEN, LAYOUT_RISE, LAYOUT_SCREEN_PX, LAYOUT_TEXT_KINDS, LAYOUT_TOOLTIP_TRAIT, LAYOUT_VIEWPORTS, LAYOUT_WIRE_AUTOPLAY_MS, LayoutAlign, LayoutBleed, LayoutButtonVariant, LayoutColour, LayoutColourMode, LayoutDepth, LayoutDial, LayoutEase, LayoutEditOp, LayoutEnter, LayoutGalleryEffect, LayoutGapCode, LayoutIssueCode, LayoutLayerKind, LayoutMendKind, LayoutNavKind, LayoutPace, LayoutPhotoShape, LayoutPhotoSource, LayoutRole, LayoutSectionKind, LayoutSequenceToken, LayoutSide, LayoutSignatureId, LayoutSize, LayoutSourceChoice, LayoutTrackProp, LayoutTransition, LayoutViewport, MAX_SITE_PICTURES, NAV_PART_LABELS, NAV_SHAPE_COPY, NEUTRAL_STYLE_PROPS, NODE_BASELINES, NO_TOKENS, NavPagesSource, NavRole, NavShape, NavShapeError, PAGE_ARCHETYPES, PHOTO_ANALYSIS_WIDTH, PHOTO_CALM_DETAIL, PHOTO_GRID, PHOTO_LIGHT_LUMINANCE, PICTURE_ASPECTS, PICTURE_NEVER, PICTURE_REAL_PLACE_FAMILIES, PICTURE_REROLL_EVERY, PICTURE_REVIEW_FORMAT, PICTURE_REVIEW_SHAPE, PICTURE_TEXT_CONTRAST, PICTURE_WORLDS, PICTURE_WORLD_IDS, PLAN_EDITS_ANSWER_SHAPES, PLAN_EDITS_PART_SCHEMA_NAMES, PLAN_EDIT_OP_PART, PLAN_EDIT_SHAPE, PLAN_EDIT_WIRE_KEYS, PLAN_PARTS, PLAN_PART_KEYS, PLAN_WIRE_DERIVED, PLAN_WIRE_PART_SCHEMA_NAMES, PLAN_WIRE_SHAPE, PRICING_PATTERN, PROOF_FINGERPRINTS, PUBLISH_BLOCKING_PLACEHOLDERS, PageDataKind, PathIssueCollector, PatternDirective, PatternGlobalPosition, PatternOpens, PatternPlaceholder, PatternRecipe, PhoneMenuBreakpoint, PhotoTone, PictureRefusal, PictureWorld, PlaceholderKind, PlanChangeAction, PlanChangeKind, PlanDataSourceMode, PlanDataSourceType, PlanEditIssueCode, PlanEditOp, PlanEditsOutcome, PlanPart, PlanWireEntry, PlanWireShapeError, PlanWordIssueCode, PreflightRefusalCode, PriceBindTarget, PublishRefusalCode, RENDER_CHECK, REQUIRED_CONTENT_ROLES, RelativeOp, SAMPLE_IMAGE_REF, SCENE_LEVEL, SCENE_OTHER_PAGES, SCRIM_BACKGROUND, SCRIM_COVER, SCRIM_LEVELS, SHOP_CART_BUTTON_ID, SHOP_CART_DRAWER_ID, SHOP_FIELDS, SHOP_LATEST_LIMIT, SHOP_LIST_LIMIT, SHOP_NEED, SHOP_ONLY_CONTENT_ROLES, SHOP_PRODUCTS_MAX, SHOP_ROLES, SHOP_SLUG_FIELD, SHOWCASE_FILM, SHOWCASE_SHOP, SITE_CHECKS, SITE_FACT_LABELS, SITE_HEADER_PATTERN, SITE_LIBRARY, SITE_LOCALES, SITE_NEED_IDS, SITE_PATTERNS, SITE_PLAN_VERSION, SITE_TEMPLATES, SPEC_SITE_ARCHETYPES, SPEC_SITE_COPY_LENGTHS, SPEC_SITE_DENSITY_COPY, SPEC_SITE_FACTS, SPEC_SITE_LAYOUT, SPEC_SITE_LIBRARY, SPEC_SITE_LOCALES, SPEC_SITE_NEED_IDS, SPEC_SITE_PATTERNS, SPEC_SITE_PICTURE_NEVER, SPEC_SITE_PICTURE_WORLDS, SPEC_SITE_PLAN_SHAPE, SPEC_SITE_REQUIRED_ROLES, SPEC_SITE_ROLES, SPEC_SITE_TEMPLATES, STOCK_FAMILIES, STOCK_FAMILY_INTENTS, STOCK_INTENT_ORDER, STOCK_INTENT_SUBJECTS, STOCK_ITEM_ASPECT, STOCK_MIN_KEPT, STOCK_PROVIDER_TERMS, STOCK_SEED_MARGIN, STOCK_SUBJECT_WORDS, STRICT_SCHEMA_BUDGET, STRICT_SCHEMA_LIMITS, STUDIO_TEMPLATE, ScrimLevel, SectionFallbackLastResort, SectionSwapAction, SectionSwapRule, ShopResource, ShopSourceRole, SiteBuildKind, SiteBuildStatus, SiteCheckId, SiteFindingCode, SiteLocale, SitePlanError, SitePlanIssueCode, SitePlanSourceKind, SiteTemplateError, SiteTemplateId, StepState, StockIntent, StockOrientation, StockProviderId, StockReviewFlag, StockReviewVerdict, StockSlotKind, StockSubject, WORDS_AREA_DEFAULT_SHARE, WordsEdge, addBarItem, addStockCredits, aiRefusalNext, aiStepParts, applyLayoutEdits, applyOwnPhotoGalleries, applyPictureScrims, applyPlanEdits, applyStockItemPhotos, applyStockPhotos, archetypeIssues, areaLuminance, artDirectionFor, artDirectionIssues, artDirectionPreamble, aspectRatioOf, assertStyleSlots, assertValidSitePlan, auditLayoutMotion, auditSite, barIconForRoute, blocksPublish, brandHueWord, buildKeys, buildStepFacts, buildStepsOf, builtHomePageId, calmParts, calmUnder, checkLayout, chooseScrim, composeContextOf, composeLayout, composeNavHeader, composePresetForm, composeSection, composeSite, contentTypeOfSource, contentTypePreviewFields, contentTypeToWire, copyLengthOf, costUsd, coverCrop, createSerializedNode, creditsOfUsd, dataSourceToWire, derivedBeats, derivedDataSources, derivedShopSources, describeInventoryForPrompt, describePlanData, describeShapeKey, driftAt, driftOverlap, emptyAreaPhrase, entranceAction, entranceInteraction, estimatePictures, estimateStepCredits, expandLayoutWire, expandPlanWire, expandWireContentType, expandWireDataSource, expandWireEdit, expandWireField, expandWirePage, expandWireSection, expandWireShop, failedBuildStep, fallBackBySection, fieldToWire, filmOfPlan, filmPlacement, findNavRoot, fingerprintOf, frameWords, isActiveBuild, isLayoutRule, isNonEmptyString, isPictureWorld, isPlainObject, isRtlLocale, isShopResource, jsonAnyOf, jsonBoolean, jsonClosedObject, jsonInteger, jsonListOf, jsonOneOf, jsonSchemaKeywords, jsonSchemaObjects, jsonShapedObject, jsonText, judgeLayoutRender, layerShownSpans, layoutBandScheme, layoutBoxPx, layoutColumnsVw, layoutDesignOf, layoutDialOf, layoutDriftPhoto, layoutElementStyle, layoutGalleryLists, layoutGallerySources, layoutGlideDepth, layoutHeldStill, layoutLookChanges, layoutLookOf, layoutMotionOf, layoutNodeClass, layoutOpeningDisplayMend, layoutOpeningDisplays, layoutPathSteps, layoutPhotoIds, layoutPresetColours, layoutPresetOf, layoutRepairJsonSchema, layoutRoomPx, layoutRuleEdge, layoutShapeHasPurpose, layoutStillLine, layoutTextFits, layoutTextWidthEm, layoutToWire, layoutVoidScreens, layoutVoids, layoutWireJsonSchema, luminanceOf, measureLayout, mendLayout, modelCanDo, moveBarItem, navPages, navShapeBreakpoint, navShapeOf, nextSourceOf, nodeBindPaths, orientationOfRatio, ownPhotoFit, pageToWire, parseLayoutPhotoId, parsePatternPath, parseSampleImageRef, pathAt, patternById, patternHasForm, patternLinkSlots, patternListGap, patternManifest, patternNeedsBinding, patternNodes, patternOptionalParts, patternRoleNeeds, patternScopes, patternSlotBudgets, patternSlots, patternTakesBinding, phoneGapBefore, phoneMenuPages, phoneWordsColour, photoInventory, photoShapeOf, pictureAspect, pictureItemsOf, picturePrompt, pictureRefusalOf, pictureRerolls, pictureReviewIssues, pictureReviewJsonSchema, pictureReviewPasses, pictureSlotKey, pictureTargets, pictureTryFits, pixelsUnder, placeFilm, planEditOps, planEditToWire, planEditWireGaps, planEditWireKeys, planEditWireOps, planEditWireShape, planEditsFromWire, planEditsJsonSchema, planEditsToWire, planEntrances, planFromTemplate, planHasShopSource, planLayoutPhotos, planNavShape, planOwnPhotos, planPartOfPath, planPartToWire, planPictures, planSells, planStockPhotos, planToWire, planWireGaps, planWirePartJsonSchema, planWirePartShape, planWordIssues, pricesIn, publishRefusal, publishVerdict, readyMadeColumn, recipeListBinds, recomposeAsks, releasedLayoutDefaults, removeBarItem, requiredAcknowledgements, requiredShapeKeys, roleField, routeMatches, routeParams, samenessIssues, sampleImageRef, scoreStockPhoto, screenFontSize, screenWordColumns, screenWordMisfit, screenWordOverflowPx, sectionEntrances, sectionPatternIds, sectionToWire, sectionsNamed, sequenceShare, sequenceTokenOf, setStyleProps, shapeKeys, shopCategoriesOf, shopContentType, shopSourceAliases, showcaseGlobals, showcasePages, showcasePlans, showcaseScenes, showcaseStorePages, shownTogether, signatureOf, siteNavPages, slotBudget, splitSide, stockCopyKey, stockCreditLine, stockCreditLines, stockCreditNode, stockCreditNodeId, stockFits, stockGroupOf, stockItemSlots, stockKept, stockPhotoRatio, stockPhotoSubject, stockPhotoUsable, stockPhotoWords, stockSlots, stockWord, stockWords, strictSchemaComplexity, strictSchemaRefusal, toneOf, typicalStepTokens, validatePlanEdits, validateSitePlan, variantNamesOf, walkSerialized, wireContentTypeJsonSchema, wireDataSourceJsonSchema, wireFieldJsonSchema, wirePageJsonSchema, wireSectionJsonSchema, wireShopProductJsonSchema, withDerivedSources, wordPattern, wordsOverPhotos, wordsOverPicture, writtenTexts };
|
|
22970
23861
|
//# sourceMappingURL=vectoriox-iox-ui-generation-core.mjs.map
|