@constructor-io/constructorio-ui-pia 2.16.1 → 2.17.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 +15 -13
- package/dist/constructorio-ui-pia-bundled.js +47 -47
- package/lib/cjs/components/CioPia/CioPiaQna.js +14 -4
- package/lib/cjs/hooks/useAnswerResults.js +17 -1
- package/lib/cjs/hooks/useCioPia.js +2 -1
- package/lib/cjs/hooks/useConversation.js +40 -18
- package/lib/cjs/hooks/usePersistedConversation.js +71 -0
- package/lib/cjs/hooks/usePiaClient.js +8 -1
- package/lib/cjs/index.js +4 -1
- package/lib/cjs/utils/conversationStorage.js +141 -0
- package/lib/cjs/version.js +1 -1
- package/lib/mjs/components/CioPia/CioPiaQna.js +12 -2
- package/lib/mjs/hooks/useAnswerResults.js +17 -1
- package/lib/mjs/hooks/useCioPia.js +2 -1
- package/lib/mjs/hooks/useConversation.js +38 -16
- package/lib/mjs/hooks/usePersistedConversation.js +73 -0
- package/lib/mjs/hooks/usePiaClient.js +8 -1
- package/lib/mjs/index.js +2 -0
- package/lib/mjs/utils/conversationStorage.js +129 -0
- package/lib/mjs/version.js +1 -1
- package/lib/types/components/CioPia/types.d.ts +16 -1
- package/lib/types/hooks/useAnswerResults.d.ts +2 -0
- package/lib/types/hooks/useCioPia.d.ts +2 -0
- package/lib/types/hooks/useConversation.d.ts +4 -1
- package/lib/types/hooks/usePersistedConversation.d.ts +18 -0
- package/lib/types/hooks/usePiaClient.d.ts +3 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/types.d.ts +14 -0
- package/lib/types/utils/conversationStorage.d.ts +20 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,19 +116,21 @@ omitting it would quietly put everyone in the test arm with no control group to
|
|
|
116
116
|
|
|
117
117
|
#### Configuration Options
|
|
118
118
|
|
|
119
|
-
| Prop | Type
|
|
120
|
-
| ---------------------------- |
|
|
121
|
-
| `apiKey` | `string`
|
|
122
|
-
| `itemId` | `string`
|
|
123
|
-
| `variationId` | `string`
|
|
124
|
-
| `threadId` | `string`
|
|
125
|
-
| `initialConversationHistory` | `ConversationEntry[]`
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
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
|
+
| `initialConversationHistory` | `ConversationEntry[]` | A conversation you manage, shown before the first question and read once on mount. Conversation and modal modes only (see [Restoring a conversation](#restoring-a-conversation)) |
|
|
126
|
+
| `persistConversation` | `{ enabled: boolean }` | Off by default. Keeps each product's conversation in the browser across page loads. Conversation and modal modes only (see the [Persistent Conversations Guide](https://constructor-io.github.io/constructorio-ui-pia/?path=/docs/general-integration-guide-persistent-conversations-guide--docs)) |
|
|
127
|
+
| `userId` | `string \| null` | Whose persisted conversations these are: the signed-in shopper's id, or `null` for a guest. Change it on login and logout |
|
|
128
|
+
| `displayConfigs` | `object` | Display configuration options (see below) |
|
|
129
|
+
| `trackingConfigs` | `object` | Tracking configuration options (see below) |
|
|
130
|
+
| `callbacks` | `object` | Callback handlers for user interactions |
|
|
131
|
+
| `translations` | `object` | UI string translations for internationalization |
|
|
132
|
+
| `componentOverrides` | `object` | Custom component overrides |
|
|
133
|
+
| `abTest` | `object` | A/B test configuration — test cells for tracking, and a control-group placeholder (see below) |
|
|
132
134
|
|
|
133
135
|
**Display Configs:**
|
|
134
136
|
|