efficient-storefront-blocks 0.84.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/chunks/{EditorPreviewCheckout-3NVDTH56.js → EditorPreviewCheckout-4XHYYAT2.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-77K7CGYZ.js → SiteEditorProvider-X4YKBAJ4.js} +1 -1
- package/dist/chunks/{chunk-F3MB7QCR.js → chunk-KKKMX6LH.js} +1 -1
- package/dist/chunks/{chunk-VJLQXB7I.js → chunk-NFXV7HDB.js} +1 -1
- package/dist/chunks/chunk-NNBMZAW4.js +340 -0
- package/dist/chunks/chunk-VG4SUIRK.js +1 -0
- package/dist/chunks/{chunk-VYOK2XBF.js → chunk-Y5LB56KB.js} +1 -1
- package/dist/chunks/{fitment-data-PWXEDMOA.js → fitment-data-2I2FDPXW.js} +1 -1
- package/dist/contract.js +2 -2
- package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/config.d.ts +1 -0
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/document/popup-look-fields.d.ts +4 -0
- package/dist/editor/lib/document/popup-look-fields.js +1 -0
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +8 -1
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +124 -52
- package/dist/render/app/globals.css +156 -0
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +1 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/CartDrawer.d.ts +4 -3
- package/dist/render/components/CartDrawer.js +1 -4
- package/dist/render/components/DetailRows.d.ts +6 -1
- package/dist/render/components/DetailRows.js +1 -1
- package/dist/render/components/PopupFrame.d.ts +10 -1
- package/dist/render/components/PopupFrame.js +5 -1
- package/dist/render/components/Reviews.d.ts +1 -0
- package/dist/render/components/Reviews.js +1 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicDetailRows.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicDetailRows.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/commerce/DetailRows/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/current-record.d.ts +4 -15
- package/dist/render/lib/document/current-record.js +1 -1
- package/dist/render/lib/document/render-config.d.ts +1 -0
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-detail.d.ts +2 -0
- package/dist/render/lib/document/section-to-box-rows-detail.js +1 -0
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/sections/section-band.d.ts +6 -0
- package/dist/render/lib/sections/section-band.js +1 -1
- package/dist/render/lib/sections/spec-table-band.d.ts +4 -0
- package/dist/render/lib/sections/spec-table-band.js +1 -0
- package/dist/words.d.ts +34 -12
- package/dist/words.js +5 -5
- package/package.json +4 -3
- package/dist/chunks/chunk-5EQD5D3L.js +0 -340
- package/dist/chunks/chunk-DQFD2BJD.js +0 -1
- /package/dist/chunks/{chunk-5EQD5D3L.js.LEGAL.txt → chunk-NNBMZAW4.js.LEGAL.txt} +0 -0
|
@@ -859,6 +859,32 @@
|
|
|
859
859
|
[data-sf-card-shadow="soft"], [data-sf-box-shadow="soft"] { --sf-shadow-step: 0 1px 2px color-mix(in srgb, var(--sf-shadow-color, #141416) 7%, transparent), 0 4px 12px -4px color-mix(in srgb, var(--sf-shadow-color, #141416) 10%, transparent); }
|
|
860
860
|
[data-sf-card-shadow="lifted"], [data-sf-box-shadow="lifted"] { --sf-shadow-step: 0 2px 4px color-mix(in srgb, var(--sf-shadow-color, #141416) 6%, transparent), 0 14px 30px -10px color-mix(in srgb, var(--sf-shadow-color, #141416) 22%, transparent); }
|
|
861
861
|
[data-sf-box-shadow] { box-shadow: var(--sf-shadow-step); }
|
|
862
|
+
/* A Box's own Shadow per view (three-views plan 5e, part B2): the builder writes
|
|
863
|
+
`data-sf-box-shadow-tablet` / `-phone` = `on` | `off` only where a view's
|
|
864
|
+
answer differs from the desktop's. Same widths as the Block spacing views. */
|
|
865
|
+
@media (min-width: 720px) and (max-width: 1099.98px) {
|
|
866
|
+
[data-sf-box-shadow-tablet="on"] { box-shadow: var(--sf-shadow-step); }
|
|
867
|
+
[data-sf-box-shadow-tablet="off"] { box-shadow: none; }
|
|
868
|
+
}
|
|
869
|
+
@media not all and (min-width: 720px) {
|
|
870
|
+
[data-sf-box-shadow-phone="on"] { box-shadow: var(--sf-shadow-step); }
|
|
871
|
+
[data-sf-box-shadow-phone="off"] { box-shadow: none; }
|
|
872
|
+
}
|
|
873
|
+
/* A Box's Fill colour and Darken per view (three-views plan 5e, part B3). The
|
|
874
|
+
desktop answer stays INLINE (`background-color` on the Box or its card layer,
|
|
875
|
+
`background` on its Darken wash layer); the builder adds
|
|
876
|
+
`sf-fill-tablet` / `-phone` + `--sf-fill-tablet` / `-phone`, and
|
|
877
|
+
`sf-wash-tablet` / `-phone` + `--sf-wash-tablet` / `-phone`, only where a
|
|
878
|
+
view's answer differs (a phone that follows the tablet carries the phone
|
|
879
|
+
pair too). `!important` so the view beats the inline desktop style. */
|
|
880
|
+
@media (min-width: 720px) and (max-width: 1099.98px) {
|
|
881
|
+
.sf-fill-tablet { background-color: var(--sf-fill-tablet) !important; }
|
|
882
|
+
.sf-wash-tablet { background: var(--sf-wash-tablet) !important; }
|
|
883
|
+
}
|
|
884
|
+
@media not all and (min-width: 720px) {
|
|
885
|
+
.sf-fill-phone { background-color: var(--sf-fill-phone) !important; }
|
|
886
|
+
.sf-wash-phone { background: var(--sf-wash-phone) !important; }
|
|
887
|
+
}
|
|
862
888
|
|
|
863
889
|
/* ─── Heading compression ──────────────────────────────────────────────
|
|
864
890
|
The Appearance panel's "Headings" compression rung, applied to real headings
|
|
@@ -3363,6 +3389,136 @@ em.text-accent {
|
|
|
3363
3389
|
padding-block: 0;
|
|
3364
3390
|
}
|
|
3365
3391
|
|
|
3392
|
+
/* A Box's own Block spacing per view (three-views plan 5e, part B2). The
|
|
3393
|
+
builder (efficient-web-builder Flex) writes the desktop answer as above and,
|
|
3394
|
+
only where a view's answer differs from the desktop's, `sf-box-each-tablet` /
|
|
3395
|
+
`sf-box-gap-only-tablet` (and `-phone`; a phone that follows the tablet
|
|
3396
|
+
carries its class too). Each: `revert-layer`, because the rule above is
|
|
3397
|
+
unlayered, so this hands every block shape its own layered `py-*` back.
|
|
3398
|
+
Gap only: `0`, as above. The block shapes are the ones above, each one.
|
|
3399
|
+
Widths: the Tablet view's (720 up to, not including, 1100; the builder's
|
|
3400
|
+
`TABLET_MEDIA`) and the phone's below 720, as the section border's. After the
|
|
3401
|
+
desktop rule, so it wins at equal specificity.
|
|
3402
|
+
scripts/test-box-views-sheet.ts, scripts/browser-box-views.tsx. */
|
|
3403
|
+
@media (min-width: 720px) and (max-width: 1099.98px) {
|
|
3404
|
+
.sf-box-each-tablet > *,
|
|
3405
|
+
.sf-box-each-tablet > .sf-entrance > *,
|
|
3406
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > *,
|
|
3407
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-entrance > *,
|
|
3408
|
+
.sf-box-each-tablet > .sf-section-pad > *,
|
|
3409
|
+
.sf-box-each-tablet > .sf-entrance > .sf-section-pad > *,
|
|
3410
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > *,
|
|
3411
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > *,
|
|
3412
|
+
.sf-box-each-tablet > .sf-block-size > *,
|
|
3413
|
+
.sf-box-each-tablet > .sf-block-size > .sf-entrance > *,
|
|
3414
|
+
.sf-box-each-tablet > .sf-block-size > .sf-section-pad > *,
|
|
3415
|
+
.sf-box-each-tablet > .sf-block-size > .sf-entrance > .sf-section-pad > *,
|
|
3416
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > *,
|
|
3417
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > *,
|
|
3418
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-section-pad > *,
|
|
3419
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3420
|
+
padding-block: revert-layer;
|
|
3421
|
+
}
|
|
3422
|
+
/* …but `revert-layer` also drops a nested Box's own Overlap padding (its
|
|
3423
|
+
unlayered `.sf-gap-overlap-*` rule, above), which an Each Box draws: so a
|
|
3424
|
+
block shape that IS an Overlap Box takes its overlap padding back here. */
|
|
3425
|
+
.sf-box-each-tablet > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3426
|
+
.sf-box-each-tablet > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3427
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3428
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3429
|
+
.sf-box-each-tablet > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3430
|
+
.sf-box-each-tablet > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3431
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3432
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3433
|
+
.sf-box-each-tablet > .sf-block-size > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3434
|
+
.sf-box-each-tablet > .sf-block-size > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3435
|
+
.sf-box-each-tablet > .sf-block-size > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3436
|
+
.sf-box-each-tablet > .sf-block-size > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3437
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3438
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3439
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3440
|
+
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both) {
|
|
3441
|
+
padding-block: var(--sf-gap-overlap-eff);
|
|
3442
|
+
}
|
|
3443
|
+
.sf-box-gap-only-tablet > *,
|
|
3444
|
+
.sf-box-gap-only-tablet > .sf-entrance > *,
|
|
3445
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > *,
|
|
3446
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-entrance > *,
|
|
3447
|
+
.sf-box-gap-only-tablet > .sf-section-pad > *,
|
|
3448
|
+
.sf-box-gap-only-tablet > .sf-entrance > .sf-section-pad > *,
|
|
3449
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > *,
|
|
3450
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > *,
|
|
3451
|
+
.sf-box-gap-only-tablet > .sf-block-size > *,
|
|
3452
|
+
.sf-box-gap-only-tablet > .sf-block-size > .sf-entrance > *,
|
|
3453
|
+
.sf-box-gap-only-tablet > .sf-block-size > .sf-section-pad > *,
|
|
3454
|
+
.sf-box-gap-only-tablet > .sf-block-size > .sf-entrance > .sf-section-pad > *,
|
|
3455
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > *,
|
|
3456
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > *,
|
|
3457
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-section-pad > *,
|
|
3458
|
+
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3459
|
+
padding-block: 0;
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
@media not all and (min-width: 720px) {
|
|
3463
|
+
.sf-box-each-phone > *,
|
|
3464
|
+
.sf-box-each-phone > .sf-entrance > *,
|
|
3465
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > *,
|
|
3466
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-entrance > *,
|
|
3467
|
+
.sf-box-each-phone > .sf-section-pad > *,
|
|
3468
|
+
.sf-box-each-phone > .sf-entrance > .sf-section-pad > *,
|
|
3469
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > *,
|
|
3470
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > *,
|
|
3471
|
+
.sf-box-each-phone > .sf-block-size > *,
|
|
3472
|
+
.sf-box-each-phone > .sf-block-size > .sf-entrance > *,
|
|
3473
|
+
.sf-box-each-phone > .sf-block-size > .sf-section-pad > *,
|
|
3474
|
+
.sf-box-each-phone > .sf-block-size > .sf-entrance > .sf-section-pad > *,
|
|
3475
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > *,
|
|
3476
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > *,
|
|
3477
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-section-pad > *,
|
|
3478
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3479
|
+
padding-block: revert-layer;
|
|
3480
|
+
}
|
|
3481
|
+
/* …but `revert-layer` also drops a nested Box's own Overlap padding (its
|
|
3482
|
+
unlayered `.sf-gap-overlap-*` rule, above), which an Each Box draws: so a
|
|
3483
|
+
block shape that IS an Overlap Box takes its overlap padding back here. */
|
|
3484
|
+
.sf-box-each-phone > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3485
|
+
.sf-box-each-phone > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3486
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3487
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3488
|
+
.sf-box-each-phone > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3489
|
+
.sf-box-each-phone > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3490
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3491
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3492
|
+
.sf-box-each-phone > .sf-block-size > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3493
|
+
.sf-box-each-phone > .sf-block-size > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3494
|
+
.sf-box-each-phone > .sf-block-size > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3495
|
+
.sf-box-each-phone > .sf-block-size > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3496
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3497
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3498
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3499
|
+
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both) {
|
|
3500
|
+
padding-block: var(--sf-gap-overlap-eff);
|
|
3501
|
+
}
|
|
3502
|
+
.sf-box-gap-only-phone > *,
|
|
3503
|
+
.sf-box-gap-only-phone > .sf-entrance > *,
|
|
3504
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > *,
|
|
3505
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-entrance > *,
|
|
3506
|
+
.sf-box-gap-only-phone > .sf-section-pad > *,
|
|
3507
|
+
.sf-box-gap-only-phone > .sf-entrance > .sf-section-pad > *,
|
|
3508
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-section-pad > *,
|
|
3509
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-entrance > .sf-section-pad > *,
|
|
3510
|
+
.sf-box-gap-only-phone > .sf-block-size > *,
|
|
3511
|
+
.sf-box-gap-only-phone > .sf-block-size > .sf-entrance > *,
|
|
3512
|
+
.sf-box-gap-only-phone > .sf-block-size > .sf-section-pad > *,
|
|
3513
|
+
.sf-box-gap-only-phone > .sf-block-size > .sf-entrance > .sf-section-pad > *,
|
|
3514
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > *,
|
|
3515
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > *,
|
|
3516
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-section-pad > *,
|
|
3517
|
+
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3518
|
+
padding-block: 0;
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3366
3522
|
/* ── THE VISITOR'S OWN "REDUCE MOTION" SETTING ──────────────────────────────
|
|
3367
3523
|
[ADD] The Site Respects Reduce Motion.
|
|
3368
3524
|
|
|
@@ -54,6 +54,7 @@ interface CartCtx {
|
|
|
54
54
|
warmCatalog: (kind?: ProductKind) => void;
|
|
55
55
|
add: (line: CartLine) => void;
|
|
56
56
|
addAndOpen: (line: CartLine) => void;
|
|
57
|
+
setAutoOpen: (on: boolean) => void;
|
|
57
58
|
remove: (id: string) => void;
|
|
58
59
|
setQty: (id: string, qty: number) => void;
|
|
59
60
|
replaceItems: (lines: CartLine[]) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as zt}from"react/jsx-runtime";import{createContext as Jt,useCallback as u,useContext as Xt,useEffect as y,useMemo as Nt,useRef as q,useState as i}from"react";import{usePathname as Yt}from"next/navigation";import{products as E}from"../lib/api/index.js";import{couponDeferredToCheckout as Gt}from"../lib/cart/coupon-preview.js";import{snapshotCartLines as Kt}from"../lib/cart/snapshot-lines.js";import{MAX_QTY_PER_LINE as Tt,orderLinesForSets as Zt,setPrice as $t}from"../lib/commerce.js";import{UNPRICED_LABEL as te}from"../lib/wheels/price-display.js";import{isValidEmail as ee}from"../lib/email-shape.js";import{trackAddToCart as ne}from"../lib/google-tag.js";import{shippingStatus as oe}from"../lib/cart/shipping-status.js";import{useCurrency as se}from"./CurrencyContext.js";const re=400,ue=400,ce=1500;function bt(a){return(a.components?.length??0)>0}function qt(a,s){return{code:a,valid:s.valid,deferred:Gt(s,s.askedAsShopper),message:s.message||void 0,effects:s.effects??void 0}}function Bt(a,s){return $t(a.components,s)}function W(a,s){const r=Bt(a,s);return r===null?null:r*a.qty}function Mt(a){return a!=="tyre"}const Ot=Jt(null);function Ne({children:a,preview:s=!1}){const{currency:r,country:Q,formatMoney:It}=se(),[H,R]=i(s),[l,O]=i([]),[V,xt]=i([]),[j,At]=i([]),[F,St]=i(!1),[v,_t]=i(!1),[Pt,Dt]=i(!1),[Rt,Ut]=i(!1),[m,z]=i(null),[kt,wt]=i(0),J=u(()=>wt(t=>t+1),[]),[X,Y]=i(void 0),[N,Lt]=i(null),[c,C]=i(null),[G,I]=i(!1),[p,K]=i(null),x=q(void 0),T=u(()=>R(!0),[]),A=u(()=>R(!1),[]),Z=u(()=>R(t=>!t),[]);y(()=>{s||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&T()},[T,s]);const S=Yt(),$=q(S);y(()=>{$.current!==S&&($.current=S,s||A())},[S,s,A]);const tt=u(t=>{Lt(e=>e?.country===t?.country&&e?.subdivision===t?.subdivision&&e?.postcode===t?.postcode?e:t)},[]),et=u(t=>{Ut(!0),Mt(t)&&Dt(!0)},[]),nt=Pt||l.some(t=>Mt(t.kind)),ot=Rt||l.length>0;y(()=>{if(s||!nt||F)return;let t=!0;return E.listWheels().then(e=>{t&&(xt(e),St(!0))}),()=>{t=!1}},[s,nt,F]),y(()=>{if(s||!ot||v)return;let t=!0;return E.listBundles().then(e=>{t&&(At(e),_t(!0))}),()=>{t=!1}},[s,ot,v]);const g=m?.deliveryOptions??[],st=m?.courier??null;y(()=>{m&&K(t=>t&&g.some(e=>e.id===t)?t:g[0]?.id??null)},[m]);const _=u(()=>l.filter(bt).flatMap(t=>Zt(t.components,t.qty)),[l]),rt=u(async(t,e)=>{const o=t.trim().toUpperCase();if(!o)return;const n=_();if(n.length===0){C({code:o,valid:!1,message:"Add a wheel to the cart first."});return}I(!0),x.current=e;try{const d=await E.validateCoupon({code:o,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:e});C(qt(o,d))}catch{C({code:o,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{I(!1)}},[_,r,p]),ut=u(()=>{C(null),x.current=void 0},[]),ct=u(t=>{if(!c)return;const{code:e}=c;C(o=>o&&o.code===e?{code:e,valid:!1,refused:!0,message:t}:o)},[c]);y(()=>{if(!c||c.refused)return;const t=c.code,e=n=>n!==null&&n.code===t&&!n.refused,o=setTimeout(async()=>{const n=_();if(n.length===0){C(d=>e(d)?{code:t,valid:!1,message:"Add a wheel to the cart first."}:d);return}I(!0);try{const d=await E.validateCoupon({code:t,items:n,currency:r,shippingMethodId:p??void 0,customerEmail:x.current});C(M=>e(M)?qt(t,d):M)}catch{}finally{I(!1)}},re);return()=>clearTimeout(o)},[l,r,p]);const U=c&&!c.refused?c.code:void 0;y(()=>{if(s)return;let t=!0;const e=setTimeout(async()=>{const o=_();if(o.length===0){z(null),Y(void 0);return}try{const n=await E.quoteCart({items:o,currency:r,shippingMethodId:p??void 0,couponCode:U,customerEmail:x.current||void 0,country:N?.country||Q||void 0,subdivision:N?.country&&N.subdivision||void 0,postcode:N?.country&&N.postcode||void 0});if(!t)return;z(n)}catch{if(!t)return}Y(U)},ue);return()=>{t=!1,clearTimeout(e)}},[l,r,p,U,Q,N,kt]);const P=u(t=>{O(e=>{const o=e.findIndex(n=>n.id===t.id);return o===-1?[...e,t]:e.map((n,d)=>d===o?{...n,qty:Math.min(Tt,n.qty+t.qty)}:n)}),ne(t,r)},[r]),it=u(t=>{O(e=>e.filter(o=>o.id!==t))},[]),at=u((t,e)=>{const o=Math.max(1,Math.min(Tt,e));O(n=>n.map(d=>d.id===t?{...d,qty:o}:d))},[]),lt=u(t=>{O(t)},[]),[B,Wt]=i(null),dt=q(null);dt.current=B;const h=q(null),k=q(""),ft=u((t,e)=>{const o=t.trim().toLowerCase();ee(o)&&Wt(n=>n&&n.email===o&&n.firstName===(e??"")?n:{email:o,firstName:e??""})},[]);y(()=>{if(s||!B)return;const t=Kt(l.filter(bt),n=>W(n,r)===null?te:It(W(n,r),r)),e={email:B.email,firstName:B.firstName,currency:r,items:t},o=JSON.stringify(e);if(o!==k.current)return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,k.current=o,E.captureCart(e).catch(n=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart capture failed",n)})},ce),()=>{h.current&&(clearTimeout(h.current),h.current=null)}},[l,B,r,s]);const mt=u(()=>{h.current&&(clearTimeout(h.current),h.current=null);const t=dt.current;t&&(k.current="",E.captureCart({email:t.email,firstName:t.firstName,currency:r,items:[]}).catch(e=>{process.env.NODE_ENV!=="production"&&console.warn("abandoned-cart clear failed",e)}))},[r]),pt=Nt(()=>{const t=l.reduce((f,b)=>{const D=W(b,r);return D===null?f:f+D},0),e=l.some(f=>Bt(f,r)===null),o=l.reduce((f,b)=>f+b.qty,0),n=c?.valid?c.effects:void 0,d=n?Math.min(t,Number(n.discountAmount)):0,M=m?.bundleDiscount??0,Ht=m?.appliedBundles??[],w=!!n?.freeShipping,gt=g.find(f=>f.id===p),Et=w?0:m?.shipping??gt?.amount??0,Vt=oe({quoted:m!==null,optionCount:g.length,chosenAmount:gt?.amount,couponWaivesFreight:w}),L={};for(const f of n?.freeUnits??[])L[f.partNumber]=(L[f.partNumber]??0)+f.quantity;const jt=m?.tax??null,Ft=m?m.grandTotal:t-d-M+Et;return{sets:o,units:l.reduce((f,b)=>f+(b.components??[]).reduce((D,vt)=>D+vt.wheels*b.qty,0),0),subtotal:t,hasUnpricedLine:e,discount:d,bundleDiscount:M,appliedBundles:Ht,shipping:Et,freeShipping:w,shippingStatus:Vt,freeUnitsByPartNumber:L,tax:jt,grand:Ft,repricing:!!c?.refused&&m!==null&&X===c?.code,currency:r}},[l,r,c,g,p,m,X]),ht=q(!0),yt=u(t=>{ht.current=t},[]),Ct=u(t=>{P(t),ht.current&&T()},[P,T]),Qt=Nt(()=>({isOpen:H,preview:s,open:T,close:A,toggle:Z,items:l,catalog:V,bundles:j,warmCatalog:et,add:P,addAndOpen:Ct,setAutoOpen:yt,remove:it,setQty:at,replaceItems:lt,identify:ft,clearCapturedCart:mt,coupon:c,applyCoupon:rt,removeCoupon:ut,refuseCoupon:ct,couponBusy:G,deliveryOptions:g,setQuoteDestination:tt,courier:st,requote:J,shippingMethodId:p,setShippingMethodId:K,totals:pt}),[H,s,T,A,Z,l,V,j,et,P,Ct,yt,it,at,lt,ft,mt,c,rt,ut,ct,G,g,tt,st,J,p,pt]);return zt(Ot.Provider,{value:Qt,children:a})}function Te(){const a=Xt(Ot);if(!a)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return a}export{Ne as CartProvider,bt as isOrderable,W as lineTotal,Te as useCart};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type CartDrawerContent } from "efficient-web-builder/format/lib/content/cart-drawer";
|
|
2
|
-
export default function CartDrawer({ content, }: {
|
|
1
|
+
import { type CartDrawerContent, type CartDrawerLook } from "efficient-web-builder/format/lib/content/cart-drawer";
|
|
2
|
+
export default function CartDrawer({ content, look, }: {
|
|
3
3
|
content?: CartDrawerContent;
|
|
4
|
-
|
|
4
|
+
look?: CartDrawerLook;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as a
|
|
2
|
-
@keyframes storefront-cart-fade { from { opacity: 0 } to { opacity: 1 } }
|
|
3
|
-
@keyframes storefront-cart-slide { from { transform: translateX(40px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
|
|
4
|
-
`}),r(h,{content:e,closeRef:s}),r(R,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(w,{content:e,tyres:f}),r(D,{}),r(g,{}),r(v,{content:e})]}),r(k,{}),r(C,{})]})]}):null}export{_ as default};
|
|
1
|
+
"use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as p,useRef as f}from"react";import{useCart as u}from"./CartContext.js";import{isTyreLine as C}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as d}from"./useTyreCatalog.js";import R from"./PopupFrame.js";import{CartActions as w,CartCouponRow as T,CartDrawerHeader as x,CartLines as O,CartStatusRail as _,CartTotals as v,CartTrustMarkers as y,CartUpsell as A}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as D,resolveCartDrawerLook as L}from"efficient-web-builder/format/lib/content/cart-drawer";const h=L(void 0);function j({content:e=D,look:o=h}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:t}=u(),s=f(null),m=d(c.some(C));return p(()=>{t(o.autoOpen)},[o.autoOpen,t]),a(R,{look:o,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:"Your cart",children:[r(x,{content:e,closeRef:s}),r(_,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(O,{content:e,tyres:m}),r(A,{}),r(T,{}),r(y,{content:e})]}),r(v,{}),r(w,{})]})}export{j as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import type { SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
|
|
2
3
|
export interface DetailSpec {
|
|
3
4
|
label?: string;
|
|
4
5
|
value?: string;
|
|
@@ -20,5 +21,9 @@ export interface DetailRowsProps {
|
|
|
20
21
|
padTop?: number;
|
|
21
22
|
padBottom?: number;
|
|
22
23
|
editing?: boolean;
|
|
24
|
+
template?: unknown;
|
|
25
|
+
nodeId?: string;
|
|
23
26
|
}
|
|
24
|
-
export
|
|
27
|
+
export declare function detailCardRow(row: DetailRow): SourceRow;
|
|
28
|
+
export declare function templateCanDraw(rows: readonly DetailRow[]): boolean;
|
|
29
|
+
export default function DetailRows({ rows, startLeft, layout, padTop, padBottom, editing, template, nodeId, }: DetailRowsProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as o}from"react/jsx-runtime";import z from"./SectionBand.js";import T from"efficient-web-builder/render/components/Placeholder";import{withRMark as c}from"efficient-web-builder/render/components/RMark";import{renderGold as u}from"efficient-web-builder/render/components/goldPhrases";import{say as g}from"efficient-web-builder/format/lib/editor-words";import{stripMarkup as _}from"efficient-web-builder/format/lib/markup";import{finiteNumber as v}from"efficient-web-builder/format/lib/finite-number";import{CardTemplateRows as $}from"efficient-web-builder/render/components/CardRowContext";const p={body:"text-[length:var(--size-body,15px)]",labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function C(t){return{eyebrow:t.eyebrow?.trim()?t.eyebrow:"",title:t.title?.trim()?t.title:"",copy:t.copy?.trim()?t.copy:"",image:t.image?.trim()?t.image:"",tag:t.tag?.trim()?t.tag:""}}function S(t){return t.every(r=>!r.media&&!(r.specs??[]).some(n=>(n?.label??"").trim()||(n?.value??"").trim()))}const B="[&:not(:first-child)]:border-t [&:not(:first-child)]:border-line";function D({rows:t,startLeft:r=!1,layout:n="even",padTop:y,padBottom:w,editing:N=!1,template:k,nodeId:j}){const a=n==="narrow",f=v(y),x=v(w),h=(t??[]).filter(e=>(e?.eyebrow??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.tag??"").trim()||(e?.image??"").trim()),m=h.length>0?h:N?[{tag:g("Row {n}",{n:1})},{tag:g("Row {n}",{n:2})},{tag:g("Row {n}",{n:3})}]:[];return m.length===0?null:i(z,{className:"relative z-[2] border-b border-line bg-bg",style:{...f===void 0?{}:{paddingTop:f},...x===void 0?{}:{paddingBottom:x}},defaults:{paddingTop:100,paddingBottom:100},children:i($,{ownerId:j??"",ownerType:"DetailRows",Template:S(m)?k:void 0,rows:m.map(C),fallback:m.map((e,s)=>{const d=s%2===1!==r;return o("div",{className:["grid items-center py-[60px]",a?"grid-cols-[1fr_460px] gap-[72px]":"grid-cols-2 gap-12","max-view-desktop:grid-cols-1",d?"[direction:rtl] max-view-desktop:[direction:ltr]":"",s>0?"border-t border-line":""].join(" "),children:[o("div",{className:["[direction:ltr] flex flex-col gap-4",a?"max-w-[560px]":"",a&&!d?"ml-auto max-view-desktop:ml-0":""].join(" "),children:[e.eyebrow?.trim()&&i("div",{className:`font-mono ${p.labelLarge} uppercase tracking-[0.2em] text-accent`,children:c(e.eyebrow)}),e.title?.trim()&&i("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3vw,42px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-[1.1] tracking-[-0.02em]",children:u(e.title,!0)}),e.copy?.trim()&&i("p",{className:`${p.body} leading-[1.6] text-fg-dim`,children:u(e.copy,!1)}),(()=>{const b=(e.specs??[]).filter(l=>(l?.label??"").trim()||(l?.value??"").trim());return b.length===0?null:i("dl",{className:`mt-2 border-t border-line pt-3 font-mono ${p.label} uppercase tracking-[0.1em] leading-[2.1]`,children:b.map((l,R)=>o("div",{className:"flex items-baseline justify-between gap-6",children:[i("dt",{className:"text-fg-dim",children:c(l.label??"")}),i("dd",{className:"text-fg",children:c(l.value??"")})]},R))})})()]}),o("div",{className:["[direction:ltr] flex flex-col gap-3",a?d?"items-end":"items-start":"",a?"max-view-desktop:items-start":""].join(" "),children:[e.media?i("div",{className:"w-full",children:e.media}):i("div",{className:["relative overflow-hidden max-w-full",a?e.imageShape==="wide"?"w-[460px] aspect-[16/9]":"w-[360px] aspect-square":"aspect-square"].join(" "),children:i(T,{label:e.tag?.trim()||e.title?.trim()||`row-${s+1}`,src:e.image||void 0,alt:_(e.title?.trim()||e.tag?.trim()||""),showBackground:!e.image,objectFit:"contain",sizes:a?"(max-width: 1100px) 100vw, 460px":"(max-width: 1100px) 100vw, 50vw"})}),e.tag?.trim()&&i("span",{className:`font-mono ${p.labelSmall} uppercase tracking-[0.2em] text-fg-dim ${d?"text-left":"text-right"}`,children:c(e.tag)})]})]},s)}),wrapCopy:e=>i("div",{className:B,children:e}),children:e=>e})})}export{D as default,C as detailCardRow,S as templateCanDraw};
|
|
@@ -11,10 +11,19 @@ export interface SiteScrim {
|
|
|
11
11
|
animation?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare const SITE_BLUR: Record<SiteScrim["blur"], string>;
|
|
14
|
+
export interface DrawerFrame {
|
|
15
|
+
closeRef: RefObject<HTMLElement | null>;
|
|
16
|
+
lockScroll?: boolean;
|
|
17
|
+
}
|
|
14
18
|
export declare function tintOf(hex: string, opacity: number): string;
|
|
15
|
-
export
|
|
19
|
+
export declare function closeButtonPlace(look: Pick<PopupLook, "closeButton" | "fullWidth" | "height" | "width">): {
|
|
20
|
+
place: PopupLook["closeButton"];
|
|
21
|
+
until?: number;
|
|
22
|
+
};
|
|
23
|
+
export default function PopupFrame({ look, site, drawer, open, inline, modal, onClose, label, labelledBy, children, }: {
|
|
16
24
|
look?: PopupLook;
|
|
17
25
|
site?: SiteScrim;
|
|
26
|
+
drawer?: DrawerFrame;
|
|
18
27
|
open?: boolean;
|
|
19
28
|
inline?: boolean;
|
|
20
29
|
modal?: boolean;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as l,jsxs as b,Fragment as T}from"react/jsx-runtime";import{useCallback as N,useEffect as E,useRef as _}from"react";import{resolveCartDrawerLook as S}from"efficient-web-builder/format/lib/content/cart-drawer";import{useModalDismiss as W}from"./useModalDismiss.js";const D="color-mix(in oklab, var(--bg) 78%, transparent)",O={6:"backdrop-blur-[6px]",8:"backdrop-blur-[8px]"},z={popup:"z-[90]",consent:"z-[95]"},B=S(void 0).width,A="rgba(0,0,0,.5)",L={"top-left":{justifyContent:"flex-start",alignItems:"flex-start"},"top-center":{justifyContent:"center",alignItems:"flex-start"},"top-right":{justifyContent:"flex-end",alignItems:"flex-start"},left:{justifyContent:"flex-start",alignItems:"center"},center:{justifyContent:"center",alignItems:"center"},right:{justifyContent:"flex-end",alignItems:"center"},"bottom-left":{justifyContent:"flex-start",alignItems:"flex-end"},"bottom-center":{justifyContent:"center",alignItems:"flex-end"},"bottom-right":{justifyContent:"flex-end",alignItems:"flex-end"}};function v(t,e){const n=Number.parseInt(t.slice(1),16),s=n>>16&255,a=n>>8&255,o=n&255;return`rgba(${s}, ${a}, ${o}, ${Math.round(e)/100})`}function w(t,e){const n=e||t.closeButton!=="none";return t.outsideClick||!n}const g=48,P=46;function F(t){const e=t.height==="full";return t.closeButton==="inside"||!e&&!t.fullWidth?{place:t.closeButton}:t.closeButton==="outside"?{place:"inside"}:e&&t.fullWidth?{place:"inside"}:e?{place:"inside",until:t.width+g}:{place:"none"}}function H({look:t,site:e,drawer:n,open:s=!0,inline:a=!1,modal:o=!0,onClose:y,label:d,labelledBy:I,children:m}){const p=_(null),f=N(()=>y?.(),[y]),c=o&&!a;W({active:c&&s,onDismiss:f,focusRef:e?e.focusRef:n?void 0:p,trapRef:e?e.trapRef:n?p:void 0,lockScroll:n?.lockScroll});const x=n?.closeRef;if(E(()=>{!x||!c||!s||x.current?.focus({preventScroll:!0})},[x,c,s]),!a&&!s)return null;if(e){const r=["fixed inset-0",z[e.layer??"popup"],"flex items-center justify-center",e.scroll?"overflow-y-auto":"","p-6",O[e.blur],e.sheetOnPhone?"max-[880px]:items-end max-[880px]:p-0":""].filter(Boolean).join(" ");return l("div",{role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":I,"data-popup-frame":"site",onClick:u=>{u.target===u.currentTarget&&f()},className:r,style:{background:D,animation:e.animation},children:m})}if(!t)return null;if(n){const r=t.placement==="left",u=t.width!==B;return b(T,{children:[l("div",{onClick:c&&w(t,!0)?f:void 0,className:"fixed inset-0 z-[60] backdrop-blur-[4px]",style:{background:v(t.tintColor,t.tintOpacity).replaceAll(" ",""),animation:"storefront-cart-fade 350ms ease both"},"aria-hidden":"true"}),b("aside",{ref:p,role:"dialog","aria-label":d,"aria-modal":"true",className:`fixed inset-y-0 ${r?"left-0":"right-0"} z-[61] flex ${u?"w-[var(--sf-cart-drawer-width)]":"w-[520px]"} max-w-[100vw] flex-col ${r?"border-r":"border-l"} border-line bg-bg max-[640px]:w-screen ${r?"max-[640px]:border-r-0":"max-[640px]:border-l-0"}`,style:{...u?{"--sf-cart-drawer-width":`${t.width}px`}:null,animation:`${r?"storefront-cart-slide-left":"storefront-cart-slide"} 450ms cubic-bezier(.2,.7,.2,1) both`,boxShadow:`${r?"":"-"}30px 0 80px ${A}`},onClick:R=>R.stopPropagation(),children:[l("style",{children:`
|
|
2
|
+
@keyframes storefront-cart-fade { from { opacity: 0 } to { opacity: 1 } }
|
|
3
|
+
@keyframes storefront-cart-slide { from { transform: translateX(40px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
|
|
4
|
+
${r?` @keyframes storefront-cart-slide-left { from { transform: translateX(-40px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }
|
|
5
|
+
`:""}`}),m]})]})}const $=r=>{!c||!w(t,!1)||r.target===r.currentTarget&&f()},h=t.height==="full",C=t.fullWidth||h,i=F(t),j=b("div",{ref:p,tabIndex:-1,"data-popup-panel":"",className:"relative flex flex-col bg-bg text-fg outline-none",style:{width:t.fullWidth?"100%":`min(${t.width}px, 100%)`,height:h?"100%":void 0,maxHeight:t.fullWidth&&!h||i.place==="outside"?`calc(100% - ${g}px)`:"100%",borderRadius:C?0:"var(--sf-section-radius, 0px)",...o||a?null:{pointerEvents:"auto"}},children:[i.place!=="none"?l("button",{type:"button","aria-label":"Close",onClick:a?void 0:f,"data-popup-close":i.place,"data-popup-close-until":i.until,className:"absolute z-[5] flex h-[38px] w-[38px] items-center justify-center border border-line bg-bg font-mono text-[14px] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:i.place==="outside"?{top:-P,right:0}:{top:12,right:12},children:"×"}):null,i.until?l("style",{children:`@container popup-frame (min-width: ${i.until+1}px){[data-popup-close-until="${i.until}"]{display:none}}`}):null,l("div",{"data-popup-scroll":"",className:"min-h-0 flex-1",style:{overflow:"auto"},children:m})]});return l("div",{role:o||a?"dialog":"region","aria-modal":c?!0:void 0,"aria-label":d,"data-popup-frame":a?"inline":"live",onClick:$,className:a?"relative flex min-h-[100vh] w-full":"fixed inset-0 z-[90] flex",style:{...L[t.placement],background:v(t.tintColor,t.tintOpacity),padding:C?0:i.place==="outside"&&t.placement.startsWith("top")?`${24+g}px 24px 24px`:24,...i.until?{containerType:"inline-size",containerName:"popup-frame"}:null,...o||a?null:{pointerEvents:"none"}},children:j})}export{O as SITE_BLUR,D as SITE_TINT,F as closeButtonPlace,H as default,v as tintOf};
|
|
@@ -19,4 +19,5 @@ export interface ReviewsProps {
|
|
|
19
19
|
cards?: ReactNode;
|
|
20
20
|
omitHead?: boolean;
|
|
21
21
|
}
|
|
22
|
+
export declare const FRAME_OWN_BOX = "mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";
|
|
22
23
|
export default function Reviews({ look, eyebrow, title, columns, rows, editing, sample, cards, omitHead, }: ReviewsProps): import("react").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";import y from"./SectionBand.js";const t={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},w="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function k({look:d,eyebrow:n,title:r,columns:p,rows:s=[],editing:o=!1,sample:x=!1,cards:g,omitHead:l=!1}){const c=Math.min(3,Math.max(1,p??3));return!o&&s.length===0?null:i(y,{className:"relative z-[2] border-t border-line bg-surface",column:l?M:w,children:[l?null:i(h,{children:[(n??"").trim()&&e(u,{text:n??"",look:d,className:"mb-4 block"}),(r??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${t.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 ${t.headingMediumUpTo800}`,children:b(r??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(c)},children:g??s.map(a=>i("article",{className:["flex flex-col gap-4 bg-bg p-10 max-view-wide:p-8",x?"opacity-60":""].join(" "),children:[a.rating!==void 0&&e(N,{rating:a.rating}),(a.title??"").trim()&&e("h3",{className:`font-display ${t.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${t.bodySmall} leading-[1.65] text-fg-dim`,children:v(a.quote).map((f,m)=>e("p",{className:m?"mt-3":"",children:f},m))}),i("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${t.label} uppercase tracking-[0.22em] text-fg`,children:a.name}),e("span",{className:`font-mono ${t.label} uppercase tracking-[0.18em] text-fg-dim`,children:a.meta??""})]})]},a.key))})]})}export{k as default};
|
|
1
|
+
import{jsx as e,Fragment as h,jsxs as i}from"react/jsx-runtime";import u from"efficient-web-builder/render/components/SectionEyebrow";import{renderHeadline as b,splitParagraphs as v}from"efficient-web-builder/render/components/goldPhrases";import N from"./RatingStars.js";import y from"./SectionBand.js";const t={headingMediumUpTo800:"max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",headingMedium:"text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))]",bodySmall:"text-[length:var(--size-body,15px)]",bodyLarge:"text-[length:var(--size-body,19px)]",label:"text-[length:var(--size-label,12px)]"},w="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",M="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] pt-0 pb-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]";function k({look:d,eyebrow:n,title:r,columns:p,rows:s=[],editing:o=!1,sample:x=!1,cards:g,omitHead:l=!1}){const c=Math.min(3,Math.max(1,p??3));return!o&&s.length===0?null:i(y,{className:"relative z-[2] border-t border-line bg-surface",column:l?M:w,children:[l?null:i(h,{children:[(n??"").trim()&&e(u,{text:n??"",look:d,className:"mb-4 block"}),(r??"").trim()&&e("h2",{className:`mb-12 font-heading2 ${t.headingMedium} font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:mb-8 ${t.headingMediumUpTo800}`,children:b(r??"",!1)})]}),e("div",{className:"sf-card grid grid-cols-1 gap-px border border-line bg-line min-[700px]:[grid-template-columns:repeat(var(--rv-cols),minmax(0,1fr))]",style:{"--rv-cols":String(c)},children:g??s.map(a=>i("article",{className:["flex flex-col gap-4 bg-bg p-10 max-view-wide:p-8",x?"opacity-60":""].join(" "),children:[a.rating!==void 0&&e(N,{rating:a.rating}),(a.title??"").trim()&&e("h3",{className:`font-display ${t.bodyLarge} font-medium uppercase leading-[1.2] tracking-[-0.01em] text-fg`,children:a.title}),e("div",{className:`flex-1 font-serif ${t.bodySmall} leading-[1.65] text-fg-dim`,children:v(a.quote).map((f,m)=>e("p",{className:m?"mt-3":"",children:f},m))}),i("footer",{className:"flex items-baseline justify-between gap-4 border-t border-line pt-5",children:[e("span",{className:`font-mono ${t.label} uppercase tracking-[0.22em] text-fg`,children:a.name}),e("span",{className:`font-mono ${t.label} uppercase tracking-[0.18em] text-fg-dim`,children:a.meta??""})]})]},a.key))})]})}export{M as FRAME_OWN_BOX,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as z,jsx as e,jsxs as l}from"react/jsx-runtime";import C from"./SectionBand.js";import{SPEC_TABLE_BAND as w}from"../lib/sections/spec-table-band.js";import{useScopeClass as I}from"../lib/use-scope-class.js";import{useState as B}from"react";import D from"efficient-web-builder/render/components/SectionHeader";import{CardTemplateRows as R}from"efficient-web-builder/render/components/CardRowContext";import j from"./WheelSvg.js";import{renderGold as _,renderHeadline as A}from"efficient-web-builder/render/components/goldPhrases";import{inchLabel as y}from"../lib/wheels/spec-format.js";import V from"./DimensionArrowMarkers.js";import W from"./SpecTablePartBridge.js";import{SPEC_REGION_ATTR as P}from"efficient-web-builder/format/lib/sections/spec-table-regions";import{say as T}from"efficient-web-builder/format/lib/editor-words";import{applyShopMark as M}from"efficient-web-builder/format/lib/markup";import{useEnglish as G}from"./EnglishVariant.js";import{sizedImage as H}from"efficient-web-builder/format/lib/sized-image";const $={between:"[&>*+*]:border-t [&>*+*]:border-line",every:"[&>*]:border-t [&>*]:border-line"},E="[&_sup.text-accent.tracking-normal]:static [&_sup.text-accent.tracking-normal]:align-baseline [&_sup.text-accent.tracking-normal]:[font-size:inherit] [&_sup.text-accent.tracking-normal]:text-current [&_sup.text-accent.tracking-normal]:tracking-[inherit]",O="(max-width: 1100px) 80vw, 290px",d={labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,14px)]"};function r(i,a){return i?{[P]:a}:{}}function F({editing:i,nodeId:a,children:n}){return!i||!a?e(z,{children:n}):e(W,{nodeId:a,children:n})}function L({row:i,topBorder:a,editing:n}){return l("div",{className:`flex items-baseline justify-between gap-6 py-4 font-mono ${d.labelLarge} tracking-[0.05em] ${a?"border-t border-line":""}`,children:[e("span",{...r(n,"rowLabel"),className:"uppercase text-fg-dim",children:i.label}),e("span",{...r(n,"rowValue"),className:`text-right ${i.accent?"text-accent":"text-fg"}`,children:i.value})]})}function Y({diagram:i,editing:a}){const[n,x]=B(!1),o=I("spec"),{wheelName:p,imageSrc:s,diameter:f,width:g,offset:b,holes:v,pcd:S,spokes:m,mesh:c,bore:N}=i,u=!!s&&!n;return l("div",{className:"sf-card bg-surface p-6 max-view-desktop:mt-8",children:[e("div",{...r(a,"diagramTitle"),className:`mb-3 font-mono ${d.label} uppercase tracking-[0.25em] text-fg-dim`,children:"Wheel Dimension Diagram"}),l("div",{className:"relative flex aspect-square items-center justify-center",children:[l("svg",{viewBox:"0 0 320 320",className:"absolute inset-0 h-full w-full text-fg-dim",fill:"none",stroke:"currentColor",children:[e("line",{x1:40,y1:20,x2:280,y2:20,strokeWidth:1,markerStart:`url(#${o}-L)`,markerEnd:`url(#${o}-R)`}),e("line",{x1:40,y1:15,x2:40,y2:25,strokeWidth:1}),e("line",{x1:280,y1:15,x2:280,y2:25,strokeWidth:1}),e(V,{id:o})]}),u?e("img",{...H(s,{fallbackWidth:960}),sizes:O,alt:`${p} — face`,onError:()=>x(!0),loading:"lazy",className:"relative z-[1] block h-[80%] w-[80%] object-contain"}):e(j,{spokes:m,mesh:c,className:"relative z-[1] block h-[72%] w-[72%] text-accent"}),l("span",{...r(a,"diagramCallout"),className:`absolute top-1.5 left-1/2 z-20 -translate-x-1/2 bg-surface px-2 font-mono ${d.label} tracking-[0.2em] text-accent`,children:["⌀ ",y(f)]}),l("span",{...r(a,"diagramCallout"),className:`absolute bottom-1.5 left-1/2 z-20 -translate-x-1/2 bg-surface px-2 font-mono ${d.label} tracking-[0.2em] text-fg`,children:["WIDTH ",y(g)]})]}),l("div",{className:`mt-4 grid grid-cols-5 gap-3 font-mono ${d.labelSmall} uppercase tracking-[0.2em] text-fg-dim max-[480px]:grid-cols-3`,children:[l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Holes"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:v})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"PCD"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:S})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Spokes"}),l("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:[m,c?" + Mesh":""]})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"Bore"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-fg",children:N})]}),l("div",{children:[e("div",{...r(a,"diagramStatLabel"),className:"text-fg-dim/60",children:"ET"}),e("div",{...r(a,"diagramStatValue"),className:"mt-1 text-accent",children:b})]})]})]})}function Z({num:i,title:a,description:n,rows:x,builtInLabels:o=!1,diagram:p,editing:s=!1,omitHead:f=!1,nodeId:g,capped:b=!0,template:v}){const S=G(),m=(x??[]).filter(t=>(t?.label??"").trim()||(t?.value??"").trim()).map(t=>o&&t.label?{...t,label:S(t.label)}:t),c=m.length>0?m:s?[{label:T("Label"),value:T("Value")}]:[],N=c.map(t=>({label:t.label??"",value:t.accent&&t.value?M(t.value,0,t.value.length,"highlight").text:t.value??""})),u=t=>p?l("div",{className:"grid grid-cols-[1fr_400px] gap-12 max-view-desktop:grid-cols-1",children:[e("div",{className:t?`${$.between} ${E}`:void 0,children:t??c.map((k,h)=>e(L,{row:k,topBorder:h>0,editing:s},h))}),e(Y,{diagram:p,editing:s})]}):e("div",{className:`grid grid-cols-2 gap-x-16 max-[900px]:grid-cols-1${t?` ${$.every} ${E}`:""}`,children:t??c.map((k,h)=>e(L,{row:k,topBorder:!0,editing:s},h))});return e(C,{className:f?w.ownBox:w.inline,capped:b,children:l(F,{editing:s,nodeId:g,children:[f?null:e(D,{num:i?_(i):void 0,title:a?A(a,!1):void 0,description:n?_(n):void 0,accent:!0}),e(R,{ownerId:g??"",ownerType:"SpecTable",Template:v,rows:N,fallback:u(),children:t=>u(t)})]})})}export{Z as default};
|
|
@@ -8,6 +8,8 @@ interface Props {
|
|
|
8
8
|
padTop?: number;
|
|
9
9
|
padBottom?: number;
|
|
10
10
|
editing?: boolean;
|
|
11
|
+
template?: unknown;
|
|
12
|
+
nodeId?: string;
|
|
11
13
|
}
|
|
12
14
|
export default function DynamicDetailRows(props: Props): import("react").JSX.Element;
|
|
13
15
|
export declare function recordDetailRows(record: CurrentRecord): DetailRow[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as s}from"react/jsx-runtime";import D from"../SectionBand.js";import h from"../DetailRows.js";import x from"./KindGate.js";import b from"./RecordPhotoGallery.js";import{useCurrentProduct as k}from"../../lib/document/current-product.js";import{SAMPLE_RECORD as S,recordFacts as B,recordPictures as w,useCurrentRecord as P,useDrawsOtherRecord as T}from"../../lib/document/current-record.js";import{detailShotTag as v,pickDetailShots as N}from"../../lib/wheels/detail-shots.js";import{selectedStuds as C}from"../../lib/wheels/selected-studs.js";import{useSampleProduct as F}from"./useSampleProduct.js";import{say as L}from"efficient-web-builder/format/lib/editor-words";const j=["alloy-wheel"];function g(e,i){return e.finishes.find(t=>t.name===i)??e.finishes[0]}function E(e,i){return(g(e,i)?.features??[]).map(t=>({eyebrow:t.eyebrow,title:t.heading,copy:t.description,tag:t.mark,image:t.image||void 0}))}function G(e,i,t){const r=N(g(e,i),t);return r.rows.map(o=>({eyebrow:o.eyebrow?.trim()||void 0,title:o.title,copy:o.line||void 0,image:o.url,tag:v(o,r,t),imageShape:"square"}))}function I(e){return T(!!e.editing)?s(K,{...e}):s(x,{kinds:j,type:"DetailRows",editing:e.editing,children:s(O,{...e})})}function y(e){const i=B(e),t=w(e)[0];return!i.length&&!t&&!e.title.trim()?[]:[{title:e.title,specs:i,image:t?.url||void 0}]}function K({startLeft:e,padTop:i,padBottom:t,editing:r=!1,template:o,nodeId:c}){const a=P(),n=a?y(a):r?y(S):[];if(n.length===0)return null;const l=a?w(a,{firstField:!0}):[];return l.length&&(n[0]={...n[0],media:s(b,{pictures:l,name:a?.title??"",editing:r,fit:"column"})}),s(h,{rows:n,startLeft:e,padTop:i,padBottom:t,editing:r,template:o,nodeId:c})}function O({rowsFrom:e,startLeft:i,padTop:t,padBottom:r,editing:o=!1,template:c,nodeId:a}){const n=k(),l=F(o&&!n),u=n?.product??l,d=u?.kind==="alloy-wheel"?u.source:null,m=n?n.selection.shown.finish:void 0,R=n?C(n.selection):null,p=e==="details",f=d?p?G(d,m,R):E(d,m):[];return p&&f.length===0?o?s(D,{className:"border-b border-line py-14 max-view-desktop:py-10",children:s("p",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:L("No detail shots on this finish yet. Tick a close-up on the design's renderings and give it a title. This section is hidden on the live page until then.")})}):null:s(h,{rows:f,startLeft:i,padTop:t,padBottom:r,editing:o,template:c,nodeId:a})}export{I as default,y as recordDetailRows,j as supportedKinds};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
|
+
export declare const DetailRowsSlots: {
|
|
3
|
+
template: {
|
|
4
|
+
type: "slot";
|
|
5
|
+
allow: string[];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
2
8
|
export declare const DETAILROWS_SCAFFOLD_ROWS: {
|
|
3
9
|
image: string;
|
|
4
10
|
eyebrow: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=[{image:"",eyebrow:"Feature eyebrow",title:"Feature *one.*",copy:"Describe this feature in a sentence or two.",tag:"01 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *two.*",copy:"Describe this feature in a sentence or two.",tag:"02 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *three.*",copy:"Describe this feature in a sentence or two.",tag:"03 · Detail"}],
|
|
1
|
+
import{cardTemplateSlot as e}from"efficient-web-builder/format/lib/content/card-template";const t={template:e()},o=[{image:"",eyebrow:"Feature eyebrow",title:"Feature *one.*",copy:"Describe this feature in a sentence or two.",tag:"01 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *two.*",copy:"Describe this feature in a sentence or two.",tag:"02 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *three.*",copy:"Describe this feature in a sentence or two.",tag:"03 · Detail"}],r={label:"Feature Rows",fields:t,defaultProps:{dynamic:!1,rows:[],startLeft:!1,layout:"even",padTop:100,padBottom:100}};export{o as DETAILROWS_SCAFFOLD_ROWS,r as DetailRowsMeta,t as DetailRowsSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import d from"../../../../../components/pdp-dynamic/DynamicDetailRows.js";import i from"../../../../../components/DetailRows.js";import{phRows as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{DetailRowsMeta as a,DETAILROWS_SCAFFOLD_ROWS as n}from"./meta.js";const y={...a,render:t=>t.dynamic?e(d,{rowsFrom:t.rowsFrom==="details"?"details":"story",startLeft:t.startLeft,padTop:typeof t.padTop=="number"?t.padTop:void 0,padBottom:typeof t.padBottom=="number"?t.padBottom:void 0,editing:t.editor?.isEditing,template:t.template,nodeId:typeof t.id=="string"?t.id:void 0}):e(i,{rows:o(t.rows,n,t.editor),startLeft:t.startLeft,layout:t.layout,padTop:typeof t.padTop=="number"?t.padTop:void 0,padBottom:typeof t.padBottom=="number"?t.padBottom:void 0,editing:t.editor?.isEditing,template:t.template,nodeId:typeof t.id=="string"?t.id:void 0})};export{y as DetailRowsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerCardTemplates as l}from"efficient-web-builder/format/lib/content/card-template";import{HERO_PRICE_BLOCK as a,withHeroPriceTemplate as
|
|
1
|
+
import{registerCardTemplates as l}from"efficient-web-builder/format/lib/content/card-template";import{HERO_PRICE_BLOCK as a,withHeroPriceTemplate as t}from"../content/hero-price-seed.js";import{MENU_LINK_BLOCK as o,withMenuTemplate as b}from"../content/menu-card-seed.js";const e={fields:[{key:"label",label:"Label"},{key:"href",label:"Link",kind:"link"}],blocks:[{type:o,label:"Menu link"}],seed:b},i=[{block:"Reviews",fields:[{key:"quote",label:"Quote"},{key:"title",label:"Title"},{key:"name",label:"Name"},{key:"role",label:"Role · location"},{key:"rating",label:"Rating"},{key:"dateLabel",label:"Date"}]},{block:"SpecTable",fields:[{key:"label",label:"Label"},{key:"value",label:"Value"}]},{block:"DetailRows",fields:[{key:"eyebrow",label:"Eyebrow"},{key:"title",label:"Title"},{key:"copy",label:"Body",multiline:!0},{key:"image",label:"Image",kind:"image",alt:"title"},{key:"tag",label:"Image tag"}]},{block:"FooterMenu",...e},{block:"MenuBlock",...e},{block:"ProductHero",fields:[],blocks:[{type:a,label:"Price"}],seed:t}];l(i);export{i as STOREFRONT_CARD_TEMPLATES};
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
fields: Readonly<Record<string, unknown>>;
|
|
7
|
-
value: TValue;
|
|
8
|
-
schema?: readonly RecordFieldSpec[];
|
|
9
|
-
}
|
|
10
|
-
export interface RecordFieldSpec {
|
|
11
|
-
key: string;
|
|
12
|
-
label: string;
|
|
13
|
-
kind: string;
|
|
14
|
-
}
|
|
2
|
+
import { useCurrentRecord, useCurrentRecordOf, type CurrentRecord, type RecordSchemaField } from "efficient-web-builder/render/components/CurrentRecord";
|
|
3
|
+
export type { CurrentRecord };
|
|
4
|
+
export { useCurrentRecord, useCurrentRecordOf };
|
|
5
|
+
export type RecordFieldSpec = RecordSchemaField;
|
|
15
6
|
export interface RecordPicture {
|
|
16
7
|
url: string;
|
|
17
8
|
alt: string;
|
|
@@ -39,5 +30,3 @@ export declare function CurrentRecordProvider({ record, children, }: {
|
|
|
39
30
|
record: CurrentRecord;
|
|
40
31
|
children: ReactNode;
|
|
41
32
|
}): import("react").JSX.Element;
|
|
42
|
-
export declare function useCurrentRecord(): CurrentRecord | null;
|
|
43
|
-
export declare function useCurrentRecordOf<TValue = unknown>(type: string): CurrentRecord<TValue> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as f}from"react/jsx-runtime";import{createContext as R,useContext as p}from"react";import{say as o}from"efficient-web-builder/format/lib/editor-words";import{declaredRecordType as h,PRODUCT_RECORD_TYPE as a}from"efficient-web-builder/format/lib/content/record-types";import{CurrentRecordProvider as k,useCurrentRecord as y,useCurrentRecordOf as C}from"efficient-web-builder/render/components/CurrentRecord";function A(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return e?e[0].toUpperCase()+e.slice(1):t}const v=/^\d{4}-\d{2}-\d{2}$/;function m(t){return t?t.schema?.length?t.schema.filter(e=>typeof e?.key=="string"&&e.key in t.fields):Object.entries(t.fields).flatMap(([e,r])=>{const n=Array.isArray(r)?g(r[0])?"rows":"images":typeof r=="string"?v.test(r)?"date":"text":null;return n?[{key:e,label:A(e),kind:n}]:[]}):[]}function _(t,{firstField:e=!1}={}){if(!t)return[];const r=m(t).filter(n=>n.kind==="images");return(e?r.slice(0,1):r).flatMap(n=>{const i=t.fields[n.key];return Array.isArray(i)?i.flatMap(s=>{const d=s?.url;if(typeof d!="string"||!d)return[];const u=s.alt,c=s.video;return[{url:d,alt:typeof u=="string"?u:"",...typeof c=="string"&&c?{video:c}:{}}]}):[]})}function x(t){const e=new Date(`${t}T00:00:00Z`);return Number.isNaN(e.getTime())?t:e.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"})}function g(t){const e=t;return typeof e?.label=="string"&&!!e.label.trim()&&typeof e.value=="string"&&!!e.value.trim()}function w(t){return t?m(t).flatMap(e=>{const r=t.fields[e.key];return e.kind==="rows"?Array.isArray(r)?r.filter(g).map(({label:n,value:i})=>({label:n,value:i})):[]:e.kind!=="text"&&e.kind!=="date"?[]:typeof r!="string"||!r.trim()?[]:[{label:e.label,value:e.kind==="date"?x(r):r}]}):[]}function S(t){const e=t?.appState?.data?.root;return h(e?.props)!==a}const l=R(a);function E({type:t,children:e}){return f(l.Provider,{value:t,children:e})}function M(){return p(l)}function U(t){const e=y(),r=p(l);return e?e.type!==a:t&&r!==a}const B={type:"sample",key:"sample",get title(){return o("Record title")},get fields(){return{first:o("A detail of this record"),second:o("Another detail"),third:o("A third")}},value:void 0,get schema(){return[{key:"first",label:o("First detail"),kind:"text"},{key:"second",label:o("Second detail"),kind:"text"},{key:"third",label:o("Third detail"),kind:"text"}]}},F=4;function L({record:t,children:e}){return f(k,{record:t,dateWords:x,children:e})}export{L as CurrentRecordProvider,E as DeclaredRecordTypeProvider,F as SAMPLE_PICTURE_COUNT,B as SAMPLE_RECORD,S as editorPageDrawsOtherRecord,w as recordFacts,m as recordFieldSpecs,_ as recordPictures,y as useCurrentRecord,C as useCurrentRecordOf,M as useDeclaredRecordType,U as useDrawsOtherRecord};
|
|
@@ -3,5 +3,6 @@ import "./slot-seeds.js";
|
|
|
3
3
|
import "./card-templates.js";
|
|
4
4
|
import "./section-to-box-rows-reviews.js";
|
|
5
5
|
import "./section-to-box-rows-spec.js";
|
|
6
|
+
import "./section-to-box-rows-detail.js";
|
|
6
7
|
export declare function renderConfig(): Config;
|
|
7
8
|
export declare function headerRenderConfig(): Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as u,jsx as g}from"react/jsx-runtime";import{generalRenderMetas as E}from"efficient-web-builder/format/lib/document/blocks/general/metas";import{finishRenderRegistry as h}from"efficient-web-builder/render/lib/document/render-registry";import{buildBlockCategories as R}from"efficient-web-builder/format/lib/document/section-catalog";import{SITE_HEADER_TYPE as
|
|
1
|
+
import{Fragment as u,jsx as g}from"react/jsx-runtime";import{generalRenderMetas as E}from"efficient-web-builder/format/lib/document/blocks/general/metas";import{finishRenderRegistry as h}from"efficient-web-builder/render/lib/document/render-registry";import{buildBlockCategories as R}from"efficient-web-builder/format/lib/document/section-catalog";import{SITE_HEADER_TYPE as f}from"efficient-web-builder/format/lib/document/section-groups";import"./slot-seeds.js";import"./card-templates.js";import"./section-to-box-rows-reviews.js";import"./section-to-box-rows-spec.js";import"./section-to-box-rows-detail.js";import{COMMERCE_METAS as y}from"./blocks/commerce/metas.js";import{SERVICE_METAS as S}from"./blocks/service/metas.js";import _ from"./blocks/text-part-shapes.json";import{addPageBlocksFromFooter as b}from"./footer-page-blocks.js";import{LAZY_DRAWS as p}from"./lazy-draws.js";import{drawPublishedStorefrontRoot as T}from"./storefront-root.js";const j=_,k=(o,r)=>{const t=j[o];return{...r,...t?{textParts:t}:null}};let m=null;function l(){if(m)return m;const o={},r=E();for(const e of Object.keys(r))o[e]={...r[e],render:p[e]};const t={...y,...S};for(const e of Object.keys(t))o[e]=k(e,{...t[e],render:p[e]});b(o);const n={root:{render:T},categories:R(),components:o};return h(n),m=n,n}function x(o=l()){const r=o.components,t=Object.keys(r),n=new Set([f]),e=[f];for(;e.length;){const a=e.shift();for(const c of Object.values(r[a]?.fields??{})){if(c?.type!=="slot")continue;const d=c.allow??t.filter(s=>!c.disallow?.includes(s));for(const s of d)n.has(s)||!(s in r)||(n.add(s),e.push(s))}}return[...n]}let i=null;function W(){if(i)return i;const o=l(),r=o.components;return i={...o,root:{render:({children:t})=>g(u,{children:t})},components:Object.fromEntries(x(o).map(t=>[t,r[t]]))},i}export{W as headerRenderConfig,l as renderConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SECTION_BOX_SLOT as o,SECTION_BOX_TYPE as i,registerSectionToBox as g}from"efficient-web-builder/render/lib/sections/section-to-box";import{DIM as a,INNER_BOX as r,NO_PAD as m,SAME_KEYS as y,SECTION_BOX as S,TEXT as p}from"efficient-web-builder/render/lib/document/blocks/general/section-to-box-row-parts";import{token as n}from"efficient-web-builder/render/lib/document/blocks/general/section-head-looks";import{CARD_ROW_FIELD_PROP as s}from"efficient-web-builder/format/lib/content/card-template";const c=e=>({textStyle:"body-5",...n("label",e),letterSpacing:.2,case:"upper"}),t=(e,l,d)=>({type:"Text",props:{...l,[s]:e,_partStyles:{text:d}}}),P=e=>({type:i,props:{...r,name:"Row",mirrorCards:e?"odd":"even",direction:"row",share:"equal",align:"center",gap:48,sectionPaddingTop:60,sectionPaddingBottom:60,sectionPaddingTopPhone:60,sectionPaddingBottomPhone:60},slots:{[o]:[{type:i,props:{...r,name:"Words",direction:"column",gap:16},slots:{[o]:[t("eyebrow",p,{...c(13),color:"accent"}),t("title",p,{textStyle:"heading-2",...n("headingMedium",42,28),lineHeight:1.1,letterSpacing:-.02}),t("copy",a,{textStyle:"body-1",...n("body",15),lineHeight:1.6})]}},{type:i,props:{...r,name:"Picture",direction:"column",gap:12},slots:{[o]:[{type:"ImageBlock",props:{[s]:"image",aspect:"1/1",fit:"contain"}},t("tag",{...a,align:"right"},{...c(11),align:"right"})]}}]}}),_={name:"Feature Rows",boxProps:{...S,...m,direction:"column",gap:0},box:y,parts:[{kind:"core",keep:"rest",slots:e=>({template:[P(e.startLeft===!0)]})}]};g({DetailRows:_});export{P as detailRowSeed};
|