ublo-lib 1.24.4 → 1.25.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/es/common/components/admin-links/admin-links.js +95 -52
- package/es/common/components/admin-links/index.js +1 -1
- package/es/common/components/breadcrumb.js +78 -21
- package/es/common/components/cross-selling-editor/cross-selling-editor.js +52 -0
- package/es/common/components/cross-selling-editor/cross-selling-editor.module.css +6 -0
- package/es/common/components/cross-selling-editor/editor.js +98 -0
- package/es/common/components/cross-selling-editor/editor.module.css +23 -0
- package/es/common/components/cross-selling-editor/hooks/use-custom-offers.js +52 -0
- package/es/common/components/cross-selling-editor/hooks/use-tunnel-offers.js +35 -0
- package/es/common/components/cross-selling-editor/index.js +2 -0
- package/es/common/components/cross-selling-editor/override-trigger-form.js +156 -0
- package/es/common/components/cross-selling-editor/override-trigger-form.module.css +58 -0
- package/es/common/components/cross-selling-editor/override.js +124 -0
- package/es/common/components/cross-selling-editor/override.module.css +65 -0
- package/es/common/components/cross-selling-editor/overrides-list.js +111 -0
- package/es/common/components/cross-selling-editor/overrides-list.module.css +56 -0
- package/es/common/components/cross-selling-editor/rule.js +105 -0
- package/es/common/components/cross-selling-editor/rule.module.css +37 -0
- package/es/common/components/cross-selling-editor/rules.js +84 -0
- package/es/common/components/cross-selling-editor/rules.module.css +39 -0
- package/es/common/components/cross-selling-editor/services/api.js +36 -0
- package/es/common/components/cross-selling-editor/services/utils.js +199 -0
- package/es/common/components/cross-selling-editor/tester-tunnel-offer.js +53 -0
- package/es/common/components/cross-selling-editor/tester-tunnel-offer.module.css +18 -0
- package/es/common/components/cross-selling-editor/tester.js +188 -0
- package/es/common/components/cross-selling-editor/tester.module.css +106 -0
- package/es/common/components/cross-selling-editor/types.js +1 -0
- package/es/common/components/custom-contact-form/custom-contact-form.js +147 -75
- package/es/common/components/date-picker/calendar.js +1 -1
- package/es/common/components/gesco-contact-form/gesco-contact-form.js +243 -91
- package/es/common/components/gesco-contact-form/hooks/use-params.js +35 -20
- package/es/common/components/gesco-contact-form/index.js +1 -1
- package/es/common/components/gesco-contact-form/phone-code-select.js +76 -56
- package/es/common/components/gesco-contact-form/services/api.js +7 -8
- package/es/common/components/gesco-contact-form/services/form.js +39 -25
- package/es/common/components/gesco-contact-form/services/messages.js +68 -65
- package/es/common/components/gesco-contact-form/services/plausible.js +8 -10
- package/es/common/components/gesco-contact-form/types.js +1 -1
- package/es/common/components/instant-search/hooks/use-constant.js +8 -6
- package/es/common/components/instant-search/hooks/use-debounced-search.js +14 -5
- package/es/common/components/instant-search/hooks/use-search.js +10 -6
- package/es/common/components/instant-search/index.js +1 -1
- package/es/common/components/instant-search/input.js +75 -45
- package/es/common/components/instant-search/instant-search.js +124 -73
- package/es/common/components/instant-search/links.js +74 -23
- package/es/common/components/instant-search/no-product.js +81 -4
- package/es/common/components/instant-search/products.js +118 -31
- package/es/common/components/instant-search/results.js +121 -32
- package/es/common/components/instant-search/services/api.js +12 -10
- package/es/common/components/instant-search/services/messages.js +3 -3
- package/es/common/components/instant-search/services/utils.js +34 -34
- package/es/common/components/msem-preset-editor/components/facet-selector.js +39 -22
- package/es/common/components/msem-preset-editor/components/form.js +54 -5
- package/es/common/components/msem-preset-editor/components/stay-picker.js +72 -33
- package/es/common/components/msem-preset-editor/components/widget-list-item.js +130 -42
- package/es/common/components/msem-preset-editor/components/widget-list.js +54 -29
- package/es/common/components/msem-preset-editor/editor-dialog.js +68 -21
- package/es/common/components/msem-preset-editor/editors/elloha.js +102 -69
- package/es/common/components/msem-preset-editor/editors/index.js +6 -6
- package/es/common/components/msem-preset-editor/editors/lodgings.js +316 -184
- package/es/common/components/msem-preset-editor/editors/ski-passes.js +267 -180
- package/es/common/components/msem-preset-editor/editors/standard-products.js +84 -56
- package/es/common/components/msem-preset-editor/editors/vakario.js +239 -171
- package/es/common/components/msem-preset-editor/msem-preset-editor.js +215 -129
- package/es/common/components/msem-preset-editor/services/api.js +69 -42
- package/es/common/components/msem-preset-editor/services/offers.js +61 -35
- package/es/common/components/msem-preset-editor/services/preset.js +22 -14
- package/es/common/components/msem-preset-editor/services/url-params.js +24 -24
- package/es/common/components/msem-preset-linker/components/actions.js +52 -40
- package/es/common/components/msem-preset-linker/components/overlays.js +57 -41
- package/es/common/components/msem-preset-linker/components/resort-selector.js +21 -11
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.js +43 -31
- package/es/common/components/msem-preset-linker/index.js +1 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.js +71 -42
- package/es/common/components/msem-preset-linker/services/url-params.js +10 -13
- package/es/common/components/plausible/hooks/use-plausible.js +22 -18
- package/es/common/components/plausible/index.js +1 -1
- package/es/common/components/plausible/plausible.js +23 -14
- package/es/common/components/plausible/services/callback.js +164 -115
- package/es/common/components/plausible/services/load.js +4 -6
- package/es/common/components/plausible/services/send-goal.js +6 -3
- package/es/common/components/scroll-spy.js +56 -43
- package/es/common/components/scrolling-carousel/index.js +1 -1
- package/es/common/components/scrolling-carousel/scrolling-carousel.js +94 -55
- package/es/common/components/tabbed-zones.js +100 -47
- package/es/common/hooks/use-faq.js +37 -36
- package/es/common/hooks/use-in-view.js +74 -74
- package/es/common/hooks/use-scroll-direction.js +37 -32
- package/es/common/hooks/use-stay.js +16 -13
- package/es/common/hooks/use-sticky.js +35 -35
- package/es/common/hooks/use-tunnel.js +42 -30
- package/es/common/hooks/use-update-effect.js +9 -9
- package/es/common/hooks/use-window-sizes.js +27 -28
- package/es/common/utils/cms.js +15 -17
- package/es/common/utils/cookies.js +10 -11
- package/es/common/utils/copy.js +11 -11
- package/es/common/utils/dates.js +8 -10
- package/es/common/utils/elements.js +14 -15
- package/es/common/utils/events.js +4 -19
- package/es/common/utils/file-manager.js +12 -10
- package/es/common/utils/load-js.js +10 -11
- package/es/common/utils/msem-widget.js +30 -23
- package/es/common/utils/url-parameters.js +11 -7
- package/es/esf/components/magic-box/index.js +1 -1
- package/es/esf/components/magic-box/magic-box.js +164 -102
- package/es/esf/components/parcours-esf/index.js +1 -1
- package/es/esf/components/parcours-esf/parcours-esf.js +45 -30
- package/es/esf/components/period-picker/period-picker.js +5 -5
- package/es/lbm/components/lumiplan/api.js +35 -18
- package/es/lbm/components/lumiplan/domain.js +96 -20
- package/es/lbm/components/lumiplan/i18n/translations.js +24 -15
- package/es/lbm/components/lumiplan/index.js +1 -1
- package/es/lbm/components/lumiplan/lumiplan.js +130 -102
- package/es/lbm/components/lumiplan/opening.js +116 -38
- package/es/lbm/components/lumiplan/pois.js +270 -161
- package/es/lbm/components/lumiplan/resort-selector.js +58 -36
- package/es/lbm/components/lumiplan/road-condition.js +100 -19
- package/es/lbm/components/lumiplan/todays-tips.js +45 -16
- package/es/lbm/components/lumiplan/types.js +1 -1
- package/es/lbm/components/lumiplan/weather/avalanche-risk.js +33 -8
- package/es/lbm/components/lumiplan/weather/index.js +1 -1
- package/es/lbm/components/lumiplan/weather/snow-data.js +71 -5
- package/es/lbm/components/lumiplan/weather/weather-data.js +126 -7
- package/es/lbm/components/lumiplan/weather/weather-days.js +76 -48
- package/es/lbm/components/lumiplan/weather/weather-icon.js +23 -20
- package/es/lbm/components/lumiplan/weather/weather-zones.js +71 -42
- package/es/lbm/components/lumiplan/weather/weather.js +90 -28
- package/package.json +4 -10
- package/es/common/components/admin-links/admin-links.d.ts +0 -11
- package/es/common/components/admin-links/admin-links.d.ts.map +0 -1
- package/es/common/components/admin-links/index.d.ts +0 -3
- package/es/common/components/admin-links/index.d.ts.map +0 -1
- package/es/common/components/breadcrumb.d.ts +0 -16
- package/es/common/components/breadcrumb.d.ts.map +0 -1
- package/es/common/components/custom-contact-form/custom-contact-form.d.ts +0 -25
- package/es/common/components/custom-contact-form/custom-contact-form.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts +0 -17
- package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/hooks/use-params.d.ts +0 -15
- package/es/common/components/gesco-contact-form/hooks/use-params.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/index.d.ts +0 -3
- package/es/common/components/gesco-contact-form/index.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/phone-code-select.d.ts +0 -7
- package/es/common/components/gesco-contact-form/phone-code-select.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/api.d.ts +0 -30
- package/es/common/components/gesco-contact-form/services/api.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/form.d.ts +0 -31
- package/es/common/components/gesco-contact-form/services/form.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/messages.d.ts +0 -34
- package/es/common/components/gesco-contact-form/services/messages.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/services/plausible.d.ts +0 -3
- package/es/common/components/gesco-contact-form/services/plausible.d.ts.map +0 -1
- package/es/common/components/gesco-contact-form/types.d.ts +0 -34
- package/es/common/components/gesco-contact-form/types.d.ts.map +0 -1
- package/es/common/components/instant-search/hooks/use-constant.d.ts +0 -2
- package/es/common/components/instant-search/hooks/use-constant.d.ts.map +0 -1
- package/es/common/components/instant-search/hooks/use-debounced-search.d.ts +0 -7
- package/es/common/components/instant-search/hooks/use-debounced-search.d.ts.map +0 -1
- package/es/common/components/instant-search/hooks/use-search.d.ts +0 -16
- package/es/common/components/instant-search/hooks/use-search.d.ts.map +0 -1
- package/es/common/components/instant-search/index.d.ts +0 -3
- package/es/common/components/instant-search/index.d.ts.map +0 -1
- package/es/common/components/instant-search/input.d.ts +0 -15
- package/es/common/components/instant-search/input.d.ts.map +0 -1
- package/es/common/components/instant-search/instant-search.d.ts +0 -14
- package/es/common/components/instant-search/instant-search.d.ts.map +0 -1
- package/es/common/components/instant-search/links.d.ts +0 -12
- package/es/common/components/instant-search/links.d.ts.map +0 -1
- package/es/common/components/instant-search/no-product.d.ts +0 -6
- package/es/common/components/instant-search/no-product.d.ts.map +0 -1
- package/es/common/components/instant-search/products.d.ts +0 -14
- package/es/common/components/instant-search/products.d.ts.map +0 -1
- package/es/common/components/instant-search/results.d.ts +0 -76
- package/es/common/components/instant-search/results.d.ts.map +0 -1
- package/es/common/components/instant-search/services/api.d.ts +0 -2
- package/es/common/components/instant-search/services/api.d.ts.map +0 -1
- package/es/common/components/instant-search/services/messages.d.ts +0 -2
- package/es/common/components/instant-search/services/messages.d.ts.map +0 -1
- package/es/common/components/instant-search/services/utils.d.ts +0 -4
- package/es/common/components/instant-search/services/utils.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/facet-selector.d.ts +0 -6
- package/es/common/components/msem-preset-editor/components/facet-selector.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/form.d.ts +0 -8
- package/es/common/components/msem-preset-editor/components/form.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/stay-picker.d.ts +0 -14
- package/es/common/components/msem-preset-editor/components/stay-picker.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/widget-list-item.d.ts +0 -12
- package/es/common/components/msem-preset-editor/components/widget-list-item.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/components/widget-list.d.ts +0 -17
- package/es/common/components/msem-preset-editor/components/widget-list.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editor-dialog.d.ts +0 -30
- package/es/common/components/msem-preset-editor/editor-dialog.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/elloha.d.ts +0 -15
- package/es/common/components/msem-preset-editor/editors/elloha.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/index.d.ts +0 -14
- package/es/common/components/msem-preset-editor/editors/index.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/lodgings.d.ts +0 -17
- package/es/common/components/msem-preset-editor/editors/lodgings.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/ski-passes.d.ts +0 -16
- package/es/common/components/msem-preset-editor/editors/ski-passes.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/standard-products.d.ts +0 -16
- package/es/common/components/msem-preset-editor/editors/standard-products.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/editors/vakario.d.ts +0 -15
- package/es/common/components/msem-preset-editor/editors/vakario.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts +0 -28
- package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/api.d.ts +0 -15
- package/es/common/components/msem-preset-editor/services/api.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/offers.d.ts +0 -47
- package/es/common/components/msem-preset-editor/services/offers.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/preset.d.ts +0 -40
- package/es/common/components/msem-preset-editor/services/preset.d.ts.map +0 -1
- package/es/common/components/msem-preset-editor/services/url-params.d.ts +0 -3
- package/es/common/components/msem-preset-editor/services/url-params.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/components/actions.d.ts +0 -11
- package/es/common/components/msem-preset-linker/components/actions.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/components/overlays.d.ts +0 -8
- package/es/common/components/msem-preset-linker/components/overlays.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/components/resort-selector.d.ts +0 -6
- package/es/common/components/msem-preset-linker/components/resort-selector.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts +0 -4
- package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/index.d.ts +0 -3
- package/es/common/components/msem-preset-linker/index.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts +0 -30
- package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts.map +0 -1
- package/es/common/components/msem-preset-linker/services/url-params.d.ts +0 -2
- package/es/common/components/msem-preset-linker/services/url-params.d.ts.map +0 -1
- package/es/common/components/plausible/hooks/use-plausible.d.ts +0 -12
- package/es/common/components/plausible/hooks/use-plausible.d.ts.map +0 -1
- package/es/common/components/plausible/index.d.ts +0 -8
- package/es/common/components/plausible/index.d.ts.map +0 -1
- package/es/common/components/plausible/plausible.d.ts +0 -7
- package/es/common/components/plausible/plausible.d.ts.map +0 -1
- package/es/common/components/plausible/services/callback.d.ts +0 -24
- package/es/common/components/plausible/services/callback.d.ts.map +0 -1
- package/es/common/components/plausible/services/load.d.ts +0 -2
- package/es/common/components/plausible/services/load.d.ts.map +0 -1
- package/es/common/components/plausible/services/send-goal.d.ts +0 -7
- package/es/common/components/plausible/services/send-goal.d.ts.map +0 -1
- package/es/common/components/scroll-spy.d.ts +0 -14
- package/es/common/components/scroll-spy.d.ts.map +0 -1
- package/es/common/components/scrolling-carousel/index.d.ts +0 -3
- package/es/common/components/scrolling-carousel/index.d.ts.map +0 -1
- package/es/common/components/scrolling-carousel/scrolling-carousel.d.ts +0 -8
- package/es/common/components/scrolling-carousel/scrolling-carousel.d.ts.map +0 -1
- package/es/common/components/tabbed-zones.d.ts +0 -12
- package/es/common/components/tabbed-zones.d.ts.map +0 -1
- package/es/common/hooks/use-faq.d.ts +0 -3
- package/es/common/hooks/use-faq.d.ts.map +0 -1
- package/es/common/hooks/use-in-view.d.ts +0 -5
- package/es/common/hooks/use-in-view.d.ts.map +0 -1
- package/es/common/hooks/use-scroll-direction.d.ts +0 -11
- package/es/common/hooks/use-scroll-direction.d.ts.map +0 -1
- package/es/common/hooks/use-stay.d.ts +0 -4
- package/es/common/hooks/use-stay.d.ts.map +0 -1
- package/es/common/hooks/use-sticky.d.ts +0 -4
- package/es/common/hooks/use-sticky.d.ts.map +0 -1
- package/es/common/hooks/use-tunnel.d.ts +0 -8
- package/es/common/hooks/use-tunnel.d.ts.map +0 -1
- package/es/common/hooks/use-update-effect.d.ts +0 -2
- package/es/common/hooks/use-update-effect.d.ts.map +0 -1
- package/es/common/hooks/use-window-sizes.d.ts +0 -7
- package/es/common/hooks/use-window-sizes.d.ts.map +0 -1
- package/es/common/utils/cms.d.ts +0 -4
- package/es/common/utils/cms.d.ts.map +0 -1
- package/es/common/utils/cookies.d.ts +0 -2
- package/es/common/utils/cookies.d.ts.map +0 -1
- package/es/common/utils/copy.d.ts +0 -2
- package/es/common/utils/copy.d.ts.map +0 -1
- package/es/common/utils/dates.d.ts +0 -2
- package/es/common/utils/dates.d.ts.map +0 -1
- package/es/common/utils/elements.d.ts +0 -5
- package/es/common/utils/elements.d.ts.map +0 -1
- package/es/common/utils/events.d.ts +0 -4
- package/es/common/utils/events.d.ts.map +0 -1
- package/es/common/utils/file-manager.d.ts +0 -13
- package/es/common/utils/file-manager.d.ts.map +0 -1
- package/es/common/utils/load-js.d.ts +0 -3
- package/es/common/utils/load-js.d.ts.map +0 -1
- package/es/common/utils/msem-widget.d.ts +0 -16
- package/es/common/utils/msem-widget.d.ts.map +0 -1
- package/es/common/utils/url-parameters.d.ts +0 -2
- package/es/common/utils/url-parameters.d.ts.map +0 -1
- package/es/esf/components/magic-box/index.d.ts +0 -3
- package/es/esf/components/magic-box/index.d.ts.map +0 -1
- package/es/esf/components/magic-box/magic-box.d.ts +0 -22
- package/es/esf/components/magic-box/magic-box.d.ts.map +0 -1
- package/es/esf/components/parcours-esf/index.d.ts +0 -3
- package/es/esf/components/parcours-esf/index.d.ts.map +0 -1
- package/es/esf/components/parcours-esf/parcours-esf.d.ts +0 -14
- package/es/esf/components/parcours-esf/parcours-esf.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/api.d.ts +0 -8
- package/es/lbm/components/lumiplan/api.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/domain.d.ts +0 -8
- package/es/lbm/components/lumiplan/domain.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/i18n/translations.d.ts +0 -7
- package/es/lbm/components/lumiplan/i18n/translations.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/index.d.ts +0 -3
- package/es/lbm/components/lumiplan/index.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/lumiplan.d.ts +0 -2
- package/es/lbm/components/lumiplan/lumiplan.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/opening.d.ts +0 -9
- package/es/lbm/components/lumiplan/opening.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/pois.d.ts +0 -8
- package/es/lbm/components/lumiplan/pois.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/resort-selector.d.ts +0 -12
- package/es/lbm/components/lumiplan/resort-selector.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/road-condition.d.ts +0 -8
- package/es/lbm/components/lumiplan/road-condition.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/todays-tips.d.ts +0 -8
- package/es/lbm/components/lumiplan/todays-tips.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/types.d.ts +0 -285
- package/es/lbm/components/lumiplan/types.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/avalanche-risk.d.ts +0 -4
- package/es/lbm/components/lumiplan/weather/avalanche-risk.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/index.d.ts +0 -3
- package/es/lbm/components/lumiplan/weather/index.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/snow-data.d.ts +0 -8
- package/es/lbm/components/lumiplan/weather/snow-data.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-data.d.ts +0 -9
- package/es/lbm/components/lumiplan/weather/weather-data.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-days.d.ts +0 -7
- package/es/lbm/components/lumiplan/weather/weather-days.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-icon.d.ts +0 -23
- package/es/lbm/components/lumiplan/weather/weather-icon.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather-zones.d.ts +0 -6
- package/es/lbm/components/lumiplan/weather/weather-zones.d.ts.map +0 -1
- package/es/lbm/components/lumiplan/weather/weather.d.ts +0 -8
- package/es/lbm/components/lumiplan/weather/weather.d.ts.map +0 -1
|
@@ -1,30 +1,81 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import Link from "ublo/link";
|
|
3
3
|
import Loader from "dt-design-system/es/loader";
|
|
4
4
|
import * as Icons from "dt-design-system/es/icons";
|
|
5
5
|
import * as Ripple from "dt-design-system/es/ripple";
|
|
6
6
|
import * as Utils from "./services/utils";
|
|
7
7
|
import css from "./links.module.css";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
10
|
const PLACEHOLDERS = [...new Array(3)];
|
|
9
|
-
export default function Links({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
export default function Links({
|
|
12
|
+
icon,
|
|
13
|
+
linksTitle,
|
|
14
|
+
links,
|
|
15
|
+
pageTitleAsTitle,
|
|
16
|
+
loading,
|
|
17
|
+
sendPlausibleGoal
|
|
18
|
+
}) {
|
|
19
|
+
const Icon = Icons[icon];
|
|
20
|
+
const noResult = !loading && !links.length;
|
|
21
|
+
const createRipple = e => {
|
|
22
|
+
Ripple.create(e);
|
|
23
|
+
};
|
|
24
|
+
if (noResult) return null;
|
|
25
|
+
return _jsxs("div", {
|
|
26
|
+
className: css.linksSection,
|
|
27
|
+
children: [_jsx("div", {
|
|
28
|
+
className: css.linksTitle,
|
|
29
|
+
children: linksTitle
|
|
30
|
+
}), _jsxs("div", {
|
|
31
|
+
className: css.links,
|
|
32
|
+
children: [loading && PLACEHOLDERS.map((_, i) => {
|
|
33
|
+
return _jsx("div", {
|
|
34
|
+
className: css.loaderContainer,
|
|
35
|
+
children: _jsx(Loader, {
|
|
36
|
+
className: css.loader,
|
|
37
|
+
variant: "overlay"
|
|
38
|
+
})
|
|
39
|
+
}, i);
|
|
40
|
+
}), !loading && links.map(link => {
|
|
41
|
+
const {
|
|
42
|
+
id,
|
|
43
|
+
text,
|
|
44
|
+
parentTitle,
|
|
45
|
+
path
|
|
46
|
+
} = link.document;
|
|
47
|
+
const decodedPath = decodeURIComponent(path);
|
|
48
|
+
const titleProperty = pageTitleAsTitle ? "pageTitle" : "title";
|
|
49
|
+
const linkTitle = Utils.getHighlight(titleProperty, link.highlight) || link.document[titleProperty];
|
|
50
|
+
const linkText = Utils.getHighlight("text", link.highlight, true) || text;
|
|
51
|
+
return _jsxs(Link, {
|
|
52
|
+
href: decodedPath,
|
|
53
|
+
className: css.link,
|
|
54
|
+
onClick: sendPlausibleGoal(decodedPath),
|
|
55
|
+
onMouseDown: createRipple,
|
|
56
|
+
children: [_jsx(Icon, {
|
|
57
|
+
className: css.linkIcon
|
|
58
|
+
}), _jsxs("div", {
|
|
59
|
+
className: css.linkContent,
|
|
60
|
+
children: [parentTitle && _jsx("div", {
|
|
61
|
+
className: css.linkParent,
|
|
62
|
+
dangerouslySetInnerHTML: {
|
|
63
|
+
__html: parentTitle
|
|
64
|
+
}
|
|
65
|
+
}), _jsx("div", {
|
|
66
|
+
className: css.linkTitle,
|
|
67
|
+
dangerouslySetInnerHTML: {
|
|
68
|
+
__html: linkTitle
|
|
69
|
+
}
|
|
70
|
+
}), linkText && _jsx("div", {
|
|
71
|
+
className: css.linkText,
|
|
72
|
+
dangerouslySetInnerHTML: {
|
|
73
|
+
__html: linkText
|
|
74
|
+
}
|
|
75
|
+
})]
|
|
76
|
+
})]
|
|
77
|
+
}, id);
|
|
78
|
+
})]
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
@@ -1,4 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export default function NoProduct({
|
|
5
|
+
className
|
|
6
|
+
}) {
|
|
7
|
+
return _jsxs("svg", {
|
|
8
|
+
width: "200",
|
|
9
|
+
height: "200",
|
|
10
|
+
viewBox: "0 0 200 200",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
className: className,
|
|
14
|
+
children: [_jsx("path", {
|
|
15
|
+
d: "M100.5 184.3a85.8 85.8 0 1 0 0-171.5 85.8 85.8 0 0 0 0 171.5Z",
|
|
16
|
+
fill: "#EDEDED"
|
|
17
|
+
}), _jsx("path", {
|
|
18
|
+
fillRule: "evenodd",
|
|
19
|
+
clipRule: "evenodd",
|
|
20
|
+
d: "M100.5 11a87.5 87.5 0 1 0 0 175 87.5 87.5 0 0 0 0-175Zm0 3.5a84 84 0 1 1 0 168 84 84 0 0 1 0-168Z",
|
|
21
|
+
fill: "#D7D7D7"
|
|
22
|
+
}), _jsx("path", {
|
|
23
|
+
fillRule: "evenodd",
|
|
24
|
+
clipRule: "evenodd",
|
|
25
|
+
d: "M161.4 61.5c1 0 1.8-.8 1.8-1.8V46.1a4.7 4.7 0 0 0-4.7-4.7H26a4.7 4.7 0 0 0-4.7 4.7v34.3c0 1 .8 1.8 1.8 1.8h61.5c.4 0 .8-.1 1.1-.4l26.4-20.3h49.3Z",
|
|
26
|
+
fill: "#D7D7D7"
|
|
27
|
+
}), _jsx("path", {
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd",
|
|
30
|
+
d: "M138.4 59.7h-25.5L84.6 80.4H45.3V25.7a3 3 0 0 1 2.9-2.9h64.7l25.5 27.5v9.4Z",
|
|
31
|
+
fill: "#fff"
|
|
32
|
+
}), _jsx("path", {
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
clipRule: "evenodd",
|
|
35
|
+
d: "M112.9 21H48.2a4.7 4.7 0 0 0-4.7 4.7v54.7c0 1 .8 1.8 1.8 1.8h39.3c.4 0 .8-.1 1-.3l27.8-20.4h25c1 0 1.8-.8 1.8-1.8V50l-.1-.3-.2-.3v-.2l-.2-.1L114 21.6l-.1-.2-.4-.2h-.1l-.3-.1H113Zm-1.8 3.6H48.2c-.6 0-1.2.5-1.2 1.1v53h37l27.8-20.4c.3-.2.7-.3 1-.3h23.8v-6H113c-1 0-1.8-.8-1.8-1.7V24.6Zm-51 44.8h25.7a1.8 1.8 0 0 0 0-3.5H60.2a1.8 1.8 0 0 0 0 3.5Zm0-16h22a1.8 1.8 0 0 0 0-3.5H60a1.8 1.8 0 0 0 0 3.5Zm0-8.4h37.4a1.8 1.8 0 0 0 0-3.6H60.2a1.8 1.8 0 0 0 0 3.6Z",
|
|
36
|
+
fill: "#D7D7D7"
|
|
37
|
+
}), _jsx("path", {
|
|
38
|
+
fillRule: "evenodd",
|
|
39
|
+
clipRule: "evenodd",
|
|
40
|
+
d: "M4.8 84a3 3 0 0 1 2.9-3.6h76.5a3 3 0 0 0 1.7-.5l26.4-19.6a3 3 0 0 1 1.8-.6h64.7a3 3 0 0 1 3 3.5c-2.9 16-14.4 83-16.8 96.7a3 3 0 0 1-2.9 2.4H25.4a3 3 0 0 1-2.9-2.2L4.8 84Z",
|
|
41
|
+
fill: "#EDEDED"
|
|
42
|
+
}), _jsx("path", {
|
|
43
|
+
fillRule: "evenodd",
|
|
44
|
+
clipRule: "evenodd",
|
|
45
|
+
d: "m3.1 84.4 17.7 76a4.7 4.7 0 0 0 4.6 3.7h136.7c2.3 0 4.2-1.7 4.6-4l16.7-96.6a4.7 4.7 0 0 0-4.6-5.5h-64.7c-1 0-2 .3-2.8.9a1130716.6 1130716.6 0 0 1-27.1 19.8H7.7a4.7 4.7 0 0 0-4.6 5.7Zm3.5-.8a1.2 1.2 0 0 1 1.1-1.4h76.5c1 0 2-.3 2.8-1a724489.6 724489.6 0 0 1 27-19.7h64.8a1.2 1.2 0 0 1 1.2 1.4l-16.7 96.7c-.1.6-.6 1-1.2 1H25.4c-.5 0-1-.4-1.1-1l-17.7-76Z",
|
|
46
|
+
fill: "#D7D7D7"
|
|
47
|
+
}), _jsx("path", {
|
|
48
|
+
fillRule: "evenodd",
|
|
49
|
+
clipRule: "evenodd",
|
|
50
|
+
d: "M159.7 161a36.5 36.5 0 0 1-46.5-4 36.6 36.6 0 0 1 .4-51.8 36.6 36.6 0 0 1 51.7-.4 36.5 36.5 0 0 1 4 46.5l25 24.9c2.6 2.6 2.6 7 0 9.6a6.8 6.8 0 0 1-9.7 0l-25-24.9Z",
|
|
51
|
+
fill: "#fff"
|
|
52
|
+
}), _jsx("path", {
|
|
53
|
+
fillRule: "evenodd",
|
|
54
|
+
clipRule: "evenodd",
|
|
55
|
+
d: "m159.5 163.2 23.8 23.9a8.6 8.6 0 0 0 12.2 0 8.6 8.6 0 0 0 0-12.2L171.6 151a38.2 38.2 0 0 0-5-47.4 38.3 38.3 0 0 0-54.2.4 38.3 38.3 0 0 0-.4 54.2 38.2 38.2 0 0 0 47.5 5Zm1.4-3.5c-.6-.6-1.5-.7-2.2-.2a34.7 34.7 0 0 1-44.2-3.8 34.8 34.8 0 0 1 .4-49.2 34.8 34.8 0 0 1 49.2-.4c12 11.9 13.1 30.5 3.8 44.2-.5.7-.4 1.6.2 2.2l24.9 25c2 1.9 2 5.1 0 7a5 5 0 0 1-7.2 0L161 159.8Z",
|
|
56
|
+
fill: "#D7D7D7"
|
|
57
|
+
}), _jsx("path", {
|
|
58
|
+
d: "M163.5 130.8a24.4 24.4 0 0 0-24.2-24.6c-13.4 0-24.3 11-24.3 24.6a24.4 24.4 0 0 0 24.3 24.6c13.3 0 24.2-11 24.2-24.6Z",
|
|
59
|
+
fill: "#EDEDED"
|
|
60
|
+
}), _jsx("path", {
|
|
61
|
+
fillRule: "evenodd",
|
|
62
|
+
clipRule: "evenodd",
|
|
63
|
+
d: "M113.3 130.8a26.2 26.2 0 0 0 26 26.4c14.3 0 26-11.8 26-26.4a26.2 26.2 0 0 0-26-26.4c-14.4 0-26 11.8-26 26.4Zm3.5 0c0-12.6 10-22.8 22.5-22.8a22.7 22.7 0 0 1 22.4 22.8c0 12.6-10 22.9-22.4 22.9a22.7 22.7 0 0 1-22.5-22.9Z",
|
|
64
|
+
fill: "#D7D7D7"
|
|
65
|
+
}), _jsx("path", {
|
|
66
|
+
opacity: ".7",
|
|
67
|
+
fillRule: "evenodd",
|
|
68
|
+
clipRule: "evenodd",
|
|
69
|
+
d: "M117 121c.7-1.4 13.9 1.6 22.3 9.9 8.1 8 11.4 21.4 10.2 22-9.1 4.3-20.2 2.7-27.6-4.7-7.4-7.3-9-18.3-4.8-27.3Z",
|
|
70
|
+
fill: "#fff"
|
|
71
|
+
}), _jsx("path", {
|
|
72
|
+
fillRule: "evenodd",
|
|
73
|
+
clipRule: "evenodd",
|
|
74
|
+
d: "M120.9 112.5a26.2 26.2 0 0 0-.3 37 26.2 26.2 0 0 0 37-.2 26.2 26.2 0 0 0 .3-37 26.2 26.2 0 0 0-37 .2Zm2.5 2.5c9-9 23.3-9 32-.3a22.7 22.7 0 0 1-.2 32c-9 9-23.3 9.1-32 .3a22.7 22.7 0 0 1 .2-32Z",
|
|
75
|
+
fill: "#D7D7D7"
|
|
76
|
+
}), _jsx("path", {
|
|
77
|
+
d: "M140.2 142.1c1.4 0 2.4 1 2.4 2.4 0 1.3-1 2.3-2.4 2.3-1.3 0-2.3-1-2.3-2.3 0-1.3 1-2.4 2.3-2.4Zm.1-20.5V117a9.5 9.5 0 0 0-9.4 6.8v.2l4.5 1v.1l-4.6-1.1c-.3 1.2.5 2.5 1.8 2.8 1.2.3 2.5-.5 2.8-1.7l.2-.5.7-1.2c.7-.8 1.8-1.7 4-1.7Zm9.4 5.1a9.3 9.3 0 0 0-9.4-9.8v4.7c.6 0 1.8.2 2.9 1 .9.6 1.8 1.7 1.8 4.1 0 .5-.2 1-.7 1.6-.5.6-1.3 1.2-2.2 1.7a18.4 18.4 0 0 1-3.4 1.5h-.3c-1.2.4-2 1.8-1.6 3 .4 1.3 1.7 2 3 1.6l-.7-2.2-.4-1.4-.2-.6V131.6l.6 2.3.6 2.2h.2a11.6 11.6 0 0 0 1.3-.5c.9-.3 2-.8 3.2-1.5 1.2-.6 2.4-1.5 3.4-2.7a7 7 0 0 0 2-4.7Z",
|
|
78
|
+
fill: "#D7D7D7"
|
|
79
|
+
})]
|
|
80
|
+
});
|
|
81
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import Image from "next/image";
|
|
3
3
|
import Link from "ublo/link";
|
|
4
4
|
import Loader from "dt-design-system/es/loader";
|
|
@@ -9,34 +9,121 @@ import * as Utils from "./services/utils";
|
|
|
9
9
|
import message from "./services/messages";
|
|
10
10
|
import NoProduct from "./no-product";
|
|
11
11
|
import css from "./products.module.css";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
15
|
const PLACEHOLDERS = [...new Array(5)];
|
|
13
|
-
export default function Products({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
export default function Products({
|
|
17
|
+
lang,
|
|
18
|
+
products,
|
|
19
|
+
weekNumber,
|
|
20
|
+
loading,
|
|
21
|
+
sendPlausibleGoal,
|
|
22
|
+
otherResultsRef,
|
|
23
|
+
isOtherResultsEmpty
|
|
24
|
+
}) {
|
|
25
|
+
const filteredProducts = Utils.filterProducts(products, weekNumber);
|
|
26
|
+
const noProduct = !loading && !filteredProducts.length;
|
|
27
|
+
const scrollToOtherResults = () => {
|
|
28
|
+
if (otherResultsRef.current) {
|
|
29
|
+
otherResultsRef.current.scrollIntoView({
|
|
30
|
+
behavior: "smooth",
|
|
31
|
+
block: "start"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const createRipple = e => {
|
|
36
|
+
Ripple.create(e);
|
|
37
|
+
};
|
|
38
|
+
return _jsxs(_Fragment, {
|
|
39
|
+
children: [noProduct && _jsxs("div", {
|
|
40
|
+
className: css.noProduct,
|
|
41
|
+
children: [_jsx(NoProduct, {
|
|
42
|
+
className: css.noProductIcon
|
|
43
|
+
}), message(lang, "noProducts")]
|
|
44
|
+
}), loading && PLACEHOLDERS.map((_, i) => {
|
|
45
|
+
return _jsx("div", {
|
|
46
|
+
className: css.loaderContainer,
|
|
47
|
+
children: _jsx(Loader, {
|
|
48
|
+
className: css.loader,
|
|
49
|
+
variant: "overlay"
|
|
50
|
+
})
|
|
51
|
+
}, i);
|
|
52
|
+
}), !loading && filteredProducts.map(product => {
|
|
53
|
+
const {
|
|
54
|
+
id,
|
|
55
|
+
pageTitle,
|
|
56
|
+
title,
|
|
57
|
+
parentTitle,
|
|
58
|
+
image = "",
|
|
59
|
+
imagePlaceholder,
|
|
60
|
+
price,
|
|
61
|
+
time,
|
|
62
|
+
text,
|
|
63
|
+
path
|
|
64
|
+
} = product.document;
|
|
65
|
+
const decodedPath = decodeURIComponent(path);
|
|
66
|
+
const productPageTitle = Utils.getHighlight("pageTitle", product.highlight) || pageTitle;
|
|
67
|
+
const productTitle = Utils.getHighlight("title", product.highlight) || title;
|
|
68
|
+
const productTime = Utils.getHighlight("time", product.highlight) || time;
|
|
69
|
+
const productText = Utils.getHighlight("text", product.highlight) || text;
|
|
70
|
+
const showPrice = price !== undefined && weekNumber !== null;
|
|
71
|
+
const imagePlaceholderStategy = imagePlaceholder ? "blur" : "empty";
|
|
72
|
+
return _jsxs(Link, {
|
|
73
|
+
className: css.product,
|
|
74
|
+
href: decodedPath,
|
|
75
|
+
onClick: sendPlausibleGoal(decodedPath),
|
|
76
|
+
onMouseDown: createRipple,
|
|
77
|
+
children: [_jsx(Image, {
|
|
78
|
+
className: css.productImage,
|
|
79
|
+
src: image,
|
|
80
|
+
alt: title,
|
|
81
|
+
width: 220,
|
|
82
|
+
height: 180,
|
|
83
|
+
placeholder: imagePlaceholderStategy,
|
|
84
|
+
blurDataURL: imagePlaceholder
|
|
85
|
+
}), _jsxs("div", {
|
|
86
|
+
className: css.productContent,
|
|
87
|
+
children: [parentTitle && _jsx("div", {
|
|
88
|
+
className: css.productParent,
|
|
89
|
+
dangerouslySetInnerHTML: {
|
|
90
|
+
__html: parentTitle
|
|
91
|
+
}
|
|
92
|
+
}), _jsx("div", {
|
|
93
|
+
className: css.productPageTitle,
|
|
94
|
+
dangerouslySetInnerHTML: {
|
|
95
|
+
__html: productPageTitle
|
|
96
|
+
}
|
|
97
|
+
}), _jsx("div", {
|
|
98
|
+
className: css.productTitle,
|
|
99
|
+
dangerouslySetInnerHTML: {
|
|
100
|
+
__html: productTitle
|
|
101
|
+
}
|
|
102
|
+
}), _jsx("div", {
|
|
103
|
+
className: css.productTime,
|
|
104
|
+
dangerouslySetInnerHTML: {
|
|
105
|
+
__html: productTime
|
|
106
|
+
}
|
|
107
|
+
}), _jsx("div", {
|
|
108
|
+
className: css.productText,
|
|
109
|
+
dangerouslySetInnerHTML: {
|
|
110
|
+
__html: productText
|
|
111
|
+
}
|
|
112
|
+
}), showPrice && _jsx("div", {
|
|
113
|
+
className: css.productPrice,
|
|
114
|
+
dangerouslySetInnerHTML: {
|
|
115
|
+
__html: price
|
|
116
|
+
}
|
|
117
|
+
})]
|
|
118
|
+
})]
|
|
119
|
+
}, id);
|
|
120
|
+
}), !noProduct && !isOtherResultsEmpty && _jsx("div", {
|
|
121
|
+
className: css.otherProducts,
|
|
122
|
+
children: _jsxs(Button, {
|
|
123
|
+
className: css.otherProductsButton,
|
|
124
|
+
onClick: scrollToOtherResults,
|
|
125
|
+
children: [message(lang, "showOtherResults"), _jsx(Icons.ArrowDown, {})]
|
|
126
|
+
})
|
|
127
|
+
})]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import getConfig from "next/config";
|
|
4
3
|
import Button from "dt-design-system/es/button";
|
|
@@ -8,34 +7,124 @@ import Products from "./products";
|
|
|
8
7
|
import * as Dates from "./services/dates";
|
|
9
8
|
import message from "./services/messages";
|
|
10
9
|
import css from "./results.module.css";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
const {
|
|
14
|
+
publicRuntimeConfig
|
|
15
|
+
} = getConfig();
|
|
16
|
+
const {
|
|
17
|
+
season
|
|
18
|
+
} = publicRuntimeConfig;
|
|
19
|
+
export default function Results({
|
|
20
|
+
lang,
|
|
21
|
+
text,
|
|
22
|
+
results,
|
|
23
|
+
weekNumber,
|
|
24
|
+
openPeriodPicker,
|
|
25
|
+
loading,
|
|
26
|
+
sendPlausibleGoal
|
|
27
|
+
}) {
|
|
28
|
+
const ref = React.useRef(null);
|
|
29
|
+
const {
|
|
30
|
+
grouped_hits: groupedHits = []
|
|
31
|
+
} = results || {};
|
|
32
|
+
const flattenedHits = groupedHits.reduce((acc, group) => {
|
|
33
|
+
return [...acc, ...group.hits];
|
|
34
|
+
}, []);
|
|
35
|
+
const sortedHits = flattenedHits.reduce((acc, hit) => {
|
|
36
|
+
const {
|
|
37
|
+
type
|
|
38
|
+
} = hit.document;
|
|
39
|
+
return {
|
|
40
|
+
...acc,
|
|
41
|
+
[type]: [...acc[type], hit]
|
|
42
|
+
};
|
|
43
|
+
}, {
|
|
44
|
+
page: [],
|
|
45
|
+
product: [],
|
|
46
|
+
information: [],
|
|
47
|
+
faq: [],
|
|
48
|
+
instructor: []
|
|
49
|
+
});
|
|
50
|
+
const {
|
|
51
|
+
page: pages,
|
|
52
|
+
product: products,
|
|
53
|
+
information,
|
|
54
|
+
faq: faqs,
|
|
55
|
+
instructor: instructors
|
|
56
|
+
} = sortedHits;
|
|
57
|
+
const filteredFaqs = faqs.reduce((acc, faq) => {
|
|
58
|
+
const isAlreadyInAcc = acc.some(item => {
|
|
59
|
+
const hasSameTitle = item.document.title === faq.document.title;
|
|
60
|
+
const hasSameParentTitle = item.document.parentTitle === faq.document.parentTitle;
|
|
61
|
+
return hasSameTitle && hasSameParentTitle;
|
|
62
|
+
});
|
|
63
|
+
if (isAlreadyInAcc) return acc;
|
|
64
|
+
return [...acc, faq];
|
|
65
|
+
}, []);
|
|
66
|
+
const weekSystemEnabled = Boolean(season);
|
|
67
|
+
const showProductsTitle = weekNumber !== null;
|
|
68
|
+
const isOtherResultsEmpty = !(pages.length || instructors.length || filteredFaqs.length || information.length);
|
|
69
|
+
return _jsx("div", {
|
|
70
|
+
className: css.results,
|
|
71
|
+
children: (loading || text.length > 0) && _jsxs("div", {
|
|
72
|
+
className: css.inner,
|
|
73
|
+
children: [_jsxs("div", {
|
|
74
|
+
ref: ref,
|
|
75
|
+
className: css.left,
|
|
76
|
+
children: [_jsx(Links, {
|
|
77
|
+
linksTitle: message(lang, "pages"),
|
|
78
|
+
icon: "FileText",
|
|
79
|
+
links: pages,
|
|
80
|
+
loading: loading,
|
|
81
|
+
sendPlausibleGoal: sendPlausibleGoal
|
|
82
|
+
}), _jsx(Links, {
|
|
83
|
+
linksTitle: message(lang, "instructors"),
|
|
84
|
+
icon: "User",
|
|
85
|
+
links: instructors,
|
|
86
|
+
loading: loading,
|
|
87
|
+
sendPlausibleGoal: sendPlausibleGoal
|
|
88
|
+
}), _jsx(Links, {
|
|
89
|
+
linksTitle: message(lang, "faqs"),
|
|
90
|
+
icon: "Question",
|
|
91
|
+
links: filteredFaqs,
|
|
92
|
+
loading: loading,
|
|
93
|
+
sendPlausibleGoal: sendPlausibleGoal
|
|
94
|
+
}), _jsx(Links, {
|
|
95
|
+
linksTitle: message(lang, "information"),
|
|
96
|
+
icon: "Info",
|
|
97
|
+
links: information,
|
|
98
|
+
loading: loading,
|
|
99
|
+
sendPlausibleGoal: sendPlausibleGoal,
|
|
100
|
+
pageTitleAsTitle: true
|
|
101
|
+
})]
|
|
102
|
+
}), _jsxs("div", {
|
|
103
|
+
className: css.right,
|
|
104
|
+
children: [!loading && products.length > 0 && weekSystemEnabled && _jsx(_Fragment, {
|
|
105
|
+
children: showProductsTitle ? _jsxs("div", {
|
|
106
|
+
className: css.resultsWithWeekTitle,
|
|
107
|
+
children: [message(lang, "productTitleWithWeek"), Dates.weekToLongDate(weekNumber, season.end, season.forceSeasonSwitch), _jsxs(Button, {
|
|
108
|
+
onClick: openPeriodPicker,
|
|
109
|
+
children: [_jsx(Icons.Calendar, {}), message(lang, "updateWeek")]
|
|
110
|
+
})]
|
|
111
|
+
}) : _jsxs("div", {
|
|
112
|
+
className: css.resultsWithoutWeekTitle,
|
|
113
|
+
children: [message(lang, "productTitleWithoutWeek"), _jsxs(Button, {
|
|
114
|
+
onClick: openPeriodPicker,
|
|
115
|
+
children: [_jsx(Icons.Calendar, {}), message(lang, "chooseWeek")]
|
|
116
|
+
})]
|
|
117
|
+
})
|
|
118
|
+
}), _jsx(Products, {
|
|
119
|
+
lang: lang,
|
|
120
|
+
products: products,
|
|
121
|
+
weekNumber: weekNumber,
|
|
122
|
+
loading: loading,
|
|
123
|
+
sendPlausibleGoal: sendPlausibleGoal,
|
|
124
|
+
otherResultsRef: ref,
|
|
125
|
+
isOtherResultsEmpty: isOtherResultsEmpty
|
|
126
|
+
})]
|
|
127
|
+
})]
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
// import * as Fetcher from "ublo-lib/es/common/utils/fetcher";
|
|
2
1
|
import * as Fetcher from "../../../utils/fetcher";
|
|
3
2
|
const api = "https://search.ublo.app/api";
|
|
4
3
|
export function fetchResults(site, lang, query, groupLimit = 8, queryBy = "title,text,pageTitle,seoKeywords,parentTitle,seoTitle", queryByWeights) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
const endpoint = `${api}/search`;
|
|
5
|
+
return Fetcher.post(endpoint, {
|
|
6
|
+
q: query,
|
|
7
|
+
query_by: queryBy,
|
|
8
|
+
query_by_weights: queryByWeights,
|
|
9
|
+
group_limit: groupLimit,
|
|
10
|
+
per_page: 30
|
|
11
|
+
}, {
|
|
12
|
+
site,
|
|
13
|
+
lang
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
export function getHighlight(property, highlight, withExtractQuotes = false) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return snippet;
|
|
2
|
+
if (!highlight[property]?.snippet) return;
|
|
3
|
+
let snippet = highlight[property].snippet;
|
|
4
|
+
if (!withExtractQuotes) return snippet;
|
|
5
|
+
const startsWithMaj = /[A-Z]/.test(snippet);
|
|
6
|
+
const endsWithDot = snippet[snippet.length - 1] === ".";
|
|
7
|
+
if (!startsWithMaj) {
|
|
8
|
+
snippet = `...${snippet}`;
|
|
9
|
+
}
|
|
10
|
+
if (!endsWithDot) {
|
|
11
|
+
snippet = `${snippet}...`;
|
|
12
|
+
}
|
|
13
|
+
return snippet;
|
|
16
14
|
}
|
|
17
15
|
export function filterProducts(products, weekNumber) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
16
|
+
if (weekNumber !== null) {
|
|
17
|
+
return products.filter(product => {
|
|
18
|
+
const {
|
|
19
|
+
weeks = []
|
|
20
|
+
} = product.document;
|
|
21
|
+
return weeks.length === 0 || weeks.includes(weekNumber);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return products.reduce((acc, product) => {
|
|
25
|
+
const {
|
|
26
|
+
image,
|
|
27
|
+
pageTitle
|
|
28
|
+
} = product.document;
|
|
29
|
+
const isAlreadyInAcc = acc.some(item => {
|
|
30
|
+
return normalizeImage(item.document.image) === normalizeImage(image) && item.document.pageTitle === pageTitle;
|
|
31
|
+
});
|
|
32
|
+
if (isAlreadyInAcc) return acc;
|
|
33
|
+
return [...acc, product];
|
|
34
|
+
}, []);
|
|
34
35
|
}
|
|
35
36
|
function normalizeImage(image) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
37
|
+
if (!image) return "";
|
|
38
|
+
return image.replace(/(-[0-9]+)?.(jpg|jpeg|png|gif)/, "");
|
|
39
|
+
}
|