@zengenti/contensis-react-base 3.0.0-beta.50 → 3.0.0-beta.53

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.
@@ -0,0 +1,3 @@
1
+ import { SearchProps, UseFacetsProps } from '../models/SearchProps';
2
+ declare const useFacets: <SearchResults extends Record<string, any>>({ mappers }?: UseFacetsProps) => SearchProps<SearchResults>;
3
+ export default useFacets;
@@ -7,6 +7,7 @@ export * from './models';
7
7
  export { default as withSearch } from './containers/withSearch';
8
8
  export { default as withListing } from './containers/withListing';
9
9
  export { doSearch, setRouteFilters, searchSagas as sagas } from './redux/sagas';
10
+ export { default as useFacets } from './hooks/useFacets.hook';
10
11
  export { default as useListing } from './hooks/useListing.hook';
11
12
  export { default as useMinilist } from './hooks/useMinilist.hook';
12
13
  export * as actions from './redux/actions';
@@ -1,7 +1,7 @@
1
1
  import { clearFilters, updateCurrentFacet, updateCurrentTab, updatePageIndex, updateSearchTerm, updateSelectedFilters, updateSortOrder } from '../redux/actions';
2
2
  import { SearchFacet, Mappers } from '../models/Search';
3
3
  import { DebugFlags } from '../models/SearchActions';
4
- import { Facet as StateFacet, Facets, Filters, Paging } from '../models/SearchState';
4
+ import { Facet as StateFacet, Facets, Filters, Paging, SelectedFilters } from '../models/SearchState';
5
5
  export interface MinilistProps<SearchResults = any> {
6
6
  filters: Filters;
7
7
  isLoading: boolean;
@@ -22,11 +22,13 @@ export interface ListingProps<SearchResults = any> {
22
22
  featured: SearchResults[];
23
23
  filters: Filters;
24
24
  isLoading: boolean;
25
- paging: Paging;
25
+ listing: StateFacet;
26
26
  pageIsLoading: boolean;
27
+ paging: Paging;
27
28
  results: SearchResults[];
28
29
  resultsInfo: any;
29
30
  searchTerm: string;
31
+ selectedFilters: SelectedFilters;
30
32
  sortOrder: string[];
31
33
  title: string;
32
34
  updateCurrentFacet: typeof updateCurrentFacet;
@@ -42,7 +44,12 @@ export interface SearchProps<SearchResults = any> {
42
44
  currentTabIndex: number;
43
45
  facet: StateFacet;
44
46
  facets: Facets;
45
- featuredResults: SearchResults[];
47
+ facetTitles: {
48
+ key: string;
49
+ title: string;
50
+ totalCount: number;
51
+ }[];
52
+ featured: SearchResults[];
46
53
  filters: Filters;
47
54
  isLoading: boolean;
48
55
  paging: Paging;
@@ -50,6 +57,7 @@ export interface SearchProps<SearchResults = any> {
50
57
  results: SearchResults[];
51
58
  resultsInfo: any;
52
59
  searchTerm: string;
60
+ selectedFilters: SelectedFilters;
53
61
  sortOrder: string[];
54
62
  tabsAndFacets: any;
55
63
  updateCurrentFacet: typeof updateCurrentFacet;
@@ -59,11 +67,22 @@ export interface SearchProps<SearchResults = any> {
59
67
  updateSelectedFilters: typeof updateSelectedFilters;
60
68
  updateSortOrder: typeof updateSortOrder;
61
69
  }
70
+ export interface UseFacetsProps {
71
+ debug?: DebugFlags;
72
+ defaultLang?: string;
73
+ mappers?: Mappers;
74
+ /** Reserved for future use */
75
+ id?: string;
76
+ params?: {
77
+ [key: string]: string;
78
+ };
79
+ }
62
80
  export interface UseListingProps {
63
- id: string;
64
81
  debug?: DebugFlags;
65
82
  defaultLang?: string;
66
83
  mappers?: Mappers;
84
+ /** Reserved for future use */
85
+ id?: string;
67
86
  params?: {
68
87
  [key: string]: string;
69
88
  };
@@ -7,7 +7,7 @@ export declare const getSearchContext: (state: AppState) => Context;
7
7
  export declare const getCurrent: (state: AppState, context?: Context) => string;
8
8
  export declare const getCurrentFacet: (state: AppState) => string;
9
9
  export declare const getCurrentListing: (state: AppState) => string;
10
- export declare const getCurrentTab: (state: AppState) => Map<string, Tab[keyof Tab]>;
10
+ export declare const getCurrentTab: (state: AppState) => number;
11
11
  export declare const getFacets: (state: AppState, returnType?: StateType | undefined) => Facets;
12
12
  export declare const getTabFacets: (state: AppState) => {
13
13
  [k: string]: Facet;
@@ -50,7 +50,7 @@ export declare const getSearchTotalCount: (state: AppState) => any;
50
50
  export declare const getFacetsTotalCount: (state: AppState) => number;
51
51
  export declare const selectFacets: {
52
52
  getCurrent: (state: AppState) => string;
53
- getCurrentTab: (state: AppState) => Map<string, Tab[keyof Tab]>;
53
+ getCurrentTab: (state: AppState) => number;
54
54
  getCustomApi: (state: AppState, current: string, context?: Context, returnType?: StateType | undefined) => CustomApi;
55
55
  getCustomEnv: (state: AppState, current: string, context?: Context) => any;
56
56
  getFacet: (state: AppState, facetName?: string, context?: Context, returnType?: StateType | undefined) => Facet;
@@ -73,7 +73,7 @@ export declare const selectFacets: {
73
73
  getQueryParams: (state: AppState, facet: string) => Record<string, any>;
74
74
  getQueryParameter: ({ state, facet }: {
75
75
  state: AppState;
76
- facet: string;
76
+ facet?: string | undefined;
77
77
  }, key: keyof QueryParams | keyof QueryParams2, ifnull: any) => any;
78
78
  getRenderableFilters: (state: AppState, facet?: string, context?: Context) => Filters;
79
79
  getResults: (state: AppState, current?: string, context?: Context, returnType?: StateType | undefined) => any[];
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zengenti/contensis-react-base",
3
- "version": "3.0.0-beta.50",
3
+ "version": "3.0.0-beta.53",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
@@ -14014,7 +14014,7 @@
14014
14014
  }
14015
14015
  },
14016
14016
  "zengenti-search-package": {
14017
- "version": "git+https://gitlab+deploy-token-5:XKRGRE1p2PrFAxnWwLNz@gitlab.zengenti.com/zengenti-packages/search.git#94a9d576f6cdab44d490123535374967abb8b6b5",
14017
+ "version": "git+https://gitlab+deploy-token-5:XKRGRE1p2PrFAxnWwLNz@gitlab.zengenti.com/zengenti-packages/search.git#4e556e237e583e42ce6b61cc3966c1c3f17ffd60",
14018
14018
  "from": "git+https://gitlab+deploy-token-5:XKRGRE1p2PrFAxnWwLNz@gitlab.zengenti.com/zengenti-packages/search.git#immer",
14019
14019
  "dev": true,
14020
14020
  "requires": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zengenti/contensis-react-base",
3
- "version": "3.0.0-beta.50",
3
+ "version": "3.0.0-beta.53",
4
4
  "repository": "https://github.com/zengenti/contensis-react-base",
5
5
  "license": "None",
6
6
  "description": "Turbocharge your React web apps with Contensis. This package handles all dependencies for creating full featured web apps in React with Contensis and Site View. Routing is driven by Site View, Redux is used for global state management and server-side rendering (SSR) is handled for you. Also taking care of intricate hosting issues such as cache invalidation and supporting authenticated content where required.",