@constructor-io/constructorio-ui-autocomplete 1.12.0 → 1.13.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.
- package/README.md +17 -2
- package/dist/constructorio-ui-autocomplete-bundled.js +9 -9
- package/lib/cjs/components/Autocomplete/SectionItem/SectionItem.js +3 -2
- package/lib/cjs/hooks/useCioAutocomplete.js +3 -1
- package/lib/cjs/hooks/useDebouncedFetchSections.js +6 -3
- package/lib/cjs/hooks/useDownShift.js +3 -1
- package/lib/cjs/hooks/useSections.js +2 -1
- package/lib/cjs/utils.js +27 -1
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/Autocomplete/SectionItem/SectionItem.js +3 -2
- package/lib/mjs/hooks/useCioAutocomplete.js +4 -2
- package/lib/mjs/hooks/useDebouncedFetchSections.js +6 -3
- package/lib/mjs/hooks/useDownShift.js +3 -1
- package/lib/mjs/hooks/useSections.js +2 -1
- package/lib/mjs/utils.js +24 -0
- package/lib/mjs/version.js +1 -1
- package/lib/types/components/Autocomplete/CioAutocompleteProvider.d.ts +5 -0
- package/lib/types/hooks/useCioAutocomplete.d.ts +5 -0
- package/lib/types/hooks/useFetchRecommendationPod.d.ts +2 -2
- package/lib/types/hooks/useSections.d.ts +1 -0
- package/lib/types/types.d.ts +7 -3
- package/lib/types/utils.d.ts +7 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +7 -3
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_M57QS8SMPdLdLx4x" />
|
|
32
|
+
<CioAutocomplete apiKey="key_M57QS8SMPdLdLx4x" onSubmit={(e) => {console.log(e)}} />
|
|
33
33
|
</div>
|
|
34
34
|
);
|
|
35
35
|
```
|
|
@@ -159,6 +159,20 @@ import '@constructor-io/constructorio-ui-autocomplete/styles.css';
|
|
|
159
159
|
|
|
160
160
|
### Known Issues
|
|
161
161
|
|
|
162
|
+
**Older Javascript environments**
|
|
163
|
+
|
|
164
|
+
The library provides two different builds. CommonJS (cjs) and ECMAScript Modules (mjs)
|
|
165
|
+
|
|
166
|
+
For ECMAScript Modules (mjs) build. The Javascript version is ESNext which might not be supported by your environment.
|
|
167
|
+
If that's the case and your environment is using an older Javascript version like ES6 (ES2015), you might get this error.
|
|
168
|
+
|
|
169
|
+
`Module parse failed: Unexpected token (15:32)
|
|
170
|
+
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file`
|
|
171
|
+
|
|
172
|
+
To solve this you can import the CommonJS (cjs) build which supports ES6 (ES2015) syntax:
|
|
173
|
+
|
|
174
|
+
`import CioAutocomplete from '@constructor-io/constructorio-ui-autocomplete/cjs'`
|
|
175
|
+
|
|
162
176
|
**ESLint**
|
|
163
177
|
|
|
164
178
|
There is a known issue with ESLint where it fails to resolve the paths exposed in the `exports` statement of NPM packages. If you are receiving the following error, you can safely disable ESLint using `// eslint-disable-line` for that line.
|
|
@@ -194,4 +208,5 @@ npm run build-storybook # generate storybook static bundle for deploy with GH
|
|
|
194
208
|
- [Typescript Docs](https://www.typescriptlang.org/docs/)
|
|
195
209
|
|
|
196
210
|
## Usage examples
|
|
197
|
-
- [Javascript](https://codesandbox.io/s/autocomplete-ui-integration-plain-y9zjl7)
|
|
211
|
+
- [Javascript](https://codesandbox.io/s/autocomplete-ui-integration-plain-y9zjl7)
|
|
212
|
+
- [Remix App](https://codesandbox.io/p/sandbox/remix-example-for-constructorio-ui-autocomplete-kk5vh5?file=%2Fapp%2Froutes%2Findex.tsx)
|