@lorikeetai/react-native-sdk 2.2.0-beta.1 → 2.2.0-beta.3
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 +58 -3
- package/dist/customisations-BTaJ84md.d.cts +137 -0
- package/dist/customisations-BTaJ84md.d.cts.map +1 -0
- package/dist/customisations-BTaJ84md.d.ts +137 -0
- package/dist/customisations-BTaJ84md.d.ts.map +1 -0
- package/dist/index.cjs +11 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -135
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -135
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/rolldown-runtime-xuxB8TGW.cjs +32 -0
- package/dist/voice.cjs +597 -0
- package/dist/voice.cjs.map +1 -1
- package/dist/voice.d.cts +10 -1
- package/dist/voice.d.cts.map +1 -1
- package/dist/voice.d.ts +10 -1
- package/dist/voice.d.ts.map +1 -1
- package/dist/voice.js +596 -2
- package/dist/voice.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -98,9 +98,10 @@ twice.
|
|
|
98
98
|
If you compose the parts yourself, the keyboard is yours. Wrap them in a
|
|
99
99
|
`KeyboardAvoidingView` with `behavior="padding"` on both platforms, and set
|
|
100
100
|
`keyboardVerticalOffset` to their distance from the top of the screen.
|
|
101
|
-
`apps/rn-widget-demo/src/components/WidgetPane.tsx`
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
`apps/rn-widget-demo/src/components/WidgetPane.tsx` shows how: `measureInWindow`
|
|
102
|
+
on iOS, and on Android the larger of `measureInWindow` and `measure`'s `pageY`,
|
|
103
|
+
because the first can leave out the status bar and the second stops at the React
|
|
104
|
+
root. Check it on an Android device: an iOS simulator will not show the problem.
|
|
104
105
|
|
|
105
106
|
## Which header you get
|
|
106
107
|
|
|
@@ -496,6 +497,60 @@ Your backend creates the session with
|
|
|
496
497
|
returns its `{ conversationId, wsUrl, token }` to the app. Never put your API
|
|
497
498
|
credentials in the app.
|
|
498
499
|
|
|
500
|
+
### Call screen
|
|
501
|
+
|
|
502
|
+
`LorikeetCallView` draws the web Voice Widget's call screen, with its copy.
|
|
503
|
+
It shows the logo, the title, the call status and clock, the call wave, and
|
|
504
|
+
the start, mute, speaker and end buttons. Every control has an accessibility
|
|
505
|
+
label, and screen readers hear each change in the call.
|
|
506
|
+
|
|
507
|
+
```tsx
|
|
508
|
+
import { LorikeetCallView } from '@lorikeetai/react-native-sdk/voice'
|
|
509
|
+
|
|
510
|
+
const getSession = async () => {
|
|
511
|
+
const response = await fetch('https://api.example.com/support/call', {
|
|
512
|
+
method: 'POST',
|
|
513
|
+
})
|
|
514
|
+
if (response.status === 404) return null
|
|
515
|
+
if (!response.ok) throw new Error(`Call session: ${response.status}`)
|
|
516
|
+
return response.json()
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export function SupportCallScreen() {
|
|
520
|
+
return (
|
|
521
|
+
<LorikeetCallView
|
|
522
|
+
customisations={{
|
|
523
|
+
title: 'Acme support',
|
|
524
|
+
theme: { brandColor: '214 100% 50%' },
|
|
525
|
+
}}
|
|
526
|
+
getSession={getSession}
|
|
527
|
+
/>
|
|
528
|
+
)
|
|
529
|
+
}
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
The view runs the call itself, so the call ends when the view unmounts. To
|
|
533
|
+
keep a call going across screens, run `useLorikeetCall` above them and build
|
|
534
|
+
the screen yourself.
|
|
535
|
+
|
|
536
|
+
It takes the hook's `getSession` and `onError`, a `style` for its outer view,
|
|
537
|
+
and these `customisations`, as the chat widget reads them:
|
|
538
|
+
|
|
539
|
+
- `title`: the heading. Defaults to "Lorikeet AI Agent".
|
|
540
|
+
- `logoUrl`: the image above the heading, PNG, JPEG or SVG. Defaults to the
|
|
541
|
+
Lorikeet mark. An SVG is drawn only when the URL's path ends in `.svg`.
|
|
542
|
+
- `useSubtleBranding`: hides "Powered by Lorikeet".
|
|
543
|
+
- `theme`: `colorMode`, `brandColor`, `brandAccentColor`, `subtleBrandColor`,
|
|
544
|
+
`backgroundColor`, `textColor` and `inverseTextColor`, as the web Voice
|
|
545
|
+
Widget reads them. `background` and `headerBackground` apply when they are
|
|
546
|
+
plain colours. React Native cannot draw a CSS gradient, so a gradient falls
|
|
547
|
+
back to `backgroundColor` or `brandAccentColor`. `fontFamily` and `fontUrl`
|
|
548
|
+
do not apply.
|
|
549
|
+
|
|
550
|
+
### Your own call screen
|
|
551
|
+
|
|
552
|
+
`useLorikeetCall` runs the call without any UI.
|
|
553
|
+
|
|
499
554
|
```tsx
|
|
500
555
|
import { Button, Text, View } from 'react-native'
|
|
501
556
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the chat page accepts as `customisations`, as the SDK's own types.
|
|
3
|
+
*
|
|
4
|
+
* A copy of the web SDK's shape rather than an import of it. The web SDK is a
|
|
5
|
+
* browser bundle an app has no reason to install, and importing a type from it
|
|
6
|
+
* left the published `dist/index.d.ts` referencing a module consumers do not
|
|
7
|
+
* have: `Customisations` then degraded to `any` and typed nothing.
|
|
8
|
+
* `ConversationMetadata` is duplicated here for the same reason.
|
|
9
|
+
*
|
|
10
|
+
* `src/customisations.web-sdk-parity.ts` fails `typecheck` if the two drift. Not
|
|
11
|
+
* the build: that file is unreachable from `index.ts`, so the declaration build
|
|
12
|
+
* never sees it.
|
|
13
|
+
*
|
|
14
|
+
* Fields that only mean something on a web page are kept so the page's behaviour
|
|
15
|
+
* is unchanged and so a host sharing one configuration object with its web
|
|
16
|
+
* widget still type-checks. The viewport sizes, the launcher button and `mode`
|
|
17
|
+
* are all read by the web SDK rather than by the page, so none of them reaches
|
|
18
|
+
* anything this SDK renders.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Sizing for one viewport. Mostly desktop: the page is full-screen on mobile, so
|
|
22
|
+
* `height`, `width` and `borderRadius` are read for `desktop` alone, while
|
|
23
|
+
* `topClearance` and `default_open` are read for whichever viewport applies.
|
|
24
|
+
*/
|
|
25
|
+
interface ViewportCustomisations {
|
|
26
|
+
/** Clamped to a 2rem maximum. */
|
|
27
|
+
borderRadius?: string;
|
|
28
|
+
default_open?: boolean;
|
|
29
|
+
/** Clamped to the viewport minus `topClearance`, and to a 20rem minimum. */
|
|
30
|
+
height?: string;
|
|
31
|
+
/** Reserved space above the widget. Desktop default 6.5rem. */
|
|
32
|
+
topClearance?: string;
|
|
33
|
+
width?: string;
|
|
34
|
+
}
|
|
35
|
+
interface Customisations {
|
|
36
|
+
/** Falls back to the logo image. */
|
|
37
|
+
avatarUrl?: string;
|
|
38
|
+
botName?: string;
|
|
39
|
+
desktop?: ViewportCustomisations;
|
|
40
|
+
/**
|
|
41
|
+
* Which header the customer gets, not whether there is one. `true` hides the
|
|
42
|
+
* page's own; `false` keeps it, and with it the page's way out of a
|
|
43
|
+
* conversation. Ending and minimising are what that header is for, and which
|
|
44
|
+
* controls it offers depends on the subscriber's configuration, so hiding it
|
|
45
|
+
* leaves the customer no way to end or minimise unless the host supplies one.
|
|
46
|
+
*
|
|
47
|
+
* What replaces a hidden one is the host's business, so there is no one
|
|
48
|
+
* default to quote. `LorikeetWidgetView` substitutes its own header, a title
|
|
49
|
+
* and new chat, and does so when this is omitted. `LorikeetClient` only
|
|
50
|
+
* serialises the flag and renders nothing, so a composed host keeps the page's
|
|
51
|
+
* header unless it asks for it to go, and must render `LorikeetWidgetHeader`
|
|
52
|
+
* itself when it does.
|
|
53
|
+
*/
|
|
54
|
+
hideHeader?: boolean;
|
|
55
|
+
/** @default '_blank' */
|
|
56
|
+
linkTarget?: '_blank' | '_parent';
|
|
57
|
+
logoUrl?: string;
|
|
58
|
+
messages?: {
|
|
59
|
+
/** Shown when the widget is in an unexpectedly failed state. */
|
|
60
|
+
failOver?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Shown when live chat has been switched off deliberately. Reachable only
|
|
63
|
+
* where the live agent bridge is on for the subscriber; without it the widget
|
|
64
|
+
* has no unavailable state for this to label.
|
|
65
|
+
*/
|
|
66
|
+
unavailable?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Replaces the line under "Someone is taking a look", for a conversation
|
|
69
|
+
* handed to a person. Say where the reply will come from when the default
|
|
70
|
+
* should not promise it. Shown only where the live chat experience is on,
|
|
71
|
+
* which is what puts the notice on screen in the first place.
|
|
72
|
+
*/
|
|
73
|
+
escalated?: string;
|
|
74
|
+
};
|
|
75
|
+
mobile?: ViewportCustomisations;
|
|
76
|
+
mode?: 'controlled' | 'uncontrolled';
|
|
77
|
+
/**
|
|
78
|
+
* Styling for the launcher button the web widget renders. The React Native
|
|
79
|
+
* SDK renders no launcher, so this reaches the page and does nothing.
|
|
80
|
+
*
|
|
81
|
+
* @danger Experimental and may change.
|
|
82
|
+
*/
|
|
83
|
+
rootElement?: {
|
|
84
|
+
border?: string;
|
|
85
|
+
borderRadius?: string;
|
|
86
|
+
zIndex?: number;
|
|
87
|
+
bottom?: string;
|
|
88
|
+
right?: string;
|
|
89
|
+
/** Any CSS size value. Defaults to 3rem. */
|
|
90
|
+
size?: string;
|
|
91
|
+
};
|
|
92
|
+
/** Show dates as well as times, on every message. */
|
|
93
|
+
showVerboseTimestamps?: boolean;
|
|
94
|
+
theme?: CustomisationTheme;
|
|
95
|
+
title?: string;
|
|
96
|
+
/** @default false */
|
|
97
|
+
useSubtleBranding?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface CustomisationTheme {
|
|
100
|
+
/**
|
|
101
|
+
* Colour or gradient for the main area. Any colour value, and any gradient
|
|
102
|
+
* function including multiple layers. Image-based backgrounds are not
|
|
103
|
+
* supported. Takes precedence over `backgroundColor`.
|
|
104
|
+
*/
|
|
105
|
+
background?: string;
|
|
106
|
+
backgroundColor?: string;
|
|
107
|
+
/** Accent fill, currently the header. Resolves to a neutral when unset. */
|
|
108
|
+
brandAccentColor?: string;
|
|
109
|
+
brandColor?: string;
|
|
110
|
+
/** @default 'light' */
|
|
111
|
+
colorMode?: 'light' | 'dark';
|
|
112
|
+
fontFamily?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Google Fonts CSS URL declaring the `@font-face` rules for `fontFamily`.
|
|
115
|
+
* The page ships Inter only, so a brand font the device lacks falls back
|
|
116
|
+
* unless its files are loaded. Must be https, host `fonts.googleapis.com`,
|
|
117
|
+
* path `/css` or `/css2`, and carry `family` plus at most a standard
|
|
118
|
+
* `display`. A URL failing any of that is dropped whole rather than trimmed,
|
|
119
|
+
* so one stray query param means no font loads at all.
|
|
120
|
+
*/
|
|
121
|
+
fontUrl?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Colour or gradient for the header, on the same terms as `background`.
|
|
124
|
+
* Takes precedence over `brandAccentColor`.
|
|
125
|
+
*/
|
|
126
|
+
headerBackground?: string;
|
|
127
|
+
/** For text on a dark background. */
|
|
128
|
+
inverseTextColor?: string;
|
|
129
|
+
/** Falls back to the brand colour. */
|
|
130
|
+
linkColor?: string;
|
|
131
|
+
linkHoverColor?: string;
|
|
132
|
+
secondaryBrandColor?: string;
|
|
133
|
+
subtleBrandColor?: string;
|
|
134
|
+
textColor?: string;
|
|
135
|
+
}
|
|
136
|
+
export { Customisations as n, CustomisationTheme as t };
|
|
137
|
+
//# sourceMappingURL=customisations-BTaJ84md.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customisations-BTaJ84md.d.cts","names":[],"sources":["../src/customisations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;UAyBU;;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;;EAEA;;EAEA;EACA;EACA;EACA;EACA"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the chat page accepts as `customisations`, as the SDK's own types.
|
|
3
|
+
*
|
|
4
|
+
* A copy of the web SDK's shape rather than an import of it. The web SDK is a
|
|
5
|
+
* browser bundle an app has no reason to install, and importing a type from it
|
|
6
|
+
* left the published `dist/index.d.ts` referencing a module consumers do not
|
|
7
|
+
* have: `Customisations` then degraded to `any` and typed nothing.
|
|
8
|
+
* `ConversationMetadata` is duplicated here for the same reason.
|
|
9
|
+
*
|
|
10
|
+
* `src/customisations.web-sdk-parity.ts` fails `typecheck` if the two drift. Not
|
|
11
|
+
* the build: that file is unreachable from `index.ts`, so the declaration build
|
|
12
|
+
* never sees it.
|
|
13
|
+
*
|
|
14
|
+
* Fields that only mean something on a web page are kept so the page's behaviour
|
|
15
|
+
* is unchanged and so a host sharing one configuration object with its web
|
|
16
|
+
* widget still type-checks. The viewport sizes, the launcher button and `mode`
|
|
17
|
+
* are all read by the web SDK rather than by the page, so none of them reaches
|
|
18
|
+
* anything this SDK renders.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Sizing for one viewport. Mostly desktop: the page is full-screen on mobile, so
|
|
22
|
+
* `height`, `width` and `borderRadius` are read for `desktop` alone, while
|
|
23
|
+
* `topClearance` and `default_open` are read for whichever viewport applies.
|
|
24
|
+
*/
|
|
25
|
+
interface ViewportCustomisations {
|
|
26
|
+
/** Clamped to a 2rem maximum. */
|
|
27
|
+
borderRadius?: string;
|
|
28
|
+
default_open?: boolean;
|
|
29
|
+
/** Clamped to the viewport minus `topClearance`, and to a 20rem minimum. */
|
|
30
|
+
height?: string;
|
|
31
|
+
/** Reserved space above the widget. Desktop default 6.5rem. */
|
|
32
|
+
topClearance?: string;
|
|
33
|
+
width?: string;
|
|
34
|
+
}
|
|
35
|
+
interface Customisations {
|
|
36
|
+
/** Falls back to the logo image. */
|
|
37
|
+
avatarUrl?: string;
|
|
38
|
+
botName?: string;
|
|
39
|
+
desktop?: ViewportCustomisations;
|
|
40
|
+
/**
|
|
41
|
+
* Which header the customer gets, not whether there is one. `true` hides the
|
|
42
|
+
* page's own; `false` keeps it, and with it the page's way out of a
|
|
43
|
+
* conversation. Ending and minimising are what that header is for, and which
|
|
44
|
+
* controls it offers depends on the subscriber's configuration, so hiding it
|
|
45
|
+
* leaves the customer no way to end or minimise unless the host supplies one.
|
|
46
|
+
*
|
|
47
|
+
* What replaces a hidden one is the host's business, so there is no one
|
|
48
|
+
* default to quote. `LorikeetWidgetView` substitutes its own header, a title
|
|
49
|
+
* and new chat, and does so when this is omitted. `LorikeetClient` only
|
|
50
|
+
* serialises the flag and renders nothing, so a composed host keeps the page's
|
|
51
|
+
* header unless it asks for it to go, and must render `LorikeetWidgetHeader`
|
|
52
|
+
* itself when it does.
|
|
53
|
+
*/
|
|
54
|
+
hideHeader?: boolean;
|
|
55
|
+
/** @default '_blank' */
|
|
56
|
+
linkTarget?: '_blank' | '_parent';
|
|
57
|
+
logoUrl?: string;
|
|
58
|
+
messages?: {
|
|
59
|
+
/** Shown when the widget is in an unexpectedly failed state. */
|
|
60
|
+
failOver?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Shown when live chat has been switched off deliberately. Reachable only
|
|
63
|
+
* where the live agent bridge is on for the subscriber; without it the widget
|
|
64
|
+
* has no unavailable state for this to label.
|
|
65
|
+
*/
|
|
66
|
+
unavailable?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Replaces the line under "Someone is taking a look", for a conversation
|
|
69
|
+
* handed to a person. Say where the reply will come from when the default
|
|
70
|
+
* should not promise it. Shown only where the live chat experience is on,
|
|
71
|
+
* which is what puts the notice on screen in the first place.
|
|
72
|
+
*/
|
|
73
|
+
escalated?: string;
|
|
74
|
+
};
|
|
75
|
+
mobile?: ViewportCustomisations;
|
|
76
|
+
mode?: 'controlled' | 'uncontrolled';
|
|
77
|
+
/**
|
|
78
|
+
* Styling for the launcher button the web widget renders. The React Native
|
|
79
|
+
* SDK renders no launcher, so this reaches the page and does nothing.
|
|
80
|
+
*
|
|
81
|
+
* @danger Experimental and may change.
|
|
82
|
+
*/
|
|
83
|
+
rootElement?: {
|
|
84
|
+
border?: string;
|
|
85
|
+
borderRadius?: string;
|
|
86
|
+
zIndex?: number;
|
|
87
|
+
bottom?: string;
|
|
88
|
+
right?: string;
|
|
89
|
+
/** Any CSS size value. Defaults to 3rem. */
|
|
90
|
+
size?: string;
|
|
91
|
+
};
|
|
92
|
+
/** Show dates as well as times, on every message. */
|
|
93
|
+
showVerboseTimestamps?: boolean;
|
|
94
|
+
theme?: CustomisationTheme;
|
|
95
|
+
title?: string;
|
|
96
|
+
/** @default false */
|
|
97
|
+
useSubtleBranding?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface CustomisationTheme {
|
|
100
|
+
/**
|
|
101
|
+
* Colour or gradient for the main area. Any colour value, and any gradient
|
|
102
|
+
* function including multiple layers. Image-based backgrounds are not
|
|
103
|
+
* supported. Takes precedence over `backgroundColor`.
|
|
104
|
+
*/
|
|
105
|
+
background?: string;
|
|
106
|
+
backgroundColor?: string;
|
|
107
|
+
/** Accent fill, currently the header. Resolves to a neutral when unset. */
|
|
108
|
+
brandAccentColor?: string;
|
|
109
|
+
brandColor?: string;
|
|
110
|
+
/** @default 'light' */
|
|
111
|
+
colorMode?: 'light' | 'dark';
|
|
112
|
+
fontFamily?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Google Fonts CSS URL declaring the `@font-face` rules for `fontFamily`.
|
|
115
|
+
* The page ships Inter only, so a brand font the device lacks falls back
|
|
116
|
+
* unless its files are loaded. Must be https, host `fonts.googleapis.com`,
|
|
117
|
+
* path `/css` or `/css2`, and carry `family` plus at most a standard
|
|
118
|
+
* `display`. A URL failing any of that is dropped whole rather than trimmed,
|
|
119
|
+
* so one stray query param means no font loads at all.
|
|
120
|
+
*/
|
|
121
|
+
fontUrl?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Colour or gradient for the header, on the same terms as `background`.
|
|
124
|
+
* Takes precedence over `brandAccentColor`.
|
|
125
|
+
*/
|
|
126
|
+
headerBackground?: string;
|
|
127
|
+
/** For text on a dark background. */
|
|
128
|
+
inverseTextColor?: string;
|
|
129
|
+
/** Falls back to the brand colour. */
|
|
130
|
+
linkColor?: string;
|
|
131
|
+
linkHoverColor?: string;
|
|
132
|
+
secondaryBrandColor?: string;
|
|
133
|
+
subtleBrandColor?: string;
|
|
134
|
+
textColor?: string;
|
|
135
|
+
}
|
|
136
|
+
export { Customisations as n, CustomisationTheme as t };
|
|
137
|
+
//# sourceMappingURL=customisations-BTaJ84md.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customisations-BTaJ84md.d.ts","names":[],"sources":["../src/customisations.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;UAyBU;;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;;EAEA;;EAEA;EACA;EACA;EACA;EACA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,36 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
-
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
-
__defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-xuxB8TGW.cjs");
|
|
28
3
|
let react = require("react");
|
|
29
4
|
let react_native = require("react-native");
|
|
30
5
|
let react_native_safe_area_context = require("react-native-safe-area-context");
|
|
31
6
|
let react_native_webview = require("react-native-webview");
|
|
32
7
|
let react_native_svg = require("react-native-svg");
|
|
33
|
-
react_native_svg = __toESM(react_native_svg, 1);
|
|
8
|
+
react_native_svg = require_rolldown_runtime.__toESM(react_native_svg, 1);
|
|
34
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
35
10
|
|
|
36
11
|
// src/bridge.ts
|
|
@@ -532,10 +507,16 @@ const LorikeetWidgetView = (0, react.forwardRef)(function LorikeetWidgetView({ p
|
|
|
532
507
|
const containerRef = (0, react.useRef)(null);
|
|
533
508
|
const [keyboardOffset, setKeyboardOffset] = (0, react.useState)(0);
|
|
534
509
|
const measureKeyboardOffset = (0, react.useCallback)((event) => {
|
|
535
|
-
var _containerRef$current;
|
|
536
510
|
const { y } = event.nativeEvent.layout;
|
|
537
|
-
|
|
538
|
-
|
|
511
|
+
const view = containerRef.current;
|
|
512
|
+
view === null || view === void 0 || view.measureInWindow((_windowX, windowY) => {
|
|
513
|
+
if (react_native.Platform.OS !== "android") {
|
|
514
|
+
setKeyboardOffset(windowY - y);
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
view.measure((_x, _y, _width, _height, _pageX, pageY) => {
|
|
518
|
+
setKeyboardOffset(Math.max(windowY, pageY) - y);
|
|
519
|
+
});
|
|
539
520
|
});
|
|
540
521
|
}, []);
|
|
541
522
|
const [refusedTicketId, setRefusedTicketId] = (0, react.useState)(null);
|