@revenuecat/purchases-ui-js 3.3.0 → 3.4.1

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.
@@ -56,8 +56,12 @@
56
56
  },
57
57
  ) => {
58
58
  destroy?: () => void;
59
- update?: (selectedPackageId: string) => void;
59
+ update?: (updateParams: {
60
+ selectedPackageId: string;
61
+ onReady?: () => void;
62
+ }) => void;
60
63
  };
64
+ maxContentWidth?: string;
61
65
  }
62
66
 
63
67
  const {
@@ -77,6 +81,7 @@
77
81
  uiConfig,
78
82
  walletButtonRender,
79
83
  hideBackButtons = false,
84
+ maxContentWidth,
80
85
  }: Props = $props();
81
86
 
82
87
  const getColorMode = setColorModeContext(() => preferredColorMode);
@@ -173,6 +178,9 @@
173
178
  const style = $derived(
174
179
  css({
175
180
  ...mapBackground(colorMode, null, base.background),
181
+ ...(maxContentWidth && {
182
+ "padding-inline": `max(0px, calc((100vw - ${maxContentWidth}) / 2))`,
183
+ }),
176
184
  }),
177
185
  );
178
186
 
@@ -29,8 +29,12 @@ interface Props {
29
29
  onReady?: () => void;
30
30
  }) => {
31
31
  destroy?: () => void;
32
- update?: (selectedPackageId: string) => void;
32
+ update?: (updateParams: {
33
+ selectedPackageId: string;
34
+ onReady?: () => void;
35
+ }) => void;
33
36
  };
37
+ maxContentWidth?: string;
34
38
  }
35
39
  declare const Paywall: import("svelte").Component<Props, {}, "">;
36
40
  type Paywall = ReturnType<typeof Paywall>;
@@ -16,6 +16,7 @@
16
16
  actionId: string,
17
17
  ) => void | Promise<void>;
18
18
  containerId?: string;
19
+ maxContentWidth?: string;
19
20
  }
20
21
  const {
21
22
  paywallComponents,
@@ -25,6 +26,7 @@
25
26
  onActionTriggered,
26
27
  onPurchaseClicked,
27
28
  containerId = "screen-container",
29
+ maxContentWidth,
28
30
  }: Props = $props();
29
31
  </script>
30
32
 
@@ -36,6 +38,7 @@
36
38
  {uiConfig}
37
39
  variablesPerPackage={VARIABLES}
38
40
  {globalVariables}
41
+ {maxContentWidth}
39
42
  onNavigateToUrlClicked={() => {}}
40
43
  onVisitCustomerCenterClicked={() => {}}
41
44
  onBackClicked={() => {}}
@@ -9,6 +9,7 @@ interface Props {
9
9
  onActionTriggered?: (actionId: string) => void;
10
10
  onPurchaseClicked?: (packageId: string, actionId: string) => void | Promise<void>;
11
11
  containerId?: string;
12
+ maxContentWidth?: string;
12
13
  }
13
14
  declare const Screen: import("svelte").Component<Props, {}, "">;
14
15
  type Screen = ReturnType<typeof Screen>;
@@ -12,7 +12,10 @@ type PaywallContext = Readonly<{
12
12
  onReady?: () => void;
13
13
  }) => {
14
14
  destroy?: () => void;
15
- update?: (selectedPackageId: string) => void;
15
+ update?: (params: {
16
+ selectedPackageId: string;
17
+ onReady?: () => void;
18
+ }) => void;
16
19
  };
17
20
  onButtonAction: (action: Action, actionId?: string) => void;
18
21
  uiConfig: UIConfig;
@@ -4,5 +4,8 @@ export declare function paywallDecorator<TRenderer extends Renderer, TArgs>(wall
4
4
  onReady?: () => void;
5
5
  }) => {
6
6
  destroy?: () => void;
7
- update?: (selectedPackageId: string) => void;
7
+ update?: (updateParams: {
8
+ selectedPackageId: string;
9
+ onReady?: () => void;
10
+ }) => void;
8
11
  }): DecoratorFunction<TRenderer, TArgs>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@revenuecat/purchases-ui-js",
3
3
  "description": "Web components for Paywalls. Powered by RevenueCat",
4
4
  "private": false,
5
- "version": "3.3.0",
5
+ "version": "3.4.1",
6
6
  "author": {
7
7
  "name": "RevenueCat, Inc."
8
8
  },