@wix/himalaya-cli 0.1761.0 → 0.1763.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +10 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +23 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +136 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +112 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{7c3c05d452efd3f1e1e81b47dde7d9fa870c1e5217b00b253661a22b571fdbef.bin → a96903bb457796ee606fe986078d9629ba53b5ba4013bdb94e8afba3288284ed.bin} +1 -1
- package/dist/browser-plane/sw.js +7 -7
- package/dist/cli.mjs +51413 -50002
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/base44-app-to-himi-app.md +56 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +10 -0
- package/guides/himi-json-output.md +35 -0
- package/guides/one-app-section-mappings.md +6 -6
- package/guides/one-app-to-himi-app.md +33 -4
- package/guides/push-cli-onboarding.md +25 -14
- package/guides/recipe-dynamic-list.md +4 -2
- package/guides/wix-business-context.md +1 -1
- package/package.json +2 -2
- package/templates/beauty-salon/l10n/ar.json +9 -420
- package/templates/beauty-salon/l10n/cs.json +9 -420
- package/templates/beauty-salon/l10n/da.json +9 -420
- package/templates/beauty-salon/l10n/de.json +9 -420
- package/templates/beauty-salon/l10n/el.json +9 -420
- package/templates/beauty-salon/l10n/en.json +8 -61
- package/templates/beauty-salon/l10n/es.json +9 -420
- package/templates/beauty-salon/l10n/fi.json +9 -420
- package/templates/beauty-salon/l10n/fr.json +9 -420
- package/templates/beauty-salon/l10n/he.json +9 -338
- package/templates/beauty-salon/l10n/hu.json +9 -420
- package/templates/beauty-salon/l10n/id.json +9 -420
- package/templates/beauty-salon/l10n/it.json +9 -420
- package/templates/beauty-salon/l10n/ja.json +9 -420
- package/templates/beauty-salon/l10n/ko.json +9 -420
- package/templates/beauty-salon/l10n/lt.json +9 -420
- package/templates/beauty-salon/l10n/nl.json +9 -420
- package/templates/beauty-salon/l10n/no.json +9 -420
- package/templates/beauty-salon/l10n/pl.json +9 -420
- package/templates/beauty-salon/l10n/pt.json +9 -420
- package/templates/beauty-salon/l10n/ru.json +9 -420
- package/templates/beauty-salon/l10n/sv.json +9 -420
- package/templates/beauty-salon/l10n/th.json +9 -420
- package/templates/beauty-salon/l10n/tr.json +9 -420
- package/templates/beauty-salon/l10n/uk.json +9 -420
- package/templates/beauty-salon/l10n/vi.json +9 -420
- package/templates/beauty-salon/l10n/zh.json +9 -420
- package/templates/branded-lite/l10n/ar.json +31 -5
- package/templates/branded-lite/l10n/cs.json +31 -5
- package/templates/branded-lite/l10n/da.json +31 -5
- package/templates/branded-lite/l10n/de.json +31 -5
- package/templates/branded-lite/l10n/el.json +31 -5
- package/templates/branded-lite/l10n/en.json +8 -6
- package/templates/branded-lite/l10n/es.json +31 -5
- package/templates/branded-lite/l10n/fi.json +31 -5
- package/templates/branded-lite/l10n/fr.json +31 -5
- package/templates/branded-lite/l10n/he.json +27 -4
- package/templates/branded-lite/l10n/hu.json +31 -5
- package/templates/branded-lite/l10n/id.json +31 -5
- package/templates/branded-lite/l10n/it.json +31 -5
- package/templates/branded-lite/l10n/ja.json +31 -5
- package/templates/branded-lite/l10n/ko.json +31 -5
- package/templates/branded-lite/l10n/lt.json +31 -5
- package/templates/branded-lite/l10n/nl.json +31 -5
- package/templates/branded-lite/l10n/no.json +31 -5
- package/templates/branded-lite/l10n/pl.json +31 -5
- package/templates/branded-lite/l10n/pt.json +31 -5
- package/templates/branded-lite/l10n/ru.json +31 -5
- package/templates/branded-lite/l10n/sv.json +31 -5
- package/templates/branded-lite/l10n/th.json +31 -5
- package/templates/branded-lite/l10n/tr.json +31 -5
- package/templates/branded-lite/l10n/uk.json +31 -5
- package/templates/branded-lite/l10n/vi.json +31 -5
- package/templates/branded-lite/l10n/zh.json +31 -5
- package/templates/branded-lite/recipes/blog-search.json +45 -0
- package/templates/{events-meetups/recipes/programs-participant-carousel.json → branded-lite/recipes/galleries-carousel.json} +39 -118
- package/templates/{gym-fitness/recipes/programs-participant-carousel.json → branded-lite/recipes/galleries-list.json} +43 -121
- package/templates/{community-club/recipes/events-inline-list.json → branded-lite/recipes/group-feed.json} +112 -89
- package/templates/{beauty-salon/recipes/programs-participant-carousel.json → branded-lite/recipes/groups-cards.json} +71 -93
- package/templates/{beauty-salon/recipes/groups-list.json → branded-lite/recipes/services-list.json} +33 -9
- package/templates/{community-club/recipes/groups-list.json → branded-lite/recipes/subscriptions-list.json} +124 -60
- package/templates/branded-lite/recipes/upcoming-bookings.json +350 -0
- package/templates/branded-lite/recipes/videos-carousel.json +248 -0
- package/templates/branded-lite/tier5-src/_shared/blog-list.ts +75 -21
- package/templates/branded-lite/tier5-src/_shared/galleries-section.ts +115 -0
- package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +137 -0
- package/templates/branded-lite/tier5-src/_shared/groups-section.ts +7 -3
- package/templates/branded-lite/tier5-src/_shared/my-subscriptions-section.ts +107 -0
- package/templates/branded-lite/tier5-src/_shared/plans-section.ts +11 -3
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +2 -0
- package/templates/branded-lite/tier5-src/_shared/services-section.ts +122 -0
- package/templates/branded-lite/tier5-src/_shared/upcoming-bookings-section.ts +102 -0
- package/templates/branded-lite/tier5-src/_shared/videos-section.ts +91 -0
- package/templates/brandy/README.md +21 -3
- package/templates/brandy/config.ts +131 -14
- package/templates/brandy/dev/index.ts +41 -5
- package/templates/brandy/dev/member-screens.ts +14412 -0
- package/templates/brandy/provisioning.member.example.json +25 -0
- package/templates/brandy/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/brandy/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/brandy/tier5-src/_shared/chat-live.ts +242 -0
- package/templates/brandy/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/brandy/tier5-src/_shared/collection-query-legacy.ts +194 -0
- package/templates/brandy/tier5-src/_shared/collection-query.ts +252 -0
- package/templates/brandy/tier5-src/_shared/collection-service.ts +423 -0
- package/templates/brandy/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/brandy/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/brandy/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/brandy/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/brandy/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/brandy/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/brandy/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/brandy/tier5-src/_shared/live-session.ts +172 -0
- package/templates/brandy/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/brandy/tier5-src/_shared/member-access.ts +63 -0
- package/templates/brandy/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/brandy/tier5-src/_shared/member-orders.ts +8 -0
- package/templates/brandy/tier5-src/_shared/member-read.ts +82 -0
- package/templates/brandy/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/brandy/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/brandy/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/brandy/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/brandy/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/brandy/tier5-src/_shared/pricing-plan-display.ts +64 -0
- package/templates/brandy/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/brandy/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/brandy/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/brandy/tier5-src/_shared/store-order-presentation.ts +56 -0
- package/templates/brandy/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/brandy/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +92 -0
- package/templates/brandy/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
- package/templates/brandy/tier5-src/himi-branded-lite-order/index.ts +477 -0
- package/templates/brandy/tier5-src/himi-branded-lite-orders/index.ts +327 -0
- package/templates/brandy/tier5-src/himi-store-account/index.ts +1007 -0
- package/templates/brandy/tier5-src/wix-spaces-chat-thread/index.ts +350 -0
- package/templates/brandy/tier5-src/wix-spaces-delete-account/index.ts +59 -0
- package/templates/brandy/tier5-src/wix-spaces-my-subscriptions/index.ts +89 -0
- package/templates/brandy/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
- package/templates/brandy/tokens.json +25 -0
- package/templates/community-club/l10n/ar.json +0 -412
- package/templates/community-club/l10n/cs.json +0 -412
- package/templates/community-club/l10n/da.json +0 -412
- package/templates/community-club/l10n/de.json +0 -412
- package/templates/community-club/l10n/el.json +0 -412
- package/templates/community-club/l10n/en.json +1 -46
- package/templates/community-club/l10n/es.json +0 -412
- package/templates/community-club/l10n/fi.json +0 -412
- package/templates/community-club/l10n/fr.json +0 -412
- package/templates/community-club/l10n/he.json +0 -331
- package/templates/community-club/l10n/hu.json +0 -412
- package/templates/community-club/l10n/id.json +0 -412
- package/templates/community-club/l10n/it.json +0 -412
- package/templates/community-club/l10n/ja.json +0 -412
- package/templates/community-club/l10n/ko.json +0 -412
- package/templates/community-club/l10n/lt.json +0 -412
- package/templates/community-club/l10n/nl.json +0 -412
- package/templates/community-club/l10n/no.json +0 -412
- package/templates/community-club/l10n/pl.json +0 -412
- package/templates/community-club/l10n/pt.json +0 -412
- package/templates/community-club/l10n/ru.json +0 -412
- package/templates/community-club/l10n/sv.json +0 -412
- package/templates/community-club/l10n/th.json +0 -412
- package/templates/community-club/l10n/tr.json +0 -412
- package/templates/community-club/l10n/uk.json +0 -412
- package/templates/community-club/l10n/vi.json +0 -412
- package/templates/community-club/l10n/zh.json +0 -412
- package/templates/events-meetups/l10n/ar.json +0 -412
- package/templates/events-meetups/l10n/cs.json +0 -412
- package/templates/events-meetups/l10n/da.json +0 -412
- package/templates/events-meetups/l10n/de.json +0 -412
- package/templates/events-meetups/l10n/el.json +0 -412
- package/templates/events-meetups/l10n/en.json +1 -46
- package/templates/events-meetups/l10n/es.json +0 -412
- package/templates/events-meetups/l10n/fi.json +0 -412
- package/templates/events-meetups/l10n/fr.json +0 -412
- package/templates/events-meetups/l10n/he.json +0 -331
- package/templates/events-meetups/l10n/hu.json +0 -412
- package/templates/events-meetups/l10n/id.json +0 -412
- package/templates/events-meetups/l10n/it.json +0 -412
- package/templates/events-meetups/l10n/ja.json +0 -412
- package/templates/events-meetups/l10n/ko.json +0 -412
- package/templates/events-meetups/l10n/lt.json +0 -412
- package/templates/events-meetups/l10n/nl.json +0 -412
- package/templates/events-meetups/l10n/no.json +0 -412
- package/templates/events-meetups/l10n/pl.json +0 -412
- package/templates/events-meetups/l10n/pt.json +0 -412
- package/templates/events-meetups/l10n/ru.json +0 -412
- package/templates/events-meetups/l10n/sv.json +0 -412
- package/templates/events-meetups/l10n/th.json +0 -412
- package/templates/events-meetups/l10n/tr.json +0 -412
- package/templates/events-meetups/l10n/uk.json +0 -412
- package/templates/events-meetups/l10n/vi.json +0 -412
- package/templates/events-meetups/l10n/zh.json +0 -412
- package/templates/gym-fitness/l10n/ar.json +9 -405
- package/templates/gym-fitness/l10n/cs.json +9 -405
- package/templates/gym-fitness/l10n/da.json +9 -405
- package/templates/gym-fitness/l10n/de.json +9 -405
- package/templates/gym-fitness/l10n/el.json +9 -405
- package/templates/gym-fitness/l10n/en.json +8 -51
- package/templates/gym-fitness/l10n/es.json +9 -405
- package/templates/gym-fitness/l10n/fi.json +9 -405
- package/templates/gym-fitness/l10n/fr.json +9 -405
- package/templates/gym-fitness/l10n/he.json +9 -326
- package/templates/gym-fitness/l10n/hu.json +9 -405
- package/templates/gym-fitness/l10n/id.json +9 -405
- package/templates/gym-fitness/l10n/it.json +9 -405
- package/templates/gym-fitness/l10n/ja.json +9 -405
- package/templates/gym-fitness/l10n/ko.json +9 -405
- package/templates/gym-fitness/l10n/lt.json +9 -405
- package/templates/gym-fitness/l10n/nl.json +9 -405
- package/templates/gym-fitness/l10n/no.json +9 -405
- package/templates/gym-fitness/l10n/pl.json +9 -405
- package/templates/gym-fitness/l10n/pt.json +9 -405
- package/templates/gym-fitness/l10n/ru.json +9 -405
- package/templates/gym-fitness/l10n/sv.json +9 -405
- package/templates/gym-fitness/l10n/th.json +9 -405
- package/templates/gym-fitness/l10n/tr.json +9 -405
- package/templates/gym-fitness/l10n/uk.json +9 -405
- package/templates/gym-fitness/l10n/vi.json +9 -405
- package/templates/gym-fitness/l10n/zh.json +9 -405
- package/templates/nonprofit-cause/l10n/ar.json +0 -387
- package/templates/nonprofit-cause/l10n/cs.json +0 -387
- package/templates/nonprofit-cause/l10n/da.json +0 -387
- package/templates/nonprofit-cause/l10n/de.json +0 -387
- package/templates/nonprofit-cause/l10n/el.json +0 -387
- package/templates/nonprofit-cause/l10n/en.json +1 -46
- package/templates/nonprofit-cause/l10n/es.json +0 -387
- package/templates/nonprofit-cause/l10n/fi.json +0 -387
- package/templates/nonprofit-cause/l10n/fr.json +0 -387
- package/templates/nonprofit-cause/l10n/he.json +0 -311
- package/templates/nonprofit-cause/l10n/hu.json +0 -387
- package/templates/nonprofit-cause/l10n/id.json +0 -387
- package/templates/nonprofit-cause/l10n/it.json +0 -387
- package/templates/nonprofit-cause/l10n/ja.json +0 -387
- package/templates/nonprofit-cause/l10n/ko.json +0 -387
- package/templates/nonprofit-cause/l10n/lt.json +0 -387
- package/templates/nonprofit-cause/l10n/nl.json +0 -387
- package/templates/nonprofit-cause/l10n/no.json +0 -387
- package/templates/nonprofit-cause/l10n/pl.json +0 -387
- package/templates/nonprofit-cause/l10n/pt.json +0 -387
- package/templates/nonprofit-cause/l10n/ru.json +0 -387
- package/templates/nonprofit-cause/l10n/sv.json +0 -387
- package/templates/nonprofit-cause/l10n/th.json +0 -387
- package/templates/nonprofit-cause/l10n/tr.json +0 -387
- package/templates/nonprofit-cause/l10n/uk.json +0 -387
- package/templates/nonprofit-cause/l10n/vi.json +0 -387
- package/templates/nonprofit-cause/l10n/zh.json +0 -387
- package/templates/podcast-creator/l10n/ar.json +0 -417
- package/templates/podcast-creator/l10n/cs.json +0 -417
- package/templates/podcast-creator/l10n/da.json +0 -417
- package/templates/podcast-creator/l10n/de.json +0 -417
- package/templates/podcast-creator/l10n/el.json +0 -417
- package/templates/podcast-creator/l10n/en.json +1 -46
- package/templates/podcast-creator/l10n/es.json +0 -417
- package/templates/podcast-creator/l10n/fi.json +0 -417
- package/templates/podcast-creator/l10n/fr.json +0 -417
- package/templates/podcast-creator/l10n/he.json +0 -335
- package/templates/podcast-creator/l10n/hu.json +0 -417
- package/templates/podcast-creator/l10n/id.json +0 -417
- package/templates/podcast-creator/l10n/it.json +0 -417
- package/templates/podcast-creator/l10n/ja.json +0 -417
- package/templates/podcast-creator/l10n/ko.json +0 -417
- package/templates/podcast-creator/l10n/lt.json +0 -417
- package/templates/podcast-creator/l10n/nl.json +0 -417
- package/templates/podcast-creator/l10n/no.json +0 -417
- package/templates/podcast-creator/l10n/pl.json +0 -417
- package/templates/podcast-creator/l10n/pt.json +0 -417
- package/templates/podcast-creator/l10n/ru.json +0 -417
- package/templates/podcast-creator/l10n/sv.json +0 -417
- package/templates/podcast-creator/l10n/th.json +0 -417
- package/templates/podcast-creator/l10n/tr.json +0 -417
- package/templates/podcast-creator/l10n/uk.json +0 -417
- package/templates/podcast-creator/l10n/vi.json +0 -417
- package/templates/podcast-creator/l10n/zh.json +0 -417
- package/templates/portfolio-creative/l10n/ar.json +0 -437
- package/templates/portfolio-creative/l10n/cs.json +0 -437
- package/templates/portfolio-creative/l10n/da.json +0 -437
- package/templates/portfolio-creative/l10n/de.json +0 -437
- package/templates/portfolio-creative/l10n/el.json +0 -437
- package/templates/portfolio-creative/l10n/en.json +1 -46
- package/templates/portfolio-creative/l10n/es.json +0 -437
- package/templates/portfolio-creative/l10n/fi.json +0 -437
- package/templates/portfolio-creative/l10n/fr.json +0 -437
- package/templates/portfolio-creative/l10n/he.json +0 -351
- package/templates/portfolio-creative/l10n/hu.json +0 -437
- package/templates/portfolio-creative/l10n/id.json +0 -437
- package/templates/portfolio-creative/l10n/it.json +0 -437
- package/templates/portfolio-creative/l10n/ja.json +0 -437
- package/templates/portfolio-creative/l10n/ko.json +0 -437
- package/templates/portfolio-creative/l10n/lt.json +0 -437
- package/templates/portfolio-creative/l10n/nl.json +0 -437
- package/templates/portfolio-creative/l10n/no.json +0 -437
- package/templates/portfolio-creative/l10n/pl.json +0 -437
- package/templates/portfolio-creative/l10n/pt.json +0 -437
- package/templates/portfolio-creative/l10n/ru.json +0 -437
- package/templates/portfolio-creative/l10n/sv.json +0 -437
- package/templates/portfolio-creative/l10n/th.json +0 -437
- package/templates/portfolio-creative/l10n/tr.json +0 -437
- package/templates/portfolio-creative/l10n/uk.json +0 -437
- package/templates/portfolio-creative/l10n/vi.json +0 -437
- package/templates/portfolio-creative/l10n/zh.json +0 -437
- package/templates/restaurant/l10n/ar.json +0 -447
- package/templates/restaurant/l10n/cs.json +0 -447
- package/templates/restaurant/l10n/da.json +0 -447
- package/templates/restaurant/l10n/de.json +0 -447
- package/templates/restaurant/l10n/el.json +0 -447
- package/templates/restaurant/l10n/en.json +1 -46
- package/templates/restaurant/l10n/es.json +0 -447
- package/templates/restaurant/l10n/fi.json +0 -447
- package/templates/restaurant/l10n/fr.json +0 -447
- package/templates/restaurant/l10n/he.json +0 -359
- package/templates/restaurant/l10n/hu.json +0 -447
- package/templates/restaurant/l10n/id.json +0 -447
- package/templates/restaurant/l10n/it.json +0 -447
- package/templates/restaurant/l10n/ja.json +0 -447
- package/templates/restaurant/l10n/ko.json +0 -447
- package/templates/restaurant/l10n/lt.json +0 -447
- package/templates/restaurant/l10n/nl.json +0 -447
- package/templates/restaurant/l10n/no.json +0 -447
- package/templates/restaurant/l10n/pl.json +0 -447
- package/templates/restaurant/l10n/pt.json +0 -447
- package/templates/restaurant/l10n/ru.json +0 -447
- package/templates/restaurant/l10n/sv.json +0 -447
- package/templates/restaurant/l10n/th.json +0 -447
- package/templates/restaurant/l10n/tr.json +0 -447
- package/templates/restaurant/l10n/uk.json +0 -447
- package/templates/restaurant/l10n/vi.json +0 -447
- package/templates/restaurant/l10n/zh.json +0 -447
- package/templates/retail-store/l10n/ar.json +0 -462
- package/templates/retail-store/l10n/cs.json +0 -462
- package/templates/retail-store/l10n/da.json +0 -462
- package/templates/retail-store/l10n/de.json +0 -462
- package/templates/retail-store/l10n/el.json +0 -462
- package/templates/retail-store/l10n/en.json +1 -61
- package/templates/retail-store/l10n/es.json +0 -462
- package/templates/retail-store/l10n/fi.json +0 -462
- package/templates/retail-store/l10n/fr.json +0 -462
- package/templates/retail-store/l10n/he.json +0 -371
- package/templates/retail-store/l10n/hu.json +0 -462
- package/templates/retail-store/l10n/id.json +0 -462
- package/templates/retail-store/l10n/it.json +0 -462
- package/templates/retail-store/l10n/ja.json +0 -462
- package/templates/retail-store/l10n/ko.json +0 -462
- package/templates/retail-store/l10n/lt.json +0 -462
- package/templates/retail-store/l10n/nl.json +0 -462
- package/templates/retail-store/l10n/no.json +0 -462
- package/templates/retail-store/l10n/pl.json +0 -462
- package/templates/retail-store/l10n/pt.json +0 -462
- package/templates/retail-store/l10n/ru.json +0 -462
- package/templates/retail-store/l10n/sv.json +0 -462
- package/templates/retail-store/l10n/th.json +0 -462
- package/templates/retail-store/l10n/tr.json +0 -462
- package/templates/retail-store/l10n/uk.json +0 -462
- package/templates/retail-store/l10n/vi.json +0 -462
- package/templates/retail-store/l10n/zh.json +0 -462
- package/templates/yoga-studio/l10n/ar.json +9 -197
- package/templates/yoga-studio/l10n/cs.json +9 -197
- package/templates/yoga-studio/l10n/da.json +9 -197
- package/templates/yoga-studio/l10n/de.json +9 -197
- package/templates/yoga-studio/l10n/el.json +9 -197
- package/templates/yoga-studio/l10n/en.json +8 -30
- package/templates/yoga-studio/l10n/es.json +9 -197
- package/templates/yoga-studio/l10n/fi.json +9 -197
- package/templates/yoga-studio/l10n/fr.json +9 -197
- package/templates/yoga-studio/l10n/he.json +9 -159
- package/templates/yoga-studio/l10n/hu.json +9 -197
- package/templates/yoga-studio/l10n/id.json +9 -197
- package/templates/yoga-studio/l10n/it.json +9 -197
- package/templates/yoga-studio/l10n/ja.json +9 -197
- package/templates/yoga-studio/l10n/ko.json +9 -197
- package/templates/yoga-studio/l10n/lt.json +9 -197
- package/templates/yoga-studio/l10n/nl.json +9 -197
- package/templates/yoga-studio/l10n/no.json +9 -197
- package/templates/yoga-studio/l10n/pl.json +9 -197
- package/templates/yoga-studio/l10n/pt.json +9 -197
- package/templates/yoga-studio/l10n/ru.json +9 -197
- package/templates/yoga-studio/l10n/sv.json +9 -197
- package/templates/yoga-studio/l10n/th.json +9 -197
- package/templates/yoga-studio/l10n/tr.json +9 -197
- package/templates/yoga-studio/l10n/uk.json +9 -197
- package/templates/yoga-studio/l10n/vi.json +9 -197
- package/templates/yoga-studio/l10n/zh.json +9 -197
- package/templates/beauty-salon/recipes/announcement-card.json +0 -72
- package/templates/beauty-salon/recipes/blog-hero.json +0 -95
- package/templates/beauty-salon/recipes/blog-list-thumb-start.json +0 -394
- package/templates/beauty-salon/recipes/blog-list.json +0 -394
- package/templates/beauty-salon/recipes/blog-see-all.json +0 -50
- package/templates/beauty-salon/recipes/events-inline-list.json +0 -228
- package/templates/beauty-salon/recipes/events-inline.json +0 -309
- package/templates/beauty-salon/recipes/faq-list.json +0 -503
- package/templates/beauty-salon/recipes/members-list.json +0 -445
- package/templates/beauty-salon/recipes/plans-card.json +0 -811
- package/templates/beauty-salon/recipes/products-carousel.json +0 -141
- package/templates/beauty-salon/recipes/products-grid.json +0 -143
- package/templates/beauty-salon/recipes/programs-card.json +0 -254
- package/templates/beauty-salon/recipes/programs-carousel.json +0 -234
- package/templates/beauty-salon/recipes/programs-filters.json +0 -94
- package/templates/beauty-salon/recipes/programs-see-all.json +0 -43
- package/templates/beauty-salon/recipes/section-error.json +0 -58
- package/templates/beauty-salon/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/beauty-salon/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/beauty-salon/tier5-src/_shared/event-registration.ts +0 -86
- package/templates/beauty-salon/tier5-src/_shared/events-card.ts +0 -33
- package/templates/beauty-salon/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/beauty-salon/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/beauty-salon/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/beauty-salon/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/beauty-salon/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/beauty-salon/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/beauty-salon/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/beauty-salon/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/beauty-salon/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/beauty-salon/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/beauty-salon/tier5-src/_shared/products-section.ts +0 -76
- package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/beauty-salon/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/community-club/recipes/announcement-card.json +0 -72
- package/templates/community-club/recipes/blog-hero.json +0 -95
- package/templates/community-club/recipes/blog-list-thumb-start.json +0 -394
- package/templates/community-club/recipes/blog-list.json +0 -394
- package/templates/community-club/recipes/blog-see-all.json +0 -50
- package/templates/community-club/recipes/events-inline.json +0 -309
- package/templates/community-club/recipes/faq-list.json +0 -503
- package/templates/community-club/recipes/members-list.json +0 -445
- package/templates/community-club/recipes/plans-card.json +0 -811
- package/templates/community-club/recipes/products-carousel.json +0 -141
- package/templates/community-club/recipes/products-grid.json +0 -143
- package/templates/community-club/recipes/programs-card.json +0 -254
- package/templates/community-club/recipes/programs-carousel.json +0 -234
- package/templates/community-club/recipes/programs-filters.json +0 -94
- package/templates/community-club/recipes/programs-participant-carousel.json +0 -257
- package/templates/community-club/recipes/programs-see-all.json +0 -43
- package/templates/community-club/recipes/section-error.json +0 -58
- package/templates/community-club/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/community-club/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/community-club/tier5-src/_shared/events-card.ts +0 -33
- package/templates/community-club/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/community-club/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/community-club/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/community-club/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/community-club/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/community-club/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/community-club/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/community-club/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/community-club/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/community-club/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/community-club/tier5-src/_shared/products-section.ts +0 -76
- package/templates/community-club/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/community-club/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/community-club/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/events-meetups/recipes/announcement-card.json +0 -72
- package/templates/events-meetups/recipes/blog-hero.json +0 -95
- package/templates/events-meetups/recipes/blog-list-thumb-start.json +0 -394
- package/templates/events-meetups/recipes/blog-list.json +0 -394
- package/templates/events-meetups/recipes/blog-see-all.json +0 -50
- package/templates/events-meetups/recipes/events-inline-list.json +0 -228
- package/templates/events-meetups/recipes/events-inline.json +0 -309
- package/templates/events-meetups/recipes/faq-list.json +0 -503
- package/templates/events-meetups/recipes/groups-list.json +0 -196
- package/templates/events-meetups/recipes/members-list.json +0 -445
- package/templates/events-meetups/recipes/plans-card.json +0 -811
- package/templates/events-meetups/recipes/products-carousel.json +0 -141
- package/templates/events-meetups/recipes/products-grid.json +0 -143
- package/templates/events-meetups/recipes/programs-card.json +0 -254
- package/templates/events-meetups/recipes/programs-carousel.json +0 -234
- package/templates/events-meetups/recipes/programs-filters.json +0 -94
- package/templates/events-meetups/recipes/programs-see-all.json +0 -43
- package/templates/events-meetups/recipes/section-error.json +0 -58
- package/templates/events-meetups/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/events-meetups/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/events-meetups/tier5-src/_shared/detail-presence.ts +0 -51
- package/templates/events-meetups/tier5-src/_shared/events-card.ts +0 -33
- package/templates/events-meetups/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/events-meetups/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/events-meetups/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/events-meetups/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/events-meetups/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/events-meetups/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/events-meetups/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/events-meetups/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/events-meetups/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/events-meetups/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/events-meetups/tier5-src/_shared/products-section.ts +0 -76
- package/templates/events-meetups/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/events-meetups/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/gym-fitness/recipes/announcement-card.json +0 -72
- package/templates/gym-fitness/recipes/blog-hero.json +0 -95
- package/templates/gym-fitness/recipes/blog-list-thumb-start.json +0 -394
- package/templates/gym-fitness/recipes/blog-list.json +0 -394
- package/templates/gym-fitness/recipes/blog-see-all.json +0 -50
- package/templates/gym-fitness/recipes/events-inline-list.json +0 -228
- package/templates/gym-fitness/recipes/events-inline.json +0 -309
- package/templates/gym-fitness/recipes/faq-list.json +0 -503
- package/templates/gym-fitness/recipes/groups-list.json +0 -196
- package/templates/gym-fitness/recipes/members-list.json +0 -445
- package/templates/gym-fitness/recipes/plans-card.json +0 -811
- package/templates/gym-fitness/recipes/products-carousel.json +0 -141
- package/templates/gym-fitness/recipes/products-grid.json +0 -143
- package/templates/gym-fitness/recipes/programs-card.json +0 -254
- package/templates/gym-fitness/recipes/programs-carousel.json +0 -234
- package/templates/gym-fitness/recipes/programs-filters.json +0 -94
- package/templates/gym-fitness/recipes/programs-see-all.json +0 -43
- package/templates/gym-fitness/recipes/section-error.json +0 -58
- package/templates/gym-fitness/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/gym-fitness/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/gym-fitness/tier5-src/_shared/events-card.ts +0 -33
- package/templates/gym-fitness/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/gym-fitness/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/gym-fitness/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/gym-fitness/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/gym-fitness/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/gym-fitness/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/gym-fitness/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/gym-fitness/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/gym-fitness/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/gym-fitness/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/gym-fitness/tier5-src/_shared/products-section.ts +0 -76
- package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/gym-fitness/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/nonprofit-cause/recipes/announcement-card.json +0 -72
- package/templates/nonprofit-cause/recipes/blog-hero.json +0 -95
- package/templates/nonprofit-cause/recipes/blog-list-thumb-start.json +0 -394
- package/templates/nonprofit-cause/recipes/blog-list.json +0 -394
- package/templates/nonprofit-cause/recipes/blog-see-all.json +0 -50
- package/templates/nonprofit-cause/recipes/events-inline-list.json +0 -228
- package/templates/nonprofit-cause/recipes/events-inline.json +0 -309
- package/templates/nonprofit-cause/recipes/faq-list.json +0 -503
- package/templates/nonprofit-cause/recipes/groups-list.json +0 -196
- package/templates/nonprofit-cause/recipes/members-list.json +0 -445
- package/templates/nonprofit-cause/recipes/plans-card.json +0 -811
- package/templates/nonprofit-cause/recipes/products-carousel.json +0 -141
- package/templates/nonprofit-cause/recipes/products-grid.json +0 -143
- package/templates/nonprofit-cause/recipes/programs-card.json +0 -254
- package/templates/nonprofit-cause/recipes/programs-carousel.json +0 -234
- package/templates/nonprofit-cause/recipes/programs-filters.json +0 -94
- package/templates/nonprofit-cause/recipes/programs-participant-carousel.json +0 -257
- package/templates/nonprofit-cause/recipes/programs-see-all.json +0 -43
- package/templates/nonprofit-cause/recipes/section-error.json +0 -58
- package/templates/nonprofit-cause/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/nonprofit-cause/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/nonprofit-cause/tier5-src/_shared/events-card.ts +0 -33
- package/templates/nonprofit-cause/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/nonprofit-cause/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/nonprofit-cause/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/nonprofit-cause/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/nonprofit-cause/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/nonprofit-cause/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/nonprofit-cause/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/nonprofit-cause/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/nonprofit-cause/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/nonprofit-cause/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/nonprofit-cause/tier5-src/_shared/products-section.ts +0 -76
- package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/nonprofit-cause/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/podcast-creator/recipes/announcement-card.json +0 -72
- package/templates/podcast-creator/recipes/blog-hero.json +0 -95
- package/templates/podcast-creator/recipes/blog-list-thumb-start.json +0 -394
- package/templates/podcast-creator/recipes/blog-list.json +0 -394
- package/templates/podcast-creator/recipes/blog-see-all.json +0 -50
- package/templates/podcast-creator/recipes/events-inline-list.json +0 -228
- package/templates/podcast-creator/recipes/events-inline.json +0 -309
- package/templates/podcast-creator/recipes/faq-list.json +0 -503
- package/templates/podcast-creator/recipes/groups-list.json +0 -196
- package/templates/podcast-creator/recipes/members-list.json +0 -445
- package/templates/podcast-creator/recipes/plans-card.json +0 -811
- package/templates/podcast-creator/recipes/products-carousel.json +0 -141
- package/templates/podcast-creator/recipes/products-grid.json +0 -143
- package/templates/podcast-creator/recipes/programs-card.json +0 -254
- package/templates/podcast-creator/recipes/programs-carousel.json +0 -234
- package/templates/podcast-creator/recipes/programs-filters.json +0 -94
- package/templates/podcast-creator/recipes/programs-participant-carousel.json +0 -257
- package/templates/podcast-creator/recipes/programs-see-all.json +0 -43
- package/templates/podcast-creator/recipes/section-error.json +0 -58
- package/templates/podcast-creator/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/podcast-creator/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/podcast-creator/tier5-src/_shared/events-card.ts +0 -33
- package/templates/podcast-creator/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/podcast-creator/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/podcast-creator/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/podcast-creator/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/podcast-creator/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/podcast-creator/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/podcast-creator/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/podcast-creator/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/podcast-creator/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/podcast-creator/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/podcast-creator/tier5-src/_shared/products-section.ts +0 -76
- package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/podcast-creator/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/portfolio-creative/recipes/announcement-card.json +0 -72
- package/templates/portfolio-creative/recipes/blog-hero.json +0 -95
- package/templates/portfolio-creative/recipes/blog-list-thumb-start.json +0 -394
- package/templates/portfolio-creative/recipes/blog-list.json +0 -394
- package/templates/portfolio-creative/recipes/blog-see-all.json +0 -50
- package/templates/portfolio-creative/recipes/events-inline-list.json +0 -228
- package/templates/portfolio-creative/recipes/events-inline.json +0 -309
- package/templates/portfolio-creative/recipes/faq-list.json +0 -503
- package/templates/portfolio-creative/recipes/groups-list.json +0 -196
- package/templates/portfolio-creative/recipes/members-list.json +0 -445
- package/templates/portfolio-creative/recipes/plans-card.json +0 -811
- package/templates/portfolio-creative/recipes/products-carousel.json +0 -141
- package/templates/portfolio-creative/recipes/products-grid.json +0 -143
- package/templates/portfolio-creative/recipes/programs-card.json +0 -254
- package/templates/portfolio-creative/recipes/programs-carousel.json +0 -234
- package/templates/portfolio-creative/recipes/programs-filters.json +0 -94
- package/templates/portfolio-creative/recipes/programs-participant-carousel.json +0 -257
- package/templates/portfolio-creative/recipes/programs-see-all.json +0 -43
- package/templates/portfolio-creative/recipes/section-error.json +0 -58
- package/templates/portfolio-creative/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/portfolio-creative/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/portfolio-creative/tier5-src/_shared/events-card.ts +0 -33
- package/templates/portfolio-creative/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/portfolio-creative/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/portfolio-creative/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/portfolio-creative/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/portfolio-creative/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/portfolio-creative/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/portfolio-creative/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/portfolio-creative/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/portfolio-creative/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/portfolio-creative/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/portfolio-creative/tier5-src/_shared/products-section.ts +0 -76
- package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/portfolio-creative/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/restaurant/recipes/announcement-card.json +0 -72
- package/templates/restaurant/recipes/blog-hero.json +0 -95
- package/templates/restaurant/recipes/blog-list-thumb-start.json +0 -394
- package/templates/restaurant/recipes/blog-list.json +0 -394
- package/templates/restaurant/recipes/blog-see-all.json +0 -50
- package/templates/restaurant/recipes/events-inline-list.json +0 -228
- package/templates/restaurant/recipes/events-inline.json +0 -309
- package/templates/restaurant/recipes/faq-list.json +0 -503
- package/templates/restaurant/recipes/groups-list.json +0 -196
- package/templates/restaurant/recipes/members-list.json +0 -445
- package/templates/restaurant/recipes/plans-card.json +0 -811
- package/templates/restaurant/recipes/products-carousel.json +0 -141
- package/templates/restaurant/recipes/products-grid.json +0 -143
- package/templates/restaurant/recipes/programs-card.json +0 -254
- package/templates/restaurant/recipes/programs-carousel.json +0 -234
- package/templates/restaurant/recipes/programs-filters.json +0 -94
- package/templates/restaurant/recipes/programs-participant-carousel.json +0 -257
- package/templates/restaurant/recipes/programs-see-all.json +0 -43
- package/templates/restaurant/recipes/section-error.json +0 -58
- package/templates/restaurant/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/restaurant/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/restaurant/tier5-src/_shared/events-card.ts +0 -33
- package/templates/restaurant/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/restaurant/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/restaurant/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/restaurant/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/restaurant/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/restaurant/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/restaurant/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/restaurant/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/restaurant/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/restaurant/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/restaurant/tier5-src/_shared/products-section.ts +0 -76
- package/templates/restaurant/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/restaurant/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/retail-store/recipes/announcement-card.json +0 -72
- package/templates/retail-store/recipes/blog-hero.json +0 -95
- package/templates/retail-store/recipes/blog-list-thumb-start.json +0 -394
- package/templates/retail-store/recipes/blog-list.json +0 -394
- package/templates/retail-store/recipes/blog-see-all.json +0 -50
- package/templates/retail-store/recipes/events-inline-list.json +0 -228
- package/templates/retail-store/recipes/events-inline.json +0 -309
- package/templates/retail-store/recipes/faq-list.json +0 -503
- package/templates/retail-store/recipes/groups-list.json +0 -196
- package/templates/retail-store/recipes/members-list.json +0 -445
- package/templates/retail-store/recipes/plans-card.json +0 -811
- package/templates/retail-store/recipes/products-carousel.json +0 -141
- package/templates/retail-store/recipes/products-grid.json +0 -143
- package/templates/retail-store/recipes/programs-card.json +0 -254
- package/templates/retail-store/recipes/programs-carousel.json +0 -234
- package/templates/retail-store/recipes/programs-filters.json +0 -94
- package/templates/retail-store/recipes/programs-participant-carousel.json +0 -257
- package/templates/retail-store/recipes/programs-see-all.json +0 -43
- package/templates/retail-store/recipes/section-error.json +0 -58
- package/templates/retail-store/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/retail-store/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/retail-store/tier5-src/_shared/event-registration.ts +0 -86
- package/templates/retail-store/tier5-src/_shared/events-card.ts +0 -33
- package/templates/retail-store/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/retail-store/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/retail-store/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/retail-store/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/retail-store/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/retail-store/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/retail-store/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/retail-store/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/retail-store/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/retail-store/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/retail-store/tier5-src/_shared/products-section.ts +0 -76
- package/templates/retail-store/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/retail-store/tier5-src/_shared/relative-time.ts +0 -21
- package/templates/yoga-studio/recipes/announcement-card.json +0 -72
- package/templates/yoga-studio/recipes/blog-hero.json +0 -95
- package/templates/yoga-studio/recipes/blog-list-thumb-start.json +0 -394
- package/templates/yoga-studio/recipes/blog-list.json +0 -394
- package/templates/yoga-studio/recipes/blog-see-all.json +0 -50
- package/templates/yoga-studio/recipes/events-inline-list.json +0 -228
- package/templates/yoga-studio/recipes/events-inline.json +0 -309
- package/templates/yoga-studio/recipes/faq-list.json +0 -503
- package/templates/yoga-studio/recipes/groups-list.json +0 -196
- package/templates/yoga-studio/recipes/members-list.json +0 -445
- package/templates/yoga-studio/recipes/plans-card.json +0 -811
- package/templates/yoga-studio/recipes/products-carousel.json +0 -141
- package/templates/yoga-studio/recipes/products-grid.json +0 -143
- package/templates/yoga-studio/recipes/programs-card.json +0 -254
- package/templates/yoga-studio/recipes/programs-carousel.json +0 -234
- package/templates/yoga-studio/recipes/programs-filters.json +0 -94
- package/templates/yoga-studio/recipes/programs-participant-carousel.json +0 -257
- package/templates/yoga-studio/recipes/programs-see-all.json +0 -43
- package/templates/yoga-studio/recipes/section-error.json +0 -58
- package/templates/yoga-studio/tier5-src/_shared/announcement-section.ts +0 -122
- package/templates/yoga-studio/tier5-src/_shared/blog-list.ts +0 -207
- package/templates/yoga-studio/tier5-src/_shared/events-card.ts +0 -33
- package/templates/yoga-studio/tier5-src/_shared/events-inline-options.ts +0 -25
- package/templates/yoga-studio/tier5-src/_shared/events-inline.ts +0 -84
- package/templates/yoga-studio/tier5-src/_shared/faq-list.ts +0 -405
- package/templates/yoga-studio/tier5-src/_shared/groups-section.ts +0 -110
- package/templates/yoga-studio/tier5-src/_shared/member-activity.ts +0 -34
- package/templates/yoga-studio/tier5-src/_shared/member-row-extras.ts +0 -175
- package/templates/yoga-studio/tier5-src/_shared/members-directory-view.ts +0 -39
- package/templates/yoga-studio/tier5-src/_shared/members-directory.ts +0 -271
- package/templates/yoga-studio/tier5-src/_shared/plan-facts.ts +0 -87
- package/templates/yoga-studio/tier5-src/_shared/plans-section.ts +0 -106
- package/templates/yoga-studio/tier5-src/_shared/products-section.ts +0 -76
- package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +0 -16
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +0 -740
- package/templates/yoga-studio/tier5-src/_shared/relative-time.ts +0 -21
- /package/templates/{community-club → brandy}/tier5-src/_shared/detail-presence.ts +0 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
// Tier-5 bundle: Wix Spaces clone — Chat thread (ON-DEVICE, site-scoped, REAL write).
|
|
2
|
+
// himalaya.input.id carries EITHER a chatroom id (inbox-opened threads) OR a MEMBER
|
|
3
|
+
// id (member picker / member detail "Message"). When the input is a member id we
|
|
4
|
+
// resolve (get-or-create) the 1:1 chatroom first; getMessages/sendChatMessage always
|
|
5
|
+
// operate on the resolved CHATROOM id.
|
|
6
|
+
//
|
|
7
|
+
// LIVE: once the conversation is open, `load` also returns what keeps it live —
|
|
8
|
+
// `_shared/chat-live.ts` picks a `wix-realtime://` stream when the screen passes a
|
|
9
|
+
// `chatRealtime` channel, else a 4 s foreground `_poll` of `refresh`. A message from the
|
|
10
|
+
// business then appears without the member leaving the screen. `load`, `setDraft` and
|
|
11
|
+
// `send` keep their contract; the directives are stripped by the runtime, never state.
|
|
12
|
+
import { defineService, type PollDirective, type PollStopDirective, type StreamDirective } from "@himalaya/state";
|
|
13
|
+
import { getMessages, sendChatMessage, getOrCreateDirectChatroom, getChatToken, type ChatMessage } from "@himalaya/wix-chat-web";
|
|
14
|
+
import { getMyData } from "@himalaya/wix-users";
|
|
15
|
+
import { formatMonthDay, formatMonthDayTime } from "../_shared/engine-intl.js";
|
|
16
|
+
import { initials } from "../_shared/himi-text.js";
|
|
17
|
+
import { copyParam, stashCopy } from "../_shared/himi-copy.js";
|
|
18
|
+
import { presence, presenceAfterError, detailInputId, type PresenceFlags } from "../_shared/detail-presence.js";
|
|
19
|
+
import { isOfflineFailure, writeMayHaveLanded } from "../_shared/owner-load-error.js";
|
|
20
|
+
import { logChatSendError } from "../_shared/wix-bi.js";
|
|
21
|
+
import { CHAT_LIVE_POLL_ID, chatRealtimeConfig, createReloadGate, createSendIntents, createVisitToken, liveDirectives, postWithVisitToken, isTokenRejected, liveFallback, type ChatLiveMode, type ChatRealtimeConfig } from "../_shared/chat-live.js";
|
|
22
|
+
|
|
23
|
+
import { memberAccess, memberAccessChanged } from "../_shared/member-access.js";
|
|
24
|
+
import { readAccess, assertReadAccess, readAccessDenied, NO_READ_SIGN_IN, type ReadAccess } from "../_shared/member-read.js";
|
|
25
|
+
|
|
26
|
+
const SERVICE = "spacesChatThread";
|
|
27
|
+
const EMPTY_TEXT = "No messages yet. Say hello!";
|
|
28
|
+
|
|
29
|
+
// `mine` / `notMine` pick the incoming or outgoing row layout (the descriptor hides the other
|
|
30
|
+
// one). Empty strings and `*Hidden` flags let a row drop its badge, avatar or attachment.
|
|
31
|
+
// `leadFill` (" " for my messages) stays for screens that right-align with a gated spacer.
|
|
32
|
+
interface Row {
|
|
33
|
+
id: string; text: string; when: string; leadFill: string; mine: boolean; notMine: boolean;
|
|
34
|
+
senderBadge: string; avatarUrl: string; avatarInitials: string;
|
|
35
|
+
imageUrl: string; imageDescription: string; imageHidden: boolean; dayLabel: string; dayHidden: boolean;
|
|
36
|
+
}
|
|
37
|
+
interface S extends PresenceFlags {
|
|
38
|
+
threadMember: ReadAccess | null; signInRequired: boolean; noSignIn: boolean;
|
|
39
|
+
status: "loading" | "ready"; messages: Row[]; emptyText: string; emptyHidden: boolean; draft: string; sendHint: string; resolvedChatroomId: string; myUserId: string;
|
|
40
|
+
/** Send token for the host's transcript scroll: a new value follows the tail. */
|
|
41
|
+
scrollSend: string;
|
|
42
|
+
/** Which path keeps the open thread live (diagnostic). */
|
|
43
|
+
live?: ChatLiveMode;
|
|
44
|
+
_stream?: StreamDirective;
|
|
45
|
+
_poll?: PollDirective | PollStopDirective;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function inputId(): string {
|
|
49
|
+
return (globalThis as { himalaya?: { input?: { id?: string } } }).himalaya?.input?.id ?? "";
|
|
50
|
+
}
|
|
51
|
+
function inputKind(): string {
|
|
52
|
+
// The native nav plumbs an optional `kind` flat onto himalaya.input (screen|id|kind).
|
|
53
|
+
return (globalThis as { himalaya?: { input?: { kind?: string } } }).himalaya?.input?.kind ?? "";
|
|
54
|
+
}
|
|
55
|
+
// Resolve the raw input id (member OR chatroom) to a real CHATROOM id.
|
|
56
|
+
// kind==="chatroom" → the inbox already passed a resolved chatroom id; use it as-is.
|
|
57
|
+
// otherwise (member picker / member detail) → the raw id is a MEMBER id; get-or-create
|
|
58
|
+
// the 1:1 chatroom. On failure return "" — NOT the raw member id: sending to a member
|
|
59
|
+
// id 404s ("Chatroom not found"), which would surface as a misleading "Couldn't send".
|
|
60
|
+
async function resolveChatroomId(raw: string, kind: string): Promise<string> {
|
|
61
|
+
if (!raw) return "";
|
|
62
|
+
if (kind === "chatroom") return raw;
|
|
63
|
+
try {
|
|
64
|
+
return await getOrCreateDirectChatroom(raw);
|
|
65
|
+
} catch {
|
|
66
|
+
return "";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function val(arg?: unknown): string {
|
|
70
|
+
return typeof arg === "string" ? arg : ((arg as { value?: string; text?: string })?.value ?? (arg as { text?: string })?.text ?? "");
|
|
71
|
+
}
|
|
72
|
+
function dayKeyOf(d: Date): string {
|
|
73
|
+
return `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
74
|
+
}
|
|
75
|
+
/** chat-web marks the business side as "business", "businessUser" or "user" (the same predicate
|
|
76
|
+
* as wix-owner-inbox-thread); a visitor or member is anything else. */
|
|
77
|
+
function isBusinessSender(m: ChatMessage): boolean {
|
|
78
|
+
const type = String(m.sender?.type ?? "").toLowerCase();
|
|
79
|
+
return type === "business" || type === "businessuser" || type === "user";
|
|
80
|
+
}
|
|
81
|
+
function norm(m: ChatMessage, i: number, myUserId: string): Row & { timestamp: number; dayKey: string } {
|
|
82
|
+
const mm = m as unknown as {
|
|
83
|
+
id?: string; summary?: string; data?: Array<{ mimeType?: string; data?: { text?: string; uri?: string; thumbnailUrl?: string } }>;
|
|
84
|
+
payload?: { text?: string }; content?: string; createdAt?: number; createdDate?: string;
|
|
85
|
+
senderDisplayData?: { name?: string; image?: { url?: string } };
|
|
86
|
+
};
|
|
87
|
+
const text = mm.data?.find((part) => part.data?.text)?.data?.text || mm.summary || mm.payload?.text || mm.content || "";
|
|
88
|
+
const ms = mm.createdAt || (mm.createdDate ? Date.parse(mm.createdDate) : 0);
|
|
89
|
+
const date = ms ? new Date(ms) : null;
|
|
90
|
+
const senderName = mm.senderDisplayData?.name || "";
|
|
91
|
+
const avatarUrl = mm.senderDisplayData?.image?.url || "";
|
|
92
|
+
const image = mm.data?.find((part) => part.mimeType?.startsWith("image/") || part.data?.thumbnailUrl);
|
|
93
|
+
const imageUrl = image?.data?.thumbnailUrl || image?.data?.uri || "";
|
|
94
|
+
// Mine when the message sender matches my user id (resolved once per load).
|
|
95
|
+
const mine = !!(myUserId && m.sender?.userId && m.sender.userId === myUserId);
|
|
96
|
+
return {
|
|
97
|
+
id: mm.id || `m${i}`, text: text || "Message", when: date ? formatMonthDayTime(date) : "", leadFill: mine ? " " : "", mine, notMine: !mine,
|
|
98
|
+
senderBadge: isBusinessSender(m) ? copyParam("chatThread.businessBadge", "Business") : "",
|
|
99
|
+
avatarUrl, avatarInitials: initials(senderName),
|
|
100
|
+
imageUrl, imageDescription: imageUrl ? `${senderName || "Message"} attachment` : "", imageHidden: !imageUrl,
|
|
101
|
+
dayLabel: "", dayHidden: true, timestamp: ms, dayKey: date ? dayKeyOf(date) : "",
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Oldest first, one row per message id, and a day label on the first message of each day. */
|
|
106
|
+
function rowsOf(messages: ChatMessage[], myUserId: string): Row[] {
|
|
107
|
+
const sorted = messages.map((m, i) => norm(m, i, myUserId)).sort((a, b) => a.timestamp - b.timestamp);
|
|
108
|
+
const today = new Date();
|
|
109
|
+
const todayKey = dayKeyOf(today);
|
|
110
|
+
const yesterdayKey = dayKeyOf(new Date(today.getFullYear(), today.getMonth(), today.getDate() - 1));
|
|
111
|
+
const seen = new Set<string>();
|
|
112
|
+
const rows: Row[] = [];
|
|
113
|
+
let previousDay = "";
|
|
114
|
+
for (const { timestamp, dayKey, ...row } of sorted) {
|
|
115
|
+
if (seen.has(row.id)) continue;
|
|
116
|
+
seen.add(row.id);
|
|
117
|
+
const startsDay = !!dayKey && dayKey !== previousDay;
|
|
118
|
+
if (dayKey) previousDay = dayKey;
|
|
119
|
+
const dayLabel = !startsDay ? "" : dayKey === todayKey ? copyParam("chatThread.today", "Today") : dayKey === yesterdayKey ? copyParam("chatThread.yesterday", "Yesterday") : formatMonthDay(new Date(timestamp));
|
|
120
|
+
rows.push({ ...row, dayLabel, dayHidden: !dayLabel });
|
|
121
|
+
}
|
|
122
|
+
return rows;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function nextScrollToken(prev: string): string {
|
|
126
|
+
return String((Number(prev) || 0) + 1);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ONE member chatToken per visit (`_shared/chat-live.ts`): a 4 s re-read would otherwise
|
|
130
|
+
// mint a token every 4 s on top of its GET. Reset on every `load`.
|
|
131
|
+
const memberToken = createVisitToken(() => getChatToken({ role: "member" }).then((t) => t.chatToken));
|
|
132
|
+
|
|
133
|
+
async function reload(id: string, myUserId: string, member: ReadAccess): Promise<Row[]> {
|
|
134
|
+
if (!id) return [];
|
|
135
|
+
for (let attempt = 0; ; attempt++) {
|
|
136
|
+
const token = memberToken.get();
|
|
137
|
+
try {
|
|
138
|
+
const chatToken = await token;
|
|
139
|
+
await assertReadAccess(member);
|
|
140
|
+
const msgs = await getMessages(id, 30, { role: "member", chatToken });
|
|
141
|
+
return rowsOf(msgs ?? [], myUserId);
|
|
142
|
+
} catch (error) {
|
|
143
|
+
memberToken.drop(token);
|
|
144
|
+
// An expired visit token gets one fresh attempt. A repeated refusal still
|
|
145
|
+
// clears private history; checking identity before each read prevents stale retries.
|
|
146
|
+
if (attempt > 0 || !isTokenRejected(error)) throw error;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** Send ids that belong to the intent (conversation + text), not the tap. */
|
|
152
|
+
const intents = createSendIntents();
|
|
153
|
+
|
|
154
|
+
/** Post once per intent: a retried tap of the same text reuses its message id, so a send
|
|
155
|
+
* that failed ambiguously and is tapped again stays one message. */
|
|
156
|
+
async function postOnce(chatroomId: string, text: string, member: ReadAccess): Promise<void> {
|
|
157
|
+
const messageId = intents.idFor(chatroomId, text);
|
|
158
|
+
await postWithVisitToken(memberToken, async (chatToken) => {
|
|
159
|
+
await assertReadAccess(member);
|
|
160
|
+
if (liveState().threadMember !== member) throw memberAccessChanged();
|
|
161
|
+
return sendChatMessage(chatroomId, text, { role: "member", chatToken, messageId });
|
|
162
|
+
});
|
|
163
|
+
intents.settle(chatroomId, text);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** A send in flight. Set synchronously before the first `await`: an async action publishes
|
|
167
|
+
* no state until it returns, so a state flag could not stop a second tap. */
|
|
168
|
+
let sendingNow = false;
|
|
169
|
+
|
|
170
|
+
// The conversation a live re-read reads, and the channel the screen passed (if any).
|
|
171
|
+
let current = { chatroomId: "", myUserId: "" };
|
|
172
|
+
let realtime: ChatRealtimeConfig | null = null;
|
|
173
|
+
const gate = createReloadGate(() => reload(current.chatroomId, current.myUserId, liveState().threadMember!));
|
|
174
|
+
|
|
175
|
+
/** A tick or a stream event: re-read the open conversation. A failed tick keeps the
|
|
176
|
+
* thread as it is — the next one tries again.
|
|
177
|
+
*
|
|
178
|
+
* The read lands on the LIVE state (`svc.getState()`), not the state the tick started
|
|
179
|
+
* with: the runtime replaces the whole service state with what an action returns, so a
|
|
180
|
+
* tick that resolves after the member typed or sent would otherwise put back the old
|
|
181
|
+
* draft and the old messages. */
|
|
182
|
+
async function reread(s: S): Promise<S> {
|
|
183
|
+
if (!s.found || !s.resolvedChatroomId || s.resolvedChatroomId !== current.chatroomId) return s;
|
|
184
|
+
try {
|
|
185
|
+
await assertThreadMember(s);
|
|
186
|
+
const messages = await gate.request();
|
|
187
|
+
await assertThreadMember(s);
|
|
188
|
+
const now = svc.getState();
|
|
189
|
+
if (now.threadMember !== s.threadMember || now.resolvedChatroomId !== s.resolvedChatroomId) return now;
|
|
190
|
+
return { ...now, messages, emptyText: messages.length ? "" : now.emptyText || EMPTY_TEXT, emptyHidden: messages.length > 0 };
|
|
191
|
+
} catch (error) {
|
|
192
|
+
const now = svc.getState();
|
|
193
|
+
if (now.threadMember !== s.threadMember) return now;
|
|
194
|
+
return readAccessDenied(error) ? threadFailure(error) : now;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** The live service state, for an action that awaited. A typed function rather than
|
|
199
|
+
* `svc.getState()` inline, so `svc`'s own initializer does not reference it. */
|
|
200
|
+
function liveState(): S {
|
|
201
|
+
return svc.getState();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Resolve my user id once (best-effort) so messages can be tagged mine/other.
|
|
205
|
+
async function resolveMyUserId(): Promise<string> {
|
|
206
|
+
try { return (await getMyData()).userId || ""; } catch { return ""; }
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const INITIAL: S = { status: "loading", messages: [], emptyText: "", emptyHidden: true, scrollSend: "", draft: "", sendHint: "", resolvedChatroomId: "", myUserId: "", ...presence("loading"), ...NO_READ_SIGN_IN, threadMember: null };
|
|
210
|
+
let loadVersion = 0;
|
|
211
|
+
|
|
212
|
+
async function threadFailure(error: unknown): Promise<S> {
|
|
213
|
+
const version = loadVersion;
|
|
214
|
+
const member = await memberAccess();
|
|
215
|
+
const flags = member.email ? NO_READ_SIGN_IN : { signInRequired: true, noSignIn: false };
|
|
216
|
+
if (version !== loadVersion) return liveState();
|
|
217
|
+
current = { chatroomId: "", myUserId: "" };
|
|
218
|
+
memberToken.reset();
|
|
219
|
+
return { ...INITIAL, status: "ready", ...presenceAfterError(error), ...flags, live: "off", _poll: { id: CHAT_LIVE_POLL_ID, stop: true } };
|
|
220
|
+
}
|
|
221
|
+
async function assertThreadMember(s: S): Promise<void> {
|
|
222
|
+
if (!s.threadMember?.member?.email) throw new Error("Unauthenticated: sign in to read messages");
|
|
223
|
+
await assertReadAccess(s.threadMember);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const svc = defineService<S, {
|
|
227
|
+
prepare: (s: S) => S;
|
|
228
|
+
load: (s: S, a?: unknown) => Promise<S | undefined>;
|
|
229
|
+
setDraft: (s: S, a?: unknown) => S;
|
|
230
|
+
send: (s: S) => Promise<S>;
|
|
231
|
+
refresh: (s: S) => Promise<S>;
|
|
232
|
+
onStreamEvent: (s: S) => Promise<S>;
|
|
233
|
+
onStreamError: (s: S) => S;
|
|
234
|
+
}>(SERVICE, {
|
|
235
|
+
state: INITIAL,
|
|
236
|
+
actions: {
|
|
237
|
+
prepare: (s) => ({ ...s, ...INITIAL, _poll: { id: CHAT_LIVE_POLL_ID, stop: true } }),
|
|
238
|
+
load: async (s, a): Promise<S | undefined> => {
|
|
239
|
+
const version = ++loadVersion;
|
|
240
|
+
await svc.prepare();
|
|
241
|
+
current = { chatroomId: "", myUserId: "" };
|
|
242
|
+
stashCopy(a);
|
|
243
|
+
const param = (a as { chatRealtime?: unknown } | null | undefined)?.chatRealtime;
|
|
244
|
+
if (param !== undefined) realtime = chatRealtimeConfig(param);
|
|
245
|
+
const raw = inputId();
|
|
246
|
+
// No thread / recipient id (a stale link, a route opened directly) -> the shared
|
|
247
|
+
// not-found state, and no composer: there is nobody to send to.
|
|
248
|
+
if (!detailInputId()) return { ...INITIAL, status: "ready", messages: [], emptyText: "", emptyHidden: true, ...presence("missing") };
|
|
249
|
+
memberToken.reset();
|
|
250
|
+
try {
|
|
251
|
+
const member = await readAccess();
|
|
252
|
+
if (!member.member.email) throw new Error("Unauthenticated: sign in to read messages");
|
|
253
|
+
// Resolve chatroom + my user id concurrently (myUserId tags own messages).
|
|
254
|
+
const [chatroomId, myUserId] = await Promise.all([resolveChatroomId(raw, inputKind()), resolveMyUserId()]);
|
|
255
|
+
// A recipient whose 1:1 chatroom could not be resolved is not a conversation yet:
|
|
256
|
+
// reload("") would return [] without throwing and publish a live, empty thread
|
|
257
|
+
// whose Send can only fail. Show the load-error line instead.
|
|
258
|
+
if (!chatroomId) return version === loadVersion ? { ...INITIAL, status: "ready", ...presence("failed") } : undefined;
|
|
259
|
+
const messages = await reload(chatroomId, myUserId, member);
|
|
260
|
+
await assertReadAccess(member);
|
|
261
|
+
if (version !== loadVersion) return undefined;
|
|
262
|
+
current = { chatroomId, myUserId };
|
|
263
|
+
const previous = s.threadMember;
|
|
264
|
+
const sameReader = previous?.member.email === member.member.email && previous?.member.scope === member.member.scope && previous?.tenant === member.tenant;
|
|
265
|
+
const draft = sameReader && s.resolvedChatroomId === chatroomId ? s.draft : "";
|
|
266
|
+
return { ...INITIAL, draft, threadMember: member, status: "ready", resolvedChatroomId: chatroomId, myUserId, messages, emptyText: messages.length ? "" : EMPTY_TEXT, emptyHidden: messages.length > 0, scrollSend: messages.length ? nextScrollToken(s.scrollSend) : "", ...presence("found"), ...liveDirectives(realtime, chatroomId, SERVICE) };
|
|
267
|
+
} catch (e) {
|
|
268
|
+
// A thread whose messages cannot be read is not a live, empty conversation: a 404
|
|
269
|
+
// is the shared not-found state, anything else the load-error line — never a
|
|
270
|
+
// "Say hello!" composer that can only fail.
|
|
271
|
+
if (version !== loadVersion) return undefined;
|
|
272
|
+
const failed = await threadFailure(e);
|
|
273
|
+
return version === loadVersion ? failed : undefined;
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
setDraft: (s, a) => ({ ...s, draft: val(a) }),
|
|
277
|
+
// The fallback poll's tick.
|
|
278
|
+
refresh: async (s) => reread(s),
|
|
279
|
+
// "The conversation changed" — the event's payload is deliberately not read.
|
|
280
|
+
onStreamEvent: async (s) => reread(s),
|
|
281
|
+
// The channel is gone, or this host refuses it (the web host does): poll instead.
|
|
282
|
+
onStreamError: (s) => (s.found && s.resolvedChatroomId ? { ...s, ...liveFallback(SERVICE) } : s),
|
|
283
|
+
// REAL WRITE: send the typed message to the RESOLVED chatroom id, then re-read.
|
|
284
|
+
// Every return builds on the LIVE state: the runtime replaces state wholesale, and ticks
|
|
285
|
+
// or typing may have changed it while this awaited.
|
|
286
|
+
send: async (s) => {
|
|
287
|
+
if (!s.found) return s;
|
|
288
|
+
const text = s.draft.trim();
|
|
289
|
+
try { await assertThreadMember(s); }
|
|
290
|
+
catch (error) { return liveState().threadMember !== s.threadMember ? liveState() : threadFailure(error); }
|
|
291
|
+
if (liveState().threadMember !== s.threadMember) return liveState();
|
|
292
|
+
const checked = liveState();
|
|
293
|
+
if (!text) return checked.draft.trim() ? checked : { ...checked, sendHint: "Type a message first." };
|
|
294
|
+
if (sendingNow) return checked;
|
|
295
|
+
sendingNow = true;
|
|
296
|
+
try {
|
|
297
|
+
// Resolve lazily in case send() runs before load() settled.
|
|
298
|
+
let chatroomId = s.resolvedChatroomId;
|
|
299
|
+
if (!chatroomId) chatroomId = await resolveChatroomId(inputId(), inputKind());
|
|
300
|
+
if (!chatroomId) return { ...liveState(), sendHint: "Couldn't start conversation." };
|
|
301
|
+
try {
|
|
302
|
+
await postOnce(chatroomId, text, s.threadMember!);
|
|
303
|
+
} catch (e) {
|
|
304
|
+
if (liveState().threadMember !== s.threadMember) return liveState();
|
|
305
|
+
try { await assertThreadMember(s); }
|
|
306
|
+
catch (error) { return threadFailure(error); }
|
|
307
|
+
// Surface a short reason (the SDK rejects with "HTTP <code>: <body>") so a
|
|
308
|
+
// real failure is diagnosable on-device instead of an opaque "Couldn't send".
|
|
309
|
+
// A failure that may have posted anyway (a gateway timeout after the backend stored
|
|
310
|
+
// it) must not read as "Couldn't send": say it may have gone. A retry of the same text
|
|
311
|
+
// reuses its message id, so it cannot become a second message.
|
|
312
|
+
const msg = (e as { message?: string })?.message || "";
|
|
313
|
+
if (writeMayHaveLanded(e)) return { ...liveState(), resolvedChatroomId: chatroomId, sendHint: "Couldn't confirm it was sent — check before sending again." };
|
|
314
|
+
logChatSendError({ chatroomId, error: e, offline: isOfflineFailure(e) });
|
|
315
|
+
return { ...liveState(), resolvedChatroomId: chatroomId, sendHint: msg ? `Couldn't send — ${msg.slice(0, 80)}` : "Couldn't send — try again." };
|
|
316
|
+
}
|
|
317
|
+
await assertThreadMember(s);
|
|
318
|
+
if (liveState().threadMember !== s.threadMember) return liveState();
|
|
319
|
+
// SENT. From here on nothing may say otherwise: a failed re-read must not offer a
|
|
320
|
+
// second Send of a message that already posted.
|
|
321
|
+
const myUserId = s.myUserId || (await resolveMyUserId());
|
|
322
|
+
// Re-read THROUGH the live-read gate, so this read queues behind a tick already in
|
|
323
|
+
// flight instead of racing it: whatever lands last then holds the sent reply.
|
|
324
|
+
current = { chatroomId, myUserId };
|
|
325
|
+
const cleared = (now: S): string => (now.draft.trim() === text ? "" : now.draft);
|
|
326
|
+
try {
|
|
327
|
+
const messages = await gate.request();
|
|
328
|
+
await assertThreadMember(s);
|
|
329
|
+
if (liveState().threadMember !== s.threadMember) return liveState();
|
|
330
|
+
const now = liveState();
|
|
331
|
+
return { ...now, resolvedChatroomId: chatroomId, myUserId, messages, draft: cleared(now), emptyText: "", emptyHidden: true, scrollSend: nextScrollToken(now.scrollSend), sendHint: "Sent ✓" };
|
|
332
|
+
} catch (error) {
|
|
333
|
+
if (liveState().threadMember !== s.threadMember) return liveState();
|
|
334
|
+
if (readAccessDenied(error)) return threadFailure(error);
|
|
335
|
+
const now = liveState();
|
|
336
|
+
const local: Row = { id: `local-${now.messages.length}`, text, when: "", leadFill: " ", mine: true, notMine: false, senderBadge: "", avatarUrl: "", avatarInitials: "", imageUrl: "", imageDescription: "", imageHidden: true, dayLabel: "", dayHidden: true };
|
|
337
|
+
return { ...now, resolvedChatroomId: chatroomId, myUserId, messages: [...now.messages, local], draft: cleared(now), emptyText: "", emptyHidden: true, scrollSend: nextScrollToken(now.scrollSend), sendHint: "Sent ✓" };
|
|
338
|
+
}
|
|
339
|
+
} catch (error) {
|
|
340
|
+
if (liveState().threadMember !== s.threadMember) return liveState();
|
|
341
|
+
return threadFailure(error);
|
|
342
|
+
} finally {
|
|
343
|
+
sendingNow = false;
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
});
|
|
348
|
+
svc.prepare();
|
|
349
|
+
svc.load();
|
|
350
|
+
export { svc };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Tier-5 bundle: Wix Spaces clone — Delete my account.
|
|
2
|
+
// Confirm calls DELETE /members/v1/members/my then signs out. Failures surface
|
|
3
|
+
// in `message` so the UI can keep the confirmation (no silent no-op).
|
|
4
|
+
import { defineService } from "@himalaya/state";
|
|
5
|
+
import { dispatch } from "@himalaya/dispatch";
|
|
6
|
+
|
|
7
|
+
interface S {
|
|
8
|
+
status: "ready";
|
|
9
|
+
title: string;
|
|
10
|
+
body: string;
|
|
11
|
+
cta: string;
|
|
12
|
+
message: string;
|
|
13
|
+
done: boolean;
|
|
14
|
+
notDone: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function wixApi() {
|
|
18
|
+
return (globalThis as { himalaya?: { wixApi?: { call: (m: string, p: string, b?: unknown) => Promise<unknown> } } }).himalaya?.wixApi;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const svc = defineService<S, { confirm: (s: S) => Promise<S> }>("spacesDeleteAccount", {
|
|
22
|
+
state: {
|
|
23
|
+
status: "ready",
|
|
24
|
+
title: "Delete your account",
|
|
25
|
+
body: "This will permanently delete your membership on this site. This action can't be undone.",
|
|
26
|
+
cta: "Delete Account",
|
|
27
|
+
message: "",
|
|
28
|
+
done: false,
|
|
29
|
+
notDone: true,
|
|
30
|
+
},
|
|
31
|
+
actions: {
|
|
32
|
+
confirm: async (s) => {
|
|
33
|
+
try {
|
|
34
|
+
const api = wixApi();
|
|
35
|
+
if (!api) throw new Error("wixApi unavailable");
|
|
36
|
+
await api.call("DELETE", "/members/v1/members/my");
|
|
37
|
+
try { await dispatch("himi.wix.signOut"); } catch { /* best-effort */ }
|
|
38
|
+
return {
|
|
39
|
+
...s,
|
|
40
|
+
message: "Your membership was deleted. You’ve been signed out.",
|
|
41
|
+
done: true,
|
|
42
|
+
notDone: false,
|
|
43
|
+
cta: "Done",
|
|
44
|
+
};
|
|
45
|
+
} catch (err) {
|
|
46
|
+
const msg = String((err as { message?: unknown })?.message ?? err ?? "Delete failed");
|
|
47
|
+
return {
|
|
48
|
+
...s,
|
|
49
|
+
message: /403|FORBIDDEN|permission|denied/i.test(msg)
|
|
50
|
+
? "This site doesn’t allow members to delete their own account from the app."
|
|
51
|
+
: "Couldn’t delete the account. Try again or contact the site owner.",
|
|
52
|
+
done: false,
|
|
53
|
+
notDone: true,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
export { svc };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineService } from "@himalaya/state";
|
|
2
|
+
import { listMyPlanOrders, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
|
|
3
|
+
import { hostSessionFromGlobal } from "@himalaya/iap";
|
|
4
|
+
import { memberAccess, assertMemberAccess, memberAccessDenied, memberChanged } from "../_shared/member-access.js";
|
|
5
|
+
import { orderDate, orderPrice, orderStatus } from "../_shared/pricing-plan-display.js";
|
|
6
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
7
|
+
import { copyParam, stashCopy } from "../_shared/himi-copy.js";
|
|
8
|
+
import { isHttp401 } from "../_shared/member-read.js";
|
|
9
|
+
|
|
10
|
+
interface Row { id: string; name: string; subtitle: string; description: string; price: string; endDate: string; noEndDate: boolean; expired: boolean; dateLabel: string }
|
|
11
|
+
interface S {
|
|
12
|
+
status: string; orders: Row[]; rows: Row[]; allOrders: Row[]; selectedTab: string; nextCursor: string;
|
|
13
|
+
emptyText: string; hideAccountCta: boolean; noOrders: boolean;
|
|
14
|
+
isLoading: boolean; notLoading: boolean; hideError: boolean; denied: boolean;
|
|
15
|
+
hideEmpty: boolean; hideEmptyLoadMore: boolean; hideDeniedError: boolean; hideRetryError: boolean; pageError: boolean; loadingPage: boolean;
|
|
16
|
+
}
|
|
17
|
+
const initial = (): S => ({ status: "loading", orders: [], rows: [], allOrders: [], selectedTab: "active", nextCursor: "", emptyText: "", hideAccountCta: true, noOrders: true, isLoading: true, notLoading: false, hideError: true, denied: false, hideEmpty: true, hideEmptyLoadMore: true, hideDeniedError: true, hideRetryError: true, pageError: false, loadingPage: false });
|
|
18
|
+
/** The visitor state: the Sign in card, never an error. */
|
|
19
|
+
const guest = (): S => ({ ...initial(), status: "guest", emptyText: copyParam("mySubscriptions.guestBody", "Sign in to see your subscriptions."), isLoading: false, notLoading: true, hideAccountCta: false });
|
|
20
|
+
let sequence = 0;
|
|
21
|
+
let scope = "";
|
|
22
|
+
let offset = 0;
|
|
23
|
+
let pending = false;
|
|
24
|
+
const session = hostSessionFromGlobal();
|
|
25
|
+
|
|
26
|
+
function project(state: S): S {
|
|
27
|
+
// Keep the unfiltered `orders` contract for older descriptors without tabs.
|
|
28
|
+
const orders = state.allOrders;
|
|
29
|
+
const rows = orders.filter(row => row.expired === (state.selectedTab === "expired"));
|
|
30
|
+
return { ...state, orders, rows, noOrders: rows.length === 0, hideEmpty: state.status !== "ready" || rows.length > 0 || Boolean(state.nextCursor),
|
|
31
|
+
hideEmptyLoadMore: state.status !== "ready" || rows.length > 0 || !state.nextCursor,
|
|
32
|
+
emptyText: orders.length ? "" : state.selectedTab === "expired" ? copyParam("mySubscriptions.expiredEmpty", "No expired subscriptions") : copyParam("mySubscriptions.activeEmpty", "No active subscriptions") };
|
|
33
|
+
}
|
|
34
|
+
function norm(order: WixPlanOrder): Row {
|
|
35
|
+
const periodEnd = !order.earliestEndDate && !order.endDate && order.status === "ACTIVE" && (order.pricing?.subscription ?? order.priceDetails?.subscription) ? orderDate(order.currentCycle?.endedDate) : "";
|
|
36
|
+
const endDate = orderDate(order.earliestEndDate ?? order.endDate) || periodEnd;
|
|
37
|
+
return { id: order.id, name: order.planName || copyParam("plans.planFallbackName", "Plan"), subtitle: orderStatus(order),
|
|
38
|
+
description: descriptionBody(order.planDescription).bodyText, price: orderPrice(order), endDate, noEndDate: !endDate, dateLabel: periodEnd ? copyParam("subscriptionDetail.periodEnd", "Current period ends") : order.status === "CANCELED" ? copyParam("subscriptionDetail.endDate", "End date") : order.status === "ENDED" ? copyParam("mySubscriptions.expiredOn", "Expired on") : copyParam("mySubscriptions.validUntil", "Valid until"),
|
|
39
|
+
expired: ["ENDED", "CANCELED"].includes(order.status ?? "") };
|
|
40
|
+
}
|
|
41
|
+
async function readPage(state: S, reset: boolean): Promise<S | undefined> {
|
|
42
|
+
if (!reset && pending) return undefined;
|
|
43
|
+
const seq = reset ? ++sequence : sequence;
|
|
44
|
+
pending = true;
|
|
45
|
+
if (!reset) void svc.beginPage();
|
|
46
|
+
const member = await memberAccess();
|
|
47
|
+
const key = JSON.stringify([member.email, member.scope]);
|
|
48
|
+
if (seq !== sequence) return undefined;
|
|
49
|
+
if (key !== scope) { scope = key; offset = 0; state = initial(); void svc.clear(); }
|
|
50
|
+
if (!member.email) { pending = false; return guest(); }
|
|
51
|
+
try {
|
|
52
|
+
const start = reset ? 0 : offset;
|
|
53
|
+
const result = await listMyPlanOrders({ statuses: ["ACTIVE", "PENDING", "PAUSED", "CANCELED", "ENDED"], limit: 50, offset: start });
|
|
54
|
+
await assertMemberAccess(member);
|
|
55
|
+
if (seq !== sequence) return undefined;
|
|
56
|
+
const raw = result.orders ?? [];
|
|
57
|
+
offset = start + raw.length;
|
|
58
|
+
const rows = raw.filter(order => order.id && order.status !== "DRAFT").map(norm);
|
|
59
|
+
const allOrders = [...new Map([...(reset ? [] : state.allOrders), ...rows].map(row => [row.id, row])).values()];
|
|
60
|
+
return project({ ...state, status: "ready", allOrders, isLoading: false, notLoading: true, hideError: true, denied: false, hideAccountCta: true,
|
|
61
|
+
selectedTab: svc.getState().selectedTab, hideDeniedError: true, hideRetryError: true, nextCursor: raw.length === 50 ? String(offset) : "", pageError: false, loadingPage: false });
|
|
62
|
+
} catch (error) {
|
|
63
|
+
if (seq !== sequence) return undefined;
|
|
64
|
+
if (await memberChanged(member, error)) { scope = ""; void svc.clear(); void svc.load(); return undefined; }
|
|
65
|
+
// Wix refused the read as unauthenticated: the host's identity was stale or a visitor's, and Sign in is the fix.
|
|
66
|
+
if (isHttp401(error)) return guest();
|
|
67
|
+
state = project({ ...state, selectedTab: svc.getState().selectedTab });
|
|
68
|
+
const denied = memberAccessDenied(error);
|
|
69
|
+
if (denied) return { ...initial(), selectedTab: state.selectedTab, status: "error", emptyText: copyParam("mySubscriptions.accessDenied", "Subscriptions are unavailable for this account."), isLoading: false, notLoading: true, hideError: false, denied: true, hideDeniedError: false, hideRetryError: true };
|
|
70
|
+
return { ...state, status: "error", emptyText: copyParam("mySubscriptions.loadError", "Subscriptions could not be loaded."), isLoading: false, notLoading: true, hideError: false, denied: false, hideDeniedError: true, hideRetryError: false, hideEmpty: true, hideEmptyLoadMore: true, pageError: !reset && state.allOrders.length > 0, loadingPage: false };
|
|
71
|
+
} finally { if (seq === sequence) pending = false; }
|
|
72
|
+
}
|
|
73
|
+
const svc = defineService<S, {
|
|
74
|
+
clear: (s: S) => S; beginPage: (s: S) => S; load: (s: S, arg?: unknown) => Promise<S | undefined>;
|
|
75
|
+
retry: (s: S) => Promise<S | undefined>; nextPage: (s: S) => Promise<S | undefined>; selectTab: (s: S, arg?: unknown) => S;
|
|
76
|
+
}>("spacesMySubscriptions", {
|
|
77
|
+
state: initial(), notHydrated: Object.keys(initial()) as Array<keyof S>,
|
|
78
|
+
actions: {
|
|
79
|
+
clear: () => initial(),
|
|
80
|
+
beginPage: state => ({ ...state, loadingPage: true }),
|
|
81
|
+
load: (state, arg) => { stashCopy(arg); return readPage(state, true); },
|
|
82
|
+
retry: state => readPage(state, !state.pageError),
|
|
83
|
+
nextPage: state => state.nextCursor ? readPage(state, false) : Promise.resolve(undefined),
|
|
84
|
+
selectTab: (state, arg) => { const raw = typeof arg === "string" ? arg : (arg as { selectedId?: string; id?: string; value?: string })?.selectedId ?? (arg as { id?: string })?.id ?? (arg as { value?: string })?.value; return project({ ...state, selectedTab: raw === "expired" ? "expired" : "active" }); },
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
session.subscribe(() => { ++sequence; scope = ""; pending = false; void svc.clear(); void svc.load(); });
|
|
88
|
+
svc.load();
|
|
89
|
+
export { svc };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { defineService } from "@himalaya/state";
|
|
2
|
+
import { getMyPlanOrder, requestCancellation, type WixPlanOrder } from "@himalaya/wix-pricing-plans";
|
|
3
|
+
import { hostSessionFromGlobal } from "@himalaya/iap";
|
|
4
|
+
import { memberAccess, assertMemberAccess, memberAccessDenied, memberChanged, type MemberAccess } from "../_shared/member-access.js";
|
|
5
|
+
import { orderDate, orderPrice, orderStatus, orderFacts } from "../_shared/pricing-plan-display.js";
|
|
6
|
+
import { presence, presenceAfterError, detailInputId, type PresenceFlags } from "../_shared/detail-presence.js";
|
|
7
|
+
import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
|
|
8
|
+
|
|
9
|
+
interface S extends PresenceFlags {
|
|
10
|
+
denied: boolean; hideDeniedError: boolean; notActive: boolean; isActive: boolean;
|
|
11
|
+
status: string; name: string; subtitle: string; price: string; validity: string;
|
|
12
|
+
facts: ReturnType<typeof orderFacts>; hideAccountCta: boolean;
|
|
13
|
+
hideCancel: boolean; hideConfirmation: boolean; showConfirmation: boolean; busy: boolean; noScheduledOption: boolean;
|
|
14
|
+
effectiveAt: string; confirmation: string; actionMessage: string; actionError: string; hasActionError: boolean; noActionError: boolean;
|
|
15
|
+
}
|
|
16
|
+
const initial = (): S => ({ denied: false, hideDeniedError: true, notActive: true, isActive: false, status: "loading", name: "", subtitle: "", price: "", validity: "", facts: [], hideAccountCta: true,
|
|
17
|
+
hideCancel: true, hideConfirmation: true, showConfirmation: false, busy: false, noScheduledOption: true, effectiveAt: "IMMEDIATELY", confirmation: "", actionMessage: "", actionError: "none", hasActionError: false, noActionError: true, ...presence("loading") });
|
|
18
|
+
let order: WixPlanOrder | null = null;
|
|
19
|
+
let sequence = 0;
|
|
20
|
+
let cancelInFlight = false;
|
|
21
|
+
const cancellationsSent = new Set<string>();
|
|
22
|
+
let orderMemberKey = "";
|
|
23
|
+
const memberKey = (member: MemberAccess): string => JSON.stringify([member.scope, member.email]);
|
|
24
|
+
const cancellationKey = (id: string, owner = orderMemberKey): string => JSON.stringify([owner, id]);
|
|
25
|
+
const session = hostSessionFromGlobal();
|
|
26
|
+
function canCancel(o: WixPlanOrder): boolean {
|
|
27
|
+
// The member API enforces the PURCHASED policy. Current public plan settings are not the
|
|
28
|
+
// historical policy, and an archived plan must not prevent canceling an existing order.
|
|
29
|
+
return Boolean(o.id) && ["ACTIVE", "PENDING", "PAUSED"].includes(o.status ?? "") && o.type !== "EXTERNAL"
|
|
30
|
+
&& !o.autoRenewCanceled && o.cancellation?.effectiveAt !== "NEXT_PAYMENT_DATE";
|
|
31
|
+
}
|
|
32
|
+
function project(o: WixPlanOrder, message = ""): S {
|
|
33
|
+
const end = orderDate(o.earliestEndDate ?? o.endDate ?? o.currentCycle?.endedDate);
|
|
34
|
+
const scheduled = Boolean((o.pricing?.subscription ?? o.priceDetails?.subscription) && o.currentCycle?.endedDate && Date.parse(o.currentCycle.endedDate) > Date.now());
|
|
35
|
+
const renews = o.status === "ACTIVE" && scheduled ? orderDate(o.currentCycle?.endedDate) : "";
|
|
36
|
+
return { ...initial(), ...presence("found"), status: "ready", notActive: o.status !== "ACTIVE", isActive: o.status === "ACTIVE", name: o.planName || copyParam("subscriptionDetail.fallbackName", "Subscription"), subtitle: orderStatus(o), price: orderPrice(o),
|
|
37
|
+
validity: (o.earliestEndDate || o.autoRenewCanceled || o.cancellation?.effectiveAt === "NEXT_PAYMENT_DATE") && end ? copyTemplate("subscriptionDetail.scheduledEndMessage", "Your subscription ends on {date}.", { date: end }) : renews ? copyTemplate("placeSummary.planRenews", "Renews {date}", { date: renews }) : "",
|
|
38
|
+
facts: orderFacts(o), hideCancel: !canCancel(o) || cancellationsSent.has(cancellationKey(o.id)), noScheduledOption: !scheduled,
|
|
39
|
+
effectiveAt: scheduled ? "NEXT_PAYMENT_DATE" : "IMMEDIATELY", actionMessage: message };
|
|
40
|
+
}
|
|
41
|
+
function confirmation(effectiveAt: string): string {
|
|
42
|
+
const end = orderDate(order?.currentCycle?.endedDate);
|
|
43
|
+
return effectiveAt === "NEXT_PAYMENT_DATE" && end
|
|
44
|
+
? copyTemplate("subscriptionDetail.cancelAtPeriodEndBody", "Request cancellation at the next payment date, {date}?", { date: end })
|
|
45
|
+
: copyParam("subscriptionDetail.cancelImmediatelyBody", "Request cancellation now? Your access can end immediately.");
|
|
46
|
+
}
|
|
47
|
+
async function load(_state: S, arg?: unknown): Promise<S | undefined> {
|
|
48
|
+
stashCopy(arg);
|
|
49
|
+
const seq = ++sequence;
|
|
50
|
+
if (order && order.id !== detailInputId()) { order = null; void svc.clear(); }
|
|
51
|
+
const member = await memberAccess();
|
|
52
|
+
if (seq !== sequence) return undefined;
|
|
53
|
+
if (!member.email) { order = null; return { ...initial(), status: "guest", subtitle: copyParam("mySubscriptions.guestBody", "Sign in to see your subscriptions."), hideAccountCta: false, ...presence("missing"), hideNotFound: true }; }
|
|
54
|
+
const id = detailInputId();
|
|
55
|
+
if (!id) return { ...initial(), status: "ready", subtitle: copyParam("subscriptionDetail.missingId", "Open a subscription from My Subscriptions."), ...presence("missing") };
|
|
56
|
+
try {
|
|
57
|
+
const result = await getMyPlanOrder(id);
|
|
58
|
+
await assertMemberAccess(member);
|
|
59
|
+
if (seq !== sequence) return undefined;
|
|
60
|
+
orderMemberKey = memberKey(member);
|
|
61
|
+
order = result.order;
|
|
62
|
+
if (!order?.id || order.status === "DRAFT") { order = null; return { ...initial(), status: "ready", ...presence("missing") }; }
|
|
63
|
+
return project(order, cancellationsSent.has(cancellationKey(order.id)) && canCancel(order) ? copyParam("subscriptionDetail.cancelPending", "Cancellation requested. Refresh to see the latest status.") : "");
|
|
64
|
+
} catch (error) {
|
|
65
|
+
if (seq !== sequence) return undefined;
|
|
66
|
+
order = null;
|
|
67
|
+
if (await memberChanged(member, error)) { void svc.clear(); void svc.load(); return undefined; }
|
|
68
|
+
const denied = memberAccessDenied(error);
|
|
69
|
+
const flags = presenceAfterError(error);
|
|
70
|
+
return { ...initial(), status: "ready", subtitle: copyParam("subscriptionDetail.loadError", "This subscription could not be loaded."), ...flags, denied, hideLoadError: denied || flags.hideLoadError, hideDeniedError: !denied };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
type SubscriptionActions = {
|
|
74
|
+
beginCancel: (s: S) => S; clear: (s: S) => S; load: typeof load; requestCancel: (s: S) => S;
|
|
75
|
+
dismissCancel: (s: S) => S; chooseEffectiveAt: (s: S, arg?: unknown) => S;
|
|
76
|
+
confirmCancel: (s: S) => Promise<S | undefined>;
|
|
77
|
+
};
|
|
78
|
+
const svc: ReturnType<typeof defineService<S, SubscriptionActions>> = defineService<S, SubscriptionActions>("spacesSubscriptionDetail", {
|
|
79
|
+
state: initial(), notHydrated: Object.keys(initial()) as Array<keyof S>,
|
|
80
|
+
actions: {
|
|
81
|
+
beginCancel: state => ({ ...state, busy: true }),
|
|
82
|
+
clear: () => initial(), load,
|
|
83
|
+
requestCancel: state => !order || order.id !== detailInputId() || state.hideCancel || cancelInFlight ? state : { ...state, hideConfirmation: false, showConfirmation: true, actionMessage: "", actionError: "none", hasActionError: false, noActionError: true, confirmation: confirmation(state.effectiveAt) },
|
|
84
|
+
dismissCancel: state => cancelInFlight ? state : { ...state, hideConfirmation: true, showConfirmation: false },
|
|
85
|
+
chooseEffectiveAt: (state, arg) => {
|
|
86
|
+
if (cancelInFlight || state.hideConfirmation) return state;
|
|
87
|
+
const value = typeof arg === "string" ? arg : (arg as { value?: string; selectedId?: string })?.value ?? (arg as { selectedId?: string })?.selectedId;
|
|
88
|
+
const effectiveAt = value === "NEXT_PAYMENT_DATE" && !state.noScheduledOption ? value : "IMMEDIATELY";
|
|
89
|
+
return { ...state, effectiveAt, confirmation: confirmation(effectiveAt) };
|
|
90
|
+
},
|
|
91
|
+
confirmCancel: async (state): Promise<S | undefined> => {
|
|
92
|
+
if (state.hideConfirmation || state.hideCancel || !order || order.id !== detailInputId() || !canCancel(order) || cancelInFlight || cancellationsSent.has(cancellationKey(order.id))) return undefined;
|
|
93
|
+
cancelInFlight = true;
|
|
94
|
+
void svc.beginCancel();
|
|
95
|
+
const seq = sequence;
|
|
96
|
+
const id = order.id;
|
|
97
|
+
const isCurrent = (): boolean => seq === sequence && detailInputId() === id;
|
|
98
|
+
const member = await memberAccess();
|
|
99
|
+
const requestKey = cancellationKey(id, memberKey(member));
|
|
100
|
+
try {
|
|
101
|
+
if (!isCurrent()) return seq === sequence ? load(svc.getState()) : undefined;
|
|
102
|
+
await assertMemberAccess(member);
|
|
103
|
+
if (!isCurrent()) return seq === sequence ? load(svc.getState()) : undefined;
|
|
104
|
+
// Refresh policy/lifecycle facts before writing; never cancel a stale/other member order.
|
|
105
|
+
const latest = (await getMyPlanOrder(id)).order;
|
|
106
|
+
await assertMemberAccess(member);
|
|
107
|
+
if (!isCurrent()) return seq === sequence ? load(svc.getState()) : undefined;
|
|
108
|
+
if (!latest || !canCancel(latest)) { order = latest; return latest ? project(latest) : { ...initial(), ...presence("missing") }; }
|
|
109
|
+
if (state.effectiveAt === "NEXT_PAYMENT_DATE" && (!latest.currentCycle?.endedDate || Date.parse(latest.currentCycle.endedDate) <= Date.now())) {
|
|
110
|
+
order = latest; return { ...project(latest), actionMessage: copyParam("subscriptionDetail.changedBeforeCancel", "Your subscription changed. Review the details before canceling.") };
|
|
111
|
+
}
|
|
112
|
+
await requestCancellation(id, state.effectiveAt === "NEXT_PAYMENT_DATE" ? "NEXT_PAYMENT_DATE" : "IMMEDIATELY");
|
|
113
|
+
// An accepted write remains fenced for its original member even when a session
|
|
114
|
+
// change overtakes its response. Check ownership before publishing, not before
|
|
115
|
+
// remembering the acknowledgement; reads can still report ACTIVE afterward.
|
|
116
|
+
cancellationsSent.add(requestKey);
|
|
117
|
+
if (!isCurrent()) return load(svc.getState());
|
|
118
|
+
await assertMemberAccess(member);
|
|
119
|
+
if (!isCurrent()) return load(svc.getState());
|
|
120
|
+
const refreshed = (await getMyPlanOrder(id)).order;
|
|
121
|
+
await assertMemberAccess(member);
|
|
122
|
+
if (!isCurrent()) return load(svc.getState());
|
|
123
|
+
order = refreshed;
|
|
124
|
+
return project(refreshed, canCancel(refreshed) ? copyParam("subscriptionDetail.cancelPending", "Cancellation requested. Refresh to see the latest status.") : "");
|
|
125
|
+
} catch (error) {
|
|
126
|
+
if (!isCurrent()) return seq === sequence ? load(svc.getState()) : undefined;
|
|
127
|
+
if (await memberChanged(member, error)) { order = null; orderMemberKey = ""; void svc.clear(); void svc.load(); return undefined; }
|
|
128
|
+
if (!isCurrent()) return seq === sequence ? load(svc.getState()) : undefined;
|
|
129
|
+
return { ...state, busy: false, hideConfirmation: true, showConfirmation: false, actionError: cancellationsSent.has(requestKey) ? "cancelRefreshFailed" : memberAccessDenied(error) ? "cancelDenied" : "cancelFailed", hasActionError: true, noActionError: false, hideCancel: cancellationsSent.has(requestKey) || memberAccessDenied(error) || state.hideCancel,
|
|
130
|
+
actionMessage: cancellationsSent.has(requestKey) ? copyParam("subscriptionDetail.cancelRefreshFailed", "Cancellation requested, but the latest status could not be loaded. Refresh the details.")
|
|
131
|
+
: memberAccessDenied(error) ? copyParam("subscriptionDetail.cancelDenied", "This subscription cannot be canceled from this account. Contact the business for help.")
|
|
132
|
+
: copyParam("subscriptionDetail.cancelFailed", "Cancellation failed. Try again.") };
|
|
133
|
+
} finally { cancelInFlight = false; }
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
session.subscribe(() => { ++sequence; order = null; orderMemberKey = ""; void svc.clear(); void svc.load(); });
|
|
138
|
+
svc.load();
|
|
139
|
+
export { svc };
|