@developer_tribe/react-builder 1.2.31 → 1.2.32
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 +1 -1
- package/dist/build-components/BackgroundImage/BackgroundImageProps.generated.d.ts +1 -1
- package/dist/build-components/Button/ButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +1 -1
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +1 -1
- package/dist/build-components/CountDown/CountDownProps.generated.d.ts +1 -1
- package/dist/build-components/Image/ImageProps.generated.d.ts +1 -1
- package/dist/build-components/Main/MainProps.generated.d.ts +1 -1
- package/dist/build-components/NavigationBarColor/NavigationBarColorProps.generated.d.ts +1 -1
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +2 -2
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +1 -1
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallBackground/PaywallBackgroundProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallOptions/PaywallOptionsProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +1 -1
- package/dist/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.d.ts +1 -1
- package/dist/build-components/PriceTag/PriceTagProps.generated.d.ts +1 -1
- package/dist/build-components/Pricing/PricingProps.generated.d.ts +1 -1
- package/dist/build-components/Promo/PromoProps.generated.d.ts +1 -1
- package/dist/build-components/RadioButton/RadioButtonProps.generated.d.ts +1 -1
- package/dist/build-components/Separator/SeparatorProps.generated.d.ts +1 -1
- package/dist/build-components/StatusBarColor/StatusBarColorProps.generated.d.ts +1 -1
- package/dist/build-components/Text/TextProps.generated.d.ts +1 -1
- package/dist/build-components/View/ViewProps.generated.d.ts +1 -1
- package/dist/build-components/patterns.generated.d.ts +62 -52
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.web.cjs.js +3 -3
- package/dist/index.web.cjs.js.map +1 -1
- package/dist/index.web.esm.js +3 -3
- package/dist/index.web.esm.js.map +1 -1
- package/dist/utils/attributeStyle.d.ts +2 -2
- package/dist/utils/patterns.d.ts +2 -2
- package/package.json +1 -1
- package/scripts/prebuild/utils/createGeneratedProps.js +9 -9
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +9 -9
- package/src/RenderPage.tsx +42 -1
- package/src/assets/meta.json +1 -1
- package/src/assets/samples/vpn-onboard-1.json +0 -24
- package/src/build-components/BIcon/BIconProps.generated.ts +1 -1
- package/src/build-components/BIcon/pattern.json +4 -2
- package/src/build-components/BackgroundImage/BackgroundImage.tsx +1 -1
- package/src/build-components/BackgroundImage/BackgroundImageProps.generated.ts +1 -1
- package/src/build-components/BackgroundImage/pattern.json +11 -3
- package/src/build-components/Button/Button.tsx +2 -2
- package/src/build-components/Button/ButtonProps.generated.ts +1 -1
- package/src/build-components/Button/pattern.json +5 -3
- package/src/build-components/Carousel/CarouselProps.generated.ts +1 -1
- package/src/build-components/Carousel/pattern.json +9 -3
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +1 -1
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +1 -1
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +1 -1
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +1 -1
- package/src/build-components/CarouselProvider/pattern.json +5 -2
- package/src/build-components/CountDown/CountDownProps.generated.ts +1 -1
- package/src/build-components/CountDown/pattern.json +4 -2
- package/src/build-components/Image/ImageProps.generated.ts +1 -1
- package/src/build-components/Image/pattern.json +11 -4
- package/src/build-components/Main/MainProps.generated.ts +1 -1
- package/src/build-components/Main/pattern.json +4 -2
- package/src/build-components/NavigationBarColor/NavigationBarColorProps.generated.ts +1 -1
- package/src/build-components/NavigationBarColor/pattern.json +5 -3
- package/src/build-components/Onboard/OnboardProps.generated.ts +1 -1
- package/src/build-components/Onboard/pattern.json +7 -3
- package/src/build-components/OnboardButton/OnboardButton.tsx +2 -23
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +2 -2
- package/src/build-components/OnboardButton/pattern.json +44 -30
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +1 -1
- package/src/build-components/OnboardButtons/pattern.json +16 -5
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +1 -1
- package/src/build-components/OnboardDot/pattern.json +4 -2
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +1 -1
- package/src/build-components/OnboardFooter/pattern.json +4 -2
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +1 -1
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +1 -1
- package/src/build-components/OnboardItem/pattern.json +12 -4
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +1 -1
- package/src/build-components/OnboardProvider/pattern.json +9 -3
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +1 -1
- package/src/build-components/OnboardSubtitle/pattern.json +5 -2
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +1 -1
- package/src/build-components/OnboardTitle/pattern.json +5 -2
- package/src/build-components/PaywallBackground/PaywallBackgroundProps.generated.ts +1 -1
- package/src/build-components/PaywallBackground/pattern.json +4 -2
- package/src/build-components/PaywallCloseButton/PaywallCloseButton.tsx +1 -1
- package/src/build-components/PaywallCloseButton/PaywallCloseButtonProps.generated.ts +1 -1
- package/src/build-components/PaywallCloseButton/pattern.json +4 -2
- package/src/build-components/PaywallOptions/PaywallOptionsProps.generated.ts +1 -1
- package/src/build-components/PaywallOptions/pattern.json +4 -2
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +1 -1
- package/src/build-components/PaywallProvider/pattern.json +4 -2
- package/src/build-components/PaywallSubscribeButton/PaywallSubscribeButtonProps.generated.ts +1 -1
- package/src/build-components/PaywallSubscribeButton/pattern.json +4 -2
- package/src/build-components/PriceTag/PriceTagProps.generated.ts +1 -1
- package/src/build-components/PriceTag/pattern.json +10 -4
- package/src/build-components/Pricing/PricingProps.generated.ts +1 -1
- package/src/build-components/Pricing/pattern.json +4 -2
- package/src/build-components/Promo/PromoProps.generated.ts +1 -1
- package/src/build-components/Promo/pattern.json +4 -2
- package/src/build-components/RadioButton/RadioButtonProps.generated.ts +1 -1
- package/src/build-components/Separator/SeparatorProps.generated.ts +1 -1
- package/src/build-components/Separator/pattern.json +5 -3
- package/src/build-components/StatusBarColor/StatusBarColorProps.generated.ts +1 -1
- package/src/build-components/StatusBarColor/pattern.json +5 -3
- package/src/build-components/Text/Text.tsx +1 -1
- package/src/build-components/Text/TextProps.generated.ts +1 -1
- package/src/build-components/Text/pattern.json +5 -3
- package/src/build-components/View/ViewProps.generated.ts +1 -1
- package/src/build-components/View/pattern.json +18 -6
- package/src/build-components/patterns.generated.ts +62 -52
- package/src/build-components/useNode.ts +2 -16
- package/src/migrations/migrations/1.1.2_extract_component_attributes_from_style.ts +31 -10
- package/src/utils/analyseNodeByPatterns.ts +2 -2
- package/src/utils/attributeStyle.ts +9 -3
- package/src/utils/extractImageStyle.ts +4 -4
- package/src/utils/patterns.ts +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared utilities for attribute/style bag access.
|
|
3
|
-
* schemaVersion=2 uses `attributes.styles
|
|
3
|
+
* schemaVersion=2 uses `attributes.styles` exclusively.
|
|
4
4
|
*/
|
|
5
5
|
import type { NodeDefaultAttribute } from '../types/Node';
|
|
6
|
-
/** Returns styles
|
|
6
|
+
/** Returns styles bag from attributes (schemaVersion=2 uses `styles` only). Throws if legacy `style` is found. */
|
|
7
7
|
export declare function getStyleBag(attributes: NodeDefaultAttribute | undefined): Record<string, unknown> | undefined;
|
|
8
8
|
/** Safe indexed access to attributes. Use for reading style/direct props. */
|
|
9
9
|
export declare function toAttributeRecord(attributes: unknown): Record<string, unknown>;
|
package/dist/utils/patterns.d.ts
CHANGED
|
@@ -53,11 +53,11 @@ type Pattern = {
|
|
|
53
53
|
export type BuilderPlatform = 'web' | 'native';
|
|
54
54
|
/**
|
|
55
55
|
* Keys that conceptually behave like component props (behavior/flags) rather than
|
|
56
|
-
* style properties. These should NOT be normalized into `attributes.
|
|
56
|
+
* style properties. These should NOT be normalized into `attributes.styles`.
|
|
57
57
|
*/
|
|
58
58
|
export declare const NON_STYLE_ATTRIBUTE_KEYS: Set<string>;
|
|
59
59
|
/**
|
|
60
|
-
* schemaVersion=2 stores style-like keys inside `attributes.
|
|
60
|
+
* schemaVersion=2 stores style-like keys inside `attributes.styles`.
|
|
61
61
|
*
|
|
62
62
|
* We treat View+Text schema keys as style-like by default, but explicitly exclude
|
|
63
63
|
* known non-style props (behavior flags).
|
package/package.json
CHANGED
|
@@ -142,11 +142,11 @@ export async function createGeneratedProps(
|
|
|
142
142
|
return ` ${key}?: ${tsType};`;
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
// In schema v2, the source of truth for "style bag" fields is `pattern.attributes.
|
|
145
|
+
// In schema v2, the source of truth for "style bag" fields is `pattern.attributes.styles`.
|
|
146
146
|
// `meta.styles` is UI metadata (and can include non-style fields like "scrollable" or "condition"),
|
|
147
|
-
// so we must NOT treat its keys as belonging to `attributes.
|
|
148
|
-
const nestedStyleSchema = isPlainObject(attributes?.
|
|
149
|
-
? attributes.
|
|
147
|
+
// so we must NOT treat its keys as belonging to `attributes.styles`.
|
|
148
|
+
const nestedStyleSchema = isPlainObject(attributes?.styles)
|
|
149
|
+
? attributes.styles
|
|
150
150
|
: {};
|
|
151
151
|
const styleKeys = Object.keys(nestedStyleSchema);
|
|
152
152
|
const styleInterfaceName = `${componentName}StyleGenerated`;
|
|
@@ -173,17 +173,17 @@ export async function createGeneratedProps(
|
|
|
173
173
|
`\n}\n`
|
|
174
174
|
: '';
|
|
175
175
|
|
|
176
|
-
// In schema v2 we always allow a nested `
|
|
176
|
+
// In schema v2 we always allow a nested `styles` object.
|
|
177
177
|
// If pattern.json declares meta.styles keys, we expose them for autocomplete while keeping flexibility via an index signature.
|
|
178
178
|
const styleLine =
|
|
179
179
|
styleKeys.length > 0
|
|
180
|
-
? `
|
|
181
|
-
: `
|
|
180
|
+
? ` styles?: ${styleInterfaceName};`
|
|
181
|
+
: ` styles?: Record<string, unknown>;`;
|
|
182
182
|
|
|
183
|
-
// Avoid emitting `attributes.
|
|
183
|
+
// Avoid emitting `attributes.styles?: string;` when `pattern.attributes.styles` is the nested style schema object.
|
|
184
184
|
const attributeLinesWithoutNestedStyle =
|
|
185
185
|
styleKeys.length > 0
|
|
186
|
-
? attributeLines.filter(line => !line.trim().startsWith('
|
|
186
|
+
? attributeLines.filter(line => !line.trim().startsWith('styles?:'))
|
|
187
187
|
: attributeLines;
|
|
188
188
|
|
|
189
189
|
const childTsType =
|
|
@@ -203,17 +203,17 @@ async function validatePatternJson(componentDir, componentName) {
|
|
|
203
203
|
|
|
204
204
|
// Validate attributes accept primitive, enum array, or custom type refs (including X[])
|
|
205
205
|
for (const [attrName, attrType] of Object.entries(pattern.attributes)) {
|
|
206
|
-
if (attrName === '
|
|
206
|
+
if (attrName === 'styles') {
|
|
207
207
|
if (!isPlainObject(attrType)) {
|
|
208
208
|
return fail(
|
|
209
|
-
`[${componentName}] pattern.json -> 'pattern.attributes.
|
|
209
|
+
`[${componentName}] pattern.json -> 'pattern.attributes.styles' must be an object`
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
for (const [styleKey, styleType] of Object.entries(attrType)) {
|
|
213
213
|
const res = validateAttrType(
|
|
214
214
|
styleKey,
|
|
215
215
|
styleType,
|
|
216
|
-
'pattern.attributes.
|
|
216
|
+
'pattern.attributes.styles'
|
|
217
217
|
);
|
|
218
218
|
if (res) return res;
|
|
219
219
|
}
|
|
@@ -335,15 +335,15 @@ async function validatePatternJson(componentDir, componentName) {
|
|
|
335
335
|
const parentAttributes = parentData?.pattern?.attributes || {};
|
|
336
336
|
const childAttributes = data?.pattern?.attributes || {};
|
|
337
337
|
const mergedAttributes = { ...parentAttributes, ...childAttributes };
|
|
338
|
-
// Deep-merge nested schema `attributes.
|
|
339
|
-
const parentStyle = isPlainObject(parentAttributes?.
|
|
340
|
-
? parentAttributes.
|
|
338
|
+
// Deep-merge nested schema `attributes.styles` when present (so parent style keys propagate).
|
|
339
|
+
const parentStyle = isPlainObject(parentAttributes?.styles)
|
|
340
|
+
? parentAttributes.styles
|
|
341
341
|
: null;
|
|
342
|
-
const childStyle = isPlainObject(childAttributes?.
|
|
343
|
-
? childAttributes.
|
|
342
|
+
const childStyle = isPlainObject(childAttributes?.styles)
|
|
343
|
+
? childAttributes.styles
|
|
344
344
|
: null;
|
|
345
345
|
if (parentStyle || childStyle) {
|
|
346
|
-
mergedAttributes.
|
|
346
|
+
mergedAttributes.styles = {
|
|
347
347
|
...(parentStyle || {}),
|
|
348
348
|
...(childStyle || {}),
|
|
349
349
|
};
|
package/src/RenderPage.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef } from 'react';
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { DeviceMockFrame } from './DeviceMockFrame';
|
|
3
3
|
import { Node } from './types/Node';
|
|
4
4
|
import { RenderNode } from './build-components';
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
} from './components/BuilderProvider';
|
|
11
11
|
import { RenderErrorBoundary } from './components/RenderErrorBoundary';
|
|
12
12
|
import { usePreviewSelection } from './hooks/usePreviewSelection';
|
|
13
|
+
import { defaultLocalization } from './types/PreviewConfig';
|
|
14
|
+
import { defaultProjectColors } from './utils/projectColors';
|
|
13
15
|
export type ScreenStyle = {
|
|
14
16
|
light: { backgroundColor: string; color: string; seperatorColor?: string };
|
|
15
17
|
dark: { backgroundColor: string; color: string; seperatorColor?: string };
|
|
@@ -67,6 +69,7 @@ export function RenderPage({
|
|
|
67
69
|
setCurrent: s.setCurrent,
|
|
68
70
|
}));
|
|
69
71
|
const previewRootRef = useRef<HTMLDivElement | null>(null);
|
|
72
|
+
const hasAlertedRef = useRef(false);
|
|
70
73
|
const showEmptyState = isNullish(data);
|
|
71
74
|
|
|
72
75
|
usePreviewSelection({
|
|
@@ -78,6 +81,44 @@ export function RenderPage({
|
|
|
78
81
|
forceRender,
|
|
79
82
|
});
|
|
80
83
|
|
|
84
|
+
// Alert once per page when default localization or project colors are used
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (hasAlertedRef.current) return;
|
|
87
|
+
|
|
88
|
+
const locKeys = overrideLocalization
|
|
89
|
+
? Object.keys(overrideLocalization)
|
|
90
|
+
: [];
|
|
91
|
+
const pcKeys = overrideProjectColors
|
|
92
|
+
? [
|
|
93
|
+
...Object.keys(overrideProjectColors.STATIC_COLORS ?? {}),
|
|
94
|
+
...Object.keys(overrideProjectColors.THEME_COLORS ?? {}),
|
|
95
|
+
]
|
|
96
|
+
: [];
|
|
97
|
+
|
|
98
|
+
const isDefaultLocalization =
|
|
99
|
+
!overrideLocalization ||
|
|
100
|
+
locKeys.length === 0 ||
|
|
101
|
+
JSON.stringify(overrideLocalization) ===
|
|
102
|
+
JSON.stringify(defaultLocalization);
|
|
103
|
+
|
|
104
|
+
const isDefaultProjectColors =
|
|
105
|
+
!overrideProjectColors ||
|
|
106
|
+
JSON.stringify(overrideProjectColors) ===
|
|
107
|
+
JSON.stringify(defaultProjectColors);
|
|
108
|
+
|
|
109
|
+
if (isDefaultLocalization || isDefaultProjectColors) {
|
|
110
|
+
const parts: string[] = [];
|
|
111
|
+
if (isDefaultLocalization) parts.push('localization');
|
|
112
|
+
if (isDefaultProjectColors) parts.push('projectColors');
|
|
113
|
+
|
|
114
|
+
hasAlertedRef.current = true;
|
|
115
|
+
alert(
|
|
116
|
+
`[RenderPage] ⚠️ Using default ${parts.join(' & ')}. ` +
|
|
117
|
+
'Provide overrides via the store or params to avoid fallback values.',
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}, [overrideLocalization, overrideProjectColors]);
|
|
121
|
+
|
|
81
122
|
return (
|
|
82
123
|
<RenderErrorBoundary subtitle="caught by RenderPage">
|
|
83
124
|
<BuilderProvider
|
package/src/assets/meta.json
CHANGED
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
"name": "vpn-onboard-1",
|
|
3
3
|
"version": "1.1.2",
|
|
4
4
|
"type": "onboard",
|
|
5
|
-
"appConfig": {
|
|
6
|
-
"localication": {
|
|
7
|
-
"ar": {
|
|
8
|
-
"onboard.title.one-page": "أمّن اتصالك",
|
|
9
|
-
"onboard.title.two-page": "وصول إلى المحتوى حول العالم",
|
|
10
|
-
"onboard.title.three-page": "سرعة واعتمادية",
|
|
11
|
-
"onboard.title.four-page": "إشعارات وحماية دائمة",
|
|
12
|
-
"onboard.subtitle.one-page": "قم بتشفير حركة المرور وحماية خصوصيتك على شبكات Wi‑Fi العامة.",
|
|
13
|
-
"onboard.subtitle.two-page": "اتصل بخوادم عالية السرعة في بلدان متعددة بضغطة واحدة.",
|
|
14
|
-
"onboard.subtitle.three-page": "يتصل التطبيق تلقائياً بأفضل خادم لسرعة وثبات أعلى.",
|
|
15
|
-
"onboard.subtitle.four-page": "فعّل الإشعارات لمعرفة حالة الاتصال والحصول على نصائح الأمان.",
|
|
16
|
-
"onboard.next.one-page": "التالي",
|
|
17
|
-
"onboard.next.two-page": "التالي",
|
|
18
|
-
"onboard.next.three-page": "التالي",
|
|
19
|
-
"onboard.skip.one-page": "تخطي",
|
|
20
|
-
"onboard.skip.two-page": "تخطي",
|
|
21
|
-
"onboard.skip.three-page": "تخطي",
|
|
22
|
-
"onboard.allow.four-page": "السماح",
|
|
23
|
-
"view.onboarding.footer.description": "بالمتابعة، فإنك توافق على",
|
|
24
|
-
"view.onboarding.btnPrivacy": "سياسة الخصوصية",
|
|
25
|
-
"view.onboarding.btnTerms": "شروط الخدمة"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
5
|
"data": {
|
|
30
6
|
"type": "Main",
|
|
31
7
|
"isMain": true,
|
|
@@ -63,7 +63,7 @@ export interface BIconStyleGenerated {
|
|
|
63
63
|
export interface BIconPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: BIconStyleGenerated;
|
|
67
67
|
adjustsFontSizeToFit?: boolean;
|
|
68
68
|
showEllipsis?: boolean;
|
|
69
69
|
translateCounter?: number;
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"meta": {
|
|
16
|
-
"desiredParent": [
|
|
16
|
+
"desiredParent": [
|
|
17
|
+
"all"
|
|
18
|
+
],
|
|
17
19
|
"label": "BIcon",
|
|
18
20
|
"description": "Renders an icon from the icon set.",
|
|
19
21
|
"styles": {},
|
|
@@ -44,7 +46,7 @@
|
|
|
44
46
|
"defaults": {
|
|
45
47
|
"iconType": "activity",
|
|
46
48
|
"strokeWidth": 1.5,
|
|
47
|
-
"
|
|
49
|
+
"styles": {
|
|
48
50
|
"fontSize": "16"
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -20,7 +20,7 @@ export function BackgroundImage({ node }: BackgroundImageComponentProps) {
|
|
|
20
20
|
const baseStyle = useExtractViewStyle(node);
|
|
21
21
|
const backgroundStyle = useMemo(() => {
|
|
22
22
|
const attrs = node.attributes;
|
|
23
|
-
const styleBag = attrs?.
|
|
23
|
+
const styleBag = attrs?.styles;
|
|
24
24
|
const style: React.CSSProperties = {
|
|
25
25
|
backgroundRepeat: 'no-repeat',
|
|
26
26
|
backgroundPosition: 'center',
|
|
@@ -60,7 +60,7 @@ export interface BackgroundImageStyleGenerated {
|
|
|
60
60
|
export interface BackgroundImagePropsGenerated {
|
|
61
61
|
child: string;
|
|
62
62
|
attributes: {
|
|
63
|
-
|
|
63
|
+
styles?: BackgroundImageStyleGenerated;
|
|
64
64
|
scrollable?: boolean;
|
|
65
65
|
src?: string;
|
|
66
66
|
resizeMode?: ResizeModeOptionType;
|
|
@@ -8,11 +8,16 @@
|
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"src": "string",
|
|
11
|
-
"resizeMode": [
|
|
11
|
+
"resizeMode": [
|
|
12
|
+
"cover",
|
|
13
|
+
"contain",
|
|
14
|
+
"stretch",
|
|
15
|
+
"center"
|
|
16
|
+
]
|
|
12
17
|
},
|
|
13
18
|
"defaults": {
|
|
14
19
|
"resizeMode": "cover",
|
|
15
|
-
"
|
|
20
|
+
"styles": {
|
|
16
21
|
"width": "100%",
|
|
17
22
|
"height": "100%",
|
|
18
23
|
"position": "absolute",
|
|
@@ -24,7 +29,10 @@
|
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
"meta": {
|
|
27
|
-
"desiredParent": [
|
|
32
|
+
"desiredParent": [
|
|
33
|
+
"all",
|
|
34
|
+
"background"
|
|
35
|
+
],
|
|
28
36
|
"label": "Background Image",
|
|
29
37
|
"description": "Background image.",
|
|
30
38
|
"styles": {
|
|
@@ -33,7 +33,7 @@ export function Button({ node }: ButtonComponentProps) {
|
|
|
33
33
|
combinedTextStyle.textAlign,
|
|
34
34
|
]);
|
|
35
35
|
const buttonDefaults = useMemo(() => {
|
|
36
|
-
const styleBag = node?.attributes?.
|
|
36
|
+
const styleBag = node?.attributes?.styles;
|
|
37
37
|
const hasExplicitBackground =
|
|
38
38
|
styleBag?.backgroundColor !== undefined &&
|
|
39
39
|
styleBag?.backgroundColor !== null &&
|
|
@@ -45,7 +45,7 @@ export function Button({ node }: ButtonComponentProps) {
|
|
|
45
45
|
? undefined
|
|
46
46
|
: { backgroundColor: 'transparent' }),
|
|
47
47
|
} as React.CSSProperties;
|
|
48
|
-
}, [node?.attributes?.
|
|
48
|
+
}, [node?.attributes?.styles]);
|
|
49
49
|
const isSelected = isNodeSelected({
|
|
50
50
|
previewMode: !!previewMode,
|
|
51
51
|
current: selectedKey ? { key: selectedKey } : undefined,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"children": "string",
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"
|
|
10
|
+
"styles": {
|
|
11
11
|
"color": "color",
|
|
12
12
|
"fontSize": "size",
|
|
13
13
|
"fontWeight": [
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"meta": {
|
|
30
|
-
"desiredParent": [
|
|
30
|
+
"desiredParent": [
|
|
31
|
+
"all"
|
|
32
|
+
],
|
|
31
33
|
"label": "Button",
|
|
32
34
|
"description": "Simple action button.",
|
|
33
35
|
"styles": {
|
|
@@ -55,7 +57,7 @@
|
|
|
55
57
|
}
|
|
56
58
|
},
|
|
57
59
|
"defaults": {
|
|
58
|
-
"
|
|
60
|
+
"styles": {
|
|
59
61
|
"display": "flex",
|
|
60
62
|
"alignItems": "center",
|
|
61
63
|
"justifyContent": "center",
|
|
@@ -9,17 +9,23 @@
|
|
|
9
9
|
"attributes": {
|
|
10
10
|
"loop": "boolean",
|
|
11
11
|
"dragFree": "boolean",
|
|
12
|
-
"align": [
|
|
12
|
+
"align": [
|
|
13
|
+
"start",
|
|
14
|
+
"center",
|
|
15
|
+
"end"
|
|
16
|
+
]
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
19
|
"meta": {
|
|
16
|
-
"desiredParent": [
|
|
20
|
+
"desiredParent": [
|
|
21
|
+
"=CarouselProvider"
|
|
22
|
+
],
|
|
17
23
|
"label": "Carousel",
|
|
18
24
|
"description": "Container for carousel items.",
|
|
19
25
|
"styles": {}
|
|
20
26
|
},
|
|
21
27
|
"defaults": {
|
|
22
|
-
"
|
|
28
|
+
"styles": {
|
|
23
29
|
"flexDirection": "row"
|
|
24
30
|
}
|
|
25
31
|
}
|
|
@@ -63,7 +63,7 @@ export interface CarouselButtonsStyleGenerated {
|
|
|
63
63
|
export interface CarouselButtonsPropsGenerated {
|
|
64
64
|
child: string;
|
|
65
65
|
attributes: {
|
|
66
|
-
|
|
66
|
+
styles?: CarouselButtonsStyleGenerated;
|
|
67
67
|
scrollable?: boolean;
|
|
68
68
|
buttonType?: ButtonTypeOptionType;
|
|
69
69
|
skipNumber?: number;
|
|
@@ -66,7 +66,7 @@ export interface CarouselDotsStyleGenerated {
|
|
|
66
66
|
export interface CarouselDotsPropsGenerated {
|
|
67
67
|
child: string;
|
|
68
68
|
attributes: {
|
|
69
|
-
|
|
69
|
+
styles?: CarouselDotsStyleGenerated;
|
|
70
70
|
scrollable?: boolean;
|
|
71
71
|
dotType?: DotTypeOptionType;
|
|
72
72
|
dot_thickness?: string;
|
|
@@ -59,7 +59,7 @@ export interface CarouselProviderStyleGenerated {
|
|
|
59
59
|
export interface CarouselProviderPropsGenerated {
|
|
60
60
|
child: string;
|
|
61
61
|
attributes: {
|
|
62
|
-
|
|
62
|
+
styles?: CarouselProviderStyleGenerated;
|
|
63
63
|
scrollable?: boolean;
|
|
64
64
|
};
|
|
65
65
|
}
|
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
"children": "node",
|
|
9
9
|
"extends": "View",
|
|
10
10
|
"defaults": {
|
|
11
|
-
"
|
|
11
|
+
"styles": {
|
|
12
12
|
"width": "100%",
|
|
13
13
|
"height": "100%"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"meta": {
|
|
18
|
-
"desiredParent": [
|
|
18
|
+
"desiredParent": [
|
|
19
|
+
"root",
|
|
20
|
+
">View"
|
|
21
|
+
],
|
|
19
22
|
"label": "Carousel Provider",
|
|
20
23
|
"description": "Provides carousel context to its children.",
|
|
21
24
|
"attributes": {}
|
|
@@ -64,7 +64,7 @@ export interface CountDownStyleGenerated {
|
|
|
64
64
|
export interface CountDownPropsGenerated {
|
|
65
65
|
child: string;
|
|
66
66
|
attributes: {
|
|
67
|
-
|
|
67
|
+
styles?: CountDownStyleGenerated;
|
|
68
68
|
adjustsFontSizeToFit?: boolean;
|
|
69
69
|
showEllipsis?: boolean;
|
|
70
70
|
translateCounter?: number;
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
"extends": "Text",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"count": "number",
|
|
11
|
-
"
|
|
11
|
+
"styles": {
|
|
12
12
|
"width": "never",
|
|
13
13
|
"textAlign": "never"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"meta": {
|
|
18
|
-
"desiredParent": [
|
|
18
|
+
"desiredParent": [
|
|
19
|
+
"all"
|
|
20
|
+
],
|
|
19
21
|
"label": "Count Down",
|
|
20
22
|
"description": "Displays a countdown timer.",
|
|
21
23
|
"attributes": {
|
|
@@ -8,18 +8,25 @@
|
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"src": "string",
|
|
11
|
-
"
|
|
12
|
-
"resizeMode": [
|
|
11
|
+
"styles": {
|
|
12
|
+
"resizeMode": [
|
|
13
|
+
"cover",
|
|
14
|
+
"contain",
|
|
15
|
+
"stretch",
|
|
16
|
+
"center"
|
|
17
|
+
]
|
|
13
18
|
}
|
|
14
19
|
},
|
|
15
20
|
"defaults": {
|
|
16
|
-
"
|
|
21
|
+
"styles": {
|
|
17
22
|
"resizeMode": "contain"
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
},
|
|
21
26
|
"meta": {
|
|
22
|
-
"desiredParent": [
|
|
27
|
+
"desiredParent": [
|
|
28
|
+
"all"
|
|
29
|
+
],
|
|
23
30
|
"label": "Image",
|
|
24
31
|
"description": "Shows an image or graphic.",
|
|
25
32
|
"styles": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"defaults": {
|
|
14
14
|
"useSafeAreaView": true,
|
|
15
|
-
"
|
|
15
|
+
"styles": {
|
|
16
16
|
"width": "100%",
|
|
17
17
|
"height": "100%",
|
|
18
18
|
"flex": 1,
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"meta": {
|
|
23
|
-
"desiredParent": [
|
|
23
|
+
"desiredParent": [
|
|
24
|
+
"root"
|
|
25
|
+
],
|
|
24
26
|
"label": "Main",
|
|
25
27
|
"description": "Top-level screen wrapper (safe area, base layout).",
|
|
26
28
|
"hideAllAttributes": true,
|
|
@@ -59,7 +59,7 @@ export interface NavigationBarColorStyleGenerated {
|
|
|
59
59
|
export interface NavigationBarColorPropsGenerated {
|
|
60
60
|
child: string;
|
|
61
61
|
attributes: {
|
|
62
|
-
|
|
62
|
+
styles?: NavigationBarColorStyleGenerated;
|
|
63
63
|
scrollable?: boolean;
|
|
64
64
|
};
|
|
65
65
|
}
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
"children": "never",
|
|
8
8
|
"extends": "View",
|
|
9
9
|
"attributes": {
|
|
10
|
-
"
|
|
10
|
+
"styles": {
|
|
11
11
|
"backgroundColor": "color"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"meta": {
|
|
16
|
-
"desiredParent": [
|
|
16
|
+
"desiredParent": [
|
|
17
|
+
"all"
|
|
18
|
+
],
|
|
17
19
|
"label": "Navigation Bar Color",
|
|
18
20
|
"description": "Sets the OS navigation bar background color.",
|
|
19
21
|
"styles": {
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
}
|
|
28
30
|
},
|
|
29
31
|
"defaults": {
|
|
30
|
-
"
|
|
32
|
+
"styles": {
|
|
31
33
|
"backgroundColor": "THEME_COLORS.BACKGROUND"
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -8,14 +8,18 @@
|
|
|
8
8
|
"extends": "View"
|
|
9
9
|
},
|
|
10
10
|
"meta": {
|
|
11
|
-
"desiredParent": [
|
|
12
|
-
|
|
11
|
+
"desiredParent": [
|
|
12
|
+
"=OnboardProvider"
|
|
13
|
+
],
|
|
14
|
+
"desiredChildren": [
|
|
15
|
+
"=OnboardItem"
|
|
16
|
+
],
|
|
13
17
|
"label": "Onboard",
|
|
14
18
|
"description": "Wraps the onboarding flow.",
|
|
15
19
|
"styles": {}
|
|
16
20
|
},
|
|
17
21
|
"defaults": {
|
|
18
|
-
"
|
|
22
|
+
"styles": {
|
|
19
23
|
"flexDirection": "row"
|
|
20
24
|
}
|
|
21
25
|
}
|