@revenuecat/purchases-ui-js 4.2.0 → 4.3.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/dist/components/icon/Icon.svelte +12 -12
- package/dist/components/timeline/Timeline.svelte +12 -12
- package/dist/stories/fixtures.js +2 -0
- package/dist/types/components/package.d.ts +2 -0
- package/dist/types/overrides.d.ts +1 -1
- package/dist/utils/style-utils.js +7 -2
- package/package.json +1 -1
|
@@ -56,6 +56,18 @@
|
|
|
56
56
|
}),
|
|
57
57
|
);
|
|
58
58
|
|
|
59
|
+
const isVisible = $derived(
|
|
60
|
+
evaluateVisibilityConditions(
|
|
61
|
+
{
|
|
62
|
+
selectedPackageId: $selectedPackageId,
|
|
63
|
+
packageInfo: $packageInfo,
|
|
64
|
+
variables: $variables ?? {},
|
|
65
|
+
},
|
|
66
|
+
props.overrides,
|
|
67
|
+
props.visible,
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
|
|
59
71
|
const webpUrl = $derived(`${base_url}/${formats.webp}`);
|
|
60
72
|
const icon = $derived(
|
|
61
73
|
css({
|
|
@@ -75,18 +87,6 @@
|
|
|
75
87
|
"-webkit-mask-repeat": "no-repeat",
|
|
76
88
|
}),
|
|
77
89
|
);
|
|
78
|
-
|
|
79
|
-
const isVisible = $derived(
|
|
80
|
-
evaluateVisibilityConditions(
|
|
81
|
-
{
|
|
82
|
-
selectedPackageId: $selectedPackageId,
|
|
83
|
-
packageInfo: $packageInfo,
|
|
84
|
-
variables: $variables ?? {},
|
|
85
|
-
},
|
|
86
|
-
props.overrides,
|
|
87
|
-
props.visible,
|
|
88
|
-
),
|
|
89
|
-
);
|
|
90
90
|
</script>
|
|
91
91
|
|
|
92
92
|
{#if isVisible}
|
|
@@ -35,6 +35,18 @@
|
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
+
const isVisible = $derived(
|
|
39
|
+
evaluateVisibilityConditions(
|
|
40
|
+
{
|
|
41
|
+
selectedPackageId: $selectedPackageId,
|
|
42
|
+
packageInfo: $packageInfo,
|
|
43
|
+
variables: $variables ?? {},
|
|
44
|
+
},
|
|
45
|
+
props.overrides,
|
|
46
|
+
props.visible,
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
|
|
38
50
|
const timelineStyles = $derived(
|
|
39
51
|
css(
|
|
40
52
|
getTimelineInlineStyles({
|
|
@@ -50,18 +62,6 @@
|
|
|
50
62
|
}),
|
|
51
63
|
),
|
|
52
64
|
);
|
|
53
|
-
|
|
54
|
-
const isVisible = $derived(
|
|
55
|
-
evaluateVisibilityConditions(
|
|
56
|
-
{
|
|
57
|
-
selectedPackageId: $selectedPackageId,
|
|
58
|
-
packageInfo: $packageInfo,
|
|
59
|
-
variables: $variables ?? {},
|
|
60
|
-
},
|
|
61
|
-
props.overrides,
|
|
62
|
-
props.visible,
|
|
63
|
-
),
|
|
64
|
-
);
|
|
65
65
|
</script>
|
|
66
66
|
|
|
67
67
|
{#if isVisible && items.length}
|
package/dist/stories/fixtures.js
CHANGED
|
@@ -19129,6 +19129,7 @@ export const paywallWithFooter = {
|
|
|
19129
19129
|
updated_at: "2024-12-10T19:23:17Z",
|
|
19130
19130
|
};
|
|
19131
19131
|
export const paywallWithHeader = {
|
|
19132
|
+
id: "paywall_with_header",
|
|
19132
19133
|
asset_base_url: "https://assets.pawwalls.com",
|
|
19133
19134
|
components_config: {
|
|
19134
19135
|
base: {
|
|
@@ -20697,6 +20698,7 @@ export const paywallWithHeader = {
|
|
|
20697
20698
|
updated_at: "2026-04-14T09:50:13Z",
|
|
20698
20699
|
};
|
|
20699
20700
|
export const paywallWithTransparentHeaderAndTopImage = {
|
|
20701
|
+
id: "paywall_with_transparent_header_and_top_image",
|
|
20700
20702
|
asset_base_url: "https://assets.pawwalls.com",
|
|
20701
20703
|
components_config: {
|
|
20702
20704
|
base: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BaseComponent } from "../base";
|
|
2
|
+
import type { Overrides } from "../overrides";
|
|
2
3
|
import type { StackProps } from "./stack";
|
|
3
4
|
export interface PackageProps extends BaseComponent {
|
|
4
5
|
type: "package";
|
|
@@ -6,4 +7,5 @@ export interface PackageProps extends BaseComponent {
|
|
|
6
7
|
is_selected_by_default: boolean;
|
|
7
8
|
apple_promo_offer_product_code?: string | null;
|
|
8
9
|
stack: StackProps;
|
|
10
|
+
overrides?: Overrides<PackageProps>;
|
|
9
11
|
}
|
|
@@ -47,7 +47,7 @@ type VariableCondition = {
|
|
|
47
47
|
type: typeof RuleKey.VariableCondition;
|
|
48
48
|
operator: EqualityOperator;
|
|
49
49
|
variable: string;
|
|
50
|
-
value: CustomVariableValue;
|
|
50
|
+
value: CustomVariableValue | string | number | boolean;
|
|
51
51
|
};
|
|
52
52
|
type OverrideCondition = IntroOfferCondition | MultipleIntroOffersCondition | SelectedCondition | HoverCondition | FocusCondition | ErrorCondition | PromoOfferCondition | IntroductoryOfferCondition | PromotionalOfferCondition | SelectedPackageCondition | VariableCondition;
|
|
53
53
|
/**
|
|
@@ -177,8 +177,13 @@ const conditionMatches = (condition, context) => {
|
|
|
177
177
|
return !condition.packages.includes(selected);
|
|
178
178
|
}
|
|
179
179
|
if (condition.type === "variable_condition") {
|
|
180
|
-
const
|
|
181
|
-
const
|
|
180
|
+
const variableName = condition.variable.replace(/^\$?custom\./, "");
|
|
181
|
+
const currentValue = context.variables[variableName];
|
|
182
|
+
// API sends value as a plain scalar; type definition wraps it in CustomVariableValue
|
|
183
|
+
const rawValue = condition.value;
|
|
184
|
+
const conditionValue = String(typeof rawValue === "object" && rawValue !== null && "value" in rawValue
|
|
185
|
+
? rawValue.value
|
|
186
|
+
: rawValue);
|
|
182
187
|
if (condition.operator === "=")
|
|
183
188
|
return currentValue === conditionValue;
|
|
184
189
|
if (condition.operator === "!=")
|