@revenuecat/purchases-ui-js 2.0.1 → 2.0.3

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 (138) hide show
  1. package/dist/components/button/ButtonNode.stories.svelte +66 -108
  2. package/dist/components/button/ButtonNode.svelte +3 -31
  3. package/dist/components/footer/Footer.stories.svelte +112 -106
  4. package/dist/components/footer/Footer.svelte +10 -6
  5. package/dist/components/icon/Icon.stories.svelte +100 -0
  6. package/dist/components/icon/Icon.stories.svelte.d.ts +19 -0
  7. package/dist/components/icon/Icon.svelte +73 -0
  8. package/dist/components/icon/Icon.svelte.d.ts +4 -0
  9. package/dist/components/image/ClipPath.svelte +49 -0
  10. package/dist/components/image/ClipPath.svelte.d.ts +9 -0
  11. package/dist/components/image/Image.stories.svelte +83 -199
  12. package/dist/components/image/Image.svelte +152 -137
  13. package/dist/components/image/Image.svelte.d.ts +1 -1
  14. package/dist/components/image/Overlay.svelte +36 -0
  15. package/dist/components/image/Overlay.svelte.d.ts +8 -0
  16. package/dist/components/package/Package.stories.svelte +12 -27
  17. package/dist/components/package/Package.svelte +10 -44
  18. package/dist/components/paywall/Node.svelte +45 -43
  19. package/dist/components/paywall/Node.svelte.d.ts +10 -12
  20. package/dist/components/paywall/Paywall.stories.svelte +36 -140
  21. package/dist/components/paywall/Paywall.svelte +38 -20
  22. package/dist/components/paywall/Paywall.svelte.d.ts +3 -2
  23. package/dist/components/paywall/fixtures/override-paywall.d.ts +2 -0
  24. package/dist/components/paywall/fixtures/override-paywall.js +1310 -0
  25. package/dist/components/paywall/fixtures/stack-paywall.d.ts +2 -0
  26. package/dist/components/paywall/fixtures/stack-paywall.js +5223 -0
  27. package/dist/components/paywall/fixtures/variables.d.ts +261 -0
  28. package/dist/components/paywall/fixtures/variables.js +262 -0
  29. package/dist/components/purchase-button/PurchaseButton.stories.svelte +10 -29
  30. package/dist/components/purchase-button/PurchaseButton.svelte +2 -34
  31. package/dist/components/stack/Stack.stories.svelte +2364 -1020
  32. package/dist/components/stack/Stack.svelte +108 -151
  33. package/dist/components/stack/Stack.svelte.d.ts +6 -2
  34. package/dist/components/stack/stack-utils.d.ts +10 -30
  35. package/dist/components/stack/stack-utils.js +77 -257
  36. package/dist/components/text/Text.svelte +3 -37
  37. package/dist/components/text/Text.svelte.d.ts +1 -2
  38. package/dist/components/text/TextNode.stories.svelte +10 -48
  39. package/dist/components/text/TextNode.svelte +25 -37
  40. package/dist/components/text/TextNode.svelte.d.ts +1 -1
  41. package/dist/components/text/text-utils.d.ts +4 -9
  42. package/dist/components/text/text-utils.js +32 -117
  43. package/dist/components/timeline/Timeline.stories.svelte +640 -256
  44. package/dist/components/timeline/Timeline.svelte +42 -30
  45. package/dist/components/timeline/Timeline.svelte.d.ts +1 -1
  46. package/dist/components/timeline/TimelineItem.svelte +80 -112
  47. package/dist/components/timeline/TimelineItem.svelte.d.ts +6 -2
  48. package/dist/components/timeline/timeline-utils.d.ts +24 -6
  49. package/dist/components/timeline/timeline-utils.js +21 -114
  50. package/dist/data/entities.d.ts +23 -169
  51. package/dist/index.d.ts +11 -10
  52. package/dist/index.js +11 -10
  53. package/dist/stores/color-mode.d.ts +1 -1
  54. package/dist/stores/localization.d.ts +1 -1
  55. package/dist/stores/localization.js +3 -2
  56. package/dist/stores/paywall.d.ts +7 -3
  57. package/dist/stores/selected.d.ts +5 -0
  58. package/dist/stores/selected.js +12 -0
  59. package/dist/stores/variables.d.ts +2 -3
  60. package/dist/stores/variables.js +0 -1
  61. package/dist/stories/component-decorator.d.ts +2 -0
  62. package/dist/stories/component-decorator.js +12 -0
  63. package/dist/stories/fixtures.d.ts +6 -4
  64. package/dist/stories/fixtures.js +6241 -5485
  65. package/dist/stories/localization-decorator.js +1 -1
  66. package/dist/stories/paywall-decorator.js +8 -1
  67. package/dist/stories/variables-decorator.d.ts +1 -1
  68. package/dist/stories/viewport-decorator.d.ts +2 -0
  69. package/dist/stories/viewport-decorator.js +8 -0
  70. package/dist/stories/viewport-wrapper.svelte +53 -0
  71. package/dist/stories/viewport-wrapper.svelte.d.ts +10 -0
  72. package/dist/stories/with-layout.d.ts +2 -10
  73. package/dist/stories/with-layout.js +3 -5
  74. package/dist/stories/with-layout.svelte +3 -3
  75. package/dist/types/alignment.d.ts +5 -3
  76. package/dist/types/background.d.ts +6 -5
  77. package/dist/types/base.d.ts +7 -0
  78. package/dist/types/colors.d.ts +4 -4
  79. package/dist/types/component.d.ts +10 -0
  80. package/dist/types/component.js +1 -0
  81. package/dist/types/components/button.d.ts +5 -2
  82. package/dist/types/components/footer.d.ts +3 -2
  83. package/dist/types/components/icon.d.ts +28 -0
  84. package/dist/types/components/icon.js +1 -0
  85. package/dist/types/components/image.d.ts +20 -0
  86. package/dist/types/components/image.js +1 -0
  87. package/dist/types/components/package.d.ts +3 -2
  88. package/dist/types/components/purchase-button.d.ts +3 -2
  89. package/dist/types/components/stack.d.ts +32 -0
  90. package/dist/types/components/stack.js +1 -0
  91. package/dist/types/components/text.d.ts +20 -0
  92. package/dist/types/components/text.js +1 -0
  93. package/dist/types/components/timeline.d.ts +35 -0
  94. package/dist/types/components/timeline.js +1 -0
  95. package/dist/types/localization.d.ts +2 -1
  96. package/dist/types/media.d.ts +4 -3
  97. package/dist/types/overrides.d.ts +48 -0
  98. package/dist/types/overrides.js +1 -0
  99. package/dist/types/variables.d.ts +13 -0
  100. package/dist/types/variables.js +10 -0
  101. package/dist/types.d.ts +17 -9
  102. package/dist/ui/atoms/typography.stories.svelte +3 -29
  103. package/dist/ui/atoms/typography.stories.svelte.d.ts +1 -1
  104. package/dist/ui/layout/main-block.svelte +2 -2
  105. package/dist/ui/molecules/button.stories.svelte +5 -10
  106. package/dist/ui/molecules/button.svelte +1 -1
  107. package/dist/ui/theme/colors.d.ts +0 -6
  108. package/dist/ui/theme/colors.js +1 -1
  109. package/dist/ui/theme/text.d.ts +3 -4
  110. package/dist/ui/theme/theme.d.ts +2 -2
  111. package/dist/ui/theme/theme.js +2 -2
  112. package/dist/ui/theme/utils.d.ts +2 -12
  113. package/dist/ui/theme/utils.js +5 -5
  114. package/dist/utils/background-utils.d.ts +4 -0
  115. package/dist/utils/background-utils.js +39 -0
  116. package/dist/utils/base-utils.d.ts +18 -0
  117. package/dist/utils/base-utils.js +124 -0
  118. package/dist/utils/constants.d.ts +2 -2
  119. package/dist/utils/constants.js +6 -1
  120. package/dist/utils/font-utils.d.ts +4 -0
  121. package/dist/utils/font-utils.js +47 -0
  122. package/dist/utils/style-utils.d.ts +7 -120
  123. package/dist/utils/style-utils.js +35 -314
  124. package/dist/utils/variable-utils.d.ts +1 -22
  125. package/dist/utils/variable-utils.js +28 -24
  126. package/dist/web-components/index.css +1 -1
  127. package/dist/web-components/index.js +1415 -987
  128. package/package.json +34 -24
  129. package/dist/components/button/button-utils.d.ts +0 -2
  130. package/dist/components/button/button-utils.js +0 -19
  131. package/dist/components/image/image-utils.d.ts +0 -19
  132. package/dist/components/image/image-utils.js +0 -33
  133. package/dist/components/purchase-button/purchase-button-utils.d.ts +0 -2
  134. package/dist/components/purchase-button/purchase-button-utils.js +0 -20
  135. package/dist/data/state.d.ts +0 -4
  136. package/dist/stories/meta-templates.d.ts +0 -12
  137. package/dist/stories/meta-templates.js +0 -155
  138. /package/dist/{data/state.js → types/base.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { setLocalizationContext, } from "../stores/localization";
2
2
  export function localizationDecorator(props) {
3
3
  return (Story) => {
4
- setLocalizationContext(props);
4
+ setLocalizationContext(() => props);
5
5
  return Story();
6
6
  };
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import { setPaywallContext } from "../stores/paywall";
2
- import { writable } from "svelte/store";
2
+ import { readable, writable } from "svelte/store";
3
3
  export function paywallDecorator() {
4
4
  return (Story) => {
5
5
  const selectedPackageId = writable(undefined);
@@ -8,10 +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,
18
+ variablesPerPackage: readable(undefined),
13
19
  onPurchase: () => window.alert("Purchase clicked"),
14
20
  onButtonAction: (action) => window.alert(`Button clicked: ${JSON.stringify(action, undefined, 2)}`),
21
+ uiConfig: emptyUiConfig,
15
22
  });
16
23
  return Story();
17
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,53 @@
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
+ <div class="content">
18
+ {#each Array(elements) as _, index}
19
+ <div>Item {index + 1}</div>
20
+ {/each}
21
+ </div>
22
+ {@render children()}
23
+ </div>
24
+
25
+ <style>
26
+ .container {
27
+ position: relative;
28
+ overflow: hidden;
29
+ outline: 1px solid #dddddd;
30
+ display: flex;
31
+ flex-direction: column;
32
+ justify-content: flex-start;
33
+ align-items: stretch;
34
+ }
35
+
36
+ .content {
37
+ flex: 1;
38
+ overflow: auto;
39
+ display: flex;
40
+ flex-direction: column;
41
+ justify-content: flex-start;
42
+ align-items: stretch;
43
+
44
+ & > div {
45
+ min-height: 50px;
46
+ border-bottom: 1px solid #dddddd;
47
+ display: flex;
48
+ flex-direction: column;
49
+ justify-content: center;
50
+ align-items: center;
51
+ }
52
+ }
53
+ </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,10 +1,10 @@
1
1
  <script module lang="ts">
2
- import { brandingAppearances } from "./fixtures";
3
- import { toProductInfoStyleVar } from "../ui/theme/utils";
2
+ import type { Snippet } from "svelte";
4
3
  import Container from "../ui/layout/container.svelte";
5
4
  import Layout from "../ui/layout/layout.svelte";
6
5
  import Main from "../ui/layout/main-block.svelte";
7
- import type { Snippet } from "svelte";
6
+ import { toProductInfoStyleVar } from "../ui/theme/utils";
7
+ import { brandingAppearances } from "./fixtures";
8
8
  </script>
9
9
 
10
10
  <script lang="ts">
@@ -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;
@@ -0,0 +1,10 @@
1
+ import type { TimelineProps } from "./components/timeline";
2
+ import type { TextNodeProps } from "./components/text";
3
+ import type { ButtonProps } from "./components/button";
4
+ import type { FooterProps } from "./components/footer";
5
+ import type { IconProps } from "./components/icon";
6
+ import type { ImageProps } from "./components/image";
7
+ import type { PackageProps } from "./components/package";
8
+ import type { PurchaseButtonProps } from "./components/purchase-button";
9
+ import type { StackProps } from "./components/stack";
10
+ export type Component = ButtonProps | FooterProps | IconProps | ImageProps | PackageProps | PurchaseButtonProps | StackProps | TextNodeProps | TimelineProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
- import type { SharedComponentProps, StackProps } from "../../data/entities";
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
2
3
  interface RestorePurchasesAction {
3
4
  type: "restore_purchases";
4
5
  }
@@ -22,15 +23,17 @@ interface NavigateToWebPurchase {
22
23
  interface NavigateToUrlAction {
23
24
  type: "navigate_to";
24
25
  destination: "privacy_policy" | "terms" | "url";
26
+ sheet?: null;
25
27
  url: {
26
28
  url_lid: string;
27
29
  method: "deep_link" | "external_browser" | "in_app_browser";
28
30
  };
29
31
  }
30
32
  export type Action = RestorePurchasesAction | NavigateBackAction | NavigateToAction | NavigateToSheetAction | NavigateToWebPurchase | NavigateToUrlAction;
31
- export interface ButtonProps extends SharedComponentProps {
33
+ export interface ButtonProps extends BaseComponent {
32
34
  type: "button";
33
35
  action: Action;
34
36
  stack: StackProps;
37
+ transition?: null;
35
38
  }
36
39
  export {};
@@ -1,5 +1,6 @@
1
- import type { SharedComponentProps, StackProps } from "../../data/entities";
2
- export interface FooterProps extends SharedComponentProps {
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
3
+ export interface FooterProps extends BaseComponent {
3
4
  type: "footer";
4
5
  stack: StackProps;
5
6
  }
@@ -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,5 +1,6 @@
1
- import type { SharedComponentProps, StackProps } from "../../data/entities";
2
- export interface PackageProps extends SharedComponentProps {
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
3
+ export interface PackageProps extends BaseComponent {
3
4
  type: "package";
4
5
  package_id: string;
5
6
  is_selected_by_default: boolean;
@@ -1,5 +1,6 @@
1
- import type { SharedComponentProps, StackProps } from "../../data/entities";
2
- export interface PurchaseButtonProps extends SharedComponentProps {
1
+ import type { BaseComponent } from "../base";
2
+ import type { StackProps } from "./stack";
3
+ export interface PurchaseButtonProps extends BaseComponent {
3
4
  type: "purchase_button";
4
5
  stack: StackProps;
5
6
  }
@@ -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,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 {};
@@ -0,0 +1,10 @@
1
+ export var PackageIdentifier;
2
+ (function (PackageIdentifier) {
3
+ PackageIdentifier["weekly"] = "$rc_weekly";
4
+ PackageIdentifier["monthly"] = "$rc_monthly";
5
+ PackageIdentifier["two_month"] = "$rc_two_month";
6
+ PackageIdentifier["three_month"] = "$rc_three_month";
7
+ PackageIdentifier["six_month"] = "$rc_six_month";
8
+ PackageIdentifier["annual"] = "$rc_annual";
9
+ PackageIdentifier["lifetime"] = "$rc_lifetime";
10
+ })(PackageIdentifier || (PackageIdentifier = {}));
package/dist/types.d.ts CHANGED
@@ -40,29 +40,37 @@ export declare enum TextAlignments {
40
40
  center = "center",
41
41
  trailing = "end"
42
42
  }
43
- export type SizeType = {
44
- width: Size;
45
- height: Size;
46
- };
47
- export type Size = FixedSize | RelativeSize;
48
43
  type FixedSize = {
49
44
  type: "fixed";
50
45
  value: number;
51
46
  };
52
47
  type RelativeSize = {
53
- type: "fit" | "fill";
48
+ type: "fit" | "fill" | "relative";
54
49
  value?: null;
55
50
  };
56
- export type ShapeType = RectangleShape | PillShape;
51
+ export type Size = FixedSize | RelativeSize;
52
+ export type SizeType = {
53
+ width: Size;
54
+ height: Size;
55
+ };
56
+ export type ShapeType = CircleShape | RectangleShape | PillShape;
57
57
  export type RectangleShape = {
58
58
  type: "rectangle";
59
- corners: CornerRadiusType;
59
+ corners: CornerRadiusType | null;
60
60
  };
61
61
  export type CircleShape = {
62
62
  type: "circle";
63
+ corners?: null;
63
64
  };
64
- type PillShape = {
65
+ export type PillShape = {
65
66
  type: "pill";
67
+ corners?: CornerRadiusType | null;
68
+ };
69
+ export type ConcaveShape = {
70
+ type: "concave";
71
+ };
72
+ export type ConvexShape = {
73
+ type: "convex";
66
74
  };
67
75
  export type BorderType = {
68
76
  color: ColorScheme;