@revenuecat/purchases-ui-js 2.0.3 → 2.0.5
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/button/ButtonNode.stories.svelte +1 -1
- package/dist/components/button/ButtonNode.svelte +27 -3
- package/dist/components/carousel/Carousel.stories.svelte +1039 -0
- package/dist/components/carousel/Carousel.stories.svelte.d.ts +19 -0
- package/dist/components/carousel/Carousel.svelte +298 -0
- package/dist/components/carousel/Carousel.svelte.d.ts +4 -0
- package/dist/components/carousel/CarouselPage.svelte +39 -0
- package/dist/components/carousel/CarouselPage.svelte.d.ts +11 -0
- package/dist/components/carousel/PageControl.svelte +93 -0
- package/dist/components/carousel/PageControl.svelte.d.ts +4 -0
- package/dist/components/carousel/carousel-utils.d.ts +4 -0
- package/dist/components/carousel/carousel-utils.js +21 -0
- package/dist/components/package/Package.svelte +3 -1
- package/dist/components/paywall/Node.svelte +12 -24
- package/dist/components/paywall/Node.svelte.d.ts +1 -6
- package/dist/components/paywall/Paywall.stories.svelte +155 -0
- package/dist/components/paywall/Paywall.svelte +50 -59
- package/dist/components/paywall/Paywall.svelte.d.ts +2 -1
- package/dist/components/paywall/Sheet.svelte +126 -0
- package/dist/components/paywall/Sheet.svelte.d.ts +4 -0
- package/dist/components/paywall/fixtures/background-paywall.d.ts +3 -0
- package/dist/components/paywall/fixtures/background-paywall.js +62 -0
- package/dist/components/paywall/fixtures/override-paywall.d.ts +1 -1
- package/dist/components/paywall/fixtures/sheet-paywall.d.ts +2 -0
- package/dist/components/paywall/fixtures/sheet-paywall.js +325 -0
- package/dist/components/paywall/fixtures/stack-paywall.d.ts +1 -1
- package/dist/components/stack/Stack.svelte +6 -1
- package/dist/components/stack/Stack.svelte.d.ts +2 -0
- package/dist/components/tabs/TabControl.svelte +11 -0
- package/dist/components/tabs/TabControl.svelte.d.ts +4 -0
- package/dist/components/tabs/TabControlButton.svelte +19 -0
- package/dist/components/tabs/TabControlButton.svelte.d.ts +4 -0
- package/dist/components/tabs/Tabs.stories.svelte +929 -0
- package/dist/components/tabs/Tabs.stories.svelte.d.ts +19 -0
- package/dist/components/tabs/Tabs.svelte +69 -0
- package/dist/components/tabs/Tabs.svelte.d.ts +4 -0
- package/dist/components/tabs/tabs-context.d.ts +11 -0
- package/dist/components/tabs/tabs-context.js +12 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/stores/paywall.d.ts +1 -1
- package/dist/stores/selected.d.ts +1 -1
- package/dist/stores/selected.js +3 -5
- package/dist/stories/fixtures.d.ts +2 -1
- package/dist/stories/viewport-wrapper.svelte +7 -5
- package/dist/types/component.d.ts +5 -3
- package/dist/types/components/button.d.ts +4 -1
- package/dist/types/components/carousel.d.ts +51 -0
- package/dist/types/components/sheet.d.ts +16 -0
- package/dist/types/components/sheet.js +1 -0
- package/dist/types/components/tabs.d.ts +46 -0
- package/dist/types/components/tabs.js +1 -0
- package/dist/types/paywall.d.ts +26 -0
- package/dist/types/paywall.js +1 -0
- package/dist/types/ui-config.d.ts +20 -0
- package/dist/types/ui-config.js +1 -0
- package/dist/types.d.ts +6 -2
- package/dist/utils/base-utils.d.ts +1 -1
- package/dist/utils/base-utils.js +2 -17
- package/dist/utils/font-utils.d.ts +1 -1
- package/dist/utils/style-utils.d.ts +2 -9
- package/dist/utils/style-utils.js +7 -24
- package/dist/web-components/index.js +969 -942
- package/package.json +20 -20
- package/dist/components/paywall/paywall-utils.d.ts +0 -8
- package/dist/components/paywall/paywall-utils.js +0 -24
- package/dist/data/entities.d.ts +0 -46
- /package/dist/{data/entities.js → types/components/carousel.js} +0 -0
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": "2.0.
|
|
5
|
+
"version": "2.0.5",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "RevenueCat, Inc."
|
|
8
8
|
},
|
|
@@ -72,36 +72,36 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@chromatic-com/storybook": "4.1.1",
|
|
75
|
-
"@eslint/js": "9.
|
|
76
|
-
"@playwright/test": "1.
|
|
77
|
-
"@storybook/addon-docs": "9.1.
|
|
78
|
-
"@storybook/addon-links": "9.1.
|
|
79
|
-
"@storybook/addon-svelte-csf": "5.0.
|
|
80
|
-
"@storybook/sveltekit": "9.1.
|
|
81
|
-
"@sveltejs/adapter-node": "5.3.
|
|
82
|
-
"@sveltejs/kit": "2.
|
|
75
|
+
"@eslint/js": "9.37.0",
|
|
76
|
+
"@playwright/test": "1.56.0",
|
|
77
|
+
"@storybook/addon-docs": "9.1.10",
|
|
78
|
+
"@storybook/addon-links": "9.1.10",
|
|
79
|
+
"@storybook/addon-svelte-csf": "5.0.10",
|
|
80
|
+
"@storybook/sveltekit": "9.1.10",
|
|
81
|
+
"@sveltejs/adapter-node": "5.3.3",
|
|
82
|
+
"@sveltejs/kit": "2.44.0",
|
|
83
83
|
"@sveltejs/package": "2.5.4",
|
|
84
84
|
"@sveltejs/vite-plugin-svelte": "6.2.1",
|
|
85
|
-
"@types/node": "24.
|
|
86
|
-
"@typescript-eslint/parser": "8.
|
|
85
|
+
"@types/node": "24.7.0",
|
|
86
|
+
"@typescript-eslint/parser": "8.46.0",
|
|
87
87
|
"chromatic": "13.3.0",
|
|
88
|
-
"eslint": "9.
|
|
89
|
-
"eslint-plugin-storybook": "9.1.
|
|
88
|
+
"eslint": "9.37.0",
|
|
89
|
+
"eslint-plugin-storybook": "9.1.10",
|
|
90
90
|
"eslint-plugin-svelte": "3.12.4",
|
|
91
91
|
"globals": "16.4.0",
|
|
92
92
|
"husky": "9.1.7",
|
|
93
93
|
"jsdom": "27.0.0",
|
|
94
|
-
"knip": "5.64.
|
|
94
|
+
"knip": "5.64.2",
|
|
95
95
|
"lint-staged": "16.2.3",
|
|
96
96
|
"prettier": "3.6.2",
|
|
97
97
|
"prettier-plugin-svelte": "3.4.0",
|
|
98
|
-
"publint": "0.3.
|
|
99
|
-
"storybook": "9.1.
|
|
100
|
-
"svelte": "5.39.
|
|
98
|
+
"publint": "0.3.14",
|
|
99
|
+
"storybook": "9.1.10",
|
|
100
|
+
"svelte": "5.39.9",
|
|
101
101
|
"svelte-check": "4.3.2",
|
|
102
|
-
"typescript": "5.9.
|
|
103
|
-
"typescript-eslint": "8.
|
|
104
|
-
"vite": "7.1.
|
|
102
|
+
"typescript": "5.9.3",
|
|
103
|
+
"typescript-eslint": "8.46.0",
|
|
104
|
+
"vite": "7.1.9",
|
|
105
105
|
"vite-plugin-dts": "4.5.4",
|
|
106
106
|
"vitest": "3.2.4"
|
|
107
107
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { PaywallData } from "../../data/entities";
|
|
2
|
-
import type { ColorMode } from "../../types";
|
|
3
|
-
import type { Background } from "../../types/background";
|
|
4
|
-
export declare function getBackgroundStyles({ background, colorMode, }: {
|
|
5
|
-
background?: Background;
|
|
6
|
-
colorMode: ColorMode;
|
|
7
|
-
}): string;
|
|
8
|
-
export declare function getBackgroundImageSource(paywallData: PaywallData, colorMode: ColorMode): string | undefined;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_COLOR_MODE } from "../../utils/constants";
|
|
2
|
-
import { getColor, prefixObject, stringifyStyles, } from "../../utils/style-utils";
|
|
3
|
-
export function getBackgroundStyles({ background, colorMode, }) {
|
|
4
|
-
const styles = { "--background": "initial" };
|
|
5
|
-
if (background?.type === "color") {
|
|
6
|
-
Object.assign(styles, {
|
|
7
|
-
"--background": getColor({
|
|
8
|
-
colorMap: background.value,
|
|
9
|
-
colorMode,
|
|
10
|
-
fallback: "transparent",
|
|
11
|
-
}),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
const prefixedStyles = prefixObject(styles, "paywall");
|
|
15
|
-
return stringifyStyles(prefixedStyles);
|
|
16
|
-
}
|
|
17
|
-
export function getBackgroundImageSource(paywallData, colorMode) {
|
|
18
|
-
const { background } = paywallData.components_config.base;
|
|
19
|
-
if (background?.type !== "image") {
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
const { value } = background;
|
|
23
|
-
return value[colorMode]?.original ?? value[DEFAULT_COLOR_MODE]?.original;
|
|
24
|
-
}
|
package/dist/data/entities.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Background } from "../types/background";
|
|
2
|
-
import type { FooterProps } from "../types/components/footer";
|
|
3
|
-
import type { StackProps } from "../types/components/stack";
|
|
4
|
-
import type { Localizations } from "../types/localization";
|
|
5
|
-
interface RootPaywall {
|
|
6
|
-
background?: Background;
|
|
7
|
-
stack: StackProps;
|
|
8
|
-
sticky_footer?: FooterProps | null;
|
|
9
|
-
}
|
|
10
|
-
export interface ComponentConfig {
|
|
11
|
-
colors?: Record<string, string>;
|
|
12
|
-
fonts?: {
|
|
13
|
-
[fontName: string]: {
|
|
14
|
-
ios: string;
|
|
15
|
-
android: string;
|
|
16
|
-
web: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
asset_base_url?: string;
|
|
20
|
-
base: RootPaywall;
|
|
21
|
-
}
|
|
22
|
-
export interface PaywallData {
|
|
23
|
-
default_locale: string;
|
|
24
|
-
components_config: ComponentConfig;
|
|
25
|
-
components_localizations: Localizations;
|
|
26
|
-
}
|
|
27
|
-
type AppFontFamilyConfig = {
|
|
28
|
-
type: "name" | "url";
|
|
29
|
-
value?: string;
|
|
30
|
-
family: string;
|
|
31
|
-
hash: string;
|
|
32
|
-
style: string;
|
|
33
|
-
url: string;
|
|
34
|
-
weight: number;
|
|
35
|
-
};
|
|
36
|
-
type AppFontsConfig = Record<string, {
|
|
37
|
-
ios?: AppFontFamilyConfig;
|
|
38
|
-
android?: AppFontFamilyConfig;
|
|
39
|
-
web?: AppFontFamilyConfig;
|
|
40
|
-
}>;
|
|
41
|
-
export type UIConfig = {
|
|
42
|
-
app: {
|
|
43
|
-
fonts: AppFontsConfig;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export {};
|
|
File without changes
|