@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,237 @@
|
|
|
1
|
+
import { defineService } from "@himalaya/state";
|
|
2
|
+
import { getGroup, listMemberships, type WixGroup, type WixGroupMembership } from "@himalaya/wix-groups";
|
|
3
|
+
import { getMyMember } from "@himalaya/wix-members";
|
|
4
|
+
import { copyParam, stashCopy } from "../_shared/himi-copy.js";
|
|
5
|
+
import { groupMemberCount } from "../_shared/group-member-count.js";
|
|
6
|
+
import { groupImage } from "../_shared/himi-media.js";
|
|
7
|
+
import { memberAccess, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
|
|
8
|
+
|
|
9
|
+
// The groups the SIGNED-IN member belongs to (the One App "My groups" list). Two reads, both as the
|
|
10
|
+
// member: the memberships (GET /social-groups-proxy/members/v2/members/{id}/memberships, which Wix
|
|
11
|
+
// answers for the caller's own id only) and then one getGroup per membership, because a membership
|
|
12
|
+
// carries a group id and a role, never the group's name or cover.
|
|
13
|
+
//
|
|
14
|
+
// A visitor makes ZERO calls: the screen shows its sign-in card. The member id is the current
|
|
15
|
+
// member's (`getMyMember`), never taken from input. Read-only and online-only.
|
|
16
|
+
|
|
17
|
+
type Failure = "forbidden" | "failed";
|
|
18
|
+
|
|
19
|
+
/** Memberships read in one page. A member with more is told so, not shown a silently short list. */
|
|
20
|
+
const PAGE_LIMIT = 50;
|
|
21
|
+
const DETAIL_SCREEN = "himi_group";
|
|
22
|
+
|
|
23
|
+
interface MyGroupRow {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
/** "Admin", "Member" or "Pending request" — the member's standing in the group. */
|
|
27
|
+
statusLabel: string;
|
|
28
|
+
meta: string;
|
|
29
|
+
image: string;
|
|
30
|
+
initial: string;
|
|
31
|
+
hasImage: boolean;
|
|
32
|
+
noImage: boolean;
|
|
33
|
+
detailScreenId: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface State {
|
|
37
|
+
status: "loading" | "ready" | "error" | "signedOut";
|
|
38
|
+
rows: MyGroupRow[];
|
|
39
|
+
emptyText: string;
|
|
40
|
+
errorText: string;
|
|
41
|
+
/** Some groups could not be read, or the member has more than one page: said above the list. */
|
|
42
|
+
partialText: string;
|
|
43
|
+
notLoading: boolean;
|
|
44
|
+
notErrored: boolean;
|
|
45
|
+
noRows: boolean;
|
|
46
|
+
noEmpty: boolean;
|
|
47
|
+
noPartial: boolean;
|
|
48
|
+
needsSignIn: boolean;
|
|
49
|
+
noSignIn: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const initial: State = {
|
|
53
|
+
status: "loading",
|
|
54
|
+
rows: [],
|
|
55
|
+
emptyText: "",
|
|
56
|
+
errorText: "",
|
|
57
|
+
partialText: "",
|
|
58
|
+
notLoading: false,
|
|
59
|
+
notErrored: true,
|
|
60
|
+
noRows: true,
|
|
61
|
+
noEmpty: true,
|
|
62
|
+
noPartial: true,
|
|
63
|
+
needsSignIn: false,
|
|
64
|
+
noSignIn: true,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** Bumped by every load, so a response that arrives after a newer load began is dropped. */
|
|
68
|
+
let loadSeq = 0;
|
|
69
|
+
|
|
70
|
+
const signedOutState: State = { ...initial, status: "signedOut", notLoading: true, needsSignIn: true, noSignIn: false };
|
|
71
|
+
|
|
72
|
+
function errorState(failure: Failure): State {
|
|
73
|
+
return {
|
|
74
|
+
...initial,
|
|
75
|
+
status: "error",
|
|
76
|
+
notLoading: true,
|
|
77
|
+
notErrored: false,
|
|
78
|
+
errorText: failure === "forbidden"
|
|
79
|
+
? copyParam("myGroups.forbiddenText", "Your groups are unavailable for this account. Sign in again.")
|
|
80
|
+
: copyParam("myGroups.errorText", "Your groups could not be loaded."),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function failureOf(error: unknown): Failure {
|
|
85
|
+
return memberAccessDenied(error) ? "forbidden" : "failed";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isNotFound(error: unknown): boolean {
|
|
89
|
+
return /HTTP 404\b/.test(String((error as Error)?.message ?? error));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function statusLabelOf(membership: WixGroupMembership): string {
|
|
93
|
+
if ((membership.status ?? "").toUpperCase() === "PENDING") return copyParam("myGroups.status.pending", "Pending request");
|
|
94
|
+
return (membership.role?.value ?? "").toUpperCase() === "ADMIN"
|
|
95
|
+
? copyParam("myGroups.status.admin", "Admin")
|
|
96
|
+
: copyParam("myGroups.status.member", "Member");
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function rowOf(group: WixGroup, membership: WixGroupMembership): MyGroupRow {
|
|
100
|
+
const title = (group.name || copyParam("groups.groupFallbackName", "Group")).trim();
|
|
101
|
+
const count = group.membersCount ?? group.memberCount;
|
|
102
|
+
const image = groupImage(group);
|
|
103
|
+
return {
|
|
104
|
+
id: String(membership.groupId),
|
|
105
|
+
title,
|
|
106
|
+
statusLabel: statusLabelOf(membership),
|
|
107
|
+
meta: typeof count === "number" ? groupMemberCount(count) : "",
|
|
108
|
+
image,
|
|
109
|
+
initial: (title[0] || "G").toUpperCase(),
|
|
110
|
+
hasImage: Boolean(image),
|
|
111
|
+
noImage: !image,
|
|
112
|
+
detailScreenId: DETAIL_SCREEN,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** JOINED and PENDING memberships with a group id; an UNKNOWN status is not a membership to show. */
|
|
117
|
+
function shownMemberships(response: unknown): WixGroupMembership[] | undefined {
|
|
118
|
+
const memberships = (response as { memberships?: unknown } | null | undefined)?.memberships;
|
|
119
|
+
if (!Array.isArray(memberships)) return undefined;
|
|
120
|
+
const seen = new Set<string>();
|
|
121
|
+
return (memberships as WixGroupMembership[]).filter((m) => {
|
|
122
|
+
const status = (m?.status ?? "").toUpperCase();
|
|
123
|
+
if (typeof m?.groupId !== "string" || !m.groupId || (status !== "JOINED" && status !== "PENDING") || seen.has(m.groupId)) return false;
|
|
124
|
+
seen.add(m.groupId);
|
|
125
|
+
return true;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function readyState(rows: MyGroupRow[], partialText: string): State {
|
|
130
|
+
return {
|
|
131
|
+
...initial,
|
|
132
|
+
status: "ready",
|
|
133
|
+
rows,
|
|
134
|
+
emptyText: copyParam("myGroups.emptyText", "You haven’t joined any groups yet."),
|
|
135
|
+
partialText,
|
|
136
|
+
notLoading: true,
|
|
137
|
+
noRows: rows.length === 0,
|
|
138
|
+
noEmpty: rows.length > 0,
|
|
139
|
+
noPartial: !partialText,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const sameMember = (a: MemberAccess, b: MemberAccess) => a.email === b.email && a.scope === b.scope;
|
|
144
|
+
|
|
145
|
+
/** Whose groups the rows on screen are. A load for anybody else clears them first. */
|
|
146
|
+
let rowsOwner: MemberAccess | undefined;
|
|
147
|
+
|
|
148
|
+
/** The sign-in card is what the screen shows. A load that finds a member now (they signed in and came back)
|
|
149
|
+
* shows the loading state at once instead of leaving the card up over the network calls. A module flag, not
|
|
150
|
+
* a read of the state: the reload this starts must not see the card again and restart forever. */
|
|
151
|
+
let showingSignIn = false;
|
|
152
|
+
|
|
153
|
+
/** The member changed while this load ran or the rows were on screen: show the loading state at once,
|
|
154
|
+
* so the previous member's group names and standing are never on screen, and load for the current one. */
|
|
155
|
+
function restart(): State {
|
|
156
|
+
rowsOwner = undefined;
|
|
157
|
+
showingSignIn = false;
|
|
158
|
+
loadSeq++;
|
|
159
|
+
void svc.load();
|
|
160
|
+
return { ...initial };
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** An error for THIS member, unless a newer load began or the member left meanwhile: then it is stale. */
|
|
164
|
+
async function failureFor(seq: number, access: MemberAccess, failure: Failure): Promise<State | undefined> {
|
|
165
|
+
if (seq !== loadSeq) return undefined;
|
|
166
|
+
const now = await memberAccess();
|
|
167
|
+
// A newer load began while the identity was read: its answer is the fresher one.
|
|
168
|
+
if (seq !== loadSeq) return undefined;
|
|
169
|
+
if (!sameMember(access, now)) return restart();
|
|
170
|
+
return errorState(failure);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function loadOnce(access: MemberAccess): Promise<State | undefined> {
|
|
174
|
+
const seq = ++loadSeq;
|
|
175
|
+
if (!access.email) { showingSignIn = true; return signedOutState; }
|
|
176
|
+
try {
|
|
177
|
+
const me = await getMyMember();
|
|
178
|
+
const memberId = String(me?.member?.id ?? "");
|
|
179
|
+
if (!memberId) return failureFor(seq, access, "failed");
|
|
180
|
+
const response = await listMemberships(memberId, { limit: PAGE_LIMIT });
|
|
181
|
+
const memberships = shownMemberships(response);
|
|
182
|
+
if (!memberships) return failureFor(seq, access, "failed");
|
|
183
|
+
const reads = await Promise.allSettled(memberships.map((m) => getGroup(String(m.groupId))));
|
|
184
|
+
// Another load began, or the member signed out / switched account while these reads were in
|
|
185
|
+
// flight: these rows belong to somebody else now.
|
|
186
|
+
if (seq !== loadSeq) return undefined;
|
|
187
|
+
const now = await memberAccess();
|
|
188
|
+
// Re-checked after the await: a newer load may have committed while the identity was read.
|
|
189
|
+
if (seq !== loadSeq) return undefined;
|
|
190
|
+
if (!sameMember(access, now)) return restart();
|
|
191
|
+
const rows: MyGroupRow[] = [];
|
|
192
|
+
let failed = 0;
|
|
193
|
+
let firstFailure: unknown;
|
|
194
|
+
reads.forEach((read, index) => {
|
|
195
|
+
if (read.status === "fulfilled") {
|
|
196
|
+
// Social Groups wraps the entity as `{ group }`; the typed signature claims a bare group.
|
|
197
|
+
const group = ((read.value as unknown as { group?: WixGroup }).group ?? read.value) as WixGroup;
|
|
198
|
+
if (group && typeof group === "object") { rows.push(rowOf(group, memberships[index])); return; }
|
|
199
|
+
}
|
|
200
|
+
// A group deleted since the membership was listed is gone, not a failed read.
|
|
201
|
+
if (read.status === "rejected" && isNotFound(read.reason)) return;
|
|
202
|
+
failed++;
|
|
203
|
+
firstFailure ??= read.status === "rejected" ? read.reason : undefined;
|
|
204
|
+
});
|
|
205
|
+
// Memberships exist but not one group could be shown: that is unreadable (a pending request on a
|
|
206
|
+
// private group answers 404 until approved) or gone, never "you have no groups".
|
|
207
|
+
if (memberships.length > 0 && rows.length === 0) return errorState(failed > 0 ? failureOf(firstFailure) : "failed");
|
|
208
|
+
// Wix omits `total` when it is too many to count, and says so in `tooManyToCount`.
|
|
209
|
+
const truncated = response.metadata?.tooManyToCount === true || Number(response.metadata?.total ?? 0) > PAGE_LIMIT;
|
|
210
|
+
const partialText = [
|
|
211
|
+
failed > 0 ? copyParam("myGroups.partialText", "Some of your groups could not be loaded.") : "",
|
|
212
|
+
truncated ? copyParam("myGroups.truncatedText", "Showing your first groups only.") : "",
|
|
213
|
+
].filter(Boolean).join(" ");
|
|
214
|
+
rowsOwner = access;
|
|
215
|
+
return readyState(rows, partialText);
|
|
216
|
+
} catch (error) {
|
|
217
|
+
// A request that rejects because the member left is the old member's error, not the current one's.
|
|
218
|
+
return failureFor(seq, access, failureOf(error));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const svc = defineService<State, {
|
|
223
|
+
load: (state: State, arg?: unknown) => Promise<State | undefined>;
|
|
224
|
+
}>("himiBrandedMyGroups", {
|
|
225
|
+
state: initial,
|
|
226
|
+
actions: {
|
|
227
|
+
load: async (_state, arg) => {
|
|
228
|
+
stashCopy(arg);
|
|
229
|
+
const access = await memberAccess();
|
|
230
|
+
if ((rowsOwner && !sameMember(rowsOwner, access)) || (showingSignIn && access.email)) return restart();
|
|
231
|
+
return loadOnce(access);
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
svc.load();
|
|
237
|
+
export { svc };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
|
+
// himi-branded-lite-notifications — reads the member's notifications via Members Feed Viewer (queryNotifications).
|
|
3
|
+
// a failed query is an error with Retry (or Sign in when Wix refuses the
|
|
4
|
+
// visitor) and an empty one is a real empty state — never sample rows presented as
|
|
5
|
+
// the customer's own. Samples appear only in the host's explicit sample preview
|
|
6
|
+
// (_shared/branded-load-state.ts).
|
|
7
|
+
// mark-one-read / mark-all-read stay wired: they update state optimistically and
|
|
8
|
+
// best-effort the real write (a no-op on sample rows).
|
|
9
|
+
import { defineService as registerService } from "../_shared/collection-service.js";
|
|
10
|
+
import { LOADING, loaded, loadFailed, type LoadCopy, type LoadFlags } from "../_shared/branded-load-state.js";
|
|
11
|
+
import { queryNotifications, markRead, markAllRead, type MfvNotification } from "@himalaya/wix-members-feed-viewer";
|
|
12
|
+
import { assertMemberAccess, memberAccess, type MemberAccess } from "../_shared/member-access.js";
|
|
13
|
+
import { navigate } from "@himalaya/state";
|
|
14
|
+
import { notificationOpen, urlHost, type NotificationOpen } from "../_shared/notification-target.js";
|
|
15
|
+
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
16
|
+
import { copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
17
|
+
import { guestSignIn } from "../_shared/guest-sign-in.js";
|
|
18
|
+
|
|
19
|
+
interface Row {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
subtitle: string;
|
|
23
|
+
unread: boolean;
|
|
24
|
+
/** "●" when unread, "" when read — bound to an accent dot that collapses when
|
|
25
|
+
* empty (per-item render is parity-safe; item-scoped hiddenWhen is not). */
|
|
26
|
+
unreadDot: string;
|
|
27
|
+
photo: string;
|
|
28
|
+
initial: string;
|
|
29
|
+
dest: string;
|
|
30
|
+
/** What a tap does (a screen, a web link or nothing). Absent on the preview samples, which open nothing. */
|
|
31
|
+
open?: NotificationOpen;
|
|
32
|
+
}
|
|
33
|
+
interface S extends LoadFlags {
|
|
34
|
+
items: Row[]; emptyText: string; actionMessage: string;
|
|
35
|
+
/** The web link the last tap named and is waiting for a second tap to open (see `open`). */
|
|
36
|
+
pendingUrl: string;
|
|
37
|
+
/** Ownership travels with the rows, including a state captured by an async write. */
|
|
38
|
+
inboxMember: MemberAccess | null;
|
|
39
|
+
isMock: boolean; notMock: boolean;
|
|
40
|
+
/** #2849 — hiddenWhen() hides on TRUE, so these are inverted: the empty-state banner
|
|
41
|
+
* shows only when the site really has none, and the unavailable one only when the
|
|
42
|
+
* query failed. A failed query must never render the sentence that claims the
|
|
43
|
+
* customer has no content. */
|
|
44
|
+
notMockEmpty: boolean; notMockUnavailable: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Human "2h ago" / "Yesterday" from an ISO date. */
|
|
48
|
+
function relativeTime(iso?: string): string {
|
|
49
|
+
if (!iso) return "";
|
|
50
|
+
const then = Date.parse(iso);
|
|
51
|
+
if (isNaN(then)) return "";
|
|
52
|
+
const diff = Date.now() - then;
|
|
53
|
+
if (diff < 0) return "Just now";
|
|
54
|
+
const min = Math.floor(diff / 60000);
|
|
55
|
+
if (min < 1) return "Just now";
|
|
56
|
+
if (min < 60) return `${min}m ago`;
|
|
57
|
+
const hr = Math.floor(min / 60);
|
|
58
|
+
if (hr < 24) return `${hr}h ago`;
|
|
59
|
+
const day = Math.floor(hr / 24);
|
|
60
|
+
if (day === 1) return "Yesterday";
|
|
61
|
+
if (day < 7) return `${day}d ago`;
|
|
62
|
+
const wk = Math.floor(day / 7);
|
|
63
|
+
if (wk < 5) return `${wk}w ago`;
|
|
64
|
+
return new Date(then).toLocaleDateString();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function isUnread(status?: string): boolean {
|
|
68
|
+
return status === "UNSEEN" || status === "SEEN_BUT_UNREAD";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function dest(n: MfvNotification): string {
|
|
72
|
+
return n.deeplink?.mobileData?.data || n.deeplink?.webUrlData?.webUrl || "";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function photo(n: MfvNotification): string {
|
|
76
|
+
return n.icon?.personAvatarData?.data || n.icon?.webUrlData?.webUrl || "";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The screens the Notifications screen says its app serves, or undefined when it did not say. */
|
|
80
|
+
function servedScreens(arg: unknown): ReadonlySet<string> | undefined {
|
|
81
|
+
const served = (arg as { served?: unknown } | null | undefined)?.served;
|
|
82
|
+
// A Retry reaches `load` with no params (the collection layer re-dispatches the action bare), so the list the screen
|
|
83
|
+
// last named is kept: dropping it would let every catalog link be tried again.
|
|
84
|
+
if (typeof served === "string") lastServed = new Set(served.split(",").filter(Boolean));
|
|
85
|
+
return lastServed;
|
|
86
|
+
}
|
|
87
|
+
let lastServed: ReadonlySet<string> | undefined;
|
|
88
|
+
|
|
89
|
+
function norm(n: MfvNotification, served?: ReadonlySet<string>): Row {
|
|
90
|
+
const name = (n.title || n.message || "Notification").trim() || "Notification";
|
|
91
|
+
const rel = relativeTime(n.sentDate);
|
|
92
|
+
const lead = n.title && n.message ? n.message.trim() : "";
|
|
93
|
+
const subtitle = [lead, rel].filter(Boolean).join(" · ");
|
|
94
|
+
const p = photo(n);
|
|
95
|
+
const unread = isUnread(n.status);
|
|
96
|
+
return {
|
|
97
|
+
id: n.id || "",
|
|
98
|
+
name,
|
|
99
|
+
subtitle,
|
|
100
|
+
unread,
|
|
101
|
+
unreadDot: unread ? "●" : "",
|
|
102
|
+
photo: p,
|
|
103
|
+
initial: (name[0] || "#").toUpperCase(),
|
|
104
|
+
dest: dest(n),
|
|
105
|
+
open: notificationOpen(n.deeplink, served),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const MOCK: Row[] = [
|
|
110
|
+
{ id: "sample-like", name: "Maya Levin liked your post", subtitle: "“Weekend pop-up” · 2h ago", unread: true, unreadDot: "●", photo: "", initial: "M", dest: "" },
|
|
111
|
+
{ id: "sample-comment", name: "Daniel Cohen commented on your post", subtitle: "“Love this — count me in!” · 5h ago", unread: true, unreadDot: "●", photo: "", initial: "D", dest: "" },
|
|
112
|
+
{ id: "sample-booking", name: "Booking reminder", subtitle: "Yoga Flow tomorrow at 9:00 AM · Yesterday", unread: false, unreadDot: "", photo: "", initial: "B", dest: "" },
|
|
113
|
+
{ id: "sample-follow", name: "Noa Bar started following you", subtitle: "2d ago", unread: false, unreadDot: "", photo: "", initial: "N", dest: "" },
|
|
114
|
+
{ id: "sample-offer", name: "New offer just for you", subtitle: "15% off your next order · 3d ago", unread: false, unreadDot: "", photo: "", initial: "%", dest: "" },
|
|
115
|
+
];
|
|
116
|
+
|
|
117
|
+
/** sample rows reach the screen ONLY in the host's explicit sample preview;
|
|
118
|
+
* a failed or empty query is an honest error / empty state (branded-load-state.ts). */
|
|
119
|
+
const COPY: LoadCopy<Row> = {
|
|
120
|
+
prefix: "notifications",
|
|
121
|
+
empty: "You're all caught up — no notifications yet.",
|
|
122
|
+
error: "Notifications couldn't be loaded.",
|
|
123
|
+
signIn: "Sign in to see your notifications.",
|
|
124
|
+
sample: () => MOCK.map((r) => ({ ...r })),
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const signInRequired = () => new Error("Unauthenticated: sign in to see notifications");
|
|
128
|
+
|
|
129
|
+
async function requireMember(): Promise<MemberAccess> {
|
|
130
|
+
const member = await memberAccess();
|
|
131
|
+
if (!member.email) throw signInRequired();
|
|
132
|
+
return member;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async function requireInboxMember(s: S): Promise<void> {
|
|
136
|
+
const member = await requireMember();
|
|
137
|
+
if (!s.inboxMember || member.email !== s.inboxMember.email || member.scope !== s.inboxMember.scope) {
|
|
138
|
+
throw new Error("Member access changed: reload notifications");
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Each successful load owns a fresh member object. Presentation changes and
|
|
143
|
+
* other read marks keep it; a newer inbox replaces it even for the same member. */
|
|
144
|
+
function currentInbox(s: S): S | undefined {
|
|
145
|
+
const current: S = svc.getState();
|
|
146
|
+
return current.inboxMember === s.inboxMember && (s.inboxMember !== null || current.items === s.items)
|
|
147
|
+
? current : undefined;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const defineService = withOnlineWrites(registerService, ["markOneRead","markAll"], { messageFields: ["actionMessage"] });
|
|
151
|
+
/** A guest who opened Notifications is offered the app's sign-in at once (the load params opt in: `signInScreenId`). */
|
|
152
|
+
const guest = guestSignIn();
|
|
153
|
+
const INITIAL = { ...LOADING, items: [] as Row[], emptyText: "", actionMessage: "", pendingUrl: "", inboxMember: null };
|
|
154
|
+
const svc = defineService<S, {
|
|
155
|
+
prepare: (s: S) => S;
|
|
156
|
+
load: (s: S, arg?: unknown) => Promise<S>;
|
|
157
|
+
markOneRead: (s: S, id: string) => Promise<S | undefined>;
|
|
158
|
+
markAll: (s: S) => Promise<S | undefined>;
|
|
159
|
+
open: (s: S, arg?: unknown) => Promise<S | undefined>;
|
|
160
|
+
}>("himiBrandedNotifications", {
|
|
161
|
+
state: INITIAL,
|
|
162
|
+
actions: {
|
|
163
|
+
// Clear worker-restored state before this worker starts its member probe.
|
|
164
|
+
// Native hosts may already cold-paint their account-scoped snapshot; this
|
|
165
|
+
// reducer does not control that earlier host phase.
|
|
166
|
+
prepare: (s) => ({ ...s, ...INITIAL }),
|
|
167
|
+
load: async (s, arg) => {
|
|
168
|
+
// The screen names which of the link targets this app serves (a comma list); none given means any may be tried.
|
|
169
|
+
const served = servedScreens(arg);
|
|
170
|
+
try {
|
|
171
|
+
const member = await requireMember();
|
|
172
|
+
// At once, not after the read: a signed-in load whose read fails would otherwise leave the one-shot offer consumed for the next guest.
|
|
173
|
+
guest.member();
|
|
174
|
+
const items = (await queryNotifications(25)).map((n) => norm(n, served));
|
|
175
|
+
await assertMemberAccess(member);
|
|
176
|
+
return { ...s, ...loaded("items", items, COPY), inboxMember: member, actionMessage: "", pendingUrl: "" };
|
|
177
|
+
} catch (err) {
|
|
178
|
+
const signedIn = !!(await memberAccess()).email;
|
|
179
|
+
if (!signedIn) guest.offer(arg);
|
|
180
|
+
return { ...s, ...loadFailed("items", signedIn ? err : signInRequired(), COPY), inboxMember: null, actionMessage: "", pendingUrl: "" };
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
// Mark one read; optimistically clear its dot. Real write is best-effort and
|
|
184
|
+
// a no-op on sample rows.
|
|
185
|
+
markOneRead: async (s, id): Promise<S | undefined> => {
|
|
186
|
+
if (!id || s.busy) return undefined;
|
|
187
|
+
if (!s.isMock) {
|
|
188
|
+
try {
|
|
189
|
+
await requireInboxMember(s);
|
|
190
|
+
if (!currentInbox(s)) return undefined;
|
|
191
|
+
if (!id.startsWith("sample-")) { try { await markRead([id]); } catch { /* keep optimistic */ } }
|
|
192
|
+
// Embedded workers may survive a host account/tenant change while
|
|
193
|
+
// Wix is acknowledging the write. Recheck the live identity too.
|
|
194
|
+
await requireInboxMember(s);
|
|
195
|
+
} catch (err) {
|
|
196
|
+
// The read may have finished while identity was checked. An obsolete
|
|
197
|
+
// write must not clear the freshly published inbox with its error.
|
|
198
|
+
const current = currentInbox(s);
|
|
199
|
+
return current ? { ...current, ...loadFailed("items", err, COPY), inboxMember: null } : undefined;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// A refresh can also finish while Wix acknowledges the write.
|
|
203
|
+
const current = currentInbox(s);
|
|
204
|
+
return current ? { ...current, items: current.items.map((r) => (r.id === id ? { ...r, unread: false, unreadDot: "" } : r)) } : undefined;
|
|
205
|
+
},
|
|
206
|
+
// A tap on a row opens what the notification points at, like the One App: a Himi screen when its link names
|
|
207
|
+
// one of ours (see _shared/notification-target.ts), else its https link, else a visible "can't open".
|
|
208
|
+
// A web link is written by the site, so it needs a SECOND tap on the same row, after the first tap has
|
|
209
|
+
// shown where it goes. It never replaces the inbox, and an unknown link never guesses a screen.
|
|
210
|
+
open: async (s, arg): Promise<S | undefined> => {
|
|
211
|
+
const id = String((arg as { id?: unknown } | null | undefined)?.id ?? "");
|
|
212
|
+
const row = s.items.find((r) => r.id === id);
|
|
213
|
+
if (!row || s.busy) return undefined;
|
|
214
|
+
if (!s.isMock) {
|
|
215
|
+
try { await requireInboxMember(s); } catch (err) {
|
|
216
|
+
const current = currentInbox(s);
|
|
217
|
+
return current ? { ...current, ...loadFailed("items", err, COPY), inboxMember: null } : undefined;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const current = currentInbox(s);
|
|
221
|
+
if (!current) return undefined;
|
|
222
|
+
const action = row.open ?? { kind: "none" as const };
|
|
223
|
+
if (action.kind === "url") {
|
|
224
|
+
if (current.pendingUrl !== action.url) {
|
|
225
|
+
return { ...current, pendingUrl: action.url, actionMessage: copyTemplate("notifications.openLinkText", "Tap again to open {host}.", { host: urlHost(action.url) }) };
|
|
226
|
+
}
|
|
227
|
+
const opened = await openRichLink(action.url);
|
|
228
|
+
const now = currentInbox(s);
|
|
229
|
+
return now ? { ...now, pendingUrl: "", actionMessage: opened ? "" : copyParam("notifications.cantOpenText", "This notification can't be opened here.") } : undefined;
|
|
230
|
+
}
|
|
231
|
+
if (action.kind === "none") {
|
|
232
|
+
return { ...current, pendingUrl: "", actionMessage: copyParam("notifications.cantOpenText", "This notification can't be opened here.") };
|
|
233
|
+
}
|
|
234
|
+
// Read on open: the dot clears at once, the write is best effort and never holds the navigation.
|
|
235
|
+
if (!id.startsWith("sample-") && row.unread) markRead([id]).catch(() => undefined);
|
|
236
|
+
const read = { ...current, pendingUrl: "", actionMessage: "", items: current.items.map((r) => (r.id === id ? { ...r, unread: false, unreadDot: "" } : r)) };
|
|
237
|
+
return navigate(read, { screenId: action.target.screenId, args: action.target.args });
|
|
238
|
+
},
|
|
239
|
+
// Mark everything read; optimistically clear all dots.
|
|
240
|
+
markAll: async (s): Promise<S | undefined> => {
|
|
241
|
+
if (s.busy) return undefined;
|
|
242
|
+
if (!s.isMock) {
|
|
243
|
+
try {
|
|
244
|
+
await requireInboxMember(s);
|
|
245
|
+
if (!currentInbox(s)) return undefined;
|
|
246
|
+
try { await markAllRead(); } catch { /* keep optimistic */ }
|
|
247
|
+
await requireInboxMember(s);
|
|
248
|
+
} catch (err) {
|
|
249
|
+
// The read may have finished while identity was checked. An obsolete
|
|
250
|
+
// write must not clear the freshly published inbox with its error.
|
|
251
|
+
const current = currentInbox(s);
|
|
252
|
+
return current ? { ...current, ...loadFailed("items", err, COPY), inboxMember: null } : undefined;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// A refresh can also finish while Wix acknowledges the write.
|
|
256
|
+
const current = currentInbox(s);
|
|
257
|
+
return current ? { ...current, items: current.items.map((r) => (r.unread ? { ...r, unread: false, unreadDot: "" } : r)) } : undefined;
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
svc.prepare();
|
|
262
|
+
svc.load();
|
|
263
|
+
export { svc };
|