@soyio/soyio-rn-sdk 3.1.2 → 4.0.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 +184 -7
- package/index.ts +7 -0
- package/package/index.d.ts +2 -1
- package/package/index.js +3 -1
- package/package/index.js.map +1 -1
- package/package/src/components/ConsentSkeleton.d.ts +9 -0
- package/package/src/components/ConsentSkeleton.jsx +196 -0
- package/package/src/components/ConsentSkeleton.jsx.map +1 -0
- package/package/src/components/Tooltip.d.ts +10 -0
- package/package/src/components/Tooltip.jsx +115 -0
- package/package/src/components/Tooltip.jsx.map +1 -0
- package/package/src/components/index.d.ts +3 -0
- package/package/src/components/index.js +8 -0
- package/package/src/components/index.js.map +1 -0
- package/package/src/consent.d.ts +19 -0
- package/package/src/consent.jsx +83 -0
- package/package/src/consent.jsx.map +1 -0
- package/package/src/types.d.ts +62 -5
- package/package/src/utils/index.d.ts +1 -1
- package/package/src/utils/index.js +2 -1
- package/package/src/utils/index.js.map +1 -1
- package/package/src/utils/message-handler.d.ts +3 -2
- package/package/src/utils/message-handler.js +41 -7
- package/package/src/utils/message-handler.js.map +1 -1
- package/package/src/utils/url-builder.d.ts +2 -2
- package/package/src/utils/url-builder.js +9 -4
- package/package/src/utils/url-builder.js.map +1 -1
- package/package/src/webview.d.ts +1 -1
- package/package/src/webview.jsx +93 -3
- package/package/src/webview.jsx.map +1 -1
- package/package.json +13 -4
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/1f5b84f51ce0fcfbb76e904b7bcaa7560f601e1394a0b29367a09385312287eb +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/2b075ac1a6132b5b8a4c9ef0ba6b0cd84db7838aca9a000e50d907f40770a4ab +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/59cc2a9af81aaca2376702c2490650f4da2775fa673274db98aad41b7ef101c0 +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/5b63e98b991aedabb60665503384f30bffd939decf9433883b30b78011ee501a +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/66388dc76dc16bc6b76b682edd218a575bf45b9b +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/6b3133f0f39ff89a2a169d61176ee17cafacc5e288f334e2b64ee82892d11ccd +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/9077d16225f9314163ef1e7db6fc7d4088bb903d134bd95f23d5591ca4dfbfca +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/a74f2afb9d20f2375ccbd14e67c094b85c89ceb608f7cf8ae04f3f646a6c5672 +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/b501893e75f62ee1707643e35b21109927b07ed5b202321c961b424cbc2e4695 +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/dbd7a353f0130bb983d6ba05917e9be991d70e8f028df4b74e30bc6497ef7f71 +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/f2.xml +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/fd6d368a5658496536e2bfae170d1b823a3629b242cafc09784bfba4e56d8c80 +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/marker +0 -0
- package/ios/Frameworks/FaceTecSDK.framework/cache_uyertuazlkxcjrlwkejr/39bb748b334003e3fa/vu0ilin6we3lrzo5f83f7qs2jul4aq7v4aoynrmch8zfvpi8ezrfyafa4t0fx87l +0 -0
- package/package/src/core.d.ts +0 -3
- package/package/src/core.jsx +0 -65
- package/package/src/core.jsx.map +0 -1
- package/package/src/facetec-bridge.d.ts +0 -10
- package/package/src/facetec-bridge.js +0 -125
- package/package/src/facetec-bridge.js.map +0 -1
- package/package/src/passkey-bridge.d.ts +0 -17
- package/package/src/passkey-bridge.js +0 -103
- package/package/src/passkey-bridge.js.map +0 -1
- package/package/src/utils/date.d.ts +0 -1
- package/package/src/utils/date.js +0 -6
- package/package/src/utils/date.js.map +0 -1
package/README.md
CHANGED
|
@@ -153,7 +153,7 @@ You need to configure a custom URI scheme for your application to handle deep li
|
|
|
153
153
|
npx uri-scheme add custom-uri-scheme
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Replace `custom-uri-scheme` with your desired scheme name. This scheme should match the `uriScheme` parameter you use in the `SoyioWidget` options.
|
|
156
|
+
Replace `custom-uri-scheme` with your desired scheme name. This scheme should match the `uriScheme` parameter you use in the `SoyioWidget` options. It is essential for the Disclosure and Auth flows to return control to your application once they finish (especially when using the In-App Browser or Passkeys). It is not needed if you are only using the `ConsentBox`.
|
|
157
157
|
|
|
158
158
|
## Usage
|
|
159
159
|
|
|
@@ -311,11 +311,137 @@ const styles = StyleSheet.create({
|
|
|
311
311
|
});
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
+
### 3. Consent
|
|
315
|
+
|
|
316
|
+
> 📖 [Integration Guide](https://docs.soyio.id/docs/integration-guide/consent/introduction)
|
|
317
|
+
|
|
318
|
+
A **`consent`** is a component that renders a checkbox with a legal text, which the user can check to give their consent to a specific agreement.
|
|
319
|
+
|
|
320
|
+
```jsx
|
|
321
|
+
import { View, StyleSheet } from "react-native";
|
|
322
|
+
import { ConsentBox } from "@soyio/soyio-rn-sdk";
|
|
323
|
+
|
|
324
|
+
export default function App() {
|
|
325
|
+
const options = {
|
|
326
|
+
// uriScheme: "<your-app-scheme>", // Not required for consent
|
|
327
|
+
isSandbox: true, // Optional
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
const consentParams = {
|
|
331
|
+
templateId: "<consent template id>", // Starts with 'constpl_'
|
|
332
|
+
// actionToken: "<action token>", // Optional: To restore state
|
|
333
|
+
// entityId: "<entity id>", // Optional: To check existing consent
|
|
334
|
+
// context: "<context>", // Optional: Additional context
|
|
335
|
+
// optionalReconsentBehavior: "notice", // Optional
|
|
336
|
+
// mandatoryReconsentBehavior: "notice", // Optional
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const handleEvent = (event) => {
|
|
340
|
+
// Check if the event is a consent change
|
|
341
|
+
if (event.eventName === 'CONSENT_CHECKBOX_CHANGE') {
|
|
342
|
+
console.log('Is Selected:', event.isSelected);
|
|
343
|
+
console.log('Action Token:', event.actionToken);
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
return (
|
|
348
|
+
<View style={styles.container}>
|
|
349
|
+
<ConsentBox
|
|
350
|
+
options={options}
|
|
351
|
+
params={consentParams}
|
|
352
|
+
onEvent={handleEvent}
|
|
353
|
+
appearance={{ theme: 'night' }} // Optional: Customize appearance
|
|
354
|
+
showSkeleton={true} // Optional: Show loading skeleton (default: true)
|
|
355
|
+
/>
|
|
356
|
+
</View>
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const styles = StyleSheet.create({
|
|
361
|
+
container: {
|
|
362
|
+
flex: 1,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Consent Events
|
|
368
|
+
|
|
369
|
+
The `onEvent` callback receives events with the following structure:
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
{
|
|
373
|
+
eventName: 'CONSENT_CHECKBOX_CHANGE',
|
|
374
|
+
isSelected: boolean,
|
|
375
|
+
actionToken?: string,
|
|
376
|
+
identifier: string
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
- **`isSelected`**: Boolean value indicating whether the consent checkbox is selected.
|
|
381
|
+
- **`actionToken`**: Token corresponding to the current state. You can use this to restore the consent state later or validate it server-side.
|
|
382
|
+
|
|
383
|
+
### ConsentBox Props
|
|
384
|
+
|
|
385
|
+
| Prop | Type | Default | Description |
|
|
386
|
+
|------|------|---------|-------------|
|
|
387
|
+
| `options` | `SoyioWidgetConsentOptions` | Required | Widget options (uriScheme, isSandbox, etc.) |
|
|
388
|
+
| `params` | `ConsentParams` | Required | Consent parameters (templateId, etc.) |
|
|
389
|
+
| `onEvent` | `(event) => void` | - | Callback for consent events |
|
|
390
|
+
| `appearance` | `SoyioAppearance` | - | Appearance customization |
|
|
391
|
+
| `showSkeleton` | `boolean` | `true` | Show loading skeleton while content loads |
|
|
392
|
+
| `autoHeight` | `boolean` | `true` | Auto-adjust height based on content |
|
|
393
|
+
|
|
394
|
+
### Consent Attribute Descriptions
|
|
395
|
+
|
|
396
|
+
- **`templateId`**: (Required) Identifier of consent template. It must start with `'constpl_'`.
|
|
397
|
+
- **`actionToken`**: (Optional) In case of losing the state of the consent (i.e. app restart), you can use a previously generated `actionToken` to restore the state of the consent.
|
|
398
|
+
- **`entityId`**: (Optional) Identifier of the `entity` associated with a `ConsentAction`. If provided and a consent was previously granted by this entity, the UI will display a message indicating that consent has already been given.
|
|
399
|
+
- **`context`**: (Optional) Additional information that will be saved with the consent. Useful when you want to track the consent from a specific context.
|
|
400
|
+
- **`optionalReconsentBehavior`**: (Optional) Behavior when consent is already given on an optional category (`notice`, `askAgain`, `hide`).
|
|
401
|
+
- **`mandatoryReconsentBehavior`**: (Optional) Behavior when consent is already given on a mandatory category (`notice`, `askAgain`).
|
|
402
|
+
|
|
403
|
+
### 4. Customizing Appearance
|
|
404
|
+
|
|
405
|
+
The `ConsentBox` (and other components) can be customized to match your application's look and feel using the `appearance` prop.
|
|
406
|
+
|
|
407
|
+
#### Available Themes
|
|
408
|
+
|
|
409
|
+
| Theme | Description |
|
|
410
|
+
|-------|-------------|
|
|
411
|
+
| `'soyio'` | Default Soyio theme |
|
|
412
|
+
| `'night'` | Dark mode theme |
|
|
413
|
+
| `'flat'` | Flat minimal theme |
|
|
414
|
+
|
|
415
|
+
```jsx
|
|
416
|
+
<ConsentBox
|
|
417
|
+
options={options}
|
|
418
|
+
params={consentParams}
|
|
419
|
+
appearance={{
|
|
420
|
+
theme: 'night',
|
|
421
|
+
variables: {
|
|
422
|
+
colorPrimary: '#6366f1',
|
|
423
|
+
colorBackground: '#0f172a',
|
|
424
|
+
borderRadius: '8px',
|
|
425
|
+
},
|
|
426
|
+
}}
|
|
427
|
+
/>
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
#### TypeScript Types
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
import type { SoyioAppearance, SoyioTheme } from '@soyio/soyio-rn-sdk';
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
For a full list of available customization options and examples, please refer to the [Appearance Customization Guide](https://docs.soyio.id/integration-guide/appearance).
|
|
437
|
+
|
|
314
438
|
### Event Handling
|
|
315
439
|
|
|
316
440
|
The `SoyioWidget` component supports the following event handlers:
|
|
317
441
|
|
|
318
442
|
- **`onSuccess`**: Called when the verification/authentication process completes successfully
|
|
443
|
+
- **`onEvent`**: Called for widget events (e.g., consent checkbox changes, tooltip state updates)
|
|
444
|
+
- **`onReady`**: Called when the webview finishes loading
|
|
319
445
|
|
|
320
446
|
## InAppBrowser Integration
|
|
321
447
|
|
|
@@ -407,7 +533,7 @@ The InAppBrowser functions support the following callback handlers:
|
|
|
407
533
|
|
|
408
534
|
#### Attribute Descriptions
|
|
409
535
|
|
|
410
|
-
- **`uriScheme`**: (Required) The URI scheme for your application
|
|
536
|
+
- **`uriScheme`**: (Required for Disclosure and Auth) The URI scheme for your application. It is used to return control to your app after completing the flow in an In-App Browser or when using external authentication flows like Passkeys. The monolith uses this scheme to build the redirect URL (e.g., `<your-app-scheme>://success`) when the verification process finishes. Not used in the `ConsentBox`.
|
|
411
537
|
- **`companyId`**: (Optional) The unique identifier for the company, must start with `'com_'`.
|
|
412
538
|
- **`userReference`**: (Optional) A reference identifier provided by the company for the user engaging with the widget. This identifier is used in events (`onEvent` and `webhooks`) to inform the company which user the events are associated with.
|
|
413
539
|
- **`userEmail`**: (Optional) The user's email address.
|
|
@@ -421,17 +547,68 @@ The InAppBrowser functions support the following callback handlers:
|
|
|
421
547
|
|
|
422
548
|
This package includes TypeScript declarations.
|
|
423
549
|
|
|
424
|
-
|
|
550
|
+
### Development & Testing
|
|
425
551
|
|
|
426
|
-
|
|
552
|
+
#### 1. Installation
|
|
553
|
+
|
|
554
|
+
To develop the package, use `yarn` to install dependencies:
|
|
427
555
|
|
|
428
556
|
```sh
|
|
429
557
|
yarn install
|
|
430
558
|
```
|
|
431
559
|
|
|
432
|
-
|
|
560
|
+
#### 2. Building
|
|
561
|
+
|
|
562
|
+
Build the package using:
|
|
433
563
|
|
|
434
564
|
```sh
|
|
435
|
-
|
|
436
|
-
npm pack
|
|
565
|
+
yarn build # Runs both ESM and CJS builds
|
|
437
566
|
```
|
|
567
|
+
|
|
568
|
+
#### 3. Smoke Testing / Local Development
|
|
569
|
+
|
|
570
|
+
This repo includes a React Native app under `example/app` to smoke test the SDK during development.
|
|
571
|
+
|
|
572
|
+
1. Install the example app dependencies:
|
|
573
|
+
```sh
|
|
574
|
+
cd example/app
|
|
575
|
+
yarn install
|
|
576
|
+
```
|
|
577
|
+
2. (Optional) Use the helper script:
|
|
578
|
+
```sh
|
|
579
|
+
yarn smoke:setup
|
|
580
|
+
```
|
|
581
|
+
3. Replace the placeholder IDs in `example/app/App.tsx`.
|
|
582
|
+
4. Run the platform helper scripts if you prefer:
|
|
583
|
+
```sh
|
|
584
|
+
yarn smoke:ios
|
|
585
|
+
yarn smoke:android
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
**iOS**
|
|
589
|
+
|
|
590
|
+
1. Install pods:
|
|
591
|
+
```sh
|
|
592
|
+
cd example/app/ios
|
|
593
|
+
bundle install
|
|
594
|
+
bundle exec pod install
|
|
595
|
+
```
|
|
596
|
+
2. Run the app:
|
|
597
|
+
```sh
|
|
598
|
+
cd ..
|
|
599
|
+
yarn ios
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
**Android**
|
|
603
|
+
|
|
604
|
+
1. Ensure you have an emulator or device running.
|
|
605
|
+
2. JDK 17 is required for Android builds.
|
|
606
|
+
3. Run the app:
|
|
607
|
+
```sh
|
|
608
|
+
yarn smoke:android
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
Notes:
|
|
612
|
+
|
|
613
|
+
- The app pulls the SDK from `file:../..`, so local changes are reflected immediately.
|
|
614
|
+
- Metro is configured to watch the repo root (`example/app/metro.config.js`).
|
package/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { SoyioWidget } from './src/webview';
|
|
2
|
+
export { ConsentBox } from './src/consent';
|
|
2
3
|
|
|
3
4
|
export {
|
|
4
5
|
openDisclosure,
|
|
@@ -9,7 +10,13 @@ export type {
|
|
|
9
10
|
SoyioWidgetOptions,
|
|
10
11
|
DisclosureParams,
|
|
11
12
|
AuthRequestParams,
|
|
13
|
+
ConsentParams,
|
|
14
|
+
ConsentBoxRef,
|
|
15
|
+
ConsentState,
|
|
16
|
+
ConsentCheckboxChangeEvent,
|
|
12
17
|
SoyioWidgetProps,
|
|
18
|
+
SoyioAppearance,
|
|
19
|
+
SoyioTheme,
|
|
13
20
|
} from './src/types';
|
|
14
21
|
|
|
15
22
|
export type {
|
package/package/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { SoyioWidget } from './src/webview';
|
|
2
|
+
export { ConsentBox } from './src/consent';
|
|
2
3
|
export { openDisclosure, openAuthenticationRequest, } from './src/inapp-browser';
|
|
3
|
-
export type { SoyioWidgetOptions, DisclosureParams, AuthRequestParams, SoyioWidgetProps, } from './src/types';
|
|
4
|
+
export type { SoyioWidgetOptions, DisclosureParams, AuthRequestParams, ConsentParams, ConsentBoxRef, ConsentState, ConsentCheckboxChangeEvent, SoyioWidgetProps, SoyioAppearance, SoyioTheme, } from './src/types';
|
|
4
5
|
export type { OpenDisclosureParams, OpenAuthRequestParams, } from './src/inapp-browser';
|
package/package/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openAuthenticationRequest = exports.openDisclosure = exports.SoyioWidget = void 0;
|
|
3
|
+
exports.openAuthenticationRequest = exports.openDisclosure = exports.ConsentBox = exports.SoyioWidget = void 0;
|
|
4
4
|
var webview_1 = require("./src/webview");
|
|
5
5
|
Object.defineProperty(exports, "SoyioWidget", { enumerable: true, get: function () { return webview_1.SoyioWidget; } });
|
|
6
|
+
var consent_1 = require("./src/consent");
|
|
7
|
+
Object.defineProperty(exports, "ConsentBox", { enumerable: true, get: function () { return consent_1.ConsentBox; } });
|
|
6
8
|
var inapp_browser_1 = require("./src/inapp-browser");
|
|
7
9
|
Object.defineProperty(exports, "openDisclosure", { enumerable: true, get: function () { return inapp_browser_1.openDisclosure; } });
|
|
8
10
|
Object.defineProperty(exports, "openAuthenticationRequest", { enumerable: true, get: function () { return inapp_browser_1.openAuthenticationRequest; } });
|
package/package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAAnC,sGAAA,WAAW,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAAnC,sGAAA,WAAW,OAAA;AACpB,yCAA2C;AAAlC,qGAAA,UAAU,OAAA;AAEnB,qDAG6B;AAF3B,+GAAA,cAAc,OAAA;AACd,0HAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { SoyioTheme } from '../types';
|
|
4
|
+
export interface ConsentSkeletonProps {
|
|
5
|
+
theme?: SoyioTheme;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
}
|
|
9
|
+
export declare const ConsentSkeleton: React.FC<ConsentSkeletonProps>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ConsentSkeleton = void 0;
|
|
37
|
+
var react_1 = __importStar(require("react"));
|
|
38
|
+
var react_native_1 = require("react-native");
|
|
39
|
+
var ANIMATION_DURATION = 1500;
|
|
40
|
+
var styles = react_native_1.StyleSheet.create({
|
|
41
|
+
container: {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
top: 0,
|
|
44
|
+
left: 0,
|
|
45
|
+
right: 0,
|
|
46
|
+
minHeight: 112,
|
|
47
|
+
borderWidth: 1,
|
|
48
|
+
borderRadius: 4,
|
|
49
|
+
zIndex: 1,
|
|
50
|
+
},
|
|
51
|
+
mainContainer: {
|
|
52
|
+
padding: 16,
|
|
53
|
+
gap: 12,
|
|
54
|
+
},
|
|
55
|
+
topRow: {
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
gap: 12,
|
|
59
|
+
},
|
|
60
|
+
bottomRow: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'flex-start',
|
|
63
|
+
gap: 12,
|
|
64
|
+
},
|
|
65
|
+
shimmerContainer: {
|
|
66
|
+
overflow: 'hidden',
|
|
67
|
+
borderRadius: 4,
|
|
68
|
+
},
|
|
69
|
+
shimmerBase: {
|
|
70
|
+
width: '100%',
|
|
71
|
+
height: '100%',
|
|
72
|
+
overflow: 'hidden',
|
|
73
|
+
},
|
|
74
|
+
shimmerHighlight: {
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
top: 0,
|
|
77
|
+
bottom: 0,
|
|
78
|
+
width: 60,
|
|
79
|
+
opacity: 0.5,
|
|
80
|
+
},
|
|
81
|
+
iconCircle: {
|
|
82
|
+
width: 32,
|
|
83
|
+
height: 32,
|
|
84
|
+
borderRadius: 16,
|
|
85
|
+
},
|
|
86
|
+
titleBar: {
|
|
87
|
+
height: 16,
|
|
88
|
+
flex: 0.3,
|
|
89
|
+
},
|
|
90
|
+
expandButton: {
|
|
91
|
+
width: 48,
|
|
92
|
+
height: 20,
|
|
93
|
+
marginLeft: 'auto',
|
|
94
|
+
},
|
|
95
|
+
checkboxContainer: {
|
|
96
|
+
width: 32,
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
justifyContent: 'center',
|
|
99
|
+
},
|
|
100
|
+
checkbox: {
|
|
101
|
+
width: 16,
|
|
102
|
+
height: 16,
|
|
103
|
+
},
|
|
104
|
+
textContent: {
|
|
105
|
+
flex: 1,
|
|
106
|
+
gap: 8,
|
|
107
|
+
},
|
|
108
|
+
textLine1: {
|
|
109
|
+
height: 14,
|
|
110
|
+
width: '80%',
|
|
111
|
+
},
|
|
112
|
+
textLine2: {
|
|
113
|
+
height: 14,
|
|
114
|
+
width: '60%',
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
var ConsentSkeleton = function (_a) {
|
|
118
|
+
var theme = _a.theme, _b = _a.visible, visible = _b === void 0 ? true : _b, style = _a.style;
|
|
119
|
+
var systemColorScheme = (0, react_native_1.useColorScheme)();
|
|
120
|
+
var isDarkMode = theme === 'night' || (!theme && systemColorScheme === 'dark');
|
|
121
|
+
var shimmerAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
122
|
+
var fadeAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
|
|
123
|
+
(0, react_1.useEffect)(function () {
|
|
124
|
+
var shimmerLoop = react_native_1.Animated.loop(react_native_1.Animated.timing(shimmerAnim, {
|
|
125
|
+
toValue: 1,
|
|
126
|
+
duration: ANIMATION_DURATION,
|
|
127
|
+
useNativeDriver: true,
|
|
128
|
+
}));
|
|
129
|
+
shimmerLoop.start();
|
|
130
|
+
return function () { return shimmerLoop.stop(); };
|
|
131
|
+
}, [shimmerAnim]);
|
|
132
|
+
(0, react_1.useEffect)(function () {
|
|
133
|
+
if (!visible) {
|
|
134
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
135
|
+
toValue: 0,
|
|
136
|
+
duration: 200,
|
|
137
|
+
useNativeDriver: true,
|
|
138
|
+
}).start();
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
fadeAnim.setValue(1);
|
|
142
|
+
}
|
|
143
|
+
}, [visible, fadeAnim]);
|
|
144
|
+
var backgroundColor = isDarkMode ? '#1E293B' : '#FFFFFF';
|
|
145
|
+
var borderColor = isDarkMode ? '#334155' : '#E5E7EB';
|
|
146
|
+
var shimmerBaseColor = isDarkMode ? '#334155' : '#f0f0f0';
|
|
147
|
+
var shimmerTranslateX = shimmerAnim.interpolate({
|
|
148
|
+
inputRange: [0, 1],
|
|
149
|
+
outputRange: [-100, 100],
|
|
150
|
+
});
|
|
151
|
+
var renderShimmerBox = function (boxStyle) { return (<react_native_1.View style={[styles.shimmerContainer, boxStyle]}>
|
|
152
|
+
<react_native_1.View style={[styles.shimmerBase, { backgroundColor: shimmerBaseColor }]}>
|
|
153
|
+
<react_native_1.Animated.View style={[
|
|
154
|
+
styles.shimmerHighlight,
|
|
155
|
+
{
|
|
156
|
+
transform: [{ translateX: shimmerTranslateX }],
|
|
157
|
+
backgroundColor: isDarkMode ? '#475569' : '#e0e0e0',
|
|
158
|
+
},
|
|
159
|
+
]}/>
|
|
160
|
+
</react_native_1.View>
|
|
161
|
+
</react_native_1.View>); };
|
|
162
|
+
if (!visible) {
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
return (<react_native_1.Animated.View style={[
|
|
166
|
+
styles.container,
|
|
167
|
+
{
|
|
168
|
+
backgroundColor: backgroundColor,
|
|
169
|
+
borderColor: borderColor,
|
|
170
|
+
opacity: fadeAnim,
|
|
171
|
+
},
|
|
172
|
+
style,
|
|
173
|
+
]}>
|
|
174
|
+
<react_native_1.View style={styles.mainContainer}>
|
|
175
|
+
{/* Top row: icon, title, expand button */}
|
|
176
|
+
<react_native_1.View style={styles.topRow}>
|
|
177
|
+
{renderShimmerBox(styles.iconCircle)}
|
|
178
|
+
{renderShimmerBox(styles.titleBar)}
|
|
179
|
+
{renderShimmerBox(styles.expandButton)}
|
|
180
|
+
</react_native_1.View>
|
|
181
|
+
|
|
182
|
+
{/* Bottom row: checkbox and text lines */}
|
|
183
|
+
<react_native_1.View style={styles.bottomRow}>
|
|
184
|
+
<react_native_1.View style={styles.checkboxContainer}>
|
|
185
|
+
{renderShimmerBox(styles.checkbox)}
|
|
186
|
+
</react_native_1.View>
|
|
187
|
+
<react_native_1.View style={styles.textContent}>
|
|
188
|
+
{renderShimmerBox(styles.textLine1)}
|
|
189
|
+
{renderShimmerBox(styles.textLine2)}
|
|
190
|
+
</react_native_1.View>
|
|
191
|
+
</react_native_1.View>
|
|
192
|
+
</react_native_1.View>
|
|
193
|
+
</react_native_1.Animated.View>);
|
|
194
|
+
};
|
|
195
|
+
exports.ConsentSkeleton = ConsentSkeleton;
|
|
196
|
+
//# sourceMappingURL=ConsentSkeleton.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsentSkeleton.jsx","sourceRoot":"/","sources":["src/components/ConsentSkeleton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAiD;AACjD,6CAKsB;AAWtB,IAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,GAAG;QACd,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,MAAM,EAAE,CAAC;KACV;IACD,aAAa,EA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AAC,CAEF;MAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAChC;QAAA,CAAC,yCAAyC,CAC1C;QAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACzB;UAAA,CAAC,gBAAgB,CAAC,MAAM,CAAC,UAAU,CAAC,CACpC;UAAA,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAClC;UAAA,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CAAC,CACxC;QAAA,EAAE,mBAAI,CAEN;;QAAA,CAAC,yCAAyC,CAC1C;QAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;UAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CACpC;YAAA,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CACpC;UAAA,EAAE,mBAAI,CACN;UAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC9B;YAAA,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,CACnC;YAAA,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,CACrC;UAAA,EAAE,mBAAI,CACR;QAAA,EAAE,mBAAI,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,uBAAQ,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC,CAAC;AAlGW,QAAA,eAAe,mBAkG1B"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Tooltip = void 0;
|
|
37
|
+
var react_1 = __importStar(require("react"));
|
|
38
|
+
var react_native_1 = require("react-native");
|
|
39
|
+
var styles = react_native_1.StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
backgroundColor: 'rgba(30, 30, 30, 0.9)',
|
|
43
|
+
paddingVertical: 10,
|
|
44
|
+
paddingHorizontal: 16,
|
|
45
|
+
borderRadius: 8,
|
|
46
|
+
maxWidth: 300,
|
|
47
|
+
zIndex: 99999,
|
|
48
|
+
shadowColor: '#000',
|
|
49
|
+
shadowOffset: {
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 5,
|
|
52
|
+
},
|
|
53
|
+
shadowOpacity: 0.3,
|
|
54
|
+
shadowRadius: 15,
|
|
55
|
+
elevation: 5,
|
|
56
|
+
},
|
|
57
|
+
text: {
|
|
58
|
+
color: '#f5f5f5',
|
|
59
|
+
fontSize: 14,
|
|
60
|
+
fontFamily: 'System', // Fallback to system font
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
var Tooltip = function (_a) {
|
|
64
|
+
var text = _a.text, x = _a.x, y = _a.y, visible = _a.visible, containerWidth = _a.containerWidth;
|
|
65
|
+
var _b = (0, react_1.useState)({ width: 0, height: 0 }), layout = _b[0], setLayout = _b[1];
|
|
66
|
+
var fadeAnim = (0, react_1.useMemo)(function () { return new react_native_1.Animated.Value(0); }, []);
|
|
67
|
+
react_1.default.useEffect(function () {
|
|
68
|
+
react_native_1.Animated.timing(fadeAnim, {
|
|
69
|
+
toValue: visible ? 1 : 0,
|
|
70
|
+
duration: 200,
|
|
71
|
+
useNativeDriver: true,
|
|
72
|
+
}).start();
|
|
73
|
+
}, [visible, fadeAnim]);
|
|
74
|
+
var handleLayout = function (event) {
|
|
75
|
+
var _a = event.nativeEvent.layout, width = _a.width, height = _a.height;
|
|
76
|
+
setLayout({ width: width, height: height });
|
|
77
|
+
};
|
|
78
|
+
var getPosition = function () {
|
|
79
|
+
if (!layout.width || !layout.height)
|
|
80
|
+
return { top: -1000, left: -1000 };
|
|
81
|
+
var margin = 10;
|
|
82
|
+
// Default to top
|
|
83
|
+
var top = y - layout.height - margin;
|
|
84
|
+
var left = x - layout.width / 2;
|
|
85
|
+
// Check bounds
|
|
86
|
+
// Avoid left edge
|
|
87
|
+
if (left < margin) {
|
|
88
|
+
left = margin;
|
|
89
|
+
}
|
|
90
|
+
// Avoid right edge
|
|
91
|
+
if (left + layout.width > containerWidth - margin) {
|
|
92
|
+
left = containerWidth - layout.width - margin;
|
|
93
|
+
}
|
|
94
|
+
// Note: vertical checks would require container height, strictly speaking.
|
|
95
|
+
// For now assuming sticking to 'top' is preferred unless we want to flip.
|
|
96
|
+
// Given the widget behavior, top is default.
|
|
97
|
+
return { top: top, left: left };
|
|
98
|
+
};
|
|
99
|
+
var _c = getPosition(), top = _c.top, left = _c.left;
|
|
100
|
+
// If not visible and not animating out, we can hide it to prevent touches?
|
|
101
|
+
// Animated opacity handles visibility visual.
|
|
102
|
+
// We use pointerEvents="none" to let touches pass through if transparent.
|
|
103
|
+
return (<react_native_1.Animated.View style={[
|
|
104
|
+
styles.container,
|
|
105
|
+
{
|
|
106
|
+
opacity: fadeAnim,
|
|
107
|
+
top: top,
|
|
108
|
+
left: left,
|
|
109
|
+
},
|
|
110
|
+
]} onLayout={handleLayout} pointerEvents="none">
|
|
111
|
+
<react_native_1.Text style={styles.text}>{text}</react_native_1.Text>
|
|
112
|
+
</react_native_1.Animated.View>);
|
|
113
|
+
};
|
|
114
|
+
exports.Tooltip = Tooltip;
|
|
115
|
+
//# sourceMappingURL=Tooltip.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.jsx","sourceRoot":"/","sources":["src/components/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAiD;AACjD,6CAMsB;AAUtB,IAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,uBAAuB;QACxC,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;QACf,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,MAAM;QACnB,YAAY,EAAE;YACZ,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;SACV;QACD,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B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Tooltip = exports.ConsentSkeleton = void 0;
|
|
4
|
+
var ConsentSkeleton_1 = require("./ConsentSkeleton");
|
|
5
|
+
Object.defineProperty(exports, "ConsentSkeleton", { enumerable: true, get: function () { return ConsentSkeleton_1.ConsentSkeleton; } });
|
|
6
|
+
var Tooltip_1 = require("./Tooltip");
|
|
7
|
+
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["src/components/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAExB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { ConsentBoxRef, ConsentCheckboxChangeEvent, ConsentParams, SoyioAppearance, SoyioWidgetConsentOptions } from './types';
|
|
4
|
+
export type ConsentBoxProps = ViewProps & {
|
|
5
|
+
options: SoyioWidgetConsentOptions;
|
|
6
|
+
params: ConsentParams;
|
|
7
|
+
onEvent?: (event: ConsentCheckboxChangeEvent) => void;
|
|
8
|
+
autoHeight?: boolean;
|
|
9
|
+
showSkeleton?: boolean;
|
|
10
|
+
appearance?: SoyioAppearance;
|
|
11
|
+
};
|
|
12
|
+
export declare const ConsentBox: React.ForwardRefExoticComponent<ViewProps & {
|
|
13
|
+
options: SoyioWidgetConsentOptions;
|
|
14
|
+
params: ConsentParams;
|
|
15
|
+
onEvent?: (event: ConsentCheckboxChangeEvent) => void;
|
|
16
|
+
autoHeight?: boolean;
|
|
17
|
+
showSkeleton?: boolean;
|
|
18
|
+
appearance?: SoyioAppearance;
|
|
19
|
+
} & React.RefAttributes<ConsentBoxRef>>;
|