ublo-lib 1.24.3 → 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 -95
- 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/scrolling-carousel/scrolling-carousel.module.css +1 -0
- 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,26 +1,26 @@
|
|
|
1
|
-
export const build =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return `${sign}${key}=${value}`;
|
|
11
|
-
})
|
|
12
|
-
.join("");
|
|
1
|
+
export const build = params => {
|
|
2
|
+
return Object.keys(params).map((key, i) => {
|
|
3
|
+
const param = params[key];
|
|
4
|
+
if (!param) return "";
|
|
5
|
+
const isObject = typeof param === "object";
|
|
6
|
+
const sign = i === 0 ? "?" : "&";
|
|
7
|
+
const value = isObject ? encodeURI(JSON.stringify(param)) : param;
|
|
8
|
+
return `${sign}${key}=${value}`;
|
|
9
|
+
}).join("");
|
|
13
10
|
};
|
|
14
11
|
export const getPresetUrl = (lang, preset, baseUrl) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
12
|
+
const {
|
|
13
|
+
host,
|
|
14
|
+
protocol
|
|
15
|
+
} = window.location;
|
|
16
|
+
const isExternalUrl = baseUrl.startsWith("http");
|
|
17
|
+
const alreadyContainsLang = baseUrl.includes(`/${lang}`);
|
|
18
|
+
const encodedParams = build(preset);
|
|
19
|
+
if (isExternalUrl) {
|
|
20
|
+
return baseUrl.concat(encodedParams);
|
|
21
|
+
}
|
|
22
|
+
if (alreadyContainsLang) {
|
|
23
|
+
return `${protocol}//${host}${baseUrl}${encodedParams}`;
|
|
24
|
+
}
|
|
25
|
+
return `${protocol}//${host}/${lang}${baseUrl}${encodedParams}`;
|
|
26
|
+
};
|
|
@@ -1,45 +1,57 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import classNames from "classnames";
|
|
4
3
|
import * as Icons from "dt-design-system/es/icons";
|
|
5
4
|
import { MODES } from "../msem-preset-linker";
|
|
6
5
|
import css from "./actions.module.css";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export default function Actions({
|
|
10
|
+
mode,
|
|
11
|
+
setMode
|
|
12
|
+
}) {
|
|
13
|
+
const toggleMode = React.useCallback(() => {
|
|
14
|
+
if (mode === MODES.CONNECTED) {
|
|
15
|
+
setMode(MODES.EDITING);
|
|
16
|
+
window.Cms.desactivate();
|
|
17
|
+
window.Cms.hideInfo();
|
|
18
|
+
window.Cms.pageUi.removeAttribute("active");
|
|
19
|
+
window.Cms.pageUi.setAttribute("hidden", "");
|
|
20
|
+
document.body.classList.add("msem-preset-linker--editing");
|
|
21
|
+
} else {
|
|
22
|
+
setMode(MODES.CONNECTED);
|
|
23
|
+
window.Cms.pageUi.removeAttribute("hidden");
|
|
24
|
+
document.body.classList.remove("msem-preset-linker--editing");
|
|
25
|
+
}
|
|
26
|
+
}, [mode, setMode]);
|
|
27
|
+
const onSaveClick = async () => {
|
|
28
|
+
if (!window.Cms) return;
|
|
29
|
+
window.Cms.pageUi.removeAttribute("hidden");
|
|
30
|
+
window.Cms.pageUi.setAttribute("active", "");
|
|
31
|
+
window.Cms.pageUi.startLoading();
|
|
32
|
+
setMode(MODES.CONNECTED);
|
|
33
|
+
setTimeout(async () => {
|
|
34
|
+
window.Cms.pageUi.unsavedChanges = false;
|
|
35
|
+
await window.Cms.save();
|
|
36
|
+
window.Cms.pageUi.stopLoading();
|
|
37
|
+
window.Cms.pageUi.removeAttribute("active");
|
|
38
|
+
}, 200);
|
|
39
|
+
};
|
|
40
|
+
React.useEffect(() => {
|
|
41
|
+
window.toggleMseMLinker = toggleMode;
|
|
42
|
+
}, [mode, toggleMode]);
|
|
43
|
+
if (mode !== MODES.EDITING) return null;
|
|
44
|
+
const cancelClasses = classNames(css.action, css.cancel);
|
|
45
|
+
const saveClasses = classNames(css.action, css.save);
|
|
46
|
+
return _jsxs(_Fragment, {
|
|
47
|
+
children: [_jsx("button", {
|
|
48
|
+
className: cancelClasses,
|
|
49
|
+
onClick: toggleMode,
|
|
50
|
+
children: _jsx(Icons.Cross, {})
|
|
51
|
+
}), _jsx("button", {
|
|
52
|
+
className: saveClasses,
|
|
53
|
+
onClick: onSaveClick,
|
|
54
|
+
children: _jsx(Icons.Save, {})
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import * as ReactDOM from "react-dom";
|
|
4
3
|
import classNames from "classnames";
|
|
@@ -6,43 +5,60 @@ import Tooltip from "dt-design-system/es/tooltip";
|
|
|
6
5
|
import * as Icons from "dt-design-system/es/icons";
|
|
7
6
|
import { MODES } from "../msem-preset-linker";
|
|
8
7
|
import css from "./overlays.module.css";
|
|
9
|
-
|
|
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
|
-
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
|
+
export default function Overlays({
|
|
11
|
+
mode,
|
|
12
|
+
target,
|
|
13
|
+
setTarget
|
|
14
|
+
}) {
|
|
15
|
+
const [sections, setSections] = React.useState([]);
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (mode === MODES.EDITING) {
|
|
18
|
+
const targets = Array.from(document.querySelectorAll("section[data-class]"));
|
|
19
|
+
setSections(targets);
|
|
20
|
+
targets.forEach(target => {
|
|
21
|
+
const section = target;
|
|
22
|
+
section.style.setProperty("position", "relative");
|
|
23
|
+
});
|
|
24
|
+
return () => {
|
|
25
|
+
targets.forEach(target => {
|
|
26
|
+
const section = target;
|
|
27
|
+
section.style.removeProperty("position");
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}, [mode]);
|
|
32
|
+
if (mode !== MODES.EDITING) return null;
|
|
33
|
+
return _jsx(_Fragment, {
|
|
34
|
+
children: sections.map(section => {
|
|
35
|
+
const hasMseMPreset = section?.hasAttribute("data-msem-preset");
|
|
36
|
+
const hasObsoletePreset = section?.hasAttribute("data-config");
|
|
37
|
+
const hasPreset = hasMseMPreset || hasObsoletePreset;
|
|
38
|
+
const isActive = section === target;
|
|
39
|
+
const updateTarget = () => {
|
|
40
|
+
if (target) return;
|
|
41
|
+
setTarget(isActive ? null : section);
|
|
42
|
+
};
|
|
43
|
+
const classes = classNames(css.overlay, {
|
|
44
|
+
[css.active]: isActive,
|
|
45
|
+
[css.obsolete]: hasObsoletePreset
|
|
46
|
+
});
|
|
47
|
+
const tooltip = hasObsoletePreset ? "1 preset MseM obsolète" : "1 preset MseM";
|
|
48
|
+
return ReactDOM.createPortal(_jsx("div", {
|
|
49
|
+
className: classes,
|
|
50
|
+
onClick: updateTarget,
|
|
51
|
+
"data-cms-remove": "",
|
|
52
|
+
children: hasPreset && _jsx(Tooltip, {
|
|
53
|
+
content: tooltip,
|
|
54
|
+
children: _jsx("div", {
|
|
55
|
+
className: css.presetIndicator,
|
|
56
|
+
children: _jsx(Icons.Tune, {
|
|
57
|
+
className: css.presetIndicatorIcon
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
}), section);
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import Select from "dt-design-system/es/select";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export default function ResortSelector({
|
|
5
|
+
resorts,
|
|
6
|
+
resort,
|
|
7
|
+
setResort
|
|
8
|
+
}) {
|
|
9
|
+
const formatedResorts = resorts.map(resort => ({
|
|
10
|
+
label: resort.label,
|
|
11
|
+
value: String(resort.resort)
|
|
12
|
+
}));
|
|
13
|
+
return _jsx(Select, {
|
|
14
|
+
value: resort,
|
|
15
|
+
onValueChange: setResort,
|
|
16
|
+
label: "Destination",
|
|
17
|
+
options: [{
|
|
18
|
+
label: "Sélectionnez une destination pour continuer",
|
|
19
|
+
value: ""
|
|
20
|
+
}, ...formatedResorts]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -3,34 +3,46 @@ import { useUbloContext } from "ublo/with-ublo";
|
|
|
3
3
|
import { MODES, PRESET_ATTRIBUTE } from "../msem-preset-linker";
|
|
4
4
|
import * as UrlParams from "../services/url-params";
|
|
5
5
|
import * as MseM from "../../../utils/msem-widget";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
}
|
|
6
|
+
export default function useMsemPresets({
|
|
7
|
+
mode
|
|
8
|
+
}) {
|
|
9
|
+
const {
|
|
10
|
+
lang,
|
|
11
|
+
cmsMode,
|
|
12
|
+
path
|
|
13
|
+
} = useUbloContext();
|
|
14
|
+
const isEnabled = cmsMode !== "editing" && cmsMode !== "info" && mode !== MODES.EDITING;
|
|
15
|
+
const handleSectionClick = React.useCallback(e => {
|
|
16
|
+
const target = e.target;
|
|
17
|
+
const section = target.closest(`section[${PRESET_ATTRIBUTE}]`);
|
|
18
|
+
const preset = section?.getAttribute(PRESET_ATTRIBUTE);
|
|
19
|
+
if (!preset) return;
|
|
20
|
+
const {
|
|
21
|
+
widget,
|
|
22
|
+
options,
|
|
23
|
+
presets,
|
|
24
|
+
url
|
|
25
|
+
} = JSON.parse(preset);
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
if (url) {
|
|
29
|
+
const params = UrlParams.build({
|
|
30
|
+
options,
|
|
31
|
+
presets
|
|
32
|
+
});
|
|
33
|
+
const endpoint = url.concat(params);
|
|
34
|
+
window.open(endpoint, "_blank");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
MseM.loadWidget(widget, options, presets);
|
|
38
|
+
}, []);
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
const container = document.getElementById("__next");
|
|
41
|
+
if (isEnabled && container) {
|
|
42
|
+
container.addEventListener("click", handleSectionClick);
|
|
43
|
+
return () => {
|
|
44
|
+
container.removeEventListener("click", handleSectionClick);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, [lang, handleSectionClick, isEnabled, path]);
|
|
48
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import MseMPresetLinker from "./msem-preset-linker";
|
|
2
|
-
export default MseMPresetLinker;
|
|
2
|
+
export default MseMPresetLinker;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import * as React from "react";
|
|
3
2
|
import { useUbloContext } from "ublo/with-ublo";
|
|
4
3
|
import Router from "next/router";
|
|
@@ -7,48 +6,78 @@ import css from "./msem-preset-linker.module.css";
|
|
|
7
6
|
import Overlays from "./components/overlays";
|
|
8
7
|
import EditorDialog from "../msem-preset-editor/editor-dialog";
|
|
9
8
|
import useMsemPresets from "./hooks/use-msem-presets";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
export const MODES = {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
CONNECTED: 0,
|
|
13
|
+
EDITING: 1
|
|
13
14
|
};
|
|
14
15
|
export const PRESET_ATTRIBUTE = "data-msem-preset";
|
|
15
|
-
export default function MseMPresetLinker({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
target?.removeAttribute(PRESET_ATTRIBUTE);
|
|
38
|
-
}
|
|
39
|
-
removeObsoletePreset();
|
|
40
|
-
setTarget(null);
|
|
41
|
-
};
|
|
42
|
-
const closeEditor = () => {
|
|
43
|
-
setTarget(null);
|
|
44
|
-
};
|
|
45
|
-
Router.ready(() => {
|
|
46
|
-
Router.events.on("routeChangeStart", () => {
|
|
47
|
-
setMode(MODES.CONNECTED);
|
|
48
|
-
});
|
|
16
|
+
export default function MseMPresetLinker({
|
|
17
|
+
lang,
|
|
18
|
+
options,
|
|
19
|
+
urls,
|
|
20
|
+
noLodgingPage,
|
|
21
|
+
children
|
|
22
|
+
}) {
|
|
23
|
+
const {
|
|
24
|
+
cmsMode
|
|
25
|
+
} = useUbloContext();
|
|
26
|
+
const [mode, setMode] = React.useState(MODES.CONNECTED);
|
|
27
|
+
const [target, setTarget] = React.useState(null);
|
|
28
|
+
const link = target?.querySelector(":scope > a");
|
|
29
|
+
const urlOverride = link?.getAttribute("href") || undefined;
|
|
30
|
+
const urlsWithOverride = {
|
|
31
|
+
...urls,
|
|
32
|
+
override: urlOverride
|
|
33
|
+
};
|
|
34
|
+
const removeObsoletePreset = () => {
|
|
35
|
+
const attributes = ["data-config", "data-widget", "data-resort"];
|
|
36
|
+
attributes.forEach(attribute => {
|
|
37
|
+
target?.removeAttribute(attribute);
|
|
49
38
|
});
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
setTarget(null);
|
|
40
|
+
};
|
|
41
|
+
const updatePreset = newPreset => {
|
|
42
|
+
if (newPreset) {
|
|
43
|
+
target?.setAttribute(PRESET_ATTRIBUTE, JSON.stringify(newPreset));
|
|
44
|
+
} else {
|
|
45
|
+
target?.removeAttribute(PRESET_ATTRIBUTE);
|
|
46
|
+
}
|
|
47
|
+
removeObsoletePreset();
|
|
48
|
+
setTarget(null);
|
|
49
|
+
};
|
|
50
|
+
const closeEditor = () => {
|
|
51
|
+
setTarget(null);
|
|
52
|
+
};
|
|
53
|
+
Router.ready(() => {
|
|
54
|
+
Router.events.on("routeChangeStart", () => {
|
|
55
|
+
setMode(MODES.CONNECTED);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
useMsemPresets({
|
|
59
|
+
mode
|
|
60
|
+
});
|
|
61
|
+
if (!cmsMode) return null;
|
|
62
|
+
return _jsxs("div", {
|
|
63
|
+
className: css.linker,
|
|
64
|
+
children: [_jsx(Actions, {
|
|
65
|
+
mode: mode,
|
|
66
|
+
setMode: setMode
|
|
67
|
+
}), _jsx(Overlays, {
|
|
68
|
+
mode: mode,
|
|
69
|
+
target: target,
|
|
70
|
+
setTarget: setTarget
|
|
71
|
+
}), _jsx(EditorDialog, {
|
|
72
|
+
lang: lang,
|
|
73
|
+
options: options,
|
|
74
|
+
target: target,
|
|
75
|
+
updatePreset: updatePreset,
|
|
76
|
+
closeEditor: closeEditor,
|
|
77
|
+
removeObsoletePreset: removeObsoletePreset,
|
|
78
|
+
urls: urlsWithOverride,
|
|
79
|
+
noLodgingPage: noLodgingPage,
|
|
80
|
+
children: children
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
export const build =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
.join("");
|
|
13
|
-
};
|
|
1
|
+
export const build = params => {
|
|
2
|
+
return Object.keys(params).map((key, i) => {
|
|
3
|
+
const param = params[key];
|
|
4
|
+
if (!param) return "";
|
|
5
|
+
const isObject = typeof param === "object";
|
|
6
|
+
const sign = i === 0 ? "?" : "&";
|
|
7
|
+
const value = isObject ? encodeURI(JSON.stringify(param)) : param;
|
|
8
|
+
return `${sign}${key}=${value}`;
|
|
9
|
+
}).join("");
|
|
10
|
+
};
|
|
@@ -2,24 +2,28 @@ import * as React from "react";
|
|
|
2
2
|
import getConfig from "next/config";
|
|
3
3
|
import load from "../services/load";
|
|
4
4
|
import sendGoal from "../services/send-goal";
|
|
5
|
-
const {
|
|
6
|
-
|
|
5
|
+
const {
|
|
6
|
+
publicRuntimeConfig
|
|
7
|
+
} = getConfig();
|
|
8
|
+
const {
|
|
9
|
+
plausibleDomain
|
|
10
|
+
} = publicRuntimeConfig;
|
|
7
11
|
export default function useGoal(goal, props, revenue, overridenDomain) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const [loaded] = usePlausible(overridenDomain);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (!loaded || !window.plausible) return;
|
|
15
|
+
const defaultProps = {
|
|
16
|
+
path: document.location.pathname
|
|
17
|
+
};
|
|
18
|
+
sendGoal(goal, props || defaultProps, revenue);
|
|
19
|
+
}, [goal, loaded, props]);
|
|
15
20
|
}
|
|
16
21
|
function usePlausible(overridenDomain) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
22
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
if (!overridenDomain && !plausibleDomain) return;
|
|
25
|
+
load();
|
|
26
|
+
setLoaded(true);
|
|
27
|
+
}, [overridenDomain]);
|
|
28
|
+
return [loaded, setLoaded];
|
|
29
|
+
}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import Script from "next/script";
|
|
3
3
|
import getConfig from "next/config";
|
|
4
|
-
|
|
5
|
-
const {
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const {
|
|
6
|
+
publicRuntimeConfig
|
|
7
|
+
} = getConfig();
|
|
8
|
+
const {
|
|
9
|
+
plausibleDomain
|
|
10
|
+
} = publicRuntimeConfig;
|
|
6
11
|
const DEFAULT_SOURCE = "https://plausible.io/js/script.revenue.file-downloads.outbound-links.js";
|
|
7
|
-
export default function PlausibleScript({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
export default function PlausibleScript({
|
|
13
|
+
lang,
|
|
14
|
+
source = DEFAULT_SOURCE
|
|
15
|
+
}) {
|
|
16
|
+
const hasI18n = typeof plausibleDomain === "object";
|
|
17
|
+
if (hasI18n && !lang) {
|
|
18
|
+
console.warn("PlausibleScript: the lang props is mandatory if you want to use a specific domain for each lang");
|
|
19
|
+
}
|
|
20
|
+
const domain = hasI18n && lang ? plausibleDomain[lang] : plausibleDomain;
|
|
21
|
+
if (!domain) return null;
|
|
22
|
+
return _jsx(Script, {
|
|
23
|
+
"data-domain": domain,
|
|
24
|
+
src: source
|
|
25
|
+
});
|
|
26
|
+
}
|