@fast-simon/dashboard-utilities 1.0.63 → 1.0.64

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.
@@ -42,7 +42,7 @@ export interface FastStateProps {
42
42
  custom_sort_settings?: CustomSortSettings;
43
43
  }
44
44
  export interface FastStateFunctionsProps {
45
- setQuery: (query: string, autocomplete: boolean) => void;
45
+ setQuery: (query: string, autocomplete?: boolean) => void;
46
46
  setSort: (sortBy: SortBy) => void;
47
47
  setNarrow: (narrow?: ServerNarrow[]) => void;
48
48
  setPage: (page: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AAiExC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,EAAoB,CAAC,CAAA;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,EAA6B,CAAC,CAAA;AAEpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACtC,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAC1C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,OAAO,UAAU,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC,CAAA","sourcesContent":["import React, {useContext} from \"react\";\r\n\r\n\r\nimport {FullTextServerResponseAll} from \"../../@types/results\";\r\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\r\nimport {SortBy} from \"../../@types/sortBy\";\r\nimport {Product} from \"../../@types/product\";\r\nimport {FastCategory, smartCollectionsResults} from \"../../@types/categories\";\r\nimport {AppType} from \"./FastSimonApi\";\r\nimport {Widget} from \"../../@types/widget\";\r\nimport {AutocompleteResults} from \"../../@types/autocomplete\";\r\n\r\n\r\nexport interface SetStateProps extends Partial<FastStateProps> {\r\n\r\n}\r\n\r\nexport interface IsLoading {\r\n products: boolean,\r\n filters: boolean,\r\n}\r\nexport interface CustomSortSettings{\r\n personalization_rank: number,\r\n creation_date: number,\r\n popularity: number,\r\n inventory: number\r\n}\r\n\r\nexport interface FastStateProps {\r\n isReady: boolean\r\n isLoading: IsLoading,\r\n results?: FullTextServerResponseAll | smartCollectionsResults\r\n query: string\r\n page: number,\r\n narrow?: ServerNarrow[]\r\n type: AppType\r\n collectionID?: string\r\n sortBy?: SortBy\r\n recommendations?: {\r\n [id: string]: Widget\r\n },\r\n singleProducts?: {\r\n [id: string]: Product\r\n }\r\n autocomplete?: AutocompleteResults\r\n searchWithinSearch?: string,\r\n segments?: string[],\r\n flag?:string[]\r\n custom_sort_settings?:CustomSortSettings\r\n}\r\n\r\nexport interface FastStateFunctionsProps {\r\n setQuery: (query: string, autocomplete:boolean) => void,\r\n setSort: (sortBy: SortBy) => void,\r\n setNarrow: (narrow?: ServerNarrow[]) => void,\r\n setPage: (page: number) => void,\r\n getAllCategories: () => Promise<FastCategory[]>\r\n setCollection: (id: string) => void\r\n setState: (newState: SetStateProps) => void\r\n setFlag:(flags:string[])=>void\r\n setSearchWithinSearch: (query: string) => void,\r\n setSegments: (segments: string[]) => void,\r\n setCustomSort:(customSortSettings:CustomSortSettings)=>void,\r\n}\r\n\r\nexport const FastState = React.createContext({} as FastStateProps)\r\nexport const FastStateFunctions = React.createContext({} as FastStateFunctionsProps)\r\n\r\nexport const useFastStateFunctions = () => {\r\n return useContext(FastStateFunctions);\r\n}\r\n\r\nexport const useFastState = () => {\r\n return useContext(FastState)\r\n}"]}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/components/FastSimonApi/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,UAAU,EAAC,MAAM,OAAO,CAAC;AAiExC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,EAAoB,CAAC,CAAA;AAClE,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,EAA6B,CAAC,CAAA;AAEpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACtC,OAAO,UAAU,CAAC,kBAAkB,CAAC,CAAC;AAC1C,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,OAAO,UAAU,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC,CAAA","sourcesContent":["import React, {useContext} from \"react\";\r\n\r\n\r\nimport {FullTextServerResponseAll} from \"../../@types/results\";\r\nimport {Narrow, ServerNarrow} from \"../../@types/narrow\";\r\nimport {SortBy} from \"../../@types/sortBy\";\r\nimport {Product} from \"../../@types/product\";\r\nimport {FastCategory, smartCollectionsResults} from \"../../@types/categories\";\r\nimport {AppType} from \"./FastSimonApi\";\r\nimport {Widget} from \"../../@types/widget\";\r\nimport {AutocompleteResults} from \"../../@types/autocomplete\";\r\n\r\n\r\nexport interface SetStateProps extends Partial<FastStateProps> {\r\n\r\n}\r\n\r\nexport interface IsLoading {\r\n products: boolean,\r\n filters: boolean,\r\n}\r\nexport interface CustomSortSettings{\r\n personalization_rank: number,\r\n creation_date: number,\r\n popularity: number,\r\n inventory: number\r\n}\r\n\r\nexport interface FastStateProps {\r\n isReady: boolean\r\n isLoading: IsLoading,\r\n results?: FullTextServerResponseAll | smartCollectionsResults\r\n query: string\r\n page: number,\r\n narrow?: ServerNarrow[]\r\n type: AppType\r\n collectionID?: string\r\n sortBy?: SortBy\r\n recommendations?: {\r\n [id: string]: Widget\r\n },\r\n singleProducts?: {\r\n [id: string]: Product\r\n }\r\n autocomplete?: AutocompleteResults\r\n searchWithinSearch?: string,\r\n segments?: string[],\r\n flag?:string[]\r\n custom_sort_settings?:CustomSortSettings\r\n}\r\n\r\nexport interface FastStateFunctionsProps {\r\n setQuery: (query: string, autocomplete?:boolean) => void,\r\n setSort: (sortBy: SortBy) => void,\r\n setNarrow: (narrow?: ServerNarrow[]) => void,\r\n setPage: (page: number) => void,\r\n getAllCategories: () => Promise<FastCategory[]>\r\n setCollection: (id: string) => void\r\n setState: (newState: SetStateProps) => void\r\n setFlag:(flags:string[])=>void\r\n setSearchWithinSearch: (query: string) => void,\r\n setSegments: (segments: string[]) => void,\r\n setCustomSort:(customSortSettings:CustomSortSettings)=>void,\r\n}\r\n\r\nexport const FastState = React.createContext({} as FastStateProps)\r\nexport const FastStateFunctions = React.createContext({} as FastStateFunctionsProps)\r\n\r\nexport const useFastStateFunctions = () => {\r\n return useContext(FastStateFunctions);\r\n}\r\n\r\nexport const useFastState = () => {\r\n return useContext(FastState)\r\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fast-simon/dashboard-utilities",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "preview": "vite preview",