@constructor-io/constructorio-ui-asa 1.6.0 → 1.6.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,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const react_1 = tslib_1.__importDefault(require("react"));
5
+ const CioAsaProvider_1 = tslib_1.__importDefault(require("../CioAsaProvider/CioAsaProvider"));
6
+ const Chat_1 = tslib_1.__importDefault(require("../Chat/Chat"));
7
+ /**
8
+ * The whole agent in one component: the provider and the chat UI composed together.
9
+ *
10
+ * Consumers that need to place `Chat` inside their own tree, or render several
11
+ * components against one client, should compose `CioAsaProvider` and `Chat`
12
+ * directly. This is the single-entry-point convenience wrapper, and it is what the
13
+ * standalone browser bundle (`src/bundled.jsx`) mounts.
14
+ */
15
+ const CioAsa = react_1.default.forwardRef((props, ref) => {
16
+ const {
17
+ // Provider configuration — everything else belongs to Chat.
18
+ apiKey, cioClient, staticRequestConfigs, formatters, urlHelpers, callbacks, section } = props, chatProps = tslib_1.__rest(props, ["apiKey", "cioClient", "staticRequestConfigs", "formatters", "urlHelpers", "callbacks", "section"]);
19
+ return (react_1.default.createElement(CioAsaProvider_1.default, { apiKey: apiKey, cioClient: cioClient, staticRequestConfigs: staticRequestConfigs, formatters: formatters, urlHelpers: urlHelpers, callbacks: callbacks, section: section },
20
+ react_1.default.createElement(Chat_1.default, Object.assign({}, chatProps, { ref: ref }))));
21
+ });
22
+ CioAsa.displayName = 'CioAsa';
23
+ exports.default = CioAsa;
package/lib/cjs/index.js CHANGED
@@ -3,8 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ConstructorIOClient = exports.normalizeItemToProduct = exports.useCioAsaContext = exports.useAsaTracking = exports.useAsaResults = exports.Button = exports.ResultsBlock = exports.Chat = exports.CioAsaProvider = void 0;
6
+ exports.ConstructorIOClient = exports.normalizeItemToProduct = exports.useCioAsaContext = exports.useAsaTracking = exports.useAsaResults = exports.Button = exports.ResultsBlock = exports.Chat = exports.CioAsaProvider = exports.CioAsa = void 0;
7
7
  // Components
8
+ var CioAsa_1 = require("./components/CioAsa/CioAsa");
9
+ Object.defineProperty(exports, "CioAsa", { enumerable: true, get: function () { return __importDefault(CioAsa_1).default; } });
8
10
  var CioAsaProvider_1 = require("./components/CioAsaProvider/CioAsaProvider");
9
11
  Object.defineProperty(exports, "CioAsaProvider", { enumerable: true, get: function () { return __importDefault(CioAsaProvider_1).default; } });
10
12
  var Chat_1 = require("./components/Chat/Chat");
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.6.0';
3
+ exports.default = '1.6.1';
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import CioAsaProvider from '../CioAsaProvider/CioAsaProvider';
3
+ import Chat from '../Chat/Chat';
4
+ /**
5
+ * The whole agent in one component: the provider and the chat UI composed together.
6
+ *
7
+ * Consumers that need to place `Chat` inside their own tree, or render several
8
+ * components against one client, should compose `CioAsaProvider` and `Chat`
9
+ * directly. This is the single-entry-point convenience wrapper, and it is what the
10
+ * standalone browser bundle (`src/bundled.jsx`) mounts.
11
+ */
12
+ const CioAsa = React.forwardRef((props, ref) => {
13
+ const {
14
+ // Provider configuration — everything else belongs to Chat.
15
+ apiKey, cioClient, staticRequestConfigs, formatters, urlHelpers, callbacks, section, ...chatProps } = props;
16
+ return (React.createElement(CioAsaProvider, { apiKey: apiKey, cioClient: cioClient, staticRequestConfigs: staticRequestConfigs, formatters: formatters, urlHelpers: urlHelpers, callbacks: callbacks, section: section },
17
+ React.createElement(Chat, { ...chatProps, ref: ref })));
18
+ });
19
+ CioAsa.displayName = 'CioAsa';
20
+ export default CioAsa;
package/lib/mjs/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // Components
2
+ export { default as CioAsa } from './components/CioAsa/CioAsa';
2
3
  export { default as CioAsaProvider } from './components/CioAsaProvider/CioAsaProvider';
3
4
  export { default as Chat } from './components/Chat/Chat';
4
5
  export { default as ResultsBlock } from './components/ResultsBlock/ResultsBlock';
@@ -1 +1 @@
1
- export default '1.6.0';
1
+ export default '1.6.1';
@@ -12,7 +12,7 @@ export interface ChatHandle {
12
12
  /** Cancel any active response, then reset the conversation and the thread. */
13
13
  clearHistory: () => void;
14
14
  }
15
- interface ChatProps {
15
+ export interface ChatProps {
16
16
  /** Called when the close button (✕) is clicked. The consumer controls visibility. */
17
17
  onClose?: () => void;
18
18
  /** Additional CSS class name for the root container */
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ChatHandle, ChatProps } from '../Chat/Chat';
3
+ import { CioAsaProviderProps } from '../../types';
4
+ export type CioAsaProps = CioAsaProviderProps & ChatProps;
5
+ /**
6
+ * The whole agent in one component: the provider and the chat UI composed together.
7
+ *
8
+ * Consumers that need to place `Chat` inside their own tree, or render several
9
+ * components against one client, should compose `CioAsaProvider` and `Chat`
10
+ * directly. This is the single-entry-point convenience wrapper, and it is what the
11
+ * standalone browser bundle (`src/bundled.jsx`) mounts.
12
+ */
13
+ declare const CioAsa: React.ForwardRefExoticComponent<CioAsaProviderProps & ChatProps & React.RefAttributes<ChatHandle>>;
14
+ export default CioAsa;
@@ -1,6 +1,8 @@
1
+ export { default as CioAsa } from './components/CioAsa/CioAsa';
2
+ export type { CioAsaProps } from './components/CioAsa/CioAsa';
1
3
  export { default as CioAsaProvider } from './components/CioAsaProvider/CioAsaProvider';
2
4
  export { default as Chat } from './components/Chat/Chat';
3
- export type { ChatHandle } from './components/Chat/Chat';
5
+ export type { ChatHandle, ChatProps } from './components/Chat/Chat';
4
6
  export { default as ResultsBlock } from './components/ResultsBlock/ResultsBlock';
5
7
  export type { AspectRatio } from './components/ResultsBlock/ResultsBlock';
6
8
  export { default as Button } from './components/Button/Button';
@@ -1,2 +1,2 @@
1
- declare const _default: "1.6.0";
1
+ declare const _default: "1.6.1";
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructor-io/constructorio-ui-asa",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Constructor.io AI Shopping Agent UI library for web applications",
5
5
  "author": "constructor.io",
6
6
  "license": "MIT",