@wix/himalaya-cli 0.1767.0 → 0.1769.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-config.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +9 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{cba469735852da3b19235ce6d163f0e0bb4fd2e751c0042493147e4d9c143d92.bin → 7977d7340513225ef7609b9983b621e2b48c10deb7427e059e595d2fc66f7983.bin} +1 -1
- package/dist/browser-plane/sw.js +8 -8
- package/dist/cli.mjs +234 -89
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/capabilities.md +6 -4
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +4 -0
- package/guides/himi-json-output.md +19 -7
- package/guides/one-app-to-himi-app.md +19 -9
- package/guides/qa-builds.md +73 -84
- package/package.json +2 -2
- package/templates/beauty-salon/l10n/ar.json +45 -0
- package/templates/beauty-salon/l10n/cs.json +45 -0
- package/templates/beauty-salon/l10n/da.json +45 -0
- package/templates/beauty-salon/l10n/de.json +45 -0
- package/templates/beauty-salon/l10n/el.json +45 -0
- package/templates/beauty-salon/l10n/en.json +1 -1
- package/templates/beauty-salon/l10n/es.json +45 -0
- package/templates/beauty-salon/l10n/fi.json +45 -0
- package/templates/beauty-salon/l10n/fr.json +45 -0
- package/templates/beauty-salon/l10n/he.json +36 -0
- package/templates/beauty-salon/l10n/hu.json +45 -0
- package/templates/beauty-salon/l10n/id.json +45 -0
- package/templates/beauty-salon/l10n/it.json +45 -0
- package/templates/beauty-salon/l10n/ja.json +45 -0
- package/templates/beauty-salon/l10n/ko.json +45 -0
- package/templates/beauty-salon/l10n/lt.json +45 -0
- package/templates/beauty-salon/l10n/nl.json +45 -0
- package/templates/beauty-salon/l10n/no.json +45 -0
- package/templates/beauty-salon/l10n/pl.json +45 -0
- package/templates/beauty-salon/l10n/pt.json +45 -0
- package/templates/beauty-salon/l10n/ru.json +45 -0
- package/templates/beauty-salon/l10n/sv.json +45 -0
- package/templates/beauty-salon/l10n/th.json +45 -0
- package/templates/beauty-salon/l10n/tr.json +45 -0
- package/templates/beauty-salon/l10n/uk.json +45 -0
- package/templates/beauty-salon/l10n/vi.json +45 -0
- package/templates/beauty-salon/l10n/zh.json +45 -0
- package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/beauty-salon/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/beauty-salon/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/branded-lite/config.ts +11 -1
- package/templates/branded-lite/dev/index.ts +1088 -86
- package/templates/branded-lite/himalaya.content.json +3 -0
- package/templates/branded-lite/l10n/ar.json +259 -0
- package/templates/branded-lite/l10n/cs.json +259 -0
- package/templates/branded-lite/l10n/da.json +259 -0
- package/templates/branded-lite/l10n/de.json +259 -0
- package/templates/branded-lite/l10n/el.json +259 -0
- package/templates/branded-lite/l10n/en.json +65 -2
- package/templates/branded-lite/l10n/es.json +259 -0
- package/templates/branded-lite/l10n/fi.json +259 -0
- package/templates/branded-lite/l10n/fr.json +259 -0
- package/templates/branded-lite/l10n/he.json +209 -0
- package/templates/branded-lite/l10n/hu.json +259 -0
- package/templates/branded-lite/l10n/id.json +259 -0
- package/templates/branded-lite/l10n/it.json +259 -0
- package/templates/branded-lite/l10n/ja.json +259 -0
- package/templates/branded-lite/l10n/ko.json +259 -0
- package/templates/branded-lite/l10n/lt.json +259 -0
- package/templates/branded-lite/l10n/nl.json +259 -0
- package/templates/branded-lite/l10n/no.json +259 -0
- package/templates/branded-lite/l10n/pl.json +259 -0
- package/templates/branded-lite/l10n/pt.json +259 -0
- package/templates/branded-lite/l10n/ru.json +259 -0
- package/templates/branded-lite/l10n/sv.json +259 -0
- package/templates/branded-lite/l10n/th.json +259 -0
- package/templates/branded-lite/l10n/tr.json +259 -0
- package/templates/branded-lite/l10n/uk.json +259 -0
- package/templates/branded-lite/l10n/vi.json +259 -0
- package/templates/branded-lite/l10n/zh.json +259 -0
- package/templates/branded-lite/recipes/programs-card.json +2 -2
- package/templates/branded-lite/recipes/programs-carousel.json +2 -2
- package/templates/branded-lite/recipes/programs-participant-carousel.json +2 -2
- package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/branded-lite/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/branded-lite/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/branded-lite/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/branded-lite/tier5-src/_shared/inbox-search.ts +119 -0
- package/templates/branded-lite/tier5-src/_shared/member-inbox-transport.ts +64 -0
- package/templates/branded-lite/tier5-src/_shared/member-thread-rows.ts +233 -0
- package/templates/branded-lite/tier5-src/_shared/program-standing.ts +21 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +8 -4
- package/templates/branded-lite/tier5-src/business-chat/index.ts +73 -22
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +777 -54
- package/templates/branded-lite/tier5-src/himi-branded-lite-member-programs/index.ts +23 -7
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +17 -3
- package/templates/branded-lite/tier5-src/himi-branded-lite-program-participant/index.ts +336 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-program-participant/model.ts +206 -0
- package/templates/branded-lite/tier5-src/wix-spaces-chat-thread/index.ts +426 -143
- package/templates/branded-lite/tier5-src/wix-spaces-new-message/index.ts +4 -2
- package/templates/brandy/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/brandy/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/brandy/tier5-src/_shared/business-chat-transport.ts +164 -0
- package/templates/brandy/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/brandy/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/brandy/tier5-src/_shared/inbox-search.ts +119 -0
- package/templates/brandy/tier5-src/_shared/member-inbox-transport.ts +64 -0
- package/templates/brandy/tier5-src/_shared/member-thread-rows.ts +233 -0
- package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +777 -54
- package/templates/brandy/tier5-src/wix-spaces-chat-thread/index.ts +426 -143
- package/templates/community-club/l10n/ar.json +30 -0
- package/templates/community-club/l10n/cs.json +30 -0
- package/templates/community-club/l10n/da.json +30 -0
- package/templates/community-club/l10n/de.json +30 -0
- package/templates/community-club/l10n/el.json +30 -0
- package/templates/community-club/l10n/en.json +2 -2
- package/templates/community-club/l10n/es.json +30 -0
- package/templates/community-club/l10n/fi.json +30 -0
- package/templates/community-club/l10n/fr.json +30 -0
- package/templates/community-club/l10n/he.json +24 -0
- package/templates/community-club/l10n/hu.json +30 -0
- package/templates/community-club/l10n/id.json +30 -0
- package/templates/community-club/l10n/it.json +30 -0
- package/templates/community-club/l10n/ja.json +30 -0
- package/templates/community-club/l10n/ko.json +30 -0
- package/templates/community-club/l10n/lt.json +30 -0
- package/templates/community-club/l10n/nl.json +30 -0
- package/templates/community-club/l10n/no.json +30 -0
- package/templates/community-club/l10n/pl.json +30 -0
- package/templates/community-club/l10n/pt.json +30 -0
- package/templates/community-club/l10n/ru.json +30 -0
- package/templates/community-club/l10n/sv.json +30 -0
- package/templates/community-club/l10n/th.json +30 -0
- package/templates/community-club/l10n/tr.json +30 -0
- package/templates/community-club/l10n/uk.json +30 -0
- package/templates/community-club/l10n/vi.json +30 -0
- package/templates/community-club/l10n/zh.json +30 -0
- package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/community-club/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/community-club/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/community-club-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/conference/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/conference/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/conference/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/conference/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/conference/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/conference/tier5-src/business-chat/index.ts +73 -22
- package/templates/events-meetups/l10n/ar.json +30 -0
- package/templates/events-meetups/l10n/cs.json +30 -0
- package/templates/events-meetups/l10n/da.json +30 -0
- package/templates/events-meetups/l10n/de.json +30 -0
- package/templates/events-meetups/l10n/el.json +30 -0
- package/templates/events-meetups/l10n/en.json +1 -1
- package/templates/events-meetups/l10n/es.json +30 -0
- package/templates/events-meetups/l10n/fi.json +30 -0
- package/templates/events-meetups/l10n/fr.json +30 -0
- package/templates/events-meetups/l10n/he.json +24 -0
- package/templates/events-meetups/l10n/hu.json +30 -0
- package/templates/events-meetups/l10n/id.json +30 -0
- package/templates/events-meetups/l10n/it.json +30 -0
- package/templates/events-meetups/l10n/ja.json +30 -0
- package/templates/events-meetups/l10n/ko.json +30 -0
- package/templates/events-meetups/l10n/lt.json +30 -0
- package/templates/events-meetups/l10n/nl.json +30 -0
- package/templates/events-meetups/l10n/no.json +30 -0
- package/templates/events-meetups/l10n/pl.json +30 -0
- package/templates/events-meetups/l10n/pt.json +30 -0
- package/templates/events-meetups/l10n/ru.json +30 -0
- package/templates/events-meetups/l10n/sv.json +30 -0
- package/templates/events-meetups/l10n/th.json +30 -0
- package/templates/events-meetups/l10n/tr.json +30 -0
- package/templates/events-meetups/l10n/uk.json +30 -0
- package/templates/events-meetups/l10n/vi.json +30 -0
- package/templates/events-meetups/l10n/zh.json +30 -0
- package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/events-meetups/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/events-meetups/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/events-meetups-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/fitness-gym/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +21 -0
- package/templates/fitness-gym/tier5-src/business-chat/index.ts +73 -22
- package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +23 -7
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +17 -3
- package/templates/gym-fitness/l10n/ar.json +45 -0
- package/templates/gym-fitness/l10n/cs.json +45 -0
- package/templates/gym-fitness/l10n/da.json +45 -0
- package/templates/gym-fitness/l10n/de.json +45 -0
- package/templates/gym-fitness/l10n/el.json +45 -0
- package/templates/gym-fitness/l10n/en.json +1 -1
- package/templates/gym-fitness/l10n/es.json +45 -0
- package/templates/gym-fitness/l10n/fi.json +45 -0
- package/templates/gym-fitness/l10n/fr.json +45 -0
- package/templates/gym-fitness/l10n/he.json +36 -0
- package/templates/gym-fitness/l10n/hu.json +45 -0
- package/templates/gym-fitness/l10n/id.json +45 -0
- package/templates/gym-fitness/l10n/it.json +45 -0
- package/templates/gym-fitness/l10n/ja.json +45 -0
- package/templates/gym-fitness/l10n/ko.json +45 -0
- package/templates/gym-fitness/l10n/lt.json +45 -0
- package/templates/gym-fitness/l10n/nl.json +45 -0
- package/templates/gym-fitness/l10n/no.json +45 -0
- package/templates/gym-fitness/l10n/pl.json +45 -0
- package/templates/gym-fitness/l10n/pt.json +45 -0
- package/templates/gym-fitness/l10n/ru.json +45 -0
- package/templates/gym-fitness/l10n/sv.json +45 -0
- package/templates/gym-fitness/l10n/th.json +45 -0
- package/templates/gym-fitness/l10n/tr.json +45 -0
- package/templates/gym-fitness/l10n/uk.json +45 -0
- package/templates/gym-fitness/l10n/vi.json +45 -0
- package/templates/gym-fitness/l10n/zh.json +45 -0
- package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/gym-fitness/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/gym-fitness/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/medical-services/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/medical-services/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/medical-services/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/medical-services/tier5-src/business-chat/index.ts +73 -22
- package/templates/medical-services/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/nonprofit-cause/l10n/ar.json +30 -0
- package/templates/nonprofit-cause/l10n/cs.json +30 -0
- package/templates/nonprofit-cause/l10n/da.json +30 -0
- package/templates/nonprofit-cause/l10n/de.json +30 -0
- package/templates/nonprofit-cause/l10n/el.json +30 -0
- package/templates/nonprofit-cause/l10n/en.json +1 -1
- package/templates/nonprofit-cause/l10n/es.json +30 -0
- package/templates/nonprofit-cause/l10n/fi.json +30 -0
- package/templates/nonprofit-cause/l10n/fr.json +30 -0
- package/templates/nonprofit-cause/l10n/he.json +24 -0
- package/templates/nonprofit-cause/l10n/hu.json +30 -0
- package/templates/nonprofit-cause/l10n/id.json +30 -0
- package/templates/nonprofit-cause/l10n/it.json +30 -0
- package/templates/nonprofit-cause/l10n/ja.json +30 -0
- package/templates/nonprofit-cause/l10n/ko.json +30 -0
- package/templates/nonprofit-cause/l10n/lt.json +30 -0
- package/templates/nonprofit-cause/l10n/nl.json +30 -0
- package/templates/nonprofit-cause/l10n/no.json +30 -0
- package/templates/nonprofit-cause/l10n/pl.json +30 -0
- package/templates/nonprofit-cause/l10n/pt.json +30 -0
- package/templates/nonprofit-cause/l10n/ru.json +30 -0
- package/templates/nonprofit-cause/l10n/sv.json +30 -0
- package/templates/nonprofit-cause/l10n/th.json +30 -0
- package/templates/nonprofit-cause/l10n/tr.json +30 -0
- package/templates/nonprofit-cause/l10n/uk.json +30 -0
- package/templates/nonprofit-cause/l10n/vi.json +30 -0
- package/templates/nonprofit-cause/l10n/zh.json +30 -0
- package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/nonprofit-cause/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/nonprofit-cause/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/owner-lite/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/personal-fitness-trainer/dev/index.ts +2 -1
- package/templates/personal-fitness-trainer/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/personal-fitness-trainer/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +73 -22
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/podcast-creator/l10n/ar.json +35 -0
- package/templates/podcast-creator/l10n/cs.json +35 -0
- package/templates/podcast-creator/l10n/da.json +35 -0
- package/templates/podcast-creator/l10n/de.json +35 -0
- package/templates/podcast-creator/l10n/el.json +35 -0
- package/templates/podcast-creator/l10n/en.json +1 -1
- package/templates/podcast-creator/l10n/es.json +35 -0
- package/templates/podcast-creator/l10n/fi.json +35 -0
- package/templates/podcast-creator/l10n/fr.json +35 -0
- package/templates/podcast-creator/l10n/he.json +28 -0
- package/templates/podcast-creator/l10n/hu.json +35 -0
- package/templates/podcast-creator/l10n/id.json +35 -0
- package/templates/podcast-creator/l10n/it.json +35 -0
- package/templates/podcast-creator/l10n/ja.json +35 -0
- package/templates/podcast-creator/l10n/ko.json +35 -0
- package/templates/podcast-creator/l10n/lt.json +35 -0
- package/templates/podcast-creator/l10n/nl.json +35 -0
- package/templates/podcast-creator/l10n/no.json +35 -0
- package/templates/podcast-creator/l10n/pl.json +35 -0
- package/templates/podcast-creator/l10n/pt.json +35 -0
- package/templates/podcast-creator/l10n/ru.json +35 -0
- package/templates/podcast-creator/l10n/sv.json +35 -0
- package/templates/podcast-creator/l10n/th.json +35 -0
- package/templates/podcast-creator/l10n/tr.json +35 -0
- package/templates/podcast-creator/l10n/uk.json +35 -0
- package/templates/podcast-creator/l10n/vi.json +35 -0
- package/templates/podcast-creator/l10n/zh.json +35 -0
- package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/podcast-creator/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/podcast-creator/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/portfolio-creative/l10n/ar.json +35 -0
- package/templates/portfolio-creative/l10n/cs.json +35 -0
- package/templates/portfolio-creative/l10n/da.json +35 -0
- package/templates/portfolio-creative/l10n/de.json +35 -0
- package/templates/portfolio-creative/l10n/el.json +35 -0
- package/templates/portfolio-creative/l10n/en.json +1 -1
- package/templates/portfolio-creative/l10n/es.json +35 -0
- package/templates/portfolio-creative/l10n/fi.json +35 -0
- package/templates/portfolio-creative/l10n/fr.json +35 -0
- package/templates/portfolio-creative/l10n/he.json +28 -0
- package/templates/portfolio-creative/l10n/hu.json +35 -0
- package/templates/portfolio-creative/l10n/id.json +35 -0
- package/templates/portfolio-creative/l10n/it.json +35 -0
- package/templates/portfolio-creative/l10n/ja.json +35 -0
- package/templates/portfolio-creative/l10n/ko.json +35 -0
- package/templates/portfolio-creative/l10n/lt.json +35 -0
- package/templates/portfolio-creative/l10n/nl.json +35 -0
- package/templates/portfolio-creative/l10n/no.json +35 -0
- package/templates/portfolio-creative/l10n/pl.json +35 -0
- package/templates/portfolio-creative/l10n/pt.json +35 -0
- package/templates/portfolio-creative/l10n/ru.json +35 -0
- package/templates/portfolio-creative/l10n/sv.json +35 -0
- package/templates/portfolio-creative/l10n/th.json +35 -0
- package/templates/portfolio-creative/l10n/tr.json +35 -0
- package/templates/portfolio-creative/l10n/uk.json +35 -0
- package/templates/portfolio-creative/l10n/vi.json +35 -0
- package/templates/portfolio-creative/l10n/zh.json +35 -0
- package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/portfolio-creative/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/portfolio-creative/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/restaurant/l10n/ar.json +35 -0
- package/templates/restaurant/l10n/cs.json +35 -0
- package/templates/restaurant/l10n/da.json +35 -0
- package/templates/restaurant/l10n/de.json +35 -0
- package/templates/restaurant/l10n/el.json +35 -0
- package/templates/restaurant/l10n/en.json +1 -1
- package/templates/restaurant/l10n/es.json +35 -0
- package/templates/restaurant/l10n/fi.json +35 -0
- package/templates/restaurant/l10n/fr.json +35 -0
- package/templates/restaurant/l10n/he.json +28 -0
- package/templates/restaurant/l10n/hu.json +35 -0
- package/templates/restaurant/l10n/id.json +35 -0
- package/templates/restaurant/l10n/it.json +35 -0
- package/templates/restaurant/l10n/ja.json +35 -0
- package/templates/restaurant/l10n/ko.json +35 -0
- package/templates/restaurant/l10n/lt.json +35 -0
- package/templates/restaurant/l10n/nl.json +35 -0
- package/templates/restaurant/l10n/no.json +35 -0
- package/templates/restaurant/l10n/pl.json +35 -0
- package/templates/restaurant/l10n/pt.json +35 -0
- package/templates/restaurant/l10n/ru.json +35 -0
- package/templates/restaurant/l10n/sv.json +35 -0
- package/templates/restaurant/l10n/th.json +35 -0
- package/templates/restaurant/l10n/tr.json +35 -0
- package/templates/restaurant/l10n/uk.json +35 -0
- package/templates/restaurant/l10n/vi.json +35 -0
- package/templates/restaurant/l10n/zh.json +35 -0
- package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/restaurant/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/restaurant/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/restaurant-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/retail-store/l10n/ar.json +35 -0
- package/templates/retail-store/l10n/cs.json +35 -0
- package/templates/retail-store/l10n/da.json +35 -0
- package/templates/retail-store/l10n/de.json +35 -0
- package/templates/retail-store/l10n/el.json +35 -0
- package/templates/retail-store/l10n/en.json +1 -1
- package/templates/retail-store/l10n/es.json +35 -0
- package/templates/retail-store/l10n/fi.json +35 -0
- package/templates/retail-store/l10n/fr.json +35 -0
- package/templates/retail-store/l10n/he.json +28 -0
- package/templates/retail-store/l10n/hu.json +35 -0
- package/templates/retail-store/l10n/id.json +35 -0
- package/templates/retail-store/l10n/it.json +35 -0
- package/templates/retail-store/l10n/ja.json +35 -0
- package/templates/retail-store/l10n/ko.json +35 -0
- package/templates/retail-store/l10n/lt.json +35 -0
- package/templates/retail-store/l10n/nl.json +35 -0
- package/templates/retail-store/l10n/no.json +35 -0
- package/templates/retail-store/l10n/pl.json +35 -0
- package/templates/retail-store/l10n/pt.json +35 -0
- package/templates/retail-store/l10n/ru.json +35 -0
- package/templates/retail-store/l10n/sv.json +35 -0
- package/templates/retail-store/l10n/th.json +35 -0
- package/templates/retail-store/l10n/tr.json +35 -0
- package/templates/retail-store/l10n/uk.json +35 -0
- package/templates/retail-store/l10n/vi.json +35 -0
- package/templates/retail-store/l10n/zh.json +35 -0
- package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/retail-store/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/retail-store/tier5-src/_shared/program-standing.ts +67 -0
- package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/retail-store-owner/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/salon-spa/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/salon-spa/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/salon-spa/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/salon-spa/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/salon-spa/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/salon-spa/tier5-src/business-chat/index.ts +73 -22
- package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/wholesale-store/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/wholesale-store/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/wholesale-store/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/wholesale-store/tier5-src/_shared/inbox-rooms.ts +101 -11
- package/templates/wholesale-store/tier5-src/business-chat/index.ts +73 -22
- package/templates/yoga-studio/config.ts +9 -0
- package/templates/yoga-studio/dev/index.ts +1134 -133
- package/templates/yoga-studio/himalaya.content.json +3 -0
- package/templates/yoga-studio/l10n/ar.json +150 -0
- package/templates/yoga-studio/l10n/cs.json +150 -0
- package/templates/yoga-studio/l10n/da.json +150 -0
- package/templates/yoga-studio/l10n/de.json +150 -0
- package/templates/yoga-studio/l10n/el.json +150 -0
- package/templates/yoga-studio/l10n/en.json +70 -1
- package/templates/yoga-studio/l10n/es.json +150 -0
- package/templates/yoga-studio/l10n/fi.json +150 -0
- package/templates/yoga-studio/l10n/fr.json +150 -0
- package/templates/yoga-studio/l10n/he.json +122 -0
- package/templates/yoga-studio/l10n/hu.json +150 -0
- package/templates/yoga-studio/l10n/id.json +150 -0
- package/templates/yoga-studio/l10n/it.json +150 -0
- package/templates/yoga-studio/l10n/ja.json +150 -0
- package/templates/yoga-studio/l10n/ko.json +150 -0
- package/templates/yoga-studio/l10n/lt.json +150 -0
- package/templates/yoga-studio/l10n/nl.json +150 -0
- package/templates/yoga-studio/l10n/no.json +150 -0
- package/templates/yoga-studio/l10n/pl.json +150 -0
- package/templates/yoga-studio/l10n/pt.json +150 -0
- package/templates/yoga-studio/l10n/ru.json +150 -0
- package/templates/yoga-studio/l10n/sv.json +150 -0
- package/templates/yoga-studio/l10n/th.json +150 -0
- package/templates/yoga-studio/l10n/tr.json +150 -0
- package/templates/yoga-studio/l10n/uk.json +150 -0
- package/templates/yoga-studio/l10n/vi.json +150 -0
- package/templates/yoga-studio/l10n/zh.json +150 -0
- package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +1 -0
- package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +20 -4
- package/templates/yoga-studio/tier5-src/_shared/engine-intl.ts +6 -0
- package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
- package/templates/yoga-studio/tier5-src/_shared/program-standing.ts +21 -0
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +56 -12
- package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +5 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-member-programs/index.ts +23 -7
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +17 -3
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program-participant/index.ts +336 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program-participant/model.ts +206 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/engine-intl.ts +6 -0
|
@@ -21,7 +21,7 @@ import { getMyMember } from "@himalaya/wix-members";
|
|
|
21
21
|
import { iapPriceFields, onlineProgramItem, type IapPollDirective } from "@himalaya/iap";
|
|
22
22
|
import { createIapCommerce } from "@himalaya/iap-checkout";
|
|
23
23
|
import { createCollectionQuery, type CollectionPage, type CollectionQueryState } from "../_shared/collection-query.js";
|
|
24
|
-
import { standingOf as sharedStandingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
24
|
+
import { inProgram, programScreenFor, standingOf as sharedStandingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
25
25
|
import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
|
|
26
26
|
import { cleanTitle, initials } from "../_shared/himi-text.js";
|
|
27
27
|
import { programImage } from "../_shared/himi-media.js";
|
|
@@ -35,6 +35,8 @@ import { iapPriceCopy, resetUnhydratedKeysOnOlderRuntime } from "../_shared/iap-
|
|
|
35
35
|
export const SERVICE = "himiBrandedMemberPrograms";
|
|
36
36
|
const PAGE_SIZE = 20;
|
|
37
37
|
const DETAIL_SCREEN = "himi_program";
|
|
38
|
+
/** The host's participant page (load arg `participantScreen`); "" keeps every card on the program page. */
|
|
39
|
+
let participantScreen = "";
|
|
38
40
|
|
|
39
41
|
// ── Row model ────────────────────────────────────────────────────────────────
|
|
40
42
|
|
|
@@ -73,6 +75,8 @@ export interface ProgramContent {
|
|
|
73
75
|
actionLabel: string;
|
|
74
76
|
actionDisabled: boolean;
|
|
75
77
|
detailScreenId: string;
|
|
78
|
+
/** The member has a participation in the program that opens the participant page. */
|
|
79
|
+
inProgram: boolean;
|
|
76
80
|
categoryIds: string[];
|
|
77
81
|
}
|
|
78
82
|
export interface ProgramRow extends ProgramContent {
|
|
@@ -276,6 +280,7 @@ function programContent(o: { program: WixProgram; participant?: WixParticipant;
|
|
|
276
280
|
// Only a member's CTA is the join action; a guest's "View" stays a navigation.
|
|
277
281
|
actionLabel, actionDisabled: limitReached && o.member,
|
|
278
282
|
detailScreenId: DETAIL_SCREEN,
|
|
283
|
+
inProgram: inProgram(standing, o.participant),
|
|
279
284
|
categoryIds: categoryIdsOf(p),
|
|
280
285
|
};
|
|
281
286
|
}
|
|
@@ -510,15 +515,23 @@ const INITIAL_STATE: State = {
|
|
|
510
515
|
function pricedRows(items: ProgramContent[]): ProgramRow[] {
|
|
511
516
|
const copy = iapPriceCopy("memberPrograms");
|
|
512
517
|
return items.map((row) => {
|
|
513
|
-
|
|
518
|
+
// A member in the program opens the participant page, when the host serves one.
|
|
519
|
+
const detailScreenId = programScreenFor(row.inProgram, DETAIL_SCREEN, participantScreen);
|
|
520
|
+
if (!row.pricable) return { ...row, detailScreenId, priceLine: "", hasPrice: false, noPrice: true };
|
|
514
521
|
const item = onlineProgramItem({ id: row.id }, row.commercePrice);
|
|
515
522
|
const view = item ? pricing.view(item.reference) : undefined;
|
|
516
523
|
const fields = view ? iapPriceFields(view, copy) : undefined;
|
|
517
524
|
const priceLine = fields?.priceText || (row.free ? copyParam("memberPrograms.free", "Free") : row.commercePrice);
|
|
518
|
-
return { ...row, priceLine, hasPrice: !!priceLine, noPrice: !priceLine };
|
|
525
|
+
return { ...row, detailScreenId, priceLine, hasPrice: !!priceLine, noPrice: !priceLine };
|
|
519
526
|
});
|
|
520
527
|
}
|
|
521
528
|
|
|
529
|
+
/** Reads the host's participant page from a load arg; an arg without one keeps the last. */
|
|
530
|
+
function stashParticipantScreen(arg: unknown): void {
|
|
531
|
+
const value = (arg as { participantScreen?: unknown } | undefined)?.participantScreen;
|
|
532
|
+
if (typeof value === "string") participantScreen = value;
|
|
533
|
+
}
|
|
534
|
+
|
|
522
535
|
function derive(state: State): State {
|
|
523
536
|
const current = page;
|
|
524
537
|
const meta = (current?.metadata ?? {}) as Partial<PageMeta>;
|
|
@@ -612,11 +625,12 @@ type Actions = {
|
|
|
612
625
|
const actions: Actions = {
|
|
613
626
|
async load(_state, arg) {
|
|
614
627
|
stashCopy(arg);
|
|
628
|
+
stashParticipantScreen(arg);
|
|
615
629
|
// A load of what the screen already shows is the screen coming back: it revalidates behind its rows.
|
|
616
630
|
await controller.query(criteria(), true, true);
|
|
617
631
|
return undefined;
|
|
618
632
|
},
|
|
619
|
-
async refresh(_state, arg) { stashCopy(arg); await controller.query(criteria()); return undefined; },
|
|
633
|
+
async refresh(_state, arg) { stashCopy(arg); stashParticipantScreen(arg); await controller.query(criteria()); return undefined; },
|
|
620
634
|
async loadMore() { await controller.loadMore(); return undefined; },
|
|
621
635
|
async retry() { await controller.retry(); return undefined; },
|
|
622
636
|
setStatus(state, arg) {
|
|
@@ -635,11 +649,13 @@ const actions: Actions = {
|
|
|
635
649
|
categoryId = next;
|
|
636
650
|
return controller.query(criteria()).then(() => undefined);
|
|
637
651
|
},
|
|
638
|
-
// The card's one action: every standing opens the program, which owns joining, paying and leaving
|
|
652
|
+
// The card's one action: every standing opens the program, which owns joining, paying and leaving —
|
|
653
|
+
// or, for a member in it, the host's participant page (the row's detailScreenId).
|
|
639
654
|
open(state, arg) {
|
|
640
655
|
const id = (arg as { id?: unknown } | undefined)?.id;
|
|
641
|
-
|
|
642
|
-
|
|
656
|
+
const row = typeof id === "string" ? state.rows.find((candidate) => candidate.id === id && !candidate.actionDisabled) : undefined;
|
|
657
|
+
if (!row) return state;
|
|
658
|
+
return navigate(state, { screenId: row.detailScreenId || DETAIL_SCREEN, args: { id: row.id } });
|
|
643
659
|
},
|
|
644
660
|
pageChanged: derive,
|
|
645
661
|
pricingPublish: derive,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
type WixProgram,
|
|
45
45
|
type WixProgramFull,
|
|
46
46
|
} from "@himalaya/wix-online-programs";
|
|
47
|
-
import { standingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
47
|
+
import { inProgram, standingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
48
48
|
import { createRedirectSession } from "@himalaya/wix-redirects";
|
|
49
49
|
import { getMyMember } from "@himalaya/wix-members";
|
|
50
50
|
import { session as wixPlatformSession, i18n } from "@himalaya/wix-platform";
|
|
@@ -102,6 +102,10 @@ interface State {
|
|
|
102
102
|
enrollLabel: string;
|
|
103
103
|
/** The member's standing as one line ("Joined", "Pending request"…); empty for a visitor or a new member. */
|
|
104
104
|
standingLine: string;
|
|
105
|
+
/** The program id, for the participant page link. */
|
|
106
|
+
programId: string;
|
|
107
|
+
/** A member in the program opens the participant page from here; everyone else has nothing to open. */
|
|
108
|
+
participantHidden: boolean;
|
|
105
109
|
/** Withdraws a pending join request; shown only while one is pending. */
|
|
106
110
|
cancelHidden: boolean;
|
|
107
111
|
cancelDisabled: boolean;
|
|
@@ -299,7 +303,7 @@ async function enrollmentMessage(id: string, name: string, guards: CommerceGuard
|
|
|
299
303
|
const commerce = createIapCommerce({ adapters: [onlineProgramOrders], onChange: () => { void svc.pricingPublish(); } });
|
|
300
304
|
const pricing = commerce.pricing;
|
|
301
305
|
const PRICING_NOT_HYDRATED = [
|
|
302
|
-
"priceLine", "priceNote", "hidePriceRetry", "enrollDisabled", "enrollNote", "enrollHidden", "enrollLabel", "standingLine", "cancelHidden", "cancelDisabled", "cancelLabel", "buyHidden", "buyLabel", "buyDisabled", "buyNote",
|
|
306
|
+
"priceLine", "priceNote", "hidePriceRetry", "enrollDisabled", "enrollNote", "enrollHidden", "enrollLabel", "standingLine", "participantHidden", "cancelHidden", "cancelDisabled", "cancelLabel", "buyHidden", "buyLabel", "buyDisabled", "buyNote",
|
|
303
307
|
] as const;
|
|
304
308
|
const CONTENT_KEYS = ["status", "name", "description", "descriptionJson", "meta", "facts", "image", "initial", "emptyText"] as const;
|
|
305
309
|
type Content = Pick<State, (typeof CONTENT_KEYS)[number]>;
|
|
@@ -314,6 +318,8 @@ let enrollmentInFlight = false;
|
|
|
314
318
|
// Unknown initial standing stays "none"; known standing survives transient reads only
|
|
315
319
|
// for its original program and revalidated member. `joinProgram` still guards every enrollment.
|
|
316
320
|
let standing: Standing = "none";
|
|
321
|
+
/** The standing came from a participation that opens the participant page (not an admitted application alone). */
|
|
322
|
+
let standingInProgram = false;
|
|
317
323
|
let standingContext: { programId: string; member: MemberAccess } | undefined;
|
|
318
324
|
let standingProgramId = "";
|
|
319
325
|
let standingMember: MemberAccess | undefined;
|
|
@@ -419,11 +425,12 @@ function loadStanding(id: string): Promise<StandingRead | undefined> {
|
|
|
419
425
|
}
|
|
420
426
|
|
|
421
427
|
async function readStanding(id: string, seq: number): Promise<StandingRead | undefined> {
|
|
422
|
-
const previous = { standing, id: pendingApplicationId, programId: standingProgramId, member: standingMember };
|
|
428
|
+
const previous = { standing, inProgram: standingInProgram, id: pendingApplicationId, programId: standingProgramId, member: standingMember };
|
|
423
429
|
const cancelled = cancelledApplication;
|
|
424
430
|
const failedFeedback = failedCancellationFeedback;
|
|
425
431
|
let failedFeedbackInvalidated = !!failedFeedback && failedFeedback.programId !== id;
|
|
426
432
|
let next: Standing = "none";
|
|
433
|
+
let nextInProgram = false;
|
|
427
434
|
let applicationId = "";
|
|
428
435
|
let owner: MemberAccess | undefined;
|
|
429
436
|
let read: StandingRead | undefined;
|
|
@@ -481,6 +488,7 @@ async function readStanding(id: string, seq: number): Promise<StandingRead | und
|
|
|
481
488
|
sameCancelledStanding = cancelledRow && !participant;
|
|
482
489
|
feedbackKnown ||= applicationKnown || !!participant;
|
|
483
490
|
next = standingOf(programEnded, participant ?? scoped[0], application);
|
|
491
|
+
nextInProgram = inProgram(next, participant);
|
|
484
492
|
if (next !== "none") owner = member;
|
|
485
493
|
if (failedFeedback && (applicationKnown || participant)) {
|
|
486
494
|
failedFeedbackInvalidated ||= !!participant || applicationRead?.id !== failedFeedback.id
|
|
@@ -498,6 +506,7 @@ async function readStanding(id: string, seq: number): Promise<StandingRead | und
|
|
|
498
506
|
try {
|
|
499
507
|
await assertMemberAccess(previous.member);
|
|
500
508
|
next = previous.standing;
|
|
509
|
+
nextInProgram = previous.inProgram;
|
|
501
510
|
applicationId = previous.id;
|
|
502
511
|
owner = previous.member;
|
|
503
512
|
} catch { /* never retain another member's standing */ }
|
|
@@ -522,6 +531,7 @@ async function readStanding(id: string, seq: number): Promise<StandingRead | und
|
|
|
522
531
|
cancellationFeedback = "";
|
|
523
532
|
}
|
|
524
533
|
standing = next;
|
|
534
|
+
standingInProgram = nextInProgram;
|
|
525
535
|
const knownMember = owner ?? readIdentity;
|
|
526
536
|
standingContext = (visitorKnown || !!read || next !== "none") && knownMember ? { programId: id, member: knownMember } : undefined;
|
|
527
537
|
standingProgramId = next !== "none" ? id : "";
|
|
@@ -757,6 +767,8 @@ function pricedState(state: State): State {
|
|
|
757
767
|
// says where they are. Only a new member, or one whose payment is owed, sees the CTA.
|
|
758
768
|
enrollHidden: purchase.appleRoute || !canEnrol(standing), enrollLabel: enrollLabelFor(standing),
|
|
759
769
|
standingLine: standing === "none" ? "" : copyParam(STATUS[standing].key, STATUS[standing].fallback),
|
|
770
|
+
programId: inputId(),
|
|
771
|
+
participantHidden: !standingForInput() || !standingInProgram,
|
|
760
772
|
cancelHidden: standing !== "pending" || !pendingApplicationId, cancelLabel: copyParam("program.cancelRequestCta", "Cancel request"),
|
|
761
773
|
cancelDisabled: cancelInFlight || enrollmentInFlight,
|
|
762
774
|
confirmedCancellation: cancelledApplication ?? null,
|
|
@@ -795,6 +807,8 @@ const INITIAL_STATE: State = derive({
|
|
|
795
807
|
enrollHidden: false,
|
|
796
808
|
enrollLabel: copyParam("program.enrolCta", "Enrol"),
|
|
797
809
|
standingLine: "",
|
|
810
|
+
programId: "",
|
|
811
|
+
participantHidden: true,
|
|
798
812
|
cancelHidden: true,
|
|
799
813
|
cancelDisabled: false,
|
|
800
814
|
cancelLabel: copyParam("program.cancelRequestCta", "Cancel request"),
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
// Tier-5 bundle: himi-branded-lite — the participant page of one online program
|
|
2
|
+
// (`himi_program_participant`), what a JOINED member sees in place of the sales page.
|
|
3
|
+
//
|
|
4
|
+
// Two tabs. Overview: the member's progress, the next step to take, and the program's
|
|
5
|
+
// description. Content: the sections in order, each followed by its steps with a done mark.
|
|
6
|
+
// A visitor is asked to sign in; a member who is not in the program (never joined, left, or
|
|
7
|
+
// paused) is sent back to `himi_program`, which owns joining.
|
|
8
|
+
//
|
|
9
|
+
// Reads (member identity): getProgram → getMyMember → the member's participation (Search
|
|
10
|
+
// Participants) → in parallel the program's sections, its steps and the participant's resolved
|
|
11
|
+
// steps. The done marks come from the resolved steps; Wix's participant progress is the
|
|
12
|
+
// fallback count when the content cannot be listed.
|
|
13
|
+
//
|
|
14
|
+
// The next step opens the step screen when the host serves one (the load arg `stepScreen`);
|
|
15
|
+
// without it the button shows the step in the Content tab, where it is marked "Next step".
|
|
16
|
+
import { connectivity, defineService, navigate } from "@himalaya/state";
|
|
17
|
+
import {
|
|
18
|
+
getProgram,
|
|
19
|
+
listSections,
|
|
20
|
+
participationsByProgram,
|
|
21
|
+
queryParticipantSteps,
|
|
22
|
+
queryPrograms,
|
|
23
|
+
queryResolvedSteps,
|
|
24
|
+
searchMemberParticipation,
|
|
25
|
+
type WixParticipant,
|
|
26
|
+
type WixProgram,
|
|
27
|
+
type WixResolvedStep,
|
|
28
|
+
type WixStep,
|
|
29
|
+
} from "@himalaya/wix-online-programs";
|
|
30
|
+
import { getMyMember } from "@himalaya/wix-members";
|
|
31
|
+
import { i18n } from "@himalaya/wix-platform";
|
|
32
|
+
import { WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
|
|
33
|
+
import { programImage } from "../_shared/himi-media.js";
|
|
34
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
35
|
+
import { programDescription } from "../_shared/program-description.js";
|
|
36
|
+
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
37
|
+
import { isProgramEnded, programName } from "../_shared/program-fields.js";
|
|
38
|
+
import { inProgram, standingOf, STATUS, type Standing } from "../_shared/program-standing.js";
|
|
39
|
+
import { assertMemberAccess, memberAccess, memberChanged, type MemberAccess } from "../_shared/member-access.js";
|
|
40
|
+
import { initials } from "../_shared/himi-text.js";
|
|
41
|
+
import { copyParam, stashCopy } from "../_shared/himi-copy.js";
|
|
42
|
+
import { buildContent, type ContentRow } from "./model.js";
|
|
43
|
+
|
|
44
|
+
export const SERVICE = "himiBrandedProgramParticipant";
|
|
45
|
+
/** The program page a member who is not in the program goes back to. */
|
|
46
|
+
const PROGRAM_SCREEN = "himi_program";
|
|
47
|
+
const PAGE_LIMIT = 100;
|
|
48
|
+
const MAX_PAGES = 10;
|
|
49
|
+
|
|
50
|
+
type Tab = "overview" | "content";
|
|
51
|
+
type Access = "member" | "signIn" | "notJoined";
|
|
52
|
+
|
|
53
|
+
interface State {
|
|
54
|
+
status: "loading" | "ready" | "error";
|
|
55
|
+
/** ErrorState variant: "offline" or "server". */
|
|
56
|
+
errorKind: string;
|
|
57
|
+
programId: string;
|
|
58
|
+
name: string;
|
|
59
|
+
image: string;
|
|
60
|
+
initial: string;
|
|
61
|
+
hasImage: boolean;
|
|
62
|
+
noImage: boolean;
|
|
63
|
+
/** "Joined", "Program complete", "Program ended" — the member's standing as one chip. */
|
|
64
|
+
standingLine: string;
|
|
65
|
+
noStanding: boolean;
|
|
66
|
+
description: string;
|
|
67
|
+
descriptionJson: string;
|
|
68
|
+
hasDescriptionJson: boolean;
|
|
69
|
+
tab: Tab;
|
|
70
|
+
/** The Content tab's rows; empty while the Overview tab is shown, so the list builds nothing. */
|
|
71
|
+
contentRows: ContentRow[];
|
|
72
|
+
progress: number;
|
|
73
|
+
progressLabel: string;
|
|
74
|
+
hideProgress: boolean;
|
|
75
|
+
nextStepId: string;
|
|
76
|
+
nextStepTitle: string;
|
|
77
|
+
nextStepSection: string;
|
|
78
|
+
hideNextStep: boolean;
|
|
79
|
+
/** "You completed every step." / "Your next section opens …" — shown instead of a next step. */
|
|
80
|
+
nextLine: string;
|
|
81
|
+
/** Why a member who is not in the program sees no content. */
|
|
82
|
+
gateText: string;
|
|
83
|
+
isLoading: boolean;
|
|
84
|
+
notLoading: boolean;
|
|
85
|
+
hideError: boolean;
|
|
86
|
+
needsSignIn: boolean;
|
|
87
|
+
noSignIn: boolean;
|
|
88
|
+
hideNotJoined: boolean;
|
|
89
|
+
/** Hides the page body (header, tabs) while loading, on an error, and for a non-participant. */
|
|
90
|
+
hideBody: boolean;
|
|
91
|
+
hideOverview: boolean;
|
|
92
|
+
hideContentEmpty: boolean;
|
|
93
|
+
/** The Content tab's line when it has no rows: no steps yet, or steps the site will not show this member. */
|
|
94
|
+
contentEmptyText: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let rows: ContentRow[] = [];
|
|
98
|
+
/** The member the page on screen was built for: a failed refresh keeps the page only for them. */
|
|
99
|
+
let shownFor: MemberAccess | undefined;
|
|
100
|
+
let access: Access = "member";
|
|
101
|
+
let stepScreen = "";
|
|
102
|
+
let loadSeq = 0;
|
|
103
|
+
|
|
104
|
+
function inputId(): string {
|
|
105
|
+
const input = (globalThis as { himalaya?: { input?: { id?: unknown } } }).himalaya?.input;
|
|
106
|
+
return typeof input?.id === "string" ? input.id : "";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function derive(state: State): State {
|
|
110
|
+
const ready = state.status === "ready";
|
|
111
|
+
const member = ready && access === "member";
|
|
112
|
+
const content = state.tab === "content";
|
|
113
|
+
return {
|
|
114
|
+
...state,
|
|
115
|
+
hasImage: !!state.image,
|
|
116
|
+
noImage: !state.image,
|
|
117
|
+
hasDescriptionJson: state.descriptionJson !== "",
|
|
118
|
+
noStanding: state.standingLine === "",
|
|
119
|
+
contentRows: member && content ? rows : [],
|
|
120
|
+
isLoading: state.status === "loading",
|
|
121
|
+
notLoading: state.status !== "loading",
|
|
122
|
+
hideError: state.status !== "error",
|
|
123
|
+
needsSignIn: ready && access === "signIn",
|
|
124
|
+
noSignIn: !(ready && access === "signIn"),
|
|
125
|
+
hideNotJoined: !(ready && access === "notJoined"),
|
|
126
|
+
hideBody: !member,
|
|
127
|
+
hideOverview: !member || content,
|
|
128
|
+
hideProgress: !member || state.progressLabel === "",
|
|
129
|
+
hideNextStep: !member || !state.nextStepId,
|
|
130
|
+
hideContentEmpty: !member || !content || rows.length > 0,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const INITIAL_STATE: State = derive({
|
|
135
|
+
status: "loading", errorKind: "server", programId: "", name: "", image: "", initial: "", hasImage: false, noImage: true,
|
|
136
|
+
standingLine: "", noStanding: true, description: "", descriptionJson: "", hasDescriptionJson: false, tab: "overview", contentRows: [],
|
|
137
|
+
progress: 0, progressLabel: "", hideProgress: true, nextStepId: "", nextStepTitle: "", nextStepSection: "", hideNextStep: true,
|
|
138
|
+
nextLine: "", gateText: "", contentEmptyText: "", isLoading: true, notLoading: false, hideError: true, needsSignIn: false, noSignIn: true,
|
|
139
|
+
hideNotJoined: true, hideBody: true, hideOverview: true, hideContentEmpty: true,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
/** getProgram first; the programs query is the fallback when the GET path fails (as on himi_program). */
|
|
143
|
+
async function fetchProgram(id: string): Promise<WixProgram | undefined> {
|
|
144
|
+
try {
|
|
145
|
+
return (await getProgram(id)).program;
|
|
146
|
+
} catch {
|
|
147
|
+
const response = await queryPrograms({ cursorPaging: { limit: 50 } });
|
|
148
|
+
return (response.programs ?? []).find((candidate) => candidate.id === id);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function allSteps(programId: string): Promise<WixStep[]> {
|
|
153
|
+
const steps: WixStep[] = [];
|
|
154
|
+
let cursor: string | undefined;
|
|
155
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
156
|
+
const response = await queryParticipantSteps(programId, { limit: PAGE_LIMIT, cursor });
|
|
157
|
+
// The filter is the program, but a member's read has ignored a filter before: keep only this program's steps.
|
|
158
|
+
steps.push(...(response.steps ?? []).filter((step) => !step.programId || step.programId === programId));
|
|
159
|
+
const next = response.pagingMetadata?.cursors?.next ?? "";
|
|
160
|
+
if (!response.pagingMetadata?.hasNext || !next || next === cursor) break;
|
|
161
|
+
cursor = next;
|
|
162
|
+
}
|
|
163
|
+
return steps;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async function allResolved(participantId: string): Promise<WixResolvedStep[]> {
|
|
167
|
+
const resolved: WixResolvedStep[] = [];
|
|
168
|
+
let cursor: string | undefined;
|
|
169
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
170
|
+
const response = await queryResolvedSteps(participantId, { limit: PAGE_LIMIT, cursor });
|
|
171
|
+
resolved.push(...(response.resolvedSteps ?? []).filter((step) => !step.participantId || step.participantId === participantId));
|
|
172
|
+
const next = response.pagingMetadata?.cursors?.next ?? "";
|
|
173
|
+
if (!response.pagingMetadata?.hasNext || !next || next === cursor) break;
|
|
174
|
+
cursor = next;
|
|
175
|
+
}
|
|
176
|
+
return resolved;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function gateTextOf(standing: Standing, participant: WixParticipant | undefined): string {
|
|
180
|
+
const paused = standing === "suspended" || String(participant?.enrollmentStatus ?? "").toUpperCase() === "SUSPENDED";
|
|
181
|
+
return paused
|
|
182
|
+
? copyParam("programParticipant.pausedText", "Your participation in this program is paused.")
|
|
183
|
+
: copyParam("programParticipant.notJoinedText", "You're not in this program yet. Open the program to join it.");
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** The site refused this member the read (as opposed to failing it). */
|
|
187
|
+
function isRefused(error: unknown): boolean {
|
|
188
|
+
const status = (error as { status?: unknown } | null)?.status;
|
|
189
|
+
return status === 403 || /\bHTTP\s*403\b|PERMISSION_DENIED/i.test(String(error));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const sameMember = (a: MemberAccess | undefined, b: MemberAccess | undefined): boolean =>
|
|
193
|
+
!!a && !!b && a.email === b.email && a.scope === b.scope;
|
|
194
|
+
|
|
195
|
+
async function load(state: State, arg?: unknown): Promise<undefined> {
|
|
196
|
+
stashCopy(arg);
|
|
197
|
+
const asked = (arg as { stepScreen?: unknown } | undefined)?.stepScreen;
|
|
198
|
+
if (typeof asked === "string") stepScreen = asked;
|
|
199
|
+
const id = inputId();
|
|
200
|
+
const seq = ++loadSeq;
|
|
201
|
+
const current = () => seq === loadSeq && inputId() === id;
|
|
202
|
+
// A refresh keeps what the member already sees; only a first load paints the skeleton. Another
|
|
203
|
+
// program starts on its Overview; the same one keeps the tab the member left it on. Decided here,
|
|
204
|
+
// before any await: the publishes below land later than a synchronous failure.
|
|
205
|
+
const pageOnScreen = state.status === "ready" && state.programId === id;
|
|
206
|
+
if (state.programId !== id) void svc.publish({ status: "loading", tab: "overview" });
|
|
207
|
+
else if (state.status !== "ready") void svc.publish({ status: "loading" });
|
|
208
|
+
let member: MemberAccess | undefined;
|
|
209
|
+
try {
|
|
210
|
+
if (!id) throw new Error("Program id missing");
|
|
211
|
+
const [found, identity, locale] = await Promise.all([
|
|
212
|
+
fetchProgram(id).then((program) => ({ program }), (error: unknown) => ({ error })),
|
|
213
|
+
memberAccess(),
|
|
214
|
+
i18n.locale().catch(() => "en"),
|
|
215
|
+
]);
|
|
216
|
+
member = identity;
|
|
217
|
+
if (!current()) return undefined;
|
|
218
|
+
// A visitor is asked to sign in whatever Wix answered the anonymous program read (401, 403, a failure).
|
|
219
|
+
if (!member.email) {
|
|
220
|
+
access = "signIn";
|
|
221
|
+
rows = [];
|
|
222
|
+
shownFor = member;
|
|
223
|
+
void svc.publish({ programId: id, status: "ready" });
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
if ("error" in found) throw found.error;
|
|
227
|
+
const program = found.program;
|
|
228
|
+
if (!program) throw new Error("Program unavailable");
|
|
229
|
+
const name = programName(program) || copyParam("program.programFallbackName", "Program");
|
|
230
|
+
const image = programImage(program, WIX_DETAIL_IMAGE);
|
|
231
|
+
const body = descriptionBody(programDescription(program), copyParam("program.descriptionFallback", "Follow this program at your own pace."));
|
|
232
|
+
const header = { programId: id, name, image, initial: initials(name), description: body.bodyText, descriptionJson: body.bodyJson };
|
|
233
|
+
const memberId = (await getMyMember()).member?.id;
|
|
234
|
+
if (!memberId) throw new Error("Current member unavailable");
|
|
235
|
+
const participation = await searchMemberParticipation(id, memberId);
|
|
236
|
+
await assertMemberAccess(member);
|
|
237
|
+
if (!current()) return undefined;
|
|
238
|
+
const scoped = (participation.participants ?? []).filter((row) => row.memberId === memberId && row.programId === id);
|
|
239
|
+
const participant: WixParticipant | undefined = participationsByProgram(scoped).get(id);
|
|
240
|
+
const standing = standingOf(isProgramEnded(program), participant, undefined);
|
|
241
|
+
if (!participant || !inProgram(standing, participant)) {
|
|
242
|
+
access = "notJoined";
|
|
243
|
+
rows = [];
|
|
244
|
+
shownFor = member;
|
|
245
|
+
void svc.publish({ ...header, status: "ready", gateText: gateTextOf(standing, participant) });
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
// The lock lists only the app identity for sections and steps, so a real site may refuse a member
|
|
249
|
+
// (403). Then the page still shows the participation's own progress and says the steps are not available.
|
|
250
|
+
// A refused read is `undefined` and the model decides what the member sees; any other failure (a 500,
|
|
251
|
+
// offline) is the error page with Retry, whichever read answered first.
|
|
252
|
+
const refusedAs = (error: unknown): undefined => {
|
|
253
|
+
if (isRefused(error)) return undefined;
|
|
254
|
+
throw error;
|
|
255
|
+
};
|
|
256
|
+
const [sections, steps, resolved] = await Promise.all([
|
|
257
|
+
listSections(id).then((response) => response.sections ?? []).catch(refusedAs),
|
|
258
|
+
allSteps(id).catch(refusedAs),
|
|
259
|
+
allResolved(participant.id).catch(refusedAs),
|
|
260
|
+
]);
|
|
261
|
+
await assertMemberAccess(member);
|
|
262
|
+
if (!current()) return undefined;
|
|
263
|
+
const model = buildContent({ sections, steps, resolved, participant, now: Date.now(), locale });
|
|
264
|
+
access = "member";
|
|
265
|
+
rows = model.rows;
|
|
266
|
+
shownFor = member;
|
|
267
|
+
const status = STATUS[standing as Exclude<Standing, "none">];
|
|
268
|
+
void svc.publish({
|
|
269
|
+
...header,
|
|
270
|
+
status: "ready",
|
|
271
|
+
standingLine: status ? copyParam(status.key, status.fallback) : "",
|
|
272
|
+
progress: model.progress,
|
|
273
|
+
progressLabel: model.progressLabel,
|
|
274
|
+
nextStepId: model.next?.id ?? "",
|
|
275
|
+
nextStepTitle: model.next?.title ?? "",
|
|
276
|
+
nextStepSection: model.next?.sectionTitle ?? "",
|
|
277
|
+
nextLine: model.allDone ? copyParam("programParticipant.allDone", "You completed every step.") : model.nextOpensLine,
|
|
278
|
+
gateText: "",
|
|
279
|
+
contentEmptyText: model.contentAvailable
|
|
280
|
+
? copyParam("programParticipant.contentEmpty", "This program has no steps yet.")
|
|
281
|
+
: copyParam("programParticipant.contentUnavailable", "This program's steps can't be shown in the app right now."),
|
|
282
|
+
});
|
|
283
|
+
} catch (error) {
|
|
284
|
+
if (!current()) return undefined;
|
|
285
|
+
// Another member (or a signed-out one) never keeps the previous member's progress: start over for them.
|
|
286
|
+
const changed = await memberChanged(member, error);
|
|
287
|
+
// A newer load may have finished while the member was checked: it owns the page either way.
|
|
288
|
+
if (!current()) return undefined;
|
|
289
|
+
if (changed) {
|
|
290
|
+
rows = [];
|
|
291
|
+
access = "member";
|
|
292
|
+
shownFor = undefined;
|
|
293
|
+
void svc.publish({ status: "loading", programId: "", standingLine: "", progress: 0, progressLabel: "", nextStepId: "", nextStepTitle: "", nextStepSection: "", nextLine: "" });
|
|
294
|
+
void svc.load();
|
|
295
|
+
return undefined;
|
|
296
|
+
}
|
|
297
|
+
// A failed refresh keeps the page the member already sees, and only for the member it was built for.
|
|
298
|
+
if (pageOnScreen && sameMember(member, shownFor)) return undefined;
|
|
299
|
+
void svc.publish({ status: "error", errorKind: connectivity().online ? "server" : "offline" });
|
|
300
|
+
}
|
|
301
|
+
return undefined;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
type Actions = {
|
|
305
|
+
load: (state: State, arg?: unknown) => Promise<undefined>;
|
|
306
|
+
refresh: (state: State) => Promise<undefined>;
|
|
307
|
+
publish: (state: State, patch: Partial<State>) => State;
|
|
308
|
+
selectTab: (state: State, arg?: unknown) => State;
|
|
309
|
+
openStep: (state: State) => State;
|
|
310
|
+
openLink: (state: State, arg?: unknown) => Promise<undefined>;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const svc = defineService<State, Actions>(SERVICE, {
|
|
314
|
+
state: INITIAL_STATE,
|
|
315
|
+
// Nothing is written to the on-device snapshot: every field is this member's progress or derives from
|
|
316
|
+
// it, and a restored half (flags without rows) would paint a blank page. A cold start loads.
|
|
317
|
+
notPersisted: Object.keys(INITIAL_STATE) as (keyof State & string)[],
|
|
318
|
+
actions: {
|
|
319
|
+
load,
|
|
320
|
+
refresh: (state) => load(state),
|
|
321
|
+
publish: (state, patch) => derive({ ...state, ...patch }),
|
|
322
|
+
selectTab: (state, arg) => {
|
|
323
|
+
const picked = (arg as { selectedId?: unknown } | undefined)?.selectedId;
|
|
324
|
+
return picked === "overview" || picked === "content" ? derive({ ...state, tab: picked }) : state;
|
|
325
|
+
},
|
|
326
|
+
openStep: (state) => {
|
|
327
|
+
if (!state.nextStepId) return state;
|
|
328
|
+
if (stepScreen) return navigate(state, { screenId: stepScreen, args: { id: state.programId, stepId: state.nextStepId } });
|
|
329
|
+
return derive({ ...state, tab: "content" });
|
|
330
|
+
},
|
|
331
|
+
openLink: async (_state, arg) => { await openRichLink(arg); return undefined; },
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
svc.load();
|
|
336
|
+
export { svc };
|