@constructor-io/constructorio-ui-pia 2.14.0 → 2.15.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
@@ -47,9 +47,7 @@ import CioPia from '@constructor-io/constructorio-ui-pia';
47
47
  import '@constructor-io/constructorio-ui-pia/styles.css';
48
48
 
49
49
  function YourComponent() {
50
- return (
51
- <CioPia apiKey='YOUR_API_KEY' itemId='PRODUCT_ITEM_ID' />
52
- );
50
+ return <CioPia apiKey='YOUR_API_KEY' itemId='PRODUCT_ITEM_ID' />;
53
51
  }
54
52
  ```
55
53
 
@@ -118,50 +116,50 @@ omitting it would quietly put everyone in the test arm with no control group to
118
116
 
119
117
  #### Configuration Options
120
118
 
121
- | Prop | Type | Description |
122
- |------|------|-------------|
123
- | `apiKey` | `string` | Your Constructor.io API key (required) |
124
- | `itemId` | `string` | The product item ID (required) |
125
- | `variationId` | `string` | Optional variation ID |
126
- | `threadId` | `string` | Optional thread ID for conversation context (must be a valid UUID) |
127
- | `displayConfigs` | `object` | Display configuration options (see below) |
128
- | `trackingConfigs` | `object` | Tracking configuration options (see below) |
129
- | `callbacks` | `object` | Callback handlers for user interactions |
130
- | `translations` | `object` | UI string translations for internationalization |
131
- | `componentOverrides` | `object` | Custom component overrides |
132
- | `abTest` | `object` | A/B test configuration — test cells for tracking, and a control-group placeholder (see below) |
119
+ | Prop | Type | Description |
120
+ | -------------------- | -------- | --------------------------------------------------------------------------------------------- |
121
+ | `apiKey` | `string` | Your Constructor.io API key (required) |
122
+ | `itemId` | `string` | The product item ID (required) |
123
+ | `variationId` | `string` | Optional variation ID |
124
+ | `threadId` | `string` | Optional thread ID for conversation context (must be a valid UUID) |
125
+ | `displayConfigs` | `object` | Display configuration options (see below) |
126
+ | `trackingConfigs` | `object` | Tracking configuration options (see below) |
127
+ | `callbacks` | `object` | Callback handlers for user interactions |
128
+ | `translations` | `object` | UI string translations for internationalization |
129
+ | `componentOverrides` | `object` | Custom component overrides |
130
+ | `abTest` | `object` | A/B test configuration — test cells for tracking, and a control-group placeholder (see below) |
133
131
 
134
132
  **Display Configs:**
135
133
 
136
- | Option | Type | Default | Description |
137
- |--------|------|---------|-------------|
138
- | `mode` | `'default' \| 'conversation' \| 'recommendations'` | `'default'` | Display mode. `'recommendations'` is accepted by the type but not yet available — it renders nothing. |
139
- | `type` | `'inline' \| 'modal'` | `'inline'` | Component type |
140
- | `showFeedback` | `boolean` | `false` | Show feedback controls on answers |
141
- | `showPreviousItems` | `boolean` | `true` | Show product carousels from previous conversation entries |
142
- | `learnMoreUrl` | `string` | - | URL for the "Learn More" disclaimer link |
134
+ | Option | Type | Default | Description |
135
+ | ------------------- | -------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------- |
136
+ | `mode` | `'default' \| 'conversation' \| 'recommendations'` | `'default'` | Display mode. `'recommendations'` is accepted by the type but not yet available — it renders nothing. |
137
+ | `type` | `'inline' \| 'modal'` | `'inline'` | Component type |
138
+ | `showFeedback` | `boolean` | `false` | Show feedback controls on answers |
139
+ | `showPreviousItems` | `boolean` | `true` | Show product carousels from previous conversation entries |
140
+ | `learnMoreUrl` | `string` | - | URL for the "Learn More" disclaimer link |
143
141
 
144
142
  **Tracking Configs:**
145
143
 
146
- | Option | Type | Default | Description |
147
- |--------|------|---------|-------------|
148
- | `viewThreshold` | `number` | `0.5` | Fraction of the container (0–1) that must be visible before the `product_insights_agent.view` event fires. Lower it (e.g. `0.01`) to have the view event fire on minimal visibility. |
144
+ | Option | Type | Default | Description |
145
+ | --------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
146
+ | `viewThreshold` | `number` | `0.5` | Fraction of the container (0–1) that must be visible before the `product_insights_agent.view` event fires. Lower it (e.g. `0.01`) to have the view event fire on minimal visibility. |
149
147
 
150
148
  **AB Test:**
151
149
 
152
- | Option | Type | Default | Description |
153
- |--------|------|---------|-------------|
154
- | `testCells` | `Record<string, string>` | - | `{ [testName]: cellName }`, each sent as an `ef-<testName>` tracking parameter. Ignored when you supply your own `cioClient`. |
155
- | `isControl` | `boolean` | required | Renders an invisible, tracking-only placeholder instead of the widget, so the control arm still records a view event. Takes precedence over `displayConfigs.mode`. |
150
+ | Option | Type | Default | Description |
151
+ | ----------- | ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
152
+ | `testCells` | `Record<string, string>` | - | `{ [testName]: cellName }`, each sent as an `ef-<testName>` tracking parameter. Ignored when you supply your own `cioClient`. |
153
+ | `isControl` | `boolean` | required | Renders an invisible, tracking-only placeholder instead of the widget, so the control arm still records a view event. Takes precedence over `displayConfigs.mode`. |
156
154
 
157
155
  **Callbacks:**
158
156
 
159
- | Option | Type | Description |
160
- |--------|------|-------------|
161
- | `onQuestionSubmit` | `(question: string) => void` | Called when a question is submitted (via Enter key, Send button, or suggested question click) |
162
- | `onProductCardClick` | `(item: Item) => void` | Called when a product card in the carousel is clicked |
163
- | `onAddToCart` | `(item: Item, event: React.MouseEvent) => void` | Called when the "Add to Cart" button on a product card is clicked. Passing this callback is what renders the button; without it no cart control is shown |
164
- | `onFeedback` | `(type: 'up' \| 'down') => void` | Called when the user submits positive or negative feedback on an answer |
157
+ | Option | Type | Description |
158
+ | -------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
159
+ | `onQuestionSubmit` | `(question: string) => void` | Called when a question is submitted (via Enter key, Send button, or suggested question click) |
160
+ | `onProductCardClick` | `(item: Item) => void` | Called when a product card in the carousel is clicked |
161
+ | `onAddToCart` | `(item: Item, event: React.MouseEvent) => void` | Called when the "Add to Cart" button on a product card is clicked. Passing this callback is what renders the button; without it no cart control is shown |
162
+ | `onFeedback` | `(type: 'up' \| 'down') => void` | Called when the user submits positive or negative feedback on an answer |
165
163
 
166
164
  ### Using the JavaScript Bundle
167
165