ublo-lib 1.24.4 → 1.25.1
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 +240 -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,59 +1,102 @@
|
|
|
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 { useUbloContext } from "ublo/with-ublo";
|
|
4
3
|
import { loadFileManager } from "../../utils/file-manager";
|
|
5
4
|
import styles from "./admin-links.module.css";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
8
|
const ToggleIcon = () => {
|
|
7
|
-
|
|
9
|
+
return _jsx("svg", {
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
width: "24",
|
|
12
|
+
height: "24",
|
|
13
|
+
className: styles.toggleIcon,
|
|
14
|
+
children: _jsx("path", {
|
|
15
|
+
d: "M19.44 12.99l-.01.02c.04-.33.08-.67.08-1.01 0-.34-.03-.66-.07-.99l.01.02 2.44-1.92-2.43-4.22-2.87 1.16.01.01c-.52-.4-1.09-.74-1.71-1h.01L14.44 2H9.57l-.44 3.07h.01c-.62.26-1.19.6-1.71 1l.01-.01-2.88-1.17-2.44 4.22 2.44 1.92.01-.02c-.04.33-.07.65-.07.99 0 .34.03.68.08 1.01l-.01-.02-2.1 1.65-.33.26 2.43 4.2 2.88-1.15-.02-.04c.53.41 1.1.75 1.73 1.01h-.03L9.58 22h4.85s.03-.18.06-.42l.38-2.65h-.01c.62-.26 1.2-.6 1.73-1.01l-.02.04 2.88 1.15 2.43-4.2s-.14-.12-.33-.26l-2.11-1.66zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"
|
|
16
|
+
})
|
|
17
|
+
});
|
|
8
18
|
};
|
|
9
|
-
const AdminLinks = ({
|
|
10
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
19
|
+
const AdminLinks = ({
|
|
20
|
+
customLinks
|
|
21
|
+
}) => {
|
|
22
|
+
const {
|
|
23
|
+
lang,
|
|
24
|
+
cmsMode,
|
|
25
|
+
config
|
|
26
|
+
} = useUbloContext();
|
|
27
|
+
const [open, setOpen] = React.useState(false);
|
|
28
|
+
const hasLangPrefix = config.langPrefix.links;
|
|
29
|
+
const {
|
|
30
|
+
plausibleLink
|
|
31
|
+
} = config;
|
|
32
|
+
const links = {
|
|
33
|
+
msemAdmin: {
|
|
34
|
+
name: "Administration MseM",
|
|
35
|
+
onClick: "https://admin.mon-sejour-en-montagne.com/",
|
|
36
|
+
target: "_blank"
|
|
37
|
+
},
|
|
38
|
+
tutoriels: {
|
|
39
|
+
name: "Tutoriels",
|
|
40
|
+
onClick: "https://www.valraiso.net/toolbox/?auth=my-toolbox&filter=tools",
|
|
41
|
+
target: "_blank"
|
|
42
|
+
},
|
|
43
|
+
popup: {
|
|
44
|
+
name: "Popup",
|
|
45
|
+
onClick: hasLangPrefix ? `/${lang.concat("/popup")}` : "/popup"
|
|
46
|
+
},
|
|
47
|
+
fileManager: {
|
|
48
|
+
name: "Photothèque",
|
|
49
|
+
onClick: loadFileManager
|
|
50
|
+
},
|
|
51
|
+
plausible: {
|
|
52
|
+
name: "Statistiques",
|
|
53
|
+
onClick: typeof plausibleLink === "string" ? plausibleLink : plausibleLink?.[lang],
|
|
54
|
+
target: "_blank"
|
|
55
|
+
},
|
|
56
|
+
...customLinks
|
|
57
|
+
};
|
|
58
|
+
return _jsx("div", {
|
|
59
|
+
className: styles.root,
|
|
60
|
+
children: cmsMode && _jsxs(_Fragment, {
|
|
61
|
+
children: [_jsx("div", {
|
|
62
|
+
className: styles.toggle,
|
|
63
|
+
onClick: () => setOpen(!open),
|
|
64
|
+
children: _jsx(ToggleIcon, {})
|
|
65
|
+
}), open && _jsxs("div", {
|
|
66
|
+
className: styles.links,
|
|
67
|
+
children: [_jsx("div", {
|
|
68
|
+
className: styles.linksTitle,
|
|
69
|
+
children: "Liens utiles"
|
|
70
|
+
}), Object.keys(links).map((key, i) => {
|
|
71
|
+
const link = links[key];
|
|
72
|
+
if (!link) return null;
|
|
73
|
+
const {
|
|
74
|
+
name,
|
|
75
|
+
onClick,
|
|
76
|
+
target
|
|
77
|
+
} = link;
|
|
78
|
+
const isHrefValid = typeof onClick === "string" && onClick !== "";
|
|
79
|
+
const isFunction = typeof onClick === "function";
|
|
80
|
+
if (!isHrefValid && !isFunction) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const Tag = isHrefValid ? "a" : "button";
|
|
84
|
+
const anchorProps = {
|
|
85
|
+
href: onClick,
|
|
86
|
+
target
|
|
87
|
+
};
|
|
88
|
+
const buttonProps = {
|
|
89
|
+
onClick
|
|
90
|
+
};
|
|
91
|
+
const props = isFunction ? buttonProps : anchorProps;
|
|
92
|
+
return _jsx(Tag, {
|
|
93
|
+
className: styles.link,
|
|
94
|
+
...props,
|
|
95
|
+
children: name
|
|
96
|
+
}, i);
|
|
97
|
+
})]
|
|
98
|
+
})]
|
|
99
|
+
})
|
|
100
|
+
});
|
|
58
101
|
};
|
|
59
|
-
export default AdminLinks;
|
|
102
|
+
export default AdminLinks;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import AdminLinks from "./admin-links";
|
|
2
|
-
export default AdminLinks;
|
|
2
|
+
export default AdminLinks;
|
|
@@ -1,24 +1,81 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import Link from "ublo/link";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const Item = ({
|
|
7
|
+
name,
|
|
8
|
+
page,
|
|
9
|
+
path,
|
|
10
|
+
itemTitle,
|
|
11
|
+
nextItem,
|
|
12
|
+
isCurrent,
|
|
13
|
+
exclusions
|
|
14
|
+
}) => {
|
|
15
|
+
const hasTemplate = page !== undefined;
|
|
16
|
+
const isExternalUrl = /^((http|https):\/\/)/.test(path);
|
|
17
|
+
const noHref = isCurrent || !hasTemplate;
|
|
18
|
+
const isExcluded = !isCurrent && exclusions.includes(name);
|
|
19
|
+
const Tag = isExternalUrl ? "a" : noHref ? "span" : Link;
|
|
20
|
+
const linkProps = {
|
|
21
|
+
title: itemTitle,
|
|
22
|
+
page,
|
|
23
|
+
as: path
|
|
24
|
+
};
|
|
25
|
+
const spanProps = {
|
|
26
|
+
dangerouslySetInnerHTML: {
|
|
27
|
+
__html: itemTitle
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const anchorProps = {
|
|
31
|
+
...spanProps,
|
|
32
|
+
href: path
|
|
33
|
+
};
|
|
34
|
+
const props = isExternalUrl ? anchorProps : noHref ? spanProps : linkProps;
|
|
35
|
+
return _jsxs(_Fragment, {
|
|
36
|
+
children: [!isExcluded && _jsx(Tag, {
|
|
37
|
+
className: "breadcrumb__item",
|
|
38
|
+
...props
|
|
39
|
+
}), nextItem]
|
|
40
|
+
});
|
|
14
41
|
};
|
|
15
|
-
const Items = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
42
|
+
const Items = ({
|
|
43
|
+
rawItem,
|
|
44
|
+
exclusions
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
next,
|
|
48
|
+
name,
|
|
49
|
+
title,
|
|
50
|
+
path,
|
|
51
|
+
page,
|
|
52
|
+
shortTitle
|
|
53
|
+
} = rawItem;
|
|
54
|
+
const isCurrent = next === undefined;
|
|
55
|
+
const isNextExcluded = !isCurrent && exclusions.includes(next.name);
|
|
56
|
+
const itemToRender = isNextExcluded ? next.next : next;
|
|
57
|
+
const nextItem = !isCurrent ? _jsx(Items, {
|
|
58
|
+
rawItem: itemToRender,
|
|
59
|
+
exclusions: exclusions
|
|
60
|
+
}) : null;
|
|
61
|
+
return _jsx(Item, {
|
|
62
|
+
name: name,
|
|
63
|
+
page: page,
|
|
64
|
+
path: path,
|
|
65
|
+
itemTitle: shortTitle || title,
|
|
66
|
+
nextItem: nextItem,
|
|
67
|
+
isCurrent: isCurrent,
|
|
68
|
+
exclusions: exclusions
|
|
69
|
+
});
|
|
22
70
|
};
|
|
23
|
-
const Breadcrumb = ({
|
|
24
|
-
|
|
71
|
+
const Breadcrumb = ({
|
|
72
|
+
breadcrumb,
|
|
73
|
+
exclusions = []
|
|
74
|
+
}) => _jsx("div", {
|
|
75
|
+
className: "breadcrumb",
|
|
76
|
+
children: _jsx(Items, {
|
|
77
|
+
rawItem: breadcrumb,
|
|
78
|
+
exclusions: exclusions
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import Zone from "ublo/zone";
|
|
4
|
+
import { useUbloContext } from "ublo/with-ublo";
|
|
5
|
+
import * as Plausible from "../plausible";
|
|
6
|
+
import Editor from "./editor";
|
|
7
|
+
import styles from "./cross-selling-editor.module.css";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export default function CrossSellingEditor({
|
|
11
|
+
titleZoneProps = {},
|
|
12
|
+
contentZoneProps = {},
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
const ref = React.useRef();
|
|
16
|
+
const titleRef = React.useRef();
|
|
17
|
+
const {
|
|
18
|
+
cmsMode
|
|
19
|
+
} = useUbloContext();
|
|
20
|
+
const sendPlausibleEvent = e => {
|
|
21
|
+
const link = e.target.closest("a");
|
|
22
|
+
if (link) {
|
|
23
|
+
const selector = ".tunnel-offer__title, [data-title]";
|
|
24
|
+
const offer = link.querySelector(selector)?.textContent || "";
|
|
25
|
+
Plausible.sendGoal("Cart Cross Selling Offer: Click", {
|
|
26
|
+
Clicked: offer
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return _jsxs("div", {
|
|
31
|
+
className: styles.editor,
|
|
32
|
+
onClick: sendPlausibleEvent,
|
|
33
|
+
children: [children, cmsMode === "editing" && _jsx(Editor, {
|
|
34
|
+
zoneRef: ref
|
|
35
|
+
}), titleZoneProps.enabled && _jsx(Zone, {
|
|
36
|
+
ref: titleRef,
|
|
37
|
+
id: titleZoneProps.id || "tunnel-offers-title",
|
|
38
|
+
className: classNames(styles.titleZone, titleZoneProps.className),
|
|
39
|
+
section: titleZoneProps.section,
|
|
40
|
+
maxSections: 1,
|
|
41
|
+
tooltip: "Zone d'edition : Titre des offres",
|
|
42
|
+
"data-title-zone": ""
|
|
43
|
+
}), contentZoneProps.enabled && _jsx(Zone, {
|
|
44
|
+
ref: ref,
|
|
45
|
+
id: contentZoneProps.id || "tunnel-offers",
|
|
46
|
+
className: classNames(styles.contentZone, contentZoneProps.className),
|
|
47
|
+
section: contentZoneProps.section,
|
|
48
|
+
tooltip: "Zone d'edition : Offres",
|
|
49
|
+
"data-content-zone": ""
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Dialog from "dt-design-system/es/dialog";
|
|
3
|
+
import Button from "dt-design-system/es/button";
|
|
4
|
+
import Tooltip from "dt-design-system/es/tooltip";
|
|
5
|
+
import * as Icons from "dt-design-system/es/icons";
|
|
6
|
+
import Rules from "./rules";
|
|
7
|
+
import Tester from "./tester";
|
|
8
|
+
import * as Utils from "./services/utils";
|
|
9
|
+
import styles from "./editor.module.css";
|
|
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
|
+
export default function Editor({
|
|
14
|
+
zoneRef
|
|
15
|
+
}) {
|
|
16
|
+
const zoneContainer = zoneRef.current;
|
|
17
|
+
const [dialogOpened, setDialogOpened] = React.useState(false);
|
|
18
|
+
const [config, setConfig] = React.useState({});
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
init(zoneContainer, setConfig);
|
|
21
|
+
}, [zoneContainer]);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const configContainer = zoneContainer?.querySelector(`#${Utils.CONFIG_ID}`);
|
|
24
|
+
if (configContainer) {
|
|
25
|
+
configContainer.textContent = JSON.stringify(config);
|
|
26
|
+
}
|
|
27
|
+
}, [config, zoneContainer]);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
if (dialogOpened) {
|
|
30
|
+
document.body.style.setProperty("overflow", "hidden");
|
|
31
|
+
} else {
|
|
32
|
+
document.body.style.removeProperty("overflow");
|
|
33
|
+
}
|
|
34
|
+
}, [dialogOpened]);
|
|
35
|
+
const openDialog = () => {
|
|
36
|
+
patchSections(zoneContainer);
|
|
37
|
+
setDialogOpened(true);
|
|
38
|
+
};
|
|
39
|
+
const closeDialog = () => {
|
|
40
|
+
setDialogOpened(false);
|
|
41
|
+
};
|
|
42
|
+
return _jsxs(_Fragment, {
|
|
43
|
+
children: [_jsx(Tooltip, {
|
|
44
|
+
content: "Param\xE9trer les offres crois\xE9es",
|
|
45
|
+
children: _jsx(Button, {
|
|
46
|
+
className: styles.button,
|
|
47
|
+
onClick: openDialog,
|
|
48
|
+
children: _jsx(Icons.Settings, {})
|
|
49
|
+
})
|
|
50
|
+
}), _jsx(Dialog, {
|
|
51
|
+
className: styles.dialog,
|
|
52
|
+
isOpened: dialogOpened,
|
|
53
|
+
close: closeDialog,
|
|
54
|
+
showAsModal: false,
|
|
55
|
+
children: _jsxs("div", {
|
|
56
|
+
className: styles.dialogInner,
|
|
57
|
+
children: [_jsx(Rules, {
|
|
58
|
+
container: zoneContainer,
|
|
59
|
+
config: config,
|
|
60
|
+
setConfig: setConfig,
|
|
61
|
+
tunnelOffers: Utils.tunnelOffers
|
|
62
|
+
}), _jsx(Tester, {
|
|
63
|
+
container: zoneContainer,
|
|
64
|
+
config: config,
|
|
65
|
+
tunnelOffers: Utils.tunnelOffers
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function init(zoneContainer, setConfig) {
|
|
72
|
+
let configContainer = zoneContainer?.querySelector(`#${Utils.CONFIG_ID}`);
|
|
73
|
+
if (!configContainer) {
|
|
74
|
+
configContainer = Object.assign(document.createElement("script"), {
|
|
75
|
+
id: Utils.CONFIG_ID,
|
|
76
|
+
type: "application/json",
|
|
77
|
+
innerHTML: JSON.stringify({})
|
|
78
|
+
});
|
|
79
|
+
if (zoneContainer) {
|
|
80
|
+
zoneContainer.appendChild(configContainer);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const storedConfig = configContainer.textContent;
|
|
84
|
+
if (storedConfig) {
|
|
85
|
+
setConfig(JSON.parse(storedConfig));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function patchSections(zoneContainer) {
|
|
89
|
+
if (!zoneContainer) return;
|
|
90
|
+
const sections = Array.from(zoneContainer?.querySelectorAll("section[data-class]"));
|
|
91
|
+
sections.forEach(section => {
|
|
92
|
+
const hasUuid = section.hasAttribute("data-uuid");
|
|
93
|
+
if (!hasUuid) {
|
|
94
|
+
const uuid = crypto.randomUUID();
|
|
95
|
+
section.setAttribute("data-uuid", uuid);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.dialog {
|
|
2
|
+
width: 1500px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.backdrop {
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 0;
|
|
8
|
+
left: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
background-color: rgba(255, 255, 255, 0.5);
|
|
12
|
+
backdrop-filter: blur(calc(var(--blur, 5px) * 3));
|
|
13
|
+
z-index: calc(var(--ds-floating-z-index, 100) - 1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dialogInner {
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.button {
|
|
22
|
+
margin-left: auto;
|
|
23
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useUbloContext } from "ublo/with-ublo";
|
|
3
|
+
import * as API from "../services/api";
|
|
4
|
+
import * as Utils from "../services/utils";
|
|
5
|
+
export default function useCustomOffers() {
|
|
6
|
+
const {
|
|
7
|
+
lang,
|
|
8
|
+
path
|
|
9
|
+
} = useUbloContext();
|
|
10
|
+
const [offers, setOffers] = React.useState();
|
|
11
|
+
React.useEffect(() => {
|
|
12
|
+
const titleZone = document.querySelector("[data-title-zone]");
|
|
13
|
+
const contentZone = document.querySelector("[data-content-zone]");
|
|
14
|
+
const getOffers = async () => {
|
|
15
|
+
const cartId = window.sessionStorage.getItem("cartId");
|
|
16
|
+
let items = {};
|
|
17
|
+
let merchants = [];
|
|
18
|
+
let stay = {};
|
|
19
|
+
let skiPassDurations = [];
|
|
20
|
+
if (cartId) {
|
|
21
|
+
try {
|
|
22
|
+
const {
|
|
23
|
+
cart
|
|
24
|
+
} = await API.fetchMseMCart(cartId, lang);
|
|
25
|
+
items = Utils.formatCartContent(cart);
|
|
26
|
+
merchants = Utils.getMerchantsFromCart(cart);
|
|
27
|
+
stay = Utils.getStayFromCart(cart);
|
|
28
|
+
skiPassDurations = await Utils.getskiPassDurationFromCart(cart);
|
|
29
|
+
} catch (e) {}
|
|
30
|
+
}
|
|
31
|
+
const content = {
|
|
32
|
+
items,
|
|
33
|
+
merchants,
|
|
34
|
+
stay,
|
|
35
|
+
skiPassDurations
|
|
36
|
+
};
|
|
37
|
+
const storedConfig = Utils.getConfig(contentZone);
|
|
38
|
+
const sortedOffers = Utils.getSortedOffers(contentZone, content, storedConfig);
|
|
39
|
+
const title = titleZone?.innerHTML || "";
|
|
40
|
+
const customOffers = sortedOffers.length > 0 ? `
|
|
41
|
+
${title}
|
|
42
|
+
<div data-custom-offers="">
|
|
43
|
+
${sortedOffers.map(({
|
|
44
|
+
elementHTML
|
|
45
|
+
}) => elementHTML).join("")}
|
|
46
|
+
</div>` : undefined;
|
|
47
|
+
setOffers(customOffers);
|
|
48
|
+
};
|
|
49
|
+
getOffers();
|
|
50
|
+
}, [lang, path]);
|
|
51
|
+
return offers;
|
|
52
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useUbloContext } from "ublo/with-ublo";
|
|
3
|
+
import { fetchZone } from "ublo/fetcher";
|
|
4
|
+
import * as Utils from "../services/utils";
|
|
5
|
+
export default function useTunnelOffers(zone, path, cart) {
|
|
6
|
+
const {
|
|
7
|
+
ubloApi,
|
|
8
|
+
site,
|
|
9
|
+
lang
|
|
10
|
+
} = useUbloContext();
|
|
11
|
+
const [offers, setOffers] = React.useState([]);
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
const getOffers = async () => {
|
|
14
|
+
const offers = await fetchZone(ubloApi, site, lang, path, zone);
|
|
15
|
+
const container = Object.assign(document.createElement("div"), {
|
|
16
|
+
innerHTML: offers
|
|
17
|
+
});
|
|
18
|
+
const items = Utils.formatCartContent(cart);
|
|
19
|
+
const merchants = Utils.getMerchantsFromCart(cart);
|
|
20
|
+
const stay = Utils.getStayFromCart(cart);
|
|
21
|
+
const skiPassDurations = await Utils.getskiPassDurationFromCart(cart);
|
|
22
|
+
const content = {
|
|
23
|
+
items,
|
|
24
|
+
merchants,
|
|
25
|
+
stay,
|
|
26
|
+
skiPassDurations
|
|
27
|
+
};
|
|
28
|
+
const storedConfig = Utils.getConfig(container);
|
|
29
|
+
const sortedOffers = Utils.getSortedOffers(container, content, storedConfig);
|
|
30
|
+
setOffers(sortedOffers);
|
|
31
|
+
};
|
|
32
|
+
getOffers();
|
|
33
|
+
}, [cart, lang, path, site, ubloApi, zone]);
|
|
34
|
+
return offers;
|
|
35
|
+
}
|