@giovchat/react-native 0.2.0 → 0.3.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 +66 -9
- package/dist/GiovChat.d.ts +35 -0
- package/dist/GiovChat.d.ts.map +1 -1
- package/dist/GiovChat.js +45 -8
- package/dist/GiovChat.js.map +1 -1
- package/dist/brandingStyle.d.ts +38 -0
- package/dist/brandingStyle.d.ts.map +1 -0
- package/dist/brandingStyle.js +71 -0
- package/dist/brandingStyle.js.map +1 -0
- package/dist/client.d.ts +38 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +91 -1
- package/dist/client.js.map +1 -1
- package/dist/components/Branding.d.ts +24 -1
- package/dist/components/Branding.d.ts.map +1 -1
- package/dist/components/Branding.js +49 -6
- package/dist/components/Branding.js.map +1 -1
- package/dist/components/MessageBubble.d.ts +8 -1
- package/dist/components/MessageBubble.d.ts.map +1 -1
- package/dist/components/MessageBubble.js +19 -17
- package/dist/components/MessageBubble.js.map +1 -1
- package/dist/components/RatingCard.d.ts +23 -0
- package/dist/components/RatingCard.d.ts.map +1 -0
- package/dist/components/RatingCard.js +107 -0
- package/dist/components/RatingCard.js.map +1 -0
- package/dist/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/i18n.d.ts +23 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +100 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +5 -0
- package/dist/protocol.js.map +1 -1
- package/dist/rating.d.ts +41 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +165 -0
- package/dist/rating.js.map +1 -0
- package/dist/ratingStore.d.ts +36 -0
- package/dist/ratingStore.d.ts.map +1 -0
- package/dist/ratingStore.js +55 -0
- package/dist/ratingStore.js.map +1 -0
- package/dist/styleOverrides.d.ts +10 -2
- package/dist/styleOverrides.d.ts.map +1 -1
- package/dist/styleOverrides.js +9 -0
- package/dist/styleOverrides.js.map +1 -1
- package/dist/types.d.ts +45 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/useChatSession.d.ts +18 -1
- package/dist/useChatSession.d.ts.map +1 -1
- package/dist/useChatSession.js +178 -9
- package/dist/useChatSession.js.map +1 -1
- package/package.json +3 -2
- package/src/GiovChat.tsx +121 -11
- package/src/brandingStyle.ts +87 -0
- package/src/client.ts +92 -2
- package/src/components/Branding.tsx +66 -7
- package/src/components/MessageBubble.tsx +17 -1
- package/src/components/RatingCard.tsx +219 -0
- package/src/errors.ts +4 -1
- package/src/i18n.ts +123 -0
- package/src/index.ts +17 -0
- package/src/protocol.ts +5 -0
- package/src/rating.ts +169 -0
- package/src/ratingStore.ts +65 -0
- package/src/styleOverrides.ts +15 -2
- package/src/types.ts +51 -0
- package/src/useChatSession.ts +152 -6
package/README.md
CHANGED
|
@@ -217,7 +217,7 @@ Any string can be replaced through `strings`; see `GiovChatStrings` for the keys
|
|
|
217
217
|
|
|
218
218
|
- **Theme:** the dashboard setting (`light`, `dark`, `auto`) applies; `auto` follows the device. Override it with `theme`.
|
|
219
219
|
- **Colour:** the dashboard's primary colour applies; override it with `primaryColor`.
|
|
220
|
-
- **Fonts and colours of each surface:** `styleOverrides`.
|
|
220
|
+
- **Fonts and colours of each surface:** `styleOverrides`. A slot you leave out keeps the SDK's themed default.
|
|
221
221
|
|
|
222
222
|
```tsx
|
|
223
223
|
import { GiovChat, type GiovChatStyleOverrides } from "@giovchat/react-native";
|
|
@@ -236,6 +236,7 @@ const chatStyles = {
|
|
|
236
236
|
input: { backgroundColor: "#ffffff", color: "#0f172a" },
|
|
237
237
|
button: { backgroundColor: "#2563eb" },
|
|
238
238
|
buttonText: { color: "#ffffff" },
|
|
239
|
+
branding: { backgroundColor: "#f8fafc", color: "#334155", brandColor: "#1d4ed8" },
|
|
239
240
|
} satisfies GiovChatStyleOverrides;
|
|
240
241
|
|
|
241
242
|
<GiovChat tenantKey="YOUR_TENANT_KEY" styleOverrides={chatStyles} />;
|
|
@@ -250,12 +251,60 @@ const chatStyles = {
|
|
|
250
251
|
| `agentText`, `visitorText` | Same text properties | Message content (every formatted run), sender labels and timestamps; agent text also covers greeting and typing |
|
|
251
252
|
| `formTitle`, `label`, `buttonText`, `hint`, `errorText` | Same text properties | Form heading and labels, button text, loading hint, attachment chips, errors; hint colour also controls input placeholders |
|
|
252
253
|
| `input` | Text properties plus `backgroundColor` | Composer and all pre-chat inputs |
|
|
254
|
+
| `branding` | `fontFamily`, `color`, `brandColor`, `backgroundColor` | The "Powered by GiovChat" footer: its font, "Powered by" colour, "GiovChat" link colour and background |
|
|
253
255
|
|
|
254
|
-
The top-level `fontFamily` is the default for customizable text; a slot's `fontFamily` takes precedence. Colours
|
|
256
|
+
The top-level `fontFamily` is the default for every customizable text slot and the footer; a slot's own `fontFamily` takes precedence. `fontWeight` is `normal`, `bold` or `100` to `900`; `fontStyle` is `normal` or `italic`. Colours are `#rgb`, `#rrggbb`, `rgb()` or `rgba()` strings (the footer needs these forms, see below); use readable foreground/background combinations. Registered style IDs, style arrays, unsupported slots and unsupported properties are ignored at runtime, including for JavaScript callers. Font sizes, spacing, dimensions, borders, positioning, visibility and opacity remain SDK-controlled.
|
|
255
257
|
|
|
256
|
-
###
|
|
258
|
+
### The footer and plans
|
|
257
259
|
|
|
258
|
-
The
|
|
260
|
+
The **Powered by GiovChat** footer follows your app's style but stays on. The top-level `fontFamily` and the `branding` slot apply to it; its layout, size (12 pt) and text are fixed, and it cannot be hidden with a style. Contrast is enforced: "Powered by" and "GiovChat" must each reach 4.5:1 (WCAG AA) against the footer background. An override that is transparent or has any alpha below 1, is not a hex/`rgb()` colour (named colours cannot be checked), or fails the ratio is ignored for that property: the SDK default is used (`#52525b` text, `#7c3aed` link on `#ffffff`; black or white when the default is unreadable on your own background) and a warning is logged in development.
|
|
261
|
+
|
|
262
|
+
Removal is a plan feature. The widget reads `showBranding` from the server's `/widget/config` response: Starter and Pro always show the footer; Business and Advanced can remove it in **Settings > Chat widget > Appearance**. It stays visible when the field is missing or configuration cannot be loaded; only an explicit server `false` hides it.
|
|
263
|
+
|
|
264
|
+
## Build your own UI
|
|
265
|
+
|
|
266
|
+
Use the headless client when the built-in screen does not fit your design. See **Headless usage** below. If you build your own screen, show the footer when the workspace's `showBranding` is true (Starter and Pro workspaces): `<GiovBranding />` reads the setting and takes the same style overrides. This is a plan term we cannot enforce in code.
|
|
267
|
+
|
|
268
|
+
```tsx
|
|
269
|
+
import { GiovBranding } from "@giovchat/react-native";
|
|
270
|
+
|
|
271
|
+
// With a config you already fetched:
|
|
272
|
+
<GiovBranding showBranding={config.showBranding} styleOverrides={{ fontFamily: "YourAppFont", branding: { backgroundColor: "#f8fafc" } }} />
|
|
273
|
+
// Or let it read the workspace config (renders nothing when the plan removed branding):
|
|
274
|
+
<GiovBranding tenantKey="YOUR_TENANT_KEY" />
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## Ratings and answer feedback
|
|
278
|
+
|
|
279
|
+
When the team (or GiovBot, or the workspace's "ask for a rating when a conversation is closed" setting) asks the visitor to rate the conversation, the chat draws a **rating card** under that message: five faces (Very bad to Great, each with an accessibility label), an optional comment (up to 1,000 characters) and **Send**. After the answer the card shows **Thanks** and the chosen face; the visitor can change it until the server's deadline (`closesAt`), after which the card is read-only. A card the team replaced draws nothing. Under every finished GiovBot answer the chat also shows thumbs up and down; a thumbs-down offers an optional reason (up to 300 characters). Against a server without these routes the thumbs disappear and no card ever arrives. Everything is translated in the five shipped languages (`strings` overrides: `rateTitle`, `ratingFace`, `ratingSend`, `ratingThanks`, `answerGood`, `answerBad`, ...).
|
|
280
|
+
|
|
281
|
+
Nothing to set up. To take control:
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
import { GiovChat, useGiovRating, type GiovChatHandle } from "@giovchat/react-native";
|
|
285
|
+
|
|
286
|
+
// Your own prompt: turn the built-in card off and read/answer the request yourself.
|
|
287
|
+
const chat = useRef<GiovChatHandle>(null);
|
|
288
|
+
<GiovChat ref={chat} tenantKey="YOUR_TENANT_KEY" ratingCard={false} answerFeedback={false}
|
|
289
|
+
onRatingRequested={(request) => showMyBanner(request.requestId, request.closesAt)}
|
|
290
|
+
onRatingSubmitted={(result) => console.log(result.score)}
|
|
291
|
+
onAnswerFeedback={({ messageId, value, reason }) => track(messageId, value, reason)} />;
|
|
292
|
+
|
|
293
|
+
function RateButton() {
|
|
294
|
+
const rating = useGiovRating(); // { request, supported, submit, submitFeedback, show }
|
|
295
|
+
if (!rating.request) return null; // nothing to rate right now
|
|
296
|
+
return <Button title={rating.request.answered ? "Change my rating" : "Rate us"} onPress={rating.show} />; // opens the built-in sheet
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
await chat.current?.submitRating(5, { comment: "Quick answer" }); // headless; requestId defaults to the open card
|
|
300
|
+
await chat.current?.submitAnswerFeedback(messageId, "down", { reason: "Wrong date" });
|
|
301
|
+
chat.current?.getRatingRequest(); // { requestId, messageId, closesAt, answered, score?, comment? } | null
|
|
302
|
+
chat.current?.showRating(); // the built-in sheet; false when there is no card
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
`submitRating` and `submitAnswerFeedback` reject with a `GiovChatError` whose `code` is one of `invalid_rating`, `invalid_feedback`, `request_not_found`, `message_not_found`, `request_replaced`, `rating_closed`, `too_many_changes` (at most 20 changes), `rate_limited` (wait `retryAfterSeconds`), `invalid_session`, or `unsupported` (an older server). The rating sheet is its own `Modal`, so it also opens while the chat is hidden (the chat must be connected: mounted with `visible` or `keepConnected`). When the team closes the conversation it stays on screen read-only (history visible, a rating card still answerable, the composer replaced by **Start a new conversation**); the card sent on close therefore renders even after the close. A card's optional hosted-page `url` is never needed: the SDK answers with the visitor token.
|
|
306
|
+
|
|
307
|
+
Headless clients use `ChatClient.submitRating`, `ChatClient.submitAnswerFeedback` and `ChatClient.onRating(frame)` (the socket frame that patches a card live, or announces its replacement), plus `parseRatingFrame`, `patchRating`, `supersedeRatings` and `pendingRatingRequest` for the state.
|
|
259
308
|
|
|
260
309
|
## Props
|
|
261
310
|
|
|
@@ -271,7 +320,7 @@ The widget reads `showBranding` from the server's `/widget/config` response. Sta
|
|
|
271
320
|
| `baseUrl` | `string` | `https://api.giovchat.app` | API base URL override |
|
|
272
321
|
| `primaryColor` | `string` | From dashboard | Brand colour override |
|
|
273
322
|
| `theme` | `"light" \| "dark" \| "auto"` | From dashboard | Theme override; `auto` follows the device |
|
|
274
|
-
| `styleOverrides` | `GiovChatStyleOverrides` | none | Allowlisted font and colour overrides |
|
|
323
|
+
| `styleOverrides` | `GiovChatStyleOverrides` | none | Allowlisted font and colour overrides, including the `branding` footer slot |
|
|
275
324
|
| `locale` | `string` | Device language | Interface language |
|
|
276
325
|
| `strings` | `Partial<GiovChatStrings>` | none | Replace any interface string |
|
|
277
326
|
| `attachmentPicker` | `GiovChatAttachmentPicker` | none | Enables attachments (when the agent allows them) |
|
|
@@ -280,14 +329,19 @@ The widget reads `showBranding` from the server's `/widget/config` response. Sta
|
|
|
280
329
|
| `onConversationStart` | `(id: string) => void` | — | Called once with the conversation ID |
|
|
281
330
|
| `onError` | `(error: GiovChatError) => void` | — | Every failure, with a `code` |
|
|
282
331
|
| `onConnectionStatusChange` | `(status) => void` | — | `"connecting" \| "connected" \| "disconnected"` |
|
|
332
|
+
| `ratingCard` | `boolean` | `true` | Draw the conversation rating card |
|
|
333
|
+
| `answerFeedback` | `boolean` | `true` | Thumbs under GiovBot answers |
|
|
334
|
+
| `onRatingRequested` | `(request) => void` | — | A rating card the visitor has not answered arrived |
|
|
335
|
+
| `onRatingSubmitted` | `(result) => void` | — | The rating was stored |
|
|
336
|
+
| `onAnswerFeedback` | `(feedback) => void` | — | A thumb was stored |
|
|
283
337
|
|
|
284
|
-
`ref` (`GiovChatHandle`): `reset()` clears this identity's session and starts fresh; `registerPushToken(token, platform, options?)` and `unregisterPushToken(token)` manage push (see above).
|
|
338
|
+
`ref` (`GiovChatHandle`): `reset()` clears this identity's session and starts fresh; `registerPushToken(token, platform, options?)` and `unregisterPushToken(token)` manage push (see above); `submitRating`, `submitAnswerFeedback`, `getRatingRequest` and `showRating` handle ratings (see "Ratings and answer feedback").
|
|
285
339
|
|
|
286
|
-
`onError` codes: `network`, `timeout`, `invalid_response`, `invalid_session` (the stored session is gone), `conversation_closed`, `connection_failed`, `disconnected`, `send_failed`, `upload_failed`, `workspace_busy`, `identity_rejected` (the workspace requires a signed identity and `userHash` is wrong or missing), `storage`, `server`, `rate_limited` (with `retryAfterSeconds`)
|
|
340
|
+
`onError` codes: `network`, `timeout`, `invalid_response`, `invalid_session` (the stored session is gone), `conversation_closed`, `connection_failed`, `disconnected`, `send_failed`, `upload_failed`, `workspace_busy`, `identity_rejected` (the workspace requires a signed identity and `userHash` is wrong or missing), `storage`, `server`, `rate_limited` (with `retryAfterSeconds`); the rating calls add `unsupported`, `invalid_rating`, `invalid_feedback`, `request_not_found`, `message_not_found`, `request_replaced`, `rating_closed` and `too_many_changes`.
|
|
287
341
|
|
|
288
342
|
## Headless usage
|
|
289
343
|
|
|
290
|
-
For a fully custom UI, the transport and helpers are exported. `ChatClient` owns the WebSocket; pass it an `Outbox` that outlives it if you reconnect with new clients.
|
|
344
|
+
For a fully custom UI (`config.showBranding`, `config.primaryColor`, `config.title` come from `fetchWidgetConfig`; `GiovChatError.code` tells why a call failed), the transport and helpers are exported. `ChatClient` owns the WebSocket; pass it an `Outbox` that outlives it if you reconnect with new clients.
|
|
291
345
|
|
|
292
346
|
```ts
|
|
293
347
|
import { ChatClient, Outbox, createConversation, fetchConversationHistory, fetchWidgetConfig, DEFAULT_BASE_URL } from "@giovchat/react-native";
|
|
@@ -313,13 +367,16 @@ client.sendTyping(); client.sendTypingEnd();
|
|
|
313
367
|
const upload = await client.uploadAttachment({ uri, name, type }, (progress) => {});
|
|
314
368
|
client.send("", [upload.url]);
|
|
315
369
|
client.retryMessage(failedId);
|
|
370
|
+
await client.submitRating(5, { comment: "Great help" }); // answers the open rating card (1 to 5)
|
|
371
|
+
await client.submitAnswerFeedback(messageId, "up"); // thumbs on a GiovBot answer: "up" | "down" | "none"
|
|
316
372
|
client.disconnect();
|
|
317
373
|
```
|
|
318
374
|
|
|
375
|
+
- `client.onConversationState(cb)` reports the team closing or reopening the conversation (`status: "open" | "closed"`; absent on older servers, where the history's `closed` decides).
|
|
319
376
|
- `parseChatMarkdown(text)` returns the formatted tree the built-in UI renders.
|
|
320
377
|
- `headerIdentity(config, agentName, agentAvatar)` gives the header rule.
|
|
321
378
|
- On typing: `isBot` is `true` for AI, `false` for a person and `undefined` for an older sender. Never infer AI typing from `config.botEnabled`.
|
|
322
|
-
-
|
|
379
|
+
- Show `<GiovBranding />` (or your own footer) when `config.showBranding` is true; see **Build your own UI**.
|
|
323
380
|
|
|
324
381
|
## Upgrading from 0.1
|
|
325
382
|
|
package/dist/GiovChat.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { type GiovChatStyleOverrides } from "./styleOverrides";
|
|
|
5
5
|
import { type GiovChatStrings } from "./i18n";
|
|
6
6
|
import { type GiovChatAttachmentPicker } from "./attachments";
|
|
7
7
|
import type { GiovPushOptions, GiovPushPlatform, GiovPushRegistration } from "./client";
|
|
8
|
+
import type { GiovAnswerFeedback, GiovFeedbackValue, GiovRatingRequest, GiovRatingResult } from "./types";
|
|
8
9
|
export interface GiovChatProps {
|
|
9
10
|
/**
|
|
10
11
|
* Tenant key from your agent dashboard.
|
|
@@ -73,8 +74,42 @@ export interface GiovChatProps {
|
|
|
73
74
|
sessionStorage?: GiovChatSessionStorage;
|
|
74
75
|
onError?: (error: GiovChatError) => void;
|
|
75
76
|
onConnectionStatusChange?: (status: GiovChatConnectionStatus) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Draw the conversation rating card ("How did we do?") in the chat. Turn it off to build your own with
|
|
79
|
+
* `useGiovRating()` or the handle (`submitRating`, `showRating`).
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
ratingCard?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Thumbs under GiovBot answers (hidden on servers without them).
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
answerFeedback?: boolean;
|
|
88
|
+
/** The team or GiovBot asked the visitor to rate the conversation (once per card, live or from history). */
|
|
89
|
+
onRatingRequested?: (request: GiovRatingRequest) => void;
|
|
90
|
+
/** The visitor's rating was stored. */
|
|
91
|
+
onRatingSubmitted?: (result: GiovRatingResult) => void;
|
|
92
|
+
/** The visitor's vote on a GiovBot answer was stored. */
|
|
93
|
+
onAnswerFeedback?: (feedback: GiovAnswerFeedback) => void;
|
|
76
94
|
}
|
|
77
95
|
export interface GiovChatHandle {
|
|
96
|
+
/**
|
|
97
|
+
* Rates the conversation (`requestId` defaults to the open card). Rejects with a `GiovChatError`
|
|
98
|
+
* (`rating_closed`, `request_replaced`, `too_many_changes`, `invalid_rating`, `rate_limited` with
|
|
99
|
+
* `retryAfterSeconds`, `unsupported` on an older server).
|
|
100
|
+
*/
|
|
101
|
+
submitRating(score: number, options?: {
|
|
102
|
+
comment?: string;
|
|
103
|
+
requestId?: string;
|
|
104
|
+
}): Promise<GiovRatingResult>;
|
|
105
|
+
/** Thumbs up or down (with an optional reason for down) on a GiovBot answer; `none` takes the vote back. */
|
|
106
|
+
submitAnswerFeedback(messageId: string, value: GiovFeedbackValue, options?: {
|
|
107
|
+
reason?: string;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
/** The rating card the visitor can answer or change now, or null. */
|
|
110
|
+
getRatingRequest(): GiovRatingRequest | null;
|
|
111
|
+
/** Opens the built-in rating sheet for the open card, over the chat or on its own. False when there is no card. */
|
|
112
|
+
showRating(): boolean;
|
|
78
113
|
/** Clears this identity's stored session and starts fresh if the chat is visible. */
|
|
79
114
|
reset(): Promise<void>;
|
|
80
115
|
/**
|
package/dist/GiovChat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiovChat.d.ts","sourceRoot":"","sources":["../src/GiovChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiF,MAAM,OAAO,CAAC;AAgBtG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ9C,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,sBAAsB,EAAe,MAAM,SAAS,CAAC;AAE9G,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGtF,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAKtF,OAAO,EAKL,KAAK,wBAAwB,EAE9B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"GiovChat.d.ts","sourceRoot":"","sources":["../src/GiovChat.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiF,MAAM,OAAO,CAAC;AAgBtG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ9C,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,sBAAsB,EAAe,MAAM,SAAS,CAAC;AAE9G,OAAO,EAAyB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAGtF,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAKtF,OAAO,EAKL,KAAK,wBAAwB,EAE9B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAIxF,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAI1G,MAAM,WAAW,aAAa;IAC5B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");
|
|
51
51
|
const attachments_1 = require("./attachments");
|
|
52
52
|
const unread_1 = require("./unread");
|
|
53
|
+
const RatingCard_1 = require("./components/RatingCard");
|
|
54
|
+
const ratingStore_1 = require("./ratingStore");
|
|
53
55
|
// ─── Component ───────────────────────────────────────────────────────────────
|
|
54
56
|
exports.GiovChat = react_1.default.forwardRef(function GiovChat(props, ref) {
|
|
55
57
|
const scope = (0, useChatSession_1.sessionScope)(props.baseUrl ?? "https://api.giovchat.app", props.tenantKey, props.contact, props.sessionKey);
|
|
@@ -75,7 +77,7 @@ function problemText(problem, strings) {
|
|
|
75
77
|
case "count": return strings.tooManyFiles(problem.max);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({ tenantKey, mode = "modal", visible = true, onClose, contact, baseUrl = "https://api.giovchat.app", primaryColor: overridePrimaryColor, theme: themeOverride, styleOverrides, locale, strings: stringOverrides, attachmentPicker, keepConnected, onUnreadCountChange, onConversationStart, sessionKey, sessionStorage, onError, onConnectionStatusChange, }, ref) {
|
|
80
|
+
const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({ tenantKey, mode = "modal", visible = true, onClose, contact, baseUrl = "https://api.giovchat.app", primaryColor: overridePrimaryColor, theme: themeOverride, styleOverrides, locale, strings: stringOverrides, attachmentPicker, keepConnected, onUnreadCountChange, onConversationStart, sessionKey, sessionStorage, onError, onConnectionStatusChange, ratingCard = true, answerFeedback = true, onRatingRequested, onRatingSubmitted, onAnswerFeedback, }, ref) {
|
|
79
81
|
const systemScheme = (0, react_native_1.useColorScheme)();
|
|
80
82
|
const custom = (0, react_1.useMemo)(() => (0, styleOverrides_1.resolveStyleOverrides)(styleOverrides), [styleOverrides]);
|
|
81
83
|
const strings = (0, react_1.useMemo)(() => (0, i18n_1.resolveStrings)(locale, stringOverrides), [locale, stringOverrides]);
|
|
@@ -83,18 +85,38 @@ const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({
|
|
|
83
85
|
const chat = (0, useChatSession_1.useChatSession)({
|
|
84
86
|
tenantKey, baseUrl, visible, contact, scope, sessionKey, sessionStorage, keepConnected,
|
|
85
87
|
onError, onConnectionStatusChange, onConversationStart, onUnreadCountChange,
|
|
88
|
+
onRatingRequested, onRatingSubmitted, onAnswerFeedback,
|
|
86
89
|
});
|
|
87
90
|
const { phase, config, messages, agentTyping, agentTypingIsBot, error, sending, uploads, requiredFields, retry, reset, submitContact, send } = chat;
|
|
88
91
|
const [input, setInput] = (0, react_1.useState)("");
|
|
89
92
|
const [files, setFiles] = (0, react_1.useState)([]);
|
|
90
93
|
const [fileProblem, setFileProblem] = (0, react_1.useState)(null);
|
|
94
|
+
const [sheetOpen, setSheetOpen] = (0, react_1.useState)(false);
|
|
91
95
|
const listRef = (0, react_1.useRef)(null);
|
|
92
96
|
const unreadOwner = (0, react_1.useRef)(Symbol("giovchat-unread"));
|
|
97
|
+
// The calls below read the latest state through a ref, so the handle and the hook entry stay stable.
|
|
98
|
+
const live = (0, react_1.useRef)(chat);
|
|
99
|
+
live.current = chat;
|
|
100
|
+
const ratingCalls = (0, react_1.useMemo)(() => ({
|
|
101
|
+
submit: (score, options) => live.current.submitRating(score, options),
|
|
102
|
+
submitFeedback: (messageId, value, options) => live.current.submitAnswerFeedback(messageId, value, options),
|
|
103
|
+
show: () => { if (!live.current.ratingRequest)
|
|
104
|
+
return false; setSheetOpen(true); return true; },
|
|
105
|
+
}), []);
|
|
106
|
+
const ratingOwner = (0, react_1.useRef)(Symbol("giovchat-rating"));
|
|
107
|
+
(0, react_1.useEffect)(() => {
|
|
108
|
+
(0, ratingStore_1.publishRating)(ratingOwner.current, tenantKey, { request: chat.ratingRequest, supported: chat.ratingsSupported, ...ratingCalls });
|
|
109
|
+
}, [tenantKey, chat.ratingRequest, chat.ratingsSupported, ratingCalls]);
|
|
110
|
+
(0, react_1.useEffect)(() => () => (0, ratingStore_1.forgetRating)(ratingOwner.current), []);
|
|
93
111
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
112
|
+
submitRating: ratingCalls.submit,
|
|
113
|
+
submitAnswerFeedback: ratingCalls.submitFeedback,
|
|
114
|
+
getRatingRequest: () => live.current.ratingRequest,
|
|
115
|
+
showRating: ratingCalls.show,
|
|
94
116
|
reset: async () => { setInput(""); setFiles([]); await reset(); },
|
|
95
117
|
registerPushToken: (token, platform, options) => chat.registerPushToken(token, platform, { ...(locale ? { locale } : {}), ...options }),
|
|
96
118
|
unregisterPushToken: chat.unregisterPushToken,
|
|
97
|
-
}), [reset, chat.registerPushToken, chat.unregisterPushToken, locale]);
|
|
119
|
+
}), [reset, chat.registerPushToken, chat.unregisterPushToken, locale, ratingCalls]);
|
|
98
120
|
(0, react_1.useEffect)(() => {
|
|
99
121
|
const timer = setTimeout(() => listRef.current?.scrollToEnd({ animated: true }), 80);
|
|
100
122
|
return () => clearTimeout(timer);
|
|
@@ -119,7 +141,7 @@ const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({
|
|
|
119
141
|
const handleClose = (0, react_1.useCallback)(() => onClose?.(), [onClose]);
|
|
120
142
|
const policy = config?.attachments ?? attachments_1.DEFAULT_ATTACHMENT_POLICY;
|
|
121
143
|
// Uploads need a conversation: the first message starts it, then files can follow.
|
|
122
|
-
const canAttach = !!attachmentPicker && chat.hasConversation && policy.enabled && policy.allowedTypes.length > 0;
|
|
144
|
+
const canAttach = !!attachmentPicker && chat.hasConversation && !chat.closed && policy.enabled && policy.allowedTypes.length > 0;
|
|
123
145
|
const composing = phase === "ready" || phase === "connecting" || phase === "active";
|
|
124
146
|
const canSend = composing && !sending && (!!input.trim() || files.length > 0);
|
|
125
147
|
const handleSend = async () => {
|
|
@@ -147,6 +169,14 @@ const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({
|
|
|
147
169
|
}
|
|
148
170
|
catch { /* The picker was dismissed or failed; nothing changes. */ }
|
|
149
171
|
};
|
|
172
|
+
const onRateCard = (0, react_1.useCallback)(async (requestId, score, comment) => {
|
|
173
|
+
await live.current.submitRating(score, { requestId, comment });
|
|
174
|
+
}, []);
|
|
175
|
+
const onVote = (0, react_1.useCallback)((messageId, value, reason) => live.current.submitAnswerFeedback(messageId, value, { reason }), []);
|
|
176
|
+
const sheetMessage = sheetOpen && chat.ratingRequest ? messages.find((message) => message.id === chat.ratingRequest?.messageId) : undefined;
|
|
177
|
+
// The sheet closes by itself once there is no card to show (answered cards stay until dismissed).
|
|
178
|
+
(0, react_1.useEffect)(() => { if (sheetOpen && !chat.ratingRequest)
|
|
179
|
+
setSheetOpen(false); }, [sheetOpen, chat.ratingRequest]);
|
|
150
180
|
const identity = config ? (0, identity_1.headerIdentity)(config, chat.currentAgentName, chat.currentAgentAvatar) : null;
|
|
151
181
|
const subtitle = phase === "active" || phase === "ready"
|
|
152
182
|
? identity?.kind === "person" ? strings.statusPerson : identity?.kind === "bot" ? strings.statusBot : strings.statusTeam
|
|
@@ -156,10 +186,10 @@ const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({
|
|
|
156
186
|
// Black or white on the buttons' colour, by WCAG contrast.
|
|
157
187
|
const buttonInk = (0, color_1.textOn)(custom.button.backgroundColor ?? primaryColor);
|
|
158
188
|
// ── Render ───────────────────────────────────────────────────────────────────
|
|
159
|
-
const chatContent = ((0, jsx_runtime_1.jsx)(i18n_1.GiovChatStringsContext.Provider, { value: strings, children: (0, jsx_runtime_1.jsx)(WidgetStyles_1.WidgetStylesContext.Provider, { value: custom, children: (0, jsx_runtime_1.jsxs)(react_native_safe_area_context_1.SafeAreaView, { style: [styles.safeArea, { backgroundColor: bgColor }, custom.container], children: [(0, jsx_runtime_1.jsx)(components_1.Header, { privacyPolicyUrl: config?.privacyPolicyUrl, title: identity?.title ?? config?.title ?? "Chat", subtitle: subtitle, primaryColor: primaryColor, avatarUrl: identity?.avatar, kind: identity?.kind, onClose: showClose ? handleClose : undefined }), (phase === "loading" || phase === "idle") && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.centered, children: [(0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "large", color: primaryColor }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.hint, { color: isDark ? "#555" : "#aaa" }, custom.hint], children: strings.loading })] })), phase === "error" && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.centered, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.errorText, custom.errorText], children: error ? errorText(error, strings) : strings.unavailable }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles.retryBtn, { backgroundColor: primaryColor }, custom.button], onPress: retry, accessibilityRole: "button", accessibilityLabel: strings.retry, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.retryBtnText, { color: buttonInk }, custom.buttonText], children: strings.tryAgain }) })] })), phase === "pre-chat" && config?.requestUserInfo && ((0, jsx_runtime_1.jsx)(components_1.PreChatForm, { fields: requiredFields, primaryColor: primaryColor, dark: isDark, initialValues: contact, onSubmit: submitContact })), composing && ((0, jsx_runtime_1.jsxs)(react_native_1.KeyboardAvoidingView, { style: styles.flex, behavior: react_native_1.Platform.OS === "ios" ? "padding" : "height", children: [error && ((0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "alert", style: [styles.errorText, { padding: 10 }, custom.errorText], children: errorText(error, strings) })), (0, jsx_runtime_1.jsx)(react_native_1.FlatList, { ref: listRef, data: messages, keyExtractor: (item) => item.clientMessageId ?? item.id, contentContainerStyle: styles.listContent, ListHeaderComponent: config ? ((0, jsx_runtime_1.jsx)(components_1.GreetingBubble, { text: config.greetingText, dark: isDark })) : null, ListFooterComponent: agentTyping ? (0, jsx_runtime_1.jsx)(components_1.TypingIndicator, { dark: isDark, isBot: agentTypingIsBot, botName: config?.botName }) : null, renderItem: ({ item }) => ((0, jsx_runtime_1.jsx)(components_1.MessageBubble, { message: item, primaryColor: primaryColor, dark: isDark, botName: config?.botName, resolveAttachmentUrl: chat.attachmentUrl, onRetry: (message) => message.clientMessageId && chat.retryMessage(message.clientMessageId), onDiscard: (message) => message.clientMessageId && chat.discardMessage(message.clientMessageId) })) }), (files.length > 0 || fileProblem) && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.files, { backgroundColor: bgColor, borderTopColor: isDark ? "#1e1e1e" : "#ebebeb" }], children: [fileProblem && (0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "alert", style: [styles.fileProblem, custom.errorText], children: fileProblem }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.fileChips, children: files.map((file, index) => {
|
|
189
|
+
const chatContent = ((0, jsx_runtime_1.jsx)(i18n_1.GiovChatStringsContext.Provider, { value: strings, children: (0, jsx_runtime_1.jsx)(WidgetStyles_1.WidgetStylesContext.Provider, { value: custom, children: (0, jsx_runtime_1.jsxs)(react_native_safe_area_context_1.SafeAreaView, { style: [styles.safeArea, { backgroundColor: bgColor }, custom.container], children: [(0, jsx_runtime_1.jsx)(components_1.Header, { privacyPolicyUrl: config?.privacyPolicyUrl, title: identity?.title ?? config?.title ?? "Chat", subtitle: subtitle, primaryColor: primaryColor, avatarUrl: identity?.avatar, kind: identity?.kind, onClose: showClose ? handleClose : undefined }), (phase === "loading" || phase === "idle") && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.centered, children: [(0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "large", color: primaryColor }), (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.hint, { color: isDark ? "#555" : "#aaa" }, custom.hint], children: strings.loading })] })), phase === "error" && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.centered, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.errorText, custom.errorText], children: error ? errorText(error, strings) : strings.unavailable }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [styles.retryBtn, { backgroundColor: primaryColor }, custom.button], onPress: retry, accessibilityRole: "button", accessibilityLabel: strings.retry, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.retryBtnText, { color: buttonInk }, custom.buttonText], children: strings.tryAgain }) })] })), phase === "pre-chat" && config?.requestUserInfo && ((0, jsx_runtime_1.jsx)(components_1.PreChatForm, { fields: requiredFields, primaryColor: primaryColor, dark: isDark, initialValues: contact, onSubmit: submitContact })), composing && ((0, jsx_runtime_1.jsxs)(react_native_1.KeyboardAvoidingView, { style: styles.flex, behavior: react_native_1.Platform.OS === "ios" ? "padding" : "height", children: [error && ((0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "alert", style: [styles.errorText, { padding: 10 }, custom.errorText], children: errorText(error, strings) })), (0, jsx_runtime_1.jsx)(react_native_1.FlatList, { ref: listRef, data: messages, keyExtractor: (item) => item.clientMessageId ?? item.id, contentContainerStyle: styles.listContent, ListHeaderComponent: config ? ((0, jsx_runtime_1.jsx)(components_1.GreetingBubble, { text: config.greetingText, dark: isDark })) : null, ListFooterComponent: agentTyping ? (0, jsx_runtime_1.jsx)(components_1.TypingIndicator, { dark: isDark, isBot: agentTypingIsBot, botName: config?.botName }) : null, renderItem: ({ item }) => ((0, jsx_runtime_1.jsx)(components_1.MessageBubble, { message: item, primaryColor: primaryColor, dark: isDark, botName: config?.botName, resolveAttachmentUrl: chat.attachmentUrl, onRetry: (message) => message.clientMessageId && chat.retryMessage(message.clientMessageId), onDiscard: (message) => message.clientMessageId && chat.discardMessage(message.clientMessageId), ratingCard: ratingCard, onRate: chat.ratingsSupported ? onRateCard : undefined, onVote: answerFeedback && chat.ratingsSupported ? onVote : undefined })) }), (files.length > 0 || fileProblem) && ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.files, { backgroundColor: bgColor, borderTopColor: isDark ? "#1e1e1e" : "#ebebeb" }], children: [fileProblem && (0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "alert", style: [styles.fileProblem, custom.errorText], children: fileProblem }), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.fileChips, children: files.map((file, index) => {
|
|
160
190
|
const upload = uploads[index];
|
|
161
191
|
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.fileChip, { backgroundColor: isDark ? "#1c1c1c" : "#f2f2f2" }], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.fileChipText, { color: isDark ? "#e5e5e5" : "#222" }, custom.hint], numberOfLines: 1, children: upload ? strings.uploading(Math.round(upload.progress * 100)) : file.name }), !sending && ((0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { onPress: () => setFiles((current) => current.filter((_, i) => i !== index)), accessibilityRole: "button", accessibilityLabel: strings.removeAttachment(file.name), hitSlop: { top: 8, bottom: 8, left: 8, right: 8 }, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: isDark ? "#aaa" : "#666", fontSize: 14 }, children: "\u2715" }) }))] }, `${file.uri}-${index}`));
|
|
162
|
-
}) })] })), (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
192
|
+
}) })] })), chat.closed ? ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [styles.closedBar, { borderTopColor: isDark ? "#1e1e1e" : "#ebebeb", backgroundColor: bgColor }, custom.composer], children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.hint, { color: isDark ? "#aaa" : "#555" }, custom.hint], children: strings.conversationEnded }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { testID: "giov-new-conversation", style: [styles.retryBtn, { backgroundColor: primaryColor }, custom.button], onPress: () => { setInput(""); setFiles([]); void chat.startNew(); }, accessibilityRole: "button", accessibilityLabel: strings.startNewConversation, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.retryBtnText, { color: buttonInk }, custom.buttonText], children: strings.startNewConversation }) })] })) : ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
163
193
|
styles.composerRow,
|
|
164
194
|
{
|
|
165
195
|
borderTopColor: isDark ? "#1e1e1e" : "#ebebeb",
|
|
@@ -184,11 +214,13 @@ const GiovChatInstance = react_1.default.forwardRef(function GiovChatInstance({
|
|
|
184
214
|
{ backgroundColor: primaryColor },
|
|
185
215
|
custom.button,
|
|
186
216
|
!canSend && styles.sendBtnOff,
|
|
187
|
-
], onPress: handleSend, disabled: !canSend, accessibilityRole: "button", accessibilityLabel: strings.sendMessage, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.sendIcon, { color: buttonInk }, custom.buttonText], children: "\u2191" }) })] })] })), (0, jsx_runtime_1.jsx)(Branding_1.Branding, { showBranding: config?.showBranding })] }) }) }));
|
|
217
|
+
], onPress: handleSend, disabled: !canSend, accessibilityRole: "button", accessibilityLabel: strings.sendMessage, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [styles.sendIcon, { color: buttonInk }, custom.buttonText], children: "\u2191" }) })] }))] })), (0, jsx_runtime_1.jsx)(Branding_1.Branding, { showBranding: config?.showBranding })] }) }) }));
|
|
218
|
+
// The rating sheet is its own Modal beside the chat, so it opens even while the chat is hidden.
|
|
219
|
+
const sheet = sheetMessage?.rating ? ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: true, transparent: true, animationType: "slide", onRequestClose: () => setSheetOpen(false), children: (0, jsx_runtime_1.jsx)(i18n_1.GiovChatStringsContext.Provider, { value: strings, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.sheetScrim, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { testID: "giov-rating-sheet", accessibilityViewIsModal: true, style: [styles.sheet, { backgroundColor: bgColor }], children: [(0, jsx_runtime_1.jsxs)(react_native_1.View, { style: styles.sheetHeader, children: [(0, jsx_runtime_1.jsx)(react_native_1.Text, { accessibilityRole: "header", style: [styles.sheetTitle, { color: isDark ? "#f0f0f0" : "#111" }], children: strings.rateTitle }), (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { testID: "giov-rating-sheet-close", accessibilityRole: "button", accessibilityLabel: strings.closeRating, onPress: () => setSheetOpen(false), hitSlop: { top: 10, bottom: 10, left: 10, right: 10 }, children: (0, jsx_runtime_1.jsx)(react_native_1.Text, { style: { color: isDark ? "#aaa" : "#666", fontSize: 18 }, children: "\u2715" }) })] }), (0, jsx_runtime_1.jsx)(RatingCard_1.RatingCard, { block: sheetMessage.rating, primaryColor: primaryColor, dark: isDark, onRate: chat.ratingsSupported ? onRateCard : undefined, testIDPrefix: "giov-sheet-rating" })] }) }) }) })) : null;
|
|
188
220
|
if (mode === "modal") {
|
|
189
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: visible, animationType: "slide", presentationStyle: "pageSheet", onRequestClose: handleClose, children: chatContent }));
|
|
221
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_native_1.Modal, { visible: visible, animationType: "slide", presentationStyle: "pageSheet", onRequestClose: handleClose, children: chatContent }), sheet] }));
|
|
190
222
|
}
|
|
191
|
-
return visible ? chatContent : null;
|
|
223
|
+
return (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [visible ? chatContent : null, sheet] });
|
|
192
224
|
});
|
|
193
225
|
const styles = react_native_1.StyleSheet.create({
|
|
194
226
|
flex: { flex: 1 },
|
|
@@ -252,6 +284,11 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
252
284
|
justifyContent: "center",
|
|
253
285
|
},
|
|
254
286
|
sendBtnOff: { opacity: 0.35 },
|
|
287
|
+
closedBar: { alignItems: "center", gap: 10, padding: 14, borderTopWidth: react_native_1.StyleSheet.hairlineWidth },
|
|
288
|
+
sheetScrim: { flex: 1, justifyContent: "flex-end", backgroundColor: "rgba(0,0,0,0.4)" },
|
|
289
|
+
sheet: { borderTopLeftRadius: 18, borderTopRightRadius: 18, padding: 20, paddingBottom: 32, gap: 8 },
|
|
290
|
+
sheetHeader: { flexDirection: "row", alignItems: "center", justifyContent: "space-between" },
|
|
291
|
+
sheetTitle: { fontSize: 16, fontWeight: "700" },
|
|
255
292
|
sendIcon: { color: "#fff", fontSize: 18, fontWeight: "700", lineHeight: 22 },
|
|
256
293
|
});
|
|
257
294
|
//# sourceMappingURL=GiovChat.js.map
|
package/dist/GiovChat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GiovChat.js","sourceRoot":"","sources":["../src/GiovChat.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAsG;AACtG,+CAasB;AACtB,qDAAgE;AAEhE,6CAMsB;AAEtB,mFAA8D;AAC9D,qDAAsF;AACtF,4DAAgE;AAChE,oDAAiD;AACjD,iCAAsF;AACtF,yCAAgE;AAChE,yCAAuC;AACvC,qCAAwC;AACxC,mCAAiC;AACjC,+CAOuB;AAEvB,qCAAiE;AA6GjE,gFAAgF;AAEnE,QAAA,QAAQ,GAAG,eAAK,CAAC,UAAU,CAAgC,SAAS,QAAQ,CAAC,KAAK,EAAE,GAAG;IAClG,MAAM,KAAK,GAAG,IAAA,6BAAY,EAAC,KAAK,CAAC,OAAO,IAAI,0BAA0B,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1H,OAAO,uBAAC,gBAAgB,OAAiB,KAAK,EAAE,GAAG,EAAE,GAAG,IAA1B,KAAK,CAAyB,CAAC;AAC/D,CAAC,CAAC,CAAC;AAEH,SAAS,SAAS,CAAC,KAAoB,EAAE,OAAwB;IAC/D,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,iBAAiB,CAAC,CAAC,OAAO,OAAO,CAAC,cAAc,CAAC;QACtD,KAAK,qBAAqB,CAAC,CAAC,OAAO,OAAO,CAAC,iBAAiB,CAAC;QAC7D,KAAK,eAAe,CAAC,CAAC,OAAO,OAAO,CAAC,YAAY,CAAC;QAClD,KAAK,aAAa,CAAC,CAAC,OAAO,OAAO,CAAC,UAAU,CAAC;QAC9C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1,38 @@
|
|
|
1
|
+
/** The "Powered by GiovChat" footer's style slot. Layout, size and text stay SDK-controlled. */
|
|
2
|
+
export interface GiovChatBrandingStyle {
|
|
3
|
+
/** Font family of the footer. Defaults to the top-level `fontFamily`. */
|
|
4
|
+
fontFamily?: string;
|
|
5
|
+
/** Colour of "Powered by". Must reach 4.5:1 against the footer background. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** Colour of "GiovChat" (the link). Must reach 4.5:1 against the footer background. */
|
|
8
|
+
brandColor?: string;
|
|
9
|
+
/** Footer background. Opaque colours only. */
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
}
|
|
12
|
+
/** WCAG AA for normal text. */
|
|
13
|
+
export declare const FOOTER_MIN_CONTRAST = 4.5;
|
|
14
|
+
export declare const FOOTER_DEFAULTS: {
|
|
15
|
+
readonly backgroundColor: "#ffffff";
|
|
16
|
+
readonly color: "#52525b";
|
|
17
|
+
readonly brandColor: "#7c3aed";
|
|
18
|
+
};
|
|
19
|
+
/** The footer text is never smaller than this, whatever the app's style. */
|
|
20
|
+
export declare const FOOTER_FONT_SIZE = 12;
|
|
21
|
+
export interface ResolvedFooterStyle {
|
|
22
|
+
fontFamily?: string;
|
|
23
|
+
color: string;
|
|
24
|
+
brandColor: string;
|
|
25
|
+
backgroundColor: string;
|
|
26
|
+
/** True when the app changed the background: the divider is then a neutral translucent grey. */
|
|
27
|
+
customBackground: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** `parseColor`, but null for anything see-through: `transparent`, alpha below 1 (hex, rgba). */
|
|
30
|
+
export declare function parseOpaqueColor(value: unknown): [number, number, number] | null;
|
|
31
|
+
/**
|
|
32
|
+
* Applies the app's footer colours under the accessibility rules: an override that is see-through,
|
|
33
|
+
* unreadable (named colours), or below 4.5:1 against the effective background falls back to the
|
|
34
|
+
* SDK's default for that property (or, when the default fails too on the app's own background, to
|
|
35
|
+
* black or white). `warn` receives one message per rejected value.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveFooterStyle(slot: GiovChatBrandingStyle | undefined, warn?: (message: string) => void): ResolvedFooterStyle;
|
|
38
|
+
//# sourceMappingURL=brandingStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brandingStyle.d.ts","sourceRoot":"","sources":["../src/brandingStyle.ts"],"names":[],"mappings":"AAEA,gGAAgG;AAChG,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,+BAA+B;AAC/B,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,eAAe;;;;CAAmF,CAAC;AAChH,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,gGAAgG;IAChG,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,iGAAiG;AACjG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAchF;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,qBAAqB,GAAG,SAAS,EACvC,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAe,GACzC,mBAAmB,CA+BrB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FOOTER_FONT_SIZE = exports.FOOTER_DEFAULTS = exports.FOOTER_MIN_CONTRAST = void 0;
|
|
4
|
+
exports.parseOpaqueColor = parseOpaqueColor;
|
|
5
|
+
exports.resolveFooterStyle = resolveFooterStyle;
|
|
6
|
+
const color_1 = require("./color");
|
|
7
|
+
/** WCAG AA for normal text. */
|
|
8
|
+
exports.FOOTER_MIN_CONTRAST = 4.5;
|
|
9
|
+
exports.FOOTER_DEFAULTS = { backgroundColor: "#ffffff", color: "#52525b", brandColor: "#7c3aed" };
|
|
10
|
+
/** The footer text is never smaller than this, whatever the app's style. */
|
|
11
|
+
exports.FOOTER_FONT_SIZE = 12;
|
|
12
|
+
/** `parseColor`, but null for anything see-through: `transparent`, alpha below 1 (hex, rgba). */
|
|
13
|
+
function parseOpaqueColor(value) {
|
|
14
|
+
if (typeof value !== "string")
|
|
15
|
+
return null;
|
|
16
|
+
const text = value.trim().toLowerCase();
|
|
17
|
+
const hex = /^#([0-9a-f]{4}|[0-9a-f]{8})$/.exec(text)?.[1];
|
|
18
|
+
if (hex) {
|
|
19
|
+
const alpha = hex.length === 4 ? hex[3] + hex[3] : hex.slice(6, 8);
|
|
20
|
+
if (parseInt(alpha, 16) !== 255)
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const functional = /^rgba?\(\s*\d{1,3}\s*[, ]\s*\d{1,3}\s*[, ]\s*\d{1,3}\s*(?:[,/]\s*([\d.]+)(%?)\s*)?\)$/.exec(text);
|
|
24
|
+
if (functional?.[1] !== undefined) {
|
|
25
|
+
const alpha = Number(functional[1]) / (functional[2] ? 100 : 1);
|
|
26
|
+
if (!(alpha >= 1))
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return (0, color_1.parseColor)(text);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Applies the app's footer colours under the accessibility rules: an override that is see-through,
|
|
33
|
+
* unreadable (named colours), or below 4.5:1 against the effective background falls back to the
|
|
34
|
+
* SDK's default for that property (or, when the default fails too on the app's own background, to
|
|
35
|
+
* black or white). `warn` receives one message per rejected value.
|
|
36
|
+
*/
|
|
37
|
+
function resolveFooterStyle(slot, warn = () => { }) {
|
|
38
|
+
let background = exports.FOOTER_DEFAULTS.backgroundColor;
|
|
39
|
+
let customBackground = false;
|
|
40
|
+
if (slot?.backgroundColor !== undefined) {
|
|
41
|
+
if (parseOpaqueColor(slot.backgroundColor)) {
|
|
42
|
+
background = slot.backgroundColor;
|
|
43
|
+
customBackground = true;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
warn(`GiovChat: branding.backgroundColor "${slot.backgroundColor}" is ignored (use an opaque hex or rgb colour).`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const backgroundRgb = (0, color_1.parseColor)(background);
|
|
50
|
+
const readable = (candidate) => {
|
|
51
|
+
const rgb = (0, color_1.parseColor)(candidate);
|
|
52
|
+
return rgb !== null && (0, color_1.contrastRatio)(rgb, backgroundRgb) >= exports.FOOTER_MIN_CONTRAST;
|
|
53
|
+
};
|
|
54
|
+
const pick = (name) => {
|
|
55
|
+
const wanted = slot?.[name];
|
|
56
|
+
if (wanted !== undefined) {
|
|
57
|
+
if (parseOpaqueColor(wanted) && readable(wanted))
|
|
58
|
+
return wanted;
|
|
59
|
+
warn(`GiovChat: branding.${name} "${wanted}" is ignored (an opaque colour with at least ${exports.FOOTER_MIN_CONTRAST}:1 contrast against the footer background is required).`);
|
|
60
|
+
}
|
|
61
|
+
return readable(exports.FOOTER_DEFAULTS[name]) ? exports.FOOTER_DEFAULTS[name] : (0, color_1.textOn)(background);
|
|
62
|
+
};
|
|
63
|
+
return {
|
|
64
|
+
...(slot?.fontFamily ? { fontFamily: slot.fontFamily } : {}),
|
|
65
|
+
color: pick("color"),
|
|
66
|
+
brandColor: pick("brandColor"),
|
|
67
|
+
backgroundColor: background,
|
|
68
|
+
customBackground,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=brandingStyle.js.map
|
|
@@ -0,0 +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