@developer_tribe/react-builder 1.2.43 → 1.2.44-test.2
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/attributes-editor/Field.d.ts +3 -1
- package/dist/attributes-editor/attributesEditorModelTypes.d.ts +3 -0
- package/dist/attributes-editor/useAttributesEditorModel.d.ts +1 -1
- package/dist/build-components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/build-components/Checkbox/CheckboxProps.generated.d.ts +67 -0
- package/dist/build-components/FormCheckbox/FormCheckbox.d.ts +3 -0
- package/dist/build-components/FormCheckbox/FormCheckboxProps.generated.d.ts +69 -0
- package/dist/build-components/FormErrorText/FormErrorText.d.ts +3 -0
- package/dist/build-components/FormErrorText/FormErrorTextProps.generated.d.ts +61 -0
- package/dist/build-components/FormProvider/FormProvider.d.ts +11 -0
- package/dist/build-components/FormProvider/FormProviderProps.generated.d.ts +55 -0
- package/dist/build-components/FormSubmitButton/FormSubmitButton.d.ts +2 -0
- package/dist/build-components/FormSubmitButton/FormSubmitButtonProps.generated.d.ts +78 -0
- package/dist/build-components/GlobalProvider/GlobalContext.d.ts +28 -0
- package/dist/build-components/GlobalProvider/GlobalProvider.d.ts +5 -0
- package/dist/build-components/GlobalProvider/GlobalProviderProps.generated.d.ts +60 -0
- package/dist/build-components/GlobalProvider/globalProviderUtils.d.ts +28 -0
- package/dist/build-components/GlobalProvider/useGlobalNavigation.d.ts +19 -0
- package/dist/build-components/GlobalProvider/useGlobalProviderLogic.d.ts +15 -0
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +22 -10
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +2 -0
- package/dist/build-components/PaywallProvider/PaywallProviderProps.generated.d.ts +2 -0
- package/dist/build-components/SystemButton/SystemButton.d.ts +7 -0
- package/dist/build-components/SystemButton/SystemButtonProps.generated.d.ts +76 -0
- package/dist/build-components/SystemButton/usePlacementButtonEvents.d.ts +35 -0
- package/dist/build-components/TermsProvider/TermsProvider.d.ts +5 -0
- package/dist/build-components/TermsProvider/TermsProviderProps.generated.d.ts +55 -0
- package/dist/build-components/WebView/WebView.d.ts +2 -0
- package/dist/build-components/WebView/WebViewProps.generated.d.ts +59 -0
- package/dist/build-components/index.d.ts +10 -1
- package/dist/build-components/patterns.generated.d.ts +5645 -1686
- 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 +5 -5
- package/dist/index.web.cjs.js.map +1 -1
- package/dist/index.web.d.ts +1 -0
- package/dist/index.web.esm.js +4 -4
- package/dist/index.web.esm.js.map +1 -1
- package/dist/mockOS/context/MockOSContextBase.d.ts +3 -1
- package/dist/styles.css +1 -1
- package/dist/types/PreviewConfig.d.ts +1 -1
- package/dist/utils/nodeTree.d.ts +18 -0
- package/package.json +2 -1
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +68 -4
- package/src/assets/meta.json +1 -1
- package/src/assets/prompt-scheme-onboard.generated.ts +1 -1
- package/src/assets/prompt-scheme-paywall.generated.ts +1 -1
- package/src/assets/samples/getSamples.ts +7 -0
- package/src/assets/samples/global-onboard-flow.json +735 -0
- package/src/assets/samples/terms-and-privacy-no-form.json +108 -0
- package/src/assets/samples/terms-and-privacy.json +130 -0
- package/src/attributes-editor/AttributesEditorView.tsx +3 -0
- package/src/attributes-editor/Field.tsx +91 -2
- package/src/attributes-editor/attributesEditorModelTypes.ts +3 -0
- package/src/attributes-editor/useAttributesEditorModel.ts +8 -0
- package/src/build-components/Checkbox/Checkbox.tsx +165 -0
- package/src/build-components/Checkbox/CheckboxProps.generated.ts +84 -0
- package/src/build-components/Checkbox/pattern.json +83 -0
- package/src/build-components/FormCheckbox/FormCheckbox.tsx +108 -0
- package/src/build-components/FormCheckbox/FormCheckboxProps.generated.ts +86 -0
- package/src/build-components/FormCheckbox/pattern.json +39 -0
- package/src/build-components/FormErrorText/FormErrorText.tsx +34 -0
- package/src/build-components/FormErrorText/FormErrorTextProps.generated.ts +78 -0
- package/src/build-components/FormErrorText/pattern.json +21 -0
- package/src/build-components/FormProvider/FormProvider.tsx +131 -0
- package/src/build-components/FormProvider/FormProviderProps.generated.ts +72 -0
- package/src/build-components/FormProvider/pattern.json +33 -0
- package/src/build-components/FormSubmitButton/FormSubmitButton.tsx +52 -0
- package/src/build-components/FormSubmitButton/FormSubmitButtonProps.generated.ts +114 -0
- package/src/build-components/FormSubmitButton/pattern.json +33 -0
- package/src/build-components/GlobalProvider/GlobalContext.ts +48 -0
- package/src/build-components/GlobalProvider/GlobalProvider.tsx +51 -0
- package/src/build-components/GlobalProvider/GlobalProviderProps.generated.ts +78 -0
- package/src/build-components/GlobalProvider/globalProviderUtils.ts +204 -0
- package/src/build-components/GlobalProvider/pattern.json +55 -0
- package/src/build-components/GlobalProvider/useGlobalNavigation.ts +65 -0
- package/src/build-components/GlobalProvider/useGlobalProviderLogic.ts +172 -0
- package/src/build-components/OnboardButton/OnboardButton.tsx +44 -36
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +40 -10
- package/src/build-components/OnboardButton/pattern.json +7 -4
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +12 -0
- package/src/build-components/OnboardProvider/pattern.json +9 -1
- package/src/build-components/PaywallProvider/PaywallProviderProps.generated.ts +12 -0
- package/src/build-components/PaywallProvider/pattern.json +9 -1
- package/src/build-components/RenderNode.generated.tsx +46 -1
- package/src/build-components/SystemButton/SystemButton.tsx +74 -0
- package/src/build-components/SystemButton/SystemButtonProps.generated.ts +112 -0
- package/src/build-components/SystemButton/pattern.json +63 -0
- package/src/build-components/SystemButton/usePlacementButtonEvents.ts +114 -0
- package/src/build-components/TermsProvider/TermsProvider.tsx +45 -0
- package/src/build-components/TermsProvider/TermsProviderProps.generated.ts +82 -0
- package/src/build-components/TermsProvider/pattern.json +35 -0
- package/src/build-components/WebView/WebView.tsx +149 -0
- package/src/build-components/WebView/WebViewProps.generated.ts +76 -0
- package/src/build-components/WebView/pattern.json +71 -0
- package/src/build-components/index.ts +45 -0
- package/src/build-components/patterns.generated.ts +5735 -1557
- package/src/components/AttributesEditorPanel.tsx +1 -0
- package/src/index.web.ts +3 -0
- package/src/mockOS/components/MockOSRouter.tsx +21 -0
- package/src/mockOS/context/MockOSContext.tsx +7 -0
- package/src/mockOS/context/MockOSContextBase.ts +4 -0
- package/src/patterns/event-constants.json +19 -0
- package/src/styles/components/_checkbox.scss +19 -0
- package/src/styles/components/_global-provider.scss +131 -0
- package/src/styles/components/_webview.scss +52 -0
- package/src/styles/index.scss +4 -0
- package/src/types/PreviewConfig.ts +19 -0
- package/src/utils/analyseNodeByPatterns.ts +5 -2
- package/src/utils/nodeTree.ts +115 -0
- package/src/utils/projectColors.ts +4 -0
- package/src/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
package/src/index.web.ts
CHANGED
|
@@ -12,6 +12,9 @@ export * from './build-components';
|
|
|
12
12
|
export { default as useNode } from './build-components/useNode';
|
|
13
13
|
export type { EventObjectGenerated } from './build-components/OnboardButton/OnboardButtonProps.generated';
|
|
14
14
|
|
|
15
|
+
// Host-app API: store (tema vb. builder içinde kullanılır; örn. tema toggle'ı builder'a senkronize etmek için).
|
|
16
|
+
export { useRenderStore } from './store';
|
|
17
|
+
|
|
15
18
|
// Host-app API: let parent apps inject a custom "Text" field renderer.
|
|
16
19
|
import { useRenderStore } from './store';
|
|
17
20
|
import type { ComponentType } from 'react';
|
|
@@ -35,6 +35,17 @@ function OnboardComponent() {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function TermsComponent() {
|
|
39
|
+
return (
|
|
40
|
+
<div className="mockos-screen mockos-screen--terms">
|
|
41
|
+
<div className="mockos-screen__heading">Terms and Privacy</div>
|
|
42
|
+
<div className="mockos-screen__text">
|
|
43
|
+
Please review our terms and conditions.
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
38
49
|
function SubscriptionComponent() {
|
|
39
50
|
return (
|
|
40
51
|
<div className="mockos-screen mockos-screen--subscription">
|
|
@@ -68,6 +79,14 @@ function ScreenRenderer({
|
|
|
68
79
|
return <>{children}</>;
|
|
69
80
|
}
|
|
70
81
|
|
|
82
|
+
// app_launch flow: terms route shows builder (terms UI); onboard route shows default onboard screen
|
|
83
|
+
if (children && childrenBelongTo === 'app' && currentRoute === 'terms') {
|
|
84
|
+
return <>{children}</>;
|
|
85
|
+
}
|
|
86
|
+
if (childrenBelongTo === 'app' && currentRoute === 'onboard') {
|
|
87
|
+
return <OnboardComponent />;
|
|
88
|
+
}
|
|
89
|
+
|
|
71
90
|
// Otherwise render default screens based on route
|
|
72
91
|
switch (currentRoute) {
|
|
73
92
|
case 'launchscreen':
|
|
@@ -78,6 +97,8 @@ function ScreenRenderer({
|
|
|
78
97
|
return <HomeComponent />;
|
|
79
98
|
case 'onboard':
|
|
80
99
|
return <OnboardComponent />;
|
|
100
|
+
case 'terms':
|
|
101
|
+
return <TermsComponent />;
|
|
81
102
|
case 'subscription':
|
|
82
103
|
return <SubscriptionComponent />;
|
|
83
104
|
default:
|
|
@@ -80,8 +80,12 @@ export function MockOSProvider({
|
|
|
80
80
|
const [navigationStack, setNavigationStack] = useState<RouteStackItem[]>([
|
|
81
81
|
{ route: defaultRoute, timestamp: Date.now() },
|
|
82
82
|
]);
|
|
83
|
+
const [termsAccepted, setTermsAccepted] = useState(false);
|
|
83
84
|
|
|
84
85
|
const navigation = useCallback((route: RouteType) => {
|
|
86
|
+
if (route === 'terms') {
|
|
87
|
+
setTermsAccepted(false);
|
|
88
|
+
}
|
|
85
89
|
setCurrentRoute(route);
|
|
86
90
|
|
|
87
91
|
// If navigating from launchscreen and the last item in stack is launchscreen,
|
|
@@ -179,6 +183,8 @@ export function MockOSProvider({
|
|
|
179
183
|
navigation,
|
|
180
184
|
goBack,
|
|
181
185
|
navigationStack,
|
|
186
|
+
termsAccepted,
|
|
187
|
+
setTermsAccepted,
|
|
182
188
|
}),
|
|
183
189
|
[
|
|
184
190
|
permission,
|
|
@@ -188,6 +194,7 @@ export function MockOSProvider({
|
|
|
188
194
|
navigation,
|
|
189
195
|
goBack,
|
|
190
196
|
navigationStack,
|
|
197
|
+
termsAccepted,
|
|
191
198
|
],
|
|
192
199
|
);
|
|
193
200
|
|
|
@@ -6,6 +6,7 @@ export type RouteType =
|
|
|
6
6
|
| 'app'
|
|
7
7
|
| 'home'
|
|
8
8
|
| 'onboard'
|
|
9
|
+
| 'terms'
|
|
9
10
|
| 'subscription';
|
|
10
11
|
|
|
11
12
|
export interface RouteStackItem {
|
|
@@ -26,6 +27,9 @@ export interface MockOSContextValue {
|
|
|
26
27
|
navigation: (route: RouteType) => void;
|
|
27
28
|
goBack: () => boolean;
|
|
28
29
|
navigationStack: RouteStackItem[];
|
|
30
|
+
// Terms and Privacy sample: accept button proceeds only when checkbox is checked
|
|
31
|
+
termsAccepted: boolean;
|
|
32
|
+
setTermsAccepted: (value: boolean) => void;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
/**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Central event constants. Referenced via $ref in pattern.json types blocks. Run 'yarn prebuild' after changes.",
|
|
3
|
+
"eventTypes": ["Permission", "Navigate", "Placement", "SetCondition"],
|
|
4
|
+
"placementKeys": ["terms", "onboard", "paywall", "subscription", "home"],
|
|
5
|
+
"conditionKeys": ["termsAccepted"],
|
|
6
|
+
"permissionTypes": [
|
|
7
|
+
"notification",
|
|
8
|
+
"camera",
|
|
9
|
+
"microphone",
|
|
10
|
+
"location",
|
|
11
|
+
"photos",
|
|
12
|
+
"contacts",
|
|
13
|
+
"att",
|
|
14
|
+
"rating",
|
|
15
|
+
"GDPR"
|
|
16
|
+
],
|
|
17
|
+
"validationTypes": ["required", "email", "url", "min", "max"],
|
|
18
|
+
"formFieldNames": ["email", "firstName", "lastName", "phone", "birthday"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* Checkbox build-component: layout in CSS; only dynamic values (sizes, colors) inline. */
|
|
2
|
+
|
|
3
|
+
.rb-checkbox {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.rb-checkbox__box {
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
margin-top: 2px;
|
|
14
|
+
transition: all 0.2s;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rb-checkbox__label {
|
|
18
|
+
flex: 1;
|
|
19
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/* Page transition animations for GlobalProvider (platform-style names). */
|
|
2
|
+
$page-transition-duration: 0.3s;
|
|
3
|
+
$page-transition-easing: cubic-bezier(0.32, 0.72, 0, 1);
|
|
4
|
+
|
|
5
|
+
.global-provider-page {
|
|
6
|
+
flex: 1;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
height: 100%;
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.global-provider-page--none {
|
|
14
|
+
animation: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.global-provider-page--default {
|
|
18
|
+
animation: global-provider-fade $page-transition-duration $page-transition-easing;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.global-provider-page--fade {
|
|
22
|
+
animation: global-provider-fade $page-transition-duration $page-transition-easing;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@keyframes global-provider-fade {
|
|
26
|
+
from {
|
|
27
|
+
opacity: 0;
|
|
28
|
+
}
|
|
29
|
+
to {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.global-provider-page--fade_from_bottom {
|
|
35
|
+
animation: global-provider-fade-from-bottom $page-transition-duration $page-transition-easing;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@keyframes global-provider-fade-from-bottom {
|
|
39
|
+
from {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: translateY(24px);
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
transform: translateY(0);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.global-provider-page--fade_from_right {
|
|
50
|
+
animation: global-provider-fade-from-right $page-transition-duration $page-transition-easing;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes global-provider-fade-from-right {
|
|
54
|
+
from {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
transform: translateX(24px);
|
|
57
|
+
}
|
|
58
|
+
to {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
transform: translateX(0);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.global-provider-page--reveal_from_bottom {
|
|
65
|
+
animation: global-provider-reveal-from-bottom $page-transition-duration $page-transition-easing;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes global-provider-reveal-from-bottom {
|
|
69
|
+
from {
|
|
70
|
+
opacity: 0;
|
|
71
|
+
transform: translateY(100%);
|
|
72
|
+
}
|
|
73
|
+
to {
|
|
74
|
+
opacity: 1;
|
|
75
|
+
transform: translateY(0);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.global-provider-page--scale_from_center {
|
|
80
|
+
animation: global-provider-scale-from-center $page-transition-duration $page-transition-easing;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes global-provider-scale-from-center {
|
|
84
|
+
from {
|
|
85
|
+
opacity: 0;
|
|
86
|
+
transform: scale(0.95);
|
|
87
|
+
}
|
|
88
|
+
to {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
transform: scale(1);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.global-provider-page--slide_from_right {
|
|
95
|
+
animation: global-provider-slide-from-right $page-transition-duration $page-transition-easing;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@keyframes global-provider-slide-from-right {
|
|
99
|
+
from {
|
|
100
|
+
transform: translateX(100%);
|
|
101
|
+
}
|
|
102
|
+
to {
|
|
103
|
+
transform: translateX(0);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.global-provider-page--slide_from_left {
|
|
108
|
+
animation: global-provider-slide-from-left $page-transition-duration $page-transition-easing;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@keyframes global-provider-slide-from-left {
|
|
112
|
+
from {
|
|
113
|
+
transform: translateX(-100%);
|
|
114
|
+
}
|
|
115
|
+
to {
|
|
116
|
+
transform: translateX(0);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.global-provider-page--slide_from_bottom {
|
|
121
|
+
animation: global-provider-slide-from-bottom $page-transition-duration $page-transition-easing;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@keyframes global-provider-slide-from-bottom {
|
|
125
|
+
from {
|
|
126
|
+
transform: translateY(100%);
|
|
127
|
+
}
|
|
128
|
+
to {
|
|
129
|
+
transform: translateY(0);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* WebView build-component: web-only layout/structure. Numeric values come from pattern defaults via CSS vars (shared with native). */
|
|
2
|
+
|
|
3
|
+
.rb-webview {
|
|
4
|
+
position: relative;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.rb-webview__overlay {
|
|
9
|
+
position: absolute;
|
|
10
|
+
inset: 0;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.rb-webview__loader {
|
|
18
|
+
width: var(--rb-webview-loader-size, 30px);
|
|
19
|
+
height: var(--rb-webview-loader-size, 30px);
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
border: var(--rb-webview-loader-border-width, 3px) solid transparent;
|
|
22
|
+
border-top-color: currentColor;
|
|
23
|
+
animation: rb-webview-spin var(--rb-webview-loader-duration, 1s) linear infinite;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@keyframes rb-webview-spin {
|
|
27
|
+
0% {
|
|
28
|
+
transform: rotate(0deg);
|
|
29
|
+
}
|
|
30
|
+
100% {
|
|
31
|
+
transform: rotate(360deg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.rb-webview__frame-wrapper {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
position: relative;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.rb-webview__frame-inner {
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-height: 0;
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.rb-webview__frame {
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: 100%;
|
|
50
|
+
border: none;
|
|
51
|
+
transition: opacity 0.3s ease-in-out;
|
|
52
|
+
}
|
package/src/styles/index.scss
CHANGED
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
@use './components/mockos-router';
|
|
17
17
|
@use './components/bottom-bar';
|
|
18
18
|
@use './components/onboard';
|
|
19
|
+
@use './components/global-provider';
|
|
20
|
+
|
|
21
|
+
@use './components/webview';
|
|
22
|
+
@use './components/checkbox';
|
|
19
23
|
|
|
20
24
|
@use './modals/modal-shell';
|
|
21
25
|
@use './modals/add-component';
|
|
@@ -57,6 +57,12 @@ export type LocalizationKey =
|
|
|
57
57
|
| 'base.builder.paywall.footer.description'
|
|
58
58
|
| 'base.builder.paywall.btnPrivacy'
|
|
59
59
|
| 'base.builder.paywall.btnTerms'
|
|
60
|
+
// terms and privacy
|
|
61
|
+
| 'view.terms.header.title'
|
|
62
|
+
| 'view.terms.accept.button'
|
|
63
|
+
| 'view.terms.checkbox.label'
|
|
64
|
+
| 'view.terms.error.must_accept'
|
|
65
|
+
| 'form.error.validation_required'
|
|
60
66
|
| (string & {});
|
|
61
67
|
|
|
62
68
|
export type Localication = Record<
|
|
@@ -138,6 +144,12 @@ export const defaultLocalization: Localication = {
|
|
|
138
144
|
'By clicking continue, you will be accepting the Terms of service and privacy policy',
|
|
139
145
|
'base.builder.paywall.btnPrivacy': 'Privacy Policy',
|
|
140
146
|
'base.builder.paywall.btnTerms': 'Terms of Service',
|
|
147
|
+
// terms and privacy
|
|
148
|
+
'view.terms.header.title': 'Terms & Privacy',
|
|
149
|
+
'view.terms.accept.button': 'Accept',
|
|
150
|
+
'view.terms.checkbox.label': 'I accept the terms and privacy policy',
|
|
151
|
+
'view.terms.error.must_accept': 'You must accept to continue',
|
|
152
|
+
'form.error.validation_required': 'Please complete the required fields.',
|
|
141
153
|
},
|
|
142
154
|
tr: {
|
|
143
155
|
// paywall – period
|
|
@@ -181,6 +193,13 @@ export const defaultLocalization: Localication = {
|
|
|
181
193
|
'Devam et butonuna tıklayarak Hizmet Şartları ve Gizlilik Politikası kabul etmiş olursunuz',
|
|
182
194
|
'base.builder.paywall.btnPrivacy': 'Gizlilik Politikası',
|
|
183
195
|
'base.builder.paywall.btnTerms': 'Hizmet Şartları',
|
|
196
|
+
|
|
197
|
+
// terms and privacy
|
|
198
|
+
'view.terms.header.title': 'Gizlilik ve Hizmet Şartları',
|
|
199
|
+
'view.terms.accept.button': 'Kabul Et',
|
|
200
|
+
'view.terms.checkbox.label': 'Gizlilik ve Hizmet Şartlarını kabul ediyorum',
|
|
201
|
+
'view.terms.error.must_accept': 'Kabul etmeden geçiş yapılamaz',
|
|
202
|
+
'form.error.validation_required': 'Lütfen zorunlu alanları tamamlayın.',
|
|
184
203
|
},
|
|
185
204
|
};
|
|
186
205
|
|
|
@@ -432,12 +432,15 @@ function validateAttributesByPattern(
|
|
|
432
432
|
if (
|
|
433
433
|
attrName === 'title' ||
|
|
434
434
|
attrName === 'description' ||
|
|
435
|
-
attrName === 'testID'
|
|
435
|
+
attrName === 'testID' ||
|
|
436
|
+
attrName === 'animation'
|
|
436
437
|
) {
|
|
437
438
|
const res = validateAttributeValue(
|
|
438
439
|
pattern.pattern.type,
|
|
439
440
|
attrValue,
|
|
440
|
-
attrName === 'testID'
|
|
441
|
+
attrName === 'testID' || attrName === 'animation'
|
|
442
|
+
? 'string'
|
|
443
|
+
: attrName,
|
|
441
444
|
joinPath(path, attrName),
|
|
442
445
|
);
|
|
443
446
|
if (!res.valid) return res;
|
package/src/utils/nodeTree.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Node, NodeData } from '../types/Node';
|
|
2
|
+
import eventConstants from '../patterns/event-constants.json';
|
|
2
3
|
|
|
3
4
|
export function deleteNodeFromTree(root: Node, target: Node): Node {
|
|
4
5
|
if (root === null || root === undefined) return root;
|
|
@@ -97,3 +98,117 @@ export function findNodeByKey(root: Node, key?: string): Node | null {
|
|
|
97
98
|
|
|
98
99
|
return null;
|
|
99
100
|
}
|
|
101
|
+
|
|
102
|
+
export type ProjectOptions = {
|
|
103
|
+
pageKeys: string[];
|
|
104
|
+
conditionKeys: string[];
|
|
105
|
+
placementKeys: string[];
|
|
106
|
+
formFieldNames: string[];
|
|
107
|
+
eventTypes: string[];
|
|
108
|
+
validationTypes: string[];
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Traverses the entire node tree to dynamically discover project-level metadata
|
|
113
|
+
* (page keys, condition keys, form field names, etc.) and merges them with
|
|
114
|
+
* central constants from event-constants.json.
|
|
115
|
+
*
|
|
116
|
+
* This enables the Attributes Editor to provide a complete list of valid options
|
|
117
|
+
* for dropdown fields, combining predefined standards with actually used keys
|
|
118
|
+
* in the current design.
|
|
119
|
+
*/
|
|
120
|
+
export function collectProjectMetadata(root: Node): ProjectOptions {
|
|
121
|
+
const pageKeys = new Set<string>();
|
|
122
|
+
const conditionKeys = new Set<string>();
|
|
123
|
+
const placementKeys = new Set<string>();
|
|
124
|
+
const formFieldNames = new Set<string>();
|
|
125
|
+
const eventTypes = new Set<string>();
|
|
126
|
+
|
|
127
|
+
function traverse(node: Node) {
|
|
128
|
+
if (!node || typeof node === 'string') return;
|
|
129
|
+
|
|
130
|
+
if (Array.isArray(node)) {
|
|
131
|
+
node.forEach(traverse);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const data = node as NodeData;
|
|
136
|
+
const type = data.type;
|
|
137
|
+
const attrs = (data.attributes ?? {}) as Record<string, any>;
|
|
138
|
+
|
|
139
|
+
// Collect Page Keys
|
|
140
|
+
if (type === 'GlobalProvider' && Array.isArray(data.children)) {
|
|
141
|
+
data.children.forEach((child) => {
|
|
142
|
+
if (typeof child === 'object' && child !== null && 'key' in child) {
|
|
143
|
+
if (typeof child.key === 'string') pageKeys.add(child.key);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (attrs.pageKey && typeof attrs.pageKey === 'string') {
|
|
148
|
+
pageKeys.add(attrs.pageKey);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Collect Condition Keys
|
|
152
|
+
if (attrs.conditionKey && typeof attrs.conditionKey === 'string') {
|
|
153
|
+
conditionKeys.add(attrs.conditionKey);
|
|
154
|
+
}
|
|
155
|
+
if (Array.isArray(attrs.skipConditions)) {
|
|
156
|
+
attrs.skipConditions.forEach((entry: any) => {
|
|
157
|
+
if (entry?.conditionKey) conditionKeys.add(entry.conditionKey);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Collect Placement Keys
|
|
162
|
+
if (attrs.placementKey && typeof attrs.placementKey === 'string') {
|
|
163
|
+
placementKeys.add(attrs.placementKey);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Collect Form Field Names
|
|
167
|
+
if (type.startsWith('Form') && type !== 'FormProvider' && attrs.name) {
|
|
168
|
+
if (typeof attrs.name === 'string') formFieldNames.add(attrs.name);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Collect from events
|
|
172
|
+
if (Array.isArray(attrs.events)) {
|
|
173
|
+
attrs.events.forEach((evt: any) => {
|
|
174
|
+
if (evt.type && typeof evt.type === 'string') eventTypes.add(evt.type);
|
|
175
|
+
if (evt.navigate_to) pageKeys.add(evt.navigate_to);
|
|
176
|
+
if (evt.placementKey) placementKeys.add(evt.placementKey);
|
|
177
|
+
if (evt.conditionKey) conditionKeys.add(evt.conditionKey);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (data.children) {
|
|
182
|
+
traverse(data.children as Node);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
traverse(root);
|
|
187
|
+
|
|
188
|
+
// Merge with central constants for a complete set of options
|
|
189
|
+
const result: ProjectOptions = {
|
|
190
|
+
pageKeys: Array.from(
|
|
191
|
+
new Set([...pageKeys, ...eventConstants.placementKeys]),
|
|
192
|
+
).sort(),
|
|
193
|
+
conditionKeys: Array.from(
|
|
194
|
+
new Set([...conditionKeys, ...eventConstants.conditionKeys]),
|
|
195
|
+
).sort(),
|
|
196
|
+
placementKeys: Array.from(
|
|
197
|
+
new Set([...placementKeys, ...eventConstants.placementKeys]),
|
|
198
|
+
).sort(),
|
|
199
|
+
formFieldNames: Array.from(
|
|
200
|
+
new Set([
|
|
201
|
+
...formFieldNames,
|
|
202
|
+
...((eventConstants as any).formFieldNames as string[]),
|
|
203
|
+
]),
|
|
204
|
+
).sort(),
|
|
205
|
+
eventTypes: Array.from(
|
|
206
|
+
new Set([...eventTypes, ...eventConstants.eventTypes]),
|
|
207
|
+
).sort(),
|
|
208
|
+
validationTypes: Array.from(
|
|
209
|
+
new Set((eventConstants as any).validationTypes as string[]),
|
|
210
|
+
).sort(),
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
return result;
|
|
214
|
+
}
|
|
@@ -27,6 +27,8 @@ export const defaultProjectColors: ProjectColors = {
|
|
|
27
27
|
ONBOARD_SUBTITLE: '#44454D',
|
|
28
28
|
ONBOARD_BUTTON_SECONDARY_TEXT: '#81838F',
|
|
29
29
|
ONBOARD_FOOTER_TEXT: '#81838F',
|
|
30
|
+
CHECKBOX_ACTIVE_COLOR: '#0066FF',
|
|
31
|
+
FORM_ERROR_TEXT_COLOR: '#B91C1C',
|
|
30
32
|
},
|
|
31
33
|
dark: {
|
|
32
34
|
TEXT: '#E9EBF9',
|
|
@@ -37,6 +39,8 @@ export const defaultProjectColors: ProjectColors = {
|
|
|
37
39
|
ONBOARD_SUBTITLE: '#C7C7C7',
|
|
38
40
|
ONBOARD_BUTTON_SECONDARY_TEXT: '#A9AAAC',
|
|
39
41
|
ONBOARD_FOOTER_TEXT: '#A2A4B1',
|
|
42
|
+
CHECKBOX_ACTIVE_COLOR: '#0066FF',
|
|
43
|
+
FORM_ERROR_TEXT_COLOR: '#B91C1C',
|
|
40
44
|
},
|
|
41
45
|
},
|
|
42
46
|
};
|
package/src/.DS_Store
DELETED
|
Binary file
|
package/src/assets/.DS_Store
DELETED
|
Binary file
|