@wix/himalaya-cli 0.1870.0 → 0.1872.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/app-module.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +19 -0
- package/dist/cli.mjs +90 -39
- package/fixtures/wix-canned.json +8 -0
- package/guides/android-ux.md +3 -2
- package/guides/designing-himi-screens.md +10 -4
- package/guides/ios-ux.md +3 -2
- package/guides/release-notes.md +18 -0
- package/guides/sdk-reference.json +8 -1
- package/package.json +2 -2
- package/template-icons/professional-services.png +0 -0
- package/templates/bare-fashion/config.ts +37 -2
- package/templates/bare-fashion/dev/index.ts +4006 -48
- package/templates/bare-fashion/himalaya.content.json +15 -0
- package/templates/bare-fashion/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/bare-fashion/tier5-src/_shared/member-account-routes.ts +56 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/beauty-salon/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/beauty-salon-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/branded-lite/dev/index.ts +22 -1
- package/templates/branded-lite/l10n/ar.json +10 -0
- package/templates/branded-lite/l10n/cs.json +10 -0
- package/templates/branded-lite/l10n/da.json +10 -0
- package/templates/branded-lite/l10n/de.json +10 -0
- package/templates/branded-lite/l10n/el.json +10 -0
- package/templates/branded-lite/l10n/es.json +10 -0
- package/templates/branded-lite/l10n/fi.json +10 -0
- package/templates/branded-lite/l10n/fr.json +10 -0
- package/templates/branded-lite/l10n/he.json +8 -0
- package/templates/branded-lite/l10n/hu.json +10 -0
- package/templates/branded-lite/l10n/id.json +10 -0
- package/templates/branded-lite/l10n/it.json +10 -0
- package/templates/branded-lite/l10n/ja.json +10 -0
- package/templates/branded-lite/l10n/ko.json +10 -0
- package/templates/branded-lite/l10n/lt.json +10 -0
- package/templates/branded-lite/l10n/nl.json +10 -0
- package/templates/branded-lite/l10n/no.json +10 -0
- package/templates/branded-lite/l10n/pl.json +10 -0
- package/templates/branded-lite/l10n/pt.json +10 -0
- package/templates/branded-lite/l10n/ru.json +10 -0
- package/templates/branded-lite/l10n/sv.json +10 -0
- package/templates/branded-lite/l10n/th.json +10 -0
- package/templates/branded-lite/l10n/tr.json +10 -0
- package/templates/branded-lite/l10n/uk.json +10 -0
- package/templates/branded-lite/l10n/vi.json +10 -0
- package/templates/branded-lite/l10n/zh.json +10 -0
- package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/branded-lite/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/branded-lite/tier5-src/_shared/portfolio-details.ts +70 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +13 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
- package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/branded-lite/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/branded-lite/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/brandy/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/community-club/dev/index.ts +20 -0
- package/templates/community-club/l10n/ar.json +10 -0
- package/templates/community-club/l10n/cs.json +10 -0
- package/templates/community-club/l10n/da.json +10 -0
- package/templates/community-club/l10n/de.json +10 -0
- package/templates/community-club/l10n/el.json +10 -0
- package/templates/community-club/l10n/es.json +10 -0
- package/templates/community-club/l10n/fi.json +10 -0
- package/templates/community-club/l10n/fr.json +10 -0
- package/templates/community-club/l10n/he.json +8 -0
- package/templates/community-club/l10n/hu.json +10 -0
- package/templates/community-club/l10n/id.json +10 -0
- package/templates/community-club/l10n/it.json +10 -0
- package/templates/community-club/l10n/ja.json +10 -0
- package/templates/community-club/l10n/ko.json +10 -0
- package/templates/community-club/l10n/lt.json +10 -0
- package/templates/community-club/l10n/nl.json +10 -0
- package/templates/community-club/l10n/no.json +10 -0
- package/templates/community-club/l10n/pl.json +10 -0
- package/templates/community-club/l10n/pt.json +10 -0
- package/templates/community-club/l10n/ru.json +10 -0
- package/templates/community-club/l10n/sv.json +10 -0
- package/templates/community-club/l10n/th.json +10 -0
- package/templates/community-club/l10n/tr.json +10 -0
- package/templates/community-club/l10n/uk.json +10 -0
- package/templates/community-club/l10n/vi.json +10 -0
- package/templates/community-club/l10n/zh.json +10 -0
- package/templates/community-club/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/community-club/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/community-club/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/community-club/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/community-club/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/community-club-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/conference/config.ts +43 -1
- package/templates/conference/dev/index.ts +4147 -0
- package/templates/conference/himalaya.content.json +18 -0
- package/templates/conference/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/conference/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/conference/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/conference/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/conference/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/conference/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/conference/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/events-meetups/dev/index.ts +20 -0
- package/templates/events-meetups/l10n/ar.json +10 -0
- package/templates/events-meetups/l10n/cs.json +10 -0
- package/templates/events-meetups/l10n/da.json +10 -0
- package/templates/events-meetups/l10n/de.json +10 -0
- package/templates/events-meetups/l10n/el.json +10 -0
- package/templates/events-meetups/l10n/es.json +10 -0
- package/templates/events-meetups/l10n/fi.json +10 -0
- package/templates/events-meetups/l10n/fr.json +10 -0
- package/templates/events-meetups/l10n/he.json +8 -0
- package/templates/events-meetups/l10n/hu.json +10 -0
- package/templates/events-meetups/l10n/id.json +10 -0
- package/templates/events-meetups/l10n/it.json +10 -0
- package/templates/events-meetups/l10n/ja.json +10 -0
- package/templates/events-meetups/l10n/ko.json +10 -0
- package/templates/events-meetups/l10n/lt.json +10 -0
- package/templates/events-meetups/l10n/nl.json +10 -0
- package/templates/events-meetups/l10n/no.json +10 -0
- package/templates/events-meetups/l10n/pl.json +10 -0
- package/templates/events-meetups/l10n/pt.json +10 -0
- package/templates/events-meetups/l10n/ru.json +10 -0
- package/templates/events-meetups/l10n/sv.json +10 -0
- package/templates/events-meetups/l10n/th.json +10 -0
- package/templates/events-meetups/l10n/tr.json +10 -0
- package/templates/events-meetups/l10n/uk.json +10 -0
- package/templates/events-meetups/l10n/vi.json +10 -0
- package/templates/events-meetups/l10n/zh.json +10 -0
- package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/events-meetups/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/events-meetups/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/events-meetups/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/events-meetups-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/gym-fitness/dev/index.ts +20 -0
- package/templates/gym-fitness/l10n/ar.json +10 -0
- package/templates/gym-fitness/l10n/cs.json +10 -0
- package/templates/gym-fitness/l10n/da.json +10 -0
- package/templates/gym-fitness/l10n/de.json +10 -0
- package/templates/gym-fitness/l10n/el.json +10 -0
- package/templates/gym-fitness/l10n/es.json +10 -0
- package/templates/gym-fitness/l10n/fi.json +10 -0
- package/templates/gym-fitness/l10n/fr.json +10 -0
- package/templates/gym-fitness/l10n/he.json +8 -0
- package/templates/gym-fitness/l10n/hu.json +10 -0
- package/templates/gym-fitness/l10n/id.json +10 -0
- package/templates/gym-fitness/l10n/it.json +10 -0
- package/templates/gym-fitness/l10n/ja.json +10 -0
- package/templates/gym-fitness/l10n/ko.json +10 -0
- package/templates/gym-fitness/l10n/lt.json +10 -0
- package/templates/gym-fitness/l10n/nl.json +10 -0
- package/templates/gym-fitness/l10n/no.json +10 -0
- package/templates/gym-fitness/l10n/pl.json +10 -0
- package/templates/gym-fitness/l10n/pt.json +10 -0
- package/templates/gym-fitness/l10n/ru.json +10 -0
- package/templates/gym-fitness/l10n/sv.json +10 -0
- package/templates/gym-fitness/l10n/th.json +10 -0
- package/templates/gym-fitness/l10n/tr.json +10 -0
- package/templates/gym-fitness/l10n/uk.json +10 -0
- package/templates/gym-fitness/l10n/vi.json +10 -0
- package/templates/gym-fitness/l10n/zh.json +10 -0
- package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/gym-fitness/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/gym-fitness/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/gym-fitness-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/medical-services/config.ts +42 -0
- package/templates/medical-services/dev/index.ts +4136 -0
- package/templates/medical-services/himalaya.content.json +18 -0
- package/templates/medical-services/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/medical-services/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/nonprofit-cause/dev/index.ts +20 -0
- package/templates/nonprofit-cause/l10n/ar.json +10 -0
- package/templates/nonprofit-cause/l10n/cs.json +10 -0
- package/templates/nonprofit-cause/l10n/da.json +10 -0
- package/templates/nonprofit-cause/l10n/de.json +10 -0
- package/templates/nonprofit-cause/l10n/el.json +10 -0
- package/templates/nonprofit-cause/l10n/es.json +10 -0
- package/templates/nonprofit-cause/l10n/fi.json +10 -0
- package/templates/nonprofit-cause/l10n/fr.json +10 -0
- package/templates/nonprofit-cause/l10n/he.json +8 -0
- package/templates/nonprofit-cause/l10n/hu.json +10 -0
- package/templates/nonprofit-cause/l10n/id.json +10 -0
- package/templates/nonprofit-cause/l10n/it.json +10 -0
- package/templates/nonprofit-cause/l10n/ja.json +10 -0
- package/templates/nonprofit-cause/l10n/ko.json +10 -0
- package/templates/nonprofit-cause/l10n/lt.json +10 -0
- package/templates/nonprofit-cause/l10n/nl.json +10 -0
- package/templates/nonprofit-cause/l10n/no.json +10 -0
- package/templates/nonprofit-cause/l10n/pl.json +10 -0
- package/templates/nonprofit-cause/l10n/pt.json +10 -0
- package/templates/nonprofit-cause/l10n/ru.json +10 -0
- package/templates/nonprofit-cause/l10n/sv.json +10 -0
- package/templates/nonprofit-cause/l10n/th.json +10 -0
- package/templates/nonprofit-cause/l10n/tr.json +10 -0
- package/templates/nonprofit-cause/l10n/uk.json +10 -0
- package/templates/nonprofit-cause/l10n/vi.json +10 -0
- package/templates/nonprofit-cause/l10n/zh.json +10 -0
- package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/nonprofit-cause/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/nonprofit-cause/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/owner-lite/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/podcast-creator/dev/index.ts +20 -0
- package/templates/podcast-creator/l10n/ar.json +10 -0
- package/templates/podcast-creator/l10n/cs.json +10 -0
- package/templates/podcast-creator/l10n/da.json +10 -0
- package/templates/podcast-creator/l10n/de.json +10 -0
- package/templates/podcast-creator/l10n/el.json +10 -0
- package/templates/podcast-creator/l10n/es.json +10 -0
- package/templates/podcast-creator/l10n/fi.json +10 -0
- package/templates/podcast-creator/l10n/fr.json +10 -0
- package/templates/podcast-creator/l10n/he.json +8 -0
- package/templates/podcast-creator/l10n/hu.json +10 -0
- package/templates/podcast-creator/l10n/id.json +10 -0
- package/templates/podcast-creator/l10n/it.json +10 -0
- package/templates/podcast-creator/l10n/ja.json +10 -0
- package/templates/podcast-creator/l10n/ko.json +10 -0
- package/templates/podcast-creator/l10n/lt.json +10 -0
- package/templates/podcast-creator/l10n/nl.json +10 -0
- package/templates/podcast-creator/l10n/no.json +10 -0
- package/templates/podcast-creator/l10n/pl.json +10 -0
- package/templates/podcast-creator/l10n/pt.json +10 -0
- package/templates/podcast-creator/l10n/ru.json +10 -0
- package/templates/podcast-creator/l10n/sv.json +10 -0
- package/templates/podcast-creator/l10n/th.json +10 -0
- package/templates/podcast-creator/l10n/tr.json +10 -0
- package/templates/podcast-creator/l10n/uk.json +10 -0
- package/templates/podcast-creator/l10n/vi.json +10 -0
- package/templates/podcast-creator/l10n/zh.json +10 -0
- package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/podcast-creator/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/podcast-creator/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/portfolio-creative/dev/index.ts +22 -1
- package/templates/portfolio-creative/l10n/ar.json +10 -0
- package/templates/portfolio-creative/l10n/cs.json +10 -0
- package/templates/portfolio-creative/l10n/da.json +10 -0
- package/templates/portfolio-creative/l10n/de.json +10 -0
- package/templates/portfolio-creative/l10n/el.json +10 -0
- package/templates/portfolio-creative/l10n/es.json +10 -0
- package/templates/portfolio-creative/l10n/fi.json +10 -0
- package/templates/portfolio-creative/l10n/fr.json +10 -0
- package/templates/portfolio-creative/l10n/he.json +8 -0
- package/templates/portfolio-creative/l10n/hu.json +10 -0
- package/templates/portfolio-creative/l10n/id.json +10 -0
- package/templates/portfolio-creative/l10n/it.json +10 -0
- package/templates/portfolio-creative/l10n/ja.json +10 -0
- package/templates/portfolio-creative/l10n/ko.json +10 -0
- package/templates/portfolio-creative/l10n/lt.json +10 -0
- package/templates/portfolio-creative/l10n/nl.json +10 -0
- package/templates/portfolio-creative/l10n/no.json +10 -0
- package/templates/portfolio-creative/l10n/pl.json +10 -0
- package/templates/portfolio-creative/l10n/pt.json +10 -0
- package/templates/portfolio-creative/l10n/ru.json +10 -0
- package/templates/portfolio-creative/l10n/sv.json +10 -0
- package/templates/portfolio-creative/l10n/th.json +10 -0
- package/templates/portfolio-creative/l10n/tr.json +10 -0
- package/templates/portfolio-creative/l10n/uk.json +10 -0
- package/templates/portfolio-creative/l10n/vi.json +10 -0
- package/templates/portfolio-creative/l10n/zh.json +10 -0
- package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/portfolio-creative/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/portfolio-creative/tier5-src/_shared/portfolio-details.ts +70 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
- package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/portfolio-creative/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/portfolio-creative-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/professional-services/README.md +55 -0
- package/templates/professional-services/config.ts +436 -0
- package/templates/professional-services/dev/index.ts +44772 -0
- package/templates/professional-services/himalaya.content.json +100 -0
- package/templates/professional-services/himalaya.template.json +16 -0
- package/templates/professional-services/icon.png +0 -0
- package/templates/professional-services/platforms.json +1 -0
- package/templates/professional-services/tier5-src/_shared/app-locale.ts +70 -0
- package/templates/professional-services/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/professional-services/tier5-src/_shared/booking-session.ts +224 -0
- package/templates/professional-services/tier5-src/_shared/branded-lite-hosted.ts +282 -0
- package/templates/professional-services/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-presenter.ts +587 -0
- package/templates/professional-services/tier5-src/_shared/business-chat-transport.ts +164 -0
- package/templates/professional-services/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/professional-services/tier5-src/_shared/collection-contract.ts +232 -0
- package/templates/professional-services/tier5-src/_shared/collection-query.ts +201 -0
- package/templates/professional-services/tier5-src/_shared/collection-service.ts +429 -0
- package/templates/professional-services/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/professional-services/tier5-src/_shared/engine-intl.ts +538 -0
- package/templates/professional-services/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/professional-services/tier5-src/_shared/events-inline-options.ts +77 -0
- package/templates/professional-services/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/professional-services/tier5-src/_shared/featured-event.ts +63 -0
- package/templates/professional-services/tier5-src/_shared/group-member-count.ts +15 -0
- package/templates/professional-services/tier5-src/_shared/group-privacy.ts +14 -0
- package/templates/professional-services/tier5-src/_shared/guest-sign-in.ts +36 -0
- package/templates/professional-services/tier5-src/_shared/himi-account.ts +222 -0
- package/templates/professional-services/tier5-src/_shared/himi-blog-hidden.ts +66 -0
- package/templates/professional-services/tier5-src/_shared/himi-blog-post-row.ts +214 -0
- package/templates/professional-services/tier5-src/_shared/himi-blog-saved.ts +64 -0
- package/templates/professional-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/professional-services/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/professional-services/tier5-src/_shared/himi-copy.ts +123 -0
- package/templates/professional-services/tier5-src/_shared/himi-events.ts +92 -0
- package/templates/professional-services/tier5-src/_shared/himi-media.ts +33 -0
- package/templates/professional-services/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/professional-services/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/professional-services/tier5-src/_shared/host-events.ts +66 -0
- package/templates/professional-services/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/professional-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/professional-services/tier5-src/_shared/iap-attendance-purchase.ts +235 -0
- package/templates/professional-services/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/professional-services/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/professional-services/tier5-src/_shared/inbox-rooms.ts +163 -0
- package/templates/professional-services/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/professional-services/tier5-src/_shared/member-access.ts +63 -0
- package/templates/professional-services/tier5-src/_shared/member-account-routes.ts +56 -0
- package/templates/professional-services/tier5-src/_shared/member-avatar.ts +76 -0
- package/templates/professional-services/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/professional-services/tier5-src/_shared/member-read.ts +82 -0
- package/templates/professional-services/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/professional-services/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/professional-services/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/professional-services/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/professional-services/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/professional-services/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/professional-services/tier5-src/_shared/portfolio-details.ts +70 -0
- package/templates/professional-services/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/professional-services/tier5-src/_shared/relative-time.ts +21 -0
- package/templates/professional-services/tier5-src/_shared/result-snackbar.ts +26 -0
- package/templates/professional-services/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/professional-services/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/professional-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/professional-services/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/professional-services/tier5-src/_shared/weekly-goal.ts +111 -0
- package/templates/professional-services/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/professional-services/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/professional-services/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/professional-services/tier5-src/business-chat/index.ts +797 -0
- package/templates/professional-services/tier5-src/business-contact/index.ts +6 -0
- package/templates/professional-services/tier5-src/himi-blog-feed/index.ts +444 -0
- package/templates/professional-services/tier5-src/himi-blog-post/index.ts +1239 -0
- package/templates/professional-services/tier5-src/himi-booking-account/index.ts +278 -0
- package/templates/professional-services/tier5-src/himi-booking-bookings/index.ts +475 -0
- package/templates/professional-services/tier5-src/himi-booking-service/index.ts +1197 -0
- package/templates/professional-services/tier5-src/himi-booking-services/index.ts +795 -0
- package/templates/professional-services/tier5-src/himi-booking-time/index.ts +1840 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-coupons/index.ts +96 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-file-share/index.ts +12 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-group/index.ts +310 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-group-about/index.ts +240 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-notifications/index.ts +263 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-plans/index.ts +498 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-portfolio/index.ts +136 -0
- package/templates/professional-services/tier5-src/himi-branded-lite-portfolio-project/index.ts +198 -0
- package/templates/professional-services/tier5-src/himi-events-detail/index.ts +1306 -0
- package/templates/professional-services/tier5-src/himi-events-list/index.ts +171 -0
- package/templates/professional-services/tier5-src/himi-events-my-events/index.ts +227 -0
- package/templates/professional-services/tier5-src/himi-events-rsvp/index.ts +230 -0
- package/templates/professional-services/tier5-src/himi-professional-services-community/index.ts +318 -0
- package/templates/professional-services/tier5-src/himi-professional-services-home/index.ts +772 -0
- package/templates/professional-services/tier5-src/himi-store-account/index.ts +1514 -0
- package/templates/professional-services/tier5-src/wix-spaces-coupon-detail/index.ts +43 -0
- package/templates/professional-services/tier5-src/wix-spaces-my-subscriptions/index.ts +89 -0
- package/templates/professional-services/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/professional-services/tokens.json +456 -0
- package/templates/restaurant/dev/index.ts +20 -0
- package/templates/restaurant/l10n/ar.json +10 -0
- package/templates/restaurant/l10n/cs.json +10 -0
- package/templates/restaurant/l10n/da.json +10 -0
- package/templates/restaurant/l10n/de.json +10 -0
- package/templates/restaurant/l10n/el.json +10 -0
- package/templates/restaurant/l10n/es.json +10 -0
- package/templates/restaurant/l10n/fi.json +10 -0
- package/templates/restaurant/l10n/fr.json +10 -0
- package/templates/restaurant/l10n/he.json +8 -0
- package/templates/restaurant/l10n/hu.json +10 -0
- package/templates/restaurant/l10n/id.json +10 -0
- package/templates/restaurant/l10n/it.json +10 -0
- package/templates/restaurant/l10n/ja.json +10 -0
- package/templates/restaurant/l10n/ko.json +10 -0
- package/templates/restaurant/l10n/lt.json +10 -0
- package/templates/restaurant/l10n/nl.json +10 -0
- package/templates/restaurant/l10n/no.json +10 -0
- package/templates/restaurant/l10n/pl.json +10 -0
- package/templates/restaurant/l10n/pt.json +10 -0
- package/templates/restaurant/l10n/ru.json +10 -0
- package/templates/restaurant/l10n/sv.json +10 -0
- package/templates/restaurant/l10n/th.json +10 -0
- package/templates/restaurant/l10n/tr.json +10 -0
- package/templates/restaurant/l10n/uk.json +10 -0
- package/templates/restaurant/l10n/vi.json +10 -0
- package/templates/restaurant/l10n/zh.json +10 -0
- package/templates/restaurant/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/restaurant/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/restaurant/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/restaurant/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/restaurant/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/restaurant-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/retail-store/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/retail-store/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/retail-store-owner/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/salon-spa/config.ts +42 -0
- package/templates/salon-spa/dev/index.ts +4136 -0
- package/templates/salon-spa/himalaya.content.json +18 -0
- package/templates/salon-spa/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/salon-spa/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/wholesale-store/config.ts +43 -1
- package/templates/wholesale-store/dev/index.ts +4136 -0
- package/templates/wholesale-store/himalaya.content.json +18 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
- package/templates/wholesale-store/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/yoga-studio/dev/index.ts +20 -0
- package/templates/yoga-studio/l10n/ar.json +10 -0
- package/templates/yoga-studio/l10n/cs.json +10 -0
- package/templates/yoga-studio/l10n/da.json +10 -0
- package/templates/yoga-studio/l10n/de.json +10 -0
- package/templates/yoga-studio/l10n/el.json +10 -0
- package/templates/yoga-studio/l10n/es.json +10 -0
- package/templates/yoga-studio/l10n/fi.json +10 -0
- package/templates/yoga-studio/l10n/fr.json +10 -0
- package/templates/yoga-studio/l10n/he.json +8 -0
- package/templates/yoga-studio/l10n/hu.json +10 -0
- package/templates/yoga-studio/l10n/id.json +10 -0
- package/templates/yoga-studio/l10n/it.json +10 -0
- package/templates/yoga-studio/l10n/ja.json +10 -0
- package/templates/yoga-studio/l10n/ko.json +10 -0
- package/templates/yoga-studio/l10n/lt.json +10 -0
- package/templates/yoga-studio/l10n/nl.json +10 -0
- package/templates/yoga-studio/l10n/no.json +10 -0
- package/templates/yoga-studio/l10n/pl.json +10 -0
- package/templates/yoga-studio/l10n/pt.json +10 -0
- package/templates/yoga-studio/l10n/ru.json +10 -0
- package/templates/yoga-studio/l10n/sv.json +10 -0
- package/templates/yoga-studio/l10n/th.json +10 -0
- package/templates/yoga-studio/l10n/tr.json +10 -0
- package/templates/yoga-studio/l10n/uk.json +10 -0
- package/templates/yoga-studio/l10n/vi.json +10 -0
- package/templates/yoga-studio/l10n/zh.json +10 -0
- package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/yoga-studio/tier5-src/_shared/himi-events.ts +27 -0
- package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +3 -1
- package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +38 -8
- package/templates/yoga-studio/tier5-src/himi-events-my-events/index.ts +4 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +6 -1
- package/templates/yoga-studio-owner/tier5-src/_shared/himi-events.ts +27 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// Login info — the login email (read only) and the Password section — and its Change password
|
|
2
|
+
// step, pushed in the same page sheet. Nothing in Login info is edited in place, so it has no Save.
|
|
3
|
+
//
|
|
4
|
+
// The Password section is a row to Change password only where this app can change it (a native
|
|
5
|
+
// app on HimalayaCore 1.5.0 or later). Elsewhere it is a grey notice: "in preview mode" on the web
|
|
6
|
+
// host, "here" in every other case, with Go to website when the site has a real URL. There is no
|
|
7
|
+
// change-email feature: the login email is changed on the website, and this modal does not say so.
|
|
8
|
+
import { dispatch } from "@himalaya/dispatch";
|
|
9
|
+
import { open as openUrl } from "@himalaya/open-url";
|
|
10
|
+
import { defineService } from "@himalaya/state";
|
|
11
|
+
import { snackbar } from "@himalaya/ui";
|
|
12
|
+
import { getMyMember } from "@himalaya/wix-members";
|
|
13
|
+
import { memberAccess } from "../_shared/member-access.js";
|
|
14
|
+
import { memberAccountRoutes } from "../_shared/member-account-routes.js";
|
|
15
|
+
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
16
|
+
import {
|
|
17
|
+
clean, fetchMember, isSignedOut, loadErrorVariant, passwordCase, passwordMode, rawText, sameAccess, signedOutError, siteHandoffAvailable,
|
|
18
|
+
type PasswordMode, type WixMemberResponse,
|
|
19
|
+
} from "./shared.js";
|
|
20
|
+
|
|
21
|
+
// ---- Login info ----
|
|
22
|
+
|
|
23
|
+
interface LoginState {
|
|
24
|
+
phase: "loading" | "ready" | "error" | "signedOut";
|
|
25
|
+
errorVariant: "offline" | "server";
|
|
26
|
+
loginEmail: string;
|
|
27
|
+
passwordMode: PasswordMode;
|
|
28
|
+
/** row | preview | preview-link | here | here-link — the case the Password section draws. */
|
|
29
|
+
passwordCase: string;
|
|
30
|
+
siteUrl: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const LOGIN_EMPTY: LoginState = { phase: "loading", errorVariant: "server", loginEmail: "", passwordMode: "notice-here", passwordCase: "here", siteUrl: "" };
|
|
34
|
+
let loginLoadVersion = 0;
|
|
35
|
+
|
|
36
|
+
const login = defineService<LoginState, {
|
|
37
|
+
load: (s: LoginState, arg?: unknown) => Promise<LoginState>;
|
|
38
|
+
showLoading: (s: LoginState) => LoginState;
|
|
39
|
+
openSite: (s: LoginState) => Promise<LoginState>;
|
|
40
|
+
}>("himiBrandedAccountLogin", {
|
|
41
|
+
state: { ...LOGIN_EMPTY },
|
|
42
|
+
notHydrated: Object.keys(LOGIN_EMPTY) as (keyof LoginState)[],
|
|
43
|
+
notPersisted: Object.keys(LOGIN_EMPTY) as (keyof LoginState)[],
|
|
44
|
+
actions: {
|
|
45
|
+
showLoading: () => ({ ...LOGIN_EMPTY }),
|
|
46
|
+
load: async (_s, arg): Promise<LoginState> => {
|
|
47
|
+
const version = ++loginLoadVersion;
|
|
48
|
+
stashCopy(arg);
|
|
49
|
+
if (login.getState().phase !== "loading") await login.showLoading();
|
|
50
|
+
try {
|
|
51
|
+
const { member, email, scope, siteUrl } = await fetchMember((arg as { siteUrl?: unknown } | undefined)?.siteUrl);
|
|
52
|
+
const routes = await memberAccountRoutes();
|
|
53
|
+
// The member read above must still be the one signed in after the routes read.
|
|
54
|
+
if (!(await sameAccess(email, scope))) throw signedOutError();
|
|
55
|
+
if (version !== loginLoadVersion) return login.getState();
|
|
56
|
+
const mode = passwordMode(routes);
|
|
57
|
+
return {
|
|
58
|
+
phase: "ready",
|
|
59
|
+
errorVariant: "server",
|
|
60
|
+
loginEmail: clean(member.loginEmail) || email,
|
|
61
|
+
passwordMode: mode,
|
|
62
|
+
passwordCase: passwordCase(mode, siteHandoffAvailable(siteUrl)),
|
|
63
|
+
siteUrl,
|
|
64
|
+
};
|
|
65
|
+
} catch (error) {
|
|
66
|
+
if (version !== loginLoadVersion) return login.getState();
|
|
67
|
+
return { ...LOGIN_EMPTY, phase: isSignedOut(error) ? "signedOut" : "error", errorVariant: loadErrorVariant(error) };
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
// Go to website: a missing, malformed or placeholder site URL has no handoff.
|
|
71
|
+
openSite: async (s): Promise<LoginState> => {
|
|
72
|
+
if (!siteHandoffAvailable(s.siteUrl)) return s;
|
|
73
|
+
try { await openUrl(s.siteUrl, "in_app_browser"); } catch { /* the handoff is best-effort */ }
|
|
74
|
+
return s;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// ---- Change password ----
|
|
80
|
+
|
|
81
|
+
interface PasswordState {
|
|
82
|
+
phase: "loading" | "ready" | "error" | "signedOut";
|
|
83
|
+
errorVariant: "offline" | "server";
|
|
84
|
+
memberId: string;
|
|
85
|
+
memberEmail: string;
|
|
86
|
+
memberScope: string;
|
|
87
|
+
loginEmail: string;
|
|
88
|
+
currentPassword: string;
|
|
89
|
+
newPassword: string;
|
|
90
|
+
confirmPassword: string;
|
|
91
|
+
dirty: boolean;
|
|
92
|
+
/** Save is active only when all three fields have a value. */
|
|
93
|
+
cannotSave: boolean;
|
|
94
|
+
saving: boolean;
|
|
95
|
+
currentError: string;
|
|
96
|
+
/** Wix refused the new password: the site's length or complexity rules. */
|
|
97
|
+
newError: string;
|
|
98
|
+
confirmError: string;
|
|
99
|
+
/** The banner at the top after a failure that is not a field's. */
|
|
100
|
+
saveError: string;
|
|
101
|
+
noSaveError: boolean;
|
|
102
|
+
resetSending: boolean;
|
|
103
|
+
/** The line under "Forgot password?": the reset link went out, or it could not. */
|
|
104
|
+
resetMessage: string;
|
|
105
|
+
noResetMessage: boolean;
|
|
106
|
+
resetError: string;
|
|
107
|
+
noResetError: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const PASSWORD_EMPTY: PasswordState = {
|
|
111
|
+
phase: "loading", errorVariant: "server", memberId: "", memberEmail: "", memberScope: "", loginEmail: "",
|
|
112
|
+
currentPassword: "", newPassword: "", confirmPassword: "", dirty: false, cannotSave: true, saving: false,
|
|
113
|
+
currentError: "", newError: "", confirmError: "", saveError: "", noSaveError: true,
|
|
114
|
+
resetSending: false, resetMessage: "", noResetMessage: true, resetError: "", noResetError: true,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
function derivePassword(s: PasswordState): PasswordState {
|
|
118
|
+
const filled = !!s.currentPassword && !!s.newPassword && !!s.confirmPassword;
|
|
119
|
+
return {
|
|
120
|
+
...s,
|
|
121
|
+
dirty: !!(s.currentPassword || s.newPassword || s.confirmPassword),
|
|
122
|
+
cannotSave: s.phase !== "ready" || !filled || s.saving || s.resetSending,
|
|
123
|
+
noSaveError: !s.saveError,
|
|
124
|
+
noResetMessage: !s.resetMessage,
|
|
125
|
+
noResetError: !s.resetError,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
type PasswordResult = { status?: string; code?: string; payload?: { status?: string; code?: string; payload?: { code?: string } } } | null;
|
|
130
|
+
type PasswordNext = PasswordState & { _nav?: { presentation: "dismiss" } };
|
|
131
|
+
|
|
132
|
+
let passwordLoadVersion = 0;
|
|
133
|
+
let passwordMutationInFlight = false;
|
|
134
|
+
let passwordResetInFlight = false;
|
|
135
|
+
|
|
136
|
+
// A typed value always lands; Save stays off (`cannotSave`) until the step is ready.
|
|
137
|
+
const setSecret = (key: "currentPassword" | "newPassword" | "confirmPassword") => (s: PasswordState, arg?: unknown): PasswordState => derivePassword({
|
|
138
|
+
...s,
|
|
139
|
+
[key]: rawText((arg as { value?: unknown } | undefined)?.value),
|
|
140
|
+
...(key === "currentPassword" ? { currentError: "" } : { newError: "", confirmError: "" }),
|
|
141
|
+
saveError: "",
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const password = defineService<PasswordState, {
|
|
145
|
+
load: (s: PasswordState, arg?: unknown) => Promise<PasswordState>;
|
|
146
|
+
showLoading: (s: PasswordState) => PasswordState;
|
|
147
|
+
begin: (s: PasswordState, patch: Partial<PasswordState>) => PasswordState;
|
|
148
|
+
setCurrentPassword: (s: PasswordState, arg?: unknown) => PasswordState;
|
|
149
|
+
setNewPassword: (s: PasswordState, arg?: unknown) => PasswordState;
|
|
150
|
+
setConfirmPassword: (s: PasswordState, arg?: unknown) => PasswordState;
|
|
151
|
+
save: (s: PasswordState) => Promise<PasswordNext | undefined>;
|
|
152
|
+
resetPassword: (s: PasswordState) => Promise<PasswordState | undefined>;
|
|
153
|
+
}>("himiBrandedAccountPassword", {
|
|
154
|
+
state: { ...PASSWORD_EMPTY },
|
|
155
|
+
// The passwords never survive the visit: not in the persisted state, not in a hydrated one.
|
|
156
|
+
notHydrated: Object.keys(PASSWORD_EMPTY) as (keyof PasswordState)[],
|
|
157
|
+
notPersisted: Object.keys(PASSWORD_EMPTY) as (keyof PasswordState)[],
|
|
158
|
+
actions: {
|
|
159
|
+
showLoading: () => ({ ...PASSWORD_EMPTY }),
|
|
160
|
+
begin: (s, patch) => derivePassword({ ...s, ...patch }),
|
|
161
|
+
load: async (_s, arg): Promise<PasswordState> => {
|
|
162
|
+
const version = ++passwordLoadVersion;
|
|
163
|
+
stashCopy(arg);
|
|
164
|
+
if (password.getState().phase !== "loading") await password.showLoading();
|
|
165
|
+
try {
|
|
166
|
+
const { member, email, scope } = await fetchMember();
|
|
167
|
+
const routes = await memberAccountRoutes();
|
|
168
|
+
if (!(await sameAccess(email, scope))) throw signedOutError();
|
|
169
|
+
if (version !== passwordLoadVersion) return password.getState();
|
|
170
|
+
// Only reachable from the Login info row, which shows only where the app can change it.
|
|
171
|
+
if (!routes.passwordCredentials) throw new Error("Password changes are not available in this app.");
|
|
172
|
+
return derivePassword({ ...PASSWORD_EMPTY, phase: "ready", memberId: clean(member.id), memberEmail: email, memberScope: scope, loginEmail: clean(member.loginEmail) || email });
|
|
173
|
+
} catch (error) {
|
|
174
|
+
if (version !== passwordLoadVersion) return password.getState();
|
|
175
|
+
return derivePassword({ ...PASSWORD_EMPTY, phase: isSignedOut(error) ? "signedOut" : "error", errorVariant: loadErrorVariant(error) });
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
setCurrentPassword: setSecret("currentPassword"),
|
|
179
|
+
setNewPassword: setSecret("newPassword"),
|
|
180
|
+
setConfirmPassword: setSecret("confirmPassword"),
|
|
181
|
+
save: async (s): Promise<PasswordNext | undefined> => {
|
|
182
|
+
if (s.cannotSave || passwordMutationInFlight || passwordResetInFlight) return undefined;
|
|
183
|
+
if (s.newPassword !== s.confirmPassword) {
|
|
184
|
+
return derivePassword({ ...s, confirmError: copyParam("accountSettings.passwordMismatch", "The new passwords do not match.") });
|
|
185
|
+
}
|
|
186
|
+
passwordMutationInFlight = true;
|
|
187
|
+
await password.begin({ saving: true, currentError: "", newError: "", confirmError: "", saveError: "" });
|
|
188
|
+
let code = "";
|
|
189
|
+
try {
|
|
190
|
+
if (!(await sameAccess(s.memberEmail, s.memberScope))) code = "account_changed";
|
|
191
|
+
else {
|
|
192
|
+
const result = await dispatch("himi.wix.changePassword", { currentPassword: s.currentPassword, newPassword: s.newPassword, expectedMemberId: s.memberId }) as PasswordResult;
|
|
193
|
+
if (!(await sameAccess(s.memberEmail, s.memberScope))) code = "account_changed";
|
|
194
|
+
else if (result?.status !== "ok" && result?.payload?.status !== "ok") code = result?.code ?? result?.payload?.code ?? result?.payload?.payload?.code ?? "failed";
|
|
195
|
+
}
|
|
196
|
+
} catch {
|
|
197
|
+
// A binary without the native handler fails closed here; never report success.
|
|
198
|
+
code = "unavailable";
|
|
199
|
+
} finally {
|
|
200
|
+
passwordMutationInFlight = false;
|
|
201
|
+
}
|
|
202
|
+
const latest = password.getState();
|
|
203
|
+
if (!code) {
|
|
204
|
+
void snackbar({ message: copyParam("accountSettings.savedToast", "Your changes are saved."), tone: "info" }).catch(() => undefined);
|
|
205
|
+
return { ...derivePassword({ ...latest, currentPassword: "", newPassword: "", confirmPassword: "", saving: false }), _nav: { presentation: "dismiss" } };
|
|
206
|
+
}
|
|
207
|
+
// A wrong current password or another member: the secrets are cleared and typed again. Any
|
|
208
|
+
// other failure keeps them for the banner's Try again (they live only in this visit's state).
|
|
209
|
+
const cleared = { ...latest, currentPassword: "", newPassword: "", confirmPassword: "", saving: false };
|
|
210
|
+
if (code === "reauthentication_failed") {
|
|
211
|
+
return derivePassword({ ...cleared, currentError: copyParam("accountSettings.passwordReauthenticationFailed", "We could not verify your current password.") });
|
|
212
|
+
}
|
|
213
|
+
if (code === "account_changed") {
|
|
214
|
+
return derivePassword({ ...cleared, saveError: copyParam("accountSettings.passwordAccountChanged", "Your account changed. Sign in again before changing your password.") });
|
|
215
|
+
}
|
|
216
|
+
// The current password was right; only the new one breaks the site's rules. Keep the current
|
|
217
|
+
// one, clear the new pair, and say so under New password.
|
|
218
|
+
if (code === "password_rejected") {
|
|
219
|
+
return derivePassword({
|
|
220
|
+
...latest, newPassword: "", confirmPassword: "", saving: false,
|
|
221
|
+
newError: copyParam("accountSettings.passwordRequirements", "This password doesn’t meet this site’s requirements. Use a longer password with letters, numbers and symbols."),
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
const message = code === "unavailable"
|
|
225
|
+
? copyParam("accountSettings.passwordUnavailable", "Password changes aren’t available in this session. Sign in again or use the website.")
|
|
226
|
+
: code === "rate_limited"
|
|
227
|
+
? copyParam("accountSettings.passwordRateLimited", "Too many attempts. Wait a few minutes, then try again.")
|
|
228
|
+
: copyParam("accountSettings.passwordChangeFailed", "Your password was not changed. Try again.");
|
|
229
|
+
return derivePassword({ ...latest, saving: false, saveError: message });
|
|
230
|
+
},
|
|
231
|
+
// Forgot password?: the existing reset email, sent to the login email of the member who is
|
|
232
|
+
// still signed in. The result shows under the link.
|
|
233
|
+
resetPassword: async (s): Promise<PasswordState | undefined> => {
|
|
234
|
+
if (s.phase !== "ready" || s.saving || passwordMutationInFlight || passwordResetInFlight || !s.loginEmail) return undefined;
|
|
235
|
+
passwordResetInFlight = true;
|
|
236
|
+
await password.begin({ resetSending: true, resetMessage: "", resetError: "" });
|
|
237
|
+
let code = "";
|
|
238
|
+
let resetEmail = "";
|
|
239
|
+
try {
|
|
240
|
+
const before = await memberAccess();
|
|
241
|
+
const beforeMember = await getMyMember({ fieldsets: ["FULL"] }) as WixMemberResponse;
|
|
242
|
+
const afterRead = await memberAccess();
|
|
243
|
+
// The same login email the screen shows: loginEmail, else the signed-in email.
|
|
244
|
+
resetEmail = clean(beforeMember.member?.loginEmail) || s.memberEmail;
|
|
245
|
+
if (!before.email || before.email !== s.memberEmail || before.scope !== s.memberScope || afterRead.email !== s.memberEmail || afterRead.scope !== s.memberScope || beforeMember.member?.id !== s.memberId || !resetEmail) {
|
|
246
|
+
code = "account_changed";
|
|
247
|
+
} else {
|
|
248
|
+
const result = await dispatch("himi.wix.resetPassword", { email: resetEmail }) as PasswordResult;
|
|
249
|
+
const current = await memberAccess();
|
|
250
|
+
const afterMember = await getMyMember({ fieldsets: ["FULL"] }) as WixMemberResponse;
|
|
251
|
+
const finalAccess = await memberAccess();
|
|
252
|
+
if (current.email !== s.memberEmail || current.scope !== s.memberScope || finalAccess.email !== s.memberEmail || finalAccess.scope !== s.memberScope || afterMember.member?.id !== s.memberId) code = "account_changed";
|
|
253
|
+
else if (result?.status !== "ok" && result?.payload?.status !== "ok") code = "reset_failed";
|
|
254
|
+
}
|
|
255
|
+
} catch {
|
|
256
|
+
code = "reset_failed";
|
|
257
|
+
} finally {
|
|
258
|
+
passwordResetInFlight = false;
|
|
259
|
+
}
|
|
260
|
+
const latest = password.getState();
|
|
261
|
+
if (!code) return derivePassword({ ...latest, resetSending: false, resetMessage: copyTemplate("accountSettings.resetLinkSent", "We sent a reset link to {email}.", { email: resetEmail }), resetError: "" });
|
|
262
|
+
return derivePassword({
|
|
263
|
+
...latest,
|
|
264
|
+
resetSending: false,
|
|
265
|
+
resetMessage: "",
|
|
266
|
+
resetError: code === "account_changed"
|
|
267
|
+
? copyParam("accountSettings.passwordAccountChanged", "Your account changed. Sign in again before changing your password.")
|
|
268
|
+
: copyParam("accountSettings.passwordResetFailed", "A reset link could not be sent. Try again."),
|
|
269
|
+
});
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
export { login as loginInfo, password as changePassword };
|