@wix/himalaya-cli 0.1776.0 → 0.1778.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/cli.mjs +456 -69
- package/guides/himi-json-output.md +4 -1
- package/guides/one-app-section-mappings.md +5 -8
- package/guides/one-app-to-himi-app.md +29 -10
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +2 -2
- package/templates/beauty-salon/l10n/ar.json +5 -0
- package/templates/beauty-salon/l10n/cs.json +5 -0
- package/templates/beauty-salon/l10n/da.json +5 -0
- package/templates/beauty-salon/l10n/de.json +5 -0
- package/templates/beauty-salon/l10n/el.json +5 -0
- package/templates/beauty-salon/l10n/es.json +5 -0
- package/templates/beauty-salon/l10n/fi.json +5 -0
- package/templates/beauty-salon/l10n/fr.json +5 -0
- package/templates/beauty-salon/l10n/he.json +4 -0
- package/templates/beauty-salon/l10n/hu.json +5 -0
- package/templates/beauty-salon/l10n/id.json +5 -0
- package/templates/beauty-salon/l10n/it.json +5 -0
- package/templates/beauty-salon/l10n/ja.json +5 -0
- package/templates/beauty-salon/l10n/ko.json +5 -0
- package/templates/beauty-salon/l10n/lt.json +5 -0
- package/templates/beauty-salon/l10n/nl.json +5 -0
- package/templates/beauty-salon/l10n/no.json +5 -0
- package/templates/beauty-salon/l10n/pl.json +5 -0
- package/templates/beauty-salon/l10n/pt.json +5 -0
- package/templates/beauty-salon/l10n/ru.json +5 -0
- package/templates/beauty-salon/l10n/sv.json +5 -0
- package/templates/beauty-salon/l10n/th.json +5 -0
- package/templates/beauty-salon/l10n/tr.json +5 -0
- package/templates/beauty-salon/l10n/uk.json +5 -0
- package/templates/beauty-salon/l10n/vi.json +5 -0
- package/templates/beauty-salon/l10n/zh.json +5 -0
- package/templates/beauty-salon/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/branded-lite/dev/index.ts +2 -2
- package/templates/branded-lite/l10n/ar.json +15 -0
- package/templates/branded-lite/l10n/cs.json +15 -0
- package/templates/branded-lite/l10n/da.json +15 -0
- package/templates/branded-lite/l10n/de.json +15 -0
- package/templates/branded-lite/l10n/el.json +15 -0
- package/templates/branded-lite/l10n/es.json +15 -0
- package/templates/branded-lite/l10n/fi.json +15 -0
- package/templates/branded-lite/l10n/fr.json +15 -0
- package/templates/branded-lite/l10n/he.json +12 -0
- package/templates/branded-lite/l10n/hu.json +15 -0
- package/templates/branded-lite/l10n/id.json +15 -0
- package/templates/branded-lite/l10n/it.json +15 -0
- package/templates/branded-lite/l10n/ja.json +15 -0
- package/templates/branded-lite/l10n/ko.json +15 -0
- package/templates/branded-lite/l10n/lt.json +15 -0
- package/templates/branded-lite/l10n/nl.json +15 -0
- package/templates/branded-lite/l10n/no.json +15 -0
- package/templates/branded-lite/l10n/pl.json +15 -0
- package/templates/branded-lite/l10n/pt.json +15 -0
- package/templates/branded-lite/l10n/ru.json +15 -0
- package/templates/branded-lite/l10n/sv.json +15 -0
- package/templates/branded-lite/l10n/th.json +15 -0
- package/templates/branded-lite/l10n/tr.json +15 -0
- package/templates/branded-lite/l10n/uk.json +15 -0
- package/templates/branded-lite/l10n/vi.json +15 -0
- package/templates/branded-lite/l10n/zh.json +15 -0
- package/templates/branded-lite/recipes/blog-categories.json +115 -0
- package/templates/branded-lite/recipes/event-schedule.json +114 -0
- package/templates/branded-lite/recipes/groups-newsfeed.json +245 -0
- package/templates/branded-lite/recipes/loyalty-offering.json +241 -0
- package/templates/branded-lite/recipes/loyalty-status.json +173 -0
- package/templates/branded-lite/recipes/members-carousel.json +144 -0
- package/templates/branded-lite/recipes/performance-tracker.json +325 -0
- package/templates/branded-lite/recipes/podcasts-widget.json +280 -0
- package/templates/branded-lite/recipes/products-search-bar.json +139 -0
- package/templates/branded-lite/recipes/wishlist-grid.json +236 -0
- package/templates/branded-lite/tier5-src/_shared/blog-categories.ts +62 -0
- package/templates/branded-lite/tier5-src/_shared/event-agenda.ts +122 -0
- package/templates/branded-lite/tier5-src/_shared/event-schedule-section.ts +91 -0
- package/templates/branded-lite/tier5-src/_shared/group-feed-section.ts +2 -2
- package/templates/branded-lite/tier5-src/_shared/groups-newsfeed-section.ts +105 -0
- package/templates/branded-lite/tier5-src/_shared/loyalty-offering-section.ts +88 -0
- package/templates/branded-lite/tier5-src/_shared/loyalty-status-section.ts +88 -0
- package/templates/branded-lite/tier5-src/_shared/members-directory.ts +9 -3
- package/templates/branded-lite/tier5-src/_shared/performance-tracker-section.ts +120 -0
- package/templates/branded-lite/tier5-src/_shared/performance-tracker-weeks.ts +71 -0
- package/templates/branded-lite/tier5-src/_shared/podcast-section.ts +131 -0
- package/templates/branded-lite/tier5-src/_shared/saved-products-section.ts +64 -0
- package/templates/branded-lite/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/brandy/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/community-club/dev/index.ts +2 -2
- package/templates/community-club/l10n/ar.json +5 -0
- package/templates/community-club/l10n/cs.json +5 -0
- package/templates/community-club/l10n/da.json +5 -0
- package/templates/community-club/l10n/de.json +5 -0
- package/templates/community-club/l10n/el.json +5 -0
- package/templates/community-club/l10n/es.json +5 -0
- package/templates/community-club/l10n/fi.json +5 -0
- package/templates/community-club/l10n/fr.json +5 -0
- package/templates/community-club/l10n/he.json +4 -0
- package/templates/community-club/l10n/hu.json +5 -0
- package/templates/community-club/l10n/id.json +5 -0
- package/templates/community-club/l10n/it.json +5 -0
- package/templates/community-club/l10n/ja.json +5 -0
- package/templates/community-club/l10n/ko.json +5 -0
- package/templates/community-club/l10n/lt.json +5 -0
- package/templates/community-club/l10n/nl.json +5 -0
- package/templates/community-club/l10n/no.json +5 -0
- package/templates/community-club/l10n/pl.json +5 -0
- package/templates/community-club/l10n/pt.json +5 -0
- package/templates/community-club/l10n/ru.json +5 -0
- package/templates/community-club/l10n/sv.json +5 -0
- package/templates/community-club/l10n/th.json +5 -0
- package/templates/community-club/l10n/tr.json +5 -0
- package/templates/community-club/l10n/uk.json +5 -0
- package/templates/community-club/l10n/vi.json +5 -0
- package/templates/community-club/l10n/zh.json +5 -0
- package/templates/community-club/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/community-club/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/conference/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/events-meetups/dev/index.ts +2 -2
- package/templates/events-meetups/l10n/ar.json +5 -0
- package/templates/events-meetups/l10n/cs.json +5 -0
- package/templates/events-meetups/l10n/da.json +5 -0
- package/templates/events-meetups/l10n/de.json +5 -0
- package/templates/events-meetups/l10n/el.json +5 -0
- package/templates/events-meetups/l10n/es.json +5 -0
- package/templates/events-meetups/l10n/fi.json +5 -0
- package/templates/events-meetups/l10n/fr.json +5 -0
- package/templates/events-meetups/l10n/he.json +4 -0
- package/templates/events-meetups/l10n/hu.json +5 -0
- package/templates/events-meetups/l10n/id.json +5 -0
- package/templates/events-meetups/l10n/it.json +5 -0
- package/templates/events-meetups/l10n/ja.json +5 -0
- package/templates/events-meetups/l10n/ko.json +5 -0
- package/templates/events-meetups/l10n/lt.json +5 -0
- package/templates/events-meetups/l10n/nl.json +5 -0
- package/templates/events-meetups/l10n/no.json +5 -0
- package/templates/events-meetups/l10n/pl.json +5 -0
- package/templates/events-meetups/l10n/pt.json +5 -0
- package/templates/events-meetups/l10n/ru.json +5 -0
- package/templates/events-meetups/l10n/sv.json +5 -0
- package/templates/events-meetups/l10n/th.json +5 -0
- package/templates/events-meetups/l10n/tr.json +5 -0
- package/templates/events-meetups/l10n/uk.json +5 -0
- package/templates/events-meetups/l10n/vi.json +5 -0
- package/templates/events-meetups/l10n/zh.json +5 -0
- package/templates/events-meetups/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/gym-fitness/dev/index.ts +2 -2
- package/templates/gym-fitness/l10n/ar.json +5 -0
- package/templates/gym-fitness/l10n/cs.json +5 -0
- package/templates/gym-fitness/l10n/da.json +5 -0
- package/templates/gym-fitness/l10n/de.json +5 -0
- package/templates/gym-fitness/l10n/el.json +5 -0
- package/templates/gym-fitness/l10n/es.json +5 -0
- package/templates/gym-fitness/l10n/fi.json +5 -0
- package/templates/gym-fitness/l10n/fr.json +5 -0
- package/templates/gym-fitness/l10n/he.json +4 -0
- package/templates/gym-fitness/l10n/hu.json +5 -0
- package/templates/gym-fitness/l10n/id.json +5 -0
- package/templates/gym-fitness/l10n/it.json +5 -0
- package/templates/gym-fitness/l10n/ja.json +5 -0
- package/templates/gym-fitness/l10n/ko.json +5 -0
- package/templates/gym-fitness/l10n/lt.json +5 -0
- package/templates/gym-fitness/l10n/nl.json +5 -0
- package/templates/gym-fitness/l10n/no.json +5 -0
- package/templates/gym-fitness/l10n/pl.json +5 -0
- package/templates/gym-fitness/l10n/pt.json +5 -0
- package/templates/gym-fitness/l10n/ru.json +5 -0
- package/templates/gym-fitness/l10n/sv.json +5 -0
- package/templates/gym-fitness/l10n/th.json +5 -0
- package/templates/gym-fitness/l10n/tr.json +5 -0
- package/templates/gym-fitness/l10n/uk.json +5 -0
- package/templates/gym-fitness/l10n/vi.json +5 -0
- package/templates/gym-fitness/l10n/zh.json +5 -0
- package/templates/gym-fitness/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/medical-services/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/medical-services/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/nonprofit-cause/dev/index.ts +2 -2
- package/templates/nonprofit-cause/l10n/ar.json +5 -0
- package/templates/nonprofit-cause/l10n/cs.json +5 -0
- package/templates/nonprofit-cause/l10n/da.json +5 -0
- package/templates/nonprofit-cause/l10n/de.json +5 -0
- package/templates/nonprofit-cause/l10n/el.json +5 -0
- package/templates/nonprofit-cause/l10n/es.json +5 -0
- package/templates/nonprofit-cause/l10n/fi.json +5 -0
- package/templates/nonprofit-cause/l10n/fr.json +5 -0
- package/templates/nonprofit-cause/l10n/he.json +4 -0
- package/templates/nonprofit-cause/l10n/hu.json +5 -0
- package/templates/nonprofit-cause/l10n/id.json +5 -0
- package/templates/nonprofit-cause/l10n/it.json +5 -0
- package/templates/nonprofit-cause/l10n/ja.json +5 -0
- package/templates/nonprofit-cause/l10n/ko.json +5 -0
- package/templates/nonprofit-cause/l10n/lt.json +5 -0
- package/templates/nonprofit-cause/l10n/nl.json +5 -0
- package/templates/nonprofit-cause/l10n/no.json +5 -0
- package/templates/nonprofit-cause/l10n/pl.json +5 -0
- package/templates/nonprofit-cause/l10n/pt.json +5 -0
- package/templates/nonprofit-cause/l10n/ru.json +5 -0
- package/templates/nonprofit-cause/l10n/sv.json +5 -0
- package/templates/nonprofit-cause/l10n/th.json +5 -0
- package/templates/nonprofit-cause/l10n/tr.json +5 -0
- package/templates/nonprofit-cause/l10n/uk.json +5 -0
- package/templates/nonprofit-cause/l10n/vi.json +5 -0
- package/templates/nonprofit-cause/l10n/zh.json +5 -0
- package/templates/nonprofit-cause/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/personal-fitness-trainer/dev/index.ts +2 -2
- package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/podcast-creator/dev/index.ts +2 -2
- package/templates/podcast-creator/l10n/ar.json +5 -0
- package/templates/podcast-creator/l10n/cs.json +5 -0
- package/templates/podcast-creator/l10n/da.json +5 -0
- package/templates/podcast-creator/l10n/de.json +5 -0
- package/templates/podcast-creator/l10n/el.json +5 -0
- package/templates/podcast-creator/l10n/es.json +5 -0
- package/templates/podcast-creator/l10n/fi.json +5 -0
- package/templates/podcast-creator/l10n/fr.json +5 -0
- package/templates/podcast-creator/l10n/he.json +4 -0
- package/templates/podcast-creator/l10n/hu.json +5 -0
- package/templates/podcast-creator/l10n/id.json +5 -0
- package/templates/podcast-creator/l10n/it.json +5 -0
- package/templates/podcast-creator/l10n/ja.json +5 -0
- package/templates/podcast-creator/l10n/ko.json +5 -0
- package/templates/podcast-creator/l10n/lt.json +5 -0
- package/templates/podcast-creator/l10n/nl.json +5 -0
- package/templates/podcast-creator/l10n/no.json +5 -0
- package/templates/podcast-creator/l10n/pl.json +5 -0
- package/templates/podcast-creator/l10n/pt.json +5 -0
- package/templates/podcast-creator/l10n/ru.json +5 -0
- package/templates/podcast-creator/l10n/sv.json +5 -0
- package/templates/podcast-creator/l10n/th.json +5 -0
- package/templates/podcast-creator/l10n/tr.json +5 -0
- package/templates/podcast-creator/l10n/uk.json +5 -0
- package/templates/podcast-creator/l10n/vi.json +5 -0
- package/templates/podcast-creator/l10n/zh.json +5 -0
- package/templates/podcast-creator/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/portfolio-creative/dev/index.ts +2 -2
- package/templates/portfolio-creative/l10n/ar.json +5 -0
- package/templates/portfolio-creative/l10n/cs.json +5 -0
- package/templates/portfolio-creative/l10n/da.json +5 -0
- package/templates/portfolio-creative/l10n/de.json +5 -0
- package/templates/portfolio-creative/l10n/el.json +5 -0
- package/templates/portfolio-creative/l10n/es.json +5 -0
- package/templates/portfolio-creative/l10n/fi.json +5 -0
- package/templates/portfolio-creative/l10n/fr.json +5 -0
- package/templates/portfolio-creative/l10n/he.json +4 -0
- package/templates/portfolio-creative/l10n/hu.json +5 -0
- package/templates/portfolio-creative/l10n/id.json +5 -0
- package/templates/portfolio-creative/l10n/it.json +5 -0
- package/templates/portfolio-creative/l10n/ja.json +5 -0
- package/templates/portfolio-creative/l10n/ko.json +5 -0
- package/templates/portfolio-creative/l10n/lt.json +5 -0
- package/templates/portfolio-creative/l10n/nl.json +5 -0
- package/templates/portfolio-creative/l10n/no.json +5 -0
- package/templates/portfolio-creative/l10n/pl.json +5 -0
- package/templates/portfolio-creative/l10n/pt.json +5 -0
- package/templates/portfolio-creative/l10n/ru.json +5 -0
- package/templates/portfolio-creative/l10n/sv.json +5 -0
- package/templates/portfolio-creative/l10n/th.json +5 -0
- package/templates/portfolio-creative/l10n/tr.json +5 -0
- package/templates/portfolio-creative/l10n/uk.json +5 -0
- package/templates/portfolio-creative/l10n/vi.json +5 -0
- package/templates/portfolio-creative/l10n/zh.json +5 -0
- package/templates/portfolio-creative/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/restaurant/dev/index.ts +2 -2
- package/templates/restaurant/l10n/ar.json +5 -0
- package/templates/restaurant/l10n/cs.json +5 -0
- package/templates/restaurant/l10n/da.json +5 -0
- package/templates/restaurant/l10n/de.json +5 -0
- package/templates/restaurant/l10n/el.json +5 -0
- package/templates/restaurant/l10n/es.json +5 -0
- package/templates/restaurant/l10n/fi.json +5 -0
- package/templates/restaurant/l10n/fr.json +5 -0
- package/templates/restaurant/l10n/he.json +4 -0
- package/templates/restaurant/l10n/hu.json +5 -0
- package/templates/restaurant/l10n/id.json +5 -0
- package/templates/restaurant/l10n/it.json +5 -0
- package/templates/restaurant/l10n/ja.json +5 -0
- package/templates/restaurant/l10n/ko.json +5 -0
- package/templates/restaurant/l10n/lt.json +5 -0
- package/templates/restaurant/l10n/nl.json +5 -0
- package/templates/restaurant/l10n/no.json +5 -0
- package/templates/restaurant/l10n/pl.json +5 -0
- package/templates/restaurant/l10n/pt.json +5 -0
- package/templates/restaurant/l10n/ru.json +5 -0
- package/templates/restaurant/l10n/sv.json +5 -0
- package/templates/restaurant/l10n/th.json +5 -0
- package/templates/restaurant/l10n/tr.json +5 -0
- package/templates/restaurant/l10n/uk.json +5 -0
- package/templates/restaurant/l10n/vi.json +5 -0
- package/templates/restaurant/l10n/zh.json +5 -0
- package/templates/restaurant/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/retail-store/dev/index.ts +2 -2
- package/templates/retail-store/l10n/ar.json +5 -0
- package/templates/retail-store/l10n/cs.json +5 -0
- package/templates/retail-store/l10n/da.json +5 -0
- package/templates/retail-store/l10n/de.json +5 -0
- package/templates/retail-store/l10n/el.json +5 -0
- package/templates/retail-store/l10n/es.json +5 -0
- package/templates/retail-store/l10n/fi.json +5 -0
- package/templates/retail-store/l10n/fr.json +5 -0
- package/templates/retail-store/l10n/he.json +4 -0
- package/templates/retail-store/l10n/hu.json +5 -0
- package/templates/retail-store/l10n/id.json +5 -0
- package/templates/retail-store/l10n/it.json +5 -0
- package/templates/retail-store/l10n/ja.json +5 -0
- package/templates/retail-store/l10n/ko.json +5 -0
- package/templates/retail-store/l10n/lt.json +5 -0
- package/templates/retail-store/l10n/nl.json +5 -0
- package/templates/retail-store/l10n/no.json +5 -0
- package/templates/retail-store/l10n/pl.json +5 -0
- package/templates/retail-store/l10n/pt.json +5 -0
- package/templates/retail-store/l10n/ru.json +5 -0
- package/templates/retail-store/l10n/sv.json +5 -0
- package/templates/retail-store/l10n/th.json +5 -0
- package/templates/retail-store/l10n/tr.json +5 -0
- package/templates/retail-store/l10n/uk.json +5 -0
- package/templates/retail-store/l10n/vi.json +5 -0
- package/templates/retail-store/l10n/zh.json +5 -0
- package/templates/retail-store/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/salon-spa/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +55 -3
- package/templates/yoga-studio/dev/index.ts +2 -2
- package/templates/yoga-studio/l10n/ar.json +5 -0
- package/templates/yoga-studio/l10n/cs.json +5 -0
- package/templates/yoga-studio/l10n/da.json +5 -0
- package/templates/yoga-studio/l10n/de.json +5 -0
- package/templates/yoga-studio/l10n/el.json +5 -0
- package/templates/yoga-studio/l10n/es.json +5 -0
- package/templates/yoga-studio/l10n/fi.json +5 -0
- package/templates/yoga-studio/l10n/fr.json +5 -0
- package/templates/yoga-studio/l10n/he.json +4 -0
- package/templates/yoga-studio/l10n/hu.json +5 -0
- package/templates/yoga-studio/l10n/id.json +5 -0
- package/templates/yoga-studio/l10n/it.json +5 -0
- package/templates/yoga-studio/l10n/ja.json +5 -0
- package/templates/yoga-studio/l10n/ko.json +5 -0
- package/templates/yoga-studio/l10n/lt.json +5 -0
- package/templates/yoga-studio/l10n/nl.json +5 -0
- package/templates/yoga-studio/l10n/no.json +5 -0
- package/templates/yoga-studio/l10n/pl.json +5 -0
- package/templates/yoga-studio/l10n/pt.json +5 -0
- package/templates/yoga-studio/l10n/ru.json +5 -0
- package/templates/yoga-studio/l10n/sv.json +5 -0
- package/templates/yoga-studio/l10n/th.json +5 -0
- package/templates/yoga-studio/l10n/tr.json +5 -0
- package/templates/yoga-studio/l10n/uk.json +5 -0
- package/templates/yoga-studio/l10n/vi.json +5 -0
- package/templates/yoga-studio/l10n/zh.json +5 -0
- package/templates/yoga-studio/tier5-src/_shared/weekly-goal.ts +7 -3
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +55 -3
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "The One App store search section: a search bar that opens the shop (its search field, filters and sort), and an optional filter button that opens the shop too. The bar is a tap target, not a field: the source opens its own search screen from it. ONE node, always mounted; the generator removes the filter button when the source hides sort and filter. No service.",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"id": "unique node id prefix for this section",
|
|
5
|
+
"placeholder": "the bar's text: the source's own placeholder, else Search products",
|
|
6
|
+
"shopScreen": "the shop screen the bar and the filter button open, himi_shop",
|
|
7
|
+
"shopAll": "the shop's own All selection: the bar opens the shop on all products"
|
|
8
|
+
},
|
|
9
|
+
"node": {
|
|
10
|
+
"id": "{{id}}.search",
|
|
11
|
+
"body": {
|
|
12
|
+
"package": "himalaya",
|
|
13
|
+
"type": "HStack",
|
|
14
|
+
"props": {
|
|
15
|
+
"spacing": 8,
|
|
16
|
+
"alignment": "center",
|
|
17
|
+
"children": [
|
|
18
|
+
{
|
|
19
|
+
"id": "{{id}}.bar",
|
|
20
|
+
"body": {
|
|
21
|
+
"package": "himalaya",
|
|
22
|
+
"type": "HStack",
|
|
23
|
+
"props": {
|
|
24
|
+
"spacing": 8,
|
|
25
|
+
"alignment": "center",
|
|
26
|
+
"children": [
|
|
27
|
+
{
|
|
28
|
+
"id": "{{id}}.bar.icon",
|
|
29
|
+
"body": {
|
|
30
|
+
"package": "himalaya",
|
|
31
|
+
"type": "Icon",
|
|
32
|
+
"props": {
|
|
33
|
+
"name": "search",
|
|
34
|
+
"size": 18,
|
|
35
|
+
"tint": "textSecondary"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "{{id}}.bar.text",
|
|
41
|
+
"body": {
|
|
42
|
+
"package": "himalaya",
|
|
43
|
+
"type": "Text",
|
|
44
|
+
"props": {
|
|
45
|
+
"text": "{{placeholder}}",
|
|
46
|
+
"style": "body",
|
|
47
|
+
"maxLines": 1,
|
|
48
|
+
"color": "textSecondary"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "",
|
|
54
|
+
"body": {
|
|
55
|
+
"package": "himalaya",
|
|
56
|
+
"type": "Spacer",
|
|
57
|
+
"props": {}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"modifiers": {
|
|
64
|
+
"weight": 1,
|
|
65
|
+
"background": {
|
|
66
|
+
"token": "surfaceElevated"
|
|
67
|
+
},
|
|
68
|
+
"border": {
|
|
69
|
+
"width": 1,
|
|
70
|
+
"color": {
|
|
71
|
+
"token": "border"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"cornerRadius": 8,
|
|
75
|
+
"padding": {
|
|
76
|
+
"leading": 12,
|
|
77
|
+
"trailing": 12,
|
|
78
|
+
"top": 12,
|
|
79
|
+
"bottom": 12
|
|
80
|
+
},
|
|
81
|
+
"onTap": {
|
|
82
|
+
"actionId": "himi.open",
|
|
83
|
+
"params": {
|
|
84
|
+
"screenId": "{{shopScreen}}",
|
|
85
|
+
"categoryId": "{{shopAll}}",
|
|
86
|
+
"categoryActivation": "{{id}}"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"pressFeedback": "scale",
|
|
90
|
+
"haptic": "light",
|
|
91
|
+
"accessibilityRole": "button",
|
|
92
|
+
"accessibilityLabel": "{{placeholder}}"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "{{id}}.filter",
|
|
97
|
+
"body": {
|
|
98
|
+
"package": "himalaya",
|
|
99
|
+
"type": "ZStack",
|
|
100
|
+
"props": {
|
|
101
|
+
"alignment": "center",
|
|
102
|
+
"children": [
|
|
103
|
+
{
|
|
104
|
+
"id": "{{id}}.filter.icon",
|
|
105
|
+
"body": {
|
|
106
|
+
"package": "himalaya",
|
|
107
|
+
"type": "Icon",
|
|
108
|
+
"props": {
|
|
109
|
+
"name": "filter",
|
|
110
|
+
"size": 20,
|
|
111
|
+
"tint": "textPrimary"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"modifiers": {
|
|
119
|
+
"width": 44,
|
|
120
|
+
"height": 44,
|
|
121
|
+
"onTap": {
|
|
122
|
+
"actionId": "himi.open",
|
|
123
|
+
"params": {
|
|
124
|
+
"screenId": "{{shopScreen}}",
|
|
125
|
+
"categoryId": "{{shopAll}}",
|
|
126
|
+
"categoryActivation": "{{id}}"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"pressFeedback": "scale",
|
|
130
|
+
"haptic": "light",
|
|
131
|
+
"accessibilityRole": "button",
|
|
132
|
+
"accessibilityLabel": "Filter products"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_recipe": "The One App store wishlist section: the products saved on this device as a two-column grid (image, name, price; a tap opens the product), the source's empty state (a heart, its text and, when the source shows it, a button to the shop) and a See All button to the saved-products screen when more are saved. The One App list is the member's account wishlist, which no worker can read: this one is device-local. ONE node, always mounted. Service: registerSavedProductsSection(svc, { limit }).",
|
|
3
|
+
"_placeholders": {
|
|
4
|
+
"svc": "service name the page worker registered with registerSavedProductsSection",
|
|
5
|
+
"id": "unique node id prefix for this section",
|
|
6
|
+
"imageMode": "the tile image's content mode: fill (the source's crop) or fit",
|
|
7
|
+
"emptyButton": "the empty state's button label: the source's own text, else Shop now",
|
|
8
|
+
"shopScreen": "the shop screen the empty state's button opens, himi_shop",
|
|
9
|
+
"shopAll": "the shop's own All selection",
|
|
10
|
+
"seeAllLabel": "the See All button's label",
|
|
11
|
+
"seeAllScreen": "the saved-products screen, himi_saved_products"
|
|
12
|
+
},
|
|
13
|
+
"node": {
|
|
14
|
+
"id": "{{id}}.wishlist",
|
|
15
|
+
"body": {
|
|
16
|
+
"package": "himalaya",
|
|
17
|
+
"type": "VStack",
|
|
18
|
+
"props": {
|
|
19
|
+
"spacing": 12,
|
|
20
|
+
"alignment": "leading",
|
|
21
|
+
"children": [
|
|
22
|
+
{
|
|
23
|
+
"id": "{{id}}.loading",
|
|
24
|
+
"body": {
|
|
25
|
+
"package": "himalaya",
|
|
26
|
+
"type": "Skeleton",
|
|
27
|
+
"props": {
|
|
28
|
+
"height": 220,
|
|
29
|
+
"count": 2,
|
|
30
|
+
"cornerRadius": 8
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"modifiers": {
|
|
34
|
+
"padding": {
|
|
35
|
+
"leading": 0,
|
|
36
|
+
"trailing": 0,
|
|
37
|
+
"top": 0,
|
|
38
|
+
"bottom": 0
|
|
39
|
+
},
|
|
40
|
+
"hiddenPath": "$service:{{svc}}.notLoading"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "{{id}}.grid",
|
|
45
|
+
"body": {
|
|
46
|
+
"package": "himalaya",
|
|
47
|
+
"type": "Grid",
|
|
48
|
+
"props": {
|
|
49
|
+
"columns": 2,
|
|
50
|
+
"spacing": 12,
|
|
51
|
+
"itemsPath": "$service:{{svc}}.rows",
|
|
52
|
+
"items": [
|
|
53
|
+
{
|
|
54
|
+
"id": "{{id}}.tile",
|
|
55
|
+
"body": {
|
|
56
|
+
"package": "himalaya",
|
|
57
|
+
"type": "VStack",
|
|
58
|
+
"props": {
|
|
59
|
+
"spacing": 8,
|
|
60
|
+
"alignment": "leading",
|
|
61
|
+
"children": [
|
|
62
|
+
{
|
|
63
|
+
"id": "",
|
|
64
|
+
"body": {
|
|
65
|
+
"package": "himalaya",
|
|
66
|
+
"type": "Image",
|
|
67
|
+
"props": {
|
|
68
|
+
"url": "$item.image",
|
|
69
|
+
"initials": "$item.initial",
|
|
70
|
+
"fillWidth": true,
|
|
71
|
+
"contentMode": "{{imageMode}}",
|
|
72
|
+
"contentDescription": "$item.name",
|
|
73
|
+
"aspectRatio": 1,
|
|
74
|
+
"shape": "rect"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"modifiers": {
|
|
78
|
+
"fillMaxWidth": true
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "",
|
|
83
|
+
"body": {
|
|
84
|
+
"package": "himalaya",
|
|
85
|
+
"type": "Text",
|
|
86
|
+
"props": {
|
|
87
|
+
"text": "$item.name",
|
|
88
|
+
"style": "bodyEmphasis",
|
|
89
|
+
"maxLines": 2
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "",
|
|
95
|
+
"body": {
|
|
96
|
+
"package": "himalaya",
|
|
97
|
+
"type": "Text",
|
|
98
|
+
"props": {
|
|
99
|
+
"text": "$item.price",
|
|
100
|
+
"style": "caption",
|
|
101
|
+
"color": "accentPrimary",
|
|
102
|
+
"collapseWhenEmpty": true
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"modifiers": {
|
|
110
|
+
"fillMaxWidth": true,
|
|
111
|
+
"onTap": {
|
|
112
|
+
"actionId": "himi.open",
|
|
113
|
+
"params": {
|
|
114
|
+
"screenId": "$item.detailScreenId",
|
|
115
|
+
"id": "$item.id"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"pressFeedback": "scale",
|
|
119
|
+
"haptic": "light",
|
|
120
|
+
"accessibilityLabel": "$item.name"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"modifiers": {
|
|
127
|
+
"hiddenPath": "$service:{{svc}}.noRows"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"id": "{{id}}.empty",
|
|
132
|
+
"body": {
|
|
133
|
+
"package": "himalaya",
|
|
134
|
+
"type": "VStack",
|
|
135
|
+
"props": {
|
|
136
|
+
"spacing": 8,
|
|
137
|
+
"alignment": "center",
|
|
138
|
+
"children": [
|
|
139
|
+
{
|
|
140
|
+
"id": "{{id}}.empty.icon",
|
|
141
|
+
"body": {
|
|
142
|
+
"package": "himalaya",
|
|
143
|
+
"type": "Icon",
|
|
144
|
+
"props": {
|
|
145
|
+
"name": "heart",
|
|
146
|
+
"size": 28,
|
|
147
|
+
"tint": "textSecondary"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "{{id}}.empty.title",
|
|
153
|
+
"body": {
|
|
154
|
+
"package": "himalaya",
|
|
155
|
+
"type": "Text",
|
|
156
|
+
"props": {
|
|
157
|
+
"text": "Your wishlist is empty",
|
|
158
|
+
"style": "bodyEmphasis",
|
|
159
|
+
"textAlign": "center"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "{{id}}.empty.text",
|
|
165
|
+
"body": {
|
|
166
|
+
"package": "himalaya",
|
|
167
|
+
"type": "Text",
|
|
168
|
+
"props": {
|
|
169
|
+
"text": "Tap the heart on a product to add it to your wishlist.",
|
|
170
|
+
"style": "footnote",
|
|
171
|
+
"textAlign": "center",
|
|
172
|
+
"color": "textSecondary"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"id": "{{id}}.empty.shop",
|
|
178
|
+
"body": {
|
|
179
|
+
"package": "himalaya",
|
|
180
|
+
"type": "Button",
|
|
181
|
+
"props": {
|
|
182
|
+
"title": "{{emptyButton}}",
|
|
183
|
+
"style": "primary",
|
|
184
|
+
"size": "md",
|
|
185
|
+
"action": {
|
|
186
|
+
"actionId": "himi.open",
|
|
187
|
+
"params": {
|
|
188
|
+
"screenId": "{{shopScreen}}",
|
|
189
|
+
"categoryId": "{{shopAll}}",
|
|
190
|
+
"categoryActivation": "{{id}}"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"modifiers": {
|
|
200
|
+
"fillMaxWidth": true,
|
|
201
|
+
"padding": {
|
|
202
|
+
"leading": 16,
|
|
203
|
+
"trailing": 16,
|
|
204
|
+
"top": 16,
|
|
205
|
+
"bottom": 16
|
|
206
|
+
},
|
|
207
|
+
"hiddenPath": "$service:{{svc}}.noEmpty"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"id": "{{id}}.more",
|
|
212
|
+
"body": {
|
|
213
|
+
"package": "himalaya",
|
|
214
|
+
"type": "Button",
|
|
215
|
+
"props": {
|
|
216
|
+
"title": "{{seeAllLabel}}",
|
|
217
|
+
"style": "secondary",
|
|
218
|
+
"size": "md",
|
|
219
|
+
"fullWidth": true,
|
|
220
|
+
"action": {
|
|
221
|
+
"actionId": "himi.open",
|
|
222
|
+
"params": {
|
|
223
|
+
"screenId": "{{seeAllScreen}}"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"modifiers": {
|
|
229
|
+
"hiddenPath": "$service:{{svc}}.noMore"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// A blog category list as a registrable service: the One App category list section, driven by the source section's settings.
|
|
2
|
+
// categoryIds -> only those categories, in that order (unset: every category the blog has),
|
|
3
|
+
// showCount -> the "12 posts" line under each name (the source's `categoryListDisplayOptions.postsCount`).
|
|
4
|
+
// A category with no published post is left out: its row would open a list with nothing in it.
|
|
5
|
+
// A page worker registers it under a service name; the descriptor binds `$service:<serviceName>.*` (recipe blog-categories.json).
|
|
6
|
+
import { defineService } from "@himalaya/state";
|
|
7
|
+
import { queryCategories } from "@himalaya/wix-blog";
|
|
8
|
+
import { copyPlural, stashCopy } from "./himi-copy.js";
|
|
9
|
+
|
|
10
|
+
export interface BlogCategoriesOptions {
|
|
11
|
+
/** Show only these categories, in this order. */
|
|
12
|
+
categoryIds?: string[];
|
|
13
|
+
/** Show each category's post count under its name. */
|
|
14
|
+
showCount?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CategoryRow {
|
|
18
|
+
id: string; title: string;
|
|
19
|
+
/** "12 posts"; "" when the section does not show counts or the API gave none. */
|
|
20
|
+
count: string; hasCount: boolean; noCount: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface BlogCategoriesState {
|
|
24
|
+
status: "loading" | "ready" | "error";
|
|
25
|
+
rows: CategoryRow[];
|
|
26
|
+
notLoading: boolean; notErrored: boolean; noRows: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The most categories one query returns: a blog with more shows its first 100. */
|
|
30
|
+
const QUERY_LIMIT = 100;
|
|
31
|
+
|
|
32
|
+
export function registerBlogCategories(serviceName: string, options: BlogCategoriesOptions = {}) {
|
|
33
|
+
const view = (status: BlogCategoriesState["status"], rows: CategoryRow[]): BlogCategoriesState => ({
|
|
34
|
+
status, rows, notLoading: status !== "loading", notErrored: status !== "error", noRows: !rows.length,
|
|
35
|
+
});
|
|
36
|
+
return defineService<BlogCategoriesState, { load: (state: BlogCategoriesState, arg?: unknown) => Promise<BlogCategoriesState> }>(serviceName, {
|
|
37
|
+
state: view("loading", []),
|
|
38
|
+
actions: {
|
|
39
|
+
load: async (_state, arg) => {
|
|
40
|
+
stashCopy(arg);
|
|
41
|
+
try {
|
|
42
|
+
const response = await queryCategories({ paging: { limit: QUERY_LIMIT } });
|
|
43
|
+
const byId = new Map((response.categories ?? []).map((category) => [category.id, category]));
|
|
44
|
+
// The chosen categories in the source's order (one that no longer exists is simply absent), else the blog's own order.
|
|
45
|
+
const chosen = options.categoryIds?.length ? options.categoryIds.flatMap((id) => byId.get(id) ?? []) : [...byId.values()];
|
|
46
|
+
const rows = chosen.flatMap((category): CategoryRow[] => {
|
|
47
|
+
const title = (category.label || category.title || "").trim();
|
|
48
|
+
if (!category.id || !title || category.postCount === 0) return [];
|
|
49
|
+
// `postCount` absent (an older payload) shows no count rather than a guessed one.
|
|
50
|
+
const count = options.showCount && category.postCount !== undefined
|
|
51
|
+
? copyPlural("blogList.categoryPostCount", "{n, plural, one {# post} other {# posts}}", category.postCount) : "";
|
|
52
|
+
return [{ id: category.id, title, count, hasCount: !!count, noCount: !count }];
|
|
53
|
+
});
|
|
54
|
+
return view("ready", rows);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.warn("blog_categories: the categories could not be read", error);
|
|
57
|
+
return view("error", []);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// An event's agenda (Wix Events schedule items), as the conference screens show it: one row per
|
|
2
|
+
// visible session in start order, its time range and length in the EVENT's time zone (an
|
|
3
|
+
// attendee abroad plans by the venue's clock), its stage, and the day it falls on.
|
|
4
|
+
//
|
|
5
|
+
// Read from the visitor-readable `GET /events/v1/schedule?eventId=` — only when the event has its
|
|
6
|
+
// agenda turned on (`agendaSettings.enabled`); otherwise Wix answers for an owner only. A failed
|
|
7
|
+
// read is reported (`ok: false`) so the caller can show an error with Retry, never an empty agenda.
|
|
8
|
+
import { calendarDay, formatClock, formatWeekdayMonthDayLong } from "./engine-intl.js";
|
|
9
|
+
import { copyParam, copyTemplate } from "./himi-copy.js";
|
|
10
|
+
|
|
11
|
+
export interface AgendaSession {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
/** "9:30 AM – 10:00 AM"; "" when the item has no valid start. */
|
|
15
|
+
time: string;
|
|
16
|
+
/** "30 min", "2 hr", "1 hr 30 min"; "" when it has no valid end. */
|
|
17
|
+
duration: string;
|
|
18
|
+
/** The stage or room; "" when the item names none. */
|
|
19
|
+
place: string;
|
|
20
|
+
noPlace: boolean;
|
|
21
|
+
description: string;
|
|
22
|
+
noDescription: boolean;
|
|
23
|
+
/** The day it falls on in the event's zone, `YYYY-MM-DD` — the grouping key. */
|
|
24
|
+
dayKey: string;
|
|
25
|
+
/** "Thursday, January 12". */
|
|
26
|
+
dayLabel: string;
|
|
27
|
+
start: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type WixApi = { call: (method: string, path: string, body?: unknown) => Promise<unknown> };
|
|
31
|
+
function wixApi(): WixApi | null {
|
|
32
|
+
return (globalThis as { himalaya?: { wixApi?: WixApi } }).himalaya?.wixApi ?? null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const clean = (value: unknown): string => (typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "");
|
|
36
|
+
/** A schedule item's description is HTML ("<p>Nina Rashid, Founder of DigiArt</p>"): its text,
|
|
37
|
+
* one paragraph per line break. No DOM in a worker, so the tags are stripped by hand. */
|
|
38
|
+
export function plainText(html: unknown): string {
|
|
39
|
+
if (typeof html !== "string") return "";
|
|
40
|
+
return html
|
|
41
|
+
.replace(/<\s*br\s*\/?>/gi, "\n").replace(/<\/\s*(p|div|li|h[1-6])\s*>/gi, "\n").replace(/<[^>]*>/g, "")
|
|
42
|
+
.replace(/ /g, " ").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'")
|
|
43
|
+
.split("\n").map((line) => line.replace(/\s+/g, " ").trim()).filter(Boolean).join("\n");
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** "1 hr 30 min" for 90 minutes, in this screen's copy. */
|
|
47
|
+
export function durationLabel(minutes: number): string {
|
|
48
|
+
if (!Number.isFinite(minutes) || minutes <= 0) return "";
|
|
49
|
+
// Round the whole length first: 4 h 59 min 58 s is "5 hr", never "4 hr 60 min".
|
|
50
|
+
const total = Math.round(minutes);
|
|
51
|
+
const h = Math.floor(total / 60), m = total % 60;
|
|
52
|
+
if (h && m) return copyTemplate("agendaCommon.durationHoursMinutes", "{h} hr {m} min", { h, m });
|
|
53
|
+
if (h) return copyTemplate("agendaCommon.durationHours", "{h} hr", { h });
|
|
54
|
+
return copyTemplate("agendaCommon.durationMinutes", "{m} min", { m });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface RawItem {
|
|
58
|
+
id?: unknown; name?: unknown; title?: unknown; hidden?: unknown; status?: unknown;
|
|
59
|
+
stageName?: unknown; description?: unknown;
|
|
60
|
+
timeSlot?: { start?: unknown; end?: unknown; timeZoneId?: unknown };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** One session row from a Wix schedule item, or null for a hidden, draft or unnamed one. */
|
|
64
|
+
export function agendaSession(item: RawItem, eventZone: string): AgendaSession | null {
|
|
65
|
+
if (item.hidden === true) return null;
|
|
66
|
+
// Wix schedule items are SCHEDULED or CANCELED (a draft is a separate copy, not a status).
|
|
67
|
+
if (clean(item.status).toUpperCase() === "CANCELED") return null;
|
|
68
|
+
const id = clean(item.id), name = clean(item.name) || clean(item.title);
|
|
69
|
+
if (!id || !name) return null;
|
|
70
|
+
const zone = clean(item.timeSlot?.timeZoneId) || eventZone || undefined;
|
|
71
|
+
const start = new Date(clean(item.timeSlot?.start));
|
|
72
|
+
const end = new Date(clean(item.timeSlot?.end));
|
|
73
|
+
const hasStart = !Number.isNaN(start.getTime());
|
|
74
|
+
const hasEnd = hasStart && !Number.isNaN(end.getTime()) && end.getTime() > start.getTime();
|
|
75
|
+
const place = clean(item.stageName);
|
|
76
|
+
const description = plainText(item.description);
|
|
77
|
+
return {
|
|
78
|
+
id,
|
|
79
|
+
name,
|
|
80
|
+
time: hasStart ? (hasEnd ? `${formatClock(start, "en-US", zone)} – ${formatClock(end, "en-US", zone)}` : formatClock(start, "en-US", zone)) : "",
|
|
81
|
+
duration: hasEnd ? durationLabel((end.getTime() - start.getTime()) / 60000) : "",
|
|
82
|
+
place,
|
|
83
|
+
noPlace: !place,
|
|
84
|
+
description,
|
|
85
|
+
noDescription: !description,
|
|
86
|
+
dayKey: hasStart ? calendarDay(start, zone) : "",
|
|
87
|
+
dayLabel: hasStart ? formatWeekdayMonthDayLong(start, "en-US", zone) : copyParam("agendaCommon.dayTbd", "Time to be announced"),
|
|
88
|
+
start: hasStart ? start.getTime() : Number.MAX_SAFE_INTEGER,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type AgendaRead = { ok: true; sessions: AgendaSession[] } | { ok: false; sessions: AgendaSession[] };
|
|
93
|
+
|
|
94
|
+
/** The visible sessions of `eventId`, in start order. An agenda that is off is an empty one. */
|
|
95
|
+
export async function readAgenda(eventId: string, agendaEnabled: boolean, eventZone: string): Promise<AgendaRead> {
|
|
96
|
+
if (!eventId || !agendaEnabled) return { ok: true, sessions: [] };
|
|
97
|
+
const api = wixApi();
|
|
98
|
+
if (!api) return { ok: false, sessions: [] };
|
|
99
|
+
try {
|
|
100
|
+
// `limit` is required: without it Wix answers `total: 5` and an EMPTY `items`.
|
|
101
|
+
const res = await api.call("GET", `/events/v1/schedule?eventId=${encodeURIComponent(eventId)}&limit=100`) as { items?: RawItem[] } | null;
|
|
102
|
+
const seen = new Set<string>();
|
|
103
|
+
const sessions = (res?.items ?? [])
|
|
104
|
+
.map((item) => agendaSession(item, eventZone))
|
|
105
|
+
// One row per item id: an owner's read lists a draft and its published copy under one id.
|
|
106
|
+
.filter((row): row is AgendaSession => !!row && !seen.has(row.id) && !!seen.add(row.id))
|
|
107
|
+
// Ties by name, compared by code unit: `localeCompare` is ECMA-402, which the wrist engines lack.
|
|
108
|
+
.sort((a, b) => a.start - b.start || (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
|
|
109
|
+
return { ok: true, sessions };
|
|
110
|
+
} catch {
|
|
111
|
+
return { ok: false, sessions: [] };
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** The event's own time zone and whether its agenda is on, from an Events v3 record. */
|
|
116
|
+
export function agendaSettingsOf(event: unknown): { enabled: boolean; zone: string } {
|
|
117
|
+
const e = event as { agendaSettings?: { enabled?: unknown }; dateAndTimeSettings?: { timeZoneId?: unknown }; scheduling?: { timeZoneId?: unknown; config?: { timeZoneId?: unknown } } } | null;
|
|
118
|
+
return {
|
|
119
|
+
enabled: e?.agendaSettings?.enabled === true,
|
|
120
|
+
zone: clean(e?.dateAndTimeSettings?.timeZoneId) || clean(e?.scheduling?.config?.timeZoneId) || clean(e?.scheduling?.timeZoneId),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// A page's Events schedule section as a registrable service: the sessions of ONE chosen event (the source section's `eventId`), in start
|
|
2
|
+
// order, each as the day and start time it runs (in the app's language, in the EVENT's time zone), its name and its stage.
|
|
3
|
+
// limit -> how many sessions (default 10); `noMore` is false when the event has more, which is when the section's View All button
|
|
4
|
+
// (to the event screen, whose full schedule lists every session) shows.
|
|
5
|
+
// The read is the one the conference agenda makes: the event with its AGENDA fieldset (without it Wix leaves `agendaSettings` out and the
|
|
6
|
+
// agenda is never read), then `GET /events/v1/schedule?eventId=` (_shared/event-agenda.ts). An event with its agenda off, or none, has no
|
|
7
|
+
// sessions: the section then hides completely (`hideSection`), title included. A failed read is `error`, never an empty schedule; an event
|
|
8
|
+
// that no longer exists (404) is an empty one.
|
|
9
|
+
// The section adds no words of its own: every row is the event's own data, and the error state is the shared section-error recipe's.
|
|
10
|
+
// A page worker registers it under a service name; the descriptor binds `$service:<serviceName>.*` (recipe event-schedule).
|
|
11
|
+
import { defineService } from "@himalaya/state";
|
|
12
|
+
import { getEvent } from "@himalaya/wix-events";
|
|
13
|
+
import { agendaSettingsOf, readAgenda, type AgendaSession } from "./event-agenda.js";
|
|
14
|
+
import { isNotFoundError } from "./detail-presence.js";
|
|
15
|
+
import { formatClock, formatWeekdayMonthDayLong } from "./engine-intl.js";
|
|
16
|
+
import { stashCopy } from "./himi-copy.js";
|
|
17
|
+
|
|
18
|
+
export interface EventScheduleOptions {
|
|
19
|
+
/** The event whose schedule this is. */
|
|
20
|
+
eventId: string;
|
|
21
|
+
/** How many sessions to show. */
|
|
22
|
+
limit?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ScheduleRow {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
/** "Thursday, January 12 · 9:30 AM": the day and start time, in the app's language and the event's zone; a session with no start is "to be announced". */
|
|
29
|
+
when: string;
|
|
30
|
+
/** The stage or room; "" when the session names none. */
|
|
31
|
+
place: string;
|
|
32
|
+
noPlace: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface EventScheduleState {
|
|
36
|
+
status: "loading" | "ready" | "error";
|
|
37
|
+
rows: ScheduleRow[];
|
|
38
|
+
notLoading: boolean; notErrored: boolean; noRows: boolean;
|
|
39
|
+
/** The read finished and there is nothing to show: the whole section (title included) hides. */
|
|
40
|
+
hideSection: boolean;
|
|
41
|
+
/** false when the event has more sessions than the section shows. */
|
|
42
|
+
noMore: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const DEFAULT_LIMIT = 10, MAX_LIMIT = 30;
|
|
46
|
+
|
|
47
|
+
/** `AgendaSession.start` of a session with no valid start (it sorts last). */
|
|
48
|
+
const NO_START = Number.MAX_SAFE_INTEGER;
|
|
49
|
+
|
|
50
|
+
/** The agenda module formats in en-US for the conference template; a branded app shows its own language, so the row formats the timestamp. */
|
|
51
|
+
const rowOf = (session: AgendaSession, zone: string): ScheduleRow => {
|
|
52
|
+
const date = new Date(session.start);
|
|
53
|
+
const tz = zone || undefined;
|
|
54
|
+
return {
|
|
55
|
+
id: session.id, name: session.name,
|
|
56
|
+
// A session with no valid start has no time to show: the agenda module's "Time to be announced" is English that no branded-lite
|
|
57
|
+
// catalog translates, so the line stays empty and the recipe collapses it (`collapseWhenEmpty`).
|
|
58
|
+
when: session.start === NO_START ? "" : [formatWeekdayMonthDayLong(date, undefined, tz), formatClock(date, undefined, tz)].filter(Boolean).join(" · "),
|
|
59
|
+
place: session.place, noPlace: session.noPlace,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export function registerEventScheduleSection(serviceName: string, options: EventScheduleOptions) {
|
|
64
|
+
const limit = Math.min(Math.max(Math.floor(options.limit ?? DEFAULT_LIMIT), 1), MAX_LIMIT);
|
|
65
|
+
const view = (status: EventScheduleState["status"], rows: ReadonlyArray<ScheduleRow>, more: boolean): EventScheduleState => ({
|
|
66
|
+
status, rows: [...rows],
|
|
67
|
+
notLoading: status !== "loading", notErrored: status !== "error", noRows: !rows.length,
|
|
68
|
+
hideSection: status === "ready" && !rows.length,
|
|
69
|
+
noMore: !more,
|
|
70
|
+
});
|
|
71
|
+
return defineService<EventScheduleState, { load: (state: EventScheduleState, arg?: unknown) => Promise<EventScheduleState> }>(serviceName, {
|
|
72
|
+
state: view("loading", [], false),
|
|
73
|
+
actions: {
|
|
74
|
+
load: async (_state, arg) => {
|
|
75
|
+
stashCopy(arg);
|
|
76
|
+
try {
|
|
77
|
+
if (!options.eventId) return view("ready", [], false);
|
|
78
|
+
const res = await getEvent(options.eventId, { fields: ["DETAILS", "AGENDA"] });
|
|
79
|
+
const { enabled, zone } = agendaSettingsOf((res as unknown as { event?: unknown }).event ?? res);
|
|
80
|
+
const agenda = await readAgenda(options.eventId, enabled, zone);
|
|
81
|
+
if (!agenda.ok) throw new Error("The event schedule could not be read");
|
|
82
|
+
return view("ready", agenda.sessions.slice(0, limit).map((session) => rowOf(session, zone)), agenda.sessions.length > limit);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
if (isNotFoundError(error)) return view("ready", [], false);
|
|
85
|
+
console.warn("event_schedule_section: the schedule could not be read", error);
|
|
86
|
+
return view("error", [], false);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
}
|
|
@@ -63,7 +63,7 @@ function authorOf(item: WixFeedItem, profiles: WixFeedProfile[]): { name: string
|
|
|
63
63
|
return { name: profile?.userName || named || copyParam("feed.memberFallbackName", "Member"), avatar: fromProfile || fromCreator || "" };
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function postRow(item: WixFeedItem, profiles: WixFeedProfile[], now: number): GroupFeedRow {
|
|
66
|
+
export function postRow(item: WixFeedItem, profiles: WixFeedProfile[], now: number): GroupFeedRow {
|
|
67
67
|
const { name, avatar } = authorOf(item, profiles);
|
|
68
68
|
return {
|
|
69
69
|
id: item.feedItemId || "", author: name, initials: initials(name),
|
|
@@ -73,7 +73,7 @@ function postRow(item: WixFeedItem, profiles: WixFeedProfile[], now: number): Gr
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/** The feed read is a member scope: Wix answers a viewer it will not show with `HTTP 401` / `HTTP 403`. */
|
|
76
|
-
const isRefusal = (error: unknown): boolean => /\b(401|403)\b/.test(String((error as Error | undefined)?.message ?? error));
|
|
76
|
+
export const isRefusal = (error: unknown): boolean => /\b(401|403)\b/.test(String((error as Error | undefined)?.message ?? error));
|
|
77
77
|
|
|
78
78
|
export function registerGroupFeedSection(serviceName: string, options: GroupFeedOptions) {
|
|
79
79
|
const view = (status: GroupFeedState["status"], parts: { rows?: GroupFeedRow[]; groupName?: string; privacy?: string; restrictedText?: string } = {}): GroupFeedState => {
|