@revenuecat/purchases-ui-js 4.8.11 → 4.8.13
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/components/web-view/WebView.stories.svelte +72 -1
- package/dist/components/web-view/WebView.svelte +5 -0
- package/dist/components/workflows/Screen.svelte +3 -0
- package/dist/components/workflows/Screen.svelte.d.ts +1 -0
- package/dist/components/workflows/Workflow.svelte +3 -0
- package/dist/components/workflows/Workflow.svelte.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import WebView from "./WebView.svelte";
|
|
3
3
|
import { componentDecorator } from "../../stories/component-decorator";
|
|
4
|
+
import type { WebViewProps } from "../../types/components/web-view";
|
|
4
5
|
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
6
|
+
import type { ComponentProps } from "svelte";
|
|
7
|
+
|
|
8
|
+
// Cross-origin SVG (jsDelivr allows framing; no opaque page chrome). Parent
|
|
9
|
+
// checkerboard shows through and proves the host iframe is transparent.
|
|
10
|
+
const TRANSPARENT_CONTENT_URL =
|
|
11
|
+
"https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/2705.svg";
|
|
5
12
|
|
|
6
13
|
const { Story } = defineMeta({
|
|
7
14
|
title: "Components/WebView",
|
|
@@ -23,12 +30,36 @@
|
|
|
23
30
|
width: { type: "fill" },
|
|
24
31
|
height: { type: "fixed", value: 400 },
|
|
25
32
|
},
|
|
26
|
-
},
|
|
33
|
+
} satisfies WebViewProps,
|
|
27
34
|
});
|
|
28
35
|
</script>
|
|
29
36
|
|
|
37
|
+
{#snippet transparencyTemplate(props: ComponentProps<typeof WebView>)}
|
|
38
|
+
<div class="transparency-showcase">
|
|
39
|
+
<p class="transparency-showcase__caption">
|
|
40
|
+
Checkerboard behind the iframe — the parent should show through
|
|
41
|
+
transparent content (and around letterboxed SVG).
|
|
42
|
+
</p>
|
|
43
|
+
<div class="transparency-showcase__stage">
|
|
44
|
+
<WebView {...props} />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
{/snippet}
|
|
48
|
+
|
|
30
49
|
<Story name="Default" />
|
|
31
50
|
|
|
51
|
+
<Story
|
|
52
|
+
name="Transparent background"
|
|
53
|
+
args={{
|
|
54
|
+
url: TRANSPARENT_CONTENT_URL,
|
|
55
|
+
size: {
|
|
56
|
+
width: { type: "fixed", value: 320 },
|
|
57
|
+
height: { type: "fixed", value: 320 },
|
|
58
|
+
},
|
|
59
|
+
}}
|
|
60
|
+
template={transparencyTemplate}
|
|
61
|
+
/>
|
|
62
|
+
|
|
32
63
|
<Story
|
|
33
64
|
name="Fill (full bleed)"
|
|
34
65
|
args={{
|
|
@@ -103,3 +134,43 @@
|
|
|
103
134
|
url: "http://insecure.example.com",
|
|
104
135
|
}}
|
|
105
136
|
/>
|
|
137
|
+
|
|
138
|
+
<style>
|
|
139
|
+
.transparency-showcase {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
gap: 12px;
|
|
143
|
+
padding: 16px;
|
|
144
|
+
max-width: 640px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.transparency-showcase__caption {
|
|
148
|
+
margin: 0;
|
|
149
|
+
font:
|
|
150
|
+
14px/1.4 ui-sans-serif,
|
|
151
|
+
system-ui,
|
|
152
|
+
sans-serif;
|
|
153
|
+
color: #334155;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.transparency-showcase__stage {
|
|
157
|
+
display: flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
padding: 24px;
|
|
161
|
+
/* High-contrast checkerboard so iframe transparency is obvious. */
|
|
162
|
+
background-color: #cbd5e1;
|
|
163
|
+
background-image:
|
|
164
|
+
linear-gradient(45deg, #64748b 25%, transparent 25%),
|
|
165
|
+
linear-gradient(-45deg, #64748b 25%, transparent 25%),
|
|
166
|
+
linear-gradient(45deg, transparent 75%, #64748b 75%),
|
|
167
|
+
linear-gradient(-45deg, transparent 75%, #64748b 75%);
|
|
168
|
+
background-size: 24px 24px;
|
|
169
|
+
background-position:
|
|
170
|
+
0 0,
|
|
171
|
+
0 12px,
|
|
172
|
+
12px -12px,
|
|
173
|
+
-12px 0;
|
|
174
|
+
border-radius: 8px;
|
|
175
|
+
}
|
|
176
|
+
</style>
|
|
@@ -175,6 +175,9 @@
|
|
|
175
175
|
.web-view {
|
|
176
176
|
position: relative;
|
|
177
177
|
overflow: hidden;
|
|
178
|
+
background: transparent;
|
|
179
|
+
/* Match content's dual scheme so the UA keeps a transparent iframe canvas. */
|
|
180
|
+
color-scheme: light dark;
|
|
178
181
|
}
|
|
179
182
|
|
|
180
183
|
iframe {
|
|
@@ -182,5 +185,7 @@
|
|
|
182
185
|
width: 100%;
|
|
183
186
|
height: 100%;
|
|
184
187
|
border: 0;
|
|
188
|
+
background: transparent;
|
|
189
|
+
color-scheme: light dark;
|
|
185
190
|
}
|
|
186
191
|
</style>
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
onVisitCustomerCenterClicked?: () => void;
|
|
50
50
|
walletButtonRender?: WalletButtonRender;
|
|
51
51
|
safeAreaFallbackColor?: ColorScheme | null;
|
|
52
|
+
hideBackButtons?: boolean;
|
|
52
53
|
}
|
|
53
54
|
const {
|
|
54
55
|
paywallComponents,
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
onVisitCustomerCenterClicked,
|
|
75
76
|
walletButtonRender,
|
|
76
77
|
safeAreaFallbackColor,
|
|
78
|
+
hideBackButtons,
|
|
77
79
|
}: Props = $props();
|
|
78
80
|
</script>
|
|
79
81
|
|
|
@@ -110,6 +112,7 @@
|
|
|
110
112
|
{onReservedAttributeChanged}
|
|
111
113
|
{walletButtonRender}
|
|
112
114
|
{safeAreaFallbackColor}
|
|
115
|
+
{hideBackButtons}
|
|
113
116
|
onError={(error) => {
|
|
114
117
|
console.error("Paywall error:", error);
|
|
115
118
|
}}
|
|
@@ -35,6 +35,7 @@ interface Props {
|
|
|
35
35
|
onVisitCustomerCenterClicked?: () => void;
|
|
36
36
|
walletButtonRender?: WalletButtonRender;
|
|
37
37
|
safeAreaFallbackColor?: ColorScheme | null;
|
|
38
|
+
hideBackButtons?: boolean;
|
|
38
39
|
}
|
|
39
40
|
declare const Screen: import("svelte").Component<Props, {}, "">;
|
|
40
41
|
type Screen = ReturnType<typeof Screen>;
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
containerId?: string;
|
|
42
42
|
walletButtonRender?: WalletButtonRender;
|
|
43
43
|
safeAreaFallbackColor?: ColorScheme | null;
|
|
44
|
+
hideBackButtons?: boolean;
|
|
44
45
|
onPurchaseClicked?: (
|
|
45
46
|
packageId: string,
|
|
46
47
|
actionId: string,
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
containerId,
|
|
89
90
|
walletButtonRender,
|
|
90
91
|
safeAreaFallbackColor,
|
|
92
|
+
hideBackButtons,
|
|
91
93
|
onPurchaseClicked,
|
|
92
94
|
onActionTriggered,
|
|
93
95
|
onInputChanged,
|
|
@@ -336,6 +338,7 @@
|
|
|
336
338
|
{containerId}
|
|
337
339
|
{walletButtonRender}
|
|
338
340
|
{safeAreaFallbackColor}
|
|
341
|
+
{hideBackButtons}
|
|
339
342
|
{onPurchaseClicked}
|
|
340
343
|
onActionTriggered={handleActionTriggered}
|
|
341
344
|
{onInputChanged}
|
|
@@ -18,6 +18,7 @@ interface Props {
|
|
|
18
18
|
containerId?: string;
|
|
19
19
|
walletButtonRender?: WalletButtonRender;
|
|
20
20
|
safeAreaFallbackColor?: ColorScheme | null;
|
|
21
|
+
hideBackButtons?: boolean;
|
|
21
22
|
onPurchaseClicked?: (packageId: string, actionId: string) => void | Promise<void>;
|
|
22
23
|
onActionTriggered?: (actionId: string) => void;
|
|
23
24
|
onInputChanged?: (fieldId: string, value: string, actionId?: string) => void;
|