@wix/himalaya-cli 0.1582.0 → 0.1584.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 +8 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +26 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +18 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/extensions.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/extensions.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/events/src/index.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/extensions.d.ts +15 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/loyalty/src/extensions.d.ts +13 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +19 -4
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +5 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +5 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +4 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +5 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-loyalty.mjs +4 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +10 -3
- package/dist/cli.mjs +1098 -702
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +25 -0
- package/guides/component-reference.json +4 -3
- package/guides/component-reference.md +24 -2
- package/guides/one-app-to-himi-app.md +52 -1
- package/guides/sdk-reference.json +37 -9
- package/guides/wix-api-usage.md +9 -0
- package/package.json +2 -2
- package/templates/beauty-salon/config.ts +27 -1
- package/templates/beauty-salon/dev/index.ts +2285 -757
- package/templates/beauty-salon/himalaya.content.json +3 -0
- package/templates/beauty-salon/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/beauty-salon/tier5-src/_shared/booking-session.ts +222 -0
- package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/beauty-salon/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/beauty-salon/tier5-src/_shared/owner-editor-value.ts +164 -0
- package/templates/beauty-salon/tier5-src/_shared/store-product-info.ts +50 -0
- package/templates/beauty-salon/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +277 -14
- package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +351 -92
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +25 -5
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +219 -220
- package/templates/beauty-salon/tier5-src/himi-branded-lite-category/index.ts +3 -2
- package/templates/beauty-salon/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +2 -1
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +14 -3
- package/templates/beauty-salon/tier5-src/wix-spaces-plan-detail/index.ts +2 -1
- package/templates/beauty-salon/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/beauty-salon-owner/dev/index.ts +129 -66
- package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-services/index.ts +4 -2
- package/templates/branded-lite/config.ts +29 -1
- package/templates/branded-lite/dev/index.ts +8371 -5565
- package/templates/branded-lite/himalaya.content.json +3 -0
- package/templates/branded-lite/l10n/en.json +2 -2
- package/templates/branded-lite/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/branded-lite/tier5-src/_shared/booking-session.ts +222 -0
- package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/branded-lite/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/branded-lite/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/branded-lite/tier5-src/_shared/owner-editor-value.ts +164 -0
- package/templates/branded-lite/tier5-src/_shared/store-product-info.ts +50 -0
- package/templates/branded-lite/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +277 -14
- package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +351 -92
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +25 -5
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +219 -220
- package/templates/branded-lite/tier5-src/himi-branded-lite-badges/index.ts +2 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-category/index.ts +3 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-feed/index.ts +4 -3
- package/templates/branded-lite/tier5-src/himi-branded-lite-group-about/index.ts +243 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +115 -49
- package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +2 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +2 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio/index.ts +2 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +3 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/facts.ts +52 -0
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +21 -11
- package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +2 -1
- package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/branded-lite/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +13 -3
- package/templates/branded-lite/tier5-src/wix-spaces-forum-post/index.ts +3 -2
- package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +53 -37
- package/templates/branded-lite/tier5-src/wix-spaces-members/index.ts +100 -34
- package/templates/branded-lite/tier5-src/wix-spaces-plan-detail/index.ts +2 -1
- package/templates/branded-lite/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/community-club/config.ts +36 -1
- package/templates/community-club/dev/index.ts +1930 -401
- package/templates/community-club/himalaya.content.json +6 -0
- package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/community-club/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/community-club/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/community-club/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/community-club/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/community-club/tier5-src/himi-branded-lite-feed/index.ts +4 -3
- package/templates/community-club/tier5-src/himi-branded-lite-group-about/index.ts +243 -0
- package/templates/community-club/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/community-club/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/community-club/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/community-club/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/community-club-owner/dev/index.ts +53 -1
- package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/community-club-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/community-club-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/community-club-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/community-club-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/community-club-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/community-club-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/community-club-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/events-meetups/config.ts +36 -1
- package/templates/events-meetups/dev/index.ts +1930 -401
- package/templates/events-meetups/himalaya.content.json +6 -0
- package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/events-meetups/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/events-meetups/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/events-meetups/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/events-meetups/tier5-src/himi-branded-lite-feed/index.ts +4 -3
- package/templates/events-meetups/tier5-src/himi-branded-lite-group-about/index.ts +243 -0
- package/templates/events-meetups/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/events-meetups/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/events-meetups/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/events-meetups-owner/dev/index.ts +6 -0
- package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/gym-fitness/config.ts +27 -1
- package/templates/gym-fitness/dev/index.ts +2803 -844
- package/templates/gym-fitness/himalaya.content.json +3 -0
- package/templates/gym-fitness/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/gym-fitness/tier5-src/_shared/booking-session.ts +222 -0
- package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/gym-fitness/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/gym-fitness/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/gym-fitness/tier5-src/_shared/owner-editor-value.ts +164 -0
- package/templates/gym-fitness/tier5-src/_shared/store-product-info.ts +50 -0
- package/templates/gym-fitness/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +277 -14
- package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +351 -92
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +25 -5
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +219 -220
- package/templates/gym-fitness/tier5-src/himi-branded-lite-category/index.ts +3 -2
- package/templates/gym-fitness/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +2 -1
- package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +14 -3
- package/templates/gym-fitness/tier5-src/wix-spaces-plan-detail/index.ts +2 -1
- package/templates/gym-fitness/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/gym-fitness-owner/dev/index.ts +132 -66
- package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-services/index.ts +4 -2
- package/templates/nonprofit-cause/config.ts +36 -1
- package/templates/nonprofit-cause/dev/index.ts +1925 -396
- package/templates/nonprofit-cause/himalaya.content.json +6 -0
- package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/nonprofit-cause/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/nonprofit-cause/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/nonprofit-cause/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-feed/index.ts +4 -3
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group-about/index.ts +243 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +2 -1
- package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/nonprofit-cause/tier5-src/wix-spaces-plan-detail/index.ts +2 -1
- package/templates/nonprofit-cause/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/nonprofit-cause-owner/dev/index.ts +85 -65
- package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-rich-guard.ts +27 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-services/index.ts +4 -2
- package/templates/owner-lite/dev/index.ts +132 -66
- package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/owner-lite/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/owner-lite/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/owner-lite/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/owner-lite/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/owner-lite/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/owner-lite/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/owner-lite/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/owner-lite/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/owner-lite/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/owner-lite/tier5-src/himi-owner-lite-services/index.ts +4 -2
- package/templates/podcast-creator/config.ts +27 -1
- package/templates/podcast-creator/dev/index.ts +1051 -158
- package/templates/podcast-creator/himalaya.content.json +3 -0
- package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/podcast-creator/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/podcast-creator/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/podcast-creator/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/podcast-creator/tier5-src/himi-branded-lite-feed/index.ts +4 -3
- package/templates/podcast-creator/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +2 -1
- package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +2 -1
- package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/podcast-creator/tier5-src/wix-spaces-plan-detail/index.ts +2 -1
- package/templates/podcast-creator/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/podcast-creator-owner/dev/index.ts +53 -1
- package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/portfolio-creative/config.ts +27 -1
- package/templates/portfolio-creative/dev/index.ts +1305 -468
- package/templates/portfolio-creative/himalaya.content.json +3 -0
- package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/portfolio-creative/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/portfolio-creative/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/portfolio-creative/tier5-src/_shared/owner-editor-value.ts +164 -0
- package/templates/portfolio-creative/tier5-src/_shared/store-product-info.ts +50 -0
- package/templates/portfolio-creative/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-category/index.ts +3 -2
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio/index.ts +2 -1
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +3 -2
- package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +14 -3
- package/templates/portfolio-creative/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/portfolio-creative-owner/dev/index.ts +129 -66
- package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-services/index.ts +4 -2
- package/templates/restaurant/config.ts +27 -1
- package/templates/restaurant/dev/index.ts +1051 -158
- package/templates/restaurant/himalaya.content.json +3 -0
- package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/restaurant/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/restaurant/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/restaurant/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/restaurant/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/restaurant/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/restaurant/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/restaurant/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/restaurant/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/restaurant-owner/dev/index.ts +132 -66
- package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-services/index.ts +4 -2
- package/templates/retail-store/config.ts +27 -1
- package/templates/retail-store/dev/index.ts +597 -191
- package/templates/retail-store/himalaya.content.json +3 -0
- package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/retail-store/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/retail-store/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/retail-store/tier5-src/_shared/owner-editor-value.ts +164 -0
- package/templates/retail-store/tier5-src/_shared/store-product-info.ts +50 -0
- package/templates/retail-store/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/retail-store/tier5-src/himi-branded-lite-category/index.ts +3 -2
- package/templates/retail-store/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +13 -3
- package/templates/retail-store/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/retail-store-owner/dev/index.ts +50 -1
- package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-product/index.ts +39 -6
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-product-form/index.ts +14 -8
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-products/index.ts +7 -4
- package/templates/yoga-studio/config.ts +27 -1
- package/templates/yoga-studio/dev/index.ts +2996 -877
- package/templates/yoga-studio/himalaya.content.json +3 -0
- package/templates/yoga-studio/tier5-src/_shared/booking-location.ts +147 -0
- package/templates/yoga-studio/tier5-src/_shared/booking-session.ts +222 -0
- package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +1 -1
- package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/yoga-studio/tier5-src/_shared/event-registration.ts +86 -0
- package/templates/yoga-studio/tier5-src/_shared/himi-restaurants.ts +2 -1
- package/templates/yoga-studio/tier5-src/himi-blog-post/index.ts +21 -8
- package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +277 -14
- package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +351 -92
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +25 -5
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +219 -220
- package/templates/yoga-studio/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +2 -1
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/facts.ts +52 -0
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +21 -11
- package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +12 -86
- package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +47 -6
- package/templates/yoga-studio/tier5-src/wix-spaces-plan-detail/index.ts +2 -1
- package/templates/yoga-studio/tier5-src/wix-spaces-whats-new/index.ts +2 -1
- package/templates/yoga-studio-owner/dev/index.ts +85 -65
- package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +19 -3
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-rich-guard.ts +27 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event/index.ts +16 -8
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event-form/index.ts +16 -7
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-events/index.ts +4 -2
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post/index.ts +7 -0
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-service/index.ts +38 -7
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-service-form/index.ts +53 -7
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-services/index.ts +4 -2
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { withOnlineWrites } from "../_shared/online-actions.js";
|
|
2
|
+
// himi-branded-lite-notifsettings — reads the site's notification topics + the member's preferences.
|
|
3
|
+
// a failed query is an error with Retry (or Sign in when Wix refuses the
|
|
4
|
+
// visitor) and an empty one is a real empty state — never sample rows presented as
|
|
5
|
+
// the customer's own. Samples appear only in the host's explicit sample preview
|
|
6
|
+
// (_shared/branded-load-state.ts).
|
|
7
|
+
// any exist. INTERACTIVE: tapping a row toggles that topic On/Off — optimistic +
|
|
8
|
+
// best-effort upsertMyNotificationPreferences (a no-op on sample rows).
|
|
9
|
+
import { defineService as registerService } from "@himalaya/state";
|
|
10
|
+
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
11
|
+
import { stashCopy } from "../_shared/himi-copy.js";
|
|
12
|
+
import { memberAccess, assertMemberAccess, type MemberAccess } from "../_shared/member-access.js";
|
|
13
|
+
import { LOADING, loaded, loadFailed, type LoadCopy, type LoadFlags } from "../_shared/branded-load-state.js";
|
|
14
|
+
import {
|
|
15
|
+
getNotificationTopics,
|
|
16
|
+
getMyNotificationPreferences,
|
|
17
|
+
upsertMyNotificationPreferences,
|
|
18
|
+
muteStatusFor,
|
|
19
|
+
readTopics,
|
|
20
|
+
readPreferences,
|
|
21
|
+
isDeliveredNow,
|
|
22
|
+
isLocked,
|
|
23
|
+
preferenceFor,
|
|
24
|
+
type NotificationTopicDefinition,
|
|
25
|
+
type PreferenceInfo,
|
|
26
|
+
} from "@himalaya/wix-notification-preferences";
|
|
27
|
+
|
|
28
|
+
/** The channel this surface delivers on — read for the row state, written on toggle.
|
|
29
|
+
* One constant, so the read and the write cannot drift apart. */
|
|
30
|
+
const CHANNEL = "MOBILE";
|
|
31
|
+
|
|
32
|
+
/** `note` is the line under a row's switch — only a locked topic has one. */
|
|
33
|
+
interface Row { id: string; name: string; subtitle: string; note: string; on: boolean; locked: boolean;
|
|
34
|
+
/** Inverse of `locked` (hiddenWhen hides on TRUE) and the plain On/Off a locked row shows. */
|
|
35
|
+
notLocked: boolean; stateLabel: string }
|
|
36
|
+
interface S extends LoadFlags {
|
|
37
|
+
preferencesMember: MemberAccess | null;
|
|
38
|
+
topics: Row[]; emptyText: string; actionMessage: string;
|
|
39
|
+
isMock: boolean; notMock: boolean; /** #2849 — hiddenWhen() hides on TRUE, so these are inverted: the empty-state banner
|
|
40
|
+
* shows only when the site really has none, and the unavailable one only when the
|
|
41
|
+
* query failed. A failed query must never render the sentence that claims the
|
|
42
|
+
* customer has no content. */
|
|
43
|
+
notMockEmpty: boolean; notMockUnavailable: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Whether this topic is actually being DELIVERED — not merely what the recipient
|
|
47
|
+
* asked for. `isDeliveredNow` prefers the server's `granted` verdict, so a topic the
|
|
48
|
+
* member unmuted under a channel-wide mute renders OFF instead of promising a
|
|
49
|
+
* notification that will never arrive. No preference row at all ⇒ the topic's default,
|
|
50
|
+
* which is delivery. */
|
|
51
|
+
function isOn(topicId: string, prefs: PreferenceInfo[]): boolean {
|
|
52
|
+
const p = preferenceFor(topicId, prefs, CHANNEL);
|
|
53
|
+
if (!p) return true;
|
|
54
|
+
return isDeliveredNow(p.stateData);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** A row the server says cannot be changed here (a broader rule overrides it). */
|
|
58
|
+
function locked(topicId: string, prefs: PreferenceInfo[]): boolean {
|
|
59
|
+
return isLocked(preferenceFor(topicId, prefs, CHANNEL)?.stateData);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Row subtitle doubles as an affordance: current state + how to change it. */
|
|
63
|
+
function subtitleFor(on: boolean): string {
|
|
64
|
+
return on ? "On · tap to mute" : "Off · tap to enable";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function row(id: string, name: string, on: boolean): Row {
|
|
68
|
+
return { id, name, subtitle: subtitleFor(on), note: "", on, locked: false, notLocked: true, stateLabel: on ? "On" : "Off" };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function norm(t: NotificationTopicDefinition, prefs: PreferenceInfo[]): Row {
|
|
72
|
+
const name = (t.displayName || "Notification").trim() || "Notification";
|
|
73
|
+
const id = t.topicId || name;
|
|
74
|
+
const r = row(id, name, isOn(id, prefs));
|
|
75
|
+
// An overridden row says so instead of offering a toggle that cannot take effect.
|
|
76
|
+
return locked(id, prefs)
|
|
77
|
+
? { ...r, locked: true, notLocked: false, subtitle: "Managed by your channel settings", note: "Managed by your channel settings" }
|
|
78
|
+
: r;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const MOCK: Row[] = [
|
|
82
|
+
row("sample-orders", "Order updates", true),
|
|
83
|
+
row("sample-bookings", "Bookings & reminders", true),
|
|
84
|
+
row("sample-promos", "Promotions & offers", false),
|
|
85
|
+
row("sample-community", "Community activity", true),
|
|
86
|
+
];
|
|
87
|
+
|
|
88
|
+
/** sample rows reach the screen ONLY in the host's explicit sample preview;
|
|
89
|
+
* a failed or empty query is an honest error / empty state (branded-load-state.ts). */
|
|
90
|
+
const COPY: LoadCopy<Row> = {
|
|
91
|
+
prefix: "notifsettings",
|
|
92
|
+
empty: "No notification topics to manage yet.",
|
|
93
|
+
error: "Notification settings couldn't be loaded.",
|
|
94
|
+
signIn: "Sign in to manage your notifications.",
|
|
95
|
+
sample: () => MOCK.map((r) => ({ ...r })),
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const defineService = withOnlineWrites(registerService, ["toggle"], { messageFields: ["actionMessage"] });
|
|
99
|
+
const INITIAL = { ...LOADING, topics: [] as Row[], emptyText: "", actionMessage: "", preferencesMember: null };
|
|
100
|
+
const signInRequired = () => new Error("Unauthenticated: sign in to manage notifications");
|
|
101
|
+
let loadVersion = 0;
|
|
102
|
+
const svc = defineService<S, {
|
|
103
|
+
prepare: (s: S) => S;
|
|
104
|
+
load: (s: S, arg?: unknown) => Promise<S | undefined>;
|
|
105
|
+
toggle: (s: S, p?: { id?: string; value?: unknown }) => Promise<S | undefined>;
|
|
106
|
+
}>("himiBrandedNotifSettings", withEmptyFlags({
|
|
107
|
+
state: INITIAL,
|
|
108
|
+
actions: {
|
|
109
|
+
prepare: (s) => ({ ...s, ...INITIAL }),
|
|
110
|
+
load: async (s, arg): Promise<S | undefined> => {
|
|
111
|
+
stashCopy(arg);
|
|
112
|
+
const version = ++loadVersion;
|
|
113
|
+
await svc.prepare();
|
|
114
|
+
try {
|
|
115
|
+
const member = await memberAccess();
|
|
116
|
+
if (!member.email) throw signInRequired();
|
|
117
|
+
const [topicsRes, prefsRes] = await Promise.all([
|
|
118
|
+
getNotificationTopics(),
|
|
119
|
+
getMyNotificationPreferences(),
|
|
120
|
+
]);
|
|
121
|
+
await assertMemberAccess(member);
|
|
122
|
+
const prefs = readPreferences(prefsRes);
|
|
123
|
+
const topics = readTopics(topicsRes).map((t) => norm(t, prefs));
|
|
124
|
+
return version === loadVersion ? { ...s, ...loaded("topics", topics, COPY), preferencesMember: member, actionMessage: "" } : undefined;
|
|
125
|
+
} catch {
|
|
126
|
+
const member = await memberAccess();
|
|
127
|
+
// An authenticated denial is not repaired by an endless sign-in loop.
|
|
128
|
+
const failure = member.email ? new Error(COPY.error) : signInRequired();
|
|
129
|
+
return version === loadVersion ? { ...s, ...loadFailed("topics", failure, COPY), preferencesMember: null, actionMessage: "" } : undefined;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
// Flip one topic's On/Off. Optimistic (updates the row immediately); the real
|
|
133
|
+
// upsert is best-effort and a no-op on sample rows.
|
|
134
|
+
toggle: async (s, p): Promise<S | undefined> => {
|
|
135
|
+
const id = p?.id;
|
|
136
|
+
const target = s.topics.find((r) => r.id === id);
|
|
137
|
+
if (s.busy || !id || !target || target.locked) return undefined;
|
|
138
|
+
if (!s.isMock) {
|
|
139
|
+
try {
|
|
140
|
+
if (!s.preferencesMember) return undefined;
|
|
141
|
+
await assertMemberAccess(s.preferencesMember);
|
|
142
|
+
if (svc.getState().preferencesMember !== s.preferencesMember) return undefined;
|
|
143
|
+
} catch {
|
|
144
|
+
await svc.load();
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
let nextOn = true;
|
|
149
|
+
const topics = s.topics.map((r) => {
|
|
150
|
+
if (r.id !== id) return r;
|
|
151
|
+
// A Toggle sends the NEXT state as `value` (action-payload contract); honour it so
|
|
152
|
+
// a repeated event can never flip the row the wrong way. A bare tap still flips.
|
|
153
|
+
nextOn = typeof p?.value === "boolean" ? p.value : !r.on;
|
|
154
|
+
return { ...r, on: nextOn, subtitle: subtitleFor(nextOn), stateLabel: nextOn ? "On" : "Off" };
|
|
155
|
+
});
|
|
156
|
+
if (!s.isMock && !id.startsWith("sample-")) {
|
|
157
|
+
try {
|
|
158
|
+
// `stateData.state` is a SCALAR enum — the old nested `{ muteStatus }` was a
|
|
159
|
+
// shape this service does not have, so every write was malformed.
|
|
160
|
+
await upsertMyNotificationPreferences([
|
|
161
|
+
{ topicId: id, channel: CHANNEL, stateData: { state: muteStatusFor(nextOn) } },
|
|
162
|
+
]);
|
|
163
|
+
} catch { /* keep the optimistic state */ }
|
|
164
|
+
try { await assertMemberAccess(s.preferencesMember!); }
|
|
165
|
+
catch { await svc.load(); return undefined; }
|
|
166
|
+
}
|
|
167
|
+
return svc.getState().preferencesMember === s.preferencesMember ? { ...svc.getState(), topics } : undefined;
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
}, { topics: "noTopics" }));
|
|
171
|
+
svc.prepare();
|
|
172
|
+
svc.load();
|
|
173
|
+
export { svc };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
1
2
|
import { paymentSetupMessage } from "../_shared/payment-setup.js";
|
|
2
3
|
import { offlineWriteMessage, offlineWritesEnabled, withOnlineWrites } from "../_shared/online-actions.js";
|
|
3
4
|
import { connectivity } from "@himalaya/state";
|
|
@@ -140,7 +141,7 @@ function planRow(plan: WixPlan): PlanRow {
|
|
|
140
141
|
return {
|
|
141
142
|
id: plan.id || "",
|
|
142
143
|
name,
|
|
143
|
-
description: (plan.description
|
|
144
|
+
description: descriptionBody(plan.description).bodyText,
|
|
144
145
|
trialBadge,
|
|
145
146
|
noTrialBadge: !trialBadge,
|
|
146
147
|
priceLine: money(plan),
|
|
@@ -16,6 +16,7 @@ import { isBridgeUnavailable } from "../_shared/owner-load-error.js";
|
|
|
16
16
|
import { isProductSaved, toggleSavedProduct } from "../_shared/himi-store-saved.js";
|
|
17
17
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
18
18
|
import { descriptionBody } from "../_shared/rich-body.js";
|
|
19
|
+
import { PRODUCT_DETAIL_FIELDS, productInfoSections, type ProductInfoSection } from "../_shared/store-product-info.js";
|
|
19
20
|
|
|
20
21
|
// Offline-first (data-offline): the detail is a public READ-THROUGH — when the live
|
|
21
22
|
// product fetch fails (offline) fall back to the last-synced row the catalog cached
|
|
@@ -231,6 +232,7 @@ interface S {
|
|
|
231
232
|
wasPriceEmpty: boolean;
|
|
232
233
|
noSku: boolean;
|
|
233
234
|
skuLabel: string;
|
|
235
|
+
infoSections: ProductInfoSection[];
|
|
234
236
|
returnPolicyBody: string;
|
|
235
237
|
shippingInfoBody: string;
|
|
236
238
|
noReturnPolicyBody: boolean;
|
|
@@ -544,6 +546,7 @@ const svc = defineService<S, {
|
|
|
544
546
|
wasPriceEmpty: false,
|
|
545
547
|
skuLabel: "",
|
|
546
548
|
noSku: true,
|
|
549
|
+
infoSections: [],
|
|
547
550
|
returnPolicyBody: "",
|
|
548
551
|
shippingInfoBody: "",
|
|
549
552
|
noReturnPolicyBody: true,
|
|
@@ -631,7 +634,7 @@ const svc = defineService<S, {
|
|
|
631
634
|
// Storage problems must not prevent browsing or buying a product.
|
|
632
635
|
let saved = false;
|
|
633
636
|
try { saved = isProductSaved(id); } catch { /* save action reports a retryable error */ }
|
|
634
|
-
s = { ...s, saved, saveHint: "", shareHint: "", adding: false, added: false, addedSheetPresented: false, quantity: 1, showOptionErrors: false, optionValidationRequest: 0, optionValidationTarget: "", galleryIndex: 0, returnPolicyExpanded: false, shippingInfoExpanded: false };
|
|
637
|
+
s = { ...s, saved, saveHint: "", shareHint: "", adding: false, added: false, addedSheetPresented: false, quantity: 1, showOptionErrors: false, optionValidationRequest: 0, optionValidationTarget: "", galleryIndex: 0, returnPolicyExpanded: false, shippingInfoExpanded: false, ...(id !== lastLoadedId ? { infoSections: [] } : {}) };
|
|
635
638
|
// A fresh navigation into the product resets any quantity left over
|
|
636
639
|
// from a previous visit to the same worker instance.
|
|
637
640
|
if (!id) {
|
|
@@ -648,8 +651,8 @@ const svc = defineService<S, {
|
|
|
648
651
|
void cartCount.then((n) => { cartKnown = n; }, () => {});
|
|
649
652
|
// The live product read goes out FIRST too — the local-db read below must never delay it.
|
|
650
653
|
// Settled into a value so a failure is handled where it is awaited, never unhandled.
|
|
651
|
-
//
|
|
652
|
-
const live = getStoreProduct(id, [
|
|
654
|
+
// Widen the default fieldset with the V3 Ricos description, the Product Info sections and choice-linked images (a V1 catalog ignores them).
|
|
655
|
+
const live = getStoreProduct(id, [...PRODUCT_DETAIL_FIELDS, "PRODUCT_CHOICES_DISPLAY_IMAGE"]).then(
|
|
653
656
|
(r) => ({ ok: true as const, r }),
|
|
654
657
|
() => ({ ok: false as const }),
|
|
655
658
|
);
|
|
@@ -712,6 +715,7 @@ const svc = defineService<S, {
|
|
|
712
715
|
...sale,
|
|
713
716
|
commercePrice: sale.price,
|
|
714
717
|
skuLabel: skuOf(p) ? `SKU: ${skuOf(p)}` : "",
|
|
718
|
+
infoSections: productInfoSections(p, base.infoSections),
|
|
715
719
|
returnPolicyBody: productPolicyBody(p, "returns") || copyParam("product.returnPolicyBody", "") || copyParam("product.policyUnavailable", "Policy details have not been provided by this store."),
|
|
716
720
|
shippingInfoBody: productPolicyBody(p, "shipping") || copyParam("product.shippingInfoBody", "") || copyParam("product.policyUnavailable", "Policy details have not been provided by this store."),
|
|
717
721
|
...productBody(p),
|
|
@@ -746,6 +750,7 @@ const svc = defineService<S, {
|
|
|
746
750
|
price: String(synced.subtitle ?? ""),
|
|
747
751
|
wasPrice: "",
|
|
748
752
|
skuLabel: "",
|
|
753
|
+
infoSections: [],
|
|
749
754
|
returnPolicyBody: "",
|
|
750
755
|
shippingInfoBody: "",
|
|
751
756
|
description: "",
|
|
@@ -768,6 +773,12 @@ const svc = defineService<S, {
|
|
|
768
773
|
const quantity = parseQuantity(argValue(arg, "value"));
|
|
769
774
|
return quantity ? derive({ ...s, quantity }) : s;
|
|
770
775
|
},
|
|
776
|
+
toggleInfoSection: (s, arg) => {
|
|
777
|
+
const id = argValue(arg, "id");
|
|
778
|
+
if (!s.infoSections.some(section => section.id === id && !section.noTitle)) return s;
|
|
779
|
+
return derive({ ...s, infoSections: s.infoSections.map(section => section.id === id
|
|
780
|
+
? { ...section, expanded: !section.expanded, collapsed: section.expanded } : section) });
|
|
781
|
+
},
|
|
771
782
|
toggleReturnPolicy: s => derive({ ...s, returnPolicyExpanded: !s.returnPolicyExpanded }),
|
|
772
783
|
toggleShippingInfo: s => derive({ ...s, shippingInfoExpanded: !s.shippingInfoExpanded }),
|
|
773
784
|
// One chip row per option group. `group` is the descriptor slot ("1".."3");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
1
2
|
// Tier-5 bundle: Wix Spaces clone — Pricing plan detail (ON-DEVICE, site-scoped).
|
|
2
3
|
// himalaya.input.id carries the plan id.
|
|
3
4
|
//
|
|
@@ -53,7 +54,7 @@ const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesPlanDetail",
|
|
|
53
54
|
const p = await readPlan(id);
|
|
54
55
|
if (!p) return { ...s, status: "ready", ...presence("missing") };
|
|
55
56
|
const perks = (p.perks?.values ?? []).map((v) => `• ${v}`).join("\n");
|
|
56
|
-
return { status: "ready", name: p.name || "Plan", price: priceOf(p), description: p.description
|
|
57
|
+
return { status: "ready", name: p.name || "Plan", price: priceOf(p), description: descriptionBody(p.description).bodyText, perks, ...presence("found") };
|
|
57
58
|
} catch (e) { return { ...s, status: "ready", ...presenceAfterError(e) }; }
|
|
58
59
|
},
|
|
59
60
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
1
2
|
// Tier-5 bundle: Wix Spaces clone — What's New (ON-DEVICE, account-level).
|
|
2
3
|
import { defineService } from "@himalaya/state";
|
|
3
4
|
import { withEmptyFlags } from "../_shared/empty-flags.js";
|
|
@@ -8,7 +9,7 @@ interface S { status: "loading" | "ready"; items: Row[]; emptyText: string; /**
|
|
|
8
9
|
|
|
9
10
|
function norm(a: WixAnnouncement, i: number): Row {
|
|
10
11
|
const aa = a as unknown as { id?: string; title?: string; bodyText?: string; description?: string };
|
|
11
|
-
return { id: aa.id || `a${i}`, name: aa.title || "Announcement", subtitle: aa.description
|
|
12
|
+
return { id: aa.id || `a${i}`, name: aa.title || "Announcement", subtitle: descriptionBody(aa.description, descriptionBody(aa.bodyText).bodyText).bodyText };
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesWhatsNew", withEmptyFlags({
|
|
@@ -80795,6 +80795,35 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
80795
80795
|
}
|
|
80796
80796
|
}
|
|
80797
80797
|
},
|
|
80798
|
+
{
|
|
80799
|
+
"id": "service_form.description_note",
|
|
80800
|
+
"body": {
|
|
80801
|
+
"package": "himalaya",
|
|
80802
|
+
"type": "Text",
|
|
80803
|
+
"props": {
|
|
80804
|
+
"text": "$service:himiOwnerLiteServiceForm.descriptionNote",
|
|
80805
|
+
"style": "footnote",
|
|
80806
|
+
"color": "textSecondary",
|
|
80807
|
+
"collapseWhenEmpty": true
|
|
80808
|
+
}
|
|
80809
|
+
}
|
|
80810
|
+
},
|
|
80811
|
+
{
|
|
80812
|
+
"id": "service_form.description_preview",
|
|
80813
|
+
"body": {
|
|
80814
|
+
"package": "himalaya",
|
|
80815
|
+
"type": "Text",
|
|
80816
|
+
"props": {
|
|
80817
|
+
"text": "$service:himiOwnerLiteServiceForm.description",
|
|
80818
|
+
"style": "body",
|
|
80819
|
+
"maxLines": 8,
|
|
80820
|
+
"collapseWhenEmpty": true
|
|
80821
|
+
}
|
|
80822
|
+
},
|
|
80823
|
+
"modifiers": {
|
|
80824
|
+
"hiddenPath": "$service:himiOwnerLiteServiceForm.descriptionEditable"
|
|
80825
|
+
}
|
|
80826
|
+
},
|
|
80798
80827
|
{
|
|
80799
80828
|
"id": "service_form.form",
|
|
80800
80829
|
"body": {
|
|
@@ -80839,6 +80868,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
80839
80868
|
"multilineMaxLines": 3
|
|
80840
80869
|
}
|
|
80841
80870
|
}
|
|
80871
|
+
},
|
|
80872
|
+
"modifiers": {
|
|
80873
|
+
"hiddenPath": "$service:himiOwnerLiteServiceForm.descriptionProtected"
|
|
80842
80874
|
}
|
|
80843
80875
|
}
|
|
80844
80876
|
],
|
|
@@ -82857,6 +82889,51 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
82857
82889
|
}
|
|
82858
82890
|
}
|
|
82859
82891
|
},
|
|
82892
|
+
{
|
|
82893
|
+
"id": "product_body",
|
|
82894
|
+
"body": {
|
|
82895
|
+
"package": "himalaya",
|
|
82896
|
+
"type": "RichContent",
|
|
82897
|
+
"props": {
|
|
82898
|
+
"documentJsonPath": "$service:himiOwnerLiteProduct.bodyJson",
|
|
82899
|
+
"onLink": {
|
|
82900
|
+
"actionId": "tier5.himiOwnerLiteProduct.openLink"
|
|
82901
|
+
},
|
|
82902
|
+
"fallback": {
|
|
82903
|
+
"id": "",
|
|
82904
|
+
"body": {
|
|
82905
|
+
"package": "himalaya",
|
|
82906
|
+
"type": "Text",
|
|
82907
|
+
"props": {
|
|
82908
|
+
"text": "$service:himiOwnerLiteProduct.bodyText",
|
|
82909
|
+
"style": "body",
|
|
82910
|
+
"color": "textPrimary",
|
|
82911
|
+
"collapseWhenEmpty": true
|
|
82912
|
+
}
|
|
82913
|
+
}
|
|
82914
|
+
}
|
|
82915
|
+
}
|
|
82916
|
+
},
|
|
82917
|
+
"modifiers": {
|
|
82918
|
+
"hiddenPath": "$service:himiOwnerLiteProduct.noBodyJson"
|
|
82919
|
+
}
|
|
82920
|
+
},
|
|
82921
|
+
{
|
|
82922
|
+
"id": "product_body_text",
|
|
82923
|
+
"body": {
|
|
82924
|
+
"package": "himalaya",
|
|
82925
|
+
"type": "Text",
|
|
82926
|
+
"props": {
|
|
82927
|
+
"text": "$service:himiOwnerLiteProduct.bodyText",
|
|
82928
|
+
"style": "body",
|
|
82929
|
+
"color": "textPrimary",
|
|
82930
|
+
"collapseWhenEmpty": true
|
|
82931
|
+
}
|
|
82932
|
+
},
|
|
82933
|
+
"modifiers": {
|
|
82934
|
+
"hiddenPath": "$service:himiOwnerLiteProduct.hasBodyJson"
|
|
82935
|
+
}
|
|
82936
|
+
},
|
|
82860
82937
|
{
|
|
82861
82938
|
"id": "product_info_card",
|
|
82862
82939
|
"body": {
|
|
@@ -83279,7 +83356,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
83279
83356
|
"contentType": "application/javascript+ts-bundle",
|
|
83280
83357
|
"declaredCapabilities": [
|
|
83281
83358
|
"wix_api",
|
|
83282
|
-
"local_database"
|
|
83359
|
+
"local_database",
|
|
83360
|
+
"open_url"
|
|
83283
83361
|
],
|
|
83284
83362
|
"minBinaryVersion": "0.1.0",
|
|
83285
83363
|
"bundleVersion": "0.0.1"
|
|
@@ -83859,6 +83937,51 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
83859
83937
|
}
|
|
83860
83938
|
}
|
|
83861
83939
|
},
|
|
83940
|
+
{
|
|
83941
|
+
"id": "service_body",
|
|
83942
|
+
"body": {
|
|
83943
|
+
"package": "himalaya",
|
|
83944
|
+
"type": "RichContent",
|
|
83945
|
+
"props": {
|
|
83946
|
+
"documentJsonPath": "$service:himiOwnerLiteService.bodyJson",
|
|
83947
|
+
"onLink": {
|
|
83948
|
+
"actionId": "tier5.himiOwnerLiteService.openLink"
|
|
83949
|
+
},
|
|
83950
|
+
"fallback": {
|
|
83951
|
+
"id": "",
|
|
83952
|
+
"body": {
|
|
83953
|
+
"package": "himalaya",
|
|
83954
|
+
"type": "Text",
|
|
83955
|
+
"props": {
|
|
83956
|
+
"text": "$service:himiOwnerLiteService.bodyText",
|
|
83957
|
+
"style": "body",
|
|
83958
|
+
"color": "textPrimary",
|
|
83959
|
+
"collapseWhenEmpty": true
|
|
83960
|
+
}
|
|
83961
|
+
}
|
|
83962
|
+
}
|
|
83963
|
+
}
|
|
83964
|
+
},
|
|
83965
|
+
"modifiers": {
|
|
83966
|
+
"hiddenPath": "$service:himiOwnerLiteService.noBodyJson"
|
|
83967
|
+
}
|
|
83968
|
+
},
|
|
83969
|
+
{
|
|
83970
|
+
"id": "service_body_text",
|
|
83971
|
+
"body": {
|
|
83972
|
+
"package": "himalaya",
|
|
83973
|
+
"type": "Text",
|
|
83974
|
+
"props": {
|
|
83975
|
+
"text": "$service:himiOwnerLiteService.bodyText",
|
|
83976
|
+
"style": "body",
|
|
83977
|
+
"color": "textPrimary",
|
|
83978
|
+
"collapseWhenEmpty": true
|
|
83979
|
+
}
|
|
83980
|
+
},
|
|
83981
|
+
"modifiers": {
|
|
83982
|
+
"hiddenPath": "$service:himiOwnerLiteService.hasBodyJson"
|
|
83983
|
+
}
|
|
83984
|
+
},
|
|
83862
83985
|
{
|
|
83863
83986
|
"id": "service_info_card",
|
|
83864
83987
|
"body": {
|
|
@@ -84046,70 +84169,6 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
84046
84169
|
"modifiers": {
|
|
84047
84170
|
"hiddenPath": "$service:himiOwnerLiteService.capacityBlank"
|
|
84048
84171
|
}
|
|
84049
|
-
},
|
|
84050
|
-
{
|
|
84051
|
-
"id": "",
|
|
84052
|
-
"body": {
|
|
84053
|
-
"package": "himalaya",
|
|
84054
|
-
"type": "Divider",
|
|
84055
|
-
"props": {}
|
|
84056
|
-
},
|
|
84057
|
-
"modifiers": {
|
|
84058
|
-
"hiddenPath": "$service:himiOwnerLiteService.descriptionNoDivider"
|
|
84059
|
-
}
|
|
84060
|
-
},
|
|
84061
|
-
{
|
|
84062
|
-
"id": "service_row_description",
|
|
84063
|
-
"body": {
|
|
84064
|
-
"package": "himalaya",
|
|
84065
|
-
"type": "HStack",
|
|
84066
|
-
"props": {
|
|
84067
|
-
"spacing": 0,
|
|
84068
|
-
"children": [
|
|
84069
|
-
{
|
|
84070
|
-
"id": "",
|
|
84071
|
-
"body": {
|
|
84072
|
-
"package": "himalaya",
|
|
84073
|
-
"type": "Text",
|
|
84074
|
-
"props": {
|
|
84075
|
-
"text": "Description",
|
|
84076
|
-
"style": "footnote",
|
|
84077
|
-
"color": "textSecondary"
|
|
84078
|
-
}
|
|
84079
|
-
},
|
|
84080
|
-
"modifiers": {
|
|
84081
|
-
"padding": {
|
|
84082
|
-
"trailing": 10
|
|
84083
|
-
}
|
|
84084
|
-
}
|
|
84085
|
-
},
|
|
84086
|
-
{
|
|
84087
|
-
"id": "",
|
|
84088
|
-
"body": {
|
|
84089
|
-
"package": "himalaya",
|
|
84090
|
-
"type": "Spacer",
|
|
84091
|
-
"props": {}
|
|
84092
|
-
}
|
|
84093
|
-
},
|
|
84094
|
-
{
|
|
84095
|
-
"id": "",
|
|
84096
|
-
"body": {
|
|
84097
|
-
"package": "himalaya",
|
|
84098
|
-
"type": "Text",
|
|
84099
|
-
"props": {
|
|
84100
|
-
"text": "$service:himiOwnerLiteService.description",
|
|
84101
|
-
"style": "bodyEmphasis",
|
|
84102
|
-
"maxLines": 1,
|
|
84103
|
-
"collapseWhenEmpty": true
|
|
84104
|
-
}
|
|
84105
|
-
}
|
|
84106
|
-
}
|
|
84107
|
-
]
|
|
84108
|
-
}
|
|
84109
|
-
},
|
|
84110
|
-
"modifiers": {
|
|
84111
|
-
"hiddenPath": "$service:himiOwnerLiteService.descriptionBlank"
|
|
84112
|
-
}
|
|
84113
84172
|
}
|
|
84114
84173
|
]
|
|
84115
84174
|
}
|
|
@@ -84230,7 +84289,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
84230
84289
|
"contentType": "application/javascript+ts-bundle",
|
|
84231
84290
|
"declaredCapabilities": [
|
|
84232
84291
|
"wix_api",
|
|
84233
|
-
"local_database"
|
|
84292
|
+
"local_database",
|
|
84293
|
+
"open_url"
|
|
84234
84294
|
],
|
|
84235
84295
|
"minBinaryVersion": "0.1.0",
|
|
84236
84296
|
"bundleVersion": "0.0.1"
|
|
@@ -84695,6 +84755,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
84695
84755
|
}
|
|
84696
84756
|
}
|
|
84697
84757
|
}
|
|
84758
|
+
},
|
|
84759
|
+
"modifiers": {
|
|
84760
|
+
"hiddenPath": "$service:himiOwnerLitePost.noBodyJson"
|
|
84698
84761
|
}
|
|
84699
84762
|
},
|
|
84700
84763
|
{
|
|
@@ -19,6 +19,8 @@ export interface CollectionConfig {
|
|
|
19
19
|
/** Numeric 0–5 row field rendered as a Rating (accessible "N out of 5") instead of
|
|
20
20
|
* folding a "★★★★☆" glyph string into the metadata line, so screen readers get a value. */
|
|
21
21
|
rating?: string;
|
|
22
|
+
/** Domain-provided calendar text and its unavailable flag, kept separate from media. */
|
|
23
|
+
dateBadge?: { text: string; hidden: string };
|
|
22
24
|
sectioned?: boolean;
|
|
23
25
|
view: 'list' | 'grid';
|
|
24
26
|
backendQuery?: boolean;
|
|
@@ -38,7 +40,13 @@ export interface CollectionConfig {
|
|
|
38
40
|
/** The card's primary verb, shown as a visible button beside the overflow.
|
|
39
41
|
* `screenId` opens that screen with the row id; without it the verb reuses the
|
|
40
42
|
* row's own tap action (the detail screen that owns the verb). */
|
|
41
|
-
primaryVerb?: { label: string; screenId?: string
|
|
43
|
+
primaryVerb?: { label: string; screenId?: string;
|
|
44
|
+
/** A row field holding THIS row's verb label (Register, RSVP, Buy Tickets…); `label` stays the fallback copy. */
|
|
45
|
+
labelPath?: string;
|
|
46
|
+
/** A row boolean that hides the verb on rows that offer no action (an event with no registration). */
|
|
47
|
+
hiddenPath?: string };
|
|
48
|
+
/** The worker action that shares a row (`tier5.<service>.<name>` with `{ id }`): adds Share to the card's overflow menu. */
|
|
49
|
+
shareAction?: string;
|
|
42
50
|
/** A TIME-BOUND entity (an event, a booking, a reservation): the boolean row field the
|
|
43
51
|
* DOMAIN sets once the record has finished — computed by the same rule as the row's own
|
|
44
52
|
* "Past" label, in the same place, so the two cannot disagree. A finished
|
|
@@ -73,7 +81,7 @@ export const COLLECTIONS: Record<string, CollectionConfig> = {
|
|
|
73
81
|
himiBookingBookings: { rows: 'rows', title: 'title', subtitle: 'subtitle', metadata: ['status'], view: 'list', backendQuery: true,
|
|
74
82
|
defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search by booking ID', countNoun: ['booking', 'bookings'], filterValues: ['Upcoming', 'Past', 'Cancelled'],
|
|
75
83
|
sortLabels: { default: 'Soonest', az: 'Oldest', za: 'Latest' } },
|
|
76
|
-
himiEvents: { rows: 'results', title: 'title', subtitle: 'dateLine', image: 'image', view: 'grid', backendQuery: true, defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search events', countNoun: ['event', 'events'], filterValues: ['Upcoming', 'Past'], sortLabels: { default: 'Date', az: 'Title A–Z', za: 'Title Z–A' }, primaryVerb: { label: 'Register' }, endedWhen: 'isPast' },
|
|
84
|
+
himiEvents: { rows: 'results', title: 'title', subtitle: 'dateLine', image: 'image', dateBadge: { text: 'dateBadge', hidden: 'noDateBadge' }, gridColumns: 1, view: 'grid', backendQuery: true, defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search events', countNoun: ['event', 'events'], filterValues: ['Upcoming', 'Past'], sortLabels: { default: 'Date', az: 'Title A–Z', za: 'Title Z–A' }, primaryVerb: { label: 'Register', labelPath: 'actionLabel', hiddenPath: 'noAction' }, shareAction: 'share', endedWhen: 'isPast' },
|
|
77
85
|
himiBlogFeed: { rows: 'posts', title: 'title', subtitle: 'excerpt', image: 'image', filter: 'category', filterValuesFrom: 'categories', view: 'grid', narrowedBy: 'selectedCategoryId' },
|
|
78
86
|
himiOwnerLiteProducts: { rows: 'products', title: 'name', subtitle: 'price', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'] },
|
|
79
87
|
himiOwnerModules: { instanceInput: 'module', rows: 'rows', title: 'title', subtitle: 'subtitle', image: 'image', filter: 'statusLabel', view: 'list', paged: true, reviewAction: 'prepareRecord', reviewSelectedAction: 'prepareSelected' },
|
|
@@ -208,7 +216,15 @@ export function projectCollection(source: CollectionRow[], config: CollectionCon
|
|
|
208
216
|
...(config.endedWhen ? (() => {
|
|
209
217
|
const ended = row[config.endedWhen] === true || (config.endedWhen === 'isPast' && row.statusLabel === 'Past');
|
|
210
218
|
return { collectionEnded: ended, collectionNotEnded: !ended };
|
|
211
|
-
})() : {})
|
|
219
|
+
})() : {}),
|
|
220
|
+
// A row restored from state saved by an older build has no badge flag. An unset hidden flag
|
|
221
|
+
// fails open and would paint an empty chip, so it reads as "no badge" until a refresh.
|
|
222
|
+
...(config.dateBadge && typeof row[config.dateBadge.hidden] !== 'boolean'
|
|
223
|
+
? { [config.dateBadge.text]: '', [config.dateBadge.hidden]: true } : {}),
|
|
224
|
+
// Same for a per-row verb: an unset hidden flag fails open and would show a verb with an unresolved
|
|
225
|
+
// label, so a row without the flag offers no action until a refresh establishes one.
|
|
226
|
+
...(config.primaryVerb?.hiddenPath && typeof row[config.primaryVerb.hiddenPath] !== 'boolean'
|
|
227
|
+
? { ...(config.primaryVerb.labelPath ? { [config.primaryVerb.labelPath]: '' } : {}), [config.primaryVerb.hiddenPath]: true } : {}) })),
|
|
212
228
|
filters, loaded: rows.length,
|
|
213
229
|
};
|
|
214
230
|
}
|
|
@@ -55,6 +55,7 @@ interface PostState {
|
|
|
55
55
|
bodyJson: string;
|
|
56
56
|
/** bodyJson !== "" — gates the plain text, because RichContent draws nothing for "". */
|
|
57
57
|
hasBodyJson: boolean;
|
|
58
|
+
noBodyJson: boolean;
|
|
58
59
|
/** Plain text of the body: RichContent's `fallback`, and the offline copy's body. */
|
|
59
60
|
bodyText: string;
|
|
60
61
|
// Info rows
|
|
@@ -151,6 +152,7 @@ function shapeFields(s: Partial<PostState>): PostState {
|
|
|
151
152
|
image,
|
|
152
153
|
bodyJson: s.bodyJson ?? "",
|
|
153
154
|
hasBodyJson: !!s.bodyJson,
|
|
155
|
+
noBodyJson: !s.bodyJson,
|
|
154
156
|
bodyText: s.bodyText ?? "",
|
|
155
157
|
postStatus: s.postStatus ?? statusLabel(raw),
|
|
156
158
|
category: s.category ?? "—",
|
|
@@ -485,4 +487,9 @@ if ((globalThis as { himalaya?: { hydrationOptOut?: unknown } }).himalaya?.hydra
|
|
|
485
487
|
if (booted && typeof booted === "object") Object.assign(booted, { deletePending: false, noDeleteConfirmation: true });
|
|
486
488
|
}
|
|
487
489
|
|
|
490
|
+
// Hydration shallow-merges older snapshots over defaults; derive both body gates from
|
|
491
|
+
// the restored document before the first paint, without waiting for a load action.
|
|
492
|
+
const bootedBody = svc.getState();
|
|
493
|
+
Object.assign(bootedBody, { hasBodyJson: !!bootedBody.bodyJson, noBodyJson: !bootedBody.bodyJson });
|
|
494
|
+
|
|
488
495
|
export { svc };
|