@revenuecat/purchases-ui-js 0.0.15 → 0.0.16

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.
@@ -90,7 +90,7 @@ export declare function getDimensionStyle(dimension: DimensionType): {
90
90
  * @param colorMode - The currently selected ColorMode (dark/light)
91
91
  * @returns CSS style object with text formatting properties
92
92
  */
93
- export declare function getTextStyles(props: TextNodeProps, colorMode?: ColorMode): any;
93
+ export declare function getTextStyles(props: TextNodeProps, colorMode?: ColorMode): Record<string, unknown>;
94
94
  /**
95
95
  * Converts a style object to a CSS string
96
96
  * @param styles - Object containing CSS properties and values
@@ -114,4 +114,4 @@ export declare function getLabelById(label_id: string, locale: string, fallbackL
114
114
  * @returns the id of the first package marked as `is_selected_by_default` or undefined
115
115
  */
116
116
  export declare function findSelectedPackageId(paywallData: PaywallData): string | undefined;
117
- export declare const getActiveStateProps: <T>(overrides?: Record<"states", Record<string, T>>, componentState?: ComponentState) => T;
117
+ export declare const getActiveStateProps: <T>(overrides?: Record<string, T>, componentState?: ComponentState) => T;
@@ -172,7 +172,7 @@ export function getGradientStyle(colorMode, gradientColors) {
172
172
  * @returns CSS style object with mask properties
173
173
  */
174
174
  export const getMaskStyle = (maskShape) => {
175
- let maskStyles = {
175
+ const maskStyles = {
176
176
  "--corner-radius": "0px",
177
177
  "--clip-path": "none",
178
178
  };
@@ -264,7 +264,7 @@ export function stringifyStyles(styles) {
264
264
  * @returns The label in the preferred or fallback locale, or undefined.
265
265
  */
266
266
  export function getLabelById(label_id, locale, fallbackLocale, labels) {
267
- const fallback = (labels[fallbackLocale] || {})[label_id];
267
+ const fallback = labels[fallbackLocale]?.[label_id];
268
268
  if (!(labels[locale] || {})[label_id]) {
269
269
  return fallback;
270
270
  }
@@ -281,8 +281,8 @@ export function findSelectedPackageId(paywallData) {
281
281
  node.is_selected_by_default) {
282
282
  return node;
283
283
  }
284
- if (node.components) {
285
- for (let c of node.components) {
284
+ if (node.components && Array.isArray(node.components)) {
285
+ for (const c of node.components) {
286
286
  const pkg = traverseNode(c);
287
287
  if (pkg) {
288
288
  return pkg;
@@ -309,7 +309,7 @@ export const getActiveStateProps = (overrides, componentState) => {
309
309
  const activeStateKeys = getComponentActiveStateKeys(componentState);
310
310
  const activeStateProps = activeStateKeys.reduce((props, key) => {
311
311
  if (overrides) {
312
- const styles = overrides.states[key];
312
+ const styles = overrides[key] || {};
313
313
  return { ...props, ...styles };
314
314
  }
315
315
  return props;
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": "0.0.15",
5
+ "version": "0.0.16",
6
6
  "author": {
7
7
  "name": "RevenueCat, Inc."
8
8
  },
@@ -36,7 +36,8 @@
36
36
  "chromatic": "chromatic",
37
37
  "format": "prettier --write .",
38
38
  "typecheck": "tsc --noEmit",
39
- "test": "vitest"
39
+ "test": "vitest",
40
+ "lint": "eslint --config eslint.config.js src/**/*"
40
41
  },
41
42
  "files": [
42
43
  "dist",