@wix/himalaya-cli 0.1583.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/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/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 +247 -186
- package/dist/preview-assets.generated.bin +0 -0
- package/fixtures/wix-canned.json +25 -0
- 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 +7 -0
- package/templates/beauty-salon/dev/index.ts +758 -352
- package/templates/beauty-salon/himalaya.content.json +3 -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-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 +9 -0
- package/templates/branded-lite/dev/index.ts +4988 -3304
- package/templates/branded-lite/himalaya.content.json +3 -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-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 +16 -0
- 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 +16 -0
- 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 +7 -0
- package/templates/gym-fitness/dev/index.ts +1115 -278
- package/templates/gym-fitness/himalaya.content.json +3 -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-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 +16 -0
- 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 +7 -0
- 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 +7 -0
- 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 +7 -0
- 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 +7 -0
- 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 +7 -0
- package/templates/yoga-studio/dev/index.ts +1107 -110
- package/templates/yoga-studio/himalaya.content.json +3 -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-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
|
@@ -5,6 +5,8 @@ import { getAll, upsert, type DbEntity } from "@himalaya/local-db";
|
|
|
5
5
|
import { normalizeEvent, type EventRow } from "../_shared/himi-events";
|
|
6
6
|
import { offsetPage } from "../_shared/offset-page.js";
|
|
7
7
|
import { copyParam } from "../_shared/himi-copy.js";
|
|
8
|
+
import { eventPageUrlOf, registrationUi } from "../_shared/event-registration.js";
|
|
9
|
+
import { share as shareSheet } from "@himalaya/share";
|
|
8
10
|
|
|
9
11
|
// Offline-first (data-offline): the public events list is a read-through catalog —
|
|
10
12
|
// paint the last-synced rows from the on-device store first (instant, works offline),
|
|
@@ -13,8 +15,37 @@ import { copyParam } from "../_shared/himi-copy.js";
|
|
|
13
15
|
// (+ declared the `events` entity in its dataSchema) just falls back to today's
|
|
14
16
|
// online-only path — the try/catch is the seam that keeps this shared bundle safe.
|
|
15
17
|
const ENTITY = "events";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
interface ListEventRow extends EventRow {
|
|
19
|
+
dateBadge: string; noDateBadge: boolean;
|
|
20
|
+
/** This card's verb (Register / RSVP / Buy Tickets / Join Waitlist) from the SAME rule the detail uses; hidden when none applies. */
|
|
21
|
+
actionLabel: string; noAction: boolean;
|
|
22
|
+
/** The event page URL (when the payload carries one) for Share. */
|
|
23
|
+
shareUrl: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// The day monogram is a title initial for undated events. Only an actual calendar
|
|
27
|
+
// date becomes a badge; derive it for old cached rows too, without a cache migration.
|
|
28
|
+
// The month must be the three-letter abbreviation: rows cached by an older worker on an
|
|
29
|
+
// Intl-less engine can hold a whole "11/10/2030, 12:00:00 PM" there.
|
|
30
|
+
function withDateBadge(row: EventRow): ListEventRow {
|
|
31
|
+
const dated = typeof row.month === "string" && /^[A-Z]{3}$/.test(row.month)
|
|
32
|
+
&& /^(?:[1-9]|[12]\d|3[01])$/.test(row.day);
|
|
33
|
+
const known = row as Partial<ListEventRow>;
|
|
34
|
+
// Rows cached by an older build carry no registration data: they show no verb until a refresh, never a wrong one.
|
|
35
|
+
return { ...row, dateBadge: dated ? `${row.day}\n${row.month}` : "", noDateBadge: !dated,
|
|
36
|
+
actionLabel: known.actionLabel ?? "", noAction: known.noAction ?? true, shareUrl: known.shareUrl ?? "" };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The card's action, from the event's own registration (REGISTRATION + URLS fieldsets). Cancelled, ended,
|
|
40
|
+
* closed, sold-out and registration-less events offer none, so a card never promises "Register" the detail refuses. */
|
|
41
|
+
function withRegistration(raw: WixEvent, row: ListEventRow): ListEventRow {
|
|
42
|
+
const ui = registrationUi(raw, Date.now());
|
|
43
|
+
const offers = ui.state !== "notice" && ui.state !== "none" && ui.state !== "scheduled" && !!ui.label;
|
|
44
|
+
return { ...row, actionLabel: offers ? ui.label : "", noAction: !offers, shareUrl: eventPageUrlOf(raw) };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function readCached(): Promise<ListEventRow[]> {
|
|
48
|
+
try { return ((await getAll(ENTITY)) as unknown as EventRow[]).map(withDateBadge); } catch { return []; }
|
|
18
49
|
}
|
|
19
50
|
async function writeCached(rows: EventRow[]): Promise<void> {
|
|
20
51
|
try { for (const r of rows) await upsert(ENTITY, r as unknown as DbEntity); } catch { /* capability not granted → online-only */ }
|
|
@@ -22,12 +53,12 @@ async function writeCached(rows: EventRow[]): Promise<void> {
|
|
|
22
53
|
|
|
23
54
|
interface S {
|
|
24
55
|
status: "loading" | "ready";
|
|
25
|
-
query: string; all:
|
|
56
|
+
query: string; all: ListEventRow[]; results: ListEventRow[]; emptyText: string; countLabel: string;
|
|
26
57
|
errored: boolean; notErrored: boolean; isLoading: boolean; notLoading: boolean; noEmpty: boolean;
|
|
27
58
|
nextCursor?: string; complete?: boolean; total?: number; loadingMore?: boolean; pageError?: boolean; fromCache?: boolean;
|
|
28
59
|
}
|
|
29
60
|
let queryNow = new Date().toISOString();
|
|
30
|
-
const svc = defineBackendCollection<S,
|
|
61
|
+
const svc = defineBackendCollection<S, ListEventRow>("himiEvents", {
|
|
31
62
|
restorePagesOnLoad: true,
|
|
32
63
|
state: { status: "loading", query: "", all: [], results: [], emptyText: "", countLabel: "", errored: false, notErrored: true,
|
|
33
64
|
isLoading: true, notLoading: false, noEmpty: true },
|
|
@@ -62,10 +93,10 @@ const svc = defineBackendCollection<S, EventRow>("himiEvents", {
|
|
|
62
93
|
];
|
|
63
94
|
}
|
|
64
95
|
if (criteria.filter === "value:Past") filter["dateAndTimeSettings.startDate"] = { $lt: queryNow };
|
|
65
|
-
const res = await queryEvents({ limit: 50, offset: Number(cursor || 0), query: { filter,
|
|
96
|
+
const res = await queryEvents({ limit: 50, offset: Number(cursor || 0), fields: ["DETAILS", "REGISTRATION", "URLS"], query: { filter,
|
|
66
97
|
sort: [{ fieldName: criteria.sort === "default" ? "dateAndTimeSettings.startDate" : "title", order: criteria.sort === "za" ? "DESC" : "ASC" }, { fieldName: "id", order: "ASC" }] } });
|
|
67
98
|
const raw = res.events ?? [];
|
|
68
|
-
const items = raw.filter(row => !!row.id).map(normalizeEvent);
|
|
99
|
+
const items = raw.filter(row => !!row.id).map(row => withRegistration(row, withDateBadge(normalizeEvent(row))));
|
|
69
100
|
await writeCached(items);
|
|
70
101
|
const metadata = (res as { pagingMetadata?: { total?: number } }).pagingMetadata;
|
|
71
102
|
return { items, ...offsetPage(cursor, raw.length, 50, metadata), metadata: { fromCache: false } };
|
|
@@ -78,6 +109,16 @@ const svc = defineBackendCollection<S, EventRow>("himiEvents", {
|
|
|
78
109
|
fromCache: page.metadata?.fromCache === true, errored, notErrored: !errored, isLoading: loading, notLoading: !loading,
|
|
79
110
|
noEmpty: true, countLabel: "", emptyText: errored ? copyParam("events.errorText", "Events could not be loaded.") : "" };
|
|
80
111
|
},
|
|
112
|
+
actions: {
|
|
113
|
+
// Share a card's event: its title and date line, plus the event page when the payload carried one.
|
|
114
|
+
share: async (s, arg) => {
|
|
115
|
+
const id = typeof arg === "string" ? arg : String((arg as { id?: unknown } | undefined)?.id ?? "");
|
|
116
|
+
const row = s.results.find(item => item.id === id);
|
|
117
|
+
if (!row) return undefined;
|
|
118
|
+
try { await shareSheet({ subject: row.title, text: [row.title, row.dateLine].filter(Boolean).join(" — "), ...(row.shareUrl ? { url: row.shareUrl } : {}) }); } catch { /* the sheet is best-effort: nothing to undo */ }
|
|
119
|
+
return undefined;
|
|
120
|
+
},
|
|
121
|
+
},
|
|
81
122
|
});
|
|
82
123
|
svc.load();
|
|
83
124
|
export { svc };
|
|
@@ -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({
|
|
@@ -83433,6 +83433,35 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
83433
83433
|
}
|
|
83434
83434
|
}
|
|
83435
83435
|
},
|
|
83436
|
+
{
|
|
83437
|
+
"id": "service_form.description_note",
|
|
83438
|
+
"body": {
|
|
83439
|
+
"package": "himalaya",
|
|
83440
|
+
"type": "Text",
|
|
83441
|
+
"props": {
|
|
83442
|
+
"text": "$service:himiOwnerLiteServiceForm.descriptionNote",
|
|
83443
|
+
"style": "footnote",
|
|
83444
|
+
"color": "textSecondary",
|
|
83445
|
+
"collapseWhenEmpty": true
|
|
83446
|
+
}
|
|
83447
|
+
}
|
|
83448
|
+
},
|
|
83449
|
+
{
|
|
83450
|
+
"id": "service_form.description_preview",
|
|
83451
|
+
"body": {
|
|
83452
|
+
"package": "himalaya",
|
|
83453
|
+
"type": "Text",
|
|
83454
|
+
"props": {
|
|
83455
|
+
"text": "$service:himiOwnerLiteServiceForm.description",
|
|
83456
|
+
"style": "body",
|
|
83457
|
+
"maxLines": 8,
|
|
83458
|
+
"collapseWhenEmpty": true
|
|
83459
|
+
}
|
|
83460
|
+
},
|
|
83461
|
+
"modifiers": {
|
|
83462
|
+
"hiddenPath": "$service:himiOwnerLiteServiceForm.descriptionEditable"
|
|
83463
|
+
}
|
|
83464
|
+
},
|
|
83436
83465
|
{
|
|
83437
83466
|
"id": "service_form.form",
|
|
83438
83467
|
"body": {
|
|
@@ -83477,6 +83506,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
83477
83506
|
"multilineMaxLines": 3
|
|
83478
83507
|
}
|
|
83479
83508
|
}
|
|
83509
|
+
},
|
|
83510
|
+
"modifiers": {
|
|
83511
|
+
"hiddenPath": "$service:himiOwnerLiteServiceForm.descriptionProtected"
|
|
83480
83512
|
}
|
|
83481
83513
|
}
|
|
83482
83514
|
],
|
|
@@ -85858,6 +85890,51 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
85858
85890
|
}
|
|
85859
85891
|
}
|
|
85860
85892
|
},
|
|
85893
|
+
{
|
|
85894
|
+
"id": "product_body",
|
|
85895
|
+
"body": {
|
|
85896
|
+
"package": "himalaya",
|
|
85897
|
+
"type": "RichContent",
|
|
85898
|
+
"props": {
|
|
85899
|
+
"documentJsonPath": "$service:himiOwnerLiteProduct.bodyJson",
|
|
85900
|
+
"onLink": {
|
|
85901
|
+
"actionId": "tier5.himiOwnerLiteProduct.openLink"
|
|
85902
|
+
},
|
|
85903
|
+
"fallback": {
|
|
85904
|
+
"id": "",
|
|
85905
|
+
"body": {
|
|
85906
|
+
"package": "himalaya",
|
|
85907
|
+
"type": "Text",
|
|
85908
|
+
"props": {
|
|
85909
|
+
"text": "$service:himiOwnerLiteProduct.bodyText",
|
|
85910
|
+
"style": "body",
|
|
85911
|
+
"color": "textPrimary",
|
|
85912
|
+
"collapseWhenEmpty": true
|
|
85913
|
+
}
|
|
85914
|
+
}
|
|
85915
|
+
}
|
|
85916
|
+
}
|
|
85917
|
+
},
|
|
85918
|
+
"modifiers": {
|
|
85919
|
+
"hiddenPath": "$service:himiOwnerLiteProduct.noBodyJson"
|
|
85920
|
+
}
|
|
85921
|
+
},
|
|
85922
|
+
{
|
|
85923
|
+
"id": "product_body_text",
|
|
85924
|
+
"body": {
|
|
85925
|
+
"package": "himalaya",
|
|
85926
|
+
"type": "Text",
|
|
85927
|
+
"props": {
|
|
85928
|
+
"text": "$service:himiOwnerLiteProduct.bodyText",
|
|
85929
|
+
"style": "body",
|
|
85930
|
+
"color": "textPrimary",
|
|
85931
|
+
"collapseWhenEmpty": true
|
|
85932
|
+
}
|
|
85933
|
+
},
|
|
85934
|
+
"modifiers": {
|
|
85935
|
+
"hiddenPath": "$service:himiOwnerLiteProduct.hasBodyJson"
|
|
85936
|
+
}
|
|
85937
|
+
},
|
|
85861
85938
|
{
|
|
85862
85939
|
"id": "product_info_card",
|
|
85863
85940
|
"body": {
|
|
@@ -86280,7 +86357,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
86280
86357
|
"contentType": "application/javascript+ts-bundle",
|
|
86281
86358
|
"declaredCapabilities": [
|
|
86282
86359
|
"wix_api",
|
|
86283
|
-
"local_database"
|
|
86360
|
+
"local_database",
|
|
86361
|
+
"open_url"
|
|
86284
86362
|
],
|
|
86285
86363
|
"minBinaryVersion": "0.1.0",
|
|
86286
86364
|
"bundleVersion": "0.0.1"
|
|
@@ -86860,6 +86938,51 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
86860
86938
|
}
|
|
86861
86939
|
}
|
|
86862
86940
|
},
|
|
86941
|
+
{
|
|
86942
|
+
"id": "service_body",
|
|
86943
|
+
"body": {
|
|
86944
|
+
"package": "himalaya",
|
|
86945
|
+
"type": "RichContent",
|
|
86946
|
+
"props": {
|
|
86947
|
+
"documentJsonPath": "$service:himiOwnerLiteService.bodyJson",
|
|
86948
|
+
"onLink": {
|
|
86949
|
+
"actionId": "tier5.himiOwnerLiteService.openLink"
|
|
86950
|
+
},
|
|
86951
|
+
"fallback": {
|
|
86952
|
+
"id": "",
|
|
86953
|
+
"body": {
|
|
86954
|
+
"package": "himalaya",
|
|
86955
|
+
"type": "Text",
|
|
86956
|
+
"props": {
|
|
86957
|
+
"text": "$service:himiOwnerLiteService.bodyText",
|
|
86958
|
+
"style": "body",
|
|
86959
|
+
"color": "textPrimary",
|
|
86960
|
+
"collapseWhenEmpty": true
|
|
86961
|
+
}
|
|
86962
|
+
}
|
|
86963
|
+
}
|
|
86964
|
+
}
|
|
86965
|
+
},
|
|
86966
|
+
"modifiers": {
|
|
86967
|
+
"hiddenPath": "$service:himiOwnerLiteService.noBodyJson"
|
|
86968
|
+
}
|
|
86969
|
+
},
|
|
86970
|
+
{
|
|
86971
|
+
"id": "service_body_text",
|
|
86972
|
+
"body": {
|
|
86973
|
+
"package": "himalaya",
|
|
86974
|
+
"type": "Text",
|
|
86975
|
+
"props": {
|
|
86976
|
+
"text": "$service:himiOwnerLiteService.bodyText",
|
|
86977
|
+
"style": "body",
|
|
86978
|
+
"color": "textPrimary",
|
|
86979
|
+
"collapseWhenEmpty": true
|
|
86980
|
+
}
|
|
86981
|
+
},
|
|
86982
|
+
"modifiers": {
|
|
86983
|
+
"hiddenPath": "$service:himiOwnerLiteService.hasBodyJson"
|
|
86984
|
+
}
|
|
86985
|
+
},
|
|
86863
86986
|
{
|
|
86864
86987
|
"id": "service_info_card",
|
|
86865
86988
|
"body": {
|
|
@@ -87047,70 +87170,6 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
87047
87170
|
"modifiers": {
|
|
87048
87171
|
"hiddenPath": "$service:himiOwnerLiteService.capacityBlank"
|
|
87049
87172
|
}
|
|
87050
|
-
},
|
|
87051
|
-
{
|
|
87052
|
-
"id": "",
|
|
87053
|
-
"body": {
|
|
87054
|
-
"package": "himalaya",
|
|
87055
|
-
"type": "Divider",
|
|
87056
|
-
"props": {}
|
|
87057
|
-
},
|
|
87058
|
-
"modifiers": {
|
|
87059
|
-
"hiddenPath": "$service:himiOwnerLiteService.descriptionNoDivider"
|
|
87060
|
-
}
|
|
87061
|
-
},
|
|
87062
|
-
{
|
|
87063
|
-
"id": "service_row_description",
|
|
87064
|
-
"body": {
|
|
87065
|
-
"package": "himalaya",
|
|
87066
|
-
"type": "HStack",
|
|
87067
|
-
"props": {
|
|
87068
|
-
"spacing": 0,
|
|
87069
|
-
"children": [
|
|
87070
|
-
{
|
|
87071
|
-
"id": "",
|
|
87072
|
-
"body": {
|
|
87073
|
-
"package": "himalaya",
|
|
87074
|
-
"type": "Text",
|
|
87075
|
-
"props": {
|
|
87076
|
-
"text": "Description",
|
|
87077
|
-
"style": "footnote",
|
|
87078
|
-
"color": "textSecondary"
|
|
87079
|
-
}
|
|
87080
|
-
},
|
|
87081
|
-
"modifiers": {
|
|
87082
|
-
"padding": {
|
|
87083
|
-
"trailing": 10
|
|
87084
|
-
}
|
|
87085
|
-
}
|
|
87086
|
-
},
|
|
87087
|
-
{
|
|
87088
|
-
"id": "",
|
|
87089
|
-
"body": {
|
|
87090
|
-
"package": "himalaya",
|
|
87091
|
-
"type": "Spacer",
|
|
87092
|
-
"props": {}
|
|
87093
|
-
}
|
|
87094
|
-
},
|
|
87095
|
-
{
|
|
87096
|
-
"id": "",
|
|
87097
|
-
"body": {
|
|
87098
|
-
"package": "himalaya",
|
|
87099
|
-
"type": "Text",
|
|
87100
|
-
"props": {
|
|
87101
|
-
"text": "$service:himiOwnerLiteService.description",
|
|
87102
|
-
"style": "bodyEmphasis",
|
|
87103
|
-
"maxLines": 1,
|
|
87104
|
-
"collapseWhenEmpty": true
|
|
87105
|
-
}
|
|
87106
|
-
}
|
|
87107
|
-
}
|
|
87108
|
-
]
|
|
87109
|
-
}
|
|
87110
|
-
},
|
|
87111
|
-
"modifiers": {
|
|
87112
|
-
"hiddenPath": "$service:himiOwnerLiteService.descriptionBlank"
|
|
87113
|
-
}
|
|
87114
87173
|
}
|
|
87115
87174
|
]
|
|
87116
87175
|
}
|
|
@@ -87231,7 +87290,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
87231
87290
|
"contentType": "application/javascript+ts-bundle",
|
|
87232
87291
|
"declaredCapabilities": [
|
|
87233
87292
|
"wix_api",
|
|
87234
|
-
"local_database"
|
|
87293
|
+
"local_database",
|
|
87294
|
+
"open_url"
|
|
87235
87295
|
],
|
|
87236
87296
|
"minBinaryVersion": "0.1.0",
|
|
87237
87297
|
"bundleVersion": "0.0.1"
|
|
@@ -87696,6 +87756,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
87696
87756
|
}
|
|
87697
87757
|
}
|
|
87698
87758
|
}
|
|
87759
|
+
},
|
|
87760
|
+
"modifiers": {
|
|
87761
|
+
"hiddenPath": "$service:himiOwnerLiteEvent.noBodyJson"
|
|
87699
87762
|
}
|
|
87700
87763
|
},
|
|
87701
87764
|
{
|
|
@@ -88705,6 +88768,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
88705
88768
|
}
|
|
88706
88769
|
}
|
|
88707
88770
|
}
|
|
88771
|
+
},
|
|
88772
|
+
"modifiers": {
|
|
88773
|
+
"hiddenPath": "$service:himiOwnerLitePost.noBodyJson"
|
|
88708
88774
|
}
|
|
88709
88775
|
},
|
|
88710
88776
|
{
|
|
@@ -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
|
}
|
|
@@ -12,7 +12,7 @@ import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback, ownerWriteError,
|
|
|
12
12
|
import { DEMO_EVENTS, DEMO_NOTE, DEMO_SAVE_NOTE } from "../_shared/owner-preview-demo.js";
|
|
13
13
|
import { stashCopy, copyParam } from "../_shared/himi-copy.js";
|
|
14
14
|
import { openRichLink } from "../_shared/rich-content-link.js";
|
|
15
|
-
import {
|
|
15
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
16
16
|
import { get as dbGet, upsert as dbUpsert, remove as dbRemove, type DbEntity } from "../_shared/owner-local-db.js";
|
|
17
17
|
import { blankFlags } from "../_shared/detail-facts.js";
|
|
18
18
|
|
|
@@ -41,6 +41,7 @@ interface EventState {
|
|
|
41
41
|
bodyJson: string;
|
|
42
42
|
/** bodyJson !== "" — gates the plain text, because RichContent draws nothing for "". */
|
|
43
43
|
hasBodyJson: boolean;
|
|
44
|
+
noBodyJson: boolean;
|
|
44
45
|
/** The description's plain text (the document's own text, else the legacy description). */
|
|
45
46
|
bodyText: string;
|
|
46
47
|
initial: string;
|
|
@@ -68,15 +69,15 @@ interface EventState {
|
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
71
|
-
/** [rico] #3499 — keep the description
|
|
72
|
+
/** [rico] #3499 — keep the description pair with the event's cached row, so the offline detail shows it.
|
|
72
73
|
* Merged into the row the events list (or the form) wrote rather than replacing it; with no row yet, the
|
|
73
74
|
* loaded detail's own fields become one. */
|
|
74
75
|
async function cacheBodyText(s: EventState): Promise<void> {
|
|
75
76
|
if (s.status !== "ready" || !s.id) return;
|
|
76
77
|
const prev = await cacheGet(s.id);
|
|
77
|
-
await cachePut(prev ? { ...prev, bodyText: s.bodyText } : {
|
|
78
|
+
await cachePut(prev ? { ...prev, bodyText: s.bodyText, bodyJson: s.bodyJson } : {
|
|
78
79
|
id: s.id, title: s.title, subtitle: s.subtitle, image: s.image, dateLine: s.dateLine, location: s.location,
|
|
79
|
-
statusLabel: s.statusLabel, registration: s.registration, bodyText: s.bodyText,
|
|
80
|
+
statusLabel: s.statusLabel, registration: s.registration, bodyText: s.bodyText, bodyJson: s.bodyJson,
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
function idFrom(arg: unknown, fallback = ""): string {
|
|
@@ -132,6 +133,7 @@ function shapeFields(s: Partial<EventState>): EventState {
|
|
|
132
133
|
summary: s.summary ?? "",
|
|
133
134
|
bodyJson: s.bodyJson ?? "",
|
|
134
135
|
hasBodyJson: !!s.bodyJson,
|
|
136
|
+
noBodyJson: !s.bodyJson,
|
|
135
137
|
bodyText: s.bodyText ?? "",
|
|
136
138
|
initial: s.initial ?? "?",
|
|
137
139
|
image,
|
|
@@ -186,6 +188,7 @@ function cachedDetail(s: EventState, row: DbEntity): EventState {
|
|
|
186
188
|
const title = String(row.title ?? row.name ?? "");
|
|
187
189
|
const dateLine = String(row.dateLine ?? row.when ?? "");
|
|
188
190
|
const location = String(row.location ?? "");
|
|
191
|
+
const body = descriptionBody(row.bodyJson || row.description, descriptionBody(row.bodyText ?? row.summary).bodyText);
|
|
189
192
|
return shape({
|
|
190
193
|
...s,
|
|
191
194
|
id: String(row.id),
|
|
@@ -193,8 +196,8 @@ function cachedDetail(s: EventState, row: DbEntity): EventState {
|
|
|
193
196
|
title,
|
|
194
197
|
subtitle: String(row.subtitle ?? [dateLine, location].filter((x) => x && x !== "—").join(" · ")),
|
|
195
198
|
summary: "",
|
|
196
|
-
bodyJson:
|
|
197
|
-
bodyText:
|
|
199
|
+
bodyJson: body.bodyJson,
|
|
200
|
+
bodyText: body.bodyText,
|
|
198
201
|
initial: String(row.initial ?? (title[0] || "?")).slice(0, 1).toUpperCase(),
|
|
199
202
|
image: String(row.image ?? ""),
|
|
200
203
|
dateLine: dateLine || "—",
|
|
@@ -216,9 +219,9 @@ async function refresh(prev: EventState, id: string): Promise<EventState> {
|
|
|
216
219
|
}
|
|
217
220
|
const row = normalizeEvent(ev); // reuses date/location/status normalization
|
|
218
221
|
const image = /^https?:\/\//.test(row.image) ? row.image : "";
|
|
219
|
-
const { bodyJson, bodyText } =
|
|
222
|
+
const { bodyJson, bodyText } = descriptionBody((ev as unknown as { description?: unknown }).description, descriptionBody(eventDescription({ ...ev, description: undefined })).bodyText);
|
|
220
223
|
// The teaser stays above the body only when it says something the body does not.
|
|
221
|
-
const teaser =
|
|
224
|
+
const teaser = descriptionBody((ev as any).shortDescription).bodyText;
|
|
222
225
|
return shape({
|
|
223
226
|
...prev,
|
|
224
227
|
id,
|
|
@@ -358,4 +361,9 @@ if ((globalThis as { himalaya?: { hydrationOptOut?: unknown } }).himalaya?.hydra
|
|
|
358
361
|
if (booted && typeof booted === "object") Object.assign(booted, { deletePending: false, noDeleteConfirmation: true });
|
|
359
362
|
}
|
|
360
363
|
|
|
364
|
+
// Hydration shallow-merges older snapshots over defaults; derive both body gates from
|
|
365
|
+
// the restored document before the first paint, without waiting for a load action.
|
|
366
|
+
const bootedBody = svc.getState();
|
|
367
|
+
Object.assign(bootedBody, { hasBodyJson: !!bootedBody.bodyJson, noBodyJson: !bootedBody.bodyJson });
|
|
368
|
+
|
|
361
369
|
export { svc };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { descriptionBody } from "../_shared/rich-body.js";
|
|
1
2
|
// Tier-5 bundle: __HIMI_APP_NAME__ — Events event EDIT form (the CRUD "U" only).
|
|
2
3
|
// Modeled on himi-blog-owner-editor. Opened from the event detail ("Edit").
|
|
3
4
|
//
|
|
@@ -222,12 +223,16 @@ const svc = defineService<EventFormState, {
|
|
|
222
223
|
// this form never writes, so showing them here would invite an edit that lands elsewhere.
|
|
223
224
|
...(() => {
|
|
224
225
|
const raw = (ev as unknown as { description?: unknown }).description;
|
|
225
|
-
const doc =
|
|
226
|
-
const text =
|
|
226
|
+
const doc = parseRicosJson(raw);
|
|
227
|
+
const text = descriptionBody(raw).bodyText;
|
|
227
228
|
// Edited in the RichContentEditor, seeded with the event's own document byte for byte (never
|
|
228
229
|
// re-encoded); a legacy string seeds as paragraphs, and none seeds an empty editor.
|
|
229
|
-
|
|
230
|
-
|
|
230
|
+
// A description that looks like a serialized document but does not read as one (malformed JSON,
|
|
231
|
+
// or an object that is not a document) is locked, as on the Product form: an empty editor would
|
|
232
|
+
// let a save replace it. A blank or tag-only string stays editable so the owner can write the first one.
|
|
233
|
+
const unreadable = !doc && !text && raw != null && (typeof raw !== "string" || /^\s*[{[]/.test(raw));
|
|
234
|
+
return { ...DESCRIPTION_LOADED, description: text, originalDescription: text, descriptionMode: unreadable ? "locked" as const : "editor" as const,
|
|
235
|
+
descriptionJson: unreadable ? "" : doc ? JSON.stringify(doc) : text ? docJson(plainPostBody(text)) : "" };
|
|
231
236
|
})(),
|
|
232
237
|
when: row.dateLine || "—",
|
|
233
238
|
location: row.location || "—",
|
|
@@ -239,14 +244,18 @@ const svc = defineService<EventFormState, {
|
|
|
239
244
|
// Offline: prefill from the last-synced local cache before the demo/error fallbacks.
|
|
240
245
|
const cached = await cacheGet(id);
|
|
241
246
|
if (cached) {
|
|
247
|
+
// Only `descriptionJson` is the document as Wix returned it. The detail's `bodyJson` is the encoder's
|
|
248
|
+
// DISPLAY copy (media resized to urls), so it feeds the preview text and never seeds the editor.
|
|
249
|
+
const doc = parseRicosJson(cached.descriptionJson);
|
|
250
|
+
const description = descriptionBody(doc ?? cached.bodyJson, descriptionBody(cached.description ?? cached.bodyText ?? cached.summary).bodyText).bodyText;
|
|
242
251
|
return shape({
|
|
243
252
|
...s, mode, id, heading: "Edit event",
|
|
244
253
|
title: String(cached.title ?? cached.name ?? ""),
|
|
245
|
-
description
|
|
246
|
-
originalDescription:
|
|
254
|
+
description,
|
|
255
|
+
originalDescription: description, ...DESCRIPTION_LOADED,
|
|
247
256
|
// A row cached with its document reopens in the editor. An older row has none, so its verdict
|
|
248
257
|
// decides: plain when it was plain, else locked (it carries no verdict either: fail closed).
|
|
249
|
-
...(
|
|
258
|
+
...(doc ? { descriptionMode: "editor" as const, descriptionJson: JSON.stringify(doc) }
|
|
250
259
|
: { descriptionMode: cached.descriptionProtected === "false" ? "plain" as const : "locked" as const, descriptionJson: "" }),
|
|
251
260
|
when: String(cached.when ?? cached.dateLine ?? "—"),
|
|
252
261
|
location: String(cached.location ?? "—"),
|
|
@@ -9,7 +9,7 @@ import { normalizeEvent, type EventRow } from "../_shared/himi-events.js";
|
|
|
9
9
|
import { ownerLoadError, isOwnerPreviewDemo, ownerDemoFallback } from "../_shared/owner-load-error.js";
|
|
10
10
|
import { DEMO_EVENTS, DEMO_NOTE } from "../_shared/owner-preview-demo.js";
|
|
11
11
|
import { copyParam } from "../_shared/himi-copy.js";
|
|
12
|
-
import { getAll, upsert, type DbEntity } from "../_shared/owner-local-db.js";
|
|
12
|
+
import { get, getAll, upsert, type DbEntity } from "../_shared/owner-local-db.js";
|
|
13
13
|
|
|
14
14
|
// Last-synced rows are an explicitly incomplete fallback for an unfiltered
|
|
15
15
|
// request during an outage. Filtered pages never claim this cache is complete.
|
|
@@ -19,7 +19,9 @@ async function readCachedRows(): Promise<EventRow[]> {
|
|
|
19
19
|
try { return (await getAll(ENTITY)) as unknown as EventRow[]; } catch { return []; }
|
|
20
20
|
}
|
|
21
21
|
async function writeCachedRows(rows: EventRow[]): Promise<void> {
|
|
22
|
-
try {
|
|
22
|
+
try {
|
|
23
|
+
for (const r of rows) await upsert(ENTITY, { ...await get(ENTITY, r.id), ...r } as unknown as DbEntity);
|
|
24
|
+
} catch { /* capability not granted → online-only */ }
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
interface EventsState {
|
|
@@ -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 };
|