@wix/himalaya-cli 0.1851.0 → 0.1853.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +13 -3
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{166f7ee733ea8d0fe7bba8b796232efd4f5413e22af4a8aeee20cae1069b2fd6.bin → fb500748f6c4768468f2e7f985aa67c38633077c7a98caaa6b500c7b00eea8e9.bin} +1 -1
- package/dist/browser-plane/sw.js +7 -7
- package/dist/cli.mjs +10136 -9601
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-index.md +1 -1
- package/guides/component-reference.json +2 -2
- package/guides/component-reference.md +8 -1
- package/guides/designing-himi-screens.md +5 -1
- package/guides/himi-json-output.md +13 -3
- package/guides/one-app-section-mappings.md +1 -1
- package/guides/one-app-to-himi-app.md +60 -10
- package/guides/sdk-reference.json +2 -2
- package/package.json +2 -2
- package/template-icons/bare-fashion.png +0 -0
- package/templates/bare-fashion/README.md +52 -0
- package/templates/bare-fashion/config.ts +474 -0
- package/templates/bare-fashion/dev/index.ts +16526 -0
- package/templates/bare-fashion/himalaya.content.json +70 -0
- package/templates/bare-fashion/himalaya.template.json +18 -0
- package/templates/bare-fashion/icon.png +0 -0
- package/templates/bare-fashion/platforms.json +3 -0
- package/templates/bare-fashion/tier5-src/_shared/app-locale.ts +70 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-address-book.ts +116 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-address-countries.ts +261 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-bag-count.ts +24 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-categories.ts +48 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-facets.ts +265 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-load-error.ts +38 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-product-card.ts +136 -0
- package/templates/bare-fashion/tier5-src/_shared/bare-fashion-store-options.ts +129 -0
- package/templates/bare-fashion/tier5-src/_shared/branded-lite-hosted.ts +282 -0
- package/templates/bare-fashion/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/bare-fashion/tier5-src/_shared/collection-query.ts +201 -0
- package/templates/bare-fashion/tier5-src/_shared/collection-service.ts +429 -0
- package/templates/bare-fashion/tier5-src/_shared/engine-intl.ts +529 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-account.ts +209 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-copy.ts +123 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-layouts.ts +142 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-store-categories.ts +108 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-store-saved.ts +57 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/bare-fashion/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/bare-fashion/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/bare-fashion/tier5-src/_shared/live-session.ts +172 -0
- package/templates/bare-fashion/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/bare-fashion/tier5-src/_shared/member-access.ts +63 -0
- package/templates/bare-fashion/tier5-src/_shared/member-avatar.ts +76 -0
- package/templates/bare-fashion/tier5-src/_shared/member-orders.ts +8 -0
- package/templates/bare-fashion/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/bare-fashion/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-account/index.ts +127 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-address-form/index.ts +367 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-addresses/index.ts +202 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-appearance/index.ts +73 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-cart/index.ts +540 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-collection/index.ts +111 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-home/index.ts +241 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-nav/index.ts +56 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-order/index.ts +437 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-product/index.ts +650 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-products/index.ts +142 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-saved/index.ts +45 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-search/index.ts +199 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-shop/index.ts +79 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-sign-in/index.ts +269 -0
- package/templates/bare-fashion/tier5-src/himi-bare-fashion-wallet/index.ts +224 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-info/index.ts +209 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-orders/index.ts +327 -0
- package/templates/bare-fashion/tier5-src/wix-spaces-collections/index.ts +48 -0
- package/templates/bare-fashion/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/bare-fashion/tier5-src/wix-spaces-view-profile/index.ts +119 -0
- package/templates/bare-fashion/tokens.json +348 -0
- package/templates/beauty-salon/dev/index.ts +223 -0
- package/templates/beauty-salon/l10n/ar.json +6 -0
- package/templates/beauty-salon/l10n/cs.json +6 -0
- package/templates/beauty-salon/l10n/da.json +6 -0
- package/templates/beauty-salon/l10n/de.json +6 -0
- package/templates/beauty-salon/l10n/el.json +6 -0
- package/templates/beauty-salon/l10n/en.json +9 -2
- package/templates/beauty-salon/l10n/es.json +6 -0
- package/templates/beauty-salon/l10n/fi.json +6 -0
- package/templates/beauty-salon/l10n/fr.json +6 -0
- package/templates/beauty-salon/l10n/he.json +5 -0
- package/templates/beauty-salon/l10n/hu.json +6 -0
- package/templates/beauty-salon/l10n/id.json +6 -0
- package/templates/beauty-salon/l10n/it.json +6 -0
- package/templates/beauty-salon/l10n/ja.json +6 -0
- package/templates/beauty-salon/l10n/ko.json +6 -0
- package/templates/beauty-salon/l10n/lt.json +6 -0
- package/templates/beauty-salon/l10n/nl.json +6 -0
- package/templates/beauty-salon/l10n/no.json +6 -0
- package/templates/beauty-salon/l10n/pl.json +6 -0
- package/templates/beauty-salon/l10n/pt.json +6 -0
- package/templates/beauty-salon/l10n/ru.json +6 -0
- package/templates/beauty-salon/l10n/sv.json +6 -0
- package/templates/beauty-salon/l10n/th.json +6 -0
- package/templates/beauty-salon/l10n/tr.json +6 -0
- package/templates/beauty-salon/l10n/uk.json +6 -0
- package/templates/beauty-salon/l10n/vi.json +6 -0
- package/templates/beauty-salon/l10n/zh.json +6 -0
- package/templates/beauty-salon/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/beauty-salon/tier5-src/_shared/lifecycle.ts +15 -0
- package/templates/beauty-salon/tier5-src/_shared/nav-member-avatar.ts +92 -0
- package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +15 -6
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/branded-lite/dev/index.ts +2167 -0
- package/templates/branded-lite/l10n/ar.json +6 -0
- package/templates/branded-lite/l10n/cs.json +6 -0
- package/templates/branded-lite/l10n/da.json +6 -0
- package/templates/branded-lite/l10n/de.json +6 -0
- package/templates/branded-lite/l10n/el.json +6 -0
- package/templates/branded-lite/l10n/en.json +12 -5
- package/templates/branded-lite/l10n/es.json +6 -0
- package/templates/branded-lite/l10n/fi.json +6 -0
- package/templates/branded-lite/l10n/fr.json +6 -0
- package/templates/branded-lite/l10n/he.json +5 -0
- package/templates/branded-lite/l10n/hu.json +6 -0
- package/templates/branded-lite/l10n/id.json +6 -0
- package/templates/branded-lite/l10n/it.json +6 -0
- package/templates/branded-lite/l10n/ja.json +6 -0
- package/templates/branded-lite/l10n/ko.json +6 -0
- package/templates/branded-lite/l10n/lt.json +6 -0
- package/templates/branded-lite/l10n/nl.json +6 -0
- package/templates/branded-lite/l10n/no.json +6 -0
- package/templates/branded-lite/l10n/pl.json +6 -0
- package/templates/branded-lite/l10n/pt.json +6 -0
- package/templates/branded-lite/l10n/ru.json +6 -0
- package/templates/branded-lite/l10n/sv.json +6 -0
- package/templates/branded-lite/l10n/th.json +6 -0
- package/templates/branded-lite/l10n/tr.json +6 -0
- package/templates/branded-lite/l10n/uk.json +6 -0
- package/templates/branded-lite/l10n/vi.json +6 -0
- package/templates/branded-lite/l10n/zh.json +6 -0
- package/templates/branded-lite/recipes/upcoming-bookings.json +118 -6
- package/templates/branded-lite/tier5-src/_shared/access-gates.ts +0 -13
- package/templates/branded-lite/tier5-src/_shared/collection-query-legacy.ts +7 -0
- package/templates/branded-lite/tier5-src/_shared/collection-query.ts +7 -0
- package/templates/branded-lite/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/branded-lite/tier5-src/_shared/events-inline-options.ts +55 -3
- package/templates/branded-lite/tier5-src/_shared/events-inline.ts +5 -3
- package/templates/branded-lite/tier5-src/_shared/guest-sign-in.ts +36 -0
- package/templates/branded-lite/tier5-src/_shared/lifecycle.ts +15 -0
- package/templates/branded-lite/tier5-src/_shared/nav-member-avatar.ts +92 -0
- package/templates/branded-lite/tier5-src/_shared/upcoming-bookings-section.ts +15 -4
- package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +14 -9
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +6 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +15 -6
- package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
- package/templates/branded-lite/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/brandy/tier5-src/_shared/collection-query-legacy.ts +7 -0
- package/templates/brandy/tier5-src/_shared/collection-query.ts +7 -0
- package/templates/brandy/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/brandy/tier5-src/_shared/guest-sign-in.ts +36 -0
- package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +6 -1
- package/templates/brandy/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
- package/templates/brandy/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/community-club/dev/index.ts +223 -0
- package/templates/community-club/l10n/ar.json +6 -0
- package/templates/community-club/l10n/cs.json +6 -0
- package/templates/community-club/l10n/da.json +6 -0
- package/templates/community-club/l10n/de.json +6 -0
- package/templates/community-club/l10n/el.json +6 -0
- package/templates/community-club/l10n/en.json +9 -2
- package/templates/community-club/l10n/es.json +6 -0
- package/templates/community-club/l10n/fi.json +6 -0
- package/templates/community-club/l10n/fr.json +6 -0
- package/templates/community-club/l10n/he.json +5 -0
- package/templates/community-club/l10n/hu.json +6 -0
- package/templates/community-club/l10n/id.json +6 -0
- package/templates/community-club/l10n/it.json +6 -0
- package/templates/community-club/l10n/ja.json +6 -0
- package/templates/community-club/l10n/ko.json +6 -0
- package/templates/community-club/l10n/lt.json +6 -0
- package/templates/community-club/l10n/nl.json +6 -0
- package/templates/community-club/l10n/no.json +6 -0
- package/templates/community-club/l10n/pl.json +6 -0
- package/templates/community-club/l10n/pt.json +6 -0
- package/templates/community-club/l10n/ru.json +6 -0
- package/templates/community-club/l10n/sv.json +6 -0
- package/templates/community-club/l10n/th.json +6 -0
- package/templates/community-club/l10n/tr.json +6 -0
- package/templates/community-club/l10n/uk.json +6 -0
- package/templates/community-club/l10n/vi.json +6 -0
- package/templates/community-club/l10n/zh.json +6 -0
- package/templates/community-club/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/community-club/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/community-club/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/community-club/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/community-club/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/community-club-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/conference/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/conference/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/conference/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/conference/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/conference/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/events-meetups/dev/index.ts +142 -0
- package/templates/events-meetups/l10n/ar.json +6 -0
- package/templates/events-meetups/l10n/cs.json +6 -0
- package/templates/events-meetups/l10n/da.json +6 -0
- package/templates/events-meetups/l10n/de.json +6 -0
- package/templates/events-meetups/l10n/el.json +6 -0
- package/templates/events-meetups/l10n/en.json +8 -1
- package/templates/events-meetups/l10n/es.json +6 -0
- package/templates/events-meetups/l10n/fi.json +6 -0
- package/templates/events-meetups/l10n/fr.json +6 -0
- package/templates/events-meetups/l10n/he.json +5 -0
- package/templates/events-meetups/l10n/hu.json +6 -0
- package/templates/events-meetups/l10n/id.json +6 -0
- package/templates/events-meetups/l10n/it.json +6 -0
- package/templates/events-meetups/l10n/ja.json +6 -0
- package/templates/events-meetups/l10n/ko.json +6 -0
- package/templates/events-meetups/l10n/lt.json +6 -0
- package/templates/events-meetups/l10n/nl.json +6 -0
- package/templates/events-meetups/l10n/no.json +6 -0
- package/templates/events-meetups/l10n/pl.json +6 -0
- package/templates/events-meetups/l10n/pt.json +6 -0
- package/templates/events-meetups/l10n/ru.json +6 -0
- package/templates/events-meetups/l10n/sv.json +6 -0
- package/templates/events-meetups/l10n/th.json +6 -0
- package/templates/events-meetups/l10n/tr.json +6 -0
- package/templates/events-meetups/l10n/uk.json +6 -0
- package/templates/events-meetups/l10n/vi.json +6 -0
- package/templates/events-meetups/l10n/zh.json +6 -0
- package/templates/events-meetups/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/events-meetups/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/events-meetups/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/events-meetups/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/events-meetups-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/fitness-gym/tier5-src/_shared/guest-sign-in.ts +36 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
- package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/gym-fitness/dev/index.ts +385 -0
- package/templates/gym-fitness/l10n/ar.json +6 -0
- package/templates/gym-fitness/l10n/cs.json +6 -0
- package/templates/gym-fitness/l10n/da.json +6 -0
- package/templates/gym-fitness/l10n/de.json +6 -0
- package/templates/gym-fitness/l10n/el.json +6 -0
- package/templates/gym-fitness/l10n/en.json +9 -2
- package/templates/gym-fitness/l10n/es.json +6 -0
- package/templates/gym-fitness/l10n/fi.json +6 -0
- package/templates/gym-fitness/l10n/fr.json +6 -0
- package/templates/gym-fitness/l10n/he.json +5 -0
- package/templates/gym-fitness/l10n/hu.json +6 -0
- package/templates/gym-fitness/l10n/id.json +6 -0
- package/templates/gym-fitness/l10n/it.json +6 -0
- package/templates/gym-fitness/l10n/ja.json +6 -0
- package/templates/gym-fitness/l10n/ko.json +6 -0
- package/templates/gym-fitness/l10n/lt.json +6 -0
- package/templates/gym-fitness/l10n/nl.json +6 -0
- package/templates/gym-fitness/l10n/no.json +6 -0
- package/templates/gym-fitness/l10n/pl.json +6 -0
- package/templates/gym-fitness/l10n/pt.json +6 -0
- package/templates/gym-fitness/l10n/ru.json +6 -0
- package/templates/gym-fitness/l10n/sv.json +6 -0
- package/templates/gym-fitness/l10n/th.json +6 -0
- package/templates/gym-fitness/l10n/tr.json +6 -0
- package/templates/gym-fitness/l10n/uk.json +6 -0
- package/templates/gym-fitness/l10n/vi.json +6 -0
- package/templates/gym-fitness/l10n/zh.json +6 -0
- package/templates/gym-fitness/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/gym-fitness/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/gym-fitness/tier5-src/_shared/lifecycle.ts +15 -0
- package/templates/gym-fitness/tier5-src/_shared/nav-member-avatar.ts +92 -0
- package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +15 -6
- package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/medical-services/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/medical-services/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/medical-services/tier5-src/_shared/guest-sign-in.ts +36 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
- package/templates/medical-services/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/nonprofit-cause/dev/index.ts +223 -0
- package/templates/nonprofit-cause/l10n/ar.json +6 -0
- package/templates/nonprofit-cause/l10n/cs.json +6 -0
- package/templates/nonprofit-cause/l10n/da.json +6 -0
- package/templates/nonprofit-cause/l10n/de.json +6 -0
- package/templates/nonprofit-cause/l10n/el.json +6 -0
- package/templates/nonprofit-cause/l10n/en.json +8 -1
- package/templates/nonprofit-cause/l10n/es.json +6 -0
- package/templates/nonprofit-cause/l10n/fi.json +6 -0
- package/templates/nonprofit-cause/l10n/fr.json +6 -0
- package/templates/nonprofit-cause/l10n/he.json +5 -0
- package/templates/nonprofit-cause/l10n/hu.json +6 -0
- package/templates/nonprofit-cause/l10n/id.json +6 -0
- package/templates/nonprofit-cause/l10n/it.json +6 -0
- package/templates/nonprofit-cause/l10n/ja.json +6 -0
- package/templates/nonprofit-cause/l10n/ko.json +6 -0
- package/templates/nonprofit-cause/l10n/lt.json +6 -0
- package/templates/nonprofit-cause/l10n/nl.json +6 -0
- package/templates/nonprofit-cause/l10n/no.json +6 -0
- package/templates/nonprofit-cause/l10n/pl.json +6 -0
- package/templates/nonprofit-cause/l10n/pt.json +6 -0
- package/templates/nonprofit-cause/l10n/ru.json +6 -0
- package/templates/nonprofit-cause/l10n/sv.json +6 -0
- package/templates/nonprofit-cause/l10n/th.json +6 -0
- package/templates/nonprofit-cause/l10n/tr.json +6 -0
- package/templates/nonprofit-cause/l10n/uk.json +6 -0
- package/templates/nonprofit-cause/l10n/vi.json +6 -0
- package/templates/nonprofit-cause/l10n/zh.json +6 -0
- package/templates/nonprofit-cause/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/nonprofit-cause/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/owner-lite/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/owner-lite/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/podcast-creator/dev/index.ts +223 -0
- package/templates/podcast-creator/l10n/ar.json +6 -0
- package/templates/podcast-creator/l10n/cs.json +6 -0
- package/templates/podcast-creator/l10n/da.json +6 -0
- package/templates/podcast-creator/l10n/de.json +6 -0
- package/templates/podcast-creator/l10n/el.json +6 -0
- package/templates/podcast-creator/l10n/en.json +8 -1
- package/templates/podcast-creator/l10n/es.json +6 -0
- package/templates/podcast-creator/l10n/fi.json +6 -0
- package/templates/podcast-creator/l10n/fr.json +6 -0
- package/templates/podcast-creator/l10n/he.json +5 -0
- package/templates/podcast-creator/l10n/hu.json +6 -0
- package/templates/podcast-creator/l10n/id.json +6 -0
- package/templates/podcast-creator/l10n/it.json +6 -0
- package/templates/podcast-creator/l10n/ja.json +6 -0
- package/templates/podcast-creator/l10n/ko.json +6 -0
- package/templates/podcast-creator/l10n/lt.json +6 -0
- package/templates/podcast-creator/l10n/nl.json +6 -0
- package/templates/podcast-creator/l10n/no.json +6 -0
- package/templates/podcast-creator/l10n/pl.json +6 -0
- package/templates/podcast-creator/l10n/pt.json +6 -0
- package/templates/podcast-creator/l10n/ru.json +6 -0
- package/templates/podcast-creator/l10n/sv.json +6 -0
- package/templates/podcast-creator/l10n/th.json +6 -0
- package/templates/podcast-creator/l10n/tr.json +6 -0
- package/templates/podcast-creator/l10n/uk.json +6 -0
- package/templates/podcast-creator/l10n/vi.json +6 -0
- package/templates/podcast-creator/l10n/zh.json +6 -0
- package/templates/podcast-creator/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/podcast-creator/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/portfolio-creative/dev/index.ts +142 -0
- package/templates/portfolio-creative/l10n/ar.json +6 -0
- package/templates/portfolio-creative/l10n/cs.json +6 -0
- package/templates/portfolio-creative/l10n/da.json +6 -0
- package/templates/portfolio-creative/l10n/de.json +6 -0
- package/templates/portfolio-creative/l10n/el.json +6 -0
- package/templates/portfolio-creative/l10n/en.json +8 -1
- package/templates/portfolio-creative/l10n/es.json +6 -0
- package/templates/portfolio-creative/l10n/fi.json +6 -0
- package/templates/portfolio-creative/l10n/fr.json +6 -0
- package/templates/portfolio-creative/l10n/he.json +5 -0
- package/templates/portfolio-creative/l10n/hu.json +6 -0
- package/templates/portfolio-creative/l10n/id.json +6 -0
- package/templates/portfolio-creative/l10n/it.json +6 -0
- package/templates/portfolio-creative/l10n/ja.json +6 -0
- package/templates/portfolio-creative/l10n/ko.json +6 -0
- package/templates/portfolio-creative/l10n/lt.json +6 -0
- package/templates/portfolio-creative/l10n/nl.json +6 -0
- package/templates/portfolio-creative/l10n/no.json +6 -0
- package/templates/portfolio-creative/l10n/pl.json +6 -0
- package/templates/portfolio-creative/l10n/pt.json +6 -0
- package/templates/portfolio-creative/l10n/ru.json +6 -0
- package/templates/portfolio-creative/l10n/sv.json +6 -0
- package/templates/portfolio-creative/l10n/th.json +6 -0
- package/templates/portfolio-creative/l10n/tr.json +6 -0
- package/templates/portfolio-creative/l10n/uk.json +6 -0
- package/templates/portfolio-creative/l10n/vi.json +6 -0
- package/templates/portfolio-creative/l10n/zh.json +6 -0
- package/templates/portfolio-creative/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/portfolio-creative/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/restaurant/dev/index.ts +142 -0
- package/templates/restaurant/l10n/ar.json +6 -0
- package/templates/restaurant/l10n/cs.json +6 -0
- package/templates/restaurant/l10n/da.json +6 -0
- package/templates/restaurant/l10n/de.json +6 -0
- package/templates/restaurant/l10n/el.json +6 -0
- package/templates/restaurant/l10n/en.json +9 -2
- package/templates/restaurant/l10n/es.json +6 -0
- package/templates/restaurant/l10n/fi.json +6 -0
- package/templates/restaurant/l10n/fr.json +6 -0
- package/templates/restaurant/l10n/he.json +5 -0
- package/templates/restaurant/l10n/hu.json +6 -0
- package/templates/restaurant/l10n/id.json +6 -0
- package/templates/restaurant/l10n/it.json +6 -0
- package/templates/restaurant/l10n/ja.json +6 -0
- package/templates/restaurant/l10n/ko.json +6 -0
- package/templates/restaurant/l10n/lt.json +6 -0
- package/templates/restaurant/l10n/nl.json +6 -0
- package/templates/restaurant/l10n/no.json +6 -0
- package/templates/restaurant/l10n/pl.json +6 -0
- package/templates/restaurant/l10n/pt.json +6 -0
- package/templates/restaurant/l10n/ru.json +6 -0
- package/templates/restaurant/l10n/sv.json +6 -0
- package/templates/restaurant/l10n/th.json +6 -0
- package/templates/restaurant/l10n/tr.json +6 -0
- package/templates/restaurant/l10n/uk.json +6 -0
- package/templates/restaurant/l10n/vi.json +6 -0
- package/templates/restaurant/l10n/zh.json +6 -0
- package/templates/restaurant/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/restaurant/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/restaurant/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/restaurant/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/restaurant-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/retail-store/dev/index.ts +142 -0
- package/templates/retail-store/l10n/ar.json +6 -0
- package/templates/retail-store/l10n/cs.json +6 -0
- package/templates/retail-store/l10n/da.json +6 -0
- package/templates/retail-store/l10n/de.json +6 -0
- package/templates/retail-store/l10n/el.json +6 -0
- package/templates/retail-store/l10n/en.json +8 -1
- package/templates/retail-store/l10n/es.json +6 -0
- package/templates/retail-store/l10n/fi.json +6 -0
- package/templates/retail-store/l10n/fr.json +6 -0
- package/templates/retail-store/l10n/he.json +5 -0
- package/templates/retail-store/l10n/hu.json +6 -0
- package/templates/retail-store/l10n/id.json +6 -0
- package/templates/retail-store/l10n/it.json +6 -0
- package/templates/retail-store/l10n/ja.json +6 -0
- package/templates/retail-store/l10n/ko.json +6 -0
- package/templates/retail-store/l10n/lt.json +6 -0
- package/templates/retail-store/l10n/nl.json +6 -0
- package/templates/retail-store/l10n/no.json +6 -0
- package/templates/retail-store/l10n/pl.json +6 -0
- package/templates/retail-store/l10n/pt.json +6 -0
- package/templates/retail-store/l10n/ru.json +6 -0
- package/templates/retail-store/l10n/sv.json +6 -0
- package/templates/retail-store/l10n/th.json +6 -0
- package/templates/retail-store/l10n/tr.json +6 -0
- package/templates/retail-store/l10n/uk.json +6 -0
- package/templates/retail-store/l10n/vi.json +6 -0
- package/templates/retail-store/l10n/zh.json +6 -0
- package/templates/retail-store/tier5-src/_shared/collection-query-legacy.ts +7 -0
- package/templates/retail-store/tier5-src/_shared/collection-query.ts +7 -0
- package/templates/retail-store/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/retail-store-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/salon-spa/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/salon-spa/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/wholesale-store/tier5-src/_shared/collection-query-legacy.ts +7 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-query.ts +7 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/yoga-studio/dev/index.ts +304 -0
- package/templates/yoga-studio/l10n/ar.json +6 -0
- package/templates/yoga-studio/l10n/cs.json +6 -0
- package/templates/yoga-studio/l10n/da.json +6 -0
- package/templates/yoga-studio/l10n/de.json +6 -0
- package/templates/yoga-studio/l10n/el.json +6 -0
- package/templates/yoga-studio/l10n/en.json +10 -3
- package/templates/yoga-studio/l10n/es.json +6 -0
- package/templates/yoga-studio/l10n/fi.json +6 -0
- package/templates/yoga-studio/l10n/fr.json +6 -0
- package/templates/yoga-studio/l10n/he.json +5 -0
- package/templates/yoga-studio/l10n/hu.json +6 -0
- package/templates/yoga-studio/l10n/id.json +6 -0
- package/templates/yoga-studio/l10n/it.json +6 -0
- package/templates/yoga-studio/l10n/ja.json +6 -0
- package/templates/yoga-studio/l10n/ko.json +6 -0
- package/templates/yoga-studio/l10n/lt.json +6 -0
- package/templates/yoga-studio/l10n/nl.json +6 -0
- package/templates/yoga-studio/l10n/no.json +6 -0
- package/templates/yoga-studio/l10n/pl.json +6 -0
- package/templates/yoga-studio/l10n/pt.json +6 -0
- package/templates/yoga-studio/l10n/ru.json +6 -0
- package/templates/yoga-studio/l10n/sv.json +6 -0
- package/templates/yoga-studio/l10n/th.json +6 -0
- package/templates/yoga-studio/l10n/tr.json +6 -0
- package/templates/yoga-studio/l10n/uk.json +6 -0
- package/templates/yoga-studio/l10n/vi.json +6 -0
- package/templates/yoga-studio/l10n/zh.json +6 -0
- package/templates/yoga-studio/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +7 -1
- package/templates/yoga-studio/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/yoga-studio/tier5-src/_shared/lifecycle.ts +15 -0
- package/templates/yoga-studio/tier5-src/_shared/nav-member-avatar.ts +92 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +15 -6
- package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +17 -0
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +26 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-query.ts +8 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +7 -1
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// Tier-5 bundle: BARE home — hero (New Collection), category carousel, sale grid.
|
|
2
|
+
//
|
|
3
|
+
// Replaces the template's himi-branded-lite-home for this app. That worker awaited
|
|
4
|
+
// bookings/events/restaurant signals for verticals BARE does not have installed
|
|
5
|
+
// (the site runs store + forms only), and those awaits never settled off-device, so
|
|
6
|
+
// the screen sat on status:"loading" forever. This worker fetches exactly the two
|
|
7
|
+
// things the home needs: the product catalog and the collections.
|
|
8
|
+
import { defineService } from "@himalaya/state";
|
|
9
|
+
import { searchStoreProducts, type StoreProduct } from "@himalaya/wix-stores";
|
|
10
|
+
import { queryCollections, type WixCollection } from "@himalaya/wix-stores-collections";
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// CATALOG VERSION. This site runs CATALOG_V1 — every /stores/v3/* read answers
|
|
14
|
+
// CATALOG_V1_SITE_CALLING_CATALOG_V3_API. Both readers below are the sanctioned
|
|
15
|
+
// SDK helpers (calling /stores/v1 by hand is refused by `himi validate`):
|
|
16
|
+
// * searchStoreProducts is catalog-agnostic — it probes
|
|
17
|
+
// GET /stores/v3/provision/version once, then routes to V1 for this site.
|
|
18
|
+
// * queryCollections is V1-only by its own SDK documentation, which is the
|
|
19
|
+
// correct reader here; the V3 equivalent (queryStoreCategories) never
|
|
20
|
+
// settles against a V1 site.
|
|
21
|
+
//
|
|
22
|
+
// KNOWN LOCAL LIMITATION: `himi render --live` does not dispatch onAppear and
|
|
23
|
+
// does not deliver responses back to a module-scope boot fetch, so that probe
|
|
24
|
+
// shows liveReturned 0 and this screen renders its loading state locally. The
|
|
25
|
+
// real-data evidence for it is `himi test` against dev/net-mocks.json (captured
|
|
26
|
+
// from the live site) plus the draft preview in a browser. himi_shop hydrates
|
|
27
|
+
// live against the same endpoints, so the binding itself is proven.
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
import { cardId, productCards, refreshSaved, toggleFavorite, type ProductCard } from "../_shared/bare-fashion-product-card.js";
|
|
30
|
+
import { categoryCard, orderCategories, type CategoryCard } from "../_shared/bare-fashion-categories.js";
|
|
31
|
+
import { errorFlags, errorKindOf, type ErrorKind } from "../_shared/bare-fashion-load-error.js";
|
|
32
|
+
|
|
33
|
+
/** The site's own words. Every string here is quoted from the published BARE site —
|
|
34
|
+
* never invented. Replace them with your brand's words. */
|
|
35
|
+
const COPY = {
|
|
36
|
+
announcement: "FREE SHIPPING OVER $50 WORLDWIDE",
|
|
37
|
+
heroTitle: "SUMMER COLLECTION",
|
|
38
|
+
heroSubtitle: "EVERYDAY APPAREL FOR EVERYONE",
|
|
39
|
+
heroCta: "Shop Now",
|
|
40
|
+
categoriesTitle: "Top Categories",
|
|
41
|
+
newInTitle: "New In",
|
|
42
|
+
saleMarquee: "SALE IS ON / SALE IS ON / SALE IS ON",
|
|
43
|
+
saleTitle: "UP TO 40% OFF",
|
|
44
|
+
saleSubtitle: "Plus free shipping over $50",
|
|
45
|
+
saleCta: "Shop Sale",
|
|
46
|
+
viewMore: "View More",
|
|
47
|
+
errorText: "Couldn't load the store.",
|
|
48
|
+
retry: "Try again",
|
|
49
|
+
} as const;
|
|
50
|
+
|
|
51
|
+
/** Hero art chosen by the site owner (wix:image://v1/0fc611_ea296f9ef99143ad9271b83419528020~mv2.jpg,
|
|
52
|
+
* 1512×1494), served from Wix media. */
|
|
53
|
+
const HERO_IMAGE =
|
|
54
|
+
"https://static.wixstatic.com/media/0fc611_ea296f9ef99143ad9271b83419528020~mv2.jpg/v1/fit/w_1512,h_1494,q_90/file.jpg";
|
|
55
|
+
|
|
56
|
+
interface S {
|
|
57
|
+
status: "loading" | "ready" | "error";
|
|
58
|
+
isLoading: boolean;
|
|
59
|
+
notLoading: boolean;
|
|
60
|
+
isErrored: boolean;
|
|
61
|
+
notErrored: boolean;
|
|
62
|
+
notReady: boolean;
|
|
63
|
+
/** Why the last load failed: the error state shows the offline or the server variant. */
|
|
64
|
+
errorKind?: ErrorKind;
|
|
65
|
+
hideOfflineError?: boolean;
|
|
66
|
+
hideServerError?: boolean;
|
|
67
|
+
|
|
68
|
+
announcement: string;
|
|
69
|
+
heroTitle: string;
|
|
70
|
+
heroSubtitle: string;
|
|
71
|
+
heroCta: string;
|
|
72
|
+
heroImage: string;
|
|
73
|
+
hasHeroImage: boolean;
|
|
74
|
+
noHeroImage: boolean;
|
|
75
|
+
|
|
76
|
+
categoriesTitle: string;
|
|
77
|
+
categories: CategoryCard[];
|
|
78
|
+
noCategories: boolean;
|
|
79
|
+
|
|
80
|
+
newInTitle: string;
|
|
81
|
+
newIn: ProductCard[];
|
|
82
|
+
/** The New In scroller: the products, then one "View More" card at the end. */
|
|
83
|
+
newInRow: NewInRowItem[];
|
|
84
|
+
noNewIn: boolean;
|
|
85
|
+
|
|
86
|
+
saleMarquee: string;
|
|
87
|
+
saleTitle: string;
|
|
88
|
+
saleSubtitle: string;
|
|
89
|
+
saleCta: string;
|
|
90
|
+
saleItems: ProductCard[];
|
|
91
|
+
noSaleItems: boolean;
|
|
92
|
+
|
|
93
|
+
viewMore: string;
|
|
94
|
+
errorText: string;
|
|
95
|
+
retryLabel: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type NewInRowItem = (ProductCard | Partial<ProductCard>) & { isMore: boolean; notMore: boolean };
|
|
99
|
+
|
|
100
|
+
const VIEW_MORE_ID = "__view_more__";
|
|
101
|
+
|
|
102
|
+
function newInRow(s: S): NewInRowItem[] {
|
|
103
|
+
if (s.newIn.length === 0) return [];
|
|
104
|
+
return [
|
|
105
|
+
...s.newIn.map((c) => ({ ...c, isMore: false, notMore: true })),
|
|
106
|
+
{ id: VIEW_MORE_ID, name: s.viewMore, isMore: true, notMore: false },
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function collectionIdsOf(p: StoreProduct): string[] {
|
|
111
|
+
const raw = (p as unknown as { collectionIds?: string[] }).collectionIds;
|
|
112
|
+
return Array.isArray(raw) ? raw : [];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Recompute every derived flag. State is not reactive: each action must re-derive.
|
|
116
|
+
* (tier-5 guide — "Derived state is not reactive".) */
|
|
117
|
+
function derive(s: S): S {
|
|
118
|
+
return {
|
|
119
|
+
...s,
|
|
120
|
+
isLoading: s.status === "loading",
|
|
121
|
+
notLoading: s.status !== "loading",
|
|
122
|
+
isErrored: s.status === "error",
|
|
123
|
+
notErrored: s.status !== "error",
|
|
124
|
+
...errorFlags(s.status, s.errorKind),
|
|
125
|
+
notReady: s.status !== "ready",
|
|
126
|
+
noCategories: s.categories.length === 0,
|
|
127
|
+
newInRow: newInRow(s),
|
|
128
|
+
noNewIn: s.newIn.length === 0,
|
|
129
|
+
noSaleItems: s.saleItems.length === 0,
|
|
130
|
+
hasHeroImage: !!s.heroImage,
|
|
131
|
+
noHeroImage: !s.heroImage,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** Boot state is DETERMINISTIC — no clock, no Math.random(). A boot state that varies
|
|
136
|
+
* rehashes the release on every build and no UX record can match it. */
|
|
137
|
+
const BOOT: S = derive({
|
|
138
|
+
status: "loading",
|
|
139
|
+
isLoading: true,
|
|
140
|
+
notLoading: false,
|
|
141
|
+
isErrored: false,
|
|
142
|
+
notErrored: true,
|
|
143
|
+
notReady: true,
|
|
144
|
+
announcement: COPY.announcement,
|
|
145
|
+
heroTitle: COPY.heroTitle,
|
|
146
|
+
heroSubtitle: COPY.heroSubtitle,
|
|
147
|
+
heroCta: COPY.heroCta,
|
|
148
|
+
heroImage: "",
|
|
149
|
+
hasHeroImage: false,
|
|
150
|
+
noHeroImage: true,
|
|
151
|
+
categoriesTitle: COPY.categoriesTitle,
|
|
152
|
+
categories: [],
|
|
153
|
+
noCategories: true,
|
|
154
|
+
newInTitle: COPY.newInTitle,
|
|
155
|
+
newIn: [],
|
|
156
|
+
newInRow: [],
|
|
157
|
+
noNewIn: true,
|
|
158
|
+
saleMarquee: COPY.saleMarquee,
|
|
159
|
+
saleTitle: COPY.saleTitle,
|
|
160
|
+
saleSubtitle: COPY.saleSubtitle,
|
|
161
|
+
saleCta: COPY.saleCta,
|
|
162
|
+
saleItems: [],
|
|
163
|
+
noSaleItems: true,
|
|
164
|
+
viewMore: COPY.viewMore,
|
|
165
|
+
errorText: COPY.errorText,
|
|
166
|
+
retryLabel: COPY.retry,
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
async function load(state: S): Promise<S> {
|
|
170
|
+
try {
|
|
171
|
+
// Independent reads: a collections failure must not blank the catalog, so they
|
|
172
|
+
// settle separately rather than through one rejecting Promise.all.
|
|
173
|
+
// Independent reads: a collections failure must not blank the catalog, so they
|
|
174
|
+
// settle separately rather than through one rejecting Promise.all.
|
|
175
|
+
const [productsResult, categoriesResult] = await Promise.allSettled([
|
|
176
|
+
searchStoreProducts({ limit: 100 }),
|
|
177
|
+
queryCollections({ query: { paging: { limit: 50 } } }),
|
|
178
|
+
]);
|
|
179
|
+
|
|
180
|
+
if (productsResult.status === "rejected") {
|
|
181
|
+
return derive({ ...state, status: "error", errorKind: errorKindOf(productsResult.reason) });
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const products = productsResult.value.products ?? [];
|
|
185
|
+
const categories = categoriesResult.status === "fulfilled"
|
|
186
|
+
? orderCategories(categoriesResult.value.collections ?? [])
|
|
187
|
+
: [];
|
|
188
|
+
|
|
189
|
+
const cards = productCards(products);
|
|
190
|
+
const saleItems = cards.filter((c) => c.onSale);
|
|
191
|
+
|
|
192
|
+
// "New In" is the site's own collection. Fall back to the head of the catalog
|
|
193
|
+
// when that collection is absent, so the rail is never empty on a site that
|
|
194
|
+
// never made one.
|
|
195
|
+
const newInId = categories.find((c) => (c.name ?? "").trim().toUpperCase() === "NEW IN")?.id ?? "";
|
|
196
|
+
const newInProducts = newInId
|
|
197
|
+
? products.filter((p) => collectionIdsOf(p).includes(newInId))
|
|
198
|
+
: [];
|
|
199
|
+
const newIn = productCards((newInProducts.length > 0 ? newInProducts : products).slice(0, 8));
|
|
200
|
+
|
|
201
|
+
return derive({
|
|
202
|
+
...state,
|
|
203
|
+
status: "ready",
|
|
204
|
+
heroImage: HERO_IMAGE,
|
|
205
|
+
categories: categories.map(categoryCard),
|
|
206
|
+
newIn,
|
|
207
|
+
saleItems,
|
|
208
|
+
});
|
|
209
|
+
} catch (e) {
|
|
210
|
+
return derive({ ...state, status: "error", errorKind: errorKindOf(e) });
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const svc = defineService<S, {
|
|
215
|
+
refresh: (s: S) => Promise<S>;
|
|
216
|
+
retry: (s: S) => Promise<S>;
|
|
217
|
+
toggleSave: (s: S, arg: unknown) => S;
|
|
218
|
+
}>("bareFashionHome", {
|
|
219
|
+
state: BOOT,
|
|
220
|
+
actions: {
|
|
221
|
+
refresh: (s) => load(s),
|
|
222
|
+
retry: (s) => load(derive({ ...s, status: "loading" })),
|
|
223
|
+
toggleSave: (s, arg) => {
|
|
224
|
+
// New In and Sale can list the same product; both hearts must agree.
|
|
225
|
+
try { toggleFavorite([...s.newIn, ...s.saleItems], cardId(arg)); } catch { return s; }
|
|
226
|
+
return derive({ ...s, newIn: refreshSaved(s.newIn), saleItems: refreshSaved(s.saleItems) });
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
// Self-kick so the screen loads on cold boot as well as on onAppear.
|
|
232
|
+
// Mirrors the shipped store workers: the boot call is NOT voided and the handle is
|
|
233
|
+
// exported, which is how the harness finds the service to await.
|
|
234
|
+
// Cold-boot kick. The descriptor's root also dispatches `refresh` from onAppear, and
|
|
235
|
+
// `load()` is idempotent, so the screen paints whichever arrives first. NOTE: `himi
|
|
236
|
+
// render --live` does not dispatch onAppear and does not deliver responses to a
|
|
237
|
+
// module-scope kick (liveReturned 0), so the LIVE proof for this screen is the draft
|
|
238
|
+
// preview in a browser, not a local render. himi_shop hydrates live against the same
|
|
239
|
+
// endpoints, so the binding itself is sound.
|
|
240
|
+
svc.refresh();
|
|
241
|
+
export { svc };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Tier-5 nav bundle: himi-bare-fashion-nav — the app-level worker behind the tab bar's live bindings.
|
|
2
|
+
// It feeds the Bag tab's count badge. On boot it reads the live cart once; after that it
|
|
3
|
+
// polls the on-device count that the shop, product and bag workers publish
|
|
4
|
+
// (see _shared/bag-count.ts), so the badge never costs a network call per tick.
|
|
5
|
+
import { defineService } from "@himalaya/state";
|
|
6
|
+
import { getCurrentCart } from "@himalaya/wix-ecom";
|
|
7
|
+
import { publishBagCount, readBagCount } from "../_shared/bare-fashion-bag-count.js";
|
|
8
|
+
|
|
9
|
+
interface S {
|
|
10
|
+
// null = badge hidden (empty cart); positive number = item count shown on badge
|
|
11
|
+
bagCount: number | null;
|
|
12
|
+
/** Why the last live read failed ("" when it did not): the badge then shows the stored count. */
|
|
13
|
+
error: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const SYNC_POLL = { id: "bare-nav-bag", intervalMs: 1500, action: "bareFashionNav.sync" };
|
|
17
|
+
|
|
18
|
+
/** Live bag size (sum of line quantities), or the reason the cart could not be read. */
|
|
19
|
+
async function liveBagCount(): Promise<{ ok: true; count: number } | { ok: false; error: string }> {
|
|
20
|
+
try {
|
|
21
|
+
const cart = await getCurrentCart();
|
|
22
|
+
return { ok: true, count: (cart.lineItems ?? []).reduce((n, li) => n + (li.quantity ?? 1), 0) };
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return { ok: false, error: String((e as Error)?.message ?? e) };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Returns null when count is 0 (hides the badge) or the count when positive. */
|
|
29
|
+
function badgeValue(count: number | null): number | null {
|
|
30
|
+
return count !== null && count > 0 ? count : null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const svc = defineService<S, {
|
|
34
|
+
load: (s: S) => Promise<S>;
|
|
35
|
+
sync: (s: S) => Promise<S | undefined>;
|
|
36
|
+
}>("bareFashionNav", {
|
|
37
|
+
state: { bagCount: null, error: "" },
|
|
38
|
+
actions: {
|
|
39
|
+
load: async (s) => {
|
|
40
|
+
const live = await liveBagCount();
|
|
41
|
+
if (live.ok) await publishBagCount(live.count);
|
|
42
|
+
const raw = live.ok ? live.count : await readBagCount();
|
|
43
|
+
const bagCount = badgeValue(raw);
|
|
44
|
+
return { ...s, bagCount, error: live.ok ? "" : live.error, _poll: { ...SYNC_POLL } } as S;
|
|
45
|
+
},
|
|
46
|
+
// Idle ticks return undefined, so an unchanged count costs no re-render.
|
|
47
|
+
sync: async (s) => {
|
|
48
|
+
const raw = await readBagCount();
|
|
49
|
+
const bagCount = badgeValue(raw);
|
|
50
|
+
return bagCount === s.bagCount ? undefined : { ...s, bagCount };
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
svc.load();
|
|
56
|
+
export { svc };
|