@empathyco/x-components 3.0.0-alpha.136 → 3.0.0-alpha.139

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/core/index.js +3 -0
  3. package/core/index.js.map +1 -1
  4. package/docs/API-reference/api/x-components.clearsearchquery.md +13 -0
  5. package/docs/API-reference/api/x-components.closemainmodal.md +15 -0
  6. package/docs/API-reference/api/x-components.historyqueriesswitch.hashistoryqueries.md +13 -0
  7. package/docs/API-reference/api/x-components.historyqueriesswitch.historyqueries.md +13 -0
  8. package/docs/API-reference/api/x-components.historyqueriesswitch.md +7 -0
  9. package/docs/API-reference/api/x-components.mainmodal.animation.md +13 -0
  10. package/docs/API-reference/api/x-components.mainmodal.md +21 -0
  11. package/docs/API-reference/api/x-components.md +4 -0
  12. package/docs/API-reference/api/x-components.openmainmodal.md +15 -0
  13. package/docs/API-reference/api/x-components.xeventstypes.md +1 -0
  14. package/docs/API-reference/api/x-components.xeventstypes.userclickedoutofmainmodal.md +13 -0
  15. package/docs/API-reference/components/common/modals/x-components.close-main-modal.md +53 -0
  16. package/docs/API-reference/components/common/modals/x-components.main-modal.md +59 -0
  17. package/docs/API-reference/components/common/modals/x-components.open-main-modal.md +53 -0
  18. package/docs/API-reference/components/history-queries/x-components.history-queries-switch.md +5 -1
  19. package/js/components/modals/close-main-modal.vue.js +61 -0
  20. package/js/components/modals/close-main-modal.vue.js.map +1 -0
  21. package/js/components/modals/close-main-modal.vue_rollup-plugin-vue_script.vue.js +32 -0
  22. package/js/components/modals/close-main-modal.vue_rollup-plugin-vue_script.vue.js.map +1 -0
  23. package/js/components/modals/main-modal.vue.js +61 -0
  24. package/js/components/modals/main-modal.vue.js.map +1 -0
  25. package/js/components/modals/main-modal.vue_rollup-plugin-vue_script.vue.js +48 -0
  26. package/js/components/modals/main-modal.vue_rollup-plugin-vue_script.vue.js.map +1 -0
  27. package/js/components/modals/open-main-modal.vue.js +61 -0
  28. package/js/components/modals/open-main-modal.vue.js.map +1 -0
  29. package/js/components/modals/open-main-modal.vue_rollup-plugin-vue_script.vue.js +32 -0
  30. package/js/components/modals/open-main-modal.vue_rollup-plugin-vue_script.vue.js.map +1 -0
  31. package/js/index.js +4 -1
  32. package/js/index.js.map +1 -1
  33. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js +3 -0
  34. package/js/x-modules/extra-params/components/extra-params.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  35. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue_script.vue.js +3 -0
  36. package/js/x-modules/extra-params/components/renderless-extra-param.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  37. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue_script.vue.js +3 -0
  38. package/js/x-modules/facets/components/clear-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  39. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js +3 -0
  40. package/js/x-modules/facets/components/facets/facets-provider.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  41. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue_script.vue.js +3 -0
  42. package/js/x-modules/facets/components/filters/all-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  43. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue_script.vue.js +3 -0
  44. package/js/x-modules/facets/components/filters/hierarchical-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  45. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue_script.vue.js +3 -0
  46. package/js/x-modules/facets/components/filters/number-range-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  47. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue_script.vue.js +3 -0
  48. package/js/x-modules/facets/components/filters/renderless-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  49. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue_script.vue.js +3 -0
  50. package/js/x-modules/facets/components/filters/simple-filter.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  51. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue_script.vue.js +3 -0
  52. package/js/x-modules/facets/components/lists/exclude-filters-with-no-results.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  53. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_script.vue.js +3 -0
  54. package/js/x-modules/facets/components/lists/filters-list.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  55. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_script.vue.js +3 -0
  56. package/js/x-modules/facets/components/lists/filters-search.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  57. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue_script.vue.js +3 -0
  58. package/js/x-modules/facets/components/lists/selected-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  59. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue_script.vue.js +3 -0
  60. package/js/x-modules/facets/components/lists/sliced-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  61. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue_script.vue.js +3 -0
  62. package/js/x-modules/facets/components/lists/sorted-filters.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  63. package/js/x-modules/history-queries/components/history-queries-switch.vue.js.map +1 -1
  64. package/js/x-modules/history-queries/components/history-queries-switch.vue_rollup-plugin-vue_script.vue.js +17 -1
  65. package/js/x-modules/history-queries/components/history-queries-switch.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  66. package/js/x-modules/history-queries/wiring.js +6 -0
  67. package/js/x-modules/history-queries/wiring.js.map +1 -1
  68. package/js/x-modules/identifier-results/wiring.js +6 -0
  69. package/js/x-modules/identifier-results/wiring.js.map +1 -1
  70. package/js/x-modules/query-suggestions/wiring.js +6 -0
  71. package/js/x-modules/query-suggestions/wiring.js.map +1 -1
  72. package/js/x-modules/related-tags/wiring.js +6 -0
  73. package/js/x-modules/related-tags/wiring.js.map +1 -1
  74. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue_script.vue.js +3 -0
  75. package/js/x-modules/scroll/components/main-scroll-item.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  76. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue_script.vue.js +3 -0
  77. package/js/x-modules/scroll/components/scroll-to-top.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  78. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue_script.vue.js +3 -0
  79. package/js/x-modules/scroll/components/window-scroll.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  80. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_script.vue.js +3 -0
  81. package/js/x-modules/search/components/sort-list.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  82. package/js/x-modules/search/components/sort.mixin.js +3 -0
  83. package/js/x-modules/search/components/sort.mixin.js.map +1 -1
  84. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue_script.vue.js +3 -0
  85. package/js/x-modules/search/components/spellcheck.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  86. package/js/x-modules/search/wiring.js +13 -1
  87. package/js/x-modules/search/wiring.js.map +1 -1
  88. package/js/x-modules/search-box/wiring.js +6 -0
  89. package/js/x-modules/search-box/wiring.js.map +1 -1
  90. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue_script.vue.js +3 -0
  91. package/js/x-modules/url/components/url-handler.vue_rollup-plugin-vue_script.vue.js.map +1 -1
  92. package/package.json +3 -3
  93. package/report/x-components.api.json +230 -1
  94. package/report/x-components.api.md +65 -0
  95. package/search/index.js +1 -1
  96. package/types/components/modals/close-main-modal.vue.d.ts +16 -0
  97. package/types/components/modals/close-main-modal.vue.d.ts.map +1 -0
  98. package/types/components/modals/index.d.ts +3 -0
  99. package/types/components/modals/index.d.ts.map +1 -1
  100. package/types/components/modals/main-modal.vue.d.ts +34 -0
  101. package/types/components/modals/main-modal.vue.d.ts.map +1 -0
  102. package/types/components/modals/open-main-modal.vue.d.ts +16 -0
  103. package/types/components/modals/open-main-modal.vue.d.ts.map +1 -0
  104. package/types/wiring/events.types.d.ts +5 -0
  105. package/types/wiring/events.types.d.ts.map +1 -1
  106. package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts +11 -0
  107. package/types/x-modules/history-queries/components/history-queries-switch.vue.d.ts.map +1 -1
  108. package/types/x-modules/history-queries/wiring.d.ts +6 -0
  109. package/types/x-modules/history-queries/wiring.d.ts.map +1 -1
  110. package/types/x-modules/identifier-results/wiring.d.ts +6 -0
  111. package/types/x-modules/identifier-results/wiring.d.ts.map +1 -1
  112. package/types/x-modules/query-suggestions/wiring.d.ts +6 -0
  113. package/types/x-modules/query-suggestions/wiring.d.ts.map +1 -1
  114. package/types/x-modules/related-tags/wiring.d.ts +6 -0
  115. package/types/x-modules/related-tags/wiring.d.ts.map +1 -1
  116. package/types/x-modules/search/wiring.d.ts +12 -0
  117. package/types/x-modules/search/wiring.d.ts.map +1 -1
  118. package/types/x-modules/search-box/wiring.d.ts +6 -0
  119. package/types/x-modules/search-box/wiring.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"url-handler.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/url/components/url-handler.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport { Dictionary, objectFilter } from '@empathyco/x-utils';\nimport Vue from 'vue';\nimport GlobalEvents from 'vue-global-events';\nimport { Component, Inject } from 'vue-property-decorator';\nimport { State } from '../../../components';\nimport { XOn } from '../../../components/decorators/bus.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { FeatureLocation } from '../../../types/origin';\nimport { UrlParams } from '../../../types/url-params';\nimport { isArrayEmpty } from '../../../utils/array';\nimport { WireMetadata } from '../../../wiring/wiring.types';\nimport { SnippetConfig } from '../../../x-installer/api/api.types';\nimport { initialUrlState } from '../store/initial-state';\nimport { UrlParamValue } from '../store/types';\nimport { urlXModule } from '../x-module';\n\ninterface ParsedUrlParams {\n all: UrlParams;\n extra: Dictionary<unknown>;\n}\n\n/**\n * This component manage the browser URL parameters to perserve them through reloads and browser\n * history navigation. It allow to configure the default url parameter names using its attributes.\n * This component doesn't render elements to the DOM.\n *\n * @public\n */\n@Component({\n components: {\n GlobalEvents\n },\n mixins: [xComponentMixin(urlXModule)]\n})\nexport default class UrlHandler extends Vue {\n /**\n * The {@link SnippetConfig} provided by an ancestor.\n *\n * @internal\n */\n @Inject({ default: undefined })\n protected snippetConfig?: SnippetConfig;\n\n /**\n * Flag to know if the params were already loaded from the URL.\n *\n * @internal\n */\n protected urlLoaded = false;\n\n /**\n * The page URL. It is used to compare against the current URL to check navigation state.\n *\n * @internal\n */\n protected url?: URL;\n\n /**\n * Flag to know if the page has been persisted by the browser's back-forward cache.\n *\n * @internal\n */\n protected isPagePersisted = false;\n\n /**\n * Computed to know which params we must get from URL. It gets the params names from the initial\n * state, to get all default params names, and also from the `$attrs` to get the extra params\n * names to take into account.\n *\n * @returns An array with the name of the params.\n *\n * @internal\n */\n protected get managedParamsNames(): string[] {\n return Object.keys({ ...initialUrlState, ...this.$attrs });\n }\n\n @State('url', 'initialExtraParams')\n public initialExtraParams!: Dictionary<unknown>;\n\n /**\n * Returns the mapping of the param keys used in the URL is configured through $attrs. This way\n * we can support any param and extra param, no matters its name.\n *\n * @param paramName - The param name to get the Url key.\n * @returns The key used in the URL for the `paramName` passed.\n *\n * @internal\n */\n protected getUrlKey(paramName: string): string {\n return this.$attrs[paramName] ?? paramName;\n }\n\n /**\n * To emit the Url events just when the URL is load, and before the components mounted events\n * and state changes, we do it in the created of this component.\n */\n created(): void {\n this.emitEvents();\n }\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `pushState` method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n @XOn('PushableUrlStateChanged')\n updateUrlWithPush(newUrlParams: UrlParams): void {\n this.updateUrl(newUrlParams, window.history.pushState.bind(window.history));\n }\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `replaceState`\n * method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n @XOn('ReplaceableUrlStateChanged')\n updateUrlWithReplace(newUrlParams: UrlParams): void {\n this.updateUrl(newUrlParams, window.history.replaceState.bind(window.history));\n }\n\n /**\n * Handler of the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event | pageshow }\n * event.\n *\n * @remarks The pageshow event is listened to check if the browser has performed a navigation\n * using the back-forward cache. This information is available in the\n * PageTransitionEvent.persisted property.\n *\n * @param event - The page transition event.\n * @internal\n */\n protected onPageShow(event: PageTransitionEvent): void {\n this.isPagePersisted = event.persisted;\n if (event.persisted) {\n // The internal url is reset due to the back-forward cache storing the previous value which\n // is no longer valid.\n this.url = undefined;\n }\n }\n\n /**\n * Emits the {@link UrlXEvents.ParamsLoadedFromUrl} XEvent,\n * the {@link UrlXEvents.ExtraParamsLoadedFromUrl} XEvent and, if there is query, also emits\n * the {@link XEventsTypes.UserOpenXProgrammatically}.\n *\n * @internal\n */\n protected emitEvents(): void {\n const { all, extra } = this.parseUrlParams();\n const metadata = this.createWireMetadata();\n this.$x.emit('ParamsLoadedFromUrl', all, metadata);\n this.$x.emit('ExtraParamsLoadedFromUrl', extra, metadata);\n // TODO: Move this logic from here.\n if (all.query) {\n this.$x.emit('UserOpenXProgrammatically', undefined, metadata);\n }\n this.urlLoaded = true;\n }\n\n /**\n * Creates the wire metadata to include in every emitted {@link XEvent | XEvents}.\n *\n * @returns The {@link WireMetadata | metadata}.\n * @internal\n */\n protected createWireMetadata(): Pick<WireMetadata, 'feature' | 'location'> {\n return {\n feature: 'url',\n location: this.detectLocation()\n };\n }\n\n /**\n * Detects the {@link FeatureLocation | location} used to build the\n * {@link QueryOriginInit | events metadata origin}.\n *\n * @returns The {@link FeatureLocation | location}.\n * @internal\n */\n protected detectLocation(): FeatureLocation {\n const currentUrl = new URL(window.location.href);\n const previousUrl = this.url;\n this.url = currentUrl;\n\n const isInternalNavigation =\n previousUrl?.search !== currentUrl.search && previousUrl?.pathname === currentUrl.pathname;\n if (isInternalNavigation) {\n return 'url_history';\n }\n\n if (this.isNavigatingFromPdp()) {\n return 'url_history_pdp';\n }\n\n return 'external';\n }\n\n /**\n * Check if the navigation is from a product page.\n *\n * @remarks Due to Safari 14 not supporting the new and standard PerformanceNavigationTiming\n * API, we are falling back to the deprecated one, PerformanceNavigation. We also fallback to\n * this API whenever we get a navigationType equal to reload, because Safari has a bug that the\n * navigationType is permanently set to reload after you have reload the page and it never\n * resets. As some browsers have a back-forward cache implemented, we also take into account if\n * the page is persisted.\n *\n * @returns True if the navigation is from a product page, false otherwise.\n * @internal\n */\n protected isNavigatingFromPdp(): boolean {\n const isPagePersisted = this.isPagePersisted;\n const navigationEntries = window.performance.getEntriesByType('navigation');\n const navigationType = (navigationEntries[0] as PerformanceNavigationTiming)?.type;\n const useFallbackStrategy =\n window.performance.navigation &&\n (isArrayEmpty(navigationEntries) || navigationType === 'reload');\n\n // Reset internal isPagePersisted property value\n this.isPagePersisted = false;\n\n if (useFallbackStrategy) {\n const {\n type: fallbackNavigationType,\n TYPE_BACK_FORWARD,\n TYPE_NAVIGATE\n } = window.performance.navigation;\n const isNavigatingInSpa =\n !!this.snippetConfig?.isSpa && fallbackNavigationType === TYPE_NAVIGATE;\n return fallbackNavigationType === TYPE_BACK_FORWARD || isNavigatingInSpa || isPagePersisted;\n } else {\n const isNavigatingInSpa = !!this.snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersisted;\n }\n }\n\n /**\n * Gets the {@link UrlParams} from the URL, including only the params defined by `paramsNames`.\n *\n * @returns ParsedUrlParams obtained from URL.\n * @internal\n */\n protected parseUrlParams(): ParsedUrlParams {\n const urlSearchParams = new URL(window.location.href).searchParams;\n return this.managedParamsNames.reduce<ParsedUrlParams>(\n (params, name) => {\n const urlKey = this.getUrlKey(name);\n if (urlSearchParams.has(urlKey)) {\n if (name in initialUrlState) {\n const urlValue = urlSearchParams.getAll(urlKey);\n params.all[name] = this.parseUrlParam(name, urlValue);\n } else {\n params.all[name] = params.extra[name] = urlSearchParams.get(urlKey);\n }\n }\n return params;\n },\n { all: { ...initialUrlState }, extra: { ...this.initialExtraParams } }\n );\n }\n\n /**\n * Updates the browser URL with the passed `newUrlParams` and using the browser history method\n * passed as `historyMethod`. It only updates the browser history if the new URL is different\n * from the current.\n *\n * @param newUrlParams - The new params to add to the browser URL.\n * @param historyMethod - The browser history method used to add the new URL.\n *\n * @internal\n */\n protected updateUrl(\n newUrlParams: UrlParams,\n historyMethod: History['pushState'] | History['replaceState']\n ): void {\n if (this.urlLoaded) {\n const url = new URL(window.location.href);\n this.deleteUrlParameters(url);\n this.setUrlParameters(url, newUrlParams);\n\n url.href = url.href.replace(/\\+/g, '%20');\n\n if (url.href !== window.location.href) {\n historyMethod({ ...window.history.state }, document.title, url.href);\n }\n this.url = url;\n }\n }\n\n /**\n * Deletes all the parameters in the passed URL.\n *\n * @param url - The URL to remove parameters from.\n * @internal\n */\n protected deleteUrlParameters(url: URL): void {\n this.managedParamsNames.forEach(paramName =>\n url.searchParams.delete(this.getUrlKey(paramName))\n );\n }\n\n /**\n * Set all the provided parameters to the url with the mapped key.\n *\n * @param url - The current URL.\n * @param urlParams - The list of parameters to add.\n * @remarks The params are filtered because there maybe received extra params which will not be\n * managed by URL. This is defined by the `managedParamsNames` computed. Also, the parameters\n * are sorted Alphabetically to produce always the same URL with the same parameters.This is\n * important for SEO purposes.\n *\n * @internal\n */\n protected setUrlParameters(url: URL, urlParams: UrlParams): void {\n // Only when there is a query the rest of the parameters are valid.\n if (!urlParams.query) {\n return;\n }\n const filteredParams = objectFilter(urlParams, paramName =>\n this.managedParamsNames.includes(paramName as string)\n );\n const sortedParameters = this.sortParams(filteredParams);\n sortedParameters.forEach(([paramName, paramValue]) => {\n const urlParamKey = this.getUrlKey(paramName);\n if (Array.isArray(paramValue)) {\n paramValue.forEach(value => {\n url.searchParams.append(urlParamKey, String(value));\n });\n } else {\n url.searchParams.set(urlParamKey, String(paramValue));\n }\n });\n }\n\n /**\n * Sorts the params in a tuple array [key,value] to generate always the same URL with the params\n * in the same order.\n *\n * @param urlParams - The {@link UrlParams} to sort.\n * @returns An array of tuples with the key-value of each paramter, sorted by key.\n * @internal\n */\n protected sortParams(urlParams: UrlParams): Array<[string, unknown]> {\n return Object.entries(urlParams).sort(([param1], [param2]) => {\n return param1 < param2 ? -1 : 1;\n });\n }\n\n /**\n * Returns the URL param value parsed depending on its type in the initial store state. As we\n * can not know what type can have an extra param, all extra params are parsed as strings. We\n * know if it is an extra param because it is not in the initial state.\n *\n * @param name - The name of the param in {@link UrlParams}.\n * @param value - The `URLSearchParams` value as an arry of strings.\n * @returns The parsed value.\n *\n * @internal\n */\n protected parseUrlParam(name: string, value: string[]): UrlParamValue {\n switch (typeof initialUrlState[name]) {\n case 'number':\n return Number(value[0]);\n case 'boolean':\n return value[0].toLowerCase() === 'true';\n case 'string':\n return value[0];\n default:\n // array\n return value;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;;;;AAaA,IAAqB,UAAU,GAA/B,MAAqB,UAAW,SAAQ,GAAG;IAA3C;;;;;;;QAcY,cAAS,GAAG,KAAK,CAAC;;;;;;QAclB,oBAAe,GAAG,KAAK,CAAC;KAyTnC;;;;;;;;;;IA9SC,IAAc,kBAAkB;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,eAAe,EAAE,GAAG,IA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CAAC;GACmB,UAAU,CAqV9B;aArVoB,UAAU;;;;"}
1
+ {"version":3,"file":"url-handler.vue_rollup-plugin-vue_script.vue.js","sources":["../../../../../src/x-modules/url/components/url-handler.vue?rollup-plugin-vue=script.ts"],"sourcesContent":["\n\n\n\n\nimport { Dictionary, objectFilter } from '@empathyco/x-utils';\nimport Vue from 'vue';\nimport GlobalEvents from 'vue-global-events';\nimport { Component, Inject } from 'vue-property-decorator';\nimport { State } from '../../../components';\nimport { XOn } from '../../../components/decorators/bus.decorators';\nimport { xComponentMixin } from '../../../components/x-component.mixin';\nimport { FeatureLocation } from '../../../types/origin';\nimport { UrlParams } from '../../../types/url-params';\nimport { isArrayEmpty } from '../../../utils/array';\nimport { WireMetadata } from '../../../wiring/wiring.types';\nimport { SnippetConfig } from '../../../x-installer/api/api.types';\nimport { initialUrlState } from '../store/initial-state';\nimport { UrlParamValue } from '../store/types';\nimport { urlXModule } from '../x-module';\n\ninterface ParsedUrlParams {\n all: UrlParams;\n extra: Dictionary<unknown>;\n}\n\n/**\n * This component manage the browser URL parameters to perserve them through reloads and browser\n * history navigation. It allow to configure the default url parameter names using its attributes.\n * This component doesn't render elements to the DOM.\n *\n * @public\n */\n@Component({\n components: {\n GlobalEvents\n },\n mixins: [xComponentMixin(urlXModule)]\n})\nexport default class UrlHandler extends Vue {\n /**\n * The {@link SnippetConfig} provided by an ancestor.\n *\n * @internal\n */\n @Inject({ default: undefined })\n protected snippetConfig?: SnippetConfig;\n\n /**\n * Flag to know if the params were already loaded from the URL.\n *\n * @internal\n */\n protected urlLoaded = false;\n\n /**\n * The page URL. It is used to compare against the current URL to check navigation state.\n *\n * @internal\n */\n protected url?: URL;\n\n /**\n * Flag to know if the page has been persisted by the browser's back-forward cache.\n *\n * @internal\n */\n protected isPagePersisted = false;\n\n /**\n * Computed to know which params we must get from URL. It gets the params names from the initial\n * state, to get all default params names, and also from the `$attrs` to get the extra params\n * names to take into account.\n *\n * @returns An array with the name of the params.\n *\n * @internal\n */\n protected get managedParamsNames(): string[] {\n return Object.keys({ ...initialUrlState, ...this.$attrs });\n }\n\n @State('url', 'initialExtraParams')\n public initialExtraParams!: Dictionary<unknown>;\n\n /**\n * Returns the mapping of the param keys used in the URL is configured through $attrs. This way\n * we can support any param and extra param, no matters its name.\n *\n * @param paramName - The param name to get the Url key.\n * @returns The key used in the URL for the `paramName` passed.\n *\n * @internal\n */\n protected getUrlKey(paramName: string): string {\n return this.$attrs[paramName] ?? paramName;\n }\n\n /**\n * To emit the Url events just when the URL is load, and before the components mounted events\n * and state changes, we do it in the created of this component.\n */\n created(): void {\n this.emitEvents();\n }\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `pushState` method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n @XOn('PushableUrlStateChanged')\n updateUrlWithPush(newUrlParams: UrlParams): void {\n this.updateUrl(newUrlParams, window.history.pushState.bind(window.history));\n }\n\n /**\n * Updates the browser URL with the new {@link UrlParams} using the history `replaceState`\n * method.\n *\n * @param newUrlParams - The new params to update browser URL.\n */\n @XOn('ReplaceableUrlStateChanged')\n updateUrlWithReplace(newUrlParams: UrlParams): void {\n this.updateUrl(newUrlParams, window.history.replaceState.bind(window.history));\n }\n\n /**\n * Handler of the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/Window/pageshow_event | pageshow }\n * event.\n *\n * @remarks The pageshow event is listened to check if the browser has performed a navigation\n * using the back-forward cache. This information is available in the\n * PageTransitionEvent.persisted property.\n *\n * @param event - The page transition event.\n * @internal\n */\n protected onPageShow(event: PageTransitionEvent): void {\n this.isPagePersisted = event.persisted;\n if (event.persisted) {\n // The internal url is reset due to the back-forward cache storing the previous value which\n // is no longer valid.\n this.url = undefined;\n }\n }\n\n /**\n * Emits the {@link UrlXEvents.ParamsLoadedFromUrl} XEvent,\n * the {@link UrlXEvents.ExtraParamsLoadedFromUrl} XEvent and, if there is query, also emits\n * the {@link XEventsTypes.UserOpenXProgrammatically}.\n *\n * @internal\n */\n protected emitEvents(): void {\n const { all, extra } = this.parseUrlParams();\n const metadata = this.createWireMetadata();\n this.$x.emit('ParamsLoadedFromUrl', all, metadata);\n this.$x.emit('ExtraParamsLoadedFromUrl', extra, metadata);\n // TODO: Move this logic from here.\n if (all.query) {\n this.$x.emit('UserOpenXProgrammatically', undefined, metadata);\n }\n this.urlLoaded = true;\n }\n\n /**\n * Creates the wire metadata to include in every emitted {@link XEvent | XEvents}.\n *\n * @returns The {@link WireMetadata | metadata}.\n * @internal\n */\n protected createWireMetadata(): Pick<WireMetadata, 'feature' | 'location'> {\n return {\n feature: 'url',\n location: this.detectLocation()\n };\n }\n\n /**\n * Detects the {@link FeatureLocation | location} used to build the\n * {@link QueryOriginInit | events metadata origin}.\n *\n * @returns The {@link FeatureLocation | location}.\n * @internal\n */\n protected detectLocation(): FeatureLocation {\n const currentUrl = new URL(window.location.href);\n const previousUrl = this.url;\n this.url = currentUrl;\n\n const isInternalNavigation =\n previousUrl?.search !== currentUrl.search && previousUrl?.pathname === currentUrl.pathname;\n if (isInternalNavigation) {\n return 'url_history';\n }\n\n if (this.isNavigatingFromPdp()) {\n return 'url_history_pdp';\n }\n\n return 'external';\n }\n\n /**\n * Check if the navigation is from a product page.\n *\n * @remarks Due to Safari 14 not supporting the new and standard PerformanceNavigationTiming\n * API, we are falling back to the deprecated one, PerformanceNavigation. We also fallback to\n * this API whenever we get a navigationType equal to reload, because Safari has a bug that the\n * navigationType is permanently set to reload after you have reload the page and it never\n * resets. As some browsers have a back-forward cache implemented, we also take into account if\n * the page is persisted.\n *\n * @returns True if the navigation is from a product page, false otherwise.\n * @internal\n */\n protected isNavigatingFromPdp(): boolean {\n const isPagePersisted = this.isPagePersisted;\n const navigationEntries = window.performance.getEntriesByType('navigation');\n const navigationType = (navigationEntries[0] as PerformanceNavigationTiming)?.type;\n const useFallbackStrategy =\n window.performance.navigation &&\n (isArrayEmpty(navigationEntries) || navigationType === 'reload');\n\n // Reset internal isPagePersisted property value\n this.isPagePersisted = false;\n\n if (useFallbackStrategy) {\n const {\n type: fallbackNavigationType,\n TYPE_BACK_FORWARD,\n TYPE_NAVIGATE\n } = window.performance.navigation;\n const isNavigatingInSpa =\n !!this.snippetConfig?.isSpa && fallbackNavigationType === TYPE_NAVIGATE;\n return fallbackNavigationType === TYPE_BACK_FORWARD || isNavigatingInSpa || isPagePersisted;\n } else {\n const isNavigatingInSpa = !!this.snippetConfig?.isSpa && navigationType === 'navigate';\n return navigationType === 'back_forward' || isNavigatingInSpa || isPagePersisted;\n }\n }\n\n /**\n * Gets the {@link UrlParams} from the URL, including only the params defined by `paramsNames`.\n *\n * @returns ParsedUrlParams obtained from URL.\n * @internal\n */\n protected parseUrlParams(): ParsedUrlParams {\n const urlSearchParams = new URL(window.location.href).searchParams;\n return this.managedParamsNames.reduce<ParsedUrlParams>(\n (params, name) => {\n const urlKey = this.getUrlKey(name);\n if (urlSearchParams.has(urlKey)) {\n if (name in initialUrlState) {\n const urlValue = urlSearchParams.getAll(urlKey);\n params.all[name] = this.parseUrlParam(name, urlValue);\n } else {\n params.all[name] = params.extra[name] = urlSearchParams.get(urlKey);\n }\n }\n return params;\n },\n { all: { ...initialUrlState }, extra: { ...this.initialExtraParams } }\n );\n }\n\n /**\n * Updates the browser URL with the passed `newUrlParams` and using the browser history method\n * passed as `historyMethod`. It only updates the browser history if the new URL is different\n * from the current.\n *\n * @param newUrlParams - The new params to add to the browser URL.\n * @param historyMethod - The browser history method used to add the new URL.\n *\n * @internal\n */\n protected updateUrl(\n newUrlParams: UrlParams,\n historyMethod: History['pushState'] | History['replaceState']\n ): void {\n if (this.urlLoaded) {\n const url = new URL(window.location.href);\n this.deleteUrlParameters(url);\n this.setUrlParameters(url, newUrlParams);\n\n url.href = url.href.replace(/\\+/g, '%20');\n\n if (url.href !== window.location.href) {\n historyMethod({ ...window.history.state }, document.title, url.href);\n }\n this.url = url;\n }\n }\n\n /**\n * Deletes all the parameters in the passed URL.\n *\n * @param url - The URL to remove parameters from.\n * @internal\n */\n protected deleteUrlParameters(url: URL): void {\n this.managedParamsNames.forEach(paramName =>\n url.searchParams.delete(this.getUrlKey(paramName))\n );\n }\n\n /**\n * Set all the provided parameters to the url with the mapped key.\n *\n * @param url - The current URL.\n * @param urlParams - The list of parameters to add.\n * @remarks The params are filtered because there maybe received extra params which will not be\n * managed by URL. This is defined by the `managedParamsNames` computed. Also, the parameters\n * are sorted Alphabetically to produce always the same URL with the same parameters.This is\n * important for SEO purposes.\n *\n * @internal\n */\n protected setUrlParameters(url: URL, urlParams: UrlParams): void {\n // Only when there is a query the rest of the parameters are valid.\n if (!urlParams.query) {\n return;\n }\n const filteredParams = objectFilter(urlParams, paramName =>\n this.managedParamsNames.includes(paramName as string)\n );\n const sortedParameters = this.sortParams(filteredParams);\n sortedParameters.forEach(([paramName, paramValue]) => {\n const urlParamKey = this.getUrlKey(paramName);\n if (Array.isArray(paramValue)) {\n paramValue.forEach(value => {\n url.searchParams.append(urlParamKey, String(value));\n });\n } else {\n url.searchParams.set(urlParamKey, String(paramValue));\n }\n });\n }\n\n /**\n * Sorts the params in a tuple array [key,value] to generate always the same URL with the params\n * in the same order.\n *\n * @param urlParams - The {@link UrlParams} to sort.\n * @returns An array of tuples with the key-value of each paramter, sorted by key.\n * @internal\n */\n protected sortParams(urlParams: UrlParams): Array<[string, unknown]> {\n return Object.entries(urlParams).sort(([param1], [param2]) => {\n return param1 < param2 ? -1 : 1;\n });\n }\n\n /**\n * Returns the URL param value parsed depending on its type in the initial store state. As we\n * can not know what type can have an extra param, all extra params are parsed as strings. We\n * know if it is an extra param because it is not in the initial state.\n *\n * @param name - The name of the param in {@link UrlParams}.\n * @param value - The `URLSearchParams` value as an arry of strings.\n * @returns The parsed value.\n *\n * @internal\n */\n protected parseUrlParam(name: string, value: string[]): UrlParamValue {\n switch (typeof initialUrlState[name]) {\n case 'number':\n return Number(value[0]);\n case 'boolean':\n return value[0].toLowerCase() === 'true';\n case 'string':\n return value[0];\n default:\n // array\n return value;\n }\n }\n}\n"],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AAO,KAAK,CAAC,CAAC,CAAC,CAAC;YAClB;;gBAEE,OAAO,KAAK,CAAC;SAChB;KACF;CACF,CAAA;AA9UC;IADC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;iDACS;AAqCxC;IADC,KAAK,CAAC,KAAK,EAAE,oBAAoB,CAAC;sDACa;AA6BhD;IADC,GAAG,CAAC,yBAAyB,CAAC;mDAG9B;AASD;IADC,GAAG,CAAC,4BAA4B,CAAC;sDAGjC;AAtFkB,UAAU;IAN9B,SAAS,CAAC;QACT,UAAU,EAAE;YACV,YAAY;SACb;QACD,MAAM,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;KACtC,CAAC;GACmB,UAAU,CAqV9B;aArVoB,UAAU;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-components",
3
- "version": "3.0.0-alpha.136",
3
+ "version": "3.0.0-alpha.139",
4
4
  "description": "Empathy X Components",
5
5
  "author": "Empathy Systems Corporation S.L.",
6
6
  "license": "Apache-2.0",
@@ -78,7 +78,7 @@
78
78
  "devDependencies": {
79
79
  "@cypress/vue": "~2.2.4",
80
80
  "@cypress/webpack-dev-server": "~1.8.4",
81
- "@empathyco/x-adapter-platform": "^1.0.0-alpha.25",
81
+ "@empathyco/x-adapter-platform": "^1.0.0-alpha.26",
82
82
  "@microsoft/api-documenter": "~7.15.3",
83
83
  "@microsoft/api-extractor": "~7.19.4",
84
84
  "@rollup/plugin-commonjs": "~21.0.1",
@@ -125,5 +125,5 @@
125
125
  "access": "public",
126
126
  "directory": "dist"
127
127
  },
128
- "gitHead": "cee7a9a9e40f9604e974337dc082bd797291dfbc"
128
+ "gitHead": "a09e6ff5149bd33c0ee0ebb88e5bde22058c4fe7"
129
129
  }
@@ -7936,6 +7936,32 @@
7936
7936
  },
7937
7937
  "implementsTokenRanges": []
7938
7938
  },
7939
+ {
7940
+ "kind": "Variable",
7941
+ "canonicalReference": "@empathyco/x-components!clearSearchQuery:var",
7942
+ "docComment": "/**\n * Clears the search state `query`.\n *\n * @public\n */\n",
7943
+ "excerptTokens": [
7944
+ {
7945
+ "kind": "Content",
7946
+ "text": "clearSearchQuery: "
7947
+ },
7948
+ {
7949
+ "kind": "Content",
7950
+ "text": "import(\"../../wiring/wiring.types\")."
7951
+ },
7952
+ {
7953
+ "kind": "Reference",
7954
+ "text": "AnyWire",
7955
+ "canonicalReference": "@empathyco/x-components!AnyWire:type"
7956
+ }
7957
+ ],
7958
+ "releaseTag": "Public",
7959
+ "name": "clearSearchQuery",
7960
+ "variableTypeTokenRange": {
7961
+ "startIndex": 1,
7962
+ "endIndex": 3
7963
+ }
7964
+ },
7939
7965
  {
7940
7966
  "kind": "Variable",
7941
7967
  "canonicalReference": "@empathyco/x-components!clearSelectedRelatedTags:var",
@@ -8018,6 +8044,34 @@
8018
8044
  ],
8019
8045
  "name": "clone"
8020
8046
  },
8047
+ {
8048
+ "kind": "Class",
8049
+ "canonicalReference": "@empathyco/x-components!CloseMainModal:class",
8050
+ "docComment": "/**\n * Button to close the {@link MainModal}.\n *\n * @public\n */\n",
8051
+ "excerptTokens": [
8052
+ {
8053
+ "kind": "Content",
8054
+ "text": "export default class CloseMainModal extends "
8055
+ },
8056
+ {
8057
+ "kind": "Reference",
8058
+ "text": "Vue",
8059
+ "canonicalReference": "vue!Vue:interface"
8060
+ },
8061
+ {
8062
+ "kind": "Content",
8063
+ "text": " "
8064
+ }
8065
+ ],
8066
+ "releaseTag": "Public",
8067
+ "name": "CloseMainModal",
8068
+ "members": [],
8069
+ "extendsTokenRange": {
8070
+ "startIndex": 1,
8071
+ "endIndex": 3
8072
+ },
8073
+ "implementsTokenRanges": []
8074
+ },
8021
8075
  {
8022
8076
  "kind": "Class",
8023
8077
  "canonicalReference": "@empathyco/x-components!CollapseHeight:class",
@@ -19903,7 +19957,67 @@
19903
19957
  ],
19904
19958
  "releaseTag": "Public",
19905
19959
  "name": "HistoryQueriesSwitch",
19906
- "members": [],
19960
+ "members": [
19961
+ {
19962
+ "kind": "Property",
19963
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesSwitch#hasHistoryQueries:member",
19964
+ "docComment": "/**\n * Checks if there are history queries.\n *\n * @returns True if there are history queries; false otherwise.\n */\n",
19965
+ "excerptTokens": [
19966
+ {
19967
+ "kind": "Content",
19968
+ "text": "protected get hasHistoryQueries(): "
19969
+ },
19970
+ {
19971
+ "kind": "Content",
19972
+ "text": "boolean"
19973
+ },
19974
+ {
19975
+ "kind": "Content",
19976
+ "text": ";"
19977
+ }
19978
+ ],
19979
+ "isOptional": false,
19980
+ "releaseTag": "Public",
19981
+ "name": "hasHistoryQueries",
19982
+ "propertyTypeTokenRange": {
19983
+ "startIndex": 1,
19984
+ "endIndex": 2
19985
+ },
19986
+ "isStatic": false
19987
+ },
19988
+ {
19989
+ "kind": "Property",
19990
+ "canonicalReference": "@empathyco/x-components!HistoryQueriesSwitch#historyQueries:member",
19991
+ "docComment": "/**\n * The history queries from the state.\n */\n",
19992
+ "excerptTokens": [
19993
+ {
19994
+ "kind": "Content",
19995
+ "text": "historyQueries: "
19996
+ },
19997
+ {
19998
+ "kind": "Reference",
19999
+ "text": "HistoryQuery",
20000
+ "canonicalReference": "@empathyco/x-components!HistoryQuery:interface"
20001
+ },
20002
+ {
20003
+ "kind": "Content",
20004
+ "text": "[]"
20005
+ },
20006
+ {
20007
+ "kind": "Content",
20008
+ "text": ";"
20009
+ }
20010
+ ],
20011
+ "isOptional": false,
20012
+ "releaseTag": "Public",
20013
+ "name": "historyQueries",
20014
+ "propertyTypeTokenRange": {
20015
+ "startIndex": 1,
20016
+ "endIndex": 3
20017
+ },
20018
+ "isStatic": false
20019
+ }
20020
+ ],
19907
20021
  "extendsTokenRange": {
19908
20022
  "startIndex": 1,
19909
20023
  "endIndex": 3
@@ -23277,6 +23391,67 @@
23277
23391
  },
23278
23392
  "implementsTokenRanges": []
23279
23393
  },
23394
+ {
23395
+ "kind": "Class",
23396
+ "canonicalReference": "@empathyco/x-components!MainModal:class",
23397
+ "docComment": "/**\n * A specialised version of a modal component, made to contain a full search application.\n *\n * @public\n */\n",
23398
+ "excerptTokens": [
23399
+ {
23400
+ "kind": "Content",
23401
+ "text": "export default class MainModal extends "
23402
+ },
23403
+ {
23404
+ "kind": "Reference",
23405
+ "text": "Vue",
23406
+ "canonicalReference": "vue!Vue:interface"
23407
+ },
23408
+ {
23409
+ "kind": "Content",
23410
+ "text": " "
23411
+ }
23412
+ ],
23413
+ "releaseTag": "Public",
23414
+ "name": "MainModal",
23415
+ "members": [
23416
+ {
23417
+ "kind": "Property",
23418
+ "canonicalReference": "@empathyco/x-components!MainModal#animation:member",
23419
+ "docComment": "/**\n * Animation to use for opening/closing the modal.\n *\n * @public\n */\n",
23420
+ "excerptTokens": [
23421
+ {
23422
+ "kind": "Content",
23423
+ "text": "animation?: "
23424
+ },
23425
+ {
23426
+ "kind": "Reference",
23427
+ "text": "Vue",
23428
+ "canonicalReference": "vue!Vue:interface"
23429
+ },
23430
+ {
23431
+ "kind": "Content",
23432
+ "text": " | string"
23433
+ },
23434
+ {
23435
+ "kind": "Content",
23436
+ "text": ";"
23437
+ }
23438
+ ],
23439
+ "isOptional": true,
23440
+ "releaseTag": "Public",
23441
+ "name": "animation",
23442
+ "propertyTypeTokenRange": {
23443
+ "startIndex": 1,
23444
+ "endIndex": 3
23445
+ },
23446
+ "isStatic": false
23447
+ }
23448
+ ],
23449
+ "extendsTokenRange": {
23450
+ "startIndex": 1,
23451
+ "endIndex": 3
23452
+ },
23453
+ "implementsTokenRanges": []
23454
+ },
23280
23455
  {
23281
23456
  "kind": "Class",
23282
23457
  "canonicalReference": "@empathyco/x-components!MainScroll:class",
@@ -27513,6 +27688,34 @@
27513
27688
  },
27514
27689
  "implementsTokenRanges": []
27515
27690
  },
27691
+ {
27692
+ "kind": "Class",
27693
+ "canonicalReference": "@empathyco/x-components!OpenMainModal:class",
27694
+ "docComment": "/**\n * Button to open the {@link MainModal}.\n *\n * @public\n */\n",
27695
+ "excerptTokens": [
27696
+ {
27697
+ "kind": "Content",
27698
+ "text": "export default class OpenMainModal extends "
27699
+ },
27700
+ {
27701
+ "kind": "Reference",
27702
+ "text": "Vue",
27703
+ "canonicalReference": "vue!Vue:interface"
27704
+ },
27705
+ {
27706
+ "kind": "Content",
27707
+ "text": " "
27708
+ }
27709
+ ],
27710
+ "releaseTag": "Public",
27711
+ "name": "OpenMainModal",
27712
+ "members": [],
27713
+ "extendsTokenRange": {
27714
+ "startIndex": 1,
27715
+ "endIndex": 3
27716
+ },
27717
+ "implementsTokenRanges": []
27718
+ },
27516
27719
  {
27517
27720
  "kind": "TypeAlias",
27518
27721
  "canonicalReference": "@empathyco/x-components!Pair:type",
@@ -52908,6 +53111,32 @@
52908
53111
  "endIndex": 2
52909
53112
  }
52910
53113
  },
53114
+ {
53115
+ "kind": "PropertySignature",
53116
+ "canonicalReference": "@empathyco/x-components!XEventsTypes#UserClickedOutOfMainModal:member",
53117
+ "docComment": "/**\n * The user clicked out of the main modal. Payload: none.\n */\n",
53118
+ "excerptTokens": [
53119
+ {
53120
+ "kind": "Content",
53121
+ "text": "UserClickedOutOfMainModal: "
53122
+ },
53123
+ {
53124
+ "kind": "Content",
53125
+ "text": "void"
53126
+ },
53127
+ {
53128
+ "kind": "Content",
53129
+ "text": ";"
53130
+ }
53131
+ ],
53132
+ "isOptional": false,
53133
+ "releaseTag": "Public",
53134
+ "name": "UserClickedOutOfMainModal",
53135
+ "propertyTypeTokenRange": {
53136
+ "startIndex": 1,
53137
+ "endIndex": 2
53138
+ }
53139
+ },
52911
53140
  {
52912
53141
  "kind": "PropertySignature",
52913
53142
  "canonicalReference": "@empathyco/x-components!XEventsTypes#UserClickedOutOfModal:member",
@@ -801,12 +801,21 @@ export class ClearSearchInput extends Vue_2 {
801
801
  query: string;
802
802
  }
803
803
 
804
+ // @public
805
+ export const clearSearchQuery: AnyWire;
806
+
804
807
  // @public
805
808
  export const clearSelectedRelatedTags: AnyWire;
806
809
 
807
810
  // @public
808
811
  export function clone<Something>(something: Something): Something;
809
812
 
813
+ // @public
814
+ export class CloseMainModal extends Vue_2 {
815
+ // @internal
816
+ protected closingEvent: XEvent;
817
+ }
818
+
810
819
  // @public
811
820
  export class CollapseHeight extends Vue_2 {
812
821
  }
@@ -1916,6 +1925,8 @@ export interface HistoryQueriesState extends QueryState {
1916
1925
 
1917
1926
  // @public
1918
1927
  export class HistoryQueriesSwitch extends Vue_2 {
1928
+ protected get hasHistoryQueries(): boolean;
1929
+ historyQueries: HistoryQuery_2[];
1919
1930
  // @internal
1920
1931
  isEnabled: boolean;
1921
1932
  // @internal
@@ -1955,6 +1966,12 @@ export const historyQueriesWiring: {
1955
1966
  UserClickedConfirmDisableHistoryQueries: {
1956
1967
  setHistoryQueriesDisabled: AnyWire;
1957
1968
  };
1969
+ UserClickedCloseX: {
1970
+ clearHistoryQueriesQuery: AnyWire;
1971
+ };
1972
+ UserClickedOutOfMainModal: {
1973
+ clearHistoryQueriesQuery: AnyWire;
1974
+ };
1958
1975
  };
1959
1976
 
1960
1977
  // @public
@@ -2099,6 +2116,12 @@ export const identifierResultsWiring: {
2099
2116
  ExtraParamsChanged: {
2100
2117
  setIdentifierResultsExtraParams: Wire<Dictionary<unknown>>;
2101
2118
  };
2119
+ UserClickedCloseX: {
2120
+ clearIdentifierResultsQuery: AnyWire;
2121
+ };
2122
+ UserClickedOutOfMainModal: {
2123
+ clearIdentifierResultsQuery: AnyWire;
2124
+ };
2102
2125
  };
2103
2126
 
2104
2127
  // @public
@@ -2242,6 +2265,17 @@ export class LocationProvider extends NoElement {
2242
2265
  protected location: FeatureLocation;
2243
2266
  }
2244
2267
 
2268
+ // @public
2269
+ export class MainModal extends Vue_2 {
2270
+ animation?: Vue_2 | string;
2271
+ // @internal
2272
+ protected closeEvents: XEvent[];
2273
+ // @internal
2274
+ protected openEvents: XEvent[];
2275
+ // @internal
2276
+ protected outOfModalClickEvent: XEvent;
2277
+ }
2278
+
2245
2279
  // @public
2246
2280
  export class MainScroll extends Vue_2 {
2247
2281
  // @internal
@@ -2598,6 +2632,12 @@ export interface ObserverOptions {
2598
2632
  vNode: VNode;
2599
2633
  }
2600
2634
 
2635
+ // @public
2636
+ export class OpenMainModal extends Vue_2 {
2637
+ // @internal
2638
+ protected openingEvent: XEvent;
2639
+ }
2640
+
2601
2641
  // @public
2602
2642
  export type Pair<Type> = [Type, Type];
2603
2643
 
@@ -2891,6 +2931,12 @@ export const querySuggestionsWiring: {
2891
2931
  ExtraParamsChanged: {
2892
2932
  setQuerySuggestionsExtraParams: Wire<Dictionary<unknown>>;
2893
2933
  };
2934
+ UserClickedCloseX: {
2935
+ clearQuerySuggestionsQuery: AnyWire;
2936
+ };
2937
+ UserClickedOutOfMainModal: {
2938
+ clearQuerySuggestionsQuery: AnyWire;
2939
+ };
2894
2940
  };
2895
2941
 
2896
2942
  // @public
@@ -3160,6 +3206,12 @@ export const relatedTagsWiring: {
3160
3206
  ExtraParamsChanged: {
3161
3207
  setRelatedTagsExtraParams: Wire<Dictionary<unknown>>;
3162
3208
  };
3209
+ UserClickedCloseX: {
3210
+ clearRelatedTagsQuery: AnyWire;
3211
+ };
3212
+ UserClickedOutOfMainModal: {
3213
+ clearRelatedTagsQuery: AnyWire;
3214
+ };
3163
3215
  };
3164
3216
 
3165
3217
  // @public
@@ -3544,6 +3596,12 @@ export const searchBoxWiring: {
3544
3596
  UserPressedClearSearchBoxButton: {
3545
3597
  clearSearchBoxQuery: AnyWire;
3546
3598
  };
3599
+ UserClickedCloseX: {
3600
+ clearSearchBoxQuery: AnyWire;
3601
+ };
3602
+ UserClickedOutOfMainModal: {
3603
+ clearSearchBoxQuery: AnyWire;
3604
+ };
3547
3605
  };
3548
3606
 
3549
3607
  // @public
@@ -3766,6 +3824,12 @@ export const searchWiring: {
3766
3824
  ExtraParamsChanged: {
3767
3825
  setSearchExtraParams: Wire<Dictionary<unknown>>;
3768
3826
  };
3827
+ UserClickedCloseX: {
3828
+ clearSearchQuery: AnyWire;
3829
+ };
3830
+ UserClickedOutOfMainModal: {
3831
+ clearSearchQuery: AnyWire;
3832
+ };
3769
3833
  };
3770
3834
 
3771
3835
  // @public
@@ -4877,6 +4941,7 @@ export interface XEventsTypes extends DeviceXEvents, EmpathizeXEvents, ExtraPara
4877
4941
  UserClickedOpenModal: string;
4878
4942
  UserClickedOpenX: void;
4879
4943
  UserClickedOutOfEventsModal: void;
4944
+ UserClickedOutOfMainModal: void;
4880
4945
  UserClickedOutOfModal: string;
4881
4946
  UserClickedPanelToggleButton: string;
4882
4947
  UserClickedResultAddToCart: Result;
package/search/index.js CHANGED
@@ -22,5 +22,5 @@ export { searchEmitters } from '../js/x-modules/search/store/emitters.js';
22
22
  export { request as searchRequest } from '../js/x-modules/search/store/getters/request.getter.js';
23
23
  export { query as searchQuery } from '../js/x-modules/search/store/getters/query.getter.js';
24
24
  export { searchXStoreModule } from '../js/x-modules/search/store/module.js';
25
- export { cancelFetchAndSaveSearchResponseWire, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetSpellcheckQuery, resetStateWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchPage, setSearchQuery, setSelectedFilters, setSort, setUrlParams } from '../js/x-modules/search/wiring.js';
25
+ export { cancelFetchAndSaveSearchResponseWire, clearSearchQuery, fetchAndSaveSearchResponseWire, increasePageAppendingResultsWire, resetAppending, resetSpellcheckQuery, resetStateWire, saveOriginWire, searchWiring, setRelatedTags, setSearchExtraParams, setSearchPage, setSearchQuery, setSelectedFilters, setSort, setUrlParams } from '../js/x-modules/search/wiring.js';
26
26
  export { searchXModule } from '../js/x-modules/search/x-module.js';
@@ -0,0 +1,16 @@
1
+ import Vue from 'vue';
2
+ import { XEvent } from '../../wiring/events.types';
3
+ /**
4
+ * Button to close the {@link MainModal}.
5
+ *
6
+ * @public
7
+ */
8
+ export default class CloseMainModal extends Vue {
9
+ /**
10
+ * Event to be emitted to close the {@link MainModal}.
11
+ *
12
+ * @internal
13
+ */
14
+ protected closingEvent: XEvent;
15
+ }
16
+ //# sourceMappingURL=close-main-modal.vue?rollup-plugin-vue=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close-main-modal.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/close-main-modal.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAaA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD;;;;GAIG;AAMH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,GAAG;IAC7C;;;;OAIG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,CAAuB;CACtD"}
@@ -5,4 +5,7 @@ export { default as BaseModal } from './base-modal.vue';
5
5
  export { default as BaseIdModal } from './base-id-modal.vue';
6
6
  export { default as BaseIdModalClose } from './base-id-modal-close.vue';
7
7
  export { default as BaseIdModalOpen } from './base-id-modal-open.vue';
8
+ export { default as CloseMainModal } from './close-main-modal.vue';
9
+ export { default as MainModal } from './main-modal.vue';
10
+ export { default as OpenMainModal } from './open-main-modal.vue';
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import Vue from 'vue';
2
+ import { XEvent } from '../../wiring/events.types';
3
+ /**
4
+ * A specialised version of a modal component, made to contain a full search application.
5
+ *
6
+ * @public
7
+ */
8
+ export default class MainModal extends Vue {
9
+ /**
10
+ * Animation to use for opening/closing the modal.
11
+ *
12
+ * @public
13
+ */
14
+ animation?: Vue | string;
15
+ /**
16
+ * Events to listen for opening the main modal.
17
+ *
18
+ * @internal
19
+ */
20
+ protected openEvents: XEvent[];
21
+ /**
22
+ * Events to listen for closing the main modal.
23
+ *
24
+ * @internal
25
+ */
26
+ protected closeEvents: XEvent[];
27
+ /**
28
+ * Event to be emitted by the modal when clicked out of its content.
29
+ *
30
+ * @internal
31
+ */
32
+ protected outOfModalClickEvent: XEvent;
33
+ }
34
+ //# sourceMappingURL=main-modal.vue?rollup-plugin-vue=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-modal.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/main-modal.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAeA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD;;;;GAIG;AAMH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,GAAG;IACxC;;;;OAIG;IAEI,SAAS,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAqD;IACnF;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,CAAsD;IAErF;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,EAAE,MAAM,CAA+B;CACtE"}
@@ -0,0 +1,16 @@
1
+ import Vue from 'vue';
2
+ import { XEvent } from '../../wiring/events.types';
3
+ /**
4
+ * Button to open the {@link MainModal}.
5
+ *
6
+ * @public
7
+ */
8
+ export default class OpenMainModal extends Vue {
9
+ /**
10
+ * Event to be emitted to open the {@link MainModal}.
11
+ *
12
+ * @internal
13
+ */
14
+ protected openingEvent: XEvent;
15
+ }
16
+ //# sourceMappingURL=open-main-modal.vue?rollup-plugin-vue=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-main-modal.vue?rollup-plugin-vue=script.d.ts","sourceRoot":"","sources":["../../../../src/components/modals/open-main-modal.vue?rollup-plugin-vue=script.ts"],"names":[],"mappings":"AAaA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGnD;;;;GAIG;AAMH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,GAAG;IAC5C;;;;OAIG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,CAAsB;CACrD"}
@@ -90,6 +90,11 @@ export interface XEventsTypes extends DeviceXEvents, EmpathizeXEvents, ExtraPara
90
90
  * Payload: none.
91
91
  */
92
92
  UserClickedCloseX: void;
93
+ /**
94
+ * The user clicked out of the main modal.
95
+ * Payload: none.
96
+ */
97
+ UserClickedOutOfMainModal: void;
93
98
  /**
94
99
  * The user clicked the button to select the number of columns.
95
100
  * Payload: the column number.