@wix/himalaya-cli 0.1749.0 → 0.1751.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 +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/himi-package.d.ts +478 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/host-compatibility.d.ts +56 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +156 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast-service.d.ts +105 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast.d.ts +116 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +326 -13
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +730 -81
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +155 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin → 21f35a12bd94f4ab97a9a75453c4adcadc438daf024a4b1950d5c356c123bd01.bin} +1 -1
- package/dist/browser-plane/sw.js +7 -7
- package/dist/cli.mjs +44618 -35753
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +4 -0
- package/guides/designing-himi-screens.md +7 -0
- package/guides/getting-started.md +5 -1
- package/guides/headless-loop.md +1 -1
- package/guides/himi-json-output.md +54 -1
- package/guides/himi-skill.md +5 -1
- package/guides/index.json +6 -0
- package/guides/one-app-to-himi-app.md +31 -8
- package/guides/qa-builds.md +12 -1
- package/guides/recipe-podcast.md +149 -0
- package/guides/skill.md +3 -1
- package/guides/store-submission.md +149 -34
- package/guides/tier-5-add-a-screen.md +16 -2
- package/guides/wix-business-context.md +43 -0
- package/guides/wix-platform-usage.md +7 -2
- package/package.json +10 -10
- package/template-icons/fitness-gym.png +0 -0
- package/template-icons/personal-fitness-trainer.png +0 -0
- package/templates/beauty-salon/config.ts +12 -0
- package/templates/beauty-salon/dev/index.ts +1 -1
- package/templates/beauty-salon/l10n/en.json +1 -1
- package/templates/beauty-salon/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/beauty-salon/tier5-src/_shared/header-badges.ts +113 -0
- package/templates/beauty-salon/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/beauty-salon/tier5-src/_shared/member-access.ts +17 -6
- package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/beauty-salon/tier5-src/_shared/source-badges.ts +72 -0
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/branded-lite/config.ts +12 -0
- package/templates/branded-lite/dev/index.ts +101 -1
- package/templates/branded-lite/l10n/en.json +22 -1
- package/templates/branded-lite/l10n/es.json +22 -0
- package/templates/branded-lite/l10n/fr.json +23 -0
- package/templates/branded-lite/l10n/he.json +19 -0
- package/templates/branded-lite/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/branded-lite/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/branded-lite/tier5-src/_shared/member-access.ts +17 -6
- package/templates/branded-lite/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +10 -5
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
- package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +12 -1
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/brandy/README.md +33 -0
- package/templates/brandy/config.ts +51 -7
- package/templates/brandy/dev/index.ts +23 -9
- package/templates/community-club/l10n/en.json +1 -1
- package/templates/community-club/tier5-src/_shared/member-access.ts +17 -6
- package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/community-club/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/community-club/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/conference/tier5-src/_shared/member-access.ts +17 -6
- package/templates/conference/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/events-meetups/l10n/en.json +1 -1
- package/templates/events-meetups/tier5-src/_shared/member-access.ts +17 -6
- package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/fitness-gym/README.md +53 -0
- package/templates/fitness-gym/config.ts +560 -0
- package/templates/fitness-gym/dev/index.ts +25787 -0
- package/templates/fitness-gym/himalaya.content.json +64 -0
- package/templates/fitness-gym/himalaya.template.json +15 -0
- package/templates/fitness-gym/icon.png +0 -0
- package/templates/fitness-gym/platforms.json +1 -0
- package/templates/fitness-gym/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/fitness-gym/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/fitness-gym/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/fitness-gym/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-media.ts +29 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/fitness-gym/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/fitness-gym/tier5-src/_shared/host-events.ts +66 -0
- package/templates/fitness-gym/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/fitness-gym/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/fitness-gym/tier5-src/_shared/member-access.ts +63 -0
- package/templates/fitness-gym/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/fitness-gym/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/fitness-gym/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/fitness-gym/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/fitness-gym/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/fitness-gym/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/fitness-gym/tier5-src/_shared/program-description.ts +11 -0
- package/templates/fitness-gym/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +46 -0
- package/templates/fitness-gym/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/fitness-gym/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/fitness-gym/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/fitness-gym/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/fitness-gym/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/fitness-gym/tier5-src/business-chat/index.ts +732 -0
- package/templates/fitness-gym/tier5-src/business-contact/index.ts +6 -0
- package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +267 -0
- package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +656 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +495 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/facts.ts +52 -0
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +845 -0
- package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +191 -0
- package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +619 -0
- package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
- package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/fitness-gym/tokens.json +414 -0
- package/templates/gym-fitness/config.ts +12 -0
- package/templates/gym-fitness/dev/index.ts +1 -1
- package/templates/gym-fitness/l10n/en.json +1 -1
- package/templates/gym-fitness/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/gym-fitness/tier5-src/_shared/header-badges.ts +113 -0
- package/templates/gym-fitness/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/gym-fitness/tier5-src/_shared/member-access.ts +17 -6
- package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/gym-fitness/tier5-src/_shared/source-badges.ts +72 -0
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/medical-services/dev/index.ts +2 -1
- package/templates/medical-services/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/medical-services/tier5-src/_shared/member-access.ts +17 -6
- package/templates/medical-services/tier5-src/himi-booking-account/index.ts +16 -1
- package/templates/medical-services/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/nonprofit-cause/l10n/en.json +1 -1
- package/templates/nonprofit-cause/tier5-src/_shared/member-access.ts +17 -6
- package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/personal-fitness-trainer/README.md +51 -0
- package/templates/personal-fitness-trainer/config.ts +343 -0
- package/templates/personal-fitness-trainer/dev/index.ts +24813 -0
- package/templates/personal-fitness-trainer/himalaya.content.json +79 -0
- package/templates/personal-fitness-trainer/himalaya.template.json +14 -0
- package/templates/personal-fitness-trainer/icon.png +0 -0
- package/templates/personal-fitness-trainer/platforms.json +3 -0
- package/templates/personal-fitness-trainer/splash.json +3 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-layouts.ts +142 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/host-events.ts +66 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-access.ts +63 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/video-caption.ts +21 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +732 -0
- package/templates/personal-fitness-trainer/tier5-src/business-contact/index.ts +6 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/index.ts +1094 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-appearance/index.ts +94 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +495 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-splash/index.ts +35 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +226 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-videos/index.ts +145 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-home/index.ts +70 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-profile/index.ts +53 -0
- package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-app-language/index.ts +73 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +119 -0
- package/templates/personal-fitness-trainer/tokens.json +381 -0
- package/templates/podcast-creator/dev/index.ts +100 -0
- package/templates/podcast-creator/l10n/en.json +22 -1
- package/templates/podcast-creator/l10n/es.json +22 -0
- package/templates/podcast-creator/l10n/fr.json +18 -0
- package/templates/podcast-creator/l10n/he.json +15 -0
- package/templates/podcast-creator/tier5-src/_shared/member-access.ts +17 -6
- package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/portfolio-creative/l10n/en.json +1 -1
- package/templates/portfolio-creative/tier5-src/_shared/member-access.ts +17 -6
- package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/restaurant/l10n/en.json +1 -1
- package/templates/restaurant/tier5-src/_shared/member-access.ts +17 -6
- package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/retail-store/l10n/en.json +1 -1
- package/templates/retail-store/tier5-src/_shared/member-access.ts +17 -6
- package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +68 -55
- package/templates/salon-spa/dev/index.ts +1 -1
- package/templates/salon-spa/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/salon-spa/tier5-src/_shared/member-access.ts +17 -6
- package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +16 -1
- package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/wholesale-store/tier5-src/_shared/member-access.ts +17 -6
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/yoga-studio/config.ts +12 -0
- package/templates/yoga-studio/dev/index.ts +1 -1
- package/templates/yoga-studio/l10n/en.json +1 -1
- package/templates/yoga-studio/tier5-src/_shared/booking-session.ts +3 -1
- package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/yoga-studio/tier5-src/_shared/header-badges.ts +113 -0
- package/templates/yoga-studio/tier5-src/_shared/location-pin.ts +97 -0
- package/templates/yoga-studio/tier5-src/_shared/member-access.ts +17 -6
- package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +5 -8
- package/templates/yoga-studio/tier5-src/_shared/source-badges.ts +72 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
- package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +152 -0
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +13 -4
- package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +68 -55
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// `site` block of ../provisioning.json — so this file holds no screen of its own. Change the
|
|
3
3
|
// pages by changing that block, never this file. When provisioning.json enables page
|
|
4
4
|
// capabilities (`webSdk`), every page gets the worker that answers them (`withSiteWebSdk`).
|
|
5
|
-
import { siteScreens, withSiteWebSdk } from "@himalaya/core";
|
|
5
|
+
import { assertSiteNativePagesBuilt, siteScreens, withSiteNativeScreenTopBarBuilder, withSiteWebSdk } from "@himalaya/core";
|
|
6
6
|
import config, { base44, BASE44_ACCOUNT_SCREEN_ID, site, webSdk } from "../config.js";
|
|
7
7
|
|
|
8
8
|
const SCREENS = siteScreens(site);
|
|
@@ -854,18 +854,32 @@ const ACCOUNT = base44 ? { [BASE44_ACCOUNT_SCREEN_ID]: base44Account(base44.dele
|
|
|
854
854
|
// and the agent tooling read `homeScreenId` from this file as written; config.ts refuses a map
|
|
855
855
|
// whose first tab is anything else, so the literal and the tab bar cannot disagree.
|
|
856
856
|
|
|
857
|
+
// A fresh copy per build: descriptors are pure functions of the site block (withSiteWebSdk
|
|
858
|
+
// copies, and attaches the page worker when `webSdk` enables capabilities). A JSON round trip,
|
|
859
|
+
// not structuredClone: `himi test` builds screens in the contained realm, which withholds it.
|
|
860
|
+
const exact: Record<string, (ctx: Parameters<typeof withSiteWebSdk>[1]) => unknown> = {
|
|
861
|
+
...Object.fromEntries(Object.keys(SCREENS).map((id) => [id, (ctx: Parameters<typeof withSiteWebSdk>[1]) => withSiteWebSdk(SCREENS[id]!, ctx, webSdk)])),
|
|
862
|
+
himi_notification_settings: () => JSON.parse(JSON.stringify(NOTIFICATIONS)),
|
|
863
|
+
...Object.fromEntries(Object.entries(ACCOUNT).map(([id, screen]) => [id, () => JSON.parse(JSON.stringify(screen))])),
|
|
864
|
+
// Your own native screens go here, keyed by screen id, and `site.nativePages` in
|
|
865
|
+
// ../provisioning.json places them as tabs, drawer rows or overflow screens, e.g.
|
|
866
|
+
// rewards: () => ({ screenId: "rewards", renderer: "sdui_intent", title: "Rewards", schemaVersion: 1, payload: { … } }),
|
|
867
|
+
// with its worker in tier5-src/ (`himi docs tier-5-add-a-screen`).
|
|
868
|
+
};
|
|
869
|
+
// A native page only PLACES a screen, so it must be one built above — or its row would open nothing.
|
|
870
|
+
assertSiteNativePagesBuilt(site, Object.keys(exact));
|
|
871
|
+
// A top-bar icon that opens one of your native screens is left out of that screen's own bar (on the
|
|
872
|
+
// screen itself it would open a second copy), the way a website page's bar leaves out its own icon.
|
|
873
|
+
for (const [screenId, build] of Object.entries(exact)) {
|
|
874
|
+
// A builder may return its screen directly or as a promise; the wrapper awaits it first.
|
|
875
|
+
if (!screenId.startsWith("site_")) exact[screenId] = withSiteNativeScreenTopBarBuilder(site, build);
|
|
876
|
+
}
|
|
877
|
+
|
|
857
878
|
export default {
|
|
858
879
|
config,
|
|
859
880
|
homeScreenId: "site_home",
|
|
860
881
|
screens: {
|
|
861
|
-
|
|
862
|
-
// copies, and attaches the page worker when `webSdk` enables capabilities). A JSON round trip,
|
|
863
|
-
// not structuredClone: `himi test` builds screens in the contained realm, which withholds it.
|
|
864
|
-
exact: {
|
|
865
|
-
...Object.fromEntries(Object.keys(SCREENS).map((id) => [id, (ctx: Parameters<typeof withSiteWebSdk>[1]) => withSiteWebSdk(SCREENS[id]!, ctx, webSdk)])),
|
|
866
|
-
himi_notification_settings: () => JSON.parse(JSON.stringify(NOTIFICATIONS)),
|
|
867
|
-
...Object.fromEntries(Object.entries(ACCOUNT).map(([id, screen]) => [id, () => JSON.parse(JSON.stringify(screen))])),
|
|
868
|
-
},
|
|
882
|
+
exact,
|
|
869
883
|
templated: [],
|
|
870
884
|
},
|
|
871
885
|
actions: [],
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import { dispatch } from "@himalaya/dispatch";
|
|
2
2
|
import { getMyData } from "@himalaya/wix-users";
|
|
3
3
|
|
|
4
|
-
export interface MemberAccess { email: string; scope: string; }
|
|
4
|
+
export interface MemberAccess { email: string; scope: string; signedIn?: boolean; }
|
|
5
5
|
export function memberAccessChanged(): Error {
|
|
6
6
|
const error = new Error("Member access changed"); error.name = "MemberAccessChanged"; return error;
|
|
7
7
|
}
|
|
8
|
-
export async function memberAccess(): Promise<MemberAccess> {
|
|
8
|
+
export async function memberAccess(options: { throwOnUnavailable?: boolean } = {}): Promise<MemberAccess> {
|
|
9
9
|
let email = "";
|
|
10
|
+
let signedIn = false;
|
|
10
11
|
let identityUnavailable = false;
|
|
11
12
|
try {
|
|
12
|
-
const value = await dispatch("himi.wix.memberIdentity") as { email?: unknown; payload?: { email?: unknown } } | null;
|
|
13
|
+
const value = await dispatch("himi.wix.memberIdentity") as { status?: unknown; ok?: unknown; email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
|
|
14
|
+
if (value?.status === "error" || value?.ok === false) throw value;
|
|
13
15
|
const raw = value?.email ?? value?.payload?.email;
|
|
14
16
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
17
|
+
signedIn = (value?.signedIn ?? value?.payload?.signedIn) === true;
|
|
15
18
|
} catch { identityUnavailable = true; }
|
|
16
19
|
// Older native hosts predate the memberIdentity action but can still expose
|
|
17
20
|
// the authenticated profile through wix-users. Only a missing action uses
|
|
18
|
-
// that rung
|
|
21
|
+
// that rung. A successful host response is authoritative, including a signed-in
|
|
22
|
+
// session whose email has not arrived yet; it must not consult owner records.
|
|
19
23
|
if (!email && identityUnavailable) {
|
|
20
24
|
try {
|
|
21
25
|
const profile = await getMyData();
|
|
22
26
|
const raw = profile.email ?? profile.contactEmail;
|
|
23
27
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
24
|
-
} catch {
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const failure = error as { status?: unknown; statusCode?: unknown; code?: unknown } | null;
|
|
30
|
+
const anonymous = failure?.status === 401 || failure?.statusCode === 401 || failure?.code === "UNAUTHENTICATED";
|
|
31
|
+
// Legacy bridges can lose the structured status. An unknown failure is
|
|
32
|
+
// unavailable in strict consumers, never evidence of a signed-out session.
|
|
33
|
+
if (options.throwOnUnavailable && !anonymous) throw error;
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
|
|
27
37
|
const account = input?.__himiPreferenceAccount, business = input?.__himiPreferenceBusiness;
|
|
28
38
|
const valid = (v: unknown): v is string => typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v) && v !== "default";
|
|
29
39
|
// These fields are overwritten by authenticated hosts. Older binaries stay online-only.
|
|
30
|
-
|
|
40
|
+
// A session signal does not grant an email-scoped cache or private query.
|
|
41
|
+
return { email, signedIn: signedIn || Boolean(email), scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
|
|
31
42
|
}
|
|
32
43
|
export async function assertMemberAccess(member: MemberAccess): Promise<void> {
|
|
33
44
|
const current = await memberAccess();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// How a worker reads an Online Program's lifecycle and name. Wix returns them in more than one
|
|
2
|
+
// shape (v3 `status` or `state`; `description.title`, `settings.title`, a flat `title` or
|
|
3
|
+
// `details.title`), so every screen that lists programs reads them here, the same way.
|
|
4
|
+
import type { WixProgram } from "@himalaya/wix-online-programs";
|
|
5
|
+
import { cleanTitle } from "./himi-text.js";
|
|
6
|
+
|
|
7
|
+
export function programStatus(p: WixProgram): string {
|
|
8
|
+
return (p.status ?? p.state ?? "").toUpperCase();
|
|
9
|
+
}
|
|
10
|
+
export const isProgramEnded = (p: WixProgram): boolean => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
|
|
11
|
+
export const isProgramDraft = (p: WixProgram): boolean => programStatus(p) === "DRAFT";
|
|
12
|
+
|
|
13
|
+
/** The program's own name, cleaned; "" when it has none (the caller picks its own fallback word). */
|
|
14
|
+
export function programName(p: WixProgram): string {
|
|
15
|
+
return cleanTitle(p.description?.title ?? p.settings?.title ?? p.title ?? p.details?.title);
|
|
16
|
+
}
|
|
@@ -22,7 +22,8 @@ import { iapPriceFields, onlineProgramItem, type IapPollDirective } from "@himal
|
|
|
22
22
|
import { createIapCommerce } from "@himalaya/iap-checkout";
|
|
23
23
|
import { createCollectionQuery, type CollectionPage, type CollectionQueryState } from "./collection-query.js";
|
|
24
24
|
import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "./member-access.js";
|
|
25
|
-
import {
|
|
25
|
+
import { initials } from "./himi-text.js";
|
|
26
|
+
import { isProgramDraft, isProgramEnded, programName } from "./program-fields.js";
|
|
26
27
|
import { programImage } from "./himi-media.js";
|
|
27
28
|
import { descriptionBody } from "./rich-body.js";
|
|
28
29
|
import { programDescription } from "./program-description.js";
|
|
@@ -125,19 +126,15 @@ export interface State {
|
|
|
125
126
|
const full = (p: WixProgram): WixProgramFull => p as WixProgramFull;
|
|
126
127
|
|
|
127
128
|
function programTitle(p: WixProgram): string {
|
|
128
|
-
return
|
|
129
|
-
|| copyParam("memberPrograms.programFallbackName", "Program");
|
|
129
|
+
return programName(p) || copyParam("memberPrograms.programFallbackName", "Program");
|
|
130
130
|
}
|
|
131
131
|
function programDetails(p: WixProgram): string {
|
|
132
132
|
// The body may be a Ricos document or serialized text: read it the way the catalog and detail do.
|
|
133
133
|
const raw = descriptionBody(programDescription(p)).bodyText.replace(/\s+/g, " ").trim();
|
|
134
134
|
return raw.length > 140 ? `${raw.slice(0, 139).trimEnd()}…` : raw;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
const isEnded = (p: WixProgram) => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
|
|
140
|
-
const isDraft = (p: WixProgram) => programStatus(p) === "DRAFT";
|
|
136
|
+
const isEnded = isProgramEnded;
|
|
137
|
+
const isDraft = isProgramDraft;
|
|
141
138
|
function accessType(p: WixProgram): string {
|
|
142
139
|
return (full(p).restrictions?.accessType ?? "PUBLIC").toUpperCase();
|
|
143
140
|
}
|
|
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
|
|
|
565
565
|
lastNameFocus: string;
|
|
566
566
|
emailFocus: string;
|
|
567
567
|
message: string;
|
|
568
|
+
hideMessage: boolean;
|
|
569
|
+
messageKind: "error" | "success";
|
|
570
|
+
resetSent: boolean;
|
|
568
571
|
isLoading: boolean;
|
|
569
572
|
notLoading: boolean;
|
|
570
573
|
isRegistering: boolean;
|
|
@@ -640,6 +643,9 @@ function derive(s: S): S {
|
|
|
640
643
|
const name = s.isMember ? greetingName(s.memberName) : "";
|
|
641
644
|
return {
|
|
642
645
|
...s,
|
|
646
|
+
hideMessage: !s.message,
|
|
647
|
+
messageKind: s.resetSent ? "success" : "error",
|
|
648
|
+
resetSent: !!s.message && !!s.resetSent,
|
|
643
649
|
greeting: name
|
|
644
650
|
? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
|
|
645
651
|
: copyParam("storeAccount.greetingGuest", "Hey, guest"),
|
|
@@ -815,7 +821,7 @@ const svc = defineService<S, {
|
|
|
815
821
|
restorePublish: (s: S) => S;
|
|
816
822
|
iapRestore: (s: S) => Promise<undefined>;
|
|
817
823
|
}>("himiStoreAccount", {
|
|
818
|
-
notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
824
|
+
notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
819
825
|
state: derive({
|
|
820
826
|
status: "loading",
|
|
821
827
|
isMember: false,
|
|
@@ -846,6 +852,9 @@ const svc = defineService<S, {
|
|
|
846
852
|
lastNameFocus: "",
|
|
847
853
|
emailFocus: "",
|
|
848
854
|
message: "",
|
|
855
|
+
hideMessage: true,
|
|
856
|
+
messageKind: "error",
|
|
857
|
+
resetSent: false,
|
|
849
858
|
isLoading: true,
|
|
850
859
|
notLoading: false,
|
|
851
860
|
// The form's first paint is already on its route's mode: only sign-in's route has `mode`.
|
|
@@ -942,10 +951,10 @@ const svc = defineService<S, {
|
|
|
942
951
|
rejectResult(raw, "reset");
|
|
943
952
|
if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
|
|
944
953
|
return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
|
|
945
|
-
message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
954
|
+
resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
946
955
|
} catch (error) {
|
|
947
956
|
return derive({ ...svc.getState(), authBusy: false,
|
|
948
|
-
message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
957
|
+
resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
949
958
|
} finally { authInFlight = false; }
|
|
950
959
|
},
|
|
951
960
|
signIn: (s) => authenticate(s, "signIn"),
|
|
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
|
|
|
991
1000
|
},
|
|
992
1001
|
});
|
|
993
1002
|
|
|
994
|
-
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
1003
|
+
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
995
1004
|
// `boot` tells settle this is not a visit: the host drops this call's navigation, and the
|
|
996
1005
|
// appear refresh does the visit's moves.
|
|
997
1006
|
svc.load({ boot: "1" });
|
|
@@ -11,7 +11,7 @@ import { getMyData, displayName } from "@himalaya/wix-users";
|
|
|
11
11
|
// `load` has resolved a member, so a guest never glimpses the placeholder avatar while
|
|
12
12
|
// the membership check is still running; `hideLoading` is false for exactly that moment,
|
|
13
13
|
// so the screen shows a loading line instead of going blank.
|
|
14
|
-
interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean }
|
|
14
|
+
interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean; hideError: boolean; hideAbout: boolean }
|
|
15
15
|
|
|
16
16
|
const EMPTY: S = {
|
|
17
17
|
status: "loading",
|
|
@@ -24,6 +24,8 @@ const EMPTY: S = {
|
|
|
24
24
|
noSignIn: true,
|
|
25
25
|
profileHidden: true,
|
|
26
26
|
hideLoading: false,
|
|
27
|
+
hideError: true,
|
|
28
|
+
hideAbout: false,
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
// The SAME member check create-post and orders use (`memberAccess`: the host's
|
|
@@ -41,66 +43,77 @@ function fromParts(name: string, handleRaw: string, about: string, photo = ""):
|
|
|
41
43
|
const clean = name.trim();
|
|
42
44
|
const handle = "@" + (handleRaw || clean || "member").replace(/\s+/g, "").replace(/^@+/, "").toLowerCase();
|
|
43
45
|
const initial = (clean.split(/\s+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2) || "?").toUpperCase();
|
|
44
|
-
return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true };
|
|
46
|
+
return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true, hideError: true, hideAbout: false };
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
async function readProfile(): Promise<S> {
|
|
50
|
+
const email = await sessionEmail();
|
|
51
|
+
if (!email) {
|
|
52
|
+
return {
|
|
53
|
+
status: "ready",
|
|
54
|
+
// Kept for hosts without the shared member gate (the Spaces clone renders these
|
|
55
|
+
// fields directly); branded-lite hides the profile block behind `profileHidden`.
|
|
56
|
+
name: "Sign in to view your profile",
|
|
57
|
+
handle: "",
|
|
58
|
+
about: "Your public profile is available after you sign in from Account.",
|
|
59
|
+
initial: "?",
|
|
60
|
+
photo: "",
|
|
61
|
+
needsSignIn: true,
|
|
62
|
+
noSignIn: false,
|
|
63
|
+
profileHidden: true,
|
|
64
|
+
hideLoading: true,
|
|
65
|
+
hideError: true,
|
|
66
|
+
hideAbout: false,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const api = wixApi();
|
|
71
|
+
if (api) {
|
|
72
|
+
const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
|
|
73
|
+
member?: {
|
|
74
|
+
loginEmail?: string;
|
|
75
|
+
contact?: { firstName?: string; lastName?: string };
|
|
76
|
+
profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
const m = res.member;
|
|
80
|
+
if (m) {
|
|
81
|
+
const nick = m.profile?.nickname?.trim() || "";
|
|
82
|
+
const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
|
|
83
|
+
const name = full || nick || m.loginEmail || email;
|
|
84
|
+
const slug = m.profile?.slug || nick || name;
|
|
85
|
+
const about = m.profile?.title || "No info to display.";
|
|
86
|
+
return fromParts(name, slug, about, m.profile?.photo?.url || "");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} catch { /* fall through to users my-data / email */ }
|
|
90
|
+
try {
|
|
91
|
+
const d = await getMyData();
|
|
92
|
+
const name = displayName(d) || email;
|
|
93
|
+
const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
|
|
94
|
+
return fromParts(
|
|
95
|
+
name,
|
|
96
|
+
dd.slug || dd.nickname || name,
|
|
97
|
+
dd.aboutPlain || dd.about || "No info to display.",
|
|
98
|
+
dd.profile?.photo?.url || dd.photo?.url || "",
|
|
99
|
+
);
|
|
100
|
+
} catch {
|
|
101
|
+
// Session identity is still known; missing profile data is not an empty biography.
|
|
102
|
+
return { ...fromParts(email, email.split("@")[0] || email, ""), about: "Profile details could not be loaded. Please try again.", hideError: false, hideAbout: true };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
let generation = 0;
|
|
106
|
+
const svc = defineService<S, { load: (s: S) => Promise<S | undefined> }>("spacesViewProfile", {
|
|
48
107
|
state: { ...EMPTY },
|
|
108
|
+
notHydrated: Object.keys(EMPTY) as (keyof S & string)[],
|
|
49
109
|
actions: {
|
|
50
110
|
load: async () => {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
status: "ready",
|
|
55
|
-
// Kept for hosts without the shared member gate (the Spaces clone renders these
|
|
56
|
-
// fields directly); branded-lite hides the profile block behind `profileHidden`.
|
|
57
|
-
name: "Sign in to view your profile",
|
|
58
|
-
handle: "",
|
|
59
|
-
about: "Your public profile is available after you sign in from Account.",
|
|
60
|
-
initial: "?",
|
|
61
|
-
photo: "",
|
|
62
|
-
needsSignIn: true,
|
|
63
|
-
noSignIn: false,
|
|
64
|
-
profileHidden: true,
|
|
65
|
-
hideLoading: true,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
try {
|
|
69
|
-
const api = wixApi();
|
|
70
|
-
if (api) {
|
|
71
|
-
const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
|
|
72
|
-
member?: {
|
|
73
|
-
loginEmail?: string;
|
|
74
|
-
contact?: { firstName?: string; lastName?: string };
|
|
75
|
-
profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
const m = res.member;
|
|
79
|
-
if (m) {
|
|
80
|
-
const nick = m.profile?.nickname?.trim() || "";
|
|
81
|
-
const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
|
|
82
|
-
const name = full || nick || m.loginEmail || email;
|
|
83
|
-
const slug = m.profile?.slug || nick || name;
|
|
84
|
-
const about = m.profile?.title || "No info to display.";
|
|
85
|
-
return fromParts(name, slug, about, m.profile?.photo?.url || "");
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
} catch { /* fall through to users my-data / email */ }
|
|
89
|
-
try {
|
|
90
|
-
const d = await getMyData();
|
|
91
|
-
const name = displayName(d) || email;
|
|
92
|
-
const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
|
|
93
|
-
return fromParts(
|
|
94
|
-
name,
|
|
95
|
-
dd.slug || dd.nickname || name,
|
|
96
|
-
dd.aboutPlain || dd.about || "No info to display.",
|
|
97
|
-
dd.profile?.photo?.url || dd.photo?.url || "",
|
|
98
|
-
);
|
|
99
|
-
} catch {
|
|
100
|
-
return fromParts(email, email.split("@")[0] || email, "No info to display.");
|
|
101
|
-
}
|
|
111
|
+
const request = ++generation;
|
|
112
|
+
const next = await readProfile();
|
|
113
|
+
return request === generation ? next : undefined;
|
|
102
114
|
},
|
|
103
115
|
},
|
|
104
116
|
});
|
|
105
|
-
svc.
|
|
117
|
+
if (!(globalThis as { himalaya?: { hydrationOptOut?: boolean } }).himalaya?.hydrationOptOut) Object.assign(svc.getState(), EMPTY);
|
|
118
|
+
void svc.load();
|
|
106
119
|
export { svc };
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import { dispatch } from "@himalaya/dispatch";
|
|
2
2
|
import { getMyData } from "@himalaya/wix-users";
|
|
3
3
|
|
|
4
|
-
export interface MemberAccess { email: string; scope: string; }
|
|
4
|
+
export interface MemberAccess { email: string; scope: string; signedIn?: boolean; }
|
|
5
5
|
export function memberAccessChanged(): Error {
|
|
6
6
|
const error = new Error("Member access changed"); error.name = "MemberAccessChanged"; return error;
|
|
7
7
|
}
|
|
8
|
-
export async function memberAccess(): Promise<MemberAccess> {
|
|
8
|
+
export async function memberAccess(options: { throwOnUnavailable?: boolean } = {}): Promise<MemberAccess> {
|
|
9
9
|
let email = "";
|
|
10
|
+
let signedIn = false;
|
|
10
11
|
let identityUnavailable = false;
|
|
11
12
|
try {
|
|
12
|
-
const value = await dispatch("himi.wix.memberIdentity") as { email?: unknown; payload?: { email?: unknown } } | null;
|
|
13
|
+
const value = await dispatch("himi.wix.memberIdentity") as { status?: unknown; ok?: unknown; email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
|
|
14
|
+
if (value?.status === "error" || value?.ok === false) throw value;
|
|
13
15
|
const raw = value?.email ?? value?.payload?.email;
|
|
14
16
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
17
|
+
signedIn = (value?.signedIn ?? value?.payload?.signedIn) === true;
|
|
15
18
|
} catch { identityUnavailable = true; }
|
|
16
19
|
// Older native hosts predate the memberIdentity action but can still expose
|
|
17
20
|
// the authenticated profile through wix-users. Only a missing action uses
|
|
18
|
-
// that rung
|
|
21
|
+
// that rung. A successful host response is authoritative, including a signed-in
|
|
22
|
+
// session whose email has not arrived yet; it must not consult owner records.
|
|
19
23
|
if (!email && identityUnavailable) {
|
|
20
24
|
try {
|
|
21
25
|
const profile = await getMyData();
|
|
22
26
|
const raw = profile.email ?? profile.contactEmail;
|
|
23
27
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
24
|
-
} catch {
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const failure = error as { status?: unknown; statusCode?: unknown; code?: unknown } | null;
|
|
30
|
+
const anonymous = failure?.status === 401 || failure?.statusCode === 401 || failure?.code === "UNAUTHENTICATED";
|
|
31
|
+
// Legacy bridges can lose the structured status. An unknown failure is
|
|
32
|
+
// unavailable in strict consumers, never evidence of a signed-out session.
|
|
33
|
+
if (options.throwOnUnavailable && !anonymous) throw error;
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
|
|
27
37
|
const account = input?.__himiPreferenceAccount, business = input?.__himiPreferenceBusiness;
|
|
28
38
|
const valid = (v: unknown): v is string => typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v) && v !== "default";
|
|
29
39
|
// These fields are overwritten by authenticated hosts. Older binaries stay online-only.
|
|
30
|
-
|
|
40
|
+
// A session signal does not grant an email-scoped cache or private query.
|
|
41
|
+
return { email, signedIn: signedIn || Boolean(email), scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
|
|
31
42
|
}
|
|
32
43
|
export async function assertMemberAccess(member: MemberAccess): Promise<void> {
|
|
33
44
|
const current = await memberAccess();
|
|
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
|
|
|
565
565
|
lastNameFocus: string;
|
|
566
566
|
emailFocus: string;
|
|
567
567
|
message: string;
|
|
568
|
+
hideMessage: boolean;
|
|
569
|
+
messageKind: "error" | "success";
|
|
570
|
+
resetSent: boolean;
|
|
568
571
|
isLoading: boolean;
|
|
569
572
|
notLoading: boolean;
|
|
570
573
|
isRegistering: boolean;
|
|
@@ -640,6 +643,9 @@ function derive(s: S): S {
|
|
|
640
643
|
const name = s.isMember ? greetingName(s.memberName) : "";
|
|
641
644
|
return {
|
|
642
645
|
...s,
|
|
646
|
+
hideMessage: !s.message,
|
|
647
|
+
messageKind: s.resetSent ? "success" : "error",
|
|
648
|
+
resetSent: !!s.message && !!s.resetSent,
|
|
643
649
|
greeting: name
|
|
644
650
|
? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
|
|
645
651
|
: copyParam("storeAccount.greetingGuest", "Hey, guest"),
|
|
@@ -815,7 +821,7 @@ const svc = defineService<S, {
|
|
|
815
821
|
restorePublish: (s: S) => S;
|
|
816
822
|
iapRestore: (s: S) => Promise<undefined>;
|
|
817
823
|
}>("himiStoreAccount", {
|
|
818
|
-
notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
824
|
+
notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
819
825
|
state: derive({
|
|
820
826
|
status: "loading",
|
|
821
827
|
isMember: false,
|
|
@@ -846,6 +852,9 @@ const svc = defineService<S, {
|
|
|
846
852
|
lastNameFocus: "",
|
|
847
853
|
emailFocus: "",
|
|
848
854
|
message: "",
|
|
855
|
+
hideMessage: true,
|
|
856
|
+
messageKind: "error",
|
|
857
|
+
resetSent: false,
|
|
849
858
|
isLoading: true,
|
|
850
859
|
notLoading: false,
|
|
851
860
|
// The form's first paint is already on its route's mode: only sign-in's route has `mode`.
|
|
@@ -942,10 +951,10 @@ const svc = defineService<S, {
|
|
|
942
951
|
rejectResult(raw, "reset");
|
|
943
952
|
if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
|
|
944
953
|
return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
|
|
945
|
-
message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
954
|
+
resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
|
|
946
955
|
} catch (error) {
|
|
947
956
|
return derive({ ...svc.getState(), authBusy: false,
|
|
948
|
-
message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
957
|
+
resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
|
|
949
958
|
} finally { authInFlight = false; }
|
|
950
959
|
},
|
|
951
960
|
signIn: (s) => authenticate(s, "signIn"),
|
|
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
|
|
|
991
1000
|
},
|
|
992
1001
|
});
|
|
993
1002
|
|
|
994
|
-
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
1003
|
+
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
995
1004
|
// `boot` tells settle this is not a visit: the host drops this call's navigation, and the
|
|
996
1005
|
// appear refresh does the visit's moves.
|
|
997
1006
|
svc.load({ boot: "1" });
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import { dispatch } from "@himalaya/dispatch";
|
|
2
2
|
import { getMyData } from "@himalaya/wix-users";
|
|
3
3
|
|
|
4
|
-
export interface MemberAccess { email: string; scope: string; }
|
|
4
|
+
export interface MemberAccess { email: string; scope: string; signedIn?: boolean; }
|
|
5
5
|
export function memberAccessChanged(): Error {
|
|
6
6
|
const error = new Error("Member access changed"); error.name = "MemberAccessChanged"; return error;
|
|
7
7
|
}
|
|
8
|
-
export async function memberAccess(): Promise<MemberAccess> {
|
|
8
|
+
export async function memberAccess(options: { throwOnUnavailable?: boolean } = {}): Promise<MemberAccess> {
|
|
9
9
|
let email = "";
|
|
10
|
+
let signedIn = false;
|
|
10
11
|
let identityUnavailable = false;
|
|
11
12
|
try {
|
|
12
|
-
const value = await dispatch("himi.wix.memberIdentity") as { email?: unknown; payload?: { email?: unknown } } | null;
|
|
13
|
+
const value = await dispatch("himi.wix.memberIdentity") as { status?: unknown; ok?: unknown; email?: unknown; signedIn?: unknown; payload?: { email?: unknown; signedIn?: unknown } } | null;
|
|
14
|
+
if (value?.status === "error" || value?.ok === false) throw value;
|
|
13
15
|
const raw = value?.email ?? value?.payload?.email;
|
|
14
16
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
17
|
+
signedIn = (value?.signedIn ?? value?.payload?.signedIn) === true;
|
|
15
18
|
} catch { identityUnavailable = true; }
|
|
16
19
|
// Older native hosts predate the memberIdentity action but can still expose
|
|
17
20
|
// the authenticated profile through wix-users. Only a missing action uses
|
|
18
|
-
// that rung
|
|
21
|
+
// that rung. A successful host response is authoritative, including a signed-in
|
|
22
|
+
// session whose email has not arrived yet; it must not consult owner records.
|
|
19
23
|
if (!email && identityUnavailable) {
|
|
20
24
|
try {
|
|
21
25
|
const profile = await getMyData();
|
|
22
26
|
const raw = profile.email ?? profile.contactEmail;
|
|
23
27
|
email = typeof raw === "string" ? raw.trim().toLowerCase() : "";
|
|
24
|
-
} catch {
|
|
28
|
+
} catch (error) {
|
|
29
|
+
const failure = error as { status?: unknown; statusCode?: unknown; code?: unknown } | null;
|
|
30
|
+
const anonymous = failure?.status === 401 || failure?.statusCode === 401 || failure?.code === "UNAUTHENTICATED";
|
|
31
|
+
// Legacy bridges can lose the structured status. An unknown failure is
|
|
32
|
+
// unavailable in strict consumers, never evidence of a signed-out session.
|
|
33
|
+
if (options.throwOnUnavailable && !anonymous) throw error;
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
|
|
27
37
|
const account = input?.__himiPreferenceAccount, business = input?.__himiPreferenceBusiness;
|
|
28
38
|
const valid = (v: unknown): v is string => typeof v === "string" && /^[A-Za-z0-9_.:-]{1,128}$/.test(v) && v !== "default";
|
|
29
39
|
// These fields are overwritten by authenticated hosts. Older binaries stay online-only.
|
|
30
|
-
|
|
40
|
+
// A session signal does not grant an email-scoped cache or private query.
|
|
41
|
+
return { email, signedIn: signedIn || Boolean(email), scope: email && valid(account) && valid(business) ? JSON.stringify([account, business, email]) : "" };
|
|
31
42
|
}
|
|
32
43
|
export async function assertMemberAccess(member: MemberAccess): Promise<void> {
|
|
33
44
|
const current = await memberAccess();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// How a worker reads an Online Program's lifecycle and name. Wix returns them in more than one
|
|
2
|
+
// shape (v3 `status` or `state`; `description.title`, `settings.title`, a flat `title` or
|
|
3
|
+
// `details.title`), so every screen that lists programs reads them here, the same way.
|
|
4
|
+
import type { WixProgram } from "@himalaya/wix-online-programs";
|
|
5
|
+
import { cleanTitle } from "./himi-text.js";
|
|
6
|
+
|
|
7
|
+
export function programStatus(p: WixProgram): string {
|
|
8
|
+
return (p.status ?? p.state ?? "").toUpperCase();
|
|
9
|
+
}
|
|
10
|
+
export const isProgramEnded = (p: WixProgram): boolean => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
|
|
11
|
+
export const isProgramDraft = (p: WixProgram): boolean => programStatus(p) === "DRAFT";
|
|
12
|
+
|
|
13
|
+
/** The program's own name, cleaned; "" when it has none (the caller picks its own fallback word). */
|
|
14
|
+
export function programName(p: WixProgram): string {
|
|
15
|
+
return cleanTitle(p.description?.title ?? p.settings?.title ?? p.title ?? p.details?.title);
|
|
16
|
+
}
|
|
@@ -22,7 +22,8 @@ import { iapPriceFields, onlineProgramItem, type IapPollDirective } from "@himal
|
|
|
22
22
|
import { createIapCommerce } from "@himalaya/iap-checkout";
|
|
23
23
|
import { createCollectionQuery, type CollectionPage, type CollectionQueryState } from "./collection-query.js";
|
|
24
24
|
import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "./member-access.js";
|
|
25
|
-
import {
|
|
25
|
+
import { initials } from "./himi-text.js";
|
|
26
|
+
import { isProgramDraft, isProgramEnded, programName } from "./program-fields.js";
|
|
26
27
|
import { programImage } from "./himi-media.js";
|
|
27
28
|
import { descriptionBody } from "./rich-body.js";
|
|
28
29
|
import { programDescription } from "./program-description.js";
|
|
@@ -125,19 +126,15 @@ export interface State {
|
|
|
125
126
|
const full = (p: WixProgram): WixProgramFull => p as WixProgramFull;
|
|
126
127
|
|
|
127
128
|
function programTitle(p: WixProgram): string {
|
|
128
|
-
return
|
|
129
|
-
|| copyParam("memberPrograms.programFallbackName", "Program");
|
|
129
|
+
return programName(p) || copyParam("memberPrograms.programFallbackName", "Program");
|
|
130
130
|
}
|
|
131
131
|
function programDetails(p: WixProgram): string {
|
|
132
132
|
// The body may be a Ricos document or serialized text: read it the way the catalog and detail do.
|
|
133
133
|
const raw = descriptionBody(programDescription(p)).bodyText.replace(/\s+/g, " ").trim();
|
|
134
134
|
return raw.length > 140 ? `${raw.slice(0, 139).trimEnd()}…` : raw;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
const isEnded = (p: WixProgram) => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
|
|
140
|
-
const isDraft = (p: WixProgram) => programStatus(p) === "DRAFT";
|
|
136
|
+
const isEnded = isProgramEnded;
|
|
137
|
+
const isDraft = isProgramDraft;
|
|
141
138
|
function accessType(p: WixProgram): string {
|
|
142
139
|
return (full(p).restrictions?.accessType ?? "PUBLIC").toUpperCase();
|
|
143
140
|
}
|