gentiq 0.7.30 → 0.7.32
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 +51 -0
- package/dist/{checkbox-DllHCh8Z.js → checkbox-CdPG-d34.js} +939 -920
- package/dist/gentiq-admin.es.js +1386 -1322
- package/dist/gentiq-index.es.js +848 -834
- package/dist/src/components/ThemeProvider.d.ts +1 -1
- package/dist/src/hooks/useGentiqUser.d.ts +184 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/lib/api.d.ts +3 -3
- package/dist/src/locales/en.json.d.ts +8 -1
- package/dist/src/locales/fa.json.d.ts +8 -1
- package/dist/src/types.d.ts +37 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -150,6 +150,7 @@ Support multiple languages (including RTL) and customize your brand's unique loo
|
|
|
150
150
|
```tsx
|
|
151
151
|
<GentiqProvider
|
|
152
152
|
theme={{
|
|
153
|
+
defaultTheme: 'system',
|
|
153
154
|
accent: '#6366f1',
|
|
154
155
|
radius: 20,
|
|
155
156
|
typography: {
|
|
@@ -170,6 +171,11 @@ Support multiple languages (including RTL) and customize your brand's unique loo
|
|
|
170
171
|
</GentiqProvider>
|
|
171
172
|
```
|
|
172
173
|
|
|
174
|
+
`defaultTheme` accepts `system`, `light`, or `dark`. Appearance preferences are
|
|
175
|
+
resolved in this order: the user's saved preference, the defaults configured in
|
|
176
|
+
the admin settings page, the `theme` values passed to `GentiqProvider`, and
|
|
177
|
+
finally Gentiq's built-in defaults.
|
|
178
|
+
|
|
173
179
|
---
|
|
174
180
|
|
|
175
181
|
## 👥 Custom User Metadata Fields
|
|
@@ -208,6 +214,51 @@ Easily extend user profiles and signup forms with your own fields. Gentiq handle
|
|
|
208
214
|
</GentiqProvider>
|
|
209
215
|
```
|
|
210
216
|
|
|
217
|
+
## Personalized Greetings
|
|
218
|
+
|
|
219
|
+
Use a functional greeting to personalize the built-in welcome screen. Gentiq
|
|
220
|
+
loads and caches the authenticated profile for you:
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
<GentiqProvider
|
|
224
|
+
welcome={{
|
|
225
|
+
greeting: ({ firstName, t }) =>
|
|
226
|
+
t(firstName ? 'chat:welcome.named' : 'chat:welcome.default', {
|
|
227
|
+
firstName,
|
|
228
|
+
}),
|
|
229
|
+
}}
|
|
230
|
+
i18n={{
|
|
231
|
+
resources: {
|
|
232
|
+
en: {
|
|
233
|
+
chat: {
|
|
234
|
+
welcome: {
|
|
235
|
+
default: 'How can I help you today?',
|
|
236
|
+
named: 'Hi {{firstName}}, how can I help you today?',
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
<ChatUI />
|
|
244
|
+
</GentiqProvider>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
For custom screens or other components, use the same profile data directly:
|
|
248
|
+
|
|
249
|
+
```tsx
|
|
250
|
+
import { useGentiqUser } from 'gentiq';
|
|
251
|
+
|
|
252
|
+
function MyWelcomeScreen() {
|
|
253
|
+
const { user, firstName, isLoading, error } = useGentiqUser();
|
|
254
|
+
|
|
255
|
+
if (isLoading) return null;
|
|
256
|
+
if (error) return <h1>Welcome!</h1>;
|
|
257
|
+
|
|
258
|
+
return <h1>Welcome, {firstName || user?.phone}!</h1>;
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
211
262
|
---
|
|
212
263
|
|
|
213
264
|
## 📄 License
|