@_solaris/messenger-widget 0.3.13 → 0.4.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 +18 -10
- package/dist/messenger.cjs +26 -25
- package/dist/messenger.embed.js +31 -30
- package/dist/messenger.js +2225 -1528
- package/dist/style.css +1 -1
- package/dist/types/core/conversationExport.d.ts +7 -1
- package/dist/types/core/forms.d.ts +2 -2
- package/dist/types/core/i18n.d.ts +249 -0
- package/dist/types/core/tokens.d.ts +1 -1
- package/dist/types/core/types.d.ts +5 -0
- package/dist/types/embed.d.ts +12 -7
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,11 +20,16 @@ import '@_solaris/messenger-widget/style.css';
|
|
|
20
20
|
// In a Vue 3 app:
|
|
21
21
|
// <Messenger :base-url="..." :widget-id="..." :user-id="..." :user-hash="..." display-mode="floating" />
|
|
22
22
|
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// `
|
|
26
|
-
//
|
|
27
|
-
//
|
|
23
|
+
// UI language: pass `language` ('fr' | 'en'). When omitted, it falls back to
|
|
24
|
+
// the authenticated customer's `language`, then the widget config's
|
|
25
|
+
// `default_language`, then French:
|
|
26
|
+
// <Messenger ... language="en" />
|
|
27
|
+
//
|
|
28
|
+
// Optionally pass agent context. `context.customer` is a flat object —
|
|
29
|
+
// pushed once to PATCH /customers/me on boot so the agent has it as context.
|
|
30
|
+
// `name` and `email` map to the customer's columns; any other key is a named
|
|
31
|
+
// variable value (server does a partial set, keeping ones you don't pass):
|
|
32
|
+
// :context="{ customer: { name: 'Jane', email: 'jane@acme.io', plan: 'pro', seats: 12 } }"
|
|
28
33
|
```
|
|
29
34
|
|
|
30
35
|
It also exports the individual presentational components, the design tokens and
|
|
@@ -50,11 +55,14 @@ import {
|
|
|
50
55
|
userId: '…',
|
|
51
56
|
userHash: '…', // HMAC-SHA256(secret, userId), computed server-side
|
|
52
57
|
displayMode: 'floating',// 'floating' | 'sheet' | 'embedded'
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
language: 'en', // optional — 'fr' | 'en'; else customer.language / widget.default_language
|
|
59
|
+
context: { // optional — agent context
|
|
60
|
+
customer: { // pushed once to PATCH /customers/me
|
|
61
|
+
name: 'Jane Doe', // so the agent has it as context
|
|
62
|
+
email: 'jane@acme.io',
|
|
63
|
+
plan: 'pro', // any extra key → named variable (values)
|
|
64
|
+
seats: 12, // server keeps variables you don't pass
|
|
65
|
+
},
|
|
58
66
|
},
|
|
59
67
|
});
|
|
60
68
|
// Messenger.destroy() to tear it down.
|