@constructor-io/constructorio-ui-autocomplete 1.7.0 → 1.7.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.
@@ -0,0 +1,3 @@
1
+ import { Item, Section } from '../types';
2
+ declare const useItems: (activeSectionsWithData: Section[]) => Item[];
3
+ export default useItems;
@@ -0,0 +1,8 @@
1
+ import ConstructorIO from '@constructor-io/constructorio-client-javascript';
2
+ import { Nullable } from '@constructor-io/constructorio-client-javascript/lib/types/types';
3
+ import { AdvancedParameters, UserDefinedSection } from '../types';
4
+ export default function useSections(query: string, cioClient: Nullable<ConstructorIO>, sections: UserDefinedSection[], zeroStateSections: UserDefinedSection[] | undefined, advancedParameters: AdvancedParameters): {
5
+ activeSections: UserDefinedSection[];
6
+ activeSectionsWithData: import("../types").Section[];
7
+ zeroStateActiveSections: false | UserDefinedSection[] | undefined;
8
+ };
@@ -13,7 +13,7 @@ export type CioAutocompleteProps = CioClientConfig & {
13
13
  openOnFocus?: boolean;
14
14
  onSubmit: OnSubmit;
15
15
  onFocus?: () => void;
16
- onChange?: () => void;
16
+ onChange?: (string: any) => void;
17
17
  placeholder?: string;
18
18
  children?: ReactNode;
19
19
  sections?: UserDefinedSection[];
@@ -1,5 +1,5 @@
1
1
  import ConstructorIOClient from '@constructor-io/constructorio-client-javascript';
2
- import { OnSubmit, Item } from './types';
2
+ import { OnSubmit, Item, Section, UserDefinedSection, AutocompleteResultSections } from './types';
3
3
  export type GetItemPosition = (args: {
4
4
  item: Item;
5
5
  items: Item[];
@@ -23,12 +23,14 @@ export declare const getStoryParams: (storyCode: any, templateCode: any, importC
23
23
  };
24
24
  };
25
25
  };
26
- export declare const defaultOnSubmitCode = "\"onSubmit\": (submitEvent) => console.dir(submitEvent)";
27
- export declare const defaultArgumentsCode: (apiKey: string) => string;
26
+ export declare const functionStrings: {
27
+ onSubmit: string;
28
+ };
28
29
  export declare const stringifyWithDefaults: (obj: {
29
30
  apiKey: string;
30
31
  onSubmit: OnSubmit;
31
- }) => any;
32
+ }) => string;
32
33
  export declare const disableStoryActions: (story: any) => void;
33
34
  export declare const getCioClient: (apiKey?: string) => ConstructorIOClient | null;
35
+ export declare const getActiveSectionsWithData: (activeSections: UserDefinedSection[], sectionResults: AutocompleteResultSections) => Section[];
34
36
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-autocomplete",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Constructor.io Autocomplete UI library for web applications",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",