@developer_tribe/react-builder 1.0.8 → 1.0.9
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/build-components/BIcon/BIconProps.generated.d.ts +3 -0
- package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +1 -0
- package/dist/build-components/Button/ButtonProps.generated.d.ts +1 -0
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +5 -0
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +1 -0
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +1 -0
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +1 -0
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +1 -0
- package/dist/build-components/Image/ImageProps.generated.d.ts +1 -0
- package/dist/build-components/Main/MainProps.generated.d.ts +1 -1
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +3 -0
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +1 -0
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +3 -0
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +3 -0
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +3 -0
- package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +3 -1
- package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallProvider/PaywallContext.d.ts +12 -0
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.d.ts +1 -0
- package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Text/TextProps.generated.d.ts +3 -0
- package/dist/build-components/View/ViewProps.generated.d.ts +1 -0
- package/dist/build-components/patterns.generated.d.ts +372 -374
- package/dist/components/BuilderProvider.d.ts +2 -0
- package/dist/components/ParamsProvider.d.ts +5 -0
- package/dist/components/RenderErrorBoundary.d.ts +28 -0
- package/dist/hooks/useSyncHtmlThemeClass.d.ts +7 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.cjs.js +4 -4
- package/dist/index.native.cjs.js.map +1 -1
- package/dist/index.native.d.ts +1 -0
- package/dist/index.native.esm.js +4 -4
- package/dist/index.native.esm.js.map +1 -1
- package/dist/migrations/migratePipe.d.ts +14 -0
- package/dist/migrations/migrations/1.1.0_normalize_style_attributes.d.ts +2 -0
- package/dist/migrations/semver.d.ts +8 -0
- package/dist/migrations/types.d.ts +8 -0
- package/dist/mockOS/components/SubscriptionModal.d.ts +7 -0
- package/dist/mockOS/context/MockOSContextBase.d.ts +1 -0
- package/dist/mockOS/hooks/useMockIap.d.ts +3 -0
- package/dist/mockOS/index.d.ts +4 -0
- package/dist/mockOS/managers/mockOSIapManager.d.ts +6 -0
- package/dist/mockOS/managers/subscriptionManager.d.ts +10 -0
- package/dist/pages/ProjectDebug.d.ts +14 -0
- package/dist/pages/ProjectMigrationPage.d.ts +23 -0
- package/dist/pages/ProjectValidationPage.d.ts +15 -0
- package/dist/styles.css +1 -1
- package/dist/types/Device.d.ts +5 -0
- package/dist/utils/__special_exceptions.d.ts +7 -0
- package/dist/utils/getImage.d.ts +23 -0
- package/dist/utils/pasteNode.d.ts +15 -0
- package/dist/utils/patterns.d.ts +1 -2
- package/package.json +6 -2
- package/scripts/migrate-patterns-to-v2.mjs +131 -0
- package/scripts/migrate-samples-to-current.ts +79 -0
- package/scripts/prebuild/utils/createGeneratedProps.js +4 -5
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +32 -21
- package/scripts/prebuild/utils/validatePatternJson.js +12 -10
- package/src/.DS_Store +0 -0
- package/src/AttributesEditor.tsx +41 -11
- package/src/RenderPage.tsx +55 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/devices.json +91 -0
- package/src/assets/samples/carousel-sample.json +141 -29
- package/src/assets/samples/getSamples.ts +9 -0
- package/src/assets/samples/paywall-1.json +119 -71
- package/src/assets/samples/simple-1.json +28 -16
- package/src/assets/samples/simple-2.json +157 -82
- package/src/assets/samples/unmigrated-builder1.json +42 -0
- package/src/assets/samples/unvalidated-builder1.json +49 -0
- package/src/assets/samples/unvalidated-crash1.json +19 -0
- package/src/assets/samples/unvalidated-crashcomponent1.json +16 -0
- package/src/assets/samples/vpn-onboard-1.json +91 -51
- package/src/assets/samples/vpn-onboard-2.json +318 -278
- package/src/assets/samples/vpn-onboard-3.json +286 -252
- package/src/assets/samples/vpn-onboard-4.json +286 -252
- package/src/assets/samples/vpn-onboard-5.json +434 -374
- package/src/assets/samples/vpn-onboard-6.json +290 -250
- package/src/attributes-editor/Field.tsx +1 -1
- package/src/attributes-editor/LayoutPreviewPicker.tsx +5 -2
- package/src/build-components/BIcon/BIconProps.generated.ts +3 -0
- package/src/build-components/BIcon/pattern.json +12 -9
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +3 -1
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +1 -0
- package/src/build-components/BackgroundImage/pattern.json +25 -16
- package/src/build-components/Button/Button.tsx +26 -3
- package/src/build-components/Button/ButtonProps.generated.ts +1 -0
- package/src/build-components/Button/pattern.json +10 -6
- package/src/build-components/Carousel/CarouselProps.generated.ts +5 -0
- package/src/build-components/Carousel/pattern.json +19 -8
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +1 -0
- package/src/build-components/CarouselButtons/pattern.json +11 -5
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +1 -0
- package/src/build-components/CarouselDots/pattern.json +5 -4
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +1 -0
- package/src/build-components/CarouselItem/pattern.json +5 -4
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +44 -2
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +1 -0
- package/src/build-components/Image/Image.tsx +2 -1
- package/src/build-components/Image/ImageProps.generated.ts +1 -0
- package/src/build-components/Image/pattern.json +11 -5
- package/src/build-components/Main/MainProps.generated.ts +1 -1
- package/src/build-components/Main/pattern.json +12 -9
- package/src/build-components/Onboard/OnboardProps.generated.ts +1 -0
- package/src/build-components/Onboard/pattern.json +14 -9
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +1 -0
- package/src/build-components/OnboardButton/pattern.json +5 -4
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +1 -0
- package/src/build-components/OnboardButtons/pattern.json +5 -4
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +1 -0
- package/src/build-components/OnboardDot/pattern.json +5 -4
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +3 -0
- package/src/build-components/OnboardFooter/pattern.json +8 -5
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +1 -0
- package/src/build-components/OnboardImage/pattern.json +7 -4
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +1 -0
- package/src/build-components/OnboardItem/pattern.json +18 -9
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +3 -0
- package/src/build-components/OnboardProvider/pattern.json +21 -6
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +3 -0
- package/src/build-components/OnboardSubtitle/pattern.json +10 -6
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +3 -0
- package/src/build-components/OnboardTitle/pattern.json +11 -7
- package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +1 -1
- package/src/build-components/PaywallBackground/pattern.json +5 -4
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +6 -1
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +3 -1
- package/src/build-components/PaywallCloseButton/pattern.json +15 -12
- package/src/build-components/PaywallOptions/PaywallOptionButton.tsx +0 -1
- package/src/build-components/PaywallOptions/PaywallOptions.tsx +3 -2
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +1 -1
- package/src/build-components/PaywallOptions/pattern.json +14 -11
- package/src/build-components/PaywallProvider/PaywallContext.ts +25 -0
- package/src/build-components/PaywallProvider/PaywallProvider.tsx +102 -5
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +1 -1
- package/src/build-components/PaywallProvider/pattern.json +11 -8
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButton.tsx +7 -0
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +1 -0
- package/src/build-components/PaywallSubscribeButton/pattern.json +16 -13
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +1 -1
- package/src/build-components/RadioButton/pattern.json +5 -4
- package/src/build-components/Text/Text.tsx +107 -4
- package/src/build-components/Text/TextProps.generated.ts +3 -0
- package/src/build-components/Text/pattern.json +19 -4
- package/src/build-components/View/ViewProps.generated.ts +1 -0
- package/src/build-components/View/pattern.json +28 -13
- package/src/build-components/other.tsx +15 -0
- package/src/build-components/patterns.generated.ts +340 -235
- package/src/build-components/useNode.ts +22 -3
- package/src/components/Builder.tsx +20 -6
- package/src/components/BuilderButton.tsx +75 -38
- package/src/components/BuilderProvider.tsx +22 -2
- package/src/components/DeviceButton.tsx +12 -5
- package/src/components/EditorHeader.tsx +296 -38
- package/src/components/ParamsProvider.tsx +7 -0
- package/src/components/RenderErrorBoundary.tsx +200 -0
- package/src/hooks/useParams.ts +5 -1
- package/src/hooks/useSyncHtmlThemeClass.ts +19 -0
- package/src/index.native.ts +7 -0
- package/src/index.ts +8 -0
- package/src/migrations/migratePipe.ts +59 -0
- package/src/migrations/migrations/1.1.0_normalize_style_attributes.ts +80 -0
- package/src/migrations/semver.ts +24 -0
- package/src/migrations/types.ts +9 -0
- package/src/mockOS/components/PermissionModal.tsx +3 -2
- package/src/mockOS/components/SubscriptionModal.tsx +400 -0
- package/src/mockOS/context/MockOSContext.tsx +61 -10
- package/src/mockOS/context/MockOSContextBase.ts +1 -0
- package/src/mockOS/hooks/useMockIap.ts +11 -0
- package/src/mockOS/index.ts +7 -0
- package/src/mockOS/managers/mockOSIapManager.ts +10 -0
- package/src/mockOS/managers/subscriptionManager.ts +36 -0
- package/src/modals/IconPickerModal.tsx +1 -1
- package/src/pages/ProjectDebug.tsx +331 -0
- package/src/pages/ProjectMigrationPage.tsx +92 -0
- package/src/pages/ProjectPage.tsx +313 -161
- package/src/pages/ProjectValidationPage.tsx +54 -0
- package/src/styles/base/_global.scss +58 -11
- package/src/styles/components/_attributes-editor.scss +1 -1
- package/src/styles/components/_bottom-bar.scss +7 -4
- package/src/styles/components/_editor-shell.scss +126 -4
- package/src/styles/components/_mockos-router.scss +3 -2
- package/src/styles/components/_ui-components.scss +10 -5
- package/src/styles/foundation/_colors.scss +78 -11
- package/src/styles/foundation/_mixins.scss +4 -1
- package/src/styles/foundation/_sizes.scss +4 -2
- package/src/styles/index.scss +1 -0
- package/src/styles/layout/_builder.scss +61 -0
- package/src/styles/layout/_project-validation.scss +214 -0
- package/src/styles/modals/_add-component.scss +4 -2
- package/src/styles/modals/_color-modal.scss +4 -2
- package/src/styles/modals/_modal-shell.scss +3 -1
- package/src/types/Device.ts +5 -0
- package/src/utils/__special_exceptions.ts +88 -0
- package/src/utils/analyseNode.ts +8 -2
- package/src/utils/analyseNodeByPatterns.ts +43 -9
- package/src/utils/extractTextStyle.ts +19 -6
- package/src/utils/extractViewStyle.ts +68 -59
- package/src/utils/getImage.ts +76 -0
- package/src/utils/novaToJson.ts +2 -1
- package/src/utils/pasteNode.ts +172 -0
- package/src/utils/patterns.ts +4 -3
- package/dist/android.svg +0 -43
- package/dist/apple.svg +0 -16
- package/dist/background.jpg +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardButton",
|
|
6
5
|
"children": "never",
|
|
@@ -39,10 +38,12 @@
|
|
|
39
38
|
}
|
|
40
39
|
},
|
|
41
40
|
"meta": {
|
|
42
|
-
"desiredParent": [
|
|
41
|
+
"desiredParent": [
|
|
42
|
+
"=OnboardButtons"
|
|
43
|
+
],
|
|
43
44
|
"label": "Onboard Button",
|
|
44
45
|
"description": "Single action button for onboarding.",
|
|
45
|
-
"
|
|
46
|
+
"styles": {
|
|
46
47
|
"labelKey": {
|
|
47
48
|
"label": "Label Key",
|
|
48
49
|
"description": "Localization key for the button text.",
|
|
@@ -27,6 +27,7 @@ export type ConditionOptionType = 'carousel-index';
|
|
|
27
27
|
export interface OnboardButtonsPropsGenerated {
|
|
28
28
|
child: string;
|
|
29
29
|
attributes: {
|
|
30
|
+
style?: Record<string, unknown>;
|
|
30
31
|
scrollable?: boolean;
|
|
31
32
|
flexDirection?: FlexDirectionOptionType;
|
|
32
33
|
alignItems?: AlignItemsOptionType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardButtons",
|
|
6
5
|
"children": "node",
|
|
@@ -25,10 +24,12 @@
|
|
|
25
24
|
}
|
|
26
25
|
},
|
|
27
26
|
"meta": {
|
|
28
|
-
"desiredParent": [
|
|
27
|
+
"desiredParent": [
|
|
28
|
+
"=OnboardItem"
|
|
29
|
+
],
|
|
29
30
|
"label": "Onboard Buttons",
|
|
30
31
|
"description": "Wrapper for onboarding button set.",
|
|
31
|
-
"
|
|
32
|
+
"styles": {
|
|
32
33
|
"buttonType": {
|
|
33
34
|
"label": "Button Type",
|
|
34
35
|
"description": "Which onboard button to show.",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardDot",
|
|
6
5
|
"children": "never",
|
|
@@ -23,10 +22,12 @@
|
|
|
23
22
|
}
|
|
24
23
|
},
|
|
25
24
|
"meta": {
|
|
26
|
-
"desiredParent": [
|
|
25
|
+
"desiredParent": [
|
|
26
|
+
">OnboardProvider"
|
|
27
|
+
],
|
|
27
28
|
"label": "Onboard Dot",
|
|
28
29
|
"description": "Renders onboarding progress dots.",
|
|
29
|
-
"
|
|
30
|
+
"styles": {
|
|
30
31
|
"dotType": {
|
|
31
32
|
"label": "Dot Type",
|
|
32
33
|
"description": "Dot animation style.",
|
|
@@ -34,10 +34,13 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
34
34
|
export interface OnboardFooterPropsGenerated {
|
|
35
35
|
child: string;
|
|
36
36
|
attributes: {
|
|
37
|
+
style?: Record<string, unknown>;
|
|
37
38
|
color?: string;
|
|
38
39
|
fontSize?: string;
|
|
39
40
|
fontWeight?: FontWeightOptionType;
|
|
40
41
|
textAlign?: TextAlignOptionType;
|
|
42
|
+
adjustsFontSizeToFit?: boolean;
|
|
43
|
+
showEllipsis?: boolean;
|
|
41
44
|
scrollable?: boolean;
|
|
42
45
|
flexDirection?: FlexDirectionOptionType;
|
|
43
46
|
alignItems?: AlignItemsOptionType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardFooter",
|
|
6
5
|
"children": "node",
|
|
@@ -16,13 +15,17 @@
|
|
|
16
15
|
}
|
|
17
16
|
},
|
|
18
17
|
"defaults": {
|
|
19
|
-
"
|
|
18
|
+
"style": {
|
|
19
|
+
"paddingHorizontal": "24@s"
|
|
20
|
+
}
|
|
20
21
|
},
|
|
21
22
|
"meta": {
|
|
22
|
-
"desiredParent": [
|
|
23
|
+
"desiredParent": [
|
|
24
|
+
">OnboardItem"
|
|
25
|
+
],
|
|
23
26
|
"label": "Onboard Footer",
|
|
24
27
|
"description": "Footer text with optional links.",
|
|
25
|
-
"
|
|
28
|
+
"styles": {
|
|
26
29
|
"textLocalizationKey": {
|
|
27
30
|
"label": "Text Localization Key",
|
|
28
31
|
"description": "Localization key for the footer text.",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardImage",
|
|
6
5
|
"children": "node",
|
|
@@ -11,10 +10,14 @@
|
|
|
11
10
|
}
|
|
12
11
|
},
|
|
13
12
|
"meta": {
|
|
14
|
-
"desiredParent": [
|
|
13
|
+
"desiredParent": [
|
|
14
|
+
">OnboardProvider",
|
|
15
|
+
">OnboardItem",
|
|
16
|
+
"!=Onboard"
|
|
17
|
+
],
|
|
15
18
|
"label": "Onboard Image",
|
|
16
19
|
"description": "Onboarding hero image with media.",
|
|
17
|
-
"
|
|
20
|
+
"styles": {
|
|
18
21
|
"video_url": {
|
|
19
22
|
"label": "Video Url",
|
|
20
23
|
"description": "URL for the onboarding video.",
|
|
@@ -22,6 +22,7 @@ export type DisplayOptionType = 'flex' | 'block';
|
|
|
22
22
|
export interface OnboardItemPropsGenerated {
|
|
23
23
|
child: string;
|
|
24
24
|
attributes: {
|
|
25
|
+
style?: Record<string, unknown>;
|
|
25
26
|
scrollable?: boolean;
|
|
26
27
|
flexDirection?: FlexDirectionOptionType;
|
|
27
28
|
alignItems?: AlignItemsOptionType;
|
|
@@ -1,28 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardItem",
|
|
6
5
|
"children": "node",
|
|
7
6
|
"extends": "View",
|
|
8
7
|
"attributes": {
|
|
9
|
-
"display": [
|
|
8
|
+
"display": [
|
|
9
|
+
"flex",
|
|
10
|
+
"block"
|
|
11
|
+
],
|
|
10
12
|
"gap": "size",
|
|
11
|
-
"flexDirection": [
|
|
13
|
+
"flexDirection": [
|
|
14
|
+
"row",
|
|
15
|
+
"column"
|
|
16
|
+
],
|
|
12
17
|
"paddingHorizontal": "size"
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
"defaults": {
|
|
16
|
-
"gap": "16@vs",
|
|
17
21
|
"display": "flex",
|
|
18
|
-
"
|
|
19
|
-
|
|
22
|
+
"style": {
|
|
23
|
+
"gap": "16@vs",
|
|
24
|
+
"flexDirection": "column",
|
|
25
|
+
"paddingHorizontal": "24@s"
|
|
26
|
+
}
|
|
20
27
|
},
|
|
21
28
|
"meta": {
|
|
22
|
-
"desiredParent": [
|
|
29
|
+
"desiredParent": [
|
|
30
|
+
"=Onboard"
|
|
31
|
+
],
|
|
23
32
|
"label": "Onboard Item",
|
|
24
33
|
"description": "Single onboarding screen section.",
|
|
25
|
-
"
|
|
34
|
+
"styles": {
|
|
26
35
|
"display": {
|
|
27
36
|
"label": "Display",
|
|
28
37
|
"description": "Controls layout display mode.",
|
|
@@ -17,10 +17,12 @@ export type JustifyContentOptionType =
|
|
|
17
17
|
| 'space-around'
|
|
18
18
|
| 'space-evenly';
|
|
19
19
|
export type PositionOptionType = 'relative' | 'absolute';
|
|
20
|
+
export type ThemeOptionType = 'light' | 'dark' | 'all';
|
|
20
21
|
|
|
21
22
|
export interface OnboardProviderPropsGenerated {
|
|
22
23
|
child: string;
|
|
23
24
|
attributes: {
|
|
25
|
+
style?: Record<string, unknown>;
|
|
24
26
|
scrollable?: boolean;
|
|
25
27
|
flexDirection?: FlexDirectionOptionType;
|
|
26
28
|
alignItems?: AlignItemsOptionType;
|
|
@@ -54,6 +56,7 @@ export interface OnboardProviderPropsGenerated {
|
|
|
54
56
|
left?: string;
|
|
55
57
|
right?: string;
|
|
56
58
|
zIndex?: number;
|
|
59
|
+
theme?: ThemeOptionType;
|
|
57
60
|
};
|
|
58
61
|
}
|
|
59
62
|
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardProvider",
|
|
6
5
|
"children": "node",
|
|
7
6
|
"extends": "View",
|
|
8
7
|
"attributes": {
|
|
8
|
+
"theme": [
|
|
9
|
+
"light",
|
|
10
|
+
"dark",
|
|
11
|
+
"all"
|
|
12
|
+
],
|
|
9
13
|
"borderRadius": "never"
|
|
10
14
|
}
|
|
11
15
|
},
|
|
12
16
|
"defaults": {
|
|
13
|
-
"
|
|
14
|
-
|
|
17
|
+
"style": {
|
|
18
|
+
"width": "100%",
|
|
19
|
+
"height": "100%"
|
|
20
|
+
}
|
|
15
21
|
},
|
|
16
22
|
"meta": {
|
|
17
|
-
"desiredParent": [
|
|
23
|
+
"desiredParent": [
|
|
24
|
+
"root"
|
|
25
|
+
],
|
|
18
26
|
"label": "Onboard Provider",
|
|
19
27
|
"description": "Provides shared settings for onboarding.",
|
|
20
|
-
"
|
|
28
|
+
"styles": {
|
|
29
|
+
"theme": {
|
|
30
|
+
"label": "Theme",
|
|
31
|
+
"description": "Controls which app theme(s) this onboarding is intended for.",
|
|
32
|
+
"category": "other",
|
|
33
|
+
"specialCategory": null,
|
|
34
|
+
"sort": -10
|
|
35
|
+
},
|
|
21
36
|
"paddingTop": {
|
|
22
37
|
"label": "Padding Top",
|
|
23
38
|
"description": "Top padding for the provider.",
|
|
@@ -34,10 +34,13 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
34
34
|
export interface OnboardSubtitlePropsGenerated {
|
|
35
35
|
child: string;
|
|
36
36
|
attributes: {
|
|
37
|
+
style?: Record<string, unknown>;
|
|
37
38
|
color?: string;
|
|
38
39
|
fontSize?: string;
|
|
39
40
|
fontWeight?: FontWeightOptionType;
|
|
40
41
|
textAlign?: TextAlignOptionType;
|
|
42
|
+
adjustsFontSizeToFit?: boolean;
|
|
43
|
+
showEllipsis?: boolean;
|
|
41
44
|
scrollable?: boolean;
|
|
42
45
|
flexDirection?: FlexDirectionOptionType;
|
|
43
46
|
alignItems?: AlignItemsOptionType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardSubtitle",
|
|
6
5
|
"children": "string",
|
|
@@ -8,13 +7,18 @@
|
|
|
8
7
|
"attributes": {}
|
|
9
8
|
},
|
|
10
9
|
"defaults": {
|
|
11
|
-
"
|
|
12
|
-
|
|
10
|
+
"style": {
|
|
11
|
+
"fontSize": "14@fs",
|
|
12
|
+
"fontWeight": "600"
|
|
13
|
+
}
|
|
13
14
|
},
|
|
14
15
|
"meta": {
|
|
15
|
-
"desiredParent": [
|
|
16
|
+
"desiredParent": [
|
|
17
|
+
">OnboardProvider",
|
|
18
|
+
">OnboardItem"
|
|
19
|
+
],
|
|
16
20
|
"label": "Onboard Subtitle",
|
|
17
21
|
"description": "Subtitle text for an onboarding step.",
|
|
18
|
-
"
|
|
22
|
+
"styles": {}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -34,10 +34,13 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
34
34
|
export interface OnboardTitlePropsGenerated {
|
|
35
35
|
child: string;
|
|
36
36
|
attributes: {
|
|
37
|
+
style?: Record<string, unknown>;
|
|
37
38
|
color?: string;
|
|
38
39
|
fontSize?: string;
|
|
39
40
|
fontWeight?: FontWeightOptionType;
|
|
40
41
|
textAlign?: TextAlignOptionType;
|
|
42
|
+
adjustsFontSizeToFit?: boolean;
|
|
43
|
+
showEllipsis?: boolean;
|
|
41
44
|
scrollable?: boolean;
|
|
42
45
|
flexDirection?: FlexDirectionOptionType;
|
|
43
46
|
alignItems?: AlignItemsOptionType;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": false,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "OnboardTitle",
|
|
6
5
|
"children": "string",
|
|
@@ -8,14 +7,19 @@
|
|
|
8
7
|
"attributes": {}
|
|
9
8
|
},
|
|
10
9
|
"defaults": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
"style": {
|
|
11
|
+
"fontSize": "24@fs",
|
|
12
|
+
"fontWeight": "700",
|
|
13
|
+
"textAlign": "center"
|
|
14
|
+
}
|
|
14
15
|
},
|
|
15
16
|
"meta": {
|
|
16
|
-
"desiredParent": [
|
|
17
|
+
"desiredParent": [
|
|
18
|
+
">OnboardItem",
|
|
19
|
+
">OnboardProvider"
|
|
20
|
+
],
|
|
17
21
|
"label": "Onboard Title",
|
|
18
22
|
"description": "Title text for an onboarding step.",
|
|
19
|
-
"
|
|
23
|
+
"styles": {}
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -21,6 +21,7 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
21
21
|
export interface PaywallBackgroundPropsGenerated {
|
|
22
22
|
child: string;
|
|
23
23
|
attributes: {
|
|
24
|
+
style?: Record<string, unknown>;
|
|
24
25
|
scrollable?: boolean;
|
|
25
26
|
flexDirection?: FlexDirectionOptionType;
|
|
26
27
|
alignItems?: AlignItemsOptionType;
|
|
@@ -54,7 +55,6 @@ export interface PaywallBackgroundPropsGenerated {
|
|
|
54
55
|
left?: string;
|
|
55
56
|
right?: string;
|
|
56
57
|
zIndex?: number;
|
|
57
|
-
[key: string]: string | number | boolean | undefined;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": true,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "PaywallBackground",
|
|
6
5
|
"children": "never",
|
|
@@ -8,9 +7,11 @@
|
|
|
8
7
|
"attributes": {}
|
|
9
8
|
},
|
|
10
9
|
"meta": {
|
|
11
|
-
"desiredParent": [
|
|
10
|
+
"desiredParent": [
|
|
11
|
+
">PaywallProvider"
|
|
12
|
+
],
|
|
12
13
|
"label": "Paywall Background",
|
|
13
14
|
"description": "Paywall Background component.",
|
|
14
|
-
"
|
|
15
|
+
"styles": {}
|
|
15
16
|
}
|
|
16
17
|
}
|
|
@@ -8,10 +8,12 @@ import { isNodeSelected, SELECTED_OUTLINE_STYLE } from '../../utils/selection';
|
|
|
8
8
|
import { useMergedStyle } from '../../utils/useMergedStyle';
|
|
9
9
|
import { Icon } from '../../components/Icon.generated';
|
|
10
10
|
import { IconsType } from '../../types/Icons';
|
|
11
|
+
import { usePaywallContext } from '../PaywallProvider/PaywallContext';
|
|
11
12
|
|
|
12
13
|
function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
|
|
13
14
|
useLogRender('PaywallCloseButton');
|
|
14
15
|
node = useNode(node);
|
|
16
|
+
const { onClose } = usePaywallContext();
|
|
15
17
|
|
|
16
18
|
const generatedId = useId();
|
|
17
19
|
const attributeName =
|
|
@@ -50,7 +52,10 @@ function PaywallCloseButton({ node }: PaywallCloseButtonComponentProps) {
|
|
|
50
52
|
attribute-name={attributeName}
|
|
51
53
|
attribute-key={attributeKey}
|
|
52
54
|
href="#"
|
|
53
|
-
onClick={(e) =>
|
|
55
|
+
onClick={(e) => {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
onClose?.();
|
|
58
|
+
}}
|
|
54
59
|
aria-label="Close"
|
|
55
60
|
style={{ ...style, cursor: 'pointer', textDecoration: 'none' }}
|
|
56
61
|
>
|
|
@@ -34,6 +34,7 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
34
34
|
export interface PaywallCloseButtonPropsGenerated {
|
|
35
35
|
child: string;
|
|
36
36
|
attributes: {
|
|
37
|
+
style?: Record<string, unknown>;
|
|
37
38
|
iconType?: string;
|
|
38
39
|
size?: number;
|
|
39
40
|
strokeWidth?: number;
|
|
@@ -41,6 +42,8 @@ export interface PaywallCloseButtonPropsGenerated {
|
|
|
41
42
|
fontSize?: string;
|
|
42
43
|
fontWeight?: FontWeightOptionType;
|
|
43
44
|
textAlign?: TextAlignOptionType;
|
|
45
|
+
adjustsFontSizeToFit?: boolean;
|
|
46
|
+
showEllipsis?: boolean;
|
|
44
47
|
scrollable?: boolean;
|
|
45
48
|
flexDirection?: FlexDirectionOptionType;
|
|
46
49
|
alignItems?: AlignItemsOptionType;
|
|
@@ -74,7 +77,6 @@ export interface PaywallCloseButtonPropsGenerated {
|
|
|
74
77
|
left?: string;
|
|
75
78
|
right?: string;
|
|
76
79
|
zIndex?: number;
|
|
77
|
-
[key: string]: string | number | boolean | undefined;
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": true,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "PaywallCloseButton",
|
|
6
5
|
"children": "never",
|
|
7
6
|
"extends": "BIcon",
|
|
8
|
-
"attributes": {}
|
|
9
|
-
"defaults": {
|
|
10
|
-
"iconType": "close",
|
|
11
|
-
"size": 24,
|
|
12
|
-
"flexDirection": "row",
|
|
13
|
-
"justifyContent": "center",
|
|
14
|
-
"alignItems": "center"
|
|
15
|
-
}
|
|
7
|
+
"attributes": {}
|
|
16
8
|
},
|
|
17
9
|
"meta": {
|
|
18
|
-
"desiredParent": [
|
|
10
|
+
"desiredParent": [
|
|
11
|
+
">PaywallProvider"
|
|
12
|
+
],
|
|
19
13
|
"label": "Paywall Close Button",
|
|
20
14
|
"description": "Paywall Close Button component.",
|
|
21
|
-
"
|
|
15
|
+
"styles": {}
|
|
16
|
+
},
|
|
17
|
+
"defaults": {
|
|
18
|
+
"iconType": "close",
|
|
19
|
+
"size": 24,
|
|
20
|
+
"style": {
|
|
21
|
+
"flexDirection": "row",
|
|
22
|
+
"justifyContent": "center",
|
|
23
|
+
"alignItems": "center"
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -36,7 +36,6 @@ export function PaywallOptionButton({
|
|
|
36
36
|
() => extractViewStyle(node, { appConfig, projectColors }),
|
|
37
37
|
[node, appConfig, projectColors],
|
|
38
38
|
);
|
|
39
|
-
console.log('-->', { node, baseStyle });
|
|
40
39
|
|
|
41
40
|
const isSelected = isNodeSelected({ previewMode, current, node });
|
|
42
41
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useId, useMemo
|
|
1
|
+
import React, { useId, useMemo } from 'react';
|
|
2
2
|
import type { PaywallOptionsComponentProps } from './PaywallOptionsProps.generated';
|
|
3
3
|
import useNode from '../useNode';
|
|
4
4
|
import { useLogRender } from '../../utils/useLogRender';
|
|
@@ -7,6 +7,7 @@ import { ParamsProvider } from '../../components/ParamsProvider';
|
|
|
7
7
|
import type { Product } from '../../paywall/types/paywall-types';
|
|
8
8
|
import { PaywallOptionButton } from './PaywallOptionButton';
|
|
9
9
|
import { usePaywallOptionParamsFactory } from './usePaywallOptionParamsFactory';
|
|
10
|
+
import { usePaywallContext } from '../PaywallProvider/PaywallContext';
|
|
10
11
|
|
|
11
12
|
function parseNumberLike(value: unknown): number | undefined {
|
|
12
13
|
if (value === null || value === undefined) return undefined;
|
|
@@ -51,7 +52,7 @@ function PaywallOptions({ node }: PaywallOptionsComponentProps) {
|
|
|
51
52
|
useLogRender('PaywallOptions');
|
|
52
53
|
node = useNode(node);
|
|
53
54
|
const { products } = useBuilderParams();
|
|
54
|
-
const
|
|
55
|
+
const { selectedProductId, setSelectedProductId } = usePaywallContext();
|
|
55
56
|
const getParamsForProduct = usePaywallOptionParamsFactory();
|
|
56
57
|
|
|
57
58
|
const sortedProducts = useMemo(() => {
|
|
@@ -21,6 +21,7 @@ export type PositionOptionType = 'relative' | 'absolute';
|
|
|
21
21
|
export interface PaywallOptionsPropsGenerated {
|
|
22
22
|
child: string;
|
|
23
23
|
attributes: {
|
|
24
|
+
style?: Record<string, unknown>;
|
|
24
25
|
scrollable?: boolean;
|
|
25
26
|
flexDirection?: FlexDirectionOptionType;
|
|
26
27
|
alignItems?: AlignItemsOptionType;
|
|
@@ -54,7 +55,6 @@ export interface PaywallOptionsPropsGenerated {
|
|
|
54
55
|
left?: string;
|
|
55
56
|
right?: string;
|
|
56
57
|
zIndex?: number;
|
|
57
|
-
[key: string]: string | number | boolean | undefined;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
3
|
-
"allowUnknownAttributes": true,
|
|
2
|
+
"schemaVersion": 2,
|
|
4
3
|
"pattern": {
|
|
5
4
|
"type": "PaywallOptions",
|
|
6
5
|
"extends": "View",
|
|
7
|
-
"children":
|
|
8
|
-
"attributes": {}
|
|
9
|
-
|
|
6
|
+
"children": "node",
|
|
7
|
+
"attributes": {}
|
|
8
|
+
},
|
|
9
|
+
"meta": {
|
|
10
|
+
"desiredParent": [
|
|
11
|
+
">PaywallProvider"
|
|
12
|
+
],
|
|
13
|
+
"label": "Paywall Options",
|
|
14
|
+
"description": "Paywall options selector component.",
|
|
15
|
+
"styles": {}
|
|
16
|
+
},
|
|
17
|
+
"defaults": {
|
|
18
|
+
"style": {
|
|
10
19
|
"flexDirection": "row",
|
|
11
20
|
"justifyContent": "space-between",
|
|
12
21
|
"alignItems": "center",
|
|
13
22
|
"minHeight": "60px"
|
|
14
23
|
}
|
|
15
|
-
},
|
|
16
|
-
"meta": {
|
|
17
|
-
"desiredParent": [">PaywallProvider"],
|
|
18
|
-
"label": "Paywall Options",
|
|
19
|
-
"description": "Paywall options selector component.",
|
|
20
|
-
"attributes": {}
|
|
21
24
|
}
|
|
22
25
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import type { Product } from '../../paywall/types/paywall-types';
|
|
3
|
+
|
|
4
|
+
export type PaywallContextValue = {
|
|
5
|
+
products: Product[];
|
|
6
|
+
selectedProductId: string;
|
|
7
|
+
setSelectedProductId: (productId: string) => void;
|
|
8
|
+
selectedProduct?: Product;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
onSubscribe?: (product?: Product) => void | boolean | Promise<boolean>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const PaywallContext = createContext<PaywallContextValue | undefined>(
|
|
14
|
+
undefined,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export function usePaywallContext(): PaywallContextValue {
|
|
18
|
+
return (
|
|
19
|
+
useContext(PaywallContext) ?? {
|
|
20
|
+
products: [],
|
|
21
|
+
selectedProductId: '',
|
|
22
|
+
setSelectedProductId: () => {},
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|