@encorekit/web-sdk 2.0.4 → 2.0.6
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 +112 -40
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/encore.min.js +1 -1
- package/dist/umd/encore.min.js.map +1 -1
- package/embed/README.md +82 -367
- package/examples/ios-webview/EncoreURLBuilder.swift +179 -61
- package/examples/ios-webview/README.md +75 -354
- package/examples/ios-webview/SimpleEncoreView.swift +49 -36
- package/examples/ios-webview/SimpleExample.swift +30 -86
- package/package.json +2 -7
- package/types/api/APIClient.d.ts +3 -1
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/errorReportLimits.d.ts +50 -0
- package/types/api/errorReportLimits.d.ts.map +1 -0
- package/types/api/generated/types.d.ts +54 -7
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/core/Encore.d.ts +25 -2
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/PlacementBuilder.d.ts +14 -2
- package/types/core/PlacementBuilder.d.ts.map +1 -1
- package/types/core/TransactionStore.d.ts +57 -13
- package/types/core/TransactionStore.d.ts.map +1 -1
- package/types/core/VerificationPoller.d.ts.map +1 -1
- package/types/core/claimBehavior.d.ts +28 -0
- package/types/core/claimBehavior.d.ts.map +1 -0
- package/types/core/errorContext.d.ts +18 -0
- package/types/core/errorContext.d.ts.map +1 -0
- package/types/core/errorType.d.ts +59 -0
- package/types/core/errorType.d.ts.map +1 -0
- package/types/core/hostDisplay.d.ts +50 -0
- package/types/core/hostDisplay.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +146 -1
- package/types/types.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +20 -0
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/PrimerScreen.d.ts +18 -11
- package/types/ui/PrimerScreen.d.ts.map +1 -1
- package/types/ui/RedemptionScreen.d.ts +15 -19
- package/types/ui/RedemptionScreen.d.ts.map +1 -1
- package/types/ui/RewardActions.d.ts +26 -0
- package/types/ui/RewardActions.d.ts.map +1 -1
- package/types/ui/brandComponents.d.ts.map +1 -1
- package/types/ui/styles.d.ts.map +1 -1
- package/types/utils/logger.d.ts +11 -1
- package/types/utils/logger.d.ts.map +1 -1
- package/embed/index.html +0 -57
- package/embed/styles.css +0 -154
- package/examples/ios-webview/EncoreWebViewBridge.swift +0 -419
- package/examples/ios-webview/ExampleViewController.swift +0 -233
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Redemption Screen
|
|
2
|
+
* Redemption Screen — the ready state, shown by redeem().
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* separate builders — extensible by adding an entry, never by threading more
|
|
4
|
+
* The narrative is a function of the claim's use case, expressed as a variant map
|
|
5
|
+
* of separate builders — extensible by adding an entry, never by threading more
|
|
7
6
|
* conditionals through one render path:
|
|
8
7
|
*
|
|
9
|
-
* - 'activation' (
|
|
10
|
-
*
|
|
11
|
-
* ledger (host row Active with the derived trial-end detail, partner Pending).
|
|
12
|
-
* - 'reward' (
|
|
13
|
-
* host-unlock moment — minimal congratulations + the pending partner row.
|
|
8
|
+
* - 'activation' (a reduceChurn claim with a nameable host): the host's own
|
|
9
|
+
* conversion has happened — dual-brand lockup, "your trial is active", and the
|
|
10
|
+
* deal ledger (host row Active with the derived trial-end detail, partner Pending).
|
|
11
|
+
* - 'reward' (a rewardUsers claim, or any claim whose host cannot be named): there
|
|
12
|
+
* was no host-unlock moment — minimal congratulations + the pending partner row.
|
|
14
13
|
*
|
|
15
|
-
* Both
|
|
16
|
-
*
|
|
14
|
+
* Both share the chrome: reassurance note + one CTA that sends the user to the
|
|
15
|
+
* advertiser inside the click gesture.
|
|
17
16
|
*/
|
|
18
|
-
type RedemptionVariant = 'activation' | 'reward';
|
|
19
|
-
interface RedemptionScreenConfig {
|
|
17
|
+
export type RedemptionVariant = 'activation' | 'reward';
|
|
18
|
+
export interface RedemptionScreenConfig {
|
|
20
19
|
/** Which narrative to render. Defaults to 'reward' (the safe minimal story). */
|
|
21
20
|
variant?: RedemptionVariant;
|
|
22
21
|
/** Display reward copy, e.g. "30 days of free Apple Music". */
|
|
@@ -26,10 +25,7 @@ interface RedemptionScreenConfig {
|
|
|
26
25
|
/** Partner logo (preferred) or a fallback image. */
|
|
27
26
|
logoUrl?: string;
|
|
28
27
|
imageUrl?: string;
|
|
29
|
-
/**
|
|
30
|
-
* Host product context — consumed by the 'activation' variant only (resolved
|
|
31
|
-
* from live remote config + the redeem() host override by the caller).
|
|
32
|
-
*/
|
|
28
|
+
/** Host product context — the 'activation' variant only. */
|
|
33
29
|
host?: {
|
|
34
30
|
name?: string;
|
|
35
31
|
trialPeriod?: string;
|
|
@@ -39,11 +35,11 @@ interface RedemptionScreenConfig {
|
|
|
39
35
|
detail?: string;
|
|
40
36
|
logoUrl?: string;
|
|
41
37
|
};
|
|
42
|
-
/** Optional CTA override; default is exactly "Claim your reward". */
|
|
38
|
+
/** Optional CTA override; the default is exactly "Claim your reward". */
|
|
43
39
|
buttonText?: string;
|
|
44
40
|
}
|
|
45
41
|
interface RedemptionScreenEventMap extends Record<string, unknown> {
|
|
46
|
-
/** The user tapped the claim CTA — caller fires the advertiser redirect. */
|
|
42
|
+
/** The user tapped the claim CTA — the caller fires the advertiser redirect. */
|
|
47
43
|
continue: undefined;
|
|
48
44
|
}
|
|
49
45
|
export declare class RedemptionScreen {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedemptionScreen.d.ts","sourceRoot":"","sources":["../../src/ui/RedemptionScreen.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"RedemptionScreen.d.ts","sourceRoot":"","sources":["../../src/ui/RedemptionScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,gFAAgF;IAChF,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,8CAA8C;QAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,gEAAgE;QAChE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,wBAAyB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,gFAAgF;IAChF,QAAQ,EAAE,SAAS,CAAC;CACrB;AA0ED,qBAAa,gBAAgB;;gBAKf,MAAM,EAAE,sBAAsB;IAK1C,MAAM,IAAI,WAAW;IAsCrB,EAAE,CAAC,CAAC,SAAS,MAAM,wBAAwB,EACzC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,GACtD,MAAM,IAAI;IAIb,OAAO,IAAI,IAAI;CAQhB"}
|
|
@@ -26,12 +26,38 @@ export declare const REWARD_COPY: {
|
|
|
26
26
|
readonly trust: "No charges until trial ends, cancel anytime.";
|
|
27
27
|
readonly primary: "Claim gift";
|
|
28
28
|
readonly secondary: "No thanks";
|
|
29
|
+
/** The secondary's other job — see `RewardActionsOptions.secondary`. */
|
|
30
|
+
readonly next: "Next offer";
|
|
29
31
|
};
|
|
30
32
|
export interface RewardActionsOptions {
|
|
31
33
|
/** Claim the selected offer (the variant's `claimOffer` action). */
|
|
32
34
|
onClaim: () => void;
|
|
33
35
|
/** Dismiss the sheet (the variant's `close` action). */
|
|
34
36
|
onDecline: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Advance the carousel's selection. Required only for `secondary: 'next'`;
|
|
39
|
+
* ignored otherwise, so a decline-mode caller need not supply one.
|
|
40
|
+
*/
|
|
41
|
+
onNext?: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* WHAT THE SECONDARY BUTTON DOES. Defaults to `'decline'`, which is the
|
|
44
|
+
* "No thanks" every integration has today.
|
|
45
|
+
*
|
|
46
|
+
* `'next'` makes it "Next offer": it advances the carousel's SELECTION — the
|
|
47
|
+
* same state the Claim CTA acts on — with the same animated scroll a swipe or
|
|
48
|
+
* a nav arrow produces. For a sheet the user cannot dismiss, that is the
|
|
49
|
+
* honest button: "No thanks" on a sheet with no way out is a control that
|
|
50
|
+
* lies about what it does, and the slot is better spent on the thing they
|
|
51
|
+
* actually want, which is to see the other offers.
|
|
52
|
+
*
|
|
53
|
+
* `'none'` renders nothing. Only for `'next'` with a single offer, where the
|
|
54
|
+
* button would be permanently inert.
|
|
55
|
+
*
|
|
56
|
+
* ⚠️ A publisher's own site keeps `'decline'`. `enabled` below can switch
|
|
57
|
+
* CLAIMING off and the decline stays live precisely so a user can always
|
|
58
|
+
* leave; anything but `'decline'` is for a host that leaves for them.
|
|
59
|
+
*/
|
|
60
|
+
secondary?: 'decline' | 'next' | 'none';
|
|
35
61
|
/**
|
|
36
62
|
* Overrides the default trust line. Present so a publisher whose reward is not a
|
|
37
63
|
* free trial is not stuck asserting "No charges until trial ends" — the default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RewardActions.d.ts","sourceRoot":"","sources":["../../src/ui/RewardActions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElF,mFAAmF;AACnF,eAAO,MAAM,WAAW;;;;
|
|
1
|
+
{"version":3,"file":"RewardActions.d.ts","sourceRoot":"","sources":["../../src/ui/RewardActions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAElF,mFAAmF;AACnF,eAAO,MAAM,WAAW;;;;IAItB,wEAAwE;;CAEhE,CAAC;AAEX,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wDAAwD;IACxD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACxC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,aAAa;;gBAwBZ,OAAO,EAAE,oBAAoB;IAIzC,MAAM,IAAI,WAAW;IA8DrB;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAW/C,OAAO,IAAI,IAAI;CAWhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brandComponents.d.ts","sourceRoot":"","sources":["../../src/ui/brandComponents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"brandComponents.d.ts","sourceRoot":"","sources":["../../src/ui/brandComponents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8CD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,WAAW,CAwBpF;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,QAAQ,CAAC;IAChB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAA;KAAE,CAAC;CACtD;AAqCD,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,WAAW,CAKjE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,IAAI,GAClB,iBAAiB,CAOnB"}
|
package/types/ui/styles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;IAI/B,0FAA0F;;CAElF,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/ui/styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH,eAAO,MAAM,OAAO;;;CAGV,CAAC;AAGX,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;IAI/B,0FAA0F;;CAElF,CAAC;AAEX;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAwgED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,GAAE,cAAmB,GAAG,IAAI,CAgB7D;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAMnC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAe1D;AAED;;GAEG;AACH,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAE/C;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
package/types/utils/logger.d.ts
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
* Logger utility for Encore Web SDK
|
|
3
3
|
* Respects configured log level and prefixes all messages
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Log verbosity, as an ordered ladder: each level includes the ones below it,
|
|
7
|
+
* so `'warn'` shows warnings and errors.
|
|
8
|
+
*
|
|
9
|
+
* The rungs and their order match the Swift and Android SDKs
|
|
10
|
+
* (`none < error < warn < info < debug`), and so does the `'none'` default.
|
|
11
|
+
* Before this, web had only `'none' | 'debug'`, so a publisher who wanted to
|
|
12
|
+
* see SDK errors had to accept every debug line with them.
|
|
13
|
+
*/
|
|
14
|
+
export declare const LOG_LEVELS: readonly ["none", "error", "warn", "info", "debug"];
|
|
15
|
+
export type LogLevel = (typeof LOG_LEVELS)[number];
|
|
6
16
|
declare class Logger {
|
|
7
17
|
#private;
|
|
8
18
|
setLogLevel(level: LogLevel): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,qDAAsD,CAAC;AAE9E,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAOnD,cAAM,MAAM;;IAGV,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAIlC,WAAW,IAAI,QAAQ;IAQvB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B;;OAEG;IACH,QAAQ,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAGnC;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
package/embed/index.html
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
|
|
6
|
-
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
7
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
8
|
-
<title>Encore Embed</title>
|
|
9
|
-
<link rel="stylesheet" href="embed/styles.css">
|
|
10
|
-
<!-- Mobile-native styles for iOS bottom sheet UI -->
|
|
11
|
-
<link rel="stylesheet" href="embed/mobile-styles.css">
|
|
12
|
-
<!-- Override Web SDK modal to work as bottom sheet -->
|
|
13
|
-
<link rel="stylesheet" href="embed/mobile-overrides.css">
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<!--
|
|
17
|
-
This page is designed to be embedded in iOS WKWebView.
|
|
18
|
-
It remains transparent until an offer is presented.
|
|
19
|
-
-->
|
|
20
|
-
|
|
21
|
-
<!-- Loading indicator (hidden by default) -->
|
|
22
|
-
<div id="encore-loading" class="encore-loading" style="display: none;">
|
|
23
|
-
<div class="encore-spinner"></div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<!-- Debug panel (only shown in development) -->
|
|
27
|
-
<div id="encore-debug" class="encore-debug" style="display: none;">
|
|
28
|
-
<div class="debug-header">
|
|
29
|
-
<span>Encore Debug</span>
|
|
30
|
-
<div class="debug-controls">
|
|
31
|
-
<button id="debug-minimize" title="Minimize">−</button>
|
|
32
|
-
<button id="debug-close" title="Close">×</button>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
<div id="debug-log" class="debug-log"></div>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<!-- Credit Claimed Confirmation View -->
|
|
39
|
-
<div id="encore-claimed" class="encore-claimed-view" style="display: none;">
|
|
40
|
-
<div class="claimed-content">
|
|
41
|
-
<div class="claimed-checkmark">✓</div>
|
|
42
|
-
<h2 class="claimed-title">Credit Claimed!</h2>
|
|
43
|
-
<p class="claimed-message">Your reward has been unlocked</p>
|
|
44
|
-
<button id="claimed-done" class="encore-button encore-button-primary">Done</button>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<!-- Load Encore Web SDK (local build) -->
|
|
49
|
-
<script src="embed/dist/encore.min.js"></script>
|
|
50
|
-
|
|
51
|
-
<!-- Load iOS Bridge -->
|
|
52
|
-
<script src="embed/dist/bridge.min.js"></script>
|
|
53
|
-
|
|
54
|
-
<!-- Load Application Logic -->
|
|
55
|
-
<script src="embed/dist/app.min.js"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
package/embed/styles.css
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encore Embed Styles
|
|
3
|
-
* Minimal styles for the embed container
|
|
4
|
-
* The Web SDK provides its own modal styles
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
* {
|
|
8
|
-
margin: 0;
|
|
9
|
-
padding: 0;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
html, body {
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
/* White background to fill the sheet */
|
|
17
|
-
background: white;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
/* No padding - SwiftUI sheet handles safe areas */
|
|
20
|
-
padding: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* Prevent text selection in embed */
|
|
24
|
-
body {
|
|
25
|
-
-webkit-user-select: none;
|
|
26
|
-
user-select: none;
|
|
27
|
-
-webkit-touch-callout: none;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* Loading indicator */
|
|
31
|
-
.encore-loading {
|
|
32
|
-
position: fixed;
|
|
33
|
-
top: 50%;
|
|
34
|
-
left: 50%;
|
|
35
|
-
transform: translate(-50%, -50%);
|
|
36
|
-
z-index: 9997;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.encore-spinner {
|
|
40
|
-
width: 40px;
|
|
41
|
-
height: 40px;
|
|
42
|
-
border: 4px solid rgba(0, 0, 0, 0.1);
|
|
43
|
-
border-top-color: #000;
|
|
44
|
-
border-radius: 50%;
|
|
45
|
-
animation: encore-spin 1s linear infinite;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@keyframes encore-spin {
|
|
49
|
-
to { transform: rotate(360deg); }
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* Dark mode support */
|
|
53
|
-
@media (prefers-color-scheme: dark) {
|
|
54
|
-
.encore-spinner {
|
|
55
|
-
border-color: rgba(255, 255, 255, 0.1);
|
|
56
|
-
border-top-color: #fff;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Debug panel */
|
|
61
|
-
.encore-debug {
|
|
62
|
-
position: fixed;
|
|
63
|
-
bottom: 0;
|
|
64
|
-
left: 0;
|
|
65
|
-
right: 0;
|
|
66
|
-
max-height: 40vh;
|
|
67
|
-
background: rgba(0, 0, 0, 0.9);
|
|
68
|
-
color: #00ff00;
|
|
69
|
-
font-family: 'Courier New', monospace;
|
|
70
|
-
font-size: 12px;
|
|
71
|
-
z-index: 99999;
|
|
72
|
-
border-top: 2px solid #00ff00;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
transition: max-height 0.3s ease;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.encore-debug.minimized {
|
|
79
|
-
max-height: 40px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.encore-debug.minimized .debug-log {
|
|
83
|
-
display: none;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.encore-debug.minimized .debug-header {
|
|
87
|
-
border-bottom: none;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.debug-header {
|
|
91
|
-
display: flex;
|
|
92
|
-
justify-content: space-between;
|
|
93
|
-
align-items: center;
|
|
94
|
-
padding: 8px 12px;
|
|
95
|
-
background: rgba(0, 0, 0, 0.95);
|
|
96
|
-
border-bottom: 1px solid #00ff00;
|
|
97
|
-
font-weight: bold;
|
|
98
|
-
cursor: pointer;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.debug-controls {
|
|
102
|
-
display: flex;
|
|
103
|
-
gap: 8px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
#debug-minimize,
|
|
107
|
-
#debug-close {
|
|
108
|
-
background: transparent;
|
|
109
|
-
border: 1px solid #00ff00;
|
|
110
|
-
color: #00ff00;
|
|
111
|
-
width: 24px;
|
|
112
|
-
height: 24px;
|
|
113
|
-
border-radius: 50%;
|
|
114
|
-
cursor: pointer;
|
|
115
|
-
font-size: 16px;
|
|
116
|
-
line-height: 1;
|
|
117
|
-
padding: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
#debug-minimize:active,
|
|
121
|
-
#debug-close:active {
|
|
122
|
-
background: rgba(0, 255, 0, 0.2);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.debug-log {
|
|
126
|
-
flex: 1;
|
|
127
|
-
overflow-y: auto;
|
|
128
|
-
padding: 8px 12px;
|
|
129
|
-
-webkit-overflow-scrolling: touch;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.debug-entry {
|
|
133
|
-
margin-bottom: 4px;
|
|
134
|
-
word-break: break-word;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.debug-entry.error {
|
|
138
|
-
color: #ff0000;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.debug-entry.warning {
|
|
142
|
-
color: #ffaa00;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.debug-entry.info {
|
|
146
|
-
color: #00aaff;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/* Ensure Web SDK modal appears above everything */
|
|
150
|
-
:root {
|
|
151
|
-
--encore-modal-z-index: 9998;
|
|
152
|
-
--encore-backdrop-z-index: 9997;
|
|
153
|
-
}
|
|
154
|
-
|