@revenuecat/purchases-ui-js 2.0.2 → 2.0.4

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.
Files changed (144) hide show
  1. package/dist/components/button/ButtonNode.stories.svelte +66 -102
  2. package/dist/components/button/ButtonNode.svelte +18 -26
  3. package/dist/components/carousel/Carousel.stories.svelte +1039 -0
  4. package/dist/components/carousel/Carousel.stories.svelte.d.ts +19 -0
  5. package/dist/components/carousel/Carousel.svelte +298 -0
  6. package/dist/components/carousel/Carousel.svelte.d.ts +4 -0
  7. package/dist/components/carousel/CarouselPage.svelte +39 -0
  8. package/dist/components/carousel/CarouselPage.svelte.d.ts +11 -0
  9. package/dist/components/carousel/PageControl.svelte +93 -0
  10. package/dist/components/carousel/PageControl.svelte.d.ts +4 -0
  11. package/dist/components/carousel/carousel-utils.d.ts +4 -0
  12. package/dist/components/carousel/carousel-utils.js +21 -0
  13. package/dist/components/footer/Footer.stories.svelte +112 -102
  14. package/dist/components/footer/Footer.svelte +8 -4
  15. package/dist/components/icon/Icon.stories.svelte +100 -0
  16. package/dist/components/icon/Icon.stories.svelte.d.ts +19 -0
  17. package/dist/components/icon/Icon.svelte +73 -0
  18. package/dist/components/icon/Icon.svelte.d.ts +4 -0
  19. package/dist/components/image/ClipPath.svelte +49 -0
  20. package/dist/components/image/ClipPath.svelte.d.ts +9 -0
  21. package/dist/components/image/Image.stories.svelte +83 -188
  22. package/dist/components/image/Image.svelte +152 -136
  23. package/dist/components/image/Image.svelte.d.ts +1 -1
  24. package/dist/components/image/Overlay.svelte +36 -0
  25. package/dist/components/image/Overlay.svelte.d.ts +8 -0
  26. package/dist/components/package/Package.stories.svelte +10 -21
  27. package/dist/components/package/Package.svelte +8 -35
  28. package/dist/components/paywall/Node.svelte +25 -32
  29. package/dist/components/paywall/Node.svelte.d.ts +4 -6
  30. package/dist/components/paywall/Paywall.stories.svelte +36 -140
  31. package/dist/components/paywall/Paywall.svelte +23 -7
  32. package/dist/components/paywall/Paywall.svelte.d.ts +4 -2
  33. package/dist/components/paywall/fixtures/override-paywall.d.ts +2 -0
  34. package/dist/components/paywall/fixtures/override-paywall.js +1310 -0
  35. package/dist/components/paywall/fixtures/stack-paywall.d.ts +2 -0
  36. package/dist/components/paywall/fixtures/stack-paywall.js +5223 -0
  37. package/dist/components/paywall/fixtures/variables.d.ts +261 -0
  38. package/dist/components/paywall/fixtures/variables.js +262 -0
  39. package/dist/components/paywall/paywall-utils.d.ts +1 -1
  40. package/dist/components/purchase-button/PurchaseButton.stories.svelte +10 -21
  41. package/dist/components/purchase-button/PurchaseButton.svelte +2 -27
  42. package/dist/components/stack/Stack.stories.svelte +2354 -978
  43. package/dist/components/stack/Stack.svelte +116 -134
  44. package/dist/components/stack/Stack.svelte.d.ts +8 -2
  45. package/dist/components/stack/stack-utils.d.ts +10 -30
  46. package/dist/components/stack/stack-utils.js +77 -255
  47. package/dist/components/text/Text.svelte +3 -37
  48. package/dist/components/text/Text.svelte.d.ts +1 -2
  49. package/dist/components/text/TextNode.stories.svelte +10 -36
  50. package/dist/components/text/TextNode.svelte +25 -28
  51. package/dist/components/text/TextNode.svelte.d.ts +1 -1
  52. package/dist/components/text/text-utils.d.ts +4 -9
  53. package/dist/components/text/text-utils.js +32 -117
  54. package/dist/components/timeline/Timeline.stories.svelte +640 -251
  55. package/dist/components/timeline/Timeline.svelte +42 -28
  56. package/dist/components/timeline/Timeline.svelte.d.ts +1 -1
  57. package/dist/components/timeline/TimelineItem.svelte +80 -112
  58. package/dist/components/timeline/TimelineItem.svelte.d.ts +6 -2
  59. package/dist/components/timeline/timeline-utils.d.ts +24 -6
  60. package/dist/components/timeline/timeline-utils.js +21 -113
  61. package/dist/index.d.ts +3 -2
  62. package/dist/index.js +3 -2
  63. package/dist/stores/color-mode.d.ts +1 -1
  64. package/dist/stores/paywall.d.ts +5 -2
  65. package/dist/stores/selected.d.ts +5 -0
  66. package/dist/stores/selected.js +12 -0
  67. package/dist/stores/variables.d.ts +1 -1
  68. package/dist/stores/variables.js +0 -1
  69. package/dist/stories/component-decorator.d.ts +2 -0
  70. package/dist/stories/component-decorator.js +12 -0
  71. package/dist/stories/fixtures.d.ts +6 -3
  72. package/dist/stories/fixtures.js +5214 -4422
  73. package/dist/stories/paywall-decorator.js +6 -0
  74. package/dist/stories/variables-decorator.d.ts +1 -1
  75. package/dist/stories/viewport-decorator.d.ts +2 -0
  76. package/dist/stories/viewport-decorator.js +8 -0
  77. package/dist/stories/viewport-wrapper.svelte +55 -0
  78. package/dist/stories/viewport-wrapper.svelte.d.ts +10 -0
  79. package/dist/stories/with-layout.d.ts +2 -10
  80. package/dist/stories/with-layout.js +3 -5
  81. package/dist/types/alignment.d.ts +5 -3
  82. package/dist/types/background.d.ts +6 -5
  83. package/dist/types/base.d.ts +7 -0
  84. package/dist/types/colors.d.ts +4 -4
  85. package/dist/types/component.d.ts +7 -2
  86. package/dist/types/components/button.d.ts +6 -1
  87. package/dist/types/components/carousel.d.ts +51 -0
  88. package/dist/types/components/carousel.js +1 -0
  89. package/dist/types/components/footer.d.ts +2 -1
  90. package/dist/types/components/icon.d.ts +28 -0
  91. package/dist/types/components/icon.js +1 -0
  92. package/dist/types/components/image.d.ts +20 -0
  93. package/dist/types/components/image.js +1 -0
  94. package/dist/types/components/package.d.ts +2 -1
  95. package/dist/types/components/purchase-button.d.ts +2 -1
  96. package/dist/types/components/stack.d.ts +32 -0
  97. package/dist/types/components/stack.js +1 -0
  98. package/dist/types/components/text.d.ts +20 -0
  99. package/dist/types/components/text.js +1 -0
  100. package/dist/types/components/timeline.d.ts +35 -0
  101. package/dist/types/components/timeline.js +1 -0
  102. package/dist/types/localization.d.ts +2 -1
  103. package/dist/types/media.d.ts +4 -3
  104. package/dist/types/overrides.d.ts +48 -0
  105. package/dist/types/overrides.js +1 -0
  106. package/dist/types/paywall.d.ts +27 -0
  107. package/dist/types/paywall.js +1 -0
  108. package/dist/types/ui-config.d.ts +20 -0
  109. package/dist/types/ui-config.js +1 -0
  110. package/dist/types/variables.d.ts +13 -0
  111. package/dist/types/variables.js +10 -0
  112. package/dist/types.d.ts +17 -9
  113. package/dist/ui/atoms/typography.stories.svelte +1 -27
  114. package/dist/ui/molecules/button.stories.svelte +3 -8
  115. package/dist/ui/theme/colors.d.ts +0 -6
  116. package/dist/ui/theme/colors.js +1 -1
  117. package/dist/ui/theme/text.d.ts +3 -4
  118. package/dist/ui/theme/utils.d.ts +0 -10
  119. package/dist/ui/theme/utils.js +5 -5
  120. package/dist/utils/background-utils.d.ts +4 -0
  121. package/dist/utils/background-utils.js +39 -0
  122. package/dist/utils/base-utils.d.ts +18 -0
  123. package/dist/utils/base-utils.js +124 -0
  124. package/dist/utils/constants.d.ts +2 -2
  125. package/dist/utils/constants.js +6 -1
  126. package/dist/utils/font-utils.d.ts +4 -0
  127. package/dist/utils/font-utils.js +47 -0
  128. package/dist/utils/style-utils.d.ts +7 -120
  129. package/dist/utils/style-utils.js +29 -304
  130. package/dist/utils/variable-utils.d.ts +1 -22
  131. package/dist/utils/variable-utils.js +28 -24
  132. package/dist/web-components/index.css +1 -1
  133. package/dist/web-components/index.js +1435 -980
  134. package/package.json +36 -26
  135. package/dist/components/button/button-utils.d.ts +0 -2
  136. package/dist/components/button/button-utils.js +0 -19
  137. package/dist/components/image/image-utils.d.ts +0 -19
  138. package/dist/components/image/image-utils.js +0 -33
  139. package/dist/components/purchase-button/purchase-button-utils.d.ts +0 -2
  140. package/dist/components/purchase-button/purchase-button-utils.js +0 -20
  141. package/dist/data/entities.d.ts +0 -162
  142. package/dist/stories/meta-templates.d.ts +0 -12
  143. package/dist/stories/meta-templates.js +0 -155
  144. /package/dist/{data/entities.js → types/base.js} +0 -0
@@ -8,11 +8,17 @@ export function paywallDecorator() {
8
8
  window.alert(`Selected package ${packageId}`);
9
9
  }
10
10
  });
11
+ const emptyUiConfig = {
12
+ app: {
13
+ fonts: {},
14
+ },
15
+ };
11
16
  setPaywallContext({
12
17
  selectedPackageId,
13
18
  variablesPerPackage: readable(undefined),
14
19
  onPurchase: () => window.alert("Purchase clicked"),
15
20
  onButtonAction: (action) => window.alert(`Button clicked: ${JSON.stringify(action, undefined, 2)}`),
21
+ uiConfig: emptyUiConfig,
16
22
  });
17
23
  return Story();
18
24
  };
@@ -1,3 +1,3 @@
1
- import type { VariableDictionary } from "../utils/variable-utils";
1
+ import type { VariableDictionary } from "../types/variables";
2
2
  import type { DecoratorFunction, Renderer } from "storybook/internal/csf";
3
3
  export declare function variablesDecorator<TRenderer extends Renderer, TArgs>(variables?: VariableDictionary): DecoratorFunction<TRenderer, TArgs>;
@@ -0,0 +1,2 @@
1
+ import type { DecoratorFunction, Renderer } from "storybook/internal/csf";
2
+ export declare function viewportDecorator<TRenderer extends Renderer, TArgs>(width: number, height: number, elements: number): DecoratorFunction<TRenderer, TArgs>;
@@ -0,0 +1,8 @@
1
+ import ViewportWrapper from "./viewport-wrapper.svelte";
2
+ export function viewportDecorator(width, height, elements) {
3
+ return (Story) => ({
4
+ Component: ViewportWrapper,
5
+ props: { width, height, elements },
6
+ Slot: Story(),
7
+ });
8
+ }
@@ -0,0 +1,55 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from "svelte";
3
+
4
+ interface Props {
5
+ width: number;
6
+ height: number;
7
+ elements: number;
8
+ children: Snippet;
9
+ }
10
+
11
+ const { width, height, elements, children }: Props = $props();
12
+
13
+ const style = $derived(`width: ${width}px; height: ${height}px`);
14
+ </script>
15
+
16
+ <div class="container" {style}>
17
+ {#if elements > 0}
18
+ <div class="content">
19
+ {#each Array(elements) as _, index}
20
+ <div>Item {index + 1}</div>
21
+ {/each}
22
+ </div>
23
+ {/if}
24
+ {@render children()}
25
+ </div>
26
+
27
+ <style>
28
+ .container {
29
+ position: relative;
30
+ overflow: hidden;
31
+ outline: 1px solid #dddddd;
32
+ display: flex;
33
+ flex-direction: column;
34
+ justify-content: flex-start;
35
+ align-items: stretch;
36
+ }
37
+
38
+ .content {
39
+ flex: 1;
40
+ overflow: auto;
41
+ display: flex;
42
+ flex-direction: column;
43
+ justify-content: flex-start;
44
+ align-items: stretch;
45
+
46
+ & > div {
47
+ min-height: 50px;
48
+ border-bottom: 1px solid #dddddd;
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: center;
52
+ align-items: center;
53
+ }
54
+ }
55
+ </style>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from "svelte";
2
+ interface Props {
3
+ width: number;
4
+ height: number;
5
+ elements: number;
6
+ children: Snippet;
7
+ }
8
+ declare const ViewportWrapper: import("svelte").Component<Props, {}, "">;
9
+ type ViewportWrapper = ReturnType<typeof ViewportWrapper>;
10
+ export default ViewportWrapper;
@@ -1,10 +1,2 @@
1
- export declare function withLayout(Story: unknown, context: unknown): {
2
- Component: import("svelte").Component<import("./with-layout.svelte").Props, {}, "">;
3
- props: {
4
- globals: any;
5
- children: () => {
6
- Component: unknown;
7
- props: any;
8
- };
9
- };
10
- };
1
+ import type { DecoratorFunction, Renderer } from "storybook/internal/types";
2
+ export declare function withLayout<TRenderer extends Renderer, TArgs>(): DecoratorFunction<TRenderer, TArgs>;
@@ -1,15 +1,13 @@
1
1
  import WithLayout from "./with-layout.svelte";
2
- export function withLayout(Story, context) {
3
- return {
2
+ export function withLayout() {
3
+ return (Story, context) => ({
4
4
  Component: WithLayout,
5
5
  props: {
6
- // @ts-expect-error too hard to get the type right
7
6
  globals: context.globals,
8
7
  children: () => ({
9
8
  Component: Story,
10
- // @ts-expect-error too hard to get the type right
11
9
  props: context.args,
12
10
  }),
13
11
  },
14
- };
12
+ });
15
13
  }
@@ -1,19 +1,21 @@
1
1
  export type Distribution = "start" | "center" | "end" | "space_between" | "space_around" | "space_evenly";
2
2
  export type VerticalAlignment = "top" | "center" | "bottom";
3
- export type HorizontalDimension = {
3
+ type HorizontalDimension = {
4
4
  type: "horizontal";
5
5
  alignment: VerticalAlignment;
6
6
  distribution: Distribution;
7
7
  };
8
8
  export type HorizontalAlignment = "leading" | "center" | "trailing";
9
- export type VerticalDimension = {
9
+ type VerticalDimension = {
10
10
  type: "vertical";
11
11
  alignment: HorizontalAlignment;
12
12
  distribution: Distribution;
13
13
  };
14
14
  export type ZAlignment = "top_leading" | "top" | "top_trailing" | "leading" | "center" | "trailing" | "bottom_leading" | "bottom" | "bottom_trailing";
15
- export type ZDimension = {
15
+ type ZDimension = {
16
16
  type: "zlayer";
17
17
  alignment: ZAlignment;
18
+ distribution?: unknown;
18
19
  };
19
20
  export type Dimension = HorizontalDimension | VerticalDimension | ZDimension;
21
+ export {};
@@ -1,18 +1,19 @@
1
1
  import type { ColorGradientScheme } from "./colors";
2
- import type { ImageInfo, ImageObjectFit, VideoInfo } from "./media";
3
- export type BackgroundColor = {
2
+ import type { ImageInfo, FitMode, VideoInfo } from "./media";
3
+ type BackgroundColor = {
4
4
  type: "color";
5
5
  value: ColorGradientScheme;
6
6
  };
7
- export type BackgroundImage = {
7
+ type BackgroundImage = {
8
8
  type: "image";
9
9
  value: ImageInfo;
10
10
  color_overlay: ColorGradientScheme | null;
11
- fit_mode: ImageObjectFit;
11
+ fit_mode: FitMode;
12
12
  };
13
- export type BackgroundVideo = {
13
+ type BackgroundVideo = {
14
14
  type: "video";
15
15
  value: VideoInfo;
16
16
  color_overlay: ColorGradientScheme | null;
17
17
  };
18
18
  export type Background = BackgroundColor | BackgroundImage | BackgroundVideo;
19
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { Component } from "./component";
2
+ export interface BaseComponent {
3
+ type: string;
4
+ id: string;
5
+ name: string;
6
+ fallback?: Component;
7
+ }
@@ -1,4 +1,4 @@
1
- export type GradientPoint = {
1
+ type GradientPoint = {
2
2
  percent: number;
3
3
  color: string;
4
4
  };
@@ -6,11 +6,11 @@ type GradientColorInfo = {
6
6
  type: "linear" | "radial";
7
7
  points: GradientPoint[];
8
8
  };
9
- export type LinearGradientColorInfo = GradientColorInfo & {
9
+ type LinearGradientColorInfo = GradientColorInfo & {
10
10
  type: "linear";
11
11
  degrees: number;
12
12
  };
13
- export type RadialGradientColorInfo = GradientColorInfo & {
13
+ type RadialGradientColorInfo = GradientColorInfo & {
14
14
  type: "radial";
15
15
  };
16
16
  type AliasColorInfo = {
@@ -21,7 +21,7 @@ type HexColorInfo = {
21
21
  type: "hex";
22
22
  value: string;
23
23
  };
24
- export type ColorInfo = AliasColorInfo | HexColorInfo;
24
+ type ColorInfo = AliasColorInfo | HexColorInfo;
25
25
  export type ColorGradientInfo = ColorInfo | LinearGradientColorInfo | RadialGradientColorInfo;
26
26
  export type ColorScheme = {
27
27
  light: ColorInfo;
@@ -1,6 +1,11 @@
1
- import type { ImageProps, StackProps, TextNodeProps, TimelineProps } from "../data/entities";
1
+ import type { TimelineProps } from "./components/timeline";
2
+ import type { TextNodeProps } from "./components/text";
2
3
  import type { ButtonProps } from "./components/button";
3
4
  import type { FooterProps } from "./components/footer";
5
+ import type { IconProps } from "./components/icon";
6
+ import type { ImageProps } from "./components/image";
4
7
  import type { PackageProps } from "./components/package";
5
8
  import type { PurchaseButtonProps } from "./components/purchase-button";
6
- export type Component = ButtonProps | FooterProps | ImageProps | PackageProps | PurchaseButtonProps | StackProps | TextNodeProps | TimelineProps;
9
+ import type { StackProps } from "./components/stack";
10
+ import type { CarouselProps } from "./components/carousel";
11
+ export type Component = ButtonProps | CarouselProps | FooterProps | IconProps | ImageProps | PackageProps | PurchaseButtonProps | StackProps | TextNodeProps | TimelineProps;
@@ -1,4 +1,6 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { Overrides } from "../overrides";
3
+ import type { StackProps } from "./stack";
2
4
  interface RestorePurchasesAction {
3
5
  type: "restore_purchases";
4
6
  }
@@ -22,6 +24,7 @@ interface NavigateToWebPurchase {
22
24
  interface NavigateToUrlAction {
23
25
  type: "navigate_to";
24
26
  destination: "privacy_policy" | "terms" | "url";
27
+ sheet?: null;
25
28
  url: {
26
29
  url_lid: string;
27
30
  method: "deep_link" | "external_browser" | "in_app_browser";
@@ -32,5 +35,7 @@ export interface ButtonProps extends BaseComponent {
32
35
  type: "button";
33
36
  action: Action;
34
37
  stack: StackProps;
38
+ transition?: null;
39
+ overrides?: Overrides<ButtonProps>;
35
40
  }
36
41
  export {};
@@ -0,0 +1,51 @@
1
+ import type { BorderType, ShadowType, ShapeType, Spacing } from "..";
2
+ import type { VerticalAlignment } from "../alignment";
3
+ import type { Background } from "../background";
4
+ import type { BaseComponent } from "../base";
5
+ import type { ColorScheme } from "../colors";
6
+ import type { Overrides } from "../overrides";
7
+ import type { StackProps } from "./stack";
8
+ export interface PageControlIndicator {
9
+ width: number;
10
+ height: number;
11
+ color: ColorScheme;
12
+ stroke_color?: ColorScheme | null;
13
+ stroke_width?: number | null;
14
+ }
15
+ export interface PageControl {
16
+ position: "top" | "bottom";
17
+ spacing: number;
18
+ margin: Spacing;
19
+ padding: Spacing;
20
+ background_color?: ColorScheme | null;
21
+ border?: BorderType | null;
22
+ shape?: ShapeType | null;
23
+ shadow?: ShadowType | null;
24
+ active: PageControlIndicator;
25
+ default: PageControlIndicator;
26
+ }
27
+ type AutoAdvanceTransitionType = "fade" | "slide";
28
+ interface AutoAdvance {
29
+ ms_time_per_page: number;
30
+ ms_transition_time: number;
31
+ transition_type: AutoAdvanceTransitionType;
32
+ }
33
+ export interface CarouselProps extends BaseComponent {
34
+ type: "carousel";
35
+ pages: StackProps[];
36
+ padding: Spacing;
37
+ margin: Spacing;
38
+ background?: Background | null;
39
+ shape?: ShapeType | null;
40
+ border?: BorderType | null;
41
+ shadow?: ShadowType | null;
42
+ page_alignment: VerticalAlignment;
43
+ page_spacing: number;
44
+ page_peek: number;
45
+ page_control?: PageControl | null;
46
+ initial_page_index: number;
47
+ loop: boolean;
48
+ auto_advance?: AutoAdvance | null;
49
+ overrides?: Overrides<CarouselProps>;
50
+ }
51
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  export interface FooterProps extends BaseComponent {
3
4
  type: "footer";
4
5
  stack: StackProps;
@@ -0,0 +1,28 @@
1
+ import type { BorderType, CircleShape, RectangleShape, ShadowType, SizeType, Spacing } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorScheme } from "../colors";
4
+ import type { Overrides } from "../overrides";
5
+ export interface IconBackground {
6
+ color: ColorScheme | null;
7
+ shape: RectangleShape | CircleShape;
8
+ border?: BorderType | null;
9
+ shadow?: ShadowType | null;
10
+ }
11
+ export interface IconProps extends BaseComponent {
12
+ type: "icon";
13
+ visible?: boolean | null;
14
+ icon_name: string;
15
+ base_url: string;
16
+ formats: {
17
+ svg?: string;
18
+ png?: string;
19
+ webp?: string;
20
+ heic?: string;
21
+ };
22
+ size: SizeType;
23
+ padding?: Spacing | null;
24
+ margin?: Spacing | null;
25
+ color: ColorScheme;
26
+ icon_background?: IconBackground | null;
27
+ overrides?: Overrides<IconProps>;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { BorderType, CircleShape, ConcaveShape, ConvexShape, RectangleShape, ShadowType, SizeType, Spacing } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorGradientScheme } from "../colors";
4
+ import type { FitMode, ImageInfo } from "../media";
5
+ import type { Overrides } from "../overrides";
6
+ export interface ImageProps extends BaseComponent {
7
+ type: "image";
8
+ visible?: boolean | null;
9
+ source: ImageInfo;
10
+ override_source_lid?: string;
11
+ size: SizeType;
12
+ mask_shape?: RectangleShape | CircleShape | ConcaveShape | ConvexShape | null;
13
+ fit_mode: FitMode;
14
+ padding?: Spacing | null;
15
+ margin?: Spacing | null;
16
+ color_overlay?: ColorGradientScheme | null;
17
+ border?: BorderType | null;
18
+ shadow?: ShadowType | null;
19
+ overrides?: Overrides<ImageProps>;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  export interface PackageProps extends BaseComponent {
3
4
  type: "package";
4
5
  package_id: string;
@@ -1,4 +1,5 @@
1
- import type { BaseComponent, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  export interface PurchaseButtonProps extends BaseComponent {
3
4
  type: "purchase_button";
4
5
  stack: StackProps;
@@ -0,0 +1,32 @@
1
+ import type { BorderType, ShadowType, ShapeType, SizeType, Spacing } from "..";
2
+ import type { Dimension } from "../alignment";
3
+ import type { Background } from "../background";
4
+ import type { ColorGradientScheme } from "../colors";
5
+ import type { Component } from "../component";
6
+ import type { BaseComponent } from "../base";
7
+ import type { Overrides } from "../overrides";
8
+ type BadgeStyle = "overlay" | "nested" | "edge_to_edge";
9
+ type BadgeAlignment = "top_leading" | "top" | "top_trailing" | "bottom_leading" | "bottom" | "bottom_trailing";
10
+ export type Badge = {
11
+ style: BadgeStyle;
12
+ alignment: BadgeAlignment;
13
+ stack: StackProps;
14
+ };
15
+ export interface StackProps extends BaseComponent {
16
+ type: "stack";
17
+ visible?: boolean | null;
18
+ components: Component[];
19
+ size: SizeType;
20
+ dimension: Dimension;
21
+ spacing: number;
22
+ margin: Spacing;
23
+ padding: Spacing;
24
+ background_color: ColorGradientScheme | null;
25
+ background: Background | null;
26
+ border: BorderType | null;
27
+ shape: ShapeType | null;
28
+ shadow: ShadowType | null;
29
+ badge?: Badge | null;
30
+ overrides?: Overrides<StackProps>;
31
+ }
32
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { FontSizes, FontWeights, SizeType, Spacing, TextAlignments } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorGradientScheme, ColorScheme } from "../colors";
4
+ import type { Overrides } from "../overrides";
5
+ export interface TextNodeProps extends BaseComponent {
6
+ text_lid: string;
7
+ font_name?: string | null;
8
+ font_size: number | keyof typeof FontSizes;
9
+ font_weight: keyof typeof FontWeights;
10
+ font_weight_int?: number;
11
+ horizontal_alignment: keyof typeof TextAlignments;
12
+ color: ColorScheme;
13
+ background_color?: ColorGradientScheme | null;
14
+ type: "text";
15
+ visible?: boolean | null;
16
+ padding: Spacing;
17
+ margin: Spacing;
18
+ size: SizeType;
19
+ overrides?: Overrides<TextNodeProps>;
20
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { SizeType, Spacing } from "..";
2
+ import type { BaseComponent } from "../base";
3
+ import type { ColorGradientScheme } from "../colors";
4
+ import type { Overrides } from "../overrides";
5
+ import type { IconProps } from "./icon";
6
+ import type { TextNodeProps } from "./text";
7
+ export interface TimelineProps extends BaseComponent {
8
+ type: "timeline";
9
+ visible?: boolean | null;
10
+ icon_alignment: "title" | "title_and_description";
11
+ item_spacing: number;
12
+ text_spacing: number;
13
+ column_gutter: number;
14
+ size: SizeType;
15
+ padding: Spacing;
16
+ margin: Spacing;
17
+ items: TimelineItemProps[];
18
+ overrides?: Overrides<TimelineProps>;
19
+ }
20
+ export interface TimelineConnectorProps {
21
+ width: number;
22
+ margin: {
23
+ top: number;
24
+ bottom: number;
25
+ };
26
+ color: ColorGradientScheme | null;
27
+ }
28
+ export interface TimelineItemProps extends BaseComponent {
29
+ type: "timeline_item";
30
+ icon: IconProps;
31
+ title: TextNodeProps;
32
+ description?: TextNodeProps | null;
33
+ connector?: TimelineConnectorProps;
34
+ overrides?: Overrides<TimelineItemProps>;
35
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { ImageInfo } from "./media";
2
2
  export type LocalizationValue = string | ImageInfo;
3
- export type Localization = Partial<Record<string, string>>;
3
+ type Localization = Partial<Record<string, string>>;
4
4
  export type Localizations = Partial<Record<string, Localization>>;
5
+ export {};
@@ -1,4 +1,4 @@
1
- export type ImageFiles = {
1
+ type ImageFiles = {
2
2
  width: number;
3
3
  height: number;
4
4
  original: string;
@@ -9,10 +9,11 @@ export type ImageFiles = {
9
9
  };
10
10
  export type ImageInfo = {
11
11
  light: ImageFiles;
12
- dark: ImageFiles | null;
12
+ dark?: ImageFiles | null;
13
13
  };
14
14
  export type VideoInfo = {
15
15
  light: string;
16
16
  dark: string | null;
17
17
  };
18
- export type ImageObjectFit = "fit" | "fill";
18
+ export type FitMode = "fit" | "fill";
19
+ export {};
@@ -0,0 +1,48 @@
1
+ type ScreenSize = "desktop" | "tablet" | "mobile";
2
+ type Orientation = "portrait" | "landscape";
3
+ type EqualityOperator = "is" | "is not";
4
+ type ArrayOperator = "in" | "not in";
5
+ type IntroOfferCondition = {
6
+ type: "intro_offer";
7
+ };
8
+ type MultipleIntroOffersCondition = {
9
+ type: "multiple_intro_offers";
10
+ };
11
+ type SelectedCondition = {
12
+ type: "selected";
13
+ };
14
+ type ScreenSizeCondition = {
15
+ type: "screen_size";
16
+ operator: ArrayOperator;
17
+ sizes: ScreenSize[];
18
+ };
19
+ type OrientationCondition = {
20
+ type: "orientation";
21
+ operator: ArrayOperator;
22
+ orientations: Orientation[];
23
+ };
24
+ type IntroductoryOfferCondition = {
25
+ type: "introductory_offer";
26
+ operator: EqualityOperator;
27
+ value: boolean;
28
+ };
29
+ type SelectedPackageCondition = {
30
+ type: "selected_package";
31
+ operator: ArrayOperator;
32
+ packages: string[];
33
+ };
34
+ type PromoOfferCondition = {
35
+ type: "promo_offer";
36
+ };
37
+ type OverrideCondition = IntroOfferCondition | MultipleIntroOffersCondition | SelectedCondition | ScreenSizeCondition | OrientationCondition | IntroductoryOfferCondition | SelectedPackageCondition | PromoOfferCondition;
38
+ /**
39
+ * The reserved properties of an override that should not be included in the override properties
40
+ */
41
+ type ReservedProperty = "id" | "type" | "overrides" | "stack" | "components" | "items" | "pages" | "tabs";
42
+ type OverrideProperties<C> = Partial<Omit<C, ReservedProperty>>;
43
+ type Override<C> = {
44
+ conditions: OverrideCondition[];
45
+ properties: OverrideProperties<C>;
46
+ };
47
+ export type Overrides<C> = Override<C>[];
48
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import type { Background } from "./background";
2
+ import type { FooterProps } from "./components/footer";
3
+ import type { StackProps } from "./components/stack";
4
+ import type { Localizations } from "./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
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ type AppFontFamilyConfig = {
2
+ type: "name" | "url";
3
+ value?: string;
4
+ family: string;
5
+ hash: string;
6
+ style: string;
7
+ url: string;
8
+ weight: number;
9
+ };
10
+ type AppFontsConfig = Record<string, {
11
+ ios?: AppFontFamilyConfig;
12
+ android?: AppFontFamilyConfig;
13
+ web?: AppFontFamilyConfig;
14
+ }>;
15
+ export type UIConfig = {
16
+ app: {
17
+ fonts: AppFontsConfig;
18
+ };
19
+ };
20
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export declare enum PackageIdentifier {
2
+ weekly = "$rc_weekly",
3
+ monthly = "$rc_monthly",
4
+ two_month = "$rc_two_month",
5
+ three_month = "$rc_three_month",
6
+ six_month = "$rc_six_month",
7
+ annual = "$rc_annual",
8
+ lifetime = "$rc_lifetime"
9
+ }
10
+ type VariableName = "product.price" | "product.price_per_period" | "product.price_per_period_abbreviated" | "product.price_per_day" | "product.price_per_week" | "product.price_per_month" | "product.price_per_year" | "product.period" | "product.period_abbreviated" | "product.periodly" | "product.period_in_days" | "product.period_in_weeks" | "product.period_in_months" | "product.period_in_years" | "product.period_with_unit" | "product.currency_code" | "product.currency_symbol" | "product.offer_price" | "product.offer_price_per_day" | "product.offer_price_per_week" | "product.offer_price_per_month" | "product.offer_price_per_year" | "product.offer_period" | "product.offer_period_abbreviated" | "product.offer_period_in_days" | "product.offer_period_in_weeks" | "product.offer_period_in_months" | "product.offer_period_in_years" | "product.offer_period_with_unit" | "product.offer_end_date" | "product.secondary_offer_price" | "product.secondary_offer_period" | "product.secondary_offer_period_abbreviated" | "product.relative_discount" | "product.store_product_name";
11
+ export type VariableDictionary = Record<VariableName, string>;
12
+ export type VariablesDictionary = Record<PackageIdentifier, VariableDictionary>;
13
+ export {};