@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
@@ -0,0 +1,19 @@
1
+ import Icon from "./Icon.svelte";
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const Icon: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, string>;
18
+ type Icon = InstanceType<typeof Icon>;
19
+ export default Icon;
@@ -0,0 +1,73 @@
1
+ <script lang="ts">
2
+ import { getColorModeContext } from "../../stores/color-mode";
3
+ import { getSelectedStateContext } from "../../stores/selected";
4
+ import type { IconProps } from "../../types/components/icon";
5
+ import {
6
+ css,
7
+ mapBorder,
8
+ mapBorderRadius,
9
+ mapColor,
10
+ mapShadow,
11
+ mapSize,
12
+ mapSpacing,
13
+ } from "../../utils/base-utils";
14
+ import { getActiveStateProps } from "../../utils/style-utils";
15
+
16
+ const props: IconProps = $props();
17
+ const selectedState = getSelectedStateContext();
18
+ const {
19
+ base_url,
20
+ formats,
21
+ size,
22
+ margin,
23
+ padding,
24
+ color,
25
+ icon_background: background,
26
+ } = $derived.by(() => {
27
+ return {
28
+ ...props,
29
+ ...getActiveStateProps($selectedState, props.overrides),
30
+ };
31
+ });
32
+
33
+ const getColorMode = getColorModeContext();
34
+ const colorMode = $derived(getColorMode());
35
+
36
+ const container = $derived(
37
+ css({
38
+ width: mapSize(size.width),
39
+ height: mapSize(size.height),
40
+ margin: mapSpacing(margin),
41
+ padding: mapSpacing(padding),
42
+ "background-color": mapColor(colorMode, background?.color),
43
+ border: mapBorder(colorMode, background?.border),
44
+ "border-radius": mapBorderRadius(background?.shape),
45
+ "box-shadow": mapShadow(colorMode, background?.shadow),
46
+ flex: "0 0 auto",
47
+ }),
48
+ );
49
+
50
+ const webpUrl = $derived(`${base_url}/${formats.webp}`);
51
+ const icon = $derived(
52
+ css({
53
+ width: "100%",
54
+ height: "100%",
55
+ position: "relative",
56
+ "z-index": 1,
57
+ overflow: "hidden",
58
+ "background-color": mapColor(colorMode, color),
59
+ "mask-image": `url(${webpUrl})`,
60
+ "webkit-mask-image": `url(${webpUrl})`,
61
+ "mask-size": "contain",
62
+ "webkit-mask-size": "contain",
63
+ "mask-position": "center",
64
+ "webkit-mask-position": "center",
65
+ "mask-repeat": "no-repeat",
66
+ "webkit-mask-repeat": "no-repeat",
67
+ }),
68
+ );
69
+ </script>
70
+
71
+ <div style={container}>
72
+ <div style={icon}></div>
73
+ </div>
@@ -0,0 +1,4 @@
1
+ import type { IconProps } from "../../types/components/icon";
2
+ declare const Icon: import("svelte").Component<IconProps, {}, "">;
3
+ type Icon = ReturnType<typeof Icon>;
4
+ export default Icon;
@@ -0,0 +1,49 @@
1
+ <script lang="ts">
2
+ import type { ImageProps } from "../../types/components/image";
3
+
4
+ interface ClipPathProps {
5
+ shape: ImageProps["mask_shape"];
6
+ width: number;
7
+ height: number;
8
+ }
9
+
10
+ const { shape, width, height }: ClipPathProps = $props();
11
+
12
+ const [topLeft, topRight, bottomRight, bottomLeft] = $derived.by(() => {
13
+ if (shape?.type !== "rectangle") {
14
+ return [0, 0, 0, 0];
15
+ }
16
+
17
+ const { corners } = shape;
18
+ return [
19
+ corners?.top_leading ?? 0,
20
+ corners?.top_trailing ?? 0,
21
+ corners?.bottom_trailing ?? 0,
22
+ corners?.bottom_leading ?? 0,
23
+ ];
24
+ });
25
+ </script>
26
+
27
+ {#if shape?.type === "circle"}
28
+ <circle cx={width / 2} cy={height / 2} r={Math.min(width, height) / 2} />
29
+ {/if}
30
+
31
+ {#if shape?.type === "concave"}
32
+ <path
33
+ d={`M 0 0 L ${width} 0 L ${width} ${height} Q ${width / 2} ${height - 54} 0 ${height} Z`}
34
+ />
35
+ {/if}
36
+ {#if shape?.type === "convex"}
37
+ <path
38
+ d={`M 0 0 L ${width} 0 L ${width} ${height - 27} Q ${width / 2} ${height + 27} 0 ${height - 27} Z`}
39
+ />
40
+ {/if}
41
+
42
+ {#if shape?.type === "rectangle" || shape?.type === undefined}
43
+ <path
44
+ d={`M ${topLeft} 0 H ${width - topRight} A ${topRight} ${topRight} 0 0 1 ${width} ${topRight}
45
+ V ${height - bottomRight} A ${bottomRight} ${bottomRight} 0 0 1 ${width - bottomRight} ${height}
46
+ H ${bottomLeft} A ${bottomLeft} ${bottomLeft} 0 0 1 0 ${height - bottomLeft}
47
+ V ${topLeft} A ${topLeft} ${topLeft} 0 0 1 ${topLeft} 0 Z`}
48
+ />
49
+ {/if}
@@ -0,0 +1,9 @@
1
+ import type { ImageProps } from "../../types/components/image";
2
+ interface ClipPathProps {
3
+ shape: ImageProps["mask_shape"];
4
+ width: number;
5
+ height: number;
6
+ }
7
+ declare const ClipPath: import("svelte").Component<ClipPathProps, {}, "">;
8
+ type ClipPath = ReturnType<typeof ClipPath>;
9
+ export default ClipPath;
@@ -1,91 +1,55 @@
1
1
  <script module lang="ts">
2
2
  import Image from "./Image.svelte";
3
- import type { PurchaseState } from "../../data/state";
3
+ import { componentDecorator } from "../../stories/component-decorator";
4
4
  import { defineMeta } from "@storybook/addon-svelte-csf";
5
5
 
6
- const purchaseState: PurchaseState = {};
7
-
8
6
  const { Story } = defineMeta({
9
7
  title: "Components/Image",
10
8
  component: Image,
11
- tags: ["autodocs"],
12
- argTypes: {
13
- id: { control: "text", description: "Unique identifier for the image" },
14
- gradient_colors: {
15
- control: "object",
16
- description: "Gradient colors for the overlay",
17
- },
9
+ decorators: [componentDecorator()],
10
+ args: {
11
+ type: "image",
12
+ id: "image",
13
+ name: "Image",
14
+ fit_mode: "fill",
18
15
  size: {
19
- control: "object",
20
- description: "Size configuration for the image",
21
- },
22
- max_height: {
23
- control: "number",
24
- description: "Maximum height of the image",
25
- },
26
- override_source_lid: {
27
- control: "text",
28
- description: "Override source lid",
29
- },
30
- fit_mode: {
31
- control: { type: "select" },
32
- options: ["fit", "fill"],
33
- description: "Fit mode for the image",
16
+ width: { type: "fill" },
17
+ height: { type: "fill" },
18
+ },
19
+ source: {
20
+ dark: null,
21
+ light: {
22
+ width: 600,
23
+ height: 400,
24
+ original: "https://placehold.co/600x400",
25
+ heic: "https://placehold.co/600x400",
26
+ heic_low_res: "https://placehold.co/600x400",
27
+ webp: "https://placehold.co/600x400",
28
+ webp_low_res: "https://placehold.co/600x400",
29
+ },
34
30
  },
35
31
  },
36
32
  });
37
33
  </script>
38
34
 
39
- <!-- Rectangle story -->
40
35
  <Story
41
36
  name="Rectangle"
42
37
  args={{
43
- purchaseState,
44
- id: "example-id",
45
- fit_mode: "fit",
46
- size: {
47
- width: { type: "fill" },
48
- height: { type: "fill" },
49
- },
50
- source: {
51
- light: {
52
- width: 600,
53
- height: 400,
54
- original: "https://placehold.co/600x400",
55
- heic: "https://placehold.co/600x400",
56
- heic_low_res: "https://placehold.co/600x400",
57
- webp: "https://placehold.co/600x400",
58
- webp_low_res: "https://placehold.co/600x400",
38
+ mask_shape: {
39
+ type: "rectangle",
40
+ corners: {
41
+ top_leading: 0,
42
+ top_trailing: 0,
43
+ bottom_leading: 0,
44
+ bottom_trailing: 0,
59
45
  },
60
- dark: null,
61
46
  },
62
- mask_shape: { type: "rectangle" },
63
47
  }}
64
48
  />
65
49
 
66
- <!-- Rounded Rectangle story -->
67
50
  <Story
68
51
  name="Rounded Rectangle"
69
52
  args={{
70
- purchaseState,
71
- id: "example-id",
72
- fit_mode: "fit",
73
- size: {
74
- width: { type: "fill" },
75
- height: { type: "fill" },
76
- },
77
- source: {
78
- light: {
79
- width: 600,
80
- height: 400,
81
- original: "https://placehold.co/600x400",
82
- heic: "https://placehold.co/600x400",
83
- heic_low_res: "https://placehold.co/600x400",
84
- webp: "https://placehold.co/600x400",
85
- webp_low_res: "https://placehold.co/600x400",
86
- },
87
- dark: null,
88
- },
89
53
  mask_shape: {
90
54
  type: "rectangle",
91
55
  corners: {
@@ -97,166 +61,63 @@
97
61
  },
98
62
  }}
99
63
  />
100
- <!-- Circle story -->
64
+
101
65
  <Story
102
66
  name="Circle"
103
67
  args={{
104
- purchaseState,
105
- id: "example-id",
106
- fit_mode: "fit",
107
- size: {
108
- width: { type: "fill" },
109
- height: { type: "fill" },
110
- },
111
- source: {
112
- light: {
113
- width: 600,
114
- height: 400,
115
- original: "https://placehold.co/600x400",
116
- heic: "https://placehold.co/600x400",
117
- heic_low_res: "https://placehold.co/600x400",
118
- webp: "https://placehold.co/600x400",
119
- webp_low_res: "https://placehold.co/600x400",
120
- },
121
- dark: null,
122
- },
123
68
  mask_shape: { type: "circle" },
124
69
  }}
125
70
  />
126
- <!-- Concave story -->
71
+
127
72
  <Story
128
73
  name="Concave"
129
74
  args={{
130
- purchaseState,
131
- id: "example-id",
132
- fit_mode: "fit",
133
- size: {
134
- width: { type: "fill" },
135
- height: { type: "fill" },
136
- },
137
- source: {
138
- light: {
139
- width: 600,
140
- height: 400,
141
- original: "https://placehold.co/600x400",
142
- heic: "https://placehold.co/600x400",
143
- heic_low_res: "https://placehold.co/600x400",
144
- webp: "https://placehold.co/600x400",
145
- webp_low_res: "https://placehold.co/600x400",
146
- },
147
- dark: null,
148
- },
149
75
  mask_shape: { type: "concave" },
150
76
  }}
151
77
  />
152
- <!-- Convex story -->
78
+
153
79
  <Story
154
80
  name="Convex"
155
81
  args={{
156
- purchaseState,
157
- id: "example-id",
158
- fit_mode: "fit",
159
- size: {
160
- width: { type: "fill" },
161
- height: { type: "fill" },
162
- },
163
- source: {
164
- light: {
165
- width: 600,
166
- height: 400,
167
- original: "https://placehold.co/600x400",
168
- heic: "https://placehold.co/600x400",
169
- heic_low_res: "https://placehold.co/600x400",
170
- webp: "https://placehold.co/600x400",
171
- webp_low_res: "https://placehold.co/600x400",
172
- },
173
- dark: null,
174
- },
175
82
  mask_shape: { type: "convex" },
176
83
  }}
177
84
  />
178
- <!-- Radial Gradient story -->
85
+
179
86
  <Story
180
87
  name="Overlay Radial Gradient"
181
88
  args={{
182
- purchaseState,
183
- id: "example-id",
184
- fit_mode: "fit",
185
- size: {
186
- width: { type: "fill" },
187
- height: { type: "fill" },
188
- },
189
- source: {
190
- light: {
191
- width: 600,
192
- height: 400,
193
- original: "https://placehold.co/600x400",
194
- heic: "https://placehold.co/600x400",
195
- heic_low_res: "https://placehold.co/600x400",
196
- webp: "https://placehold.co/600x400",
197
- webp_low_res: "https://placehold.co/600x400",
198
- },
199
- dark: null,
200
- },
201
89
  color_overlay: {
202
- dark: {
203
- type: "hex",
204
- value: "#000000FF",
205
- },
206
90
  light: {
91
+ type: "radial",
207
92
  points: [
208
93
  {
209
- color: "#020024ff",
210
94
  percent: 0,
95
+ color: "#020024ff",
211
96
  },
212
97
  {
213
- color: "#00d4ff00",
214
98
  percent: 100,
99
+ color: "#00d4ff00",
215
100
  },
216
101
  ],
217
- type: "radial",
218
102
  },
219
103
  },
220
104
  }}
221
105
  />
222
- <!-- Linear Gradient story -->
106
+
223
107
  <Story
224
108
  name="Overlay Linear Gradient"
225
109
  args={{
226
- purchaseState,
227
- id: "example-id",
228
- fit_mode: "fit",
229
- size: {
230
- width: { type: "fill" },
231
- height: { type: "fill" },
232
- },
233
- source: {
234
- light: {
235
- width: 600,
236
- height: 400,
237
- original: "https://placehold.co/600x400",
238
- heic: "https://placehold.co/600x400",
239
- heic_low_res: "https://placehold.co/600x400",
240
- webp: "https://placehold.co/600x400",
241
- webp_low_res: "https://placehold.co/600x400",
242
- },
243
- dark: null,
244
- },
245
110
  color_overlay: {
246
- dark: {
247
- type: "hex",
248
- value: "#000000FF",
249
- },
250
111
  light: {
251
112
  degrees: 180,
252
113
  points: [
253
114
  {
254
- color: "#020024ff",
255
115
  percent: 0,
116
+ color: "#020024ff",
256
117
  },
257
118
  {
258
- color: "#00d4ff00",
259
119
  percent: 100,
120
+ color: "#00d4ff00",
260
121
  },
261
122
  ],
262
123
  type: "linear",
@@ -264,37 +125,60 @@
264
125
  },
265
126
  }}
266
127
  />
267
- <!-- Solid overlay -->
128
+
268
129
  <Story
269
130
  name="Overlay Solid"
270
131
  args={{
271
- purchaseState,
272
- id: "example-id",
273
- fit_mode: "fit",
132
+ color_overlay: {
133
+ light: {
134
+ type: "hex",
135
+ value: "#e7c00069",
136
+ },
137
+ },
138
+ }}
139
+ />
140
+
141
+ <Story
142
+ name="Complex"
143
+ args={{
274
144
  size: {
275
- width: { type: "fill" },
276
- height: { type: "fill" },
145
+ width: { type: "fixed", value: 128 },
146
+ height: { type: "fixed", value: 128 },
277
147
  },
278
- source: {
279
- light: {
280
- width: 600,
281
- height: 400,
282
- original: "https://placehold.co/600x400",
283
- heic: "https://placehold.co/600x400",
284
- heic_low_res: "https://placehold.co/600x400",
285
- webp: "https://placehold.co/600x400",
286
- webp_low_res: "https://placehold.co/600x400",
148
+ mask_shape: {
149
+ type: "rectangle",
150
+ corners: {
151
+ top_leading: 0,
152
+ top_trailing: 16,
153
+ bottom_trailing: 32,
154
+ bottom_leading: 64,
287
155
  },
288
- dark: null,
289
156
  },
157
+ fit_mode: "fill",
158
+ padding: { top: 0, bottom: 0, leading: 0, trailing: 0 },
159
+ margin: { top: 0, bottom: 0, leading: 0, trailing: 0 },
290
160
  color_overlay: {
291
- dark: {
292
- type: "hex",
293
- value: "#000000FF",
294
- },
295
161
  light: {
296
- type: "hex",
297
- value: "#e7c00069",
162
+ type: "linear",
163
+ degrees: 180,
164
+ points: [
165
+ { percent: 0, color: "#ff000080" },
166
+ { percent: 100, color: "#ff00ff00" },
167
+ ],
168
+ },
169
+ },
170
+ border: {
171
+ width: 3,
172
+ color: {
173
+ light: { type: "hex", value: "#00ff0080" },
174
+ },
175
+ },
176
+ shadow: {
177
+ x: 0,
178
+ y: 0,
179
+ radius: 16,
180
+ color: {
181
+ light: { type: "hex", value: "#0000ff80" },
298
182
  },
299
183
  },
300
184
  }}