@algolia/recommend-vdom
Advanced tools
Comparing version 1.11.0 to 1.12.0
@@ -0,14 +1,3 @@ | ||
/** @jsx createElement */ | ||
import { RecommendClassNames, RecommendTranslations, Renderer, FacetsViewProps } from './types'; | ||
export declare function createFacetsView({ createElement, Fragment }: Renderer): <TItem extends { | ||
facetName?: string | undefined; | ||
facetValue?: string | undefined; | ||
}>(props: FacetsViewProps<TItem, Partial<{ | ||
title: string; | ||
sliderLabel: string; | ||
}>, Partial<{ | ||
root: string; | ||
title: string; | ||
container: string; | ||
list: string; | ||
item: string; | ||
}>>) => JSX.Element; | ||
export declare function createFacetsView({ createElement, Fragment }: Renderer): (props: FacetsViewProps<RecommendTranslations, RecommendClassNames>) => JSX.Element; |
import { Renderer, TrendingComponentProps } from './types'; | ||
export declare function createTrendingFacetsComponent({ createElement, Fragment, }: Renderer): <TObject>(props: TrendingComponentProps<TObject, {}>) => JSX.Element; | ||
export declare function createTrendingFacetsComponent({ createElement, Fragment, }: Renderer): (props: TrendingComponentProps) => JSX.Element; |
@@ -1,10 +0,10 @@ | ||
import { FacetEntry } from '@algolia/recommend-core'; | ||
import { TrendingFacetHit } from '@algolia/recommend-core'; | ||
import { Renderer } from './Renderer'; | ||
export type FacetsViewProps<TItem extends FacetEntry, TTranslations extends Record<string, string>, TClassNames extends Record<string, string>> = { | ||
export type FacetsViewProps<TTranslations extends Record<string, string>, TClassNames extends Record<string, string>> = { | ||
classNames: TClassNames; | ||
itemComponent<TComponentProps extends Record<string, unknown> = {}>(props: { | ||
item: TItem; | ||
item: TrendingFacetHit; | ||
} & Renderer & TComponentProps): JSX.Element; | ||
items: TItem[]; | ||
items: TrendingFacetHit[]; | ||
translations: TTranslations; | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { FacetEntry, RecordWithObjectID } from '@algolia/recommend-core'; | ||
import { RecordWithObjectID, TrendingFacetHit } from '@algolia/recommend-core'; | ||
import { FacetsViewProps } from './FacetsViewProps'; | ||
@@ -34,12 +34,12 @@ import { RecommendClassNames } from './RecommendClassNames'; | ||
}; | ||
export type TrendingComponentProps<TObject, TComponentProps extends Record<string, unknown> = {}> = { | ||
itemComponent(props: ItemComponentProps<FacetEntry<TObject>> & TComponentProps): JSX.Element; | ||
items: Array<FacetEntry<TObject>>; | ||
export type TrendingComponentProps<TComponentProps extends Record<string, unknown> = {}> = { | ||
itemComponent(props: ItemComponentProps<TrendingFacetHit> & TComponentProps): JSX.Element; | ||
items: TrendingFacetHit[]; | ||
classNames?: RecommendClassNames; | ||
children?(props: ChildrenProps<TObject> & TComponentProps): JSX.Element; | ||
children?(props: ChildrenProps<TrendingFacetHit> & TComponentProps): JSX.Element; | ||
fallbackComponent?(props: Renderer & TComponentProps): JSX.Element; | ||
headerComponent?(props: HeaderComponentProps<TObject> & TComponentProps): JSX.Element; | ||
headerComponent?(props: HeaderComponentProps<TrendingFacetHit> & TComponentProps): JSX.Element; | ||
status: RecommendStatus; | ||
translations?: RecommendTranslations; | ||
view?(props: FacetsViewProps<FacetEntry<TObject>, Required<RecommendTranslations>, Record<string, string>> & Renderer & TComponentProps): JSX.Element; | ||
view?(props: FacetsViewProps<Required<RecommendTranslations>, Record<string, string>> & Renderer & TComponentProps): JSX.Element; | ||
}; |
@@ -1,1 +0,1 @@ | ||
export declare const version = "1.11.0"; | ||
export declare const version = "1.12.0"; |
@@ -1,1 +0,1 @@ | ||
export const version = '1.11.0'; | ||
export const version = '1.12.0'; |
@@ -1,3 +0,3 @@ | ||
/*! @algolia/recommend-vdom 1.11.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/recommend */ | ||
/*! @algolia/recommend-vdom 1.12.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/recommend */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/recommend-vdom"]={})}(this,(function(e){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},t.apply(this,arguments)}function n(...e){return e.filter(Boolean).join(" ")}function a({createElement:e,Fragment:t}){return function(a){return 0===a.recommendations.length&&"idle"===a.status?e(a.Fallback,null):e("section",{className:n("auc-Recommend",a.classNames.root)},e(a.Header,{classNames:a.classNames,recommendations:a.recommendations,translations:a.translations,createElement:e,Fragment:t}),e(a.View,null))}}function m({createElement:e}){return function(t){return!t.recommendations||t.recommendations.length<1?null:t.translations.title?e("h3",{className:n("auc-Recommend-title",t.classNames.title)},t.translations.title):null}}function r({createElement:e,Fragment:t}){return function(a){return e("div",{className:n("auc-Recommend-container",a.classNames.container)},e("ol",{className:n("auc-Recommend-list",a.classNames.list)},a.items.map((m=>e("li",{key:m.objectID,className:n("auc-Recommend-item",a.classNames.item)},e(a.itemComponent,{createElement:e,Fragment:t,item:m}))))))}}e.createFrequentlyBoughtTogetherComponent=function({createElement:e,Fragment:n}){return function(s){const o={title:"Frequently bought together",sliderLabel:"Frequently bought together products",...s.translations},l=s.classNames??{},c=s.children??a({createElement:e,Fragment:n}),i=s.fallbackComponent??function(){return null},u=s.headerComponent??m({createElement:e,Fragment:n}),d=s.view??r({createElement:e,Fragment:n});return c({classNames:l,Fallback:()=>e(i,{Fragment:n,createElement:e}),Header:u,recommendations:s.items,status:s.status,translations:o,View:a=>e(d,t({classNames:l,itemComponent:s.itemComponent,items:s.items,translations:o,Fragment:n,createElement:e},a))})}},e.createLookingSimilarComponent=function({createElement:e,Fragment:n}){return function(s){const o={title:"Looking Similar",sliderLabel:"Looking Similar",...s.translations},l=s.classNames??{},c=s.children??a({createElement:e,Fragment:n}),i=s.fallbackComponent??function(){return null},u=s.headerComponent??m({createElement:e,Fragment:n}),d=s.view??r({createElement:e,Fragment:n});return c({classNames:l,Fallback:()=>e(i,{Fragment:n,createElement:e}),Header:u,recommendations:s.items,status:s.status,translations:o,View:a=>e(d,t({classNames:l,itemComponent:s.itemComponent,items:s.items,translations:o,Fragment:n,createElement:e},a))})}},e.createRecommendedForYouComponent=function({createElement:e,Fragment:n}){return function(s){const o={title:"Recommended For You",sliderLabel:"Recommended For You",...s.translations},l=s.classNames??{},c=s.children??a({createElement:e,Fragment:n}),i=s.fallbackComponent??function(){return null},u=s.headerComponent??m({createElement:e,Fragment:n}),d=s.view??r({createElement:e,Fragment:n});return c({classNames:l,Fallback:()=>e(i,{Fragment:n,createElement:e}),Header:u,recommendations:s.items,status:s.status,translations:o,View:a=>e(d,t({classNames:l,itemComponent:s.itemComponent,items:s.items,translations:o,Fragment:n,createElement:e},a))})}},e.createRelatedProductsComponent=function({createElement:e,Fragment:n}){return function(s){const o={title:"Related products",sliderLabel:"Related products",...s.translations},l=s.classNames??{},c=s.children??a({createElement:e,Fragment:n}),i=s.fallbackComponent??function(){return null},u=s.headerComponent??m({createElement:e,Fragment:n}),d=s.view??r({createElement:e,Fragment:n});return c({classNames:l,Fallback:()=>e(i,{Fragment:n,createElement:e}),Header:u,recommendations:s.items,status:s.status,translations:o,View:a=>e(d,t({classNames:l,itemComponent:s.itemComponent,items:s.items,translations:o,Fragment:n,createElement:e},a))})}},e.createTrendingFacetsComponent=function({createElement:e,Fragment:r}){return function(s){const o={title:"Trending facets",sliderLabel:"Trending facets",...s.translations},l=s.classNames??{},c=s.children??a({createElement:e,Fragment:r}),i=s.fallbackComponent??function(){return null},u=s.headerComponent??m({createElement:e,Fragment:r}),d=s.view??function({createElement:e,Fragment:t}){return function(a){return e("div",{className:n("auc-Recommend-container",a.classNames.container)},e("ol",{className:n("auc-Recommend-list",a.classNames.list)},a.items.map((m=>e("li",{key:m.facetValue,className:n("auc-Recommend-item",a.classNames.item)},e(a.itemComponent,{createElement:e,Fragment:t,item:m}))))))}}({createElement:e,Fragment:r});return c({classNames:l,Fallback:()=>e(i,{Fragment:r,createElement:e}),Header:u,recommendations:s.items,status:s.status,translations:o,View:n=>e(d,t({classNames:l,itemComponent:s.itemComponent,items:s.items,translations:o,Fragment:r,createElement:e},n))})}},e.createTrendingItemsComponent=function({createElement:e,Fragment:n}){return function(s){const o={title:"Trending items",sliderLabel:"Trending items",...s.translations},l=s.classNames??{},c=s.children??a({createElement:e,Fragment:n}),i=s.fallbackComponent??function(){return null},u=s.headerComponent??m({createElement:e,Fragment:n}),d=s.view??r({createElement:e,Fragment:n});return c({classNames:l,Fallback:()=>e(i,{Fragment:n,createElement:e}),Header:u,recommendations:s.items,status:s.status,translations:o,View:a=>e(d,t({classNames:l,itemComponent:s.itemComponent,items:s.items,translations:o,Fragment:n,createElement:e},a))})}}})); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@algolia/recommend-vdom", | ||
"version": "1.11.0", | ||
"version": "1.12.0", | ||
"license": "MIT", | ||
@@ -31,4 +31,4 @@ "homepage": "https://github.com/algolia/recommend", | ||
"devDependencies": { | ||
"@algolia/recommend-core": "1.11.0" | ||
"@algolia/recommend-core": "1.12.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51276
594