@eldrajs/theme-cli 0.2.7 → 0.2.8
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 +1 -0
- package/package.json +3 -3
- package/template/.eldra/manifest.json +160 -132
- package/template/.eldra/previews.json +35 -35
- package/template/blocks/announcement-bar/preview.png +0 -0
- package/template/blocks/article/preview.png +0 -0
- package/template/blocks/article-list/preview.png +0 -0
- package/template/blocks/breadcrumbs/preview.png +0 -0
- package/template/blocks/cart/preview.png +0 -0
- package/template/blocks/collection-grid/preview.png +0 -0
- package/template/blocks/collection-header/preview.png +0 -0
- package/template/blocks/contact/preview.png +0 -0
- package/template/blocks/cta/preview.png +0 -0
- package/template/blocks/faq/preview.png +0 -0
- package/template/blocks/feature-grid/preview.png +0 -0
- package/template/blocks/footer/preview.png +0 -0
- package/template/blocks/form/preview.png +0 -0
- package/template/blocks/gallery/preview.png +0 -0
- package/template/blocks/hero/preview.png +0 -0
- package/template/blocks/image/preview.png +0 -0
- package/template/blocks/logo-cloud/preview.png +0 -0
- package/template/blocks/navigation/Block.vue +54 -11
- package/template/blocks/navigation/__tests__/Block.spec.ts +91 -8
- package/template/blocks/navigation/block.json +11 -3
- package/template/blocks/navigation/mock.json +134 -129
- package/template/blocks/navigation/preview.png +0 -0
- package/template/blocks/newsletter/preview.png +0 -0
- package/template/blocks/order-status/preview.png +0 -0
- package/template/blocks/pricing-table/preview.png +0 -0
- package/template/blocks/product-carousel/preview.png +0 -0
- package/template/blocks/product-detail/preview.png +0 -0
- package/template/blocks/quote/preview.png +0 -0
- package/template/blocks/rich-text/preview.png +0 -0
- package/template/blocks/search/preview.png +0 -0
- package/template/blocks/split-content/preview.png +0 -0
- package/template/blocks/stats/preview.png +0 -0
- package/template/blocks/tabs/preview.png +0 -0
- package/template/blocks/team/preview.png +0 -0
- package/template/blocks/testimonials/preview.png +0 -0
- package/template/blocks/timeline/preview.png +0 -0
- package/template/blocks/trust-strip/preview.png +0 -0
- package/template/blocks/video-embed/preview.png +0 -0
- package/template/blocks/wishlist/preview.png +0 -0
- package/template/package.json +1 -1
- package/template/public/images/bowl.webp +0 -0
- package/template/test/prerenderFailure.spec.ts +4 -3
- package/template/test/previewParity.browser.spec.ts +1152 -0
- package/template/test/starter.spec.ts +6 -1
- package/template/test/support/previewParity.ts +302 -0
- package/template/test/support/previewParityContent.ts +726 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,7 @@ Release-please writes the generated notes from commit messages and does not repl
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
- The scaffolded starter's header declares menu sections and product/collection cards on its `links` field and draws them (WS-1362): a mega panel column of cards, each a picture at 4:3, a title and a price. Its `navigation` block is version 5 with a `groupsToSections` migration, and its mock is sections; deploying it needs a cms-service that has `groupsToSections`, so deploy the platform first.
|
|
8
9
|
- The starter template builds its pages in the store's default currency (`commerce.defaultCurrency`), and never offers the store's own currency once the store turned it off; a cart left in that currency moves to the default, and a business customer's cart stays in ISK (`currency.keepOwnCurrency()` for a theme with business sign-in) (WS-1399).
|
|
9
10
|
- `eldra-theme types` asks the gateway for the `declare module '@eldrajs/sdk'` augmentation and
|
|
10
11
|
writes it with the CMS types, so `product.extensions` is typed through the SDK's
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/theme-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "CLI for Eldra themes: init from the starter, scaffold blocks, validate, generate types, deploy a static build to Eldra.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"citty": "^0.1.6",
|
|
44
44
|
"tar": "^7.4.3",
|
|
45
|
-
"@eldrajs/theme-core": "^0.
|
|
46
|
-
"@eldrajs/vite-plugin-theme": "^0.
|
|
45
|
+
"@eldrajs/theme-core": "^0.4.0",
|
|
46
|
+
"@eldrajs/vite-plugin-theme": "^0.4.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"execa": "^9.5.2"
|
|
@@ -3745,7 +3745,7 @@
|
|
|
3745
3745
|
"description": "The store's top bar: brand, primary links with optional mega-menus, search, cart and one call to action.",
|
|
3746
3746
|
"icon": "layout-navbar",
|
|
3747
3747
|
"category": "structure",
|
|
3748
|
-
"version":
|
|
3748
|
+
"version": 5,
|
|
3749
3749
|
"groups": [
|
|
3750
3750
|
{
|
|
3751
3751
|
"groupId": "brand",
|
|
@@ -3796,6 +3796,14 @@
|
|
|
3796
3796
|
"label": "ctaLabel"
|
|
3797
3797
|
}
|
|
3798
3798
|
]
|
|
3799
|
+
},
|
|
3800
|
+
{
|
|
3801
|
+
"version": 5,
|
|
3802
|
+
"groupsToSections": [
|
|
3803
|
+
{
|
|
3804
|
+
"field": "links"
|
|
3805
|
+
}
|
|
3806
|
+
]
|
|
3799
3807
|
}
|
|
3800
3808
|
],
|
|
3801
3809
|
"fields": [
|
|
@@ -3844,7 +3852,7 @@
|
|
|
3844
3852
|
"name": "Links",
|
|
3845
3853
|
"type": "list",
|
|
3846
3854
|
"groupId": "navigation",
|
|
3847
|
-
"helpText": "Primary links. 3 to 6 recommended; more than 6 may overflow at 64–80rem. Give a link
|
|
3855
|
+
"helpText": "Primary links. 3 to 6 recommended; more than 6 may overflow at 64–80rem. Give a link a panel to turn it into a mega-menu: up to 4 columns, each with a heading, its links and a See all link. A column can hold up to 2 product or collection cards, a picture with a title and a price.",
|
|
3848
3856
|
"metadata": {
|
|
3849
3857
|
"item": {
|
|
3850
3858
|
"fieldId": "link",
|
|
@@ -3852,7 +3860,22 @@
|
|
|
3852
3860
|
"type": "link",
|
|
3853
3861
|
"localized": true,
|
|
3854
3862
|
"metadata": {
|
|
3855
|
-
"tree":
|
|
3863
|
+
"tree": {
|
|
3864
|
+
"depth": 2,
|
|
3865
|
+
"sections": {
|
|
3866
|
+
"max": 4,
|
|
3867
|
+
"headingLink": true,
|
|
3868
|
+
"seeAll": true
|
|
3869
|
+
},
|
|
3870
|
+
"cards": {
|
|
3871
|
+
"kinds": [
|
|
3872
|
+
"product",
|
|
3873
|
+
"collection"
|
|
3874
|
+
],
|
|
3875
|
+
"max": 2,
|
|
3876
|
+
"aspect": "4:3"
|
|
3877
|
+
}
|
|
3878
|
+
},
|
|
3856
3879
|
"kinds": [
|
|
3857
3880
|
"product",
|
|
3858
3881
|
"collection",
|
|
@@ -3939,114 +3962,117 @@
|
|
|
3939
3962
|
"slug": "knitwear"
|
|
3940
3963
|
},
|
|
3941
3964
|
"label": "Knitwear",
|
|
3942
|
-
"
|
|
3943
|
-
{
|
|
3944
|
-
"kind": "collection",
|
|
3945
|
-
"target": {
|
|
3946
|
-
"_type": "collection",
|
|
3947
|
-
"slug": "womens-sweaters"
|
|
3948
|
-
},
|
|
3949
|
-
"group": "Women",
|
|
3950
|
-
"label": "Sweaters"
|
|
3951
|
-
},
|
|
3952
|
-
{
|
|
3953
|
-
"kind": "collection",
|
|
3954
|
-
"target": {
|
|
3955
|
-
"_type": "collection",
|
|
3956
|
-
"slug": "womens-cardigans"
|
|
3957
|
-
},
|
|
3958
|
-
"group": "Women",
|
|
3959
|
-
"label": "Cardigans"
|
|
3960
|
-
},
|
|
3961
|
-
{
|
|
3962
|
-
"kind": "collection",
|
|
3963
|
-
"target": {
|
|
3964
|
-
"_type": "collection",
|
|
3965
|
-
"slug": "scarves-wraps"
|
|
3966
|
-
},
|
|
3967
|
-
"group": "Women",
|
|
3968
|
-
"label": "Scarves & wraps"
|
|
3969
|
-
},
|
|
3965
|
+
"sections": [
|
|
3970
3966
|
{
|
|
3971
|
-
"
|
|
3972
|
-
"
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
{
|
|
4007
|
-
"kind": "collection",
|
|
4008
|
-
"target": {
|
|
4009
|
-
"_type": "collection",
|
|
4010
|
-
"slug": "socks"
|
|
4011
|
-
},
|
|
4012
|
-
"group": "Men",
|
|
4013
|
-
"label": "Socks"
|
|
4014
|
-
},
|
|
4015
|
-
{
|
|
4016
|
-
"kind": "collection",
|
|
4017
|
-
"target": {
|
|
4018
|
-
"_type": "collection",
|
|
4019
|
-
"slug": "merino-essentials"
|
|
4020
|
-
},
|
|
4021
|
-
"group": "Collections",
|
|
4022
|
-
"label": "Merino essentials"
|
|
4023
|
-
},
|
|
4024
|
-
{
|
|
4025
|
-
"kind": "collection",
|
|
4026
|
-
"target": {
|
|
4027
|
-
"_type": "collection",
|
|
4028
|
-
"slug": "heavy-winter-knits"
|
|
4029
|
-
},
|
|
4030
|
-
"group": "Collections",
|
|
4031
|
-
"label": "Heavy winter knits"
|
|
3967
|
+
"heading": "Women",
|
|
3968
|
+
"links": [
|
|
3969
|
+
{
|
|
3970
|
+
"kind": "collection",
|
|
3971
|
+
"target": {
|
|
3972
|
+
"_type": "collection",
|
|
3973
|
+
"slug": "womens-sweaters"
|
|
3974
|
+
},
|
|
3975
|
+
"label": "Sweaters"
|
|
3976
|
+
},
|
|
3977
|
+
{
|
|
3978
|
+
"kind": "collection",
|
|
3979
|
+
"target": {
|
|
3980
|
+
"_type": "collection",
|
|
3981
|
+
"slug": "womens-cardigans"
|
|
3982
|
+
},
|
|
3983
|
+
"label": "Cardigans"
|
|
3984
|
+
},
|
|
3985
|
+
{
|
|
3986
|
+
"kind": "collection",
|
|
3987
|
+
"target": {
|
|
3988
|
+
"_type": "collection",
|
|
3989
|
+
"slug": "scarves-wraps"
|
|
3990
|
+
},
|
|
3991
|
+
"label": "Scarves & wraps"
|
|
3992
|
+
},
|
|
3993
|
+
{
|
|
3994
|
+
"kind": "collection",
|
|
3995
|
+
"target": {
|
|
3996
|
+
"_type": "collection",
|
|
3997
|
+
"slug": "hats-gloves"
|
|
3998
|
+
},
|
|
3999
|
+
"label": "Hats & gloves"
|
|
4000
|
+
}
|
|
4001
|
+
]
|
|
4032
4002
|
},
|
|
4033
4003
|
{
|
|
4034
|
-
"
|
|
4035
|
-
"
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4004
|
+
"heading": "Men",
|
|
4005
|
+
"links": [
|
|
4006
|
+
{
|
|
4007
|
+
"kind": "collection",
|
|
4008
|
+
"target": {
|
|
4009
|
+
"_type": "collection",
|
|
4010
|
+
"slug": "mens-sweaters"
|
|
4011
|
+
},
|
|
4012
|
+
"label": "Sweaters"
|
|
4013
|
+
},
|
|
4014
|
+
{
|
|
4015
|
+
"kind": "collection",
|
|
4016
|
+
"target": {
|
|
4017
|
+
"_type": "collection",
|
|
4018
|
+
"slug": "mens-cardigans"
|
|
4019
|
+
},
|
|
4020
|
+
"label": "Cardigans"
|
|
4021
|
+
},
|
|
4022
|
+
{
|
|
4023
|
+
"kind": "collection",
|
|
4024
|
+
"target": {
|
|
4025
|
+
"_type": "collection",
|
|
4026
|
+
"slug": "mens-scarves"
|
|
4027
|
+
},
|
|
4028
|
+
"label": "Scarves"
|
|
4029
|
+
},
|
|
4030
|
+
{
|
|
4031
|
+
"kind": "collection",
|
|
4032
|
+
"target": {
|
|
4033
|
+
"_type": "collection",
|
|
4034
|
+
"slug": "socks"
|
|
4035
|
+
},
|
|
4036
|
+
"label": "Socks"
|
|
4037
|
+
}
|
|
4038
|
+
]
|
|
4041
4039
|
},
|
|
4042
4040
|
{
|
|
4043
|
-
"
|
|
4044
|
-
"
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4041
|
+
"heading": "Collections",
|
|
4042
|
+
"links": [
|
|
4043
|
+
{
|
|
4044
|
+
"kind": "collection",
|
|
4045
|
+
"target": {
|
|
4046
|
+
"_type": "collection",
|
|
4047
|
+
"slug": "merino-essentials"
|
|
4048
|
+
},
|
|
4049
|
+
"label": "Merino essentials"
|
|
4050
|
+
},
|
|
4051
|
+
{
|
|
4052
|
+
"kind": "collection",
|
|
4053
|
+
"target": {
|
|
4054
|
+
"_type": "collection",
|
|
4055
|
+
"slug": "heavy-winter-knits"
|
|
4056
|
+
},
|
|
4057
|
+
"label": "Heavy winter knits"
|
|
4058
|
+
},
|
|
4059
|
+
{
|
|
4060
|
+
"kind": "collection",
|
|
4061
|
+
"target": {
|
|
4062
|
+
"_type": "collection",
|
|
4063
|
+
"slug": "undyed-wool"
|
|
4064
|
+
},
|
|
4065
|
+
"label": "Undyed wool"
|
|
4066
|
+
},
|
|
4067
|
+
{
|
|
4068
|
+
"kind": "collection",
|
|
4069
|
+
"target": {
|
|
4070
|
+
"_type": "collection",
|
|
4071
|
+
"slug": "knitwear"
|
|
4072
|
+
},
|
|
4073
|
+
"label": "Shop all knitwear"
|
|
4074
|
+
}
|
|
4075
|
+
]
|
|
4050
4076
|
}
|
|
4051
4077
|
]
|
|
4052
4078
|
},
|
|
@@ -4057,33 +4083,35 @@
|
|
|
4057
4083
|
"slug": "ceramics"
|
|
4058
4084
|
},
|
|
4059
4085
|
"label": "Ceramics",
|
|
4060
|
-
"
|
|
4086
|
+
"sections": [
|
|
4061
4087
|
{
|
|
4062
|
-
"
|
|
4063
|
-
"
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4088
|
+
"heading": "Tableware",
|
|
4089
|
+
"links": [
|
|
4090
|
+
{
|
|
4091
|
+
"kind": "collection",
|
|
4092
|
+
"target": {
|
|
4093
|
+
"_type": "collection",
|
|
4094
|
+
"slug": "plates"
|
|
4095
|
+
},
|
|
4096
|
+
"label": "Plates"
|
|
4097
|
+
},
|
|
4098
|
+
{
|
|
4099
|
+
"kind": "collection",
|
|
4100
|
+
"target": {
|
|
4101
|
+
"_type": "collection",
|
|
4102
|
+
"slug": "bowls"
|
|
4103
|
+
},
|
|
4104
|
+
"label": "Bowls"
|
|
4105
|
+
},
|
|
4106
|
+
{
|
|
4107
|
+
"kind": "collection",
|
|
4108
|
+
"target": {
|
|
4109
|
+
"_type": "collection",
|
|
4110
|
+
"slug": "mugs-cups"
|
|
4111
|
+
},
|
|
4112
|
+
"label": "Mugs & cups"
|
|
4113
|
+
}
|
|
4114
|
+
]
|
|
4087
4115
|
}
|
|
4088
4116
|
]
|
|
4089
4117
|
},
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
"announcement-bar": "
|
|
3
|
-
"article": "
|
|
4
|
-
"article-list": "
|
|
5
|
-
"breadcrumbs": "
|
|
6
|
-
"cart": "
|
|
7
|
-
"collection-grid": "
|
|
8
|
-
"collection-header": "
|
|
9
|
-
"contact": "
|
|
10
|
-
"cta": "
|
|
11
|
-
"faq": "
|
|
12
|
-
"feature-grid": "
|
|
13
|
-
"footer": "
|
|
14
|
-
"form": "
|
|
15
|
-
"gallery": "
|
|
16
|
-
"hero": "
|
|
17
|
-
"image": "
|
|
18
|
-
"logo-cloud": "
|
|
19
|
-
"navigation": "
|
|
20
|
-
"newsletter": "
|
|
21
|
-
"order-status": "
|
|
22
|
-
"pricing-table": "
|
|
23
|
-
"product-carousel": "
|
|
24
|
-
"product-detail": "
|
|
25
|
-
"quote": "
|
|
26
|
-
"rich-text": "
|
|
27
|
-
"search": "
|
|
28
|
-
"split-content": "
|
|
29
|
-
"stats": "
|
|
30
|
-
"tabs": "
|
|
31
|
-
"team": "
|
|
32
|
-
"testimonials": "
|
|
33
|
-
"timeline": "
|
|
34
|
-
"trust-strip": "
|
|
35
|
-
"video-embed": "
|
|
36
|
-
"wishlist": "
|
|
2
|
+
"announcement-bar": "cb5f0c03d3ff5a608408dd73caae60d673528ba57cca559292c0217f5b55371e",
|
|
3
|
+
"article": "287384ce10758a8ca3019f0331cb51c392da915886b4ac67cb599c7743bd4e83",
|
|
4
|
+
"article-list": "aca0382d44cbd9b3989634bd863fe55e088cf617959e38dda9ee0c0ca17f7b68",
|
|
5
|
+
"breadcrumbs": "9537ded283e8a2fbc3ad9ae0d330e6ada4f18bcf59dd8f3f7a495bdbaf3501fc",
|
|
6
|
+
"cart": "701e89e63820b14a9fa5e3a2da9e9efd55fc151d5165a278dd9ab4971473dc2a",
|
|
7
|
+
"collection-grid": "1182dab25ac153ccc773b858c55264734f24c557c0ca1a70b90337cad17104e1",
|
|
8
|
+
"collection-header": "427a6703c5cc6c1a10632034f946f1bc79fd9ff99d107e26dac87d163068f78d",
|
|
9
|
+
"contact": "52d9c46ee78b5ad97cb85b063cbee8b878829468a3ec168c74195f18d4ff739e",
|
|
10
|
+
"cta": "692e6279827b7def0b4e38451c121059941a6bbf82ac8d75dd2d399abdc81169",
|
|
11
|
+
"faq": "eb07354f72cdc53484db949de18d4de609a720dda49169e8f12d4b49ed867060",
|
|
12
|
+
"feature-grid": "f80baa8c92a3e54a37683385995bcc2af4d5a8b8ee26fd9f6370b3f2b40b1409",
|
|
13
|
+
"footer": "9556050d0adde3ba38ba29a96efb3b381348f6a2447fa81a881663fd0cf6b70a",
|
|
14
|
+
"form": "75e0c7c42e701bd0c477df33b6604b318bf14e4ba860e25cf2dc498242a76e81",
|
|
15
|
+
"gallery": "aa7603b38a2fc91f362700ff4fc6e6a85095ef9542efcef69cf36e92e6ab9a63",
|
|
16
|
+
"hero": "5784dafe38c860aa48f7efaa60829af12cc98fab24eff6afe535742a79e445bb",
|
|
17
|
+
"image": "d05e60073be042bd55ed2243efff806e411263e45aea79c20c25318c655d9bf7",
|
|
18
|
+
"logo-cloud": "8c08fb404c587f419d8914e29bd520f4f4faedd3c9a23cdd33b31602b75dfce0",
|
|
19
|
+
"navigation": "7db1b690f9f9043626e8d917a9d3b602b5facc44e23e301961bd80df15875fd8",
|
|
20
|
+
"newsletter": "a1bcec0a512f8fcee3b8e92b1146fdbb99620625cdcc6b4a8715047f8775d892",
|
|
21
|
+
"order-status": "cdd505d94b2650d00548dd798fc16d4de466d24b68c18107c88134b96c5d4d5f",
|
|
22
|
+
"pricing-table": "e807254da0b2ff76f2a66ba2143f15244998ee911d47c3dc5d27dbdcfc3240ca",
|
|
23
|
+
"product-carousel": "3ffe2cb752712b40e2d721b1132c30e0bd5104fc0e1879d38d657bdad40a50cf",
|
|
24
|
+
"product-detail": "ef517359eff04b1303d69dffa04e4f06016dd5a06a4a4d39422300b16851a4d0",
|
|
25
|
+
"quote": "f5a205b691285faa47981418b5668c6b33f9d6426b8d63c153be209ca2151281",
|
|
26
|
+
"rich-text": "b37d0b974a66e417550eccbc3151fd70e7b58c80f62756231fe0c93228f8ffa2",
|
|
27
|
+
"search": "530a23a1108914114ed89b41d0153364e3b77c383c4e4900b6704ea007e0868f",
|
|
28
|
+
"split-content": "d211565a4765c12d6b99a1988e0494f3276cb00967f72f4f16b2620cd690342a",
|
|
29
|
+
"stats": "83bf41b6d029bfbcf662e5d151a4a38847cc7027eb399d722f97aa0eb88fef10",
|
|
30
|
+
"tabs": "575f13a6abd1f5e161f2b4ca0789ff8b662f1bf1faff7b1ce32c4731c434a535",
|
|
31
|
+
"team": "42ee4e323e80b821c5371d6d04f478de80b14b147bd9d6d854bfcb348c54e613",
|
|
32
|
+
"testimonials": "5f974a9b8294389276c4905b92b626b20d5bd561de0b01d0a3fe35970b29312c",
|
|
33
|
+
"timeline": "c058a395bb86d9cabb7cb9a40e8ee2f8ca0928b147745e025208197c42a23be3",
|
|
34
|
+
"trust-strip": "f2ac93c745c109060209430c8bd8b6b74a53c25eda0d6227057fa801fc1784e8",
|
|
35
|
+
"video-embed": "c1c3ee4da01b70aac86d371bcf488e7dea8a08e30d42ffde19904cf48f43dad6",
|
|
36
|
+
"wishlist": "aed7dd39c1190c5fb286b2ab2dcded2dff7d3bb21ecd85d5c1e74016c62c6335"
|
|
37
37
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** Header (design spec 2); apiId stays `navigation`. Layout: docs/starter-kit.md, "The header". */
|
|
3
3
|
import { computed, onMounted, ref, watchEffect } from 'vue';
|
|
4
4
|
import { useEldraLink, useEldraLocale } from '@eldrajs/theme-vue';
|
|
5
|
+
import type { ResolvedLink, ResolvedSection } from '@eldrajs/theme-vue';
|
|
5
6
|
import {
|
|
6
7
|
Badge,
|
|
7
8
|
Button,
|
|
@@ -15,7 +16,9 @@ import {
|
|
|
15
16
|
} from '@eldrajs/ui';
|
|
16
17
|
import type {
|
|
17
18
|
NavMenuItem,
|
|
19
|
+
NavMenuLink,
|
|
18
20
|
NavMenuPart,
|
|
21
|
+
NavMenuSection,
|
|
19
22
|
SearchResultItem,
|
|
20
23
|
SearchResults,
|
|
21
24
|
UiMessages,
|
|
@@ -31,6 +34,7 @@ import { isInternalHref, SEARCH_PATH } from '../../app/utils/links';
|
|
|
31
34
|
import { useMoney } from '../../app/storefront/money';
|
|
32
35
|
import type { StorefrontSearchResponse } from '../../app/storefront/types';
|
|
33
36
|
import MenuLink from './parts/MenuLink.vue';
|
|
37
|
+
import blockJson from './block.json';
|
|
34
38
|
|
|
35
39
|
const props = defineProps<{ entry: EldraBlockEntry<'navigation'> }>();
|
|
36
40
|
const { data } = useBlockData(props, 'navigation');
|
|
@@ -65,11 +69,50 @@ const links = computed(() =>
|
|
|
65
69
|
})
|
|
66
70
|
);
|
|
67
71
|
|
|
68
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* The picture crop of a menu card: the `aspect` this block's own `links` field declares in
|
|
74
|
+
* `cards`, so the declaration and the drawing cannot drift. `NavMenu` falls back to 4:3 on a
|
|
75
|
+
* value that is not `width:height`.
|
|
76
|
+
*/
|
|
77
|
+
const cardAspect = (
|
|
78
|
+
blockJson.fields.find((field) => field.fieldId === 'links') as
|
|
79
|
+
| { metadata?: { item?: { metadata?: { tree?: { cards?: { aspect?: string } } } } } }
|
|
80
|
+
| undefined
|
|
81
|
+
)?.metadata?.item?.metadata?.tree?.cards?.aspect;
|
|
82
|
+
|
|
83
|
+
/** A resolved link as the menu draws it, `display` and `card` (child and section links only) kept. */
|
|
84
|
+
function toNavLink(link: ResolvedLink): NavMenuLink {
|
|
85
|
+
return {
|
|
86
|
+
label: link.label,
|
|
87
|
+
href: link.href,
|
|
88
|
+
newTab: link.newTab,
|
|
89
|
+
group: link.group,
|
|
90
|
+
current: isCurrent(link.href),
|
|
91
|
+
display: link.display,
|
|
92
|
+
card: link.card,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function toNavSection(section: ResolvedSection): NavMenuSection {
|
|
97
|
+
return {
|
|
98
|
+
heading: section.heading,
|
|
99
|
+
headingLink: section.headingLink === null ? null : toNavLink(section.headingLink),
|
|
100
|
+
display: section.display,
|
|
101
|
+
links: section.links.map(toNavLink),
|
|
102
|
+
seeAll: section.seeAll === null ? null : toNavLink(section.seeAll),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A parent with a panel is a disclosure, so its own destination moves to the panel's "View all". The
|
|
108
|
+
* panel is its `sections` when the site served them (this block declares them), else its `children`
|
|
109
|
+
* grouped by their `group`, which is what a menu stored before sections existed still is.
|
|
110
|
+
*/
|
|
69
111
|
const navItems = computed<NavMenuItem[]>(() =>
|
|
70
112
|
links.value.map((link) => {
|
|
113
|
+
const sections = link.sections ?? [];
|
|
71
114
|
const children = link.children.filter((child) => child.label !== null);
|
|
72
|
-
if (children.length === 0) {
|
|
115
|
+
if (sections.length === 0 && children.length === 0) {
|
|
73
116
|
return {
|
|
74
117
|
label: link.label,
|
|
75
118
|
href: link.href,
|
|
@@ -80,13 +123,9 @@ const navItems = computed<NavMenuItem[]>(() =>
|
|
|
80
123
|
return {
|
|
81
124
|
label: link.label,
|
|
82
125
|
layout: 'mega',
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
newTab: child.newTab,
|
|
87
|
-
group: child.group,
|
|
88
|
-
current: isCurrent(child.href),
|
|
89
|
-
})),
|
|
126
|
+
...(sections.length > 0
|
|
127
|
+
? { sections: sections.map(toNavSection) }
|
|
128
|
+
: { children: children.map(toNavLink) }),
|
|
90
129
|
};
|
|
91
130
|
})
|
|
92
131
|
);
|
|
@@ -668,8 +707,11 @@ const navMenuClasses = computed<Partial<Record<NavMenuPart, string>>>(() => ({
|
|
|
668
707
|
panel: 'pt-0',
|
|
669
708
|
content:
|
|
670
709
|
'rounded-none rounded-b-lg border-t-0 bg-(--eldra-header-surface) shadow-(--eldra-shadow-float) @wide:p-8',
|
|
671
|
-
columns
|
|
672
|
-
|
|
710
|
+
// Twelve columns, a link column three of them. A panel with a cards column is laid out in equal
|
|
711
|
+
// tracks instead: a link column is one, the cards column spans two (the design's ~1.7x).
|
|
712
|
+
columns:
|
|
713
|
+
'grid-cols-12 gap-6 data-cards:grid-flow-col data-cards:auto-cols-fr data-cards:grid-cols-none',
|
|
714
|
+
group: 'col-span-3 [[data-cards]>&]:col-span-1 [[data-cards]>&[data-cards]]:col-span-2',
|
|
673
715
|
footer: 'justify-end',
|
|
674
716
|
drawerLink: 'font-heading text-xl font-semibold',
|
|
675
717
|
drawerTrigger: 'font-heading text-xl font-semibold',
|
|
@@ -730,6 +772,7 @@ const navMenuClasses = computed<Partial<Record<NavMenuPart, string>>>(() => ({
|
|
|
730
772
|
:collapse-below="variant === 'minimal' ? 'always' : '@content'"
|
|
731
773
|
open-on-hover
|
|
732
774
|
:link-as="MenuLink"
|
|
775
|
+
:card-aspect="cardAspect"
|
|
733
776
|
:messages="navMenuMessages"
|
|
734
777
|
class="static contents"
|
|
735
778
|
:classes="navMenuClasses"
|