@wix/himalaya-cli 0.1593.0 → 0.1595.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/dist/cli.mjs +4 -3
- package/guides/one-app-to-himi-app.md +12 -0
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +216 -8
- package/templates/beauty-salon/tier5-src/_shared/himi-store-facets.ts +26 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-category/index.ts +3 -3
- package/templates/beauty-salon/tier5-src/himi-branded-lite-shop/index.ts +4 -4
- package/templates/branded-lite/dev/index.ts +216 -8
- package/templates/branded-lite/tier5-src/_shared/business-chat-transport.ts +9 -0
- package/templates/branded-lite/tier5-src/_shared/himi-store-facets.ts +26 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-category/index.ts +3 -3
- package/templates/branded-lite/tier5-src/himi-branded-lite-shop/index.ts +3 -3
- package/templates/gym-fitness/dev/index.ts +216 -8
- package/templates/gym-fitness/tier5-src/_shared/himi-store-facets.ts +26 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-category/index.ts +3 -3
- package/templates/gym-fitness/tier5-src/himi-branded-lite-shop/index.ts +4 -4
- package/templates/portfolio-creative/dev/index.ts +216 -8
- package/templates/portfolio-creative/tier5-src/_shared/himi-store-facets.ts +26 -2
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-category/index.ts +3 -3
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-shop/index.ts +4 -4
- package/templates/retail-store/dev/index.ts +216 -8
- package/templates/retail-store/tier5-src/_shared/himi-store-facets.ts +26 -2
- package/templates/retail-store/tier5-src/himi-branded-lite-category/index.ts +3 -3
- package/templates/retail-store/tier5-src/himi-branded-lite-shop/index.ts +3 -3
|
@@ -7951,7 +7951,33 @@ const SCREENS = runtimeSetting({
|
|
|
7951
7951
|
"top": 2,
|
|
7952
7952
|
"bottom": 2
|
|
7953
7953
|
},
|
|
7954
|
-
"hiddenPath": "$item.
|
|
7954
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
7955
|
+
}
|
|
7956
|
+
},
|
|
7957
|
+
{
|
|
7958
|
+
"id": "",
|
|
7959
|
+
"body": {
|
|
7960
|
+
"package": "himalaya",
|
|
7961
|
+
"type": "Text",
|
|
7962
|
+
"props": {
|
|
7963
|
+
"text": "$item.ribbon",
|
|
7964
|
+
"style": "caption",
|
|
7965
|
+
"color": "accentPrimary",
|
|
7966
|
+
"maxLines": 1
|
|
7967
|
+
}
|
|
7968
|
+
},
|
|
7969
|
+
"modifiers": {
|
|
7970
|
+
"background": {
|
|
7971
|
+
"token": "accentSurface"
|
|
7972
|
+
},
|
|
7973
|
+
"cornerRadius": 6,
|
|
7974
|
+
"padding": {
|
|
7975
|
+
"leading": 6,
|
|
7976
|
+
"trailing": 6,
|
|
7977
|
+
"top": 2,
|
|
7978
|
+
"bottom": 2
|
|
7979
|
+
},
|
|
7980
|
+
"hiddenPath": "$item.noRibbon"
|
|
7955
7981
|
}
|
|
7956
7982
|
},
|
|
7957
7983
|
{
|
|
@@ -8394,7 +8420,33 @@ const SCREENS = runtimeSetting({
|
|
|
8394
8420
|
"top": 2,
|
|
8395
8421
|
"bottom": 2
|
|
8396
8422
|
},
|
|
8397
|
-
"hiddenPath": "$item.
|
|
8423
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
8424
|
+
}
|
|
8425
|
+
},
|
|
8426
|
+
{
|
|
8427
|
+
"id": "",
|
|
8428
|
+
"body": {
|
|
8429
|
+
"package": "himalaya",
|
|
8430
|
+
"type": "Text",
|
|
8431
|
+
"props": {
|
|
8432
|
+
"text": "$item.ribbon",
|
|
8433
|
+
"style": "caption",
|
|
8434
|
+
"color": "accentPrimary",
|
|
8435
|
+
"maxLines": 1
|
|
8436
|
+
}
|
|
8437
|
+
},
|
|
8438
|
+
"modifiers": {
|
|
8439
|
+
"background": {
|
|
8440
|
+
"token": "accentSurface"
|
|
8441
|
+
},
|
|
8442
|
+
"cornerRadius": 6,
|
|
8443
|
+
"padding": {
|
|
8444
|
+
"leading": 6,
|
|
8445
|
+
"trailing": 6,
|
|
8446
|
+
"top": 2,
|
|
8447
|
+
"bottom": 2
|
|
8448
|
+
},
|
|
8449
|
+
"hiddenPath": "$item.noRibbon"
|
|
8398
8450
|
}
|
|
8399
8451
|
},
|
|
8400
8452
|
{
|
|
@@ -8869,7 +8921,33 @@ const SCREENS = runtimeSetting({
|
|
|
8869
8921
|
"top": 2,
|
|
8870
8922
|
"bottom": 2
|
|
8871
8923
|
},
|
|
8872
|
-
"hiddenPath": "$item.
|
|
8924
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
8925
|
+
}
|
|
8926
|
+
},
|
|
8927
|
+
{
|
|
8928
|
+
"id": "",
|
|
8929
|
+
"body": {
|
|
8930
|
+
"package": "himalaya",
|
|
8931
|
+
"type": "Text",
|
|
8932
|
+
"props": {
|
|
8933
|
+
"text": "$item.ribbon",
|
|
8934
|
+
"style": "caption",
|
|
8935
|
+
"color": "accentPrimary",
|
|
8936
|
+
"maxLines": 1
|
|
8937
|
+
}
|
|
8938
|
+
},
|
|
8939
|
+
"modifiers": {
|
|
8940
|
+
"background": {
|
|
8941
|
+
"token": "accentSurface"
|
|
8942
|
+
},
|
|
8943
|
+
"cornerRadius": 6,
|
|
8944
|
+
"padding": {
|
|
8945
|
+
"leading": 6,
|
|
8946
|
+
"trailing": 6,
|
|
8947
|
+
"top": 2,
|
|
8948
|
+
"bottom": 2
|
|
8949
|
+
},
|
|
8950
|
+
"hiddenPath": "$item.noRibbon"
|
|
8873
8951
|
}
|
|
8874
8952
|
},
|
|
8875
8953
|
{
|
|
@@ -9320,7 +9398,33 @@ const SCREENS = runtimeSetting({
|
|
|
9320
9398
|
"top": 2,
|
|
9321
9399
|
"bottom": 2
|
|
9322
9400
|
},
|
|
9323
|
-
"hiddenPath": "$item.
|
|
9401
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
9402
|
+
}
|
|
9403
|
+
},
|
|
9404
|
+
{
|
|
9405
|
+
"id": "",
|
|
9406
|
+
"body": {
|
|
9407
|
+
"package": "himalaya",
|
|
9408
|
+
"type": "Text",
|
|
9409
|
+
"props": {
|
|
9410
|
+
"text": "$item.ribbon",
|
|
9411
|
+
"style": "caption",
|
|
9412
|
+
"color": "accentPrimary",
|
|
9413
|
+
"maxLines": 1
|
|
9414
|
+
}
|
|
9415
|
+
},
|
|
9416
|
+
"modifiers": {
|
|
9417
|
+
"background": {
|
|
9418
|
+
"token": "accentSurface"
|
|
9419
|
+
},
|
|
9420
|
+
"cornerRadius": 6,
|
|
9421
|
+
"padding": {
|
|
9422
|
+
"leading": 6,
|
|
9423
|
+
"trailing": 6,
|
|
9424
|
+
"top": 2,
|
|
9425
|
+
"bottom": 2
|
|
9426
|
+
},
|
|
9427
|
+
"hiddenPath": "$item.noRibbon"
|
|
9324
9428
|
}
|
|
9325
9429
|
},
|
|
9326
9430
|
{
|
|
@@ -11947,7 +12051,33 @@ const SCREENS = runtimeSetting({
|
|
|
11947
12051
|
"top": 2,
|
|
11948
12052
|
"bottom": 2
|
|
11949
12053
|
},
|
|
11950
|
-
"hiddenPath": "$item.
|
|
12054
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
12055
|
+
}
|
|
12056
|
+
},
|
|
12057
|
+
{
|
|
12058
|
+
"id": "",
|
|
12059
|
+
"body": {
|
|
12060
|
+
"package": "himalaya",
|
|
12061
|
+
"type": "Text",
|
|
12062
|
+
"props": {
|
|
12063
|
+
"text": "$item.ribbon",
|
|
12064
|
+
"style": "caption",
|
|
12065
|
+
"color": "accentPrimary",
|
|
12066
|
+
"maxLines": 1
|
|
12067
|
+
}
|
|
12068
|
+
},
|
|
12069
|
+
"modifiers": {
|
|
12070
|
+
"background": {
|
|
12071
|
+
"token": "accentSurface"
|
|
12072
|
+
},
|
|
12073
|
+
"cornerRadius": 6,
|
|
12074
|
+
"padding": {
|
|
12075
|
+
"leading": 6,
|
|
12076
|
+
"trailing": 6,
|
|
12077
|
+
"top": 2,
|
|
12078
|
+
"bottom": 2
|
|
12079
|
+
},
|
|
12080
|
+
"hiddenPath": "$item.noRibbon"
|
|
11951
12081
|
}
|
|
11952
12082
|
},
|
|
11953
12083
|
{
|
|
@@ -12403,7 +12533,33 @@ const SCREENS = runtimeSetting({
|
|
|
12403
12533
|
"top": 2,
|
|
12404
12534
|
"bottom": 2
|
|
12405
12535
|
},
|
|
12406
|
-
"hiddenPath": "$item.
|
|
12536
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
12537
|
+
}
|
|
12538
|
+
},
|
|
12539
|
+
{
|
|
12540
|
+
"id": "",
|
|
12541
|
+
"body": {
|
|
12542
|
+
"package": "himalaya",
|
|
12543
|
+
"type": "Text",
|
|
12544
|
+
"props": {
|
|
12545
|
+
"text": "$item.ribbon",
|
|
12546
|
+
"style": "caption",
|
|
12547
|
+
"color": "accentPrimary",
|
|
12548
|
+
"maxLines": 1
|
|
12549
|
+
}
|
|
12550
|
+
},
|
|
12551
|
+
"modifiers": {
|
|
12552
|
+
"background": {
|
|
12553
|
+
"token": "accentSurface"
|
|
12554
|
+
},
|
|
12555
|
+
"cornerRadius": 6,
|
|
12556
|
+
"padding": {
|
|
12557
|
+
"leading": 6,
|
|
12558
|
+
"trailing": 6,
|
|
12559
|
+
"top": 2,
|
|
12560
|
+
"bottom": 2
|
|
12561
|
+
},
|
|
12562
|
+
"hiddenPath": "$item.noRibbon"
|
|
12407
12563
|
}
|
|
12408
12564
|
},
|
|
12409
12565
|
{
|
|
@@ -12891,7 +13047,33 @@ const SCREENS = runtimeSetting({
|
|
|
12891
13047
|
"top": 2,
|
|
12892
13048
|
"bottom": 2
|
|
12893
13049
|
},
|
|
12894
|
-
"hiddenPath": "$item.
|
|
13050
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
13051
|
+
}
|
|
13052
|
+
},
|
|
13053
|
+
{
|
|
13054
|
+
"id": "",
|
|
13055
|
+
"body": {
|
|
13056
|
+
"package": "himalaya",
|
|
13057
|
+
"type": "Text",
|
|
13058
|
+
"props": {
|
|
13059
|
+
"text": "$item.ribbon",
|
|
13060
|
+
"style": "caption",
|
|
13061
|
+
"color": "accentPrimary",
|
|
13062
|
+
"maxLines": 1
|
|
13063
|
+
}
|
|
13064
|
+
},
|
|
13065
|
+
"modifiers": {
|
|
13066
|
+
"background": {
|
|
13067
|
+
"token": "accentSurface"
|
|
13068
|
+
},
|
|
13069
|
+
"cornerRadius": 6,
|
|
13070
|
+
"padding": {
|
|
13071
|
+
"leading": 6,
|
|
13072
|
+
"trailing": 6,
|
|
13073
|
+
"top": 2,
|
|
13074
|
+
"bottom": 2
|
|
13075
|
+
},
|
|
13076
|
+
"hiddenPath": "$item.noRibbon"
|
|
12895
13077
|
}
|
|
12896
13078
|
},
|
|
12897
13079
|
{
|
|
@@ -13355,7 +13537,33 @@ const SCREENS = runtimeSetting({
|
|
|
13355
13537
|
"top": 2,
|
|
13356
13538
|
"bottom": 2
|
|
13357
13539
|
},
|
|
13358
|
-
"hiddenPath": "$item.
|
|
13540
|
+
"hiddenPath": "$item.saleTagHidden"
|
|
13541
|
+
}
|
|
13542
|
+
},
|
|
13543
|
+
{
|
|
13544
|
+
"id": "",
|
|
13545
|
+
"body": {
|
|
13546
|
+
"package": "himalaya",
|
|
13547
|
+
"type": "Text",
|
|
13548
|
+
"props": {
|
|
13549
|
+
"text": "$item.ribbon",
|
|
13550
|
+
"style": "caption",
|
|
13551
|
+
"color": "accentPrimary",
|
|
13552
|
+
"maxLines": 1
|
|
13553
|
+
}
|
|
13554
|
+
},
|
|
13555
|
+
"modifiers": {
|
|
13556
|
+
"background": {
|
|
13557
|
+
"token": "accentSurface"
|
|
13558
|
+
},
|
|
13559
|
+
"cornerRadius": 6,
|
|
13560
|
+
"padding": {
|
|
13561
|
+
"leading": 6,
|
|
13562
|
+
"trailing": 6,
|
|
13563
|
+
"top": 2,
|
|
13564
|
+
"bottom": 2
|
|
13565
|
+
},
|
|
13566
|
+
"hiddenPath": "$item.noRibbon"
|
|
13359
13567
|
}
|
|
13360
13568
|
},
|
|
13361
13569
|
{
|
|
@@ -58,8 +58,14 @@ export interface ProductCard {
|
|
|
58
58
|
swatch1: string; swatch2: string; swatch3: string; swatch4: string; swatch5: string;
|
|
59
59
|
swatch1Hidden: boolean; swatch2Hidden: boolean; swatch3Hidden: boolean; swatch4Hidden: boolean; swatch5Hidden: boolean;
|
|
60
60
|
noSwatches: boolean;
|
|
61
|
-
/** Hides the Sale tag
|
|
61
|
+
/** Hides the tag row (Sale tag, ribbon, swatches) when it has nothing to show. */
|
|
62
62
|
noTagRow: boolean;
|
|
63
|
+
/** The merchant's ribbon text ("New", "Best Seller"…), "" when the product has none. The ribbon replaces
|
|
64
|
+
* the price-derived Sale tag, so a product never carries two tags. */
|
|
65
|
+
ribbon: string;
|
|
66
|
+
noRibbon: boolean;
|
|
67
|
+
/** Hides the price-derived Sale tag: the product is not on sale, or its ribbon takes the tag's place. */
|
|
68
|
+
saleTagHidden: boolean;
|
|
63
69
|
/** The Wix price before any App Store presentation rewrites `price`. */
|
|
64
70
|
commercePrice: string;
|
|
65
71
|
/** Original Wix sale metadata retained when App Store presentation hides it. */
|
|
@@ -179,6 +185,21 @@ function swatchFields(hexes: string[], onSale: boolean) {
|
|
|
179
185
|
};
|
|
180
186
|
}
|
|
181
187
|
|
|
188
|
+
/** The ribbon the merchant set, whichever catalog answered: V3 `{ id, name }`, V1 a plain string. Read through a
|
|
189
|
+
* local type, not a `StoreProduct` member: other workers already extend that type with their own `ribbon`. */
|
|
190
|
+
export function ribbonText(p: StoreProduct): string {
|
|
191
|
+
const ribbon = (p as { ribbon?: unknown }).ribbon;
|
|
192
|
+
const name = typeof ribbon === "string" ? ribbon : typeof (ribbon as { name?: unknown } | null | undefined)?.name === "string" ? (ribbon as { name: string }).name : "";
|
|
193
|
+
return name.trim();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** What the tag row (Sale tag, ribbon, swatches) shows. One rule for every screen that rebuilds it, including
|
|
197
|
+
* after the App Store presentation changes `onSale`: the ribbon wins over the Sale tag, so a product never
|
|
198
|
+
* carries two, and the row hides when it has nothing to show. */
|
|
199
|
+
export function tagFields(onSale: boolean, noSwatches: boolean, ribbon: string | undefined) {
|
|
200
|
+
return { ribbon: ribbon ?? "", noRibbon: !ribbon, saleTagHidden: !onSale || !!ribbon, noTagRow: !onSale && noSwatches && !ribbon };
|
|
201
|
+
}
|
|
202
|
+
|
|
182
203
|
export function productCard(p: StoreProduct, saved: Set<string> = savedIds()): ProductCard {
|
|
183
204
|
const { now, was } = prices(p);
|
|
184
205
|
const groups = productOptions(p);
|
|
@@ -187,11 +208,14 @@ export function productCard(p: StoreProduct, saved: Set<string> = savedIds()): P
|
|
|
187
208
|
const image = productImage(p);
|
|
188
209
|
const id = p.id ?? "";
|
|
189
210
|
const onSale = !!was;
|
|
211
|
+
const ribbon = ribbonText(p);
|
|
212
|
+
const swatches = swatchFields((color?.choices ?? []).map((c) => c.colorCode ?? ""), onSale);
|
|
190
213
|
return {
|
|
191
214
|
id, name, image, hasImage: !!image, noImage: !image, initial: initials(name),
|
|
192
215
|
price: now, wasPrice: was, onSale, notOnSale: !onSale,
|
|
193
216
|
saved: saved.has(id), notSaved: !saved.has(id),
|
|
194
|
-
...
|
|
217
|
+
...swatches,
|
|
218
|
+
...tagFields(onSale, swatches.noSwatches, ribbon),
|
|
195
219
|
commercePrice: now,
|
|
196
220
|
detailScreenId: "himi_product",
|
|
197
221
|
};
|
|
@@ -7,7 +7,7 @@ import { searchStoreProducts, type StoreProduct } from "../_shared/himi-store.js
|
|
|
7
7
|
import { createCollectionQuery } from "../_shared/collection-query.js";
|
|
8
8
|
import { detailInputId, presence, presenceAfterError, type PresenceFlags } from "../_shared/detail-presence.js";
|
|
9
9
|
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
10
|
-
import { FACETS_BOOT, PAGE_SIZE, applyFacets, currencyOf, facetActions, idOf, readViewPrefs, toRows, toggleSaved, type FacetState } from "../_shared/himi-store-facets.js";
|
|
10
|
+
import { FACETS_BOOT, PAGE_SIZE, applyFacets, currencyOf, facetActions, idOf, readViewPrefs, tagFields, toRows, toggleSaved, type FacetState } from "../_shared/himi-store-facets.js";
|
|
11
11
|
import { withIapPresentation } from "../_shared/iap-presentation.js";
|
|
12
12
|
|
|
13
13
|
interface State extends FacetState, PresenceFlags {
|
|
@@ -187,8 +187,8 @@ const register = withIapPresentation<State>({
|
|
|
187
187
|
const onSale = stored.commerceOnSale ?? row.onSale;
|
|
188
188
|
return { ...row, price: price(row.id, row.commercePrice) || row.price,
|
|
189
189
|
commerceWasPrice: wasPrice, commerceOnSale: onSale,
|
|
190
|
-
...(apple(row.id) ? { wasPrice: "", onSale: false, notOnSale: true,
|
|
191
|
-
: { wasPrice, onSale, notOnSale: !onSale,
|
|
190
|
+
...(apple(row.id) ? { wasPrice: "", onSale: false, notOnSale: true, ...tagFields(false, row.noSwatches, row.ribbon) }
|
|
191
|
+
: { wasPrice, onSale, notOnSale: !onSale, ...tagFields(onSale, row.noSwatches, row.ribbon) }),
|
|
192
192
|
};
|
|
193
193
|
}) }),
|
|
194
194
|
});
|
|
@@ -17,7 +17,7 @@ import { withIapPresentation } from "../_shared/iap-presentation.js";
|
|
|
17
17
|
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
18
18
|
import { loadStoreCategories, type StoreCategoryCard } from "../_shared/himi-store-categories.js";
|
|
19
19
|
import {
|
|
20
|
-
FACETS_BOOT, PAGE_SIZE, applyFacets, countText, currencyOf, facetActions, idOf, option, readViewPrefs, selected, toRows, toggleSaved,
|
|
20
|
+
FACETS_BOOT, PAGE_SIZE, applyFacets, countText, currencyOf, facetActions, idOf, option, readViewPrefs, selected, tagFields, toRows, toggleSaved,
|
|
21
21
|
type FacetState, type Option, type Row,
|
|
22
22
|
} from "../_shared/himi-store-facets.js";
|
|
23
23
|
|
|
@@ -638,7 +638,7 @@ const register = withIapPresentation<S>({
|
|
|
638
638
|
wasPrice: "",
|
|
639
639
|
onSale: false,
|
|
640
640
|
notOnSale: true,
|
|
641
|
-
|
|
641
|
+
...tagFields(false, row.noSwatches, row.ribbon),
|
|
642
642
|
};
|
|
643
643
|
return {
|
|
644
644
|
...row,
|
|
@@ -646,7 +646,7 @@ const register = withIapPresentation<S>({
|
|
|
646
646
|
wasPrice,
|
|
647
647
|
onSale,
|
|
648
648
|
notOnSale: !onSale,
|
|
649
|
-
|
|
649
|
+
...tagFields(onSale, row.noSwatches, row.ribbon),
|
|
650
650
|
};
|
|
651
651
|
}) };
|
|
652
652
|
},
|