@sonic-equipment/ui 220.0.0 → 222.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/algolia/algolia-search-provider.js +2 -2
- package/dist/algolia/use-algolia-search.d.ts +1 -1
- package/dist/carousel/carousel.js +1 -1
- package/dist/carousel/usp-carousel/usp-carousel.js +1 -1
- package/dist/exports.d.ts +5 -0
- package/dist/global-search/plugins/categories-plugin.d.ts +1 -1
- package/dist/global-search/plugins/categories-plugin.js +1 -1
- package/dist/global-search/plugins/popular-categories-plugin.d.ts +1 -1
- package/dist/global-search/plugins/popular-categories-plugin.js +1 -1
- package/dist/global-search/plugins/popular-searches-plugin.d.ts +1 -1
- package/dist/global-search/plugins/popular-searches-plugin.js +1 -1
- package/dist/global-search/plugins/query-suggestions-plugin.d.ts +1 -1
- package/dist/global-search/plugins/query-suggestions-plugin.js +1 -1
- package/dist/global-search/plugins/quick-access-plugin.d.ts +1 -1
- package/dist/global-search/plugins/quick-access-plugin.js +1 -1
- package/dist/global-search/plugins/recent-searches-plugin.d.ts +1 -1
- package/dist/global-search/plugins/recent-searches-plugin.js +1 -1
- package/dist/global-search/search-highlight/highlight.d.ts +1 -1
- package/dist/global-search/search-highlight/highlight.js +1 -1
- package/dist/global-search/types.d.ts +1 -1
- package/dist/index.js +5 -0
- package/dist/media/image-lightbox/image-lightbox.js +1 -1
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/checkOptions.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createAutocomplete.js +109 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/createStore.js +31 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getAutocompleteSetters.js +51 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getCompletion.js +12 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getDefaultProps.js +135 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/getPropGetters.js +355 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/index.js +2 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/metadata.js +44 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/onInput.js +148 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/onKeyDown.js +202 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/reshape.js +48 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/resolve.js +119 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/stateReducer.js +149 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromise.js +50 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createCancelablePromiseList.js +42 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/createConcurrentSafePromise.js +38 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getActiveItem.js +79 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getAutocompleteElementId.js +12 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNativeEvent.js +5 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNextActiveItemId.js +31 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getNormalizedSources.js +53 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/getPluginSubmitPromise.js +39 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/isOrContainsNode.js +5 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/isSamsung.js +6 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-core@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-core/dist/esm/utils/mapToAlgoliaResponse.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/createAlgoliaRequester.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/requesters/getAlgoliaResults.js +12 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-js@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0_search-insights@2.17.3/node_modules/@algolia/autocomplete-js/dist/esm/userAgents.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createAlgoliaInsightsPlugin.js +252 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createClickedEvent.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createSearchInsightsApi.js +209 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createViewedEvents.js +18 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/isAlgoliaInsightsHit.js +5 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/isModernInsightsClient.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_alg_bf126b808dc57984d528cd690af7915e/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/constants.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_alg_bf126b808dc57984d528cd690af7915e/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/createQuerySuggestionsPlugin.js +118 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_alg_bf126b808dc57984d528cd690af7915e/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/getTemplates.js +64 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-plugin-query-suggestions@1.19.2_@algolia_client-search@4.24.0_alg_bf126b808dc57984d528cd690af7915e/node_modules/@algolia/autocomplete-plugin-query-suggestions/dist/esm/index.js +2 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/constants/index.js +4 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/isPartHighlighted.js +27 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitHighlight.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseHighlight.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitReverseSnippet.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAlgoliaHitSnippet.js +25 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/parseAttribute.js +51 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/highlight/reverseHighlightedParts.js +27 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/index.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createAlgoliaRequester.js +6 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/createRequester.js +37 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaFacets.js +31 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/requester/getAlgoliaResults.js +19 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/search/fetchAlgoliaResults.js +69 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-preset-algolia@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-preset-algolia/dist/esm/utils/getAppIdAndApiKey.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/createRef.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/debounce.js +16 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/decycle.js +34 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js +6 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getAttributeValueByPath.js +7 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js +10 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/invariant.js +15 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/isEqual.js +26 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/noop.js +3 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/safelyRunOnBrowser.js +13 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/userAgents.js +8 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/version.js +3 -0
- package/dist/node_modules/.pnpm/@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js +26 -0
- package/dist/node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/swiper-react.js +8 -2
- package/dist/shared/utils/uuid.js +1 -1
- package/dist/shims/algolia/autocomplete-core.d.ts +3 -0
- package/dist/shims/algolia/autocomplete-core.js +5 -0
- package/dist/shims/algolia/autocomplete-plugin-query-suggestions.d.ts +2 -0
- package/dist/shims/algolia/autocomplete-plugin-query-suggestions.js +5 -0
- package/dist/shims/algolia/autocomplete-plugin-recent-searches.d.ts +3 -0
- package/dist/shims/algolia/autocomplete-plugin-recent-searches.js +8 -0
- package/dist/shims/algolia/autocomplete-preset-algolia.d.ts +3 -0
- package/dist/shims/algolia/autocomplete-preset-algolia.js +5 -0
- package/dist/shims/swiper/react.d.ts +95 -0
- package/dist/shims/swiper/react.js +5 -0
- package/package.json +2 -2
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { createContext, useState, useMemo, useRef, useEffect } from 'react';
|
|
4
|
-
import { createAutocomplete } from '@algolia/autocomplete-core';
|
|
5
|
-
import { getAlgoliaResults } from '@algolia/autocomplete-preset-algolia';
|
|
6
4
|
import { config } from '../config.js';
|
|
7
5
|
import { categoriesPlugin } from '../global-search/plugins/categories-plugin.js';
|
|
8
6
|
import { popularCategoriesPlugin } from '../global-search/plugins/popular-categories-plugin.js';
|
|
@@ -14,6 +12,8 @@ import { useLanguageCode } from '../intl/use-language-code.js';
|
|
|
14
12
|
import { useDataLayer } from '../shared/ga/use-data-layer.js';
|
|
15
13
|
import { useDebouncedCallback } from '../shared/hooks/use-debounced-callback.js';
|
|
16
14
|
import { environment } from '../shared/utils/environment.js';
|
|
15
|
+
import { createAutocomplete } from '../shims/algolia/autocomplete-core.js';
|
|
16
|
+
import { getAlgoliaResults } from '../shims/algolia/autocomplete-preset-algolia.js';
|
|
17
17
|
import { getAlgoliaIndex } from './algolia-index-config.js';
|
|
18
18
|
import { AlgoliaInsightsProvider } from './algolia-insights-provider.js';
|
|
19
19
|
import { createSonicSearchClient } from './algolia-sonic-searchclient.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompleteCollection, BaseItem, InternalAutocompleteSource } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompleteCollection, BaseItem, InternalAutocompleteSource } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { CategoryHit } from '../global-search/plugins/categories-plugin';
|
|
3
3
|
import { PopularCategoryHit } from '../global-search/plugins/popular-categories-plugin';
|
|
4
4
|
import { PopularSearchHit } from '../global-search/plugins/popular-searches-plugin';
|
|
@@ -4,9 +4,9 @@ import { useState, useRef, useMemo } from 'react';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import Navigation from '../node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/modules/navigation.js';
|
|
6
6
|
import freeMode from '../node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/modules/free-mode.js';
|
|
7
|
-
import { Swiper, SwiperSlide } from '../node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/swiper-react.js';
|
|
8
7
|
import { breakpoints } from '../shared/utils/breakpoints.js';
|
|
9
8
|
import { deepMerge } from '../shared/utils/merge.js';
|
|
9
|
+
import { Swiper, SwiperSlide } from '../shims/swiper/react.js';
|
|
10
10
|
import { CarouselNavigationButton } from './carousel-navigation-button.js';
|
|
11
11
|
import styles from './carousel.module.css.js';
|
|
12
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
|
-
import { Swiper, SwiperSlide } from '../../
|
|
4
|
+
import { Swiper, SwiperSlide } from '../../shims/swiper/react.js';
|
|
5
5
|
import { CarouselPagination } from '../pagination/pagination.js';
|
|
6
6
|
import styles from './usp-carousel.module.css.js';
|
|
7
7
|
|
package/dist/exports.d.ts
CHANGED
|
@@ -462,6 +462,11 @@ export * from './shared/utils/string';
|
|
|
462
462
|
export * from './shared/utils/time';
|
|
463
463
|
export * from './shared/utils/types';
|
|
464
464
|
export * from './shared/utils/uuid';
|
|
465
|
+
export * from './shims/algolia/autocomplete-core';
|
|
466
|
+
export * from './shims/algolia/autocomplete-plugin-query-suggestions';
|
|
467
|
+
export * from './shims/algolia/autocomplete-plugin-recent-searches';
|
|
468
|
+
export * from './shims/algolia/autocomplete-preset-algolia';
|
|
469
|
+
export * from './shims/swiper/react';
|
|
465
470
|
export * from './sidebar/sidebar';
|
|
466
471
|
export * from './sidebar/sidebar-provider';
|
|
467
472
|
export * from './sidebar/toggle-sidebar-button';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompletePlugin } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompletePlugin } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
import { ImageType } from '../../shared/model/image';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getAlgoliaResults } from '
|
|
2
|
+
import { getAlgoliaResults } from '../../shims/algolia/autocomplete-preset-algolia.js';
|
|
3
3
|
|
|
4
4
|
const popularCategoriesPlugin = ({ productsIndexName, searchClient, }) => {
|
|
5
5
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
2
1
|
import { Hit } from '@algolia/client-search';
|
|
3
2
|
import { SearchClient } from 'algoliasearch';
|
|
3
|
+
import { createQuerySuggestionsPlugin } from '../../shims/algolia/autocomplete-plugin-query-suggestions';
|
|
4
4
|
export type PopularSearchHit = Hit<{
|
|
5
5
|
nb_words: number;
|
|
6
6
|
popularity: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createQuerySuggestionsPlugin } from '
|
|
2
|
+
import { createQuerySuggestionsPlugin } from '../../shims/algolia/autocomplete-plugin-query-suggestions.js';
|
|
3
3
|
|
|
4
4
|
const popularSearchesPlugin = ({ searchClient, suggestionsIndexName, }) => createQuerySuggestionsPlugin({
|
|
5
5
|
getSearchParams() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createQuerySuggestionsPlugin } from '@algolia/autocomplete-plugin-query-suggestions';
|
|
2
1
|
import { Hit } from '@algolia/client-search';
|
|
3
2
|
import { SearchClient } from 'algoliasearch';
|
|
3
|
+
import { createQuerySuggestionsPlugin } from '../../shims/algolia/autocomplete-plugin-query-suggestions';
|
|
4
4
|
export type QuerySuggestionHit = Hit<{
|
|
5
5
|
nb_words: number;
|
|
6
6
|
popularity: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createQuerySuggestionsPlugin } from '
|
|
2
|
+
import { createQuerySuggestionsPlugin } from '../../shims/algolia/autocomplete-plugin-query-suggestions.js';
|
|
3
3
|
|
|
4
4
|
const querySuggestionsPlugin = ({ searchClient, suggestionsIndexName, }) => createQuerySuggestionsPlugin({
|
|
5
5
|
getSearchParams({ state }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompletePlugin } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompletePlugin } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { Hit } from '@algolia/client-search';
|
|
3
3
|
import { SearchClient } from 'algoliasearch';
|
|
4
4
|
import { ImageType } from '../../shared/model/image';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createLocalStorageRecentSearchesPlugin } from '@algolia/autocomplete-plugin-recent-searches';
|
|
2
1
|
import { Hit } from '@algolia/client-search';
|
|
2
|
+
import { createLocalStorageRecentSearchesPlugin } from '../../shims/algolia/autocomplete-plugin-recent-searches';
|
|
3
3
|
export type RecentSearchHit = Hit<{
|
|
4
4
|
id: string;
|
|
5
5
|
label: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { createLocalStorageRecentSearchesPlugin, search } from '
|
|
2
|
+
import { createLocalStorageRecentSearchesPlugin, search } from '../../shims/algolia/autocomplete-plugin-recent-searches.js';
|
|
3
3
|
|
|
4
4
|
const recentSearchesPlugin = createLocalStorageRecentSearchesPlugin({
|
|
5
5
|
key: 'recent-algolia-searches',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
import { HighlightedHit } from '
|
|
2
|
+
import { HighlightedHit } from '../../shims/algolia/autocomplete-preset-algolia';
|
|
3
3
|
type HighlightHitParams<THit> = {
|
|
4
4
|
/**
|
|
5
5
|
* The attribute to retrieve the highlighted parts from.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createElement, Fragment } from 'react';
|
|
3
|
-
import { parseAlgoliaHitHighlight } from '
|
|
3
|
+
import { parseAlgoliaHitHighlight } from '../../shims/algolia/autocomplete-preset-algolia.js';
|
|
4
4
|
|
|
5
5
|
function Highlight({ attribute, hit, tagName = 'mark', }) {
|
|
6
6
|
return createElement(Fragment, {}, parseAlgoliaHitHighlight({ attribute, hit }).map(({ isHighlighted, value }, index) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AutocompleteApi, AutocompleteState as _AutocompleteState } from '@algolia/autocomplete-core';
|
|
1
|
+
import { AutocompleteApi, AutocompleteState as _AutocompleteState } from '@algolia/autocomplete-core/dist/esm';
|
|
2
2
|
import { SearchClient } from 'algoliasearch';
|
|
3
3
|
import { AlgoliaProductHit } from '../algolia/algolia-hit-type';
|
|
4
4
|
import { Indexes } from '../algolia/algolia-index-config';
|
package/dist/index.js
CHANGED
|
@@ -461,6 +461,11 @@ export { camelCase } from './shared/utils/string.js';
|
|
|
461
461
|
export { TIME } from './shared/utils/time.js';
|
|
462
462
|
export { has, hasNo, isObject } from './shared/utils/types.js';
|
|
463
463
|
export { createUUID, isUUID } from './shared/utils/uuid.js';
|
|
464
|
+
export { createAutocomplete } from './shims/algolia/autocomplete-core.js';
|
|
465
|
+
export { createQuerySuggestionsPlugin } from './shims/algolia/autocomplete-plugin-query-suggestions.js';
|
|
466
|
+
export { createLocalStorageRecentSearchesPlugin, search } from './shims/algolia/autocomplete-plugin-recent-searches.js';
|
|
467
|
+
export { getAlgoliaResults, parseAlgoliaHitHighlight } from './shims/algolia/autocomplete-preset-algolia.js';
|
|
468
|
+
export { Swiper, SwiperSlide } from './shims/swiper/react.js';
|
|
464
469
|
export { Sidebar } from './sidebar/sidebar.js';
|
|
465
470
|
export { SidebarDetectBreakpoint, SidebarProvider } from './sidebar/sidebar-provider.js';
|
|
466
471
|
export { ToggleSidebarButton } from './sidebar/toggle-sidebar-button.js';
|
|
@@ -4,9 +4,9 @@ import { useState, useRef } from 'react';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import Navigation from '../../node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/modules/navigation.js';
|
|
6
6
|
import Thumb from '../../node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/modules/thumbs.js';
|
|
7
|
-
import { Swiper, SwiperSlide } from '../../node_modules/.pnpm/swiper@11.2.10/node_modules/swiper/swiper-react.js';
|
|
8
7
|
import { CarouselNavigationButton } from '../../carousel/carousel-navigation-button.js';
|
|
9
8
|
import { CarouselPagination } from '../../carousel/pagination/pagination.js';
|
|
9
|
+
import { Swiper, SwiperSlide } from '../../shims/swiper/react.js';
|
|
10
10
|
import { Image } from '../image/image.js';
|
|
11
11
|
import styles from './image-lightbox.module.css.js';
|
|
12
12
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { warn } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/warn.js';
|
|
2
|
+
|
|
3
|
+
function checkOptions(options) {
|
|
4
|
+
process.env.NODE_ENV !== 'production' ? warn(!options.debug, 'The `debug` option is meant for development debugging and should not be used in production.') : void 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { checkOptions };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { checkOptions } from './checkOptions.js';
|
|
2
|
+
import { createStore } from './createStore.js';
|
|
3
|
+
import { getAutocompleteSetters } from './getAutocompleteSetters.js';
|
|
4
|
+
import { getDefaultProps } from './getDefaultProps.js';
|
|
5
|
+
import { getPropGetters } from './getPropGetters.js';
|
|
6
|
+
import { injectMetadata, getMetadata } from './metadata.js';
|
|
7
|
+
import { onInput } from './onInput.js';
|
|
8
|
+
import { stateReducer } from './stateReducer.js';
|
|
9
|
+
import { createAlgoliaInsightsPlugin } from '../../../../../../@algolia_autocomplete-plugin-algolia-insights@1.19.2_@algolia_client-search@4.24.0_algo_a07b7691870c05b2461c74a9a00d6a70/node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/createAlgoliaInsightsPlugin.js';
|
|
10
|
+
|
|
11
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
12
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
|
+
function createAutocomplete(options) {
|
|
18
|
+
checkOptions(options);
|
|
19
|
+
var subscribers = [];
|
|
20
|
+
var props = getDefaultProps(options, subscribers);
|
|
21
|
+
var store = createStore(stateReducer, props, onStoreStateChange);
|
|
22
|
+
var setters = getAutocompleteSetters({
|
|
23
|
+
store: store
|
|
24
|
+
});
|
|
25
|
+
var propGetters = getPropGetters(_objectSpread({
|
|
26
|
+
props: props,
|
|
27
|
+
refresh: refresh,
|
|
28
|
+
store: store,
|
|
29
|
+
navigator: props.navigator
|
|
30
|
+
}, setters));
|
|
31
|
+
function onStoreStateChange(_ref) {
|
|
32
|
+
var _state$context, _state$context$algoli;
|
|
33
|
+
var prevState = _ref.prevState,
|
|
34
|
+
state = _ref.state;
|
|
35
|
+
props.onStateChange(_objectSpread({
|
|
36
|
+
prevState: prevState,
|
|
37
|
+
state: state,
|
|
38
|
+
refresh: refresh,
|
|
39
|
+
navigator: props.navigator
|
|
40
|
+
}, setters));
|
|
41
|
+
if (!isAlgoliaInsightsPluginEnabled() && (_state$context = state.context) !== null && _state$context !== void 0 && (_state$context$algoli = _state$context.algoliaInsightsPlugin) !== null && _state$context$algoli !== void 0 && _state$context$algoli.__automaticInsights && props.insights !== false) {
|
|
42
|
+
var plugin = createAlgoliaInsightsPlugin({
|
|
43
|
+
__autocomplete_clickAnalytics: false
|
|
44
|
+
});
|
|
45
|
+
props.plugins.push(plugin);
|
|
46
|
+
subscribePlugins([plugin]);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function refresh() {
|
|
50
|
+
return onInput(_objectSpread({
|
|
51
|
+
event: new Event('input'),
|
|
52
|
+
nextState: {
|
|
53
|
+
isOpen: store.getState().isOpen
|
|
54
|
+
},
|
|
55
|
+
props: props,
|
|
56
|
+
navigator: props.navigator,
|
|
57
|
+
query: store.getState().query,
|
|
58
|
+
refresh: refresh,
|
|
59
|
+
store: store
|
|
60
|
+
}, setters));
|
|
61
|
+
}
|
|
62
|
+
function subscribePlugins(plugins) {
|
|
63
|
+
plugins.forEach(function (plugin) {
|
|
64
|
+
var _plugin$subscribe;
|
|
65
|
+
return (_plugin$subscribe = plugin.subscribe) === null || _plugin$subscribe === void 0 ? void 0 : _plugin$subscribe.call(plugin, _objectSpread(_objectSpread({}, setters), {}, {
|
|
66
|
+
navigator: props.navigator,
|
|
67
|
+
refresh: refresh,
|
|
68
|
+
onSelect: function onSelect(fn) {
|
|
69
|
+
subscribers.push({
|
|
70
|
+
onSelect: fn
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
onActive: function onActive(fn) {
|
|
74
|
+
subscribers.push({
|
|
75
|
+
onActive: fn
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
onResolve: function onResolve(fn) {
|
|
79
|
+
subscribers.push({
|
|
80
|
+
onResolve: fn
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function isAlgoliaInsightsPluginEnabled() {
|
|
87
|
+
return props.plugins.some(function (plugin) {
|
|
88
|
+
return plugin.name === 'aa.algoliaInsightsPlugin';
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (props.insights && !isAlgoliaInsightsPluginEnabled()) {
|
|
92
|
+
var insightsParams = typeof props.insights === 'boolean' ? {} : props.insights;
|
|
93
|
+
props.plugins.push(createAlgoliaInsightsPlugin(insightsParams));
|
|
94
|
+
}
|
|
95
|
+
subscribePlugins(props.plugins);
|
|
96
|
+
injectMetadata({
|
|
97
|
+
metadata: getMetadata({
|
|
98
|
+
plugins: props.plugins,
|
|
99
|
+
options: options
|
|
100
|
+
}),
|
|
101
|
+
environment: props.environment
|
|
102
|
+
});
|
|
103
|
+
return _objectSpread(_objectSpread({
|
|
104
|
+
refresh: refresh,
|
|
105
|
+
navigator: props.navigator
|
|
106
|
+
}, propGetters), setters);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export { createAutocomplete };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createCancelablePromiseList } from './utils/createCancelablePromiseList.js';
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
function createStore(reducer, props, onStoreStateChange) {
|
|
10
|
+
var state = props.initialState;
|
|
11
|
+
return {
|
|
12
|
+
getState: function getState() {
|
|
13
|
+
return state;
|
|
14
|
+
},
|
|
15
|
+
dispatch: function dispatch(action, payload) {
|
|
16
|
+
var prevState = _objectSpread({}, state);
|
|
17
|
+
state = reducer(state, {
|
|
18
|
+
type: action,
|
|
19
|
+
props: props,
|
|
20
|
+
payload: payload
|
|
21
|
+
});
|
|
22
|
+
onStoreStateChange({
|
|
23
|
+
state: state,
|
|
24
|
+
prevState: prevState
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
pendingRequests: createCancelablePromiseList()
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { createStore };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { flatten } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js';
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
function getAutocompleteSetters(_ref) {
|
|
10
|
+
var store = _ref.store;
|
|
11
|
+
var setActiveItemId = function setActiveItemId(value) {
|
|
12
|
+
store.dispatch('setActiveItemId', value);
|
|
13
|
+
};
|
|
14
|
+
var setQuery = function setQuery(value) {
|
|
15
|
+
store.dispatch('setQuery', value);
|
|
16
|
+
};
|
|
17
|
+
var setCollections = function setCollections(rawValue) {
|
|
18
|
+
var baseItemId = 0;
|
|
19
|
+
var value = rawValue.map(function (collection) {
|
|
20
|
+
return _objectSpread(_objectSpread({}, collection), {}, {
|
|
21
|
+
// We flatten the stored items to support calling `getAlgoliaResults`
|
|
22
|
+
// from the source itself.
|
|
23
|
+
items: flatten(collection.items).map(function (item) {
|
|
24
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
25
|
+
__autocomplete_id: baseItemId++
|
|
26
|
+
});
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
store.dispatch('setCollections', value);
|
|
31
|
+
};
|
|
32
|
+
var setIsOpen = function setIsOpen(value) {
|
|
33
|
+
store.dispatch('setIsOpen', value);
|
|
34
|
+
};
|
|
35
|
+
var setStatus = function setStatus(value) {
|
|
36
|
+
store.dispatch('setStatus', value);
|
|
37
|
+
};
|
|
38
|
+
var setContext = function setContext(value) {
|
|
39
|
+
store.dispatch('setContext', value);
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
setActiveItemId: setActiveItemId,
|
|
43
|
+
setQuery: setQuery,
|
|
44
|
+
setCollections: setCollections,
|
|
45
|
+
setIsOpen: setIsOpen,
|
|
46
|
+
setStatus: setStatus,
|
|
47
|
+
setContext: setContext
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { getAutocompleteSetters };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getActiveItem } from './utils/getActiveItem.js';
|
|
2
|
+
|
|
3
|
+
function getCompletion(_ref) {
|
|
4
|
+
var _getActiveItem;
|
|
5
|
+
var state = _ref.state;
|
|
6
|
+
if (state.isOpen === false || state.activeItemId === null) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return ((_getActiveItem = getActiveItem(state)) === null || _getActiveItem === void 0 ? void 0 : _getActiveItem.itemInputValue) || null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { getCompletion };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { getNormalizedSources } from './utils/getNormalizedSources.js';
|
|
2
|
+
import { generateAutocompleteId } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/generateAutocompleteId.js';
|
|
3
|
+
import { getItemsCount } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js';
|
|
4
|
+
import { flatten } from '../../../../../../@algolia_autocomplete-shared@1.19.2_@algolia_client-search@4.24.0_algoliasearch@4.24.0/node_modules/@algolia/autocomplete-shared/dist/esm/flatten.js';
|
|
5
|
+
|
|
6
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
function getDefaultProps(props, pluginSubscribers) {
|
|
19
|
+
var _props$id;
|
|
20
|
+
/* eslint-disable no-restricted-globals */
|
|
21
|
+
var environment = typeof window !== 'undefined' ? window : {};
|
|
22
|
+
/* eslint-enable no-restricted-globals */
|
|
23
|
+
var plugins = props.plugins || [];
|
|
24
|
+
return _objectSpread(_objectSpread({
|
|
25
|
+
debug: false,
|
|
26
|
+
openOnFocus: false,
|
|
27
|
+
enterKeyHint: undefined,
|
|
28
|
+
ignoreCompositionEvents: false,
|
|
29
|
+
placeholder: '',
|
|
30
|
+
autoFocus: false,
|
|
31
|
+
defaultActiveItemId: null,
|
|
32
|
+
stallThreshold: 300,
|
|
33
|
+
insights: undefined,
|
|
34
|
+
environment: environment,
|
|
35
|
+
shouldPanelOpen: function shouldPanelOpen(_ref) {
|
|
36
|
+
var state = _ref.state;
|
|
37
|
+
return getItemsCount(state) > 0;
|
|
38
|
+
},
|
|
39
|
+
reshape: function reshape(_ref2) {
|
|
40
|
+
var sources = _ref2.sources;
|
|
41
|
+
return sources;
|
|
42
|
+
}
|
|
43
|
+
}, props), {}, {
|
|
44
|
+
// Since `generateAutocompleteId` triggers a side effect (it increments
|
|
45
|
+
// an internal counter), we don't want to execute it if unnecessary.
|
|
46
|
+
id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generateAutocompleteId(),
|
|
47
|
+
plugins: plugins,
|
|
48
|
+
// The following props need to be deeply defaulted.
|
|
49
|
+
initialState: _objectSpread({
|
|
50
|
+
activeItemId: null,
|
|
51
|
+
query: '',
|
|
52
|
+
completion: null,
|
|
53
|
+
collections: [],
|
|
54
|
+
isOpen: false,
|
|
55
|
+
status: 'idle',
|
|
56
|
+
context: {}
|
|
57
|
+
}, props.initialState),
|
|
58
|
+
onStateChange: function onStateChange(params) {
|
|
59
|
+
var _props$onStateChange;
|
|
60
|
+
(_props$onStateChange = props.onStateChange) === null || _props$onStateChange === void 0 ? void 0 : _props$onStateChange.call(props, params);
|
|
61
|
+
plugins.forEach(function (x) {
|
|
62
|
+
var _x$onStateChange;
|
|
63
|
+
return (_x$onStateChange = x.onStateChange) === null || _x$onStateChange === void 0 ? void 0 : _x$onStateChange.call(x, params);
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
onSubmit: function onSubmit(params) {
|
|
67
|
+
var _props$onSubmit;
|
|
68
|
+
(_props$onSubmit = props.onSubmit) === null || _props$onSubmit === void 0 ? void 0 : _props$onSubmit.call(props, params);
|
|
69
|
+
plugins.forEach(function (x) {
|
|
70
|
+
var _x$onSubmit;
|
|
71
|
+
return (_x$onSubmit = x.onSubmit) === null || _x$onSubmit === void 0 ? void 0 : _x$onSubmit.call(x, params);
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
onReset: function onReset(params) {
|
|
75
|
+
var _props$onReset;
|
|
76
|
+
(_props$onReset = props.onReset) === null || _props$onReset === void 0 ? void 0 : _props$onReset.call(props, params);
|
|
77
|
+
plugins.forEach(function (x) {
|
|
78
|
+
var _x$onReset;
|
|
79
|
+
return (_x$onReset = x.onReset) === null || _x$onReset === void 0 ? void 0 : _x$onReset.call(x, params);
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
getSources: function getSources(params) {
|
|
83
|
+
return Promise.all([].concat(_toConsumableArray(plugins.map(function (plugin) {
|
|
84
|
+
return plugin.getSources;
|
|
85
|
+
})), [props.getSources]).filter(Boolean).map(function (getSources) {
|
|
86
|
+
return getNormalizedSources(getSources, params);
|
|
87
|
+
})).then(function (nested) {
|
|
88
|
+
return flatten(nested);
|
|
89
|
+
}).then(function (sources) {
|
|
90
|
+
return sources.map(function (source) {
|
|
91
|
+
return _objectSpread(_objectSpread({}, source), {}, {
|
|
92
|
+
onSelect: function onSelect(params) {
|
|
93
|
+
source.onSelect(params);
|
|
94
|
+
pluginSubscribers.forEach(function (x) {
|
|
95
|
+
var _x$onSelect;
|
|
96
|
+
return (_x$onSelect = x.onSelect) === null || _x$onSelect === void 0 ? void 0 : _x$onSelect.call(x, params);
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
onActive: function onActive(params) {
|
|
100
|
+
source.onActive(params);
|
|
101
|
+
pluginSubscribers.forEach(function (x) {
|
|
102
|
+
var _x$onActive;
|
|
103
|
+
return (_x$onActive = x.onActive) === null || _x$onActive === void 0 ? void 0 : _x$onActive.call(x, params);
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
onResolve: function onResolve(params) {
|
|
107
|
+
source.onResolve(params);
|
|
108
|
+
pluginSubscribers.forEach(function (x) {
|
|
109
|
+
var _x$onResolve;
|
|
110
|
+
return (_x$onResolve = x.onResolve) === null || _x$onResolve === void 0 ? void 0 : _x$onResolve.call(x, params);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
navigator: _objectSpread({
|
|
118
|
+
navigate: function navigate(_ref3) {
|
|
119
|
+
var itemUrl = _ref3.itemUrl;
|
|
120
|
+
environment.location.assign(itemUrl);
|
|
121
|
+
},
|
|
122
|
+
navigateNewTab: function navigateNewTab(_ref4) {
|
|
123
|
+
var itemUrl = _ref4.itemUrl;
|
|
124
|
+
var windowReference = environment.open(itemUrl, '_blank', 'noopener');
|
|
125
|
+
windowReference === null || windowReference === void 0 ? void 0 : windowReference.focus();
|
|
126
|
+
},
|
|
127
|
+
navigateNewWindow: function navigateNewWindow(_ref5) {
|
|
128
|
+
var itemUrl = _ref5.itemUrl;
|
|
129
|
+
environment.open(itemUrl, '_blank', 'noopener');
|
|
130
|
+
}
|
|
131
|
+
}, props.navigator)
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { getDefaultProps };
|