@constructor-io/constructorio-ui-autocomplete 1.7.1 → 1.8.0

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/README.md CHANGED
@@ -29,7 +29,7 @@ import { CioAutocomplete } from '@constructor-io/constructorio-ui-autocomplete';
29
29
  function YourComponent() {
30
30
  return (
31
31
  <div>
32
- <CioAutocomplete apiKey="key_Gep3oQOu5IMcNh9A" />
32
+ <CioAutocomplete apiKey="key_M57QS8SMPdLdLx4x" />
33
33
  </div>
34
34
  );
35
35
  ```
@@ -50,8 +50,8 @@ An `apiKey` or `cioJsClient` must be passed to the `useCioAutocomplete` hook alo
50
50
  import { useCioAutocomplete } from '@constructor-io/constructorio-ui-autocomplete';
51
51
 
52
52
  const args = {
53
- apiKey: 'key_Gep3oQOu5IMcNh9A',
54
- onSubmit: (submitEvent) => console.dir(submitEvent),
53
+ "apiKey": "key_M57QS8SMPdLdLx4x",
54
+ "onSubmit": (submitEvent) => console.dir(submitEvent)
55
55
  };
56
56
 
57
57
  function YourComponent() {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.termsWithGroupSuggestionsDescription = exports.advancedParametersDefaultDescription = exports.advancedParametersDescription = exports.customStylesDescription = exports.multipleSectionsDescription = exports.openOnFocusDescription = exports.zeroStateSectionsDescription = exports.onSubmitDefault = exports.onSubmitDescription = exports.onChangeDescription = exports.onFocusDescription = exports.customSectionDescription = exports.recommendationsDescription = exports.sectionOrderDescription = exports.numResultsDescription = exports.contentDescription = exports.productsDescription = exports.searchSuggestionsDescription = exports.placeholderDescription = exports.cioJsClientDescription = exports.apiKeyDescription = exports.zeroStateDescription = exports.userEventsDescription = exports.sectionsDescription = exports.hookDescription = exports.componentDescription = exports.apiKey = void 0;
4
4
  // Autocomplete key index
5
- exports.apiKey = 'key_Gep3oQOu5IMcNh9A';
5
+ exports.apiKey = 'key_M57QS8SMPdLdLx4x';
6
6
  /// //////////////////////////////
7
7
  // Storybook Folder Descriptions
8
8
  /// //////////////////////////////
@@ -1,5 +1,5 @@
1
1
  // Autocomplete key index
2
- export const apiKey = 'key_Gep3oQOu5IMcNh9A';
2
+ export const apiKey = 'key_M57QS8SMPdLdLx4x';
3
3
  /// //////////////////////////////
4
4
  // Storybook Folder Descriptions
5
5
  /// //////////////////////////////
@@ -1,5 +1,5 @@
1
1
  import { AutocompleteSubmitEvent } from './types';
2
- export declare const apiKey = "key_Gep3oQOu5IMcNh9A";
2
+ export declare const apiKey = "key_M57QS8SMPdLdLx4x";
3
3
  export declare const componentDescription = "- import `CioAutocomplete` to render in your JSX.\n- This component handles state management, data fetching, and rendering logic.\n- To use this component, an `apiKey` or `cioJsClient` are required, and an `onSubmit` callback must be passed. All other values are optional.\n- Use different props to configure the behavior of this component.\n- The following stories shows how different props affect the component's behavior\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n";
4
4
  export declare const hookDescription = "- import `useCioAutocomplete` and call this custom hook in a functional component.\n- This hook leaves rendering logic up to you, while handling:\n - state management\n - data fetching\n - keyboard navigation\n - mouse interactions\n - focus and submit event handling\n- To use this hook, an `apiKey` or `cioJsClient` are required, and an `onSubmit` callback must be passed to the `useCioAutocomplete` hook to configure behavior. All other values are optional.\n- use the <a href=\"https://kentcdodds.com/blog/how-to-give-rendering-control-to-users-with-prop-getters\" target=\"__blank\">prop getters</a> and other variables returned by this hook (below) to leverage the functionality described above with jsx elements in your react component definitions\n\nCalling the `useCioAutocomplete` hook returns an object with the following keys:\n\n```jsx\nconst {\n // must be used for a hooks integrations\n query: string, // current input field value\n sections: [{...}], // array of sections data to render in menu list\n getFormProps: () => ({...})), // prop getter for jsx form element\n getInputProps: () => ({...})), // prop getter for jsx input element\n getMenuProps: () => ({...})), // prop getter for jsx element rendering the results container\n getItemProps: (item) => ({...})), // prop getter for jsx element rendering each result\n\n // available for use, but not required for all use cases\n selectedItem: item, // undefined or current selected item (via hover or arrow keys)\n isOpen: boolean, // current state of the menu list\n openMenu: () => void, // open menu\n closeMenu: () => void, // close menu\n setQuery: () => void, // update the current input field value\n getLabelProps: () => ({...})), // prop getter for a jsx label element\n cioJsClient, // instance of constructorio-client-javascript\n } = useCioAutocomplete(args);\n```\n\n> Note: when we say `cioJsClient`, we are referring to an instance of the [constructorio-client-javascript](https://www.npmjs.com/package/@constructor-io/constructorio-client-javascript)\n\nThe following stories show how different options affect the hook's behavior!\n";
5
5
  export declare const sectionsDescription = "- by default, typing a query will fetch data for search suggestions and Products\n- to override this, pass an array of sections objects\n- the order of the objects in the `sections` array determines the order of the results\n- each section object must have an `identifier`\n- each section object can specify a `type`\n- each section object can override the default `numResults` of 8\n\nWhen no values are passed for the `sections` argument, the following defaults are used:\n\n```jsx\n[\n {\n identifier: 'Search Suggestions',\n type: 'autocomplete',\n numResults: 8\n },\n {\n identifier: 'Products',\n type: 'autocomplete',\n numResults: 8\n }\n]\n```\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-autocomplete",
3
- "version": "1.7.1",
3
+ "version": "1.8.0",
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",
@@ -23,6 +23,7 @@
23
23
  "scripts": {
24
24
  "lint": "eslint src --ext js,ts,jsx,tsx",
25
25
  "check-types": "npx tsc --noEmit",
26
+ "check-license": "license-checker --production --onlyAllow 'Apache-2.0;BSD-3-Clause;MIT;0BSD;BSD-2-Clause'",
26
27
  "copy-styles": "cp src/styles.css lib/styles.css",
27
28
  "prepare": "husky install",
28
29
  "dev": "storybook dev -p 6006",
@@ -82,6 +83,7 @@
82
83
  "eslint-plugin-react-hooks": "^4.6.0",
83
84
  "eslint-plugin-storybook": "^0.6.12",
84
85
  "husky": "^8.0.1",
86
+ "license-checker": "^25.0.1",
85
87
  "react": "^18.2.0",
86
88
  "react-dom": "^18.2.0",
87
89
  "start-server-and-test": "^1.15.2",