@evelan/jexity-widget 0.28.1 → 0.30.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.
Files changed (72) hide show
  1. package/README.md +7 -0
  2. package/dist/index.mjs +4637 -3353
  3. package/dist/index.mjs.map +1 -1
  4. package/dist/loader.js +6 -6
  5. package/dist/loader.js.map +1 -1
  6. package/dist/react.mjs +5050 -3715
  7. package/dist/react.mjs.map +1 -1
  8. package/dist/types/entries/esm.d.ts +6 -0
  9. package/dist/types/entries/esm.d.ts.map +1 -1
  10. package/dist/types/entries/react.d.ts +10 -0
  11. package/dist/types/entries/react.d.ts.map +1 -1
  12. package/dist/types/features/chat/components/ChatScreen.d.ts.map +1 -1
  13. package/dist/types/features/chat/components/EscalationFormScreen.d.ts.map +1 -1
  14. package/dist/types/features/chat/components/FormMessage.d.ts.map +1 -1
  15. package/dist/types/features/chat/components/MessageList.d.ts.map +1 -1
  16. package/dist/types/features/chat/components/SourcesRow.d.ts +4 -3
  17. package/dist/types/features/chat/components/SourcesRow.d.ts.map +1 -1
  18. package/dist/types/features/chat/composer/components/SessionErrorNotice.d.ts.map +1 -1
  19. package/dist/types/features/chat/composer/hooks/useAttachmentUpload.d.ts.map +1 -1
  20. package/dist/types/features/chat/composer/hooks/useSendMessage.d.ts.map +1 -1
  21. package/dist/types/features/chat/hooks/useConversation.d.ts.map +1 -1
  22. package/dist/types/features/chat/hooks/useConvexSession.d.ts.map +1 -1
  23. package/dist/types/features/chat/hooks/useEscalation.d.ts +8 -10
  24. package/dist/types/features/chat/hooks/useEscalation.d.ts.map +1 -1
  25. package/dist/types/features/chat/hooks/useSignedInContact.d.ts +12 -0
  26. package/dist/types/features/chat/hooks/useSignedInContact.d.ts.map +1 -0
  27. package/dist/types/features/chat/lib/chatOfAnotherUser.d.ts +14 -0
  28. package/dist/types/features/chat/lib/chatOfAnotherUser.d.ts.map +1 -0
  29. package/dist/types/features/chat/state/session-error.d.ts +5 -1
  30. package/dist/types/features/chat/state/session-error.d.ts.map +1 -1
  31. package/dist/types/features/home/components/ChatList.d.ts +18 -0
  32. package/dist/types/features/home/components/ChatList.d.ts.map +1 -0
  33. package/dist/types/features/home/components/DeleteChatsSheet.d.ts +20 -0
  34. package/dist/types/features/home/components/DeleteChatsSheet.d.ts.map +1 -0
  35. package/dist/types/features/home/components/HomeScreen.d.ts +7 -1
  36. package/dist/types/features/home/components/HomeScreen.d.ts.map +1 -1
  37. package/dist/types/i18n/index.d.ts +6 -0
  38. package/dist/types/i18n/index.d.ts.map +1 -1
  39. package/dist/types/i18n/locales/de-formal.d.ts +293 -0
  40. package/dist/types/i18n/locales/de-formal.d.ts.map +1 -0
  41. package/dist/types/i18n/locales/de.d.ts +30 -1
  42. package/dist/types/i18n/locales/de.d.ts.map +1 -1
  43. package/dist/types/i18n/locales/en.d.ts +62 -1
  44. package/dist/types/i18n/locales/en.d.ts.map +1 -1
  45. package/dist/types/lib/refreshBootstrap.d.ts +1 -1
  46. package/dist/types/lib/refreshBootstrap.d.ts.map +1 -1
  47. package/dist/types/lib/userToken.d.ts +49 -0
  48. package/dist/types/lib/userToken.d.ts.map +1 -0
  49. package/dist/types/lib/widget-config.d.ts +19 -1
  50. package/dist/types/lib/widget-config.d.ts.map +1 -1
  51. package/dist/types/lib/widgetBootstrap.d.ts +19 -2
  52. package/dist/types/lib/widgetBootstrap.d.ts.map +1 -1
  53. package/dist/types/module/screens/ScreenRouter.d.ts +5 -1
  54. package/dist/types/module/screens/ScreenRouter.d.ts.map +1 -1
  55. package/dist/types/module/screens/screens.state.d.ts +5 -1
  56. package/dist/types/module/screens/screens.state.d.ts.map +1 -1
  57. package/dist/types/module/shell/WidgetShell.d.ts.map +1 -1
  58. package/dist/types/module/shell/hooks/useBootstrap.d.ts +3 -1
  59. package/dist/types/module/shell/hooks/useBootstrap.d.ts.map +1 -1
  60. package/dist/types/module/shell/mount.d.ts.map +1 -1
  61. package/dist/types/module/shell/shell.state.d.ts +18 -1
  62. package/dist/types/module/shell/shell.state.d.ts.map +1 -1
  63. package/dist/types/module/shell/widget-instance.d.ts.map +1 -1
  64. package/dist/types/module/visitor/idle-lock.d.ts +6 -0
  65. package/dist/types/module/visitor/idle-lock.d.ts.map +1 -1
  66. package/dist/types/module/visitor/visitor.state.d.ts +17 -0
  67. package/dist/types/module/visitor/visitor.state.d.ts.map +1 -1
  68. package/dist/types/types.d.ts +25 -0
  69. package/dist/types/types.d.ts.map +1 -1
  70. package/dist/widget.js +38 -38
  71. package/dist/widget.js.map +1 -1
  72. package/package.json +3 -3
package/README.md CHANGED
@@ -76,6 +76,7 @@ function HomePage() {
76
76
  | `locale` | `string` | browser / `'de'` | Force locale (`'de'` \| `'en'`). Overrides browser detection |
77
77
  | `parentOrigin` | `string` | `window.location.origin` | Trusted origin for postMessage dashboard preview updates |
78
78
  | `theme` | `JexityTheme` | — | Granular per-element color overrides (see below) |
79
+ | `userToken` | `string \| () => string \| Promise<string>` | — | A signed-in user's pass: an HS256 JWT your **server** signs with the project's sign-in key (`sub`, optional `name`, `email`, `account_id`, `iat`, `exp` ≤ 24 h). A function is called on every bootstrap, including the hourly refresh. A refused pass stops the widget; it never falls back to anonymous. Script tag: `data-user-token`. A pass for another user (a changed attribute or string prop) starts over; with a function, call `logout()` at sign-out. See the help center: *Recognize signed-in users*. |
79
80
 
80
81
  ### Granular Theme Overrides
81
82
 
@@ -118,11 +119,17 @@ const chat = JexityChat(options)
118
119
  chat.open() // Open the chat window
119
120
  chat.close() // Close the chat window
120
121
  chat.toggle() // Toggle open/closed
122
+ chat.ask("How do I crawl?") // Open the chat and send this question
121
123
  chat.shutdown() // Remove widget from DOM
124
+ chat.logout() // Signed-in user signed out: forget this tab's chats, start over with the current pass
122
125
  chat.isOpen // readonly boolean — current open state
123
126
  chat.subscribe(cb) // Subscribe to open/close changes
124
127
  // Returns unsubscribe function
125
128
 
129
+ // Your user signed out, also before the chat has loaded on this page:
130
+ import { logout } from "@evelan/jexity-widget" // or "@evelan/jexity-widget/react"
131
+ logout() // Forget this tab's chats
132
+
126
133
  // IIFE global (script tag):
127
134
  window.JexityChat.open()
128
135
  window.JexityChat.close()