@constructor-io/constructorio-ui-autocomplete 1.9.3 → 1.13.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_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)