@vectoriox/iox-ui 5.133.0 → 5.134.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/commerce-core/index.d.ts +12 -1
- package/composite-core/index.d.ts +27 -22
- package/design-core/index.d.ts +436 -35
- package/domain-core/index.d.ts +353 -0
- package/domain-core/package.json +3 -0
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs +2 -0
- package/fesm2022/vectoriox-iox-ui-actions-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs +6 -48
- package/fesm2022/vectoriox-iox-ui-assist-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs +21 -0
- package/fesm2022/vectoriox-iox-ui-commerce-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs +68 -57
- package/fesm2022/vectoriox-iox-ui-composite-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +895 -416
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-domain-core.mjs +422 -0
- package/fesm2022/vectoriox-iox-ui-domain-core.mjs.map +1 -0
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs +13974 -12036
- package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs +9 -3
- package/fesm2022/vectoriox-iox-ui-harness-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui-mail-core.mjs +210 -2
- package/fesm2022/vectoriox-iox-ui-mail-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +290 -16
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/generation-core/index.d.ts +1419 -379
- package/harness-core/index.d.ts +6 -1
- package/index.d.ts +139 -10
- package/mail-core/index.d.ts +190 -2
- package/package.json +5 -1
- package/src/actions-core/element-actions.ts +2 -0
- package/src/assist-core/page-sections.ts +7 -37
- package/src/commerce-core/shop-display.ts +21 -0
- package/src/composite-core/shop.ts +71 -57
- package/src/design-core/design-settings.ts +16 -0
- package/src/design-core/design-token.model.ts +7 -1
- package/src/design-core/flavor-spec.generated.ts +374 -35
- package/src/design-core/flavor-tokens.ts +12 -1
- package/src/design-core/header-behaviour.ts +32 -0
- package/src/design-core/motion-language.ts +115 -0
- package/src/design-core/public-api.ts +1 -0
- package/src/design-core/style-presets.ts +3 -0
- package/src/domain-core/domain-vocabulary.ts +125 -0
- package/src/domain-core/domain-wire.ts +95 -0
- package/src/domain-core/org-path-redirect.ts +105 -0
- package/src/domain-core/public-api.ts +12 -0
- package/src/domain-core/web-domain.ts +251 -0
- package/src/generation-core/carry-fill.ts +36 -0
- package/src/generation-core/carry.ts +398 -0
- package/src/generation-core/check-carry.ts +216 -0
- package/src/generation-core/check-layout.ts +71 -5
- package/src/generation-core/compose-layout.ts +187 -28
- package/src/generation-core/compose-site.ts +154 -31
- package/src/generation-core/entrances.ts +66 -10
- package/src/generation-core/header-edit.ts +299 -0
- package/src/generation-core/header-mix.ts +64 -5
- package/src/generation-core/layout-fingerprint.ts +5 -1
- package/src/generation-core/layout-language.ts +20 -1
- package/src/generation-core/layout-space.ts +4 -4
- package/src/generation-core/layout-wire.ts +36 -1
- package/src/generation-core/node-baselines.generated.ts +1 -0
- package/src/generation-core/public-api.ts +7 -0
- package/src/generation-core/redesign-additions.ts +273 -0
- package/src/generation-core/redesign-run.ts +364 -0
- package/src/generation-core/refit-page.ts +151 -0
- package/src/generation-core/section-stamp.ts +4 -4
- package/src/generation-core/shop-plan.ts +15 -0
- package/src/generation-core/site-build-run.ts +20 -3
- package/src/generation-core/site-spec.generated.ts +194 -94
- package/src/generation-core/site-tree.ts +19 -5
- package/src/generation-core/validate-site-plan.ts +37 -3
- package/src/harness-core/motion.ts +13 -3
- package/src/harness-core/starting-design.ts +1 -1
- package/src/mail-core/mail-domain.ts +305 -0
- package/src/mail-core/mail-wire.ts +8 -0
- package/src/mail-core/public-api.ts +3 -1
- package/styles/iox-design.css +30 -1
|
@@ -54,6 +54,17 @@ export enum ShopWord {
|
|
|
54
54
|
Quantity = 'quantity',
|
|
55
55
|
FreeShippingGap = 'freeShippingGap',
|
|
56
56
|
ChooseOption = 'chooseOption',
|
|
57
|
+
/** The shop parts' own words, stamped in the site's language (`shopRecipeWords` — vectoriox/iox-ui#100). */
|
|
58
|
+
AddToCart = 'addToCart',
|
|
59
|
+
BuyNow = 'buyNow',
|
|
60
|
+
YourBag = 'yourBag',
|
|
61
|
+
Close = 'close',
|
|
62
|
+
RemoveLine = 'removeLine',
|
|
63
|
+
EmptyBag = 'emptyBag',
|
|
64
|
+
Subtotal = 'subtotal',
|
|
65
|
+
VatNote = 'vatNote',
|
|
66
|
+
CheckOut = 'checkOut',
|
|
67
|
+
KeepShopping = 'keepShopping',
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
/** `{name}` / `{n}` / `{amount}` are filled by `shopWord`. */
|
|
@@ -69,6 +80,16 @@ export const SHOP_WORDS: Readonly<Record<ShopWord, CommerceLabel>> = Object.free
|
|
|
69
80
|
[ShopWord.Quantity]: { en: 'Quantity', he: 'כמות' },
|
|
70
81
|
[ShopWord.FreeShippingGap]: { en: 'Add {amount} more for free delivery', he: 'עוד {amount} למשלוח חינם' },
|
|
71
82
|
[ShopWord.ChooseOption]: { en: 'Choose {name}', he: 'בחירת {name}' },
|
|
83
|
+
[ShopWord.AddToCart]: { en: 'Add to cart', he: 'הוספה לסל' },
|
|
84
|
+
[ShopWord.BuyNow]: { en: 'Buy now', he: 'קנייה עכשיו' },
|
|
85
|
+
[ShopWord.YourBag]: { en: 'Your bag', he: 'הסל שלך' },
|
|
86
|
+
[ShopWord.Close]: { en: 'Close', he: 'סגירה' },
|
|
87
|
+
[ShopWord.RemoveLine]: { en: 'Remove', he: 'הסרה' },
|
|
88
|
+
[ShopWord.EmptyBag]: { en: 'Your bag is empty.', he: 'הסל שלך ריק.' },
|
|
89
|
+
[ShopWord.Subtotal]: { en: 'Subtotal', he: 'סכום ביניים' },
|
|
90
|
+
[ShopWord.VatNote]: { en: 'Includes VAT. Delivery is chosen at checkout.', he: 'כולל מע״מ. המשלוח נבחר בקופה.' },
|
|
91
|
+
[ShopWord.CheckOut]: { en: 'Check out', he: 'לקופה' },
|
|
92
|
+
[ShopWord.KeepShopping]: { en: 'Keep shopping', he: 'המשך בקניות' },
|
|
72
93
|
});
|
|
73
94
|
|
|
74
95
|
export function shopWord(word: ShopWord, lang: string | null | undefined, fill: Readonly<Record<string, string | number>> = {}): string {
|
|
@@ -206,33 +206,42 @@ enum Style {
|
|
|
206
206
|
Title = 'h3',
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
/** The words a fresh recipe shows
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
209
|
+
/** The words a fresh recipe shows, in the site's language (vectoriox/iox-ui#100 — a Hebrew store's bag, buttons and drawer
|
|
210
|
+
* speak Hebrew, as its header does). The sample product's own words (board 10's vase) are the runtime's to replace. */
|
|
211
|
+
export function shopRecipeWords(lang: string | null | undefined = 'en') {
|
|
212
|
+
const w = (word: ShopWord, fill: Readonly<Record<string, string | number>> = {}) => shopWord(word, lang, fill);
|
|
213
|
+
return Object.freeze({
|
|
214
|
+
price: '₪240.00',
|
|
215
|
+
compareAt: '₪280.00',
|
|
216
|
+
option: 'Glaze — Sand',
|
|
217
|
+
value: '32 cm',
|
|
218
|
+
note: 'Charcoal is sold out',
|
|
219
|
+
quantity: '1',
|
|
220
|
+
add: w(ShopWord.AddToCart),
|
|
221
|
+
added: w(ShopWord.Added),
|
|
222
|
+
buyNow: w(ShopWord.BuyNow),
|
|
223
|
+
cart: w(ShopWord.Cart),
|
|
224
|
+
count: '2',
|
|
225
|
+
drawer: w(ShopWord.YourBag),
|
|
226
|
+
close: w(ShopWord.Close),
|
|
227
|
+
lineTitle: 'Tall speckled vase',
|
|
228
|
+
lineVariant: 'Sand · 32 cm',
|
|
229
|
+
lineTotal: '₪240.00',
|
|
230
|
+
remove: w(ShopWord.RemoveLine),
|
|
231
|
+
empty: w(ShopWord.EmptyBag),
|
|
232
|
+
shippingNote: w(ShopWord.FreeShippingGap, { amount: '₪40.00' }),
|
|
233
|
+
subtotalLabel: w(ShopWord.Subtotal),
|
|
234
|
+
subtotal: '₪360.00',
|
|
235
|
+
vatNote: w(ShopWord.VatNote),
|
|
236
|
+
checkout: w(ShopWord.CheckOut),
|
|
237
|
+
keepShopping: w(ShopWord.KeepShopping),
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export type ShopRecipeWords = ReturnType<typeof shopRecipeWords>;
|
|
242
|
+
|
|
243
|
+
/** The English words (the palette's when it has no page language). */
|
|
244
|
+
export const SHOP_RECIPE_WORDS: ShopRecipeWords = shopRecipeWords('en');
|
|
236
245
|
|
|
237
246
|
export const SHOP_LABELS = Object.freeze({
|
|
238
247
|
price: 'Price', variants: 'Options', quantity: 'Quantity', add: 'Add to cart', buyNow: 'Buy now', cartButton: 'Cart button', cartDrawer: 'Cart drawer',
|
|
@@ -307,33 +316,36 @@ export function buildQuantityRecipe(create: CompositeNodeFactory, compact = fals
|
|
|
307
316
|
}
|
|
308
317
|
|
|
309
318
|
/** Add to cart: presses on pointer-down (its element style), then reads "Added ✓" in place for ADDED_HOLD_MS. */
|
|
310
|
-
export function buildAddToCartRecipe(create: CompositeNodeFactory): CompositeNode {
|
|
319
|
+
export function buildAddToCartRecipe(create: CompositeNodeFactory, lang: string | null = 'en'): CompositeNode {
|
|
320
|
+
const t = shopRecipeWords(lang);
|
|
311
321
|
const root = button(create, 'add', ShopRole.Add, Style.Primary, SHOP_LABELS.add, '',
|
|
312
322
|
{ display: 'inline-grid', alignItems: 'center', justifyItems: 'center', flexGrow: '1', width: 'auto', height: 'auto' });
|
|
313
323
|
root.children = [
|
|
314
|
-
text(create, 'add-label', ShopRole.AddLabel, Style.Label,
|
|
315
|
-
text(create, 'added-label', ShopRole.AddedLabel, Style.Label,
|
|
324
|
+
text(create, 'add-label', ShopRole.AddLabel, Style.Label, t.add, 'Add', STACKED, 'span'),
|
|
325
|
+
text(create, 'added-label', ShopRole.AddedLabel, Style.Label, t.added, 'Added', STACKED, 'span'),
|
|
316
326
|
];
|
|
317
327
|
onClick(root, 'addToCart');
|
|
318
328
|
return root;
|
|
319
329
|
}
|
|
320
330
|
|
|
321
331
|
/** Buy now: straight to checkout with this variant (inert on the canvas). */
|
|
322
|
-
export function buildBuyNowRecipe(create: CompositeNodeFactory): CompositeNode {
|
|
332
|
+
export function buildBuyNowRecipe(create: CompositeNodeFactory, lang: string | null = 'en'): CompositeNode {
|
|
333
|
+
const t = shopRecipeWords(lang);
|
|
323
334
|
const root = button(create, 'buy-now', ShopRole.BuyNow, Style.Secondary, SHOP_LABELS.buyNow, '',
|
|
324
335
|
{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: 'auto', height: 'auto' });
|
|
325
|
-
root.children = [text(create, 'buy-now-label', null, Style.Label,
|
|
336
|
+
root.children = [text(create, 'buy-now-label', null, Style.Label, t.buyNow, 'Text', WORDS, 'span')];
|
|
326
337
|
onClick(root, 'startCheckout');
|
|
327
338
|
return root;
|
|
328
339
|
}
|
|
329
340
|
|
|
330
341
|
/** The bag button with its live count ($cart.count); it opens the page's cart drawer. */
|
|
331
|
-
export function buildCartButtonRecipe(create: CompositeNodeFactory): CompositeNode {
|
|
332
|
-
const
|
|
342
|
+
export function buildCartButtonRecipe(create: CompositeNodeFactory, lang: string | null = 'en'): CompositeNode {
|
|
343
|
+
const t = shopRecipeWords(lang);
|
|
344
|
+
const root = button(create, 'cart-button', ShopRole.CartButton, Style.CartButton, SHOP_LABELS.cartButton, t.cart,
|
|
333
345
|
{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: 'auto', height: 'auto', padding: '6px 6px 6px 6px', position: 'relative' });
|
|
334
346
|
const count = part(create, 'cart-count', Type.Container, ShopRole.CartCount, Style.CartCount, {}, 'Count',
|
|
335
347
|
{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', width: 'auto', height: 'auto', minHeight: 'var(--iox-cart-count-size)', padding: '0px 4px 0px 4px', position: 'absolute', top: '-5px', right: '-5px' });
|
|
336
|
-
const words = text(create, 'cart-count-text', null, Style.Label,
|
|
348
|
+
const words = text(create, 'cart-count-text', null, Style.Label, t.count, 'Text', { ...WORDS, lineHeight: '1' }, 'span');
|
|
337
349
|
bindSlot(words, 'content', '$cart', 'count');
|
|
338
350
|
count.children = [words];
|
|
339
351
|
root.children = [icon(create, 'cart-icon', 'ph ph-handbag'), count];
|
|
@@ -341,56 +353,57 @@ export function buildCartButtonRecipe(create: CompositeNodeFactory): CompositeNo
|
|
|
341
353
|
}
|
|
342
354
|
|
|
343
355
|
/** One cart line: thumbnail · title, variant, quantity and Remove · line total (board 10). */
|
|
344
|
-
function buildCartLine(create: CompositeNodeFactory): CompositeNode {
|
|
356
|
+
function buildCartLine(create: CompositeNodeFactory, t: ShopRecipeWords): CompositeNode {
|
|
345
357
|
const line = part(create, 'cart-line', Type.Container, ShopRole.CartLine, Style.CartLine, {}, 'Line',
|
|
346
358
|
{ display: 'grid', gridTemplateColumns: 'var(--iox-cart-thumb-size) minmax(0, 1fr) auto', alignItems: 'start', gap: '12px', width: '100%', height: 'auto', minHeight: 'auto', padding: ZERO });
|
|
347
359
|
const image = part(create, 'cart-line-image', Type.Image, ShopRole.CartLineImage, Style.Media, { src: '', alt: '' }, 'Image',
|
|
348
360
|
{ width: 'var(--iox-cart-thumb-size)', height: 'var(--iox-cart-thumb-size)', minHeight: '0px', objectFit: 'cover', aspectRatio: '1 / 1' });
|
|
349
361
|
const info = part(create, 'cart-line-info', Type.Container, null, null, {}, 'Details', { ...COLUMN, gap: '2px', minWidth: '0px' });
|
|
350
|
-
const title = text(create, 'cart-line-title', ShopRole.CartLineTitle, Style.Body,
|
|
351
|
-
const variant = text(create, 'cart-line-variant', ShopRole.CartLineVariant, Style.Small,
|
|
362
|
+
const title = text(create, 'cart-line-title', ShopRole.CartLineTitle, Style.Body, t.lineTitle, 'Title', { ...WORDS, fontWeight: '500' });
|
|
363
|
+
const variant = text(create, 'cart-line-variant', ShopRole.CartLineVariant, Style.Small, t.lineVariant, 'Variant', { ...WORDS, margin: '0px 0px 6px 0px' });
|
|
352
364
|
const actions = part(create, 'cart-line-actions', Type.Container, null, null, {}, 'Actions', { ...ROW, gap: '12px' });
|
|
353
365
|
const remove = button(create, 'cart-line-remove', ShopRole.CartLineRemove, Style.Ghost, 'Remove', '', { padding: '4px 4px 4px 4px', width: 'auto', height: 'auto', minHeight: 'auto' });
|
|
354
|
-
remove.children = [text(create, 'cart-line-remove-text', null, Style.Small,
|
|
366
|
+
remove.children = [text(create, 'cart-line-remove-text', null, Style.Small, t.remove, 'Text', WORDS, 'span')];
|
|
355
367
|
actions.children = [buildQuantityRecipe(create, true, 'cart-line-quantity'), remove];
|
|
356
368
|
info.children = [title, variant, actions];
|
|
357
|
-
const total = text(create, 'cart-line-total', ShopRole.CartLineTotal, Style.Price,
|
|
369
|
+
const total = text(create, 'cart-line-total', ShopRole.CartLineTotal, Style.Price, t.lineTotal, 'Line total',
|
|
358
370
|
{ ...WORDS, fontSize: 'var(--iox-size-body)', textAlign: 'end' });
|
|
359
371
|
line.children = [image, info, total];
|
|
360
372
|
return line;
|
|
361
373
|
}
|
|
362
374
|
|
|
363
375
|
/** The cart drawer: a Dialog at the end edge (a bottom sheet on a phone — shared CSS), filled from the PRICED cart. */
|
|
364
|
-
export function buildCartDrawerRecipe(create: CompositeNodeFactory): CompositeNode {
|
|
376
|
+
export function buildCartDrawerRecipe(create: CompositeNodeFactory, lang: string | null = 'en'): CompositeNode {
|
|
377
|
+
const t = shopRecipeWords(lang);
|
|
365
378
|
const drawer = part(create, 'cart-drawer', Type.Dialog, ShopRole.CartDrawer, Style.Dialog, {}, SHOP_LABELS.cartDrawer,
|
|
366
379
|
{ width: '380px', maxWidth: '100%', display: 'flex', flexDirection: 'column', gap: '14px' });
|
|
367
380
|
writeProp(drawer, 'placement', 'end');
|
|
368
381
|
writeProp(drawer, 'closeOnBackdrop', true);
|
|
369
382
|
writeProp(drawer, 'showCloseButton', false);
|
|
370
|
-
writeProp(drawer, 'ariaLabel',
|
|
383
|
+
writeProp(drawer, 'ariaLabel', t.drawer);
|
|
371
384
|
|
|
372
385
|
const head = part(create, 'cart-head', Type.Container, null, null, {}, 'Head', { ...ROW, width: '100%', justifyContent: 'space-between', gap: '12px' });
|
|
373
|
-
const title = part(create, 'cart-title', Type.Heading, ShopRole.CartTitle, Style.Title, { content:
|
|
386
|
+
const title = part(create, 'cart-title', Type.Heading, ShopRole.CartTitle, Style.Title, { content: t.drawer, level: 'h2' }, 'Title', WORDS);
|
|
374
387
|
const close = button(create, 'cart-close', ShopRole.CartClose, Style.Ghost, 'Close', '', { padding: '4px 4px 4px 4px', width: 'auto', height: 'auto', minHeight: 'auto' });
|
|
375
|
-
close.children = [text(create, 'cart-close-text', null, Style.Small,
|
|
388
|
+
close.children = [text(create, 'cart-close-text', null, Style.Small, t.close, 'Text', WORDS, 'span')];
|
|
376
389
|
onClick(close, 'closeDialog', drawer.id ?? '');
|
|
377
390
|
head.children = [title, close];
|
|
378
391
|
|
|
379
392
|
const lines = part(create, 'cart-lines', Type.Container, ShopRole.CartLines, null, {}, 'Lines', { ...COLUMN, gap: '16px' });
|
|
380
|
-
lines.children = [buildCartLine(create)];
|
|
393
|
+
lines.children = [buildCartLine(create, t)];
|
|
381
394
|
const issues = text(create, 'cart-issues', ShopRole.CartIssues, Style.Small, '', 'Issues', { ...WORDS, color: 'var(--iox-danger)' });
|
|
382
|
-
const empty = text(create, 'cart-empty', ShopRole.CartEmpty, Style.Body,
|
|
383
|
-
const note = text(create, 'cart-shipping-note', ShopRole.CartShippingNote, Style.CartNote,
|
|
395
|
+
const empty = text(create, 'cart-empty', ShopRole.CartEmpty, Style.Body, t.empty, 'Empty');
|
|
396
|
+
const note = text(create, 'cart-shipping-note', ShopRole.CartShippingNote, Style.CartNote, t.shippingNote, 'Free delivery note',
|
|
384
397
|
{ width: 'auto', minHeight: 'auto', margin: ZERO });
|
|
385
398
|
const summary = part(create, 'cart-summary', Type.Container, ShopRole.CartSummary, null, {}, 'Subtotal', { ...ROW, width: '100%', justifyContent: 'space-between', gap: '12px' });
|
|
386
|
-
const subtotal = text(create, 'cart-subtotal', ShopRole.CartSubtotal, Style.Body,
|
|
399
|
+
const subtotal = text(create, 'cart-subtotal', ShopRole.CartSubtotal, Style.Body, t.subtotal, 'Amount', { ...WORDS, fontVariantNumeric: 'tabular-nums', fontWeight: '600' }, 'span');
|
|
387
400
|
bindSlot(subtotal, 'content', '$cart', 'subtotal', true);
|
|
388
|
-
summary.children = [text(create, 'cart-subtotal-label', null, Style.Body,
|
|
389
|
-
const vat = text(create, 'cart-vat-note', ShopRole.CartVatNote, Style.Small,
|
|
401
|
+
summary.children = [text(create, 'cart-subtotal-label', null, Style.Body, t.subtotalLabel, 'Label', WORDS, 'span'), subtotal];
|
|
402
|
+
const vat = text(create, 'cart-vat-note', ShopRole.CartVatNote, Style.Small, t.vatNote, 'VAT note');
|
|
390
403
|
const checkout = button(create, 'checkout', ShopRole.Checkout, Style.Primary, 'Check out', '', { display: 'inline-flex', justifyContent: 'center', alignItems: 'center', width: '100%', height: 'auto' });
|
|
391
|
-
checkout.children = [text(create, 'checkout-label', null, Style.Label,
|
|
404
|
+
checkout.children = [text(create, 'checkout-label', null, Style.Label, t.checkout, 'Text', WORDS, 'span')];
|
|
392
405
|
const keep = button(create, 'keep-shopping', ShopRole.KeepShopping, Style.Secondary, 'Keep shopping', '', { display: 'inline-flex', justifyContent: 'center', alignItems: 'center', width: '100%', height: 'auto' });
|
|
393
|
-
keep.children = [text(create, 'keep-shopping-label', null, Style.Label,
|
|
406
|
+
keep.children = [text(create, 'keep-shopping-label', null, Style.Label, t.keepShopping, 'Text', WORDS, 'span')];
|
|
394
407
|
onClick(keep, 'closeDialog', drawer.id ?? '');
|
|
395
408
|
drawer.children = [head, lines, issues, empty, note, summary, vat, checkout, keep];
|
|
396
409
|
return drawer;
|
|
@@ -407,14 +420,15 @@ export enum ShopRecipe {
|
|
|
407
420
|
CartDrawer = 'cartDrawer',
|
|
408
421
|
}
|
|
409
422
|
|
|
410
|
-
|
|
423
|
+
/** Each recipe in the site's language (`lang` — vectoriox/iox-ui#100; English when the host has none). */
|
|
424
|
+
export const SHOP_RECIPES: Readonly<Record<ShopRecipe, (create: CompositeNodeFactory, lang?: string | null) => CompositeNode>> = Object.freeze({
|
|
411
425
|
[ShopRecipe.Price]: buildPriceRecipe,
|
|
412
426
|
[ShopRecipe.Variants]: buildVariantPickerRecipe,
|
|
413
427
|
[ShopRecipe.Quantity]: (create: CompositeNodeFactory) => buildQuantityRecipe(create),
|
|
414
|
-
[ShopRecipe.Add]: buildAddToCartRecipe,
|
|
415
|
-
[ShopRecipe.BuyNow]: buildBuyNowRecipe,
|
|
416
|
-
[ShopRecipe.CartButton]: buildCartButtonRecipe,
|
|
417
|
-
[ShopRecipe.CartDrawer]: buildCartDrawerRecipe,
|
|
428
|
+
[ShopRecipe.Add]: (create: CompositeNodeFactory, lang?: string | null) => buildAddToCartRecipe(create, lang ?? 'en'),
|
|
429
|
+
[ShopRecipe.BuyNow]: (create: CompositeNodeFactory, lang?: string | null) => buildBuyNowRecipe(create, lang ?? 'en'),
|
|
430
|
+
[ShopRecipe.CartButton]: (create: CompositeNodeFactory, lang?: string | null) => buildCartButtonRecipe(create, lang ?? 'en'),
|
|
431
|
+
[ShopRecipe.CartDrawer]: (create: CompositeNodeFactory, lang?: string | null) => buildCartDrawerRecipe(create, lang ?? 'en'),
|
|
418
432
|
});
|
|
419
433
|
|
|
420
434
|
/** The recipe a site holds ONCE, as a global element after the page (the bag every page opens) — never in a section. */
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
SPEC_FLAVORS, TintId,
|
|
6
6
|
} from './design-token.model';
|
|
7
7
|
import type { FlavorRevertSnapshot } from './flavor-seed';
|
|
8
|
+
import { isArriveId, isMoveId } from './motion-language';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* The `settings.design` row (design-system plan §3f), read and written by ONE pair of functions so
|
|
@@ -38,6 +39,8 @@ export enum DesignConfigKey {
|
|
|
38
39
|
Scroll = 'scroll',
|
|
39
40
|
Animate = 'animate',
|
|
40
41
|
Between = 'between',
|
|
42
|
+
Feel = 'feel',
|
|
43
|
+
Headings = 'headings',
|
|
41
44
|
Revert = 'revert',
|
|
42
45
|
}
|
|
43
46
|
|
|
@@ -131,9 +134,17 @@ export function resolveDesignChoices(partial: Partial<DesignChoices> | null | un
|
|
|
131
134
|
tint: keyOf(SPEC_AXES.tints, asString(partial?.tint)) ?? pack.defaults.tint,
|
|
132
135
|
...(fonts ? { fonts } : {}),
|
|
133
136
|
...resolveDesignMotion(partial),
|
|
137
|
+
...resolveMotionLanguageChoices(partial),
|
|
134
138
|
};
|
|
135
139
|
}
|
|
136
140
|
|
|
141
|
+
/** The look's motion language as stored: a known Feel / Headings word is kept, anything else is absent (AW3). */
|
|
142
|
+
export function resolveMotionLanguageChoices(partial: Readonly<Partial<Record<'feel' | 'headings', unknown>>> | null | undefined): Pick<DesignChoices, 'feel' | 'headings'> {
|
|
143
|
+
const feel = asString(partial?.feel);
|
|
144
|
+
const headings = asString(partial?.headings);
|
|
145
|
+
return { ...(isArriveId(feel) ? { feel } : {}), ...(isMoveId(headings) ? { headings } : {}) };
|
|
146
|
+
}
|
|
147
|
+
|
|
137
148
|
/** The look's motion, completed: an absent or unknown choice reads `PRE_MOTION` — what the site already does. */
|
|
138
149
|
export function resolveDesignMotion(partial: Readonly<Partial<Record<keyof DesignMotion, unknown>>> | null | undefined): DesignMotion {
|
|
139
150
|
return {
|
|
@@ -184,6 +195,8 @@ export function readDesignConfig(config: ReadonlyArray<DesignConfigEntry> | null
|
|
|
184
195
|
scroll: map.get(DesignConfigKey.Scroll) as ScrollId,
|
|
185
196
|
animate: map.get(DesignConfigKey.Animate) as AnimateId,
|
|
186
197
|
between: map.get(DesignConfigKey.Between) as BetweenId,
|
|
198
|
+
feel: asString(map.get(DesignConfigKey.Feel)) ?? undefined,
|
|
199
|
+
headings: asString(map.get(DesignConfigKey.Headings)) ?? undefined,
|
|
187
200
|
});
|
|
188
201
|
return {
|
|
189
202
|
choices,
|
|
@@ -226,6 +239,8 @@ export function designConfigEntries(
|
|
|
226
239
|
{ key: DesignConfigKey.Scroll, value: c.scroll },
|
|
227
240
|
{ key: DesignConfigKey.Animate, value: c.animate },
|
|
228
241
|
{ key: DesignConfigKey.Between, value: c.between },
|
|
242
|
+
...(c.feel ? [{ key: DesignConfigKey.Feel, value: c.feel }] : []),
|
|
243
|
+
...(c.headings ? [{ key: DesignConfigKey.Headings, value: c.headings }] : []),
|
|
229
244
|
...(c.fonts ? [{ key: DesignConfigKey.Fonts, value: JSON.stringify(c.fonts) }] : []),
|
|
230
245
|
...(revert ? [{ key: DesignConfigKey.Revert, value: JSON.stringify(revert) }] : []),
|
|
231
246
|
];
|
|
@@ -239,5 +254,6 @@ export function sameDesignChoices(a: DesignChoices, b: DesignChoices): boolean {
|
|
|
239
254
|
&& x.shape === y.shape && x.density === y.density && x.motion === y.motion
|
|
240
255
|
&& x.pillButtons === y.pillButtons && x.mode === y.mode && x.tint === y.tint
|
|
241
256
|
&& x.scroll === y.scroll && x.animate === y.animate && x.between === y.between
|
|
257
|
+
&& (x.feel ?? '') === (y.feel ?? '') && (x.headings ?? '') === (y.headings ?? '')
|
|
242
258
|
&& JSON.stringify(x.fonts ?? {}) === JSON.stringify(y.fonts ?? {});
|
|
243
259
|
}
|
|
@@ -50,7 +50,7 @@ export const PRE_TINT_DEFAULT: TintId = 'neutral';
|
|
|
50
50
|
export type ScrollId = keyof typeof SPEC_AXES.scrolls;
|
|
51
51
|
/** How much the sections move in as they scroll into view: Still · Subtle · Standard · Lively. */
|
|
52
52
|
export type AnimateId = keyof typeof SPEC_AXES.animations;
|
|
53
|
-
/** What plays between pages: None · Fade · Slide · Cinematic. */
|
|
53
|
+
/** What plays between pages: None · Fade · Slide · Cinematic, and the covers (AW4). */
|
|
54
54
|
export type BetweenId = keyof typeof SPEC_AXES.betweens;
|
|
55
55
|
export const SCROLL_IDS = Object.keys(SPEC_AXES.scrolls) as ReadonlyArray<ScrollId>;
|
|
56
56
|
export const ANIMATE_IDS = Object.keys(SPEC_AXES.animations) as ReadonlyArray<AnimateId>;
|
|
@@ -86,6 +86,12 @@ export interface DesignChoices {
|
|
|
86
86
|
scroll?: ScrollId;
|
|
87
87
|
animate?: AnimateId;
|
|
88
88
|
between?: BetweenId;
|
|
89
|
+
/** The look's motion language (AW3, MB-D5) — Design ▸ Motion ▸ Feel: the curve things arrive on (the leave
|
|
90
|
+
* follows it). Absent = the contract's default arrival (a row stored before AW3). An `ArriveId`. */
|
|
91
|
+
feel?: string;
|
|
92
|
+
/** Design ▸ Motion ▸ Headings arrive: the look's ONE heading move. Absent = each level's own heading entrance
|
|
93
|
+
* (MB-D8 — what a page built before AW3 was stamped with). A `MoveId`. */
|
|
94
|
+
headings?: string;
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
export interface FlavorSpecToken {
|