@wix/himalaya-cli 0.1747.0 → 0.1749.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/bin/himi +16 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +9 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +34 -8
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +45 -18
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +36 -14
- package/dist/browser-plane/assets.json +7 -7
- package/dist/browser-plane/preview-deferred/{63821bbb8f637899037252154a5587f0596e4b537173c7f50551f9e44f7c22c0.bin → b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin} +1 -1
- package/dist/browser-plane/sw.js +6 -6
- package/dist/browser-plane/t5-frame.html +1 -1
- package/dist/browser-plane/t5-worker-frame.html +1 -1
- package/dist/cli.mjs +2616 -1883
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +1 -1
- package/guides/component-reference.md +9 -0
- package/guides/one-app-to-himi-app.md +11 -6
- package/guides/wix-business-context.md +25 -1
- package/guides/wix-site-to-himi-app.md +2 -1
- package/package.json +2 -2
- package/template-icons/medical-services.png +0 -0
- package/templates/beauty-salon/dev/index.ts +1 -0
- package/templates/beauty-salon/l10n/en.json +6 -0
- package/templates/beauty-salon/l10n/fr.json +36 -5
- package/templates/beauty-salon/l10n/he.json +29 -4
- package/templates/beauty-salon/recipes/blog-hero.json +95 -0
- package/templates/beauty-salon/recipes/blog-list-thumb-start.json +177 -147
- package/templates/beauty-salon/recipes/blog-list.json +172 -142
- package/templates/beauty-salon/recipes/events-inline-list.json +30 -5
- package/templates/beauty-salon/recipes/events-inline.json +30 -5
- package/templates/beauty-salon/recipes/faq-list.json +503 -0
- package/templates/beauty-salon/recipes/groups-list.json +196 -0
- package/templates/beauty-salon/recipes/products-carousel.json +141 -0
- package/templates/beauty-salon/recipes/products-grid.json +143 -0
- package/templates/beauty-salon/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/beauty-salon/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/beauty-salon/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/beauty-salon/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/beauty-salon/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/beauty-salon/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/beauty-salon/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/beauty-salon/tier5-src/_shared/products-section.ts +76 -0
- package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/beauty-salon/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/beauty-salon-owner/dev/index.ts +54 -0
- package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/branded-lite/dev/index.ts +1 -0
- package/templates/branded-lite/l10n/fr.json +15 -5
- package/templates/branded-lite/l10n/he.json +12 -4
- package/templates/branded-lite/recipes/blog-hero.json +95 -0
- package/templates/branded-lite/recipes/blog-list-thumb-start.json +177 -147
- package/templates/branded-lite/recipes/blog-list.json +172 -142
- package/templates/branded-lite/recipes/events-inline-list.json +30 -5
- package/templates/branded-lite/recipes/events-inline.json +30 -5
- package/templates/branded-lite/recipes/faq-list.json +503 -0
- package/templates/branded-lite/recipes/groups-list.json +196 -0
- package/templates/branded-lite/recipes/products-carousel.json +141 -0
- package/templates/branded-lite/recipes/products-grid.json +143 -0
- package/templates/branded-lite/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/branded-lite/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/branded-lite/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/branded-lite/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/branded-lite/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/branded-lite/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/branded-lite/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/branded-lite/tier5-src/_shared/products-section.ts +76 -0
- package/templates/branded-lite/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/branded-lite/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/branded-lite/tier5-src/himi-branded-lite-faq/index.ts +5 -369
- package/templates/brandy/README.md +46 -5
- package/templates/brandy/config.ts +11 -0
- package/templates/brandy/himalaya.template.json +1 -1
- package/templates/community-club/dev/index.ts +1 -0
- package/templates/community-club/l10n/fr.json +25 -5
- package/templates/community-club/l10n/he.json +20 -4
- package/templates/community-club/recipes/blog-hero.json +95 -0
- package/templates/community-club/recipes/blog-list-thumb-start.json +177 -147
- package/templates/community-club/recipes/blog-list.json +172 -142
- package/templates/community-club/recipes/events-inline-list.json +30 -5
- package/templates/community-club/recipes/events-inline.json +30 -5
- package/templates/community-club/recipes/faq-list.json +503 -0
- package/templates/community-club/recipes/groups-list.json +196 -0
- package/templates/community-club/recipes/products-carousel.json +141 -0
- package/templates/community-club/recipes/products-grid.json +143 -0
- package/templates/community-club/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/community-club/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/community-club/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/community-club/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/community-club/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/community-club/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/community-club/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/community-club/tier5-src/_shared/products-section.ts +76 -0
- package/templates/community-club/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/community-club-owner/dev/index.ts +54 -0
- package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/conference/dev/index.ts +1 -0
- package/templates/events-meetups/dev/index.ts +1 -0
- package/templates/events-meetups/l10n/fr.json +25 -5
- package/templates/events-meetups/l10n/he.json +20 -4
- package/templates/events-meetups/recipes/blog-hero.json +95 -0
- package/templates/events-meetups/recipes/blog-list-thumb-start.json +177 -147
- package/templates/events-meetups/recipes/blog-list.json +172 -142
- package/templates/events-meetups/recipes/events-inline-list.json +30 -5
- package/templates/events-meetups/recipes/events-inline.json +30 -5
- package/templates/events-meetups/recipes/faq-list.json +503 -0
- package/templates/events-meetups/recipes/groups-list.json +196 -0
- package/templates/events-meetups/recipes/products-carousel.json +141 -0
- package/templates/events-meetups/recipes/products-grid.json +143 -0
- package/templates/events-meetups/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/events-meetups/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/events-meetups/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/events-meetups/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/events-meetups/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/events-meetups/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/events-meetups/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/events-meetups/tier5-src/_shared/products-section.ts +76 -0
- package/templates/events-meetups/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/events-meetups-owner/dev/index.ts +54 -0
- package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/gym-fitness/dev/index.ts +1 -0
- package/templates/gym-fitness/l10n/en.json +6 -0
- package/templates/gym-fitness/l10n/fr.json +36 -5
- package/templates/gym-fitness/l10n/he.json +29 -4
- package/templates/gym-fitness/recipes/blog-hero.json +95 -0
- package/templates/gym-fitness/recipes/blog-list-thumb-start.json +177 -147
- package/templates/gym-fitness/recipes/blog-list.json +172 -142
- package/templates/gym-fitness/recipes/events-inline-list.json +30 -5
- package/templates/gym-fitness/recipes/events-inline.json +30 -5
- package/templates/gym-fitness/recipes/faq-list.json +503 -0
- package/templates/gym-fitness/recipes/groups-list.json +196 -0
- package/templates/gym-fitness/recipes/products-carousel.json +141 -0
- package/templates/gym-fitness/recipes/products-grid.json +143 -0
- package/templates/gym-fitness/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/gym-fitness/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/gym-fitness/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/gym-fitness/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/gym-fitness/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/gym-fitness/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/gym-fitness/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/gym-fitness/tier5-src/_shared/products-section.ts +76 -0
- package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/gym-fitness/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/gym-fitness-owner/dev/index.ts +54 -0
- package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/medical-services/README.md +53 -0
- package/templates/medical-services/config.ts +320 -0
- package/templates/medical-services/dev/index.ts +17783 -0
- package/templates/medical-services/himalaya.content.json +46 -0
- package/templates/medical-services/himalaya.template.json +14 -0
- package/templates/medical-services/icon.png +0 -0
- package/templates/medical-services/platforms.json +1 -0
- package/templates/medical-services/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/medical-services/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/medical-services/tier5-src/_shared/booking-session.ts +222 -0
- package/templates/medical-services/tier5-src/_shared/branded-lite-hosted.ts +280 -0
- package/templates/medical-services/tier5-src/_shared/branded-load-state.ts +109 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/medical-services/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/medical-services/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/medical-services/tier5-src/_shared/collection-query.ts +193 -0
- package/templates/medical-services/tier5-src/_shared/collection-service.ts +400 -0
- package/templates/medical-services/tier5-src/_shared/engine-intl.ts +523 -0
- package/templates/medical-services/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/medical-services/tier5-src/_shared/himi-account.ts +194 -0
- package/templates/medical-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
- package/templates/medical-services/tier5-src/_shared/himi-bookings.ts +318 -0
- package/templates/medical-services/tier5-src/_shared/himi-copy.ts +116 -0
- package/templates/medical-services/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/medical-services/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/medical-services/tier5-src/_shared/host-events.ts +66 -0
- package/templates/medical-services/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance.ts +38 -0
- package/templates/medical-services/tier5-src/_shared/iap-worker.ts +127 -0
- package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/medical-services/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/medical-services/tier5-src/_shared/member-access.ts +52 -0
- package/templates/medical-services/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/medical-services/tier5-src/_shared/member-bookings.ts +107 -0
- package/templates/medical-services/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/medical-services/tier5-src/_shared/notification-target.ts +141 -0
- package/templates/medical-services/tier5-src/_shared/offset-page.ts +10 -0
- package/templates/medical-services/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/medical-services/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/medical-services/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/medical-services/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/medical-services/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/medical-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/medical-services/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/medical-services/tier5-src/_shared/weekly-goal.ts +107 -0
- package/templates/medical-services/tier5-src/_shared/wix-bi.ts +85 -0
- package/templates/medical-services/tier5-src/_shared/wix-member-links.ts +114 -0
- package/templates/medical-services/tier5-src/_shared/wix-service-price.ts +146 -0
- package/templates/medical-services/tier5-src/business-chat/index.ts +732 -0
- package/templates/medical-services/tier5-src/himi-booking-account/index.ts +252 -0
- package/templates/medical-services/tier5-src/himi-booking-bookings/index.ts +468 -0
- package/templates/medical-services/tier5-src/himi-booking-service/index.ts +1190 -0
- package/templates/medical-services/tier5-src/himi-booking-services/index.ts +791 -0
- package/templates/medical-services/tier5-src/himi-booking-time/index.ts +1729 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
- package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
- package/templates/medical-services/tier5-src/himi-clinic-home/index.ts +389 -0
- package/templates/medical-services/tier5-src/himi-store-account/index.ts +998 -0
- package/templates/medical-services/tokens.json +418 -0
- package/templates/nonprofit-cause/dev/index.ts +1 -0
- package/templates/nonprofit-cause/l10n/fr.json +25 -5
- package/templates/nonprofit-cause/l10n/he.json +20 -4
- package/templates/nonprofit-cause/recipes/blog-hero.json +95 -0
- package/templates/nonprofit-cause/recipes/blog-list-thumb-start.json +177 -147
- package/templates/nonprofit-cause/recipes/blog-list.json +172 -142
- package/templates/nonprofit-cause/recipes/events-inline-list.json +30 -5
- package/templates/nonprofit-cause/recipes/events-inline.json +30 -5
- package/templates/nonprofit-cause/recipes/faq-list.json +503 -0
- package/templates/nonprofit-cause/recipes/groups-list.json +196 -0
- package/templates/nonprofit-cause/recipes/products-carousel.json +141 -0
- package/templates/nonprofit-cause/recipes/products-grid.json +143 -0
- package/templates/nonprofit-cause/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/nonprofit-cause/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/nonprofit-cause/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/nonprofit-cause/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/nonprofit-cause/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/nonprofit-cause/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/nonprofit-cause/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/nonprofit-cause/tier5-src/_shared/products-section.ts +76 -0
- package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/nonprofit-cause-owner/dev/index.ts +54 -0
- package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/owner-lite/dev/index.ts +54 -0
- package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/podcast-creator/dev/index.ts +1 -0
- package/templates/podcast-creator/l10n/fr.json +35 -5
- package/templates/podcast-creator/l10n/he.json +28 -4
- package/templates/podcast-creator/recipes/blog-hero.json +95 -0
- package/templates/podcast-creator/recipes/blog-list-thumb-start.json +177 -147
- package/templates/podcast-creator/recipes/blog-list.json +172 -142
- package/templates/podcast-creator/recipes/events-inline-list.json +30 -5
- package/templates/podcast-creator/recipes/events-inline.json +30 -5
- package/templates/podcast-creator/recipes/faq-list.json +503 -0
- package/templates/podcast-creator/recipes/groups-list.json +196 -0
- package/templates/podcast-creator/recipes/products-carousel.json +141 -0
- package/templates/podcast-creator/recipes/products-grid.json +143 -0
- package/templates/podcast-creator/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/podcast-creator/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/podcast-creator/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/podcast-creator/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/podcast-creator/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/podcast-creator/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/podcast-creator/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/podcast-creator/tier5-src/_shared/products-section.ts +76 -0
- package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/podcast-creator-owner/dev/index.ts +54 -0
- package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/portfolio-creative/dev/index.ts +1 -0
- package/templates/portfolio-creative/l10n/fr.json +25 -5
- package/templates/portfolio-creative/l10n/he.json +20 -4
- package/templates/portfolio-creative/recipes/blog-hero.json +95 -0
- package/templates/portfolio-creative/recipes/blog-list-thumb-start.json +177 -147
- package/templates/portfolio-creative/recipes/blog-list.json +172 -142
- package/templates/portfolio-creative/recipes/events-inline-list.json +30 -5
- package/templates/portfolio-creative/recipes/events-inline.json +30 -5
- package/templates/portfolio-creative/recipes/faq-list.json +503 -0
- package/templates/portfolio-creative/recipes/groups-list.json +196 -0
- package/templates/portfolio-creative/recipes/products-carousel.json +141 -0
- package/templates/portfolio-creative/recipes/products-grid.json +143 -0
- package/templates/portfolio-creative/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/portfolio-creative/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/portfolio-creative/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/portfolio-creative/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/portfolio-creative/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/portfolio-creative/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/portfolio-creative/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/portfolio-creative/tier5-src/_shared/products-section.ts +76 -0
- package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/portfolio-creative-owner/dev/index.ts +54 -0
- package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/restaurant/dev/index.ts +1 -0
- package/templates/restaurant/l10n/fr.json +35 -5
- package/templates/restaurant/l10n/he.json +28 -4
- package/templates/restaurant/recipes/blog-hero.json +95 -0
- package/templates/restaurant/recipes/blog-list-thumb-start.json +177 -147
- package/templates/restaurant/recipes/blog-list.json +172 -142
- package/templates/restaurant/recipes/events-inline-list.json +30 -5
- package/templates/restaurant/recipes/events-inline.json +30 -5
- package/templates/restaurant/recipes/faq-list.json +503 -0
- package/templates/restaurant/recipes/groups-list.json +196 -0
- package/templates/restaurant/recipes/products-carousel.json +141 -0
- package/templates/restaurant/recipes/products-grid.json +143 -0
- package/templates/restaurant/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/restaurant/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/restaurant/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/restaurant/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/restaurant/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/restaurant/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/restaurant/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/restaurant/tier5-src/_shared/products-section.ts +76 -0
- package/templates/restaurant/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/restaurant-owner/dev/index.ts +54 -0
- package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/retail-store/dev/index.ts +1 -0
- package/templates/retail-store/l10n/fr.json +25 -5
- package/templates/retail-store/l10n/he.json +20 -4
- package/templates/retail-store/recipes/blog-hero.json +95 -0
- package/templates/retail-store/recipes/blog-list-thumb-start.json +177 -147
- package/templates/retail-store/recipes/blog-list.json +172 -142
- package/templates/retail-store/recipes/events-inline-list.json +30 -5
- package/templates/retail-store/recipes/events-inline.json +30 -5
- package/templates/retail-store/recipes/faq-list.json +503 -0
- package/templates/retail-store/recipes/groups-list.json +196 -0
- package/templates/retail-store/recipes/products-carousel.json +141 -0
- package/templates/retail-store/recipes/products-grid.json +143 -0
- package/templates/retail-store/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/retail-store/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/retail-store/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/retail-store/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/retail-store/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/retail-store/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/retail-store/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/retail-store/tier5-src/_shared/products-section.ts +76 -0
- package/templates/retail-store/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/retail-store-owner/dev/index.ts +54 -0
- package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
- package/templates/salon-spa/dev/index.ts +1 -0
- package/templates/salon-spa/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/salon-spa/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/salon-spa/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/wholesale-store/dev/index.ts +1 -0
- package/templates/yoga-studio/dev/index.ts +1 -0
- package/templates/yoga-studio/l10n/en.json +6 -0
- package/templates/yoga-studio/l10n/fr.json +46 -5
- package/templates/yoga-studio/l10n/he.json +37 -4
- package/templates/yoga-studio/recipes/blog-hero.json +95 -0
- package/templates/yoga-studio/recipes/blog-list-thumb-start.json +177 -147
- package/templates/yoga-studio/recipes/blog-list.json +172 -142
- package/templates/yoga-studio/recipes/events-inline-list.json +30 -5
- package/templates/yoga-studio/recipes/events-inline.json +30 -5
- package/templates/yoga-studio/recipes/faq-list.json +503 -0
- package/templates/yoga-studio/recipes/groups-list.json +196 -0
- package/templates/yoga-studio/recipes/products-carousel.json +141 -0
- package/templates/yoga-studio/recipes/products-grid.json +143 -0
- package/templates/yoga-studio/tier5-src/_shared/blog-list.ts +9 -9
- package/templates/yoga-studio/tier5-src/_shared/events-inline.ts +7 -5
- package/templates/yoga-studio/tier5-src/_shared/faq-list.ts +405 -0
- package/templates/yoga-studio/tier5-src/_shared/groups-section.ts +110 -0
- package/templates/yoga-studio/tier5-src/_shared/member-bookings.ts +17 -4
- package/templates/yoga-studio/tier5-src/_shared/member-row-extras.ts +10 -2
- package/templates/yoga-studio/tier5-src/_shared/members-directory.ts +9 -5
- package/templates/yoga-studio/tier5-src/_shared/products-section.ts +76 -0
- package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +2 -2
- package/templates/yoga-studio/tier5-src/_shared/staff-name.ts +18 -0
- package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +6 -2
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +7 -2
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +6 -4
- package/templates/yoga-studio-owner/dev/index.ts +54 -0
- package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +30 -4
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Can this host reach the member account routes My Addresses and My Wallet need?
|
|
2
|
+
//
|
|
3
|
+
// Both are served OFF www.wixapis.com (the address book on ecom.wix.com, saved cards on
|
|
4
|
+
// the member's own site), so only a native runtime whose WixApiCapability pins them can
|
|
5
|
+
// call them: HimalayaCore 1.4.0 and later. The web bridges refuse absolute URLs, and a
|
|
6
|
+
// hosted app (Spaces) signs its calls with a capability pinned to www.wixapis.com. Saved
|
|
7
|
+
// cards also need the shell to have bound its own site (app_info `memberSiteBound`): a
|
|
8
|
+
// multi-app host such as Himi Player binds none, so its wallet route has no host. The
|
|
9
|
+
// Account screen hides a link whose route is unreachable, and the screen says so instead
|
|
10
|
+
// of failing a load.
|
|
11
|
+
import { get as getAppInfo } from "@himalaya/app-info";
|
|
12
|
+
import { isHostedWorker } from "./hosted-checkout.js";
|
|
13
|
+
|
|
14
|
+
/** The HimalayaCore version whose WixApiCapability pins these routes. Checked here, at run
|
|
15
|
+
* time: the screens declare no `minBinaryVersion`, because a release takes its highest
|
|
16
|
+
* screen floor as its own and would then refuse every older binary. */
|
|
17
|
+
export const MEMBER_ACCOUNT_ROUTES_MIN_BINARY = "1.4.0";
|
|
18
|
+
export const MEMBER_MEDIA_FIELD_MIN_BINARY = "1.5.0";
|
|
19
|
+
export const MEMBER_PASSWORD_ACTIONS_MIN_BINARY = "1.5.0";
|
|
20
|
+
|
|
21
|
+
/** `version` (a HimalayaCore binary version, pre-release suffix ignored) is `floor` or later. */
|
|
22
|
+
export function atLeast(version: string, floor: string): boolean {
|
|
23
|
+
const parts = (v: string) => v.split("-")[0].split(".").map((p) => Number.parseInt(p, 10) || 0);
|
|
24
|
+
const a = parts(version), b = parts(floor);
|
|
25
|
+
for (let i = 0; i < Math.max(a.length, b.length); i++) {
|
|
26
|
+
const x = a[i] ?? 0, y = b[i] ?? 0;
|
|
27
|
+
if (x !== y) return x > y;
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface MemberAccountRoutes {
|
|
33
|
+
/** The address book on ecom.wix.com (My Addresses). */
|
|
34
|
+
addresses: boolean;
|
|
35
|
+
/** Saved cards on the member's own site (My Wallet). */
|
|
36
|
+
wallet: boolean;
|
|
37
|
+
/** Native MediaField image picking and presigned PUT support. */
|
|
38
|
+
mediaField: boolean;
|
|
39
|
+
/** Password credential actions introduced in HimalayaCore 1.5.0. */
|
|
40
|
+
passwordCredentials: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function memberAccountRoutes(): Promise<MemberAccountRoutes> {
|
|
44
|
+
if (isHostedWorker()) return { addresses: false, wallet: false, mediaField: false, passwordCredentials: false };
|
|
45
|
+
const info = await getAppInfo().catch(() => undefined);
|
|
46
|
+
if (!info) return { addresses: false, wallet: false, mediaField: false, passwordCredentials: false };
|
|
47
|
+
const native = info.platform === "ios" || info.platform === "android" || info.platform === "macos";
|
|
48
|
+
const addresses = native && atLeast(info.binaryVersion ?? "", MEMBER_ACCOUNT_ROUTES_MIN_BINARY);
|
|
49
|
+
const mediaField = native && atLeast(info.binaryVersion ?? "", MEMBER_MEDIA_FIELD_MIN_BINARY);
|
|
50
|
+
const passwordCredentials = native && atLeast(info.binaryVersion ?? "", MEMBER_PASSWORD_ACTIONS_MIN_BINARY);
|
|
51
|
+
return { addresses, wallet: addresses && info.memberSiteBound === true, mediaField, passwordCredentials };
|
|
52
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { queryBookings, type WixBooking } from "@himalaya/wix-bookings";
|
|
2
|
+
import { memberAccess, assertMemberAccess, type MemberAccess } from "./member-access.js";
|
|
3
|
+
import { offsetPage } from "./offset-page.js";
|
|
4
|
+
import type { CollectionQuery } from "./collection-query.js";
|
|
5
|
+
import { copyParam } from "./himi-copy.js";
|
|
6
|
+
import { formatWeekdayDateTime } from "./engine-intl.js";
|
|
7
|
+
import { dayKey } from "@himalaya/time";
|
|
8
|
+
|
|
9
|
+
/** The statuses that put a booking in the Canceled tab. Upcoming and Past exclude them, so each
|
|
10
|
+
* booking is in exactly one tab. */
|
|
11
|
+
export const CANCELLED_STATUSES = ["CANCELED", "CANCELLED", "DECLINED"];
|
|
12
|
+
|
|
13
|
+
/** Wix made the booking, but no checkout confirmed it: a paid booking the member did not pay
|
|
14
|
+
* for, or left in the payment page, stays here. It holds no place and the business does not
|
|
15
|
+
* see it in its booking calendar, so it is not an appointment. */
|
|
16
|
+
export const UNCONFIRMED_STATUSES = ["CREATED"];
|
|
17
|
+
|
|
18
|
+
export interface FetchMemberBookingsOptions {
|
|
19
|
+
/** Keep the unconfirmed bookings (`UNCONFIRMED_STATUSES`). Only a list that marks them as
|
|
20
|
+
* not confirmed may ask for them; Home and every count leave them out. */
|
|
21
|
+
includeUnconfirmed?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface MemberBookingRow {
|
|
25
|
+
id: string; title: string; subtitle: string; status: string; revision: string;
|
|
26
|
+
start: string; end: string; day: string; serviceId: string;
|
|
27
|
+
canCancel: boolean; cannotCancel: boolean; cannotRebook: boolean;
|
|
28
|
+
// Added for the My Bookings redesign. Each is "" / 0 / false when the record has nothing for it.
|
|
29
|
+
/** The staff member (the slot's resource), "" when the booking names none. */
|
|
30
|
+
staff: string;
|
|
31
|
+
/** The location's name, else its address. */
|
|
32
|
+
placeName: string;
|
|
33
|
+
/** The location's formatted address. */
|
|
34
|
+
placeAddress: string;
|
|
35
|
+
/** `BUSINESS`, `CUSTOM` or `CUSTOMER` (the client's place), upper case. */
|
|
36
|
+
placeType: string;
|
|
37
|
+
participants: number;
|
|
38
|
+
/** Wix's raw payment status, upper case (`PAID`, `NOT_PAID`, …). */
|
|
39
|
+
paymentStatus: string;
|
|
40
|
+
/** Wix's raw booking status, upper case (`CONFIRMED`, `WAITING_LIST`, …). */
|
|
41
|
+
statusKey: string;
|
|
42
|
+
/** A course booking: it books a schedule, not a slot. */
|
|
43
|
+
isCourse: boolean;
|
|
44
|
+
courseStart: string;
|
|
45
|
+
courseEnd: string;
|
|
46
|
+
}
|
|
47
|
+
export function bookingStart(booking: WixBooking): string {
|
|
48
|
+
// Top-level instants are UTC. Slot dates may be LOCAL to slot.timezone.
|
|
49
|
+
const value = booking.startDate || booking.bookedEntity?.slot?.startDate || "";
|
|
50
|
+
return /(?:Z|[+-]\d{2}:?\d{2})$/i.test(value) && Number.isFinite(Date.parse(value)) ? value : "";
|
|
51
|
+
}
|
|
52
|
+
const instant = (value: unknown): string =>
|
|
53
|
+
typeof value === "string" && /(?:Z|[+-]\d{2}:?\d{2})$/i.test(value) && Number.isFinite(Date.parse(value)) ? value : "";
|
|
54
|
+
const word = (value: unknown): string => typeof value === "string" ? value.trim() : "";
|
|
55
|
+
export function memberBookingRow(booking: WixBooking): MemberBookingRow {
|
|
56
|
+
const start = bookingStart(booking);
|
|
57
|
+
const entity = booking.bookedEntity;
|
|
58
|
+
const slot = entity?.slot, schedule = entity?.schedule;
|
|
59
|
+
const status = (booking.status || "").toUpperCase();
|
|
60
|
+
const revision = String((booking as WixBooking & { revision?: string | number }).revision ?? "");
|
|
61
|
+
// A course booking carries a schedule, not a slot: its service id is on the schedule.
|
|
62
|
+
const serviceId = slot?.serviceId || schedule?.serviceId || "";
|
|
63
|
+
const canCancel = !!booking.id && !!revision && Date.parse(start) > Date.now() && !CANCELLED_STATUSES.includes(status);
|
|
64
|
+
const location = slot?.location ?? schedule?.location;
|
|
65
|
+
const placeAddress = word(location?.formattedAddress);
|
|
66
|
+
const participants = Number(booking.totalParticipants);
|
|
67
|
+
return { id: booking.id, title: entity?.title || copyParam("bookings.booking", "Booking"),
|
|
68
|
+
subtitle: start ? formatWeekdayDateTime(new Date(start)) : copyParam("bookings.timeUnavailable", "Time unavailable"),
|
|
69
|
+
status: status.replace(/_/g, " "), revision, start,
|
|
70
|
+
// Wix may carry the end only on the slot (same instant rule as the start).
|
|
71
|
+
end: booking.endDate || instant(slot?.endDate), day: start ? dayKey(new Date(start)) : "",
|
|
72
|
+
serviceId, canCancel, cannotCancel: !canCancel, cannotRebook: !serviceId,
|
|
73
|
+
staff: word(slot?.resource?.name),
|
|
74
|
+
placeName: word(location?.name) || placeAddress,
|
|
75
|
+
placeAddress,
|
|
76
|
+
placeType: word(location?.locationType).toUpperCase(),
|
|
77
|
+
participants: Number.isFinite(participants) && participants > 0 ? Math.floor(participants) : 0,
|
|
78
|
+
paymentStatus: word(booking.paymentStatus).toUpperCase(),
|
|
79
|
+
statusKey: status,
|
|
80
|
+
isCourse: !slot && !!schedule,
|
|
81
|
+
courseStart: instant(schedule?.firstSessionStart),
|
|
82
|
+
courseEnd: instant(schedule?.lastSessionEnd) };
|
|
83
|
+
}
|
|
84
|
+
export async function fetchMemberBookings(criteria: CollectionQuery, cursor: string, now: string, expected?: MemberAccess, options: FetchMemberBookingsOptions = {}) {
|
|
85
|
+
const member = expected ?? await memberAccess();
|
|
86
|
+
const metadata = { email: member.email, scope: member.scope, needsSignIn: !member.email };
|
|
87
|
+
if (!member.email) return { items: [] as MemberBookingRow[], nextCursor: "", metadata };
|
|
88
|
+
await assertMemberAccess(member);
|
|
89
|
+
if (criteria.filter === "saved" && !criteria.savedIds.length) return { items: [] as MemberBookingRow[], nextCursor: "", metadata };
|
|
90
|
+
const filter: Record<string, unknown> = { "contactDetails.email": { $eq: member.email } };
|
|
91
|
+
if (criteria.query) filter.id = { $eq: criteria.query };
|
|
92
|
+
if (criteria.filter === "saved") filter.id = criteria.query ? { $in: criteria.savedIds.filter(id => id === criteria.query) } : { $in: criteria.savedIds };
|
|
93
|
+
const notListed = options.includeUnconfirmed ? CANCELLED_STATUSES : [...CANCELLED_STATUSES, ...UNCONFIRMED_STATUSES];
|
|
94
|
+
if (criteria.filter === "value:Upcoming") { filter.startDate = { $gte: now }; filter.status = { $nin: notListed }; }
|
|
95
|
+
// Past is what took place: a canceled or declined booking is in the Canceled tab only.
|
|
96
|
+
if (criteria.filter === "value:Past") { filter.startDate = { $lt: now }; filter.status = { $nin: notListed }; }
|
|
97
|
+
if (criteria.filter === "value:Cancelled") filter.status = { $in: CANCELLED_STATUSES };
|
|
98
|
+
const response = await queryBookings({ query: { filter, paging: { limit: 50, offset: Number(cursor || 0) },
|
|
99
|
+
sort: [{ fieldName: "startDate", order: criteria.sort === "za" ? "DESC" : "ASC" }, { fieldName: "id", order: "ASC" }] } });
|
|
100
|
+
await assertMemberAccess(member);
|
|
101
|
+
const raw = response.bookings ?? [];
|
|
102
|
+
// Server authorization remains authoritative. This guard also rejects a
|
|
103
|
+
// malformed/cross-member row before any UI projection. No private disk cache.
|
|
104
|
+
const items = raw.filter(booking => booking.id && booking.contactDetails?.email?.trim().toLowerCase() === member.email).map(memberBookingRow)
|
|
105
|
+
.filter(row => options.includeUnconfirmed || !UNCONFIRMED_STATUSES.includes(row.statusKey));
|
|
106
|
+
return { items, ...offsetPage(cursor, raw.length, 50, response.pagingMetadata), metadata };
|
|
107
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// "Open a member-only screen" (the business chat): a member goes there; a guest gets the app's
|
|
2
|
+
// sign-in first, never the screen's own guest prompt, and the screen opens once signed in
|
|
3
|
+
// (himi-store-account resumes `returnScreenId`). Salon & Spa offers it from Home and from the
|
|
4
|
+
// shared booking screens (a treatment that cannot be booked online, a Choose a Time with no times),
|
|
5
|
+
// so each of those workers runs the same rule.
|
|
6
|
+
//
|
|
7
|
+
// The tap's params:
|
|
8
|
+
// screenId the member screen
|
|
9
|
+
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
|
+
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
|
+
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
12
|
+
// the sign-in pushes the screen itself.
|
|
13
|
+
// returnTab the tab the screen opens on after a modal sign-in
|
|
14
|
+
//
|
|
15
|
+
// A modal sign-in also carries a host-held continuation (`authContinuation`, begun here for
|
|
16
|
+
// `memberScreenTarget(screenId)`). Where the account change of the sign-in replaces the sign-in
|
|
17
|
+
// worker before it can resume (Android), the replacement consumes it to open the screen, once.
|
|
18
|
+
// A route alone never opens a member screen; old hosts without the contract keep the plain sheet.
|
|
19
|
+
import { dispatch } from "@himalaya/dispatch";
|
|
20
|
+
import type { NavDirective } from "@himalaya/state";
|
|
21
|
+
import { signedInEmail } from "./himi-account.js";
|
|
22
|
+
|
|
23
|
+
/** How long a continuation call may take before the worker goes on without it. Just above the web
|
|
24
|
+
* host's own 4 s identity-read deadline (identityReader.ts), which it runs before answering: a host
|
|
25
|
+
* that answers is never cut off, and one that never answers cannot hold the sheet or the form. */
|
|
26
|
+
export const CONTINUATION_BUDGET_MS = 4_500;
|
|
27
|
+
/** The whole tap (session read, then begin) waits at most this long. On the web host each call runs
|
|
28
|
+
* its own identity read, so a hung host would otherwise cost two full deadlines (~8 s) before the
|
|
29
|
+
* sheet. The session read may use the host's whole deadline; begin then gets what is left, but at
|
|
30
|
+
* least an ordinary read's 1.5 s, so a slow host (2.5 s a read) still hands out the token. */
|
|
31
|
+
const TAP_BUDGET_MS = CONTINUATION_BUDGET_MS + 1_500;
|
|
32
|
+
const MIN_BEGIN_MS = 1_500;
|
|
33
|
+
|
|
34
|
+
/** The continuation target for a member screen, shared with himi-store-account. */
|
|
35
|
+
export const memberScreenTarget = (screenId: string): string => `member_screen:${screenId}`;
|
|
36
|
+
|
|
37
|
+
/** A host-held continuation for `screenId`, or "" (an old host, or a member already). */
|
|
38
|
+
async function beginContinuation(screenId: string): Promise<string> {
|
|
39
|
+
try {
|
|
40
|
+
const value = await dispatch("himi.wix.authContinuation", { operation: "begin", target: memberScreenTarget(screenId) }) as
|
|
41
|
+
{ supported?: unknown; token?: unknown; payload?: { supported?: unknown; token?: unknown } } | null;
|
|
42
|
+
const fields = value?.payload ?? value;
|
|
43
|
+
return fields?.supported === true && typeof fields.token === "string" ? fields.token : "";
|
|
44
|
+
} catch {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const strField = (arg: unknown, key: string): string => {
|
|
50
|
+
const value = (arg as Record<string, unknown> | undefined)?.[key];
|
|
51
|
+
return typeof value === "string" ? value : "";
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** `read`, or `fallback` once `ms` pass, where the engine has a timer. A bare JSContext has no
|
|
55
|
+
* timer; there it waits, as every read does. `read` must not reject. */
|
|
56
|
+
export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T> {
|
|
57
|
+
const host = globalThis as { setTimeout?: (fn: () => void, ms: number) => unknown; clearTimeout?: (timer: unknown) => void };
|
|
58
|
+
if (typeof host.setTimeout !== "function") return read;
|
|
59
|
+
return new Promise<T>((resolve) => {
|
|
60
|
+
const timer = host.setTimeout!(() => resolve(fallback), ms);
|
|
61
|
+
void read.then((value) => { host.clearTimeout?.(timer); resolve(value); });
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
|
+
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
68
|
+
if (!screenId) return null;
|
|
69
|
+
if (!signInScreenId || email) return { screenId };
|
|
70
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
const presentation = strField(arg, "signInPresentation");
|
|
72
|
+
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
|
+
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
74
|
+
return { screenId: signInScreenId, presentation, args: { ...args, modal: "1" } };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** One worker's opener. The session is asked at the tap, never read from the last load; a read
|
|
78
|
+
* that never answers counts as a guest, so the tap opens the sign-in rather than nothing. Only the
|
|
79
|
+
* newest tap navigates (no second sheet, no sheet over the screen): an older one answers null. */
|
|
80
|
+
// The session read has the continuation calls' budget: on the web host they all wait on the same
|
|
81
|
+
// identity read, so a shorter cutoff here would take a slow member for a guest and flash the sheet.
|
|
82
|
+
export function memberScreenOpener(readEmail: () => Promise<string> = () => within(signedInEmail(), CONTINUATION_BUDGET_MS, "")): (arg: unknown) => Promise<NavDirective | null> {
|
|
83
|
+
let taps = 0;
|
|
84
|
+
return async (arg) => {
|
|
85
|
+
if (!strField(arg, "screenId")) return null;
|
|
86
|
+
const mine = ++taps;
|
|
87
|
+
const tapped = Date.now();
|
|
88
|
+
const email = strField(arg, "signInScreenId") ? await readEmail() : "";
|
|
89
|
+
if (mine !== taps) return null;
|
|
90
|
+
const nav = memberScreenNav(arg, email);
|
|
91
|
+
if (!nav || !("presentation" in nav) || !nav.args?.modal) return nav;
|
|
92
|
+
// Bounded by what the tap has left (TAP_BUDGET_MS): a host that never answers still opens the
|
|
93
|
+
// plain sheet.
|
|
94
|
+
const left = Math.min(CONTINUATION_BUDGET_MS, Math.max(MIN_BEGIN_MS, TAP_BUDGET_MS - (Date.now() - tapped)));
|
|
95
|
+
const token = await within(beginContinuation(strField(arg, "screenId")), left, "");
|
|
96
|
+
if (mine !== taps) return null;
|
|
97
|
+
return token ? { ...nav, args: { ...nav.args, authContinuation: token } } : nav;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Where a tap on a member notification goes. The route table is DERIVED from the Wix member-link catalog
|
|
2
|
+
// (via the pinned copy in ./wix-member-links.ts), the one an app's push taps use, so a
|
|
3
|
+
// notification in the inbox opens exactly what the same notification opens as a push: each destination's canonical
|
|
4
|
+
// Himi screen, with the item id under `id` (branded-lite's `push.routes` is built the same way).
|
|
5
|
+
//
|
|
6
|
+
// Beyond the catalog there are a few links the One App registry and the Business Manager send that a member can
|
|
7
|
+
// receive, listed in EXTRA_ROUTES with where each was read (wix-private/mobile-modules at 7cdefdc557fb):
|
|
8
|
+
// blog wix-one-app-new-blog/src/services/get-deep-links.ts (the multi-site form of a post link)
|
|
9
|
+
// inbox mobile-apps-inbox/src/module/deepLinks.ts (a chatroom)
|
|
10
|
+
// stores, bookings, club
|
|
11
|
+
// hybrid-mobile-platform/src/pushNotifications/deepLinks.ts (links sent by the Business Manager,
|
|
12
|
+
// Ping automations and the owner app to a branded app's members)
|
|
13
|
+
// Loyalty, coupons and FAQ links are NOT here: the catalog records that no push reaches them, and a route for a
|
|
14
|
+
// link nothing sends is dead config that nobody notices.
|
|
15
|
+
//
|
|
16
|
+
// A link that matches no row is NOT guessed at: it falls back to the notification's web link (https only) or to
|
|
17
|
+
// a visible "can't open", never to a made-up screen. A screen the app does not have opens nothing, exactly as the
|
|
18
|
+
// same push tap would. Programs have no catalog entry and so fall back; add a row, and a test, when a real payload
|
|
19
|
+
// names one.
|
|
20
|
+
|
|
21
|
+
import { MEMBER_LINK_DESTINATIONS } from "./wix-member-links.js";
|
|
22
|
+
|
|
23
|
+
/** The notification's own link, as the Members Feed Viewer returns it. */
|
|
24
|
+
export interface NotificationLink {
|
|
25
|
+
webUrlData?: { webUrl?: string };
|
|
26
|
+
mobileData?: { data?: string };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface NotificationTarget {
|
|
30
|
+
screenId: string;
|
|
31
|
+
/** Screen arguments. Nav params are strings. */
|
|
32
|
+
args: Record<string, string>;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type NotificationOpen =
|
|
36
|
+
| { kind: "screen"; target: NotificationTarget }
|
|
37
|
+
| { kind: "url"; url: string }
|
|
38
|
+
| { kind: "none" };
|
|
39
|
+
|
|
40
|
+
export interface Route {
|
|
41
|
+
/** `a/:name/b` — `:name` captures one segment; every other segment must match exactly. */
|
|
42
|
+
pattern: string;
|
|
43
|
+
screenId: string;
|
|
44
|
+
/** Capture name → screen argument name. `kind` and the like are fixed arguments. */
|
|
45
|
+
args?: Record<string, string>;
|
|
46
|
+
fixed?: Record<string, string>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The catalog's links, each opening its destination's canonical screen with the item under `id`. The inbox
|
|
50
|
+
* itself is left out: a notification that points at the list has nowhere further to go. */
|
|
51
|
+
const CATALOG_ROUTES: readonly Route[] = MEMBER_LINK_DESTINATIONS
|
|
52
|
+
.filter((destination) => destination.id !== "notifications.list")
|
|
53
|
+
.flatMap((destination) => destination.matches.map((pattern): Route => ({
|
|
54
|
+
pattern,
|
|
55
|
+
screenId: destination.canonicalScreen,
|
|
56
|
+
...(destination.screenParam ? { args: { [destination.screenParam]: "id" } } : {}),
|
|
57
|
+
})));
|
|
58
|
+
|
|
59
|
+
const CHATROOM = { screenId: "himi_chat_thread", args: { chatroomId: "id" }, fixed: { kind: "chatroom" } };
|
|
60
|
+
|
|
61
|
+
const EXTRA_ROUTES: readonly Route[] = [
|
|
62
|
+
{ pattern: "blog/post/:metaSiteId/:postId", screenId: "himi_blog_post", args: { postId: "id" } },
|
|
63
|
+
{ pattern: "inbox/chatroom-by-id/:chatroomId", ...CHATROOM },
|
|
64
|
+
{ pattern: "inbox/conversation-by-chatroom-id/:chatroomId", ...CHATROOM },
|
|
65
|
+
{ pattern: "stores/:metaSiteId/catalog-for-inbox/:productId", screenId: "himi_product", args: { productId: "id" } },
|
|
66
|
+
{ pattern: "bookings/:metaSiteId/service/:serviceId/details", screenId: "himi_service", args: { serviceId: "id" } },
|
|
67
|
+
{ pattern: "platform/club/:tabId/:metaSiteId", screenId: "himi_branded_home" },
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
export const NOTIFICATION_ROUTES: readonly Route[] = [...CATALOG_ROUTES, ...EXTRA_ROUTES];
|
|
71
|
+
|
|
72
|
+
/** Every screen a notification link can open: what an app is asked about when it says which of them it serves. */
|
|
73
|
+
export const NOTIFICATION_SCREEN_IDS: readonly string[] = [...new Set(NOTIFICATION_ROUTES.map((route) => route.screenId))];
|
|
74
|
+
|
|
75
|
+
/** A captured id: a GUID, a slug or a short token. Anything else (an encoded separator, a space, an empty
|
|
76
|
+
* segment, a segment of only dots such as `..`) means the link is not one of ours, so it opens nothing. */
|
|
77
|
+
const SAFE_SEGMENT = /^(?!\.+$)[A-Za-z0-9._~-]{1,128}$/;
|
|
78
|
+
|
|
79
|
+
/** The path of a `<scheme>://<path>` link, without query or fragment. null when it is not one. */
|
|
80
|
+
function pathOf(link: string): string | null {
|
|
81
|
+
const body = link.trim().replace(/^[a-z][a-z0-9+.-]*:\/\//i, "").split(/[?#]/, 1)[0].replace(/^\/+|\/+$/g, "");
|
|
82
|
+
return body ? body : null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function match(route: Route, segments: string[]): NotificationTarget | null {
|
|
86
|
+
const parts = route.pattern.split("/");
|
|
87
|
+
if (parts.length !== segments.length) return null;
|
|
88
|
+
const captured: Record<string, string> = {};
|
|
89
|
+
for (let i = 0; i < parts.length; i++) {
|
|
90
|
+
if (parts[i].startsWith(":")) {
|
|
91
|
+
if (!SAFE_SEGMENT.test(segments[i])) return null;
|
|
92
|
+
captured[parts[i].slice(1)] = segments[i];
|
|
93
|
+
} else if (parts[i] !== segments[i]) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const args: Record<string, string> = { ...route.fixed };
|
|
98
|
+
for (const [capture, name] of Object.entries(route.args ?? {})) args[name] = captured[capture];
|
|
99
|
+
return { screenId: route.screenId, args };
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The screen a `wix://` link opens, or null when no row of the table claims it. */
|
|
103
|
+
export function screenForLink(link: string | undefined): NotificationTarget | null {
|
|
104
|
+
const path = link ? pathOf(link) : null;
|
|
105
|
+
if (!path) return null;
|
|
106
|
+
const segments = path.split("/");
|
|
107
|
+
for (const route of NOTIFICATION_ROUTES) {
|
|
108
|
+
const target = match(route, segments);
|
|
109
|
+
if (target) return target;
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Not every Tier-5 JS engine has `URL`, so a link is read by hand: `https://<host>[:port][/…]`, where the host
|
|
115
|
+
* is a dotted name of letters, digits and hyphens. Credentials (`user@`), a backslash, whitespace or any
|
|
116
|
+
* control character, and every other scheme (http, javascript:, data:, a custom scheme) are refused: a
|
|
117
|
+
* notification's web link is written by the site, so it is not trusted to run anything. */
|
|
118
|
+
const HTTPS_LINK = /^https:\/\/([A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+)(?::\d{1,5})?(?:[/?#][^\s\\\u0000-\u001f\u007f]*)?$/;
|
|
119
|
+
|
|
120
|
+
/** An https link, or null. */
|
|
121
|
+
export function safeWebUrl(raw: string | undefined): string | null {
|
|
122
|
+
const url = raw?.trim() ?? "";
|
|
123
|
+
// The cap keeps the match cheap on a hostile, site-written value.
|
|
124
|
+
return url.length <= 2048 && HTTPS_LINK.test(url) ? url : null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** The host of a link `safeWebUrl` accepted, for showing the member where a tap goes. */
|
|
128
|
+
export function urlHost(url: string): string {
|
|
129
|
+
return HTTPS_LINK.exec(url)?.[1] ?? "";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** What a tap on this notification does. A recognised app link wins over the web link: a native screen is the
|
|
133
|
+
* intent, and the web link is only the way out for a notification that names no screen of ours. */
|
|
134
|
+
export function notificationOpen(link: NotificationLink | undefined, served?: ReadonlySet<string>): NotificationOpen {
|
|
135
|
+
const target = screenForLink(link?.mobileData?.data);
|
|
136
|
+
// `served` is the screens this app actually has: a link to one it lacks (an order link in an app without the Store) is
|
|
137
|
+
// not opened, and falls to the web link or the visible "can't open", exactly like a link no row claims.
|
|
138
|
+
if (target && (!served || served.has(target.screenId))) return { kind: "screen", target };
|
|
139
|
+
const url = safeWebUrl(link?.webUrlData?.webUrl);
|
|
140
|
+
return url ? { kind: "url", url } : { kind: "none" };
|
|
141
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Offset APIs keep the offset opaque to collection UI. Advance by raw rows,
|
|
2
|
+
* never by a member/status-filtered projection. A full page without a total is
|
|
3
|
+
* deliberately incomplete until a subsequent (possibly empty) page confirms it. */
|
|
4
|
+
export function offsetPage(cursor: string, count: number, limit: number, metadata?: { total?: number }) {
|
|
5
|
+
const offset = cursor ? Number(cursor) : 0;
|
|
6
|
+
if (!Number.isSafeInteger(offset) || offset < 0) throw new Error("Invalid page offset");
|
|
7
|
+
const total = typeof metadata?.total === "number" && Number.isFinite(metadata.total) && metadata.total >= 0 ? metadata.total : undefined;
|
|
8
|
+
const next = offset + count;
|
|
9
|
+
return { nextCursor: count > 0 && (total === undefined ? count >= limit : next < total) ? String(next) : "", ...(total === undefined ? {} : { total }) };
|
|
10
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { connectivity, defineService as register, type ServiceDefinition } from '@himalaya/state';
|
|
2
|
+
|
|
3
|
+
// Template generation enables this behavior only in the selected two starter families.
|
|
4
|
+
export const offlineWritesEnabled = false;
|
|
5
|
+
|
|
6
|
+
export const offlineWriteMessage = 'You’re offline. Connect to save this change, then submit it again.';
|
|
7
|
+
|
|
8
|
+
/** The guard runs before the reducer: entered values survive and no optimistic
|
|
9
|
+
* changes, success state, or queued writes can occur. It never submits on reconnect. */
|
|
10
|
+
export function offlineWriteState<S extends object>(state: S): S {
|
|
11
|
+
const next: Record<string, unknown> = { ...state, error: offlineWriteMessage, message: offlineWriteMessage };
|
|
12
|
+
for (const key of ['saving', 'isSaving', 'submitting', 'isSubmitting', 'adding', 'added', 'bookingInFlight']) {
|
|
13
|
+
if (key in next) next[key] = false;
|
|
14
|
+
}
|
|
15
|
+
for (const key of ['savedMessage', 'successMessage']) {
|
|
16
|
+
if (key in next) next[key] = '';
|
|
17
|
+
}
|
|
18
|
+
// A saved/favourited item is business state, not a submission-success flag.
|
|
19
|
+
return next as S;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface OfflineWriteOptions<S> {
|
|
23
|
+
derive?: (state: S) => S;
|
|
24
|
+
/** Exempt only non-mutating branches of a registered action. */
|
|
25
|
+
requiresConnectivity?: (action: string, state: S, argument?: unknown) => boolean;
|
|
26
|
+
messageFields?: readonly string[] | ((action: string) => readonly string[]);
|
|
27
|
+
draftFields?: readonly string[] | Readonly<Record<string, string>>;
|
|
28
|
+
secretFields?: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function withOnlineWrites<S extends object>(registerService: typeof register, names: readonly string[], options: OfflineWriteOptions<S> = {}): typeof register {
|
|
32
|
+
if (!offlineWritesEnabled) return registerService;
|
|
33
|
+
return ((name: string, definition: ServiceDefinition<Record<string, unknown>>) => {
|
|
34
|
+
let currentState: (() => Record<string, unknown>) | undefined;
|
|
35
|
+
const handle = registerService(name, {
|
|
36
|
+
...definition,
|
|
37
|
+
notHydrated: [...new Set([...(definition.notHydrated ?? []), ...(options.secretFields ?? [])])],
|
|
38
|
+
actions: Object.fromEntries(Object.entries(definition.actions ?? {}).map(([action, reduce]) => [action,
|
|
39
|
+
(state: Record<string, unknown>, ...args: never[]) => {
|
|
40
|
+
if (!names.includes(action)) return reduce(state, ...args);
|
|
41
|
+
if (options.requiresConnectivity?.(action, state as S, args[0]) === false) return reduce(state, ...args);
|
|
42
|
+
const fields = typeof options.messageFields === 'function' ? options.messageFields(action) : options.messageFields ?? ['message'];
|
|
43
|
+
if (connectivity().online) {
|
|
44
|
+
let cleared = false;
|
|
45
|
+
for (const field of ['error', 'message', ...fields]) {
|
|
46
|
+
if (state[field] === offlineWriteMessage) { state[field] = ''; cleared = true; }
|
|
47
|
+
}
|
|
48
|
+
// Keep the runtime's state object: reducers may mutate it and return undefined.
|
|
49
|
+
const result = reduce(state, ...args);
|
|
50
|
+
if (!cleared) return result;
|
|
51
|
+
// Publish cleared feedback even for a void reducer. An async completion must
|
|
52
|
+
// keep any newer state published by another action while it was awaiting.
|
|
53
|
+
const finish = (next: Record<string, unknown> | undefined) => next === undefined ? currentState?.() ?? state : next;
|
|
54
|
+
return result && typeof (result as Promise<unknown>).then === 'function'
|
|
55
|
+
? Promise.resolve(result).then(finish)
|
|
56
|
+
: finish(result as Record<string, unknown> | undefined);
|
|
57
|
+
}
|
|
58
|
+
const draft = { ...state };
|
|
59
|
+
const argument = args[0] as Record<string, unknown> | undefined;
|
|
60
|
+
const draftFields = options.draftFields ?? [];
|
|
61
|
+
const entries = Array.isArray(draftFields) ? draftFields.map(key => [key, key]) : Object.entries(draftFields);
|
|
62
|
+
for (const [key, source] of entries) {
|
|
63
|
+
if (argument && key in state && typeof argument[source] === typeof state[key]) draft[key] = argument[source];
|
|
64
|
+
}
|
|
65
|
+
for (const key of options.secretFields ?? []) draft[key] = '';
|
|
66
|
+
const feedback = Object.fromEntries(fields.map(key => [key, offlineWriteMessage]));
|
|
67
|
+
let next = { ...offlineWriteState(draft), ...feedback };
|
|
68
|
+
if (options.derive) next = options.derive(next as S) as Record<string, unknown>;
|
|
69
|
+
return { ...next, ...feedback };
|
|
70
|
+
},
|
|
71
|
+
])),
|
|
72
|
+
});
|
|
73
|
+
if (typeof handle.getState === 'function') currentState = () => handle.getState();
|
|
74
|
+
return handle;
|
|
75
|
+
}) as typeof register;
|
|
76
|
+
}
|