@lorikeetai/react-native-sdk 2.1.0 → 2.2.0-beta.2

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/dist/index.d.ts CHANGED
@@ -1,141 +1,7 @@
1
+ import { n as Customisations, t as CustomisationTheme } from "./customisations-BTaJ84md.js";
1
2
  import { StyleProp, TextStyle } from "react-native";
2
3
  import { WebView, WebViewMessageEvent, WebViewProps } from "react-native-webview";
3
4
  type ConversationMetadata = Record<string, unknown>;
4
- /**
5
- * What the chat page accepts as `customisations`, as the SDK's own types.
6
- *
7
- * A copy of the web SDK's shape rather than an import of it. The web SDK is a
8
- * browser bundle an app has no reason to install, and importing a type from it
9
- * left the published `dist/index.d.ts` referencing a module consumers do not
10
- * have: `Customisations` then degraded to `any` and typed nothing.
11
- * `ConversationMetadata` is duplicated here for the same reason.
12
- *
13
- * `src/customisations.web-sdk-parity.ts` fails `typecheck` if the two drift. Not
14
- * the build: that file is unreachable from `index.ts`, so the declaration build
15
- * never sees it.
16
- *
17
- * Fields that only mean something on a web page are kept so the page's behaviour
18
- * is unchanged and so a host sharing one configuration object with its web
19
- * widget still type-checks. The viewport sizes, the launcher button and `mode`
20
- * are all read by the web SDK rather than by the page, so none of them reaches
21
- * anything this SDK renders.
22
- */
23
- /**
24
- * Sizing for one viewport. Mostly desktop: the page is full-screen on mobile, so
25
- * `height`, `width` and `borderRadius` are read for `desktop` alone, while
26
- * `topClearance` and `default_open` are read for whichever viewport applies.
27
- */
28
- interface ViewportCustomisations {
29
- /** Clamped to a 2rem maximum. */
30
- borderRadius?: string;
31
- default_open?: boolean;
32
- /** Clamped to the viewport minus `topClearance`, and to a 20rem minimum. */
33
- height?: string;
34
- /** Reserved space above the widget. Desktop default 6.5rem. */
35
- topClearance?: string;
36
- width?: string;
37
- }
38
- interface Customisations {
39
- /** Falls back to the logo image. */
40
- avatarUrl?: string;
41
- botName?: string;
42
- desktop?: ViewportCustomisations;
43
- /**
44
- * Which header the customer gets, not whether there is one. `true` hides the
45
- * page's own; `false` keeps it, and with it the page's way out of a
46
- * conversation. Ending and minimising are what that header is for, and which
47
- * controls it offers depends on the subscriber's configuration, so hiding it
48
- * leaves the customer no way to end or minimise unless the host supplies one.
49
- *
50
- * What replaces a hidden one is the host's business, so there is no one
51
- * default to quote. `LorikeetWidgetView` substitutes its own header, a title
52
- * and new chat, and does so when this is omitted. `LorikeetClient` only
53
- * serialises the flag and renders nothing, so a composed host keeps the page's
54
- * header unless it asks for it to go, and must render `LorikeetWidgetHeader`
55
- * itself when it does.
56
- */
57
- hideHeader?: boolean;
58
- /** @default '_blank' */
59
- linkTarget?: '_blank' | '_parent';
60
- logoUrl?: string;
61
- messages?: {
62
- /** Shown when the widget is in an unexpectedly failed state. */
63
- failOver?: string;
64
- /**
65
- * Shown when live chat has been switched off deliberately. Reachable only
66
- * where the live agent bridge is on for the subscriber; without it the widget
67
- * has no unavailable state for this to label.
68
- */
69
- unavailable?: string;
70
- /**
71
- * Replaces the line under "Someone is taking a look", for a conversation
72
- * handed to a person. Say where the reply will come from when the default
73
- * should not promise it. Shown only where the live chat experience is on,
74
- * which is what puts the notice on screen in the first place.
75
- */
76
- escalated?: string;
77
- };
78
- mobile?: ViewportCustomisations;
79
- mode?: 'controlled' | 'uncontrolled';
80
- /**
81
- * Styling for the launcher button the web widget renders. The React Native
82
- * SDK renders no launcher, so this reaches the page and does nothing.
83
- *
84
- * @danger Experimental and may change.
85
- */
86
- rootElement?: {
87
- border?: string;
88
- borderRadius?: string;
89
- zIndex?: number;
90
- bottom?: string;
91
- right?: string;
92
- /** Any CSS size value. Defaults to 3rem. */
93
- size?: string;
94
- };
95
- /** Show dates as well as times, on every message. */
96
- showVerboseTimestamps?: boolean;
97
- theme?: CustomisationTheme;
98
- title?: string;
99
- /** @default false */
100
- useSubtleBranding?: boolean;
101
- }
102
- interface CustomisationTheme {
103
- /**
104
- * Colour or gradient for the main area. Any colour value, and any gradient
105
- * function including multiple layers. Image-based backgrounds are not
106
- * supported. Takes precedence over `backgroundColor`.
107
- */
108
- background?: string;
109
- backgroundColor?: string;
110
- /** Accent fill, currently the header. Resolves to a neutral when unset. */
111
- brandAccentColor?: string;
112
- brandColor?: string;
113
- /** @default 'light' */
114
- colorMode?: 'light' | 'dark';
115
- fontFamily?: string;
116
- /**
117
- * Google Fonts CSS URL declaring the `@font-face` rules for `fontFamily`.
118
- * The page ships Inter only, so a brand font the device lacks falls back
119
- * unless its files are loaded. Must be https, host `fonts.googleapis.com`,
120
- * path `/css` or `/css2`, and carry `family` plus at most a standard
121
- * `display`. A URL failing any of that is dropped whole rather than trimmed,
122
- * so one stray query param means no font loads at all.
123
- */
124
- fontUrl?: string;
125
- /**
126
- * Colour or gradient for the header, on the same terms as `background`.
127
- * Takes precedence over `brandAccentColor`.
128
- */
129
- headerBackground?: string;
130
- /** For text on a dark background. */
131
- inverseTextColor?: string;
132
- /** Falls back to the brand colour. */
133
- linkColor?: string;
134
- linkHoverColor?: string;
135
- secondaryBrandColor?: string;
136
- subtleBrandColor?: string;
137
- textColor?: string;
138
- }
139
5
  /**
140
6
  * What the page reports, as events rather than as raw bridge messages.
141
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/conversation-metadata.ts","../src/customisations.ts","../src/events.ts","../src/types.ts","../src/widget.tsx","../src/client.ts","../src/errors.ts","../src/lifecycle.ts"],"mappings":";;KAEY,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;UCuBzB;;EAER;EACA;;EAEA;;EAEA;EACA;;UAGe;;EAEf;EACA;EACA,UAAU;;;;;;;;;;;;;;;EAeV;;EAEA;EACA;EACA;;IAEE;;;;;;IAMA;;;;;;;IAOA;;EAEF,SAAS;EACT;;;;;;;EAOA;IACE;IACA;IACA;IACA;IACA;;IAEA;;;EAGF;EACA,QAAQ;EACR;;EAEA;;UAGe;;;;;;EAMf;EACA;;EAEA;EACA;;EAEA;EACA;;;;;;;;;EASA;;;;;EAKA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BAA4B;;iBAexB,2BAA2B;iBAK3B,uBAAuB;;;;;;;;;;;;cCtB1B"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/conversation-metadata.ts","../src/events.ts","../src/types.ts","../src/widget.tsx","../src/client.ts","../src/errors.ts","../src/lifecycle.ts"],"mappings":";;;KAEY,uBAAuB;;;;;;;;;;;;;;;;;KCcvB;;;EAEN;;;;;;;;EAMA;EAAwB;;;;EAExB;;;;;;;;;;;;EAUA;EAAuB;;;;;;;;;;;;;;;;;EAevB;EAAe;;;;;;;;;;;;EAUf;;;;;;;EAKA;;;;;;;EAKA;EAA2B;;;;;;;EAK3B;EAAyB;;;;;;;;;;;;;;;;EAczB;;;;;;;;;;;;EAUA;;;;EAEA;EAAe;;;;;;;;;;;;;EAYf;EACA;EACA;;;KAIM;UCjHK;;;;EAIf;;;;EAIA,iBAAiB;;;;;EAKjB,WAAW;;;;EAIX;;KAGU;;;;EAIV;;;;EAIA;;;;EAIA,eAAe;;;;;;;;;;;;;;;EAef,WAAW,OAAO;;KAGR;;;;EAIV;;;;EAIA,QAAQ,UAAU;;;;EAIlB,OAAO,MAAM;;;;EAIb;;;;;;;KAQU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCV;IACE;IACA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCF;;;;;;;;;;;;;EAaA;;KAGU;;;;EAIV;;;;EAIA;;;;EAIA;;;;;;;;;;;;;EAaA,oBAAoB,OAAO;;;;;EAK3B,WAAW,OAAO;;;;EAIlB,iBAAiB;;;;EAIjB;IACE,SAAS,UAAU;;;;;;;;;EASrB;;;;;;;EAOA;;;;;;EAMA,WAAW;;;;;;;EAOX,eAAe;;;;;;;;;;;EAWf;;cC7JW,uCAAqB,0BAAA,6CAAA,cAAA;cA2HrB,yBAAwB,OAAA,OAAA,MAAA,eAKlC,8CAAyB,IAAA;cAYf,oCAAkB,0BAAA,0CAAA,cAAA;cCpOlB;EACX;EACA,gBAAgB;EAChB,UAAU;EACV;EAEY,cACV,gBACA,UACA,UACA,cACC;EAeH,kBAAiB,gBAAA,eAAA,OAAA,WAAA;IAOf;IACA;IACA;IACA;IACA;;;;;;;;;;;;EAmDF;;;;;;;;;;;;cCnFW;KAgBD,4BAA4B;;iBAexB,2BAA2B;iBAK3B,uBAAuB;;;;;;;;;;;;cCtB1B"}
@@ -0,0 +1,32 @@
1
+ // \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ Object.defineProperty(exports, "__toESM", {
28
+ enumerable: true,
29
+ get: function () {
30
+ return __toESM;
31
+ }
32
+ });