gentiq 0.10.0 → 0.10.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.
- package/README.md +42 -0
- package/dist/{checkbox-BuMyz6YI.js → checkbox-DIJkKoC9.js} +1220 -1244
- package/dist/gentiq-admin.es.js +739 -706
- package/dist/gentiq-index.es.js +307 -286
- package/dist/gentiq.css +1 -1
- package/dist/src/admin/lib/recharge.d.ts +10 -0
- package/dist/src/components/MessageList.d.ts +1 -1
- package/dist/src/components/PromptInputArea.d.ts +3 -1
- package/dist/src/components/WelcomeScreen.d.ts +9 -2
- package/dist/src/hooks/useTypewriter.d.ts +20 -0
- package/dist/src/hooks/useWelcomeContent.d.ts +28 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/types.d.ts +9 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -358,6 +358,48 @@ function MyWelcomeScreen() {
|
|
|
358
358
|
}
|
|
359
359
|
```
|
|
360
360
|
|
|
361
|
+
## Typing-Effect Subtitle
|
|
362
|
+
|
|
363
|
+
Instead of the static subtitle and clickable suggestion bubbles, you can show a
|
|
364
|
+
rotating subtitle that types itself out, cycling through any number of messages.
|
|
365
|
+
Set `welcome.typingPrompts` to a string array, or to a function that receives the
|
|
366
|
+
authenticated user so the messages can be conditioned on user info. When set, this
|
|
367
|
+
replaces both the static `subtitle` and the `prompts` suggestion bubbles.
|
|
368
|
+
|
|
369
|
+
```tsx
|
|
370
|
+
// Static list
|
|
371
|
+
<GentiqProvider
|
|
372
|
+
welcome={{
|
|
373
|
+
greeting: 'Welcome back',
|
|
374
|
+
typingPrompts: [
|
|
375
|
+
'Ask me anything…',
|
|
376
|
+
'Summarize a document',
|
|
377
|
+
'Draft an email',
|
|
378
|
+
],
|
|
379
|
+
}}
|
|
380
|
+
>
|
|
381
|
+
<ChatUI />
|
|
382
|
+
</GentiqProvider>
|
|
383
|
+
|
|
384
|
+
// Conditioned on the authenticated user
|
|
385
|
+
<GentiqProvider
|
|
386
|
+
welcome={{
|
|
387
|
+
greeting: 'Welcome back',
|
|
388
|
+
typingPrompts: ({ firstName }) =>
|
|
389
|
+
firstName
|
|
390
|
+
? [`Ask me anything, ${firstName}…`, 'Summarize a document', 'Draft an email']
|
|
391
|
+
: ['Ask me anything…', 'Summarize a document', 'Draft an email'],
|
|
392
|
+
}}
|
|
393
|
+
>
|
|
394
|
+
<ChatUI />
|
|
395
|
+
</GentiqProvider>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
The function receives the same context as the personalized `greeting`
|
|
399
|
+
(`{ user, firstName, isLoading, t }`). The typewriter respects the user's
|
|
400
|
+
`prefers-reduced-motion` setting, swapping whole messages instead of animating
|
|
401
|
+
each character when reduced motion is requested.
|
|
402
|
+
|
|
361
403
|
---
|
|
362
404
|
|
|
363
405
|
## 📄 License
|