@dropins/storefront-product-discovery 0.8.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +127 -0
- package/api/attributeMetadata/attributeMetadata.d.ts +4 -0
- package/api/attributeMetadata/graphql/attributeMetadata.graphql.d.ts +17 -0
- package/api/attributeMetadata/index.d.ts +10 -0
- package/api/fetch-graphql/fetch-graphql.d.ts +16 -0
- package/api/fetch-graphql/index.d.ts +10 -0
- package/api/graphql/fragments.graphql.d.ts +13 -0
- package/api/index.d.ts +13 -0
- package/api/initialize/index.d.ts +10 -0
- package/api/initialize/initialize.d.ts +10 -0
- package/api/productSearch/graphql/productSearch.graphql.d.ts +11 -0
- package/api/productSearch/index.d.ts +10 -0
- package/api/productSearch/productSearch.d.ts +4 -0
- package/api.d.ts +1 -0
- package/api.js +4 -0
- package/api.js.map +1 -0
- package/chunks/acdlEvents.js +4 -0
- package/chunks/acdlEvents.js.map +1 -0
- package/chunks/attributeMetadata.js +19 -0
- package/chunks/attributeMetadata.js.map +1 -0
- package/chunks/productSearch.js +152 -0
- package/chunks/productSearch.js.map +1 -0
- package/components/Facet/Facet.d.ts +10 -0
- package/components/Facet/index.d.ts +19 -0
- package/components/FacetList/FacetList.d.ts +9 -0
- package/components/FacetList/index.d.ts +19 -0
- package/components/ProductItem/ProductItem.d.ts +12 -0
- package/components/ProductItem/index.d.ts +11 -0
- package/components/ProductList/ProductList.d.ts +10 -0
- package/components/ProductList/index.d.ts +11 -0
- package/components/ResultsInfo/ResultsInfo.d.ts +9 -0
- package/components/ResultsInfo/index.d.ts +19 -0
- package/components/SearchAlertMessage/SearchAlertMessage.d.ts +8 -0
- package/components/SearchAlertMessage/index.d.ts +11 -0
- package/components/SearchBarInput/SearchBarInput.d.ts +15 -0
- package/components/SearchBarInput/index.d.ts +11 -0
- package/components/SearchBarResults/SearchBarResults.d.ts +10 -0
- package/components/SearchBarResults/index.d.ts +11 -0
- package/components/index.d.ts +17 -0
- package/containers/Facets/Facets.d.ts +12 -0
- package/containers/Facets/index.d.ts +19 -0
- package/containers/Facets/utils/facetUtils.d.ts +17 -0
- package/containers/Facets.d.ts +3 -0
- package/containers/Facets.js +4 -0
- package/containers/Facets.js.map +1 -0
- package/containers/ProductList/ProductList.d.ts +19 -0
- package/containers/ProductList/index.d.ts +11 -0
- package/containers/ProductList/utils/getAttributeMetadata.d.ts +10 -0
- package/containers/ProductList/utils/getProductSearch.d.ts +4 -0
- package/containers/ProductList/utils/sortUtils.d.ts +9 -0
- package/containers/ProductList/utils/urlUtils.d.ts +16 -0
- package/containers/ProductList.d.ts +3 -0
- package/containers/ProductList.js +4 -0
- package/containers/ProductList.js.map +1 -0
- package/containers/ResultsInfo/ResultsInfo.d.ts +11 -0
- package/containers/ResultsInfo/index.d.ts +19 -0
- package/containers/ResultsInfo.d.ts +3 -0
- package/containers/ResultsInfo.js +4 -0
- package/containers/ResultsInfo.js.map +1 -0
- package/containers/SearchBarInput/SearchBarInput.d.ts +16 -0
- package/containers/SearchBarInput/index.d.ts +11 -0
- package/containers/SearchBarInput/utils/getSearchBarInputSearch.d.ts +4 -0
- package/containers/SearchBarInput.d.ts +3 -0
- package/containers/SearchBarInput.js +4 -0
- package/containers/SearchBarInput.js.map +1 -0
- package/containers/SearchBarResults/SearchBarResults.d.ts +15 -0
- package/containers/SearchBarResults/index.d.ts +11 -0
- package/containers/SearchBarResults.d.ts +3 -0
- package/containers/SearchBarResults.js +5 -0
- package/containers/SearchBarResults.js.map +1 -0
- package/containers/index.d.ts +14 -0
- package/data/models/acdl.d.ts +86 -0
- package/data/models/api.d.ts +72 -0
- package/data/models/index.d.ts +2 -0
- package/data/models/product.d.ts +56 -0
- package/data/transforms/api.d.ts +11 -0
- package/data/transforms/index.d.ts +11 -0
- package/data/transforms/product.d.ts +4 -0
- package/i18n/en_US.json.d.ts +40 -0
- package/package.json +1 -0
- package/render/Provider.d.ts +8 -0
- package/render/index.d.ts +10 -0
- package/render/render.d.ts +4 -0
- package/render.d.ts +1 -0
- package/render.js +9 -0
- package/render.js.map +1 -0
- package/types/api/attributeMetadata.d.ts +12 -0
- package/types/api/index.d.ts +3 -0
- package/types/api/productSearch.d.ts +11 -0
- package/types/index.d.ts +2 -0
- package/utils/acdlEvents.d.ts +14 -0
- package/utils/htmlStringDecode.d.ts +11 -0
package/render.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sources":["/@dropins/storefront-product-discovery/src/render/Provider.tsx","/@dropins/storefront-product-discovery/src/render/render.tsx"],"sourcesContent":["/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { FunctionComponent } from 'preact';\nimport { useState, useEffect } from 'preact/hooks';\nimport { UIProvider } from '@adobe-commerce/elsie/components';\nimport { Lang } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\n\nimport en_US from '../i18n/en_US.json';\n\n// Langs\nconst langDefinitions = {\n default: en_US,\n};\n\ninterface CartProviderProps {\n children?: any;\n}\n\nexport const Provider: FunctionComponent<CartProviderProps> = ({ children }) => {\n const [lang, setLang] = useState<Lang>('en_US');\n\n // Events\n useEffect(() => {\n const localeEvent = events.on(\n 'locale',\n (locale: string) => {\n setLang(locale as Lang);\n },\n { eager: true },\n );\n return () => {\n localeEvent?.off();\n };\n }, []);\n\n return (\n <UIProvider lang={lang} langDefinitions={langDefinitions}>\n {children}\n </UIProvider>\n );\n};\n","/********************************************************************\n * Copyright 2025 Adobe\n * All Rights Reserved.\n *\n * NOTICE: Adobe permits you to use, modify, and distribute this\n * file in accordance with the terms of the Adobe license agreement\n * accompanying it.\n *******************************************************************/\n\nimport { Render } from '@adobe-commerce/elsie/lib';\nimport { Provider } from './Provider';\n\nexport const render = new Render(<Provider />);\n"],"names":["langDefinitions","en_US","Provider","children","lang","setLang","useState","useEffect","localeEvent","events","locale","jsx","UIProvider","render","Render"],"mappings":"kjCAkBMA,EAAkB,CACtB,QAASC,CACX,EAMaC,EAAiD,CAAC,CAAE,SAAAC,KAAe,CAC9E,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAe,OAAO,EAG9C,OAAAC,EAAU,IAAM,CACd,MAAMC,EAAcC,EAAO,GACzB,SACCC,GAAmB,CAClBL,EAAQK,CAAc,CACxB,EACA,CAAE,MAAO,EAAK,CAChB,EACA,MAAO,IAAM,CACXF,GAAA,MAAAA,EAAa,KACf,CACF,EAAG,EAAE,EAGFG,EAAAC,EAAA,CAAW,KAAAR,EAAY,gBAAAJ,EACrB,SAAAG,CACH,CAAA,CAEJ,ECpCaU,EAAS,IAAIC,EAAOH,EAACT,IAAS,CAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type AttributeMetadata = {
|
|
2
|
+
attribute: string;
|
|
3
|
+
label: string;
|
|
4
|
+
numeric: boolean;
|
|
5
|
+
};
|
|
6
|
+
export interface AttributeMetadataResponse {
|
|
7
|
+
attributeMetadata: {
|
|
8
|
+
sortable: AttributeMetadata[];
|
|
9
|
+
filterableInSearch: AttributeMetadata[];
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=attributeMetadata.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ProductSearchResponse {
|
|
2
|
+
productSearch: {
|
|
3
|
+
total_count: null | number;
|
|
4
|
+
items: null | Array<any>;
|
|
5
|
+
facets: null | Array<any>;
|
|
6
|
+
suggestions?: null | Array<string>;
|
|
7
|
+
related_terms?: null | Array<string>;
|
|
8
|
+
page_info: null | any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=productSearch.d.ts.map
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ProductSearchResponse } from '../data/models/api';
|
|
2
|
+
import { SearchFilter, SearchSort } from '../data/models/acdl';
|
|
3
|
+
|
|
4
|
+
declare const PLP_UNIT_ID = "livesearch-plp";
|
|
5
|
+
declare const SEARCH_UNIT_ID = "livesearch-popover";
|
|
6
|
+
declare const searchRequestSent: (searchUnitId: string) => void;
|
|
7
|
+
declare const searchResponseReceived: (searchUnitId: string) => void;
|
|
8
|
+
declare const categoryResultsView: () => void;
|
|
9
|
+
declare const searchResultsView: (searchUnitId: string) => void;
|
|
10
|
+
declare const searchProductClick: (sku: string, searchUnitId: string) => void;
|
|
11
|
+
declare const updateSearchInputCtx: (searchUnitId: string, searchRequestId: string, phrase: string, filters: Array<SearchFilter>, pageSize: number, currentPage: number, sort: Array<SearchSort>) => void;
|
|
12
|
+
declare const updateSearchResultsCtx: (searchUnitId: string, searchRequestId: string, results: ProductSearchResponse['productSearch']) => void;
|
|
13
|
+
export { searchRequestSent, searchResponseReceived, categoryResultsView, searchResultsView, searchProductClick, updateSearchInputCtx, updateSearchResultsCtx, PLP_UNIT_ID, SEARCH_UNIT_ID, };
|
|
14
|
+
//# sourceMappingURL=acdlEvents.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2025 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
declare const htmlStringDecode: (input: string) => string | null;
|
|
10
|
+
export { htmlStringDecode };
|
|
11
|
+
//# sourceMappingURL=htmlStringDecode.d.ts.map
|