@developer_tribe/react-builder 1.0.1 → 1.0.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/DeviceMockFrame.d.ts +2 -1
- package/dist/RenderPage.d.ts +4 -3
- package/dist/attributes-editor/Field.d.ts +16 -0
- package/dist/attributes-editor/FieldInfoTooltip.d.ts +7 -0
- package/dist/attributes-editor/LayoutPreviewPicker.d.ts +12 -0
- package/dist/attributes-editor/SpecialCategorySection.d.ts +19 -0
- package/dist/attributes-editor/types.d.ts +14 -0
- package/dist/background.jpg +0 -0
- package/dist/build-components/Button/Button.d.ts +1 -1
- package/dist/build-components/Button/ButtonProps.generated.d.ts +26 -1
- package/dist/build-components/Carousel/CarouselProps.generated.d.ts +27 -1
- package/dist/build-components/CarouselButtons/CarouselButtonsProps.generated.d.ts +25 -0
- package/dist/build-components/CarouselDots/CarouselDotsProps.generated.d.ts +25 -0
- package/dist/build-components/CarouselItem/CarouselItemProps.generated.d.ts +27 -1
- package/dist/build-components/CarouselProvider/CarouselProviderProps.generated.d.ts +27 -1
- package/dist/build-components/Image/ImageProps.generated.d.ts +25 -3
- package/dist/build-components/Onboard/OnboardProps.generated.d.ts +27 -1
- package/dist/build-components/OnboardButton/OnboardButtonProps.generated.d.ts +25 -0
- package/dist/build-components/OnboardButtons/OnboardButtonsProps.generated.d.ts +25 -0
- package/dist/build-components/OnboardDot/OnboardDot.d.ts +1 -1
- package/dist/build-components/OnboardDot/OnboardDotProps.generated.d.ts +22 -0
- package/dist/build-components/OnboardFooter/OnboardFooterProps.generated.d.ts +4 -5
- package/dist/build-components/OnboardImage/OnboardImageProps.generated.d.ts +25 -3
- package/dist/build-components/OnboardItem/OnboardItemProps.generated.d.ts +24 -3
- package/dist/build-components/OnboardProvider/OnboardProviderProps.generated.d.ts +25 -4
- package/dist/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.d.ts +4 -5
- package/dist/build-components/OnboardTitle/OnboardTitleProps.generated.d.ts +4 -5
- package/dist/build-components/Text/TextProps.generated.d.ts +4 -5
- package/dist/build-components/View/ViewProps.generated.d.ts +3 -4
- package/dist/build-components/patterns.generated.d.ts +4855 -132
- package/dist/components/Breadcrumb.d.ts +3 -1
- package/dist/components/Checkbox.d.ts +17 -0
- package/dist/components/DeviceButton.d.ts +8 -0
- package/dist/components/DeviceNavigationBar.d.ts +10 -0
- package/dist/components/DeviceStatusBar.d.ts +9 -0
- package/dist/components/EditorHeader.d.ts +3 -8
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/mockOS/components/MockLaunchScreenComponent.d.ts +6 -0
- package/dist/mockOS/components/MockOSRouter.d.ts +8 -0
- package/dist/mockOS/components/PermissionModal.d.ts +9 -0
- package/dist/mockOS/context/MockOSContext.d.ts +36 -0
- package/dist/mockOS/hooks/useMockNavigation.d.ts +3 -0
- package/dist/mockOS/hooks/useMockPermission.d.ts +3 -0
- package/dist/mockOS/index.d.ts +9 -0
- package/dist/mockOS/managers/mockPermissionManager.d.ts +10 -0
- package/dist/mockOS/managers/navigationManager.d.ts +17 -0
- package/dist/modals/AddComponentModal.d.ts +8 -0
- package/dist/modals/ColorModal.d.ts +9 -0
- package/dist/modals/DeviceSelectorModal.d.ts +9 -0
- package/dist/modals/LocalicationModal.d.ts +8 -0
- package/dist/modals/Modal.d.ts +12 -0
- package/dist/modals/index.d.ts +5 -0
- package/dist/pages/ProjectPage.d.ts +1 -1
- package/dist/store.d.ts +0 -2
- package/dist/styles.css +1 -1
- package/dist/utils/patterns.d.ts +24 -0
- package/package.json +2 -1
- package/scripts/prebuild/utils/createGeneratedProps.js +11 -3
- package/scripts/prebuild/utils/validateAllComponentsOrThrow.js +45 -6
- package/scripts/prebuild/utils/validatePatternJson.js +13 -5
- package/src/AttributesEditor.tsx +433 -312
- package/src/DeviceMockFrame.tsx +21 -37
- package/src/RenderPage.tsx +5 -4
- package/src/assets/images/android.svg +42 -42
- package/src/assets/images/apple.svg +15 -15
- package/src/attributes-editor/Field.tsx +662 -0
- package/src/attributes-editor/FieldInfoTooltip.tsx +49 -0
- package/src/attributes-editor/LayoutPreviewPicker.tsx +199 -0
- package/src/attributes-editor/SpecialCategorySection.tsx +284 -0
- package/src/attributes-editor/types.ts +30 -0
- package/src/build-components/Button/Button.tsx +10 -2
- package/src/build-components/Button/ButtonProps.generated.ts +37 -1
- package/src/build-components/Button/pattern.json +31 -2
- package/src/build-components/Carousel/Carousel.tsx +15 -2
- package/src/build-components/Carousel/CarouselProps.generated.ts +39 -1
- package/src/build-components/Carousel/pattern.json +10 -0
- package/src/build-components/CarouselButtons/CarouselButtons.tsx +6 -2
- package/src/build-components/CarouselButtons/CarouselButtonsProps.generated.ts +36 -0
- package/src/build-components/CarouselButtons/pattern.json +22 -0
- package/src/build-components/CarouselDots/CarouselDots.tsx +40 -8
- package/src/build-components/CarouselDots/CarouselDotsProps.generated.ts +36 -0
- package/src/build-components/CarouselDots/pattern.json +15 -0
- package/src/build-components/CarouselItem/CarouselItem.tsx +5 -2
- package/src/build-components/CarouselItem/CarouselItemProps.generated.ts +39 -1
- package/src/build-components/CarouselItem/pattern.json +7 -0
- package/src/build-components/CarouselProvider/CarouselProvider.tsx +10 -2
- package/src/build-components/CarouselProvider/CarouselProviderProps.generated.ts +39 -1
- package/src/build-components/CarouselProvider/pattern.json +7 -0
- package/src/build-components/Image/Image.tsx +8 -2
- package/src/build-components/Image/ImageProps.generated.ts +36 -3
- package/src/build-components/Image/pattern.json +46 -3
- package/src/build-components/Onboard/Onboard.tsx +6 -1
- package/src/build-components/Onboard/OnboardProps.generated.ts +39 -1
- package/src/build-components/Onboard/pattern.json +11 -0
- package/src/build-components/OnboardButton/OnboardButton.tsx +46 -5
- package/src/build-components/OnboardButton/OnboardButtonProps.generated.ts +36 -0
- package/src/build-components/OnboardButton/pattern.json +71 -5
- package/src/build-components/OnboardButtons/OnboardButtons.tsx +20 -10
- package/src/build-components/OnboardButtons/OnboardButtonsProps.generated.ts +36 -0
- package/src/build-components/OnboardButtons/pattern.json +70 -4
- package/src/build-components/OnboardDot/OnboardDot.tsx +104 -4
- package/src/build-components/OnboardDot/OnboardDotProps.generated.ts +22 -0
- package/src/build-components/OnboardDot/pattern.json +54 -1
- package/src/build-components/OnboardFooter/OnboardFooter.tsx +9 -3
- package/src/build-components/OnboardFooter/OnboardFooterProps.generated.ts +4 -5
- package/src/build-components/OnboardFooter/pattern.json +58 -2
- package/src/build-components/OnboardImage/OnboardImage.tsx +27 -5
- package/src/build-components/OnboardImage/OnboardImageProps.generated.ts +36 -3
- package/src/build-components/OnboardImage/pattern.json +21 -0
- package/src/build-components/OnboardItem/OnboardItem.tsx +6 -1
- package/src/build-components/OnboardItem/OnboardItemProps.generated.ts +35 -3
- package/src/build-components/OnboardItem/pattern.json +38 -2
- package/src/build-components/OnboardProvider/OnboardProvider.tsx +20 -8
- package/src/build-components/OnboardProvider/OnboardProviderProps.generated.ts +37 -4
- package/src/build-components/OnboardProvider/pattern.json +51 -4
- package/src/build-components/OnboardSubtitle/OnboardSubtitleProps.generated.ts +4 -5
- package/src/build-components/OnboardSubtitle/pattern.json +6 -0
- package/src/build-components/OnboardTitle/OnboardTitleProps.generated.ts +4 -5
- package/src/build-components/OnboardTitle/pattern.json +6 -0
- package/src/build-components/Text/Text.tsx +7 -3
- package/src/build-components/Text/TextProps.generated.ts +4 -5
- package/src/build-components/Text/pattern.json +38 -2
- package/src/build-components/View/View.tsx +9 -6
- package/src/build-components/View/ViewProps.generated.ts +3 -4
- package/src/build-components/View/pattern.json +227 -19
- package/src/build-components/patterns.generated.ts +4905 -139
- package/src/components/AttributesEditorPanel.tsx +7 -61
- package/src/components/Breadcrumb.tsx +37 -5
- package/src/components/Builder.tsx +180 -77
- package/src/components/Checkbox.tsx +81 -0
- package/src/components/DeviceButton.tsx +39 -0
- package/src/components/DeviceNavigationBar.tsx +201 -0
- package/src/components/DeviceStatusBar.tsx +85 -0
- package/src/components/EditorHeader.tsx +26 -74
- package/src/mockOS/components/MockLaunchScreenComponent.tsx +43 -0
- package/src/mockOS/components/MockOSRouter.tsx +115 -0
- package/src/mockOS/components/PermissionModal.tsx +270 -0
- package/src/mockOS/context/MockOSContext.tsx +179 -0
- package/src/mockOS/hooks/useMockNavigation.ts +11 -0
- package/src/mockOS/hooks/useMockPermission.ts +11 -0
- package/src/mockOS/index.ts +26 -0
- package/src/mockOS/managers/mockPermissionManager.ts +54 -0
- package/src/mockOS/managers/navigationManager.ts +91 -0
- package/src/modals/AddComponentModal.tsx +313 -0
- package/src/modals/ColorModal.tsx +268 -0
- package/src/modals/DeviceSelectorModal.tsx +57 -0
- package/src/modals/LocalicationModal.tsx +54 -0
- package/src/modals/Modal.tsx +57 -0
- package/src/modals/index.ts +5 -0
- package/src/pages/ProjectPage.tsx +19 -21
- package/src/pages/tabs/DebugTab.tsx +50 -9
- package/src/pages/tabs/PreviewTab.tsx +52 -40
- package/src/size-matters/index.ts +21 -5
- package/src/store.ts +0 -4
- package/src/styles/{global.scss → base/_global.scss} +92 -39
- package/src/styles/components/_attributes-editor.scss +261 -0
- package/src/styles/{editor.scss → components/_editor-shell.scss} +72 -57
- package/src/styles/components/_mockos-router.scss +140 -0
- package/src/styles/components/_ui-components.scss +183 -0
- package/src/styles/foundation/_colors.scss +8 -0
- package/src/styles/{_mixins.scss → foundation/_mixins.scss} +5 -4
- package/src/styles/{_reset.scss → foundation/_reset.scss} +5 -2
- package/src/styles/foundation/_sizes.scss +37 -0
- package/src/styles/foundation/_typography.scss +4 -0
- package/src/styles/foundation/_variables.scss +3 -0
- package/src/styles/index.scss +22 -136
- package/src/styles/layout/_builder.scss +68 -0
- package/src/styles/layout/_pages.scss +3 -0
- package/src/styles/modals/_add-component.scss +122 -0
- package/src/styles/modals/_color-modal.scss +130 -0
- package/src/styles/modals/_device-selector.scss +18 -0
- package/src/styles/modals/_localication-modal.scss +68 -0
- package/src/styles/modals/_modal-shell.scss +46 -0
- package/src/styles/utilities/_carousel.scss +125 -0
- package/src/types/images.d.ts +8 -0
- package/src/utils/extractTextStyle.ts +4 -2
- package/src/utils/extractViewStyle.ts +51 -7
- package/src/utils/patterns.ts +33 -0
- package/dist/build-components/OnboardDot/OnboardExpandingDotProps.generated.d.ts +0 -10
- package/src/build-components/OnboardDot/OnboardExpandingDotProps.generated.ts +0 -20
- package/src/styles/_variables.scss +0 -27
- package/src/styles/builder.scss +0 -60
- package/src/styles/components.scss +0 -88
- package/src/styles/pages.scss +0 -2
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
@use '../foundation/colors' as colors;
|
|
2
|
+
@use '../foundation/sizes' as sizes;
|
|
3
|
+
|
|
4
|
+
.color-modal {
|
|
5
|
+
width: min(520px, calc(100vw - 32px));
|
|
6
|
+
max-height: 90vh;
|
|
7
|
+
padding: sizes.$spaceRoomy;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: sizes.$spaceComfy;
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.color-modal__selected {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
background: colors.$canvasColor;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
padding: sizes.$spaceCozy sizes.$spaceComfy;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.color-modal__selected-info {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 12px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.color-modal__selected-preview {
|
|
30
|
+
width: 32px;
|
|
31
|
+
height: 32px;
|
|
32
|
+
border-radius: 6px;
|
|
33
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.color-modal__selected-label {
|
|
37
|
+
margin: 0;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
color: colors.$mutedTextColor;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.color-modal__selected-value {
|
|
43
|
+
margin: 0;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.color-modal__link-button {
|
|
48
|
+
border: none;
|
|
49
|
+
background: none;
|
|
50
|
+
color: colors.$accentColor;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
font-size: 13px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
padding: 4px 8px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.color-section {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: sizes.$spaceCompact;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.color-section__header {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: space-between;
|
|
67
|
+
gap: 8px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.color-section__title {
|
|
71
|
+
margin: 0;
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.color-section__swatches {
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
|
|
78
|
+
gap: sizes.$spaceCompact;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.color-section__empty {
|
|
82
|
+
margin: 0;
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
color: colors.$mutedTextColor;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.color-modal__swatch {
|
|
88
|
+
border: 1px solid colors.$borderColor;
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
padding: 8px;
|
|
91
|
+
background: colors.$surfaceColor;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
gap: 6px;
|
|
95
|
+
text-align: left;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
transition:
|
|
98
|
+
border-color 0.2s ease,
|
|
99
|
+
box-shadow 0.2s ease;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.color-modal__swatch--active {
|
|
103
|
+
border-color: colors.$textColor;
|
|
104
|
+
box-shadow: 0 0 0 1px colors.$textColor inset;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.color-modal__swatch-preview {
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 32px;
|
|
110
|
+
border-radius: 6px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.color-modal__swatch-preview--light {
|
|
114
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.color-modal__swatch-label {
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
font-weight: 600;
|
|
120
|
+
color: colors.$textColor;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.color-modal__swatch-value {
|
|
124
|
+
font-size: 11px;
|
|
125
|
+
color: colors.$mutedTextColor;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.color-modal__input {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@use '../foundation/sizes' as sizes;
|
|
2
|
+
|
|
3
|
+
.device-selector-modal {
|
|
4
|
+
padding-bottom: sizes.$spaceRoomy;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.device-selector-modal__grid {
|
|
8
|
+
padding: sizes.$spaceRoomy;
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
11
|
+
gap: sizes.$spaceCozy;
|
|
12
|
+
overflow: auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.device-selector-modal__grid .editor-device-button {
|
|
16
|
+
height: 80px;
|
|
17
|
+
min-width: unset;
|
|
18
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@use '../foundation/colors' as colors;
|
|
2
|
+
@use '../foundation/sizes' as sizes;
|
|
3
|
+
|
|
4
|
+
.localication-modal__content {
|
|
5
|
+
width: calc(100vw - 32px);
|
|
6
|
+
height: calc(100vh - 32px);
|
|
7
|
+
max-width: 1600px;
|
|
8
|
+
max-height: calc(100vh - 32px);
|
|
9
|
+
padding: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.localication-modal__header {
|
|
15
|
+
padding: sizes.$spaceComfy sizes.$spaceRoomy;
|
|
16
|
+
border-bottom: 1px solid colors.$borderColor;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 16px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.localication-modal__header-main {
|
|
23
|
+
flex: 1;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 4px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.localication-modal__description {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
color: colors.$mutedTextColor;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.localication-modal__body {
|
|
36
|
+
flex: 1;
|
|
37
|
+
min-height: 0;
|
|
38
|
+
padding: sizes.$spaceRoomy;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: sizes.$spaceComfy;
|
|
42
|
+
overflow: auto;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.localication-modal__editor {
|
|
46
|
+
flex: 1;
|
|
47
|
+
min-height: 0;
|
|
48
|
+
overflow: auto;
|
|
49
|
+
border: 1px solid colors.$borderColor;
|
|
50
|
+
border-radius: sizes.$radiusRounded;
|
|
51
|
+
background: colors.$canvasColor;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.localication-modal__json-editor {
|
|
55
|
+
height: 100%;
|
|
56
|
+
width: 100%;
|
|
57
|
+
display: block;
|
|
58
|
+
padding: sizes.$spaceCozy;
|
|
59
|
+
overflow: auto;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.modal--scrollable .localication-modal__content {
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.modal--scrollable .localication-modal__body {
|
|
67
|
+
overflow: auto;
|
|
68
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '../foundation/colors' as colors;
|
|
2
|
+
@use '../foundation/sizes' as sizes;
|
|
3
|
+
|
|
4
|
+
.modal {
|
|
5
|
+
position: fixed;
|
|
6
|
+
inset: 0;
|
|
7
|
+
z-index: 10000;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.modal__overlay {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: 0;
|
|
13
|
+
background: rgba(0, 0, 0, 0.4);
|
|
14
|
+
z-index: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.modal__content {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 50%;
|
|
20
|
+
left: 50%;
|
|
21
|
+
transform: translate(-50%, -50%);
|
|
22
|
+
background: colors.$surfaceColor;
|
|
23
|
+
border-radius: sizes.$radiusPill;
|
|
24
|
+
box-shadow: sizes.$cardShadow;
|
|
25
|
+
width: min(960px, calc(100vw - 40px));
|
|
26
|
+
max-height: calc(100vh - 120px);
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
z-index: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.modal__header {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
padding: sizes.$spaceComfy sizes.$spaceRoomy;
|
|
38
|
+
border-bottom: 1px solid colors.$borderColor;
|
|
39
|
+
gap: 12px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.modal__title {
|
|
43
|
+
margin: 0;
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* Embla carousel utilities stay isolated from builder core styles. */
|
|
2
|
+
.embla {
|
|
3
|
+
max-width: 48rem;
|
|
4
|
+
margin: auto;
|
|
5
|
+
--slide-height: 19rem;
|
|
6
|
+
--slide-spacing: 1rem;
|
|
7
|
+
--slide-size: 70%;
|
|
8
|
+
}
|
|
9
|
+
.embla__viewport {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
.embla__container {
|
|
13
|
+
display: flex;
|
|
14
|
+
touch-action: pan-y pinch-zoom;
|
|
15
|
+
margin-left: calc(var(--slide-spacing) * -1);
|
|
16
|
+
}
|
|
17
|
+
.embla__slide {
|
|
18
|
+
transform: translate3d(0, 0, 0);
|
|
19
|
+
min-width: 0;
|
|
20
|
+
padding-left: var(--slide-spacing);
|
|
21
|
+
flex: 0 0 100%;
|
|
22
|
+
}
|
|
23
|
+
.embla__slide__number {
|
|
24
|
+
box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
|
|
25
|
+
border-radius: 1.8rem;
|
|
26
|
+
font-size: 4rem;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
height: var(--slide-height);
|
|
32
|
+
user-select: none;
|
|
33
|
+
}
|
|
34
|
+
.embla__controls {
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-columns: auto 1fr;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
gap: 1.2rem;
|
|
39
|
+
margin-top: 1.8rem;
|
|
40
|
+
}
|
|
41
|
+
.embla__buttons {
|
|
42
|
+
display: grid;
|
|
43
|
+
grid-template-columns: repeat(2, 1fr);
|
|
44
|
+
gap: 0.6rem;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
.embla__button {
|
|
48
|
+
-webkit-tap-highlight-color: rgba(var(--text-high-contrast-rgb-value), 0.5);
|
|
49
|
+
-webkit-appearance: none;
|
|
50
|
+
appearance: none;
|
|
51
|
+
background-color: transparent;
|
|
52
|
+
touch-action: manipulation;
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
border: 0;
|
|
57
|
+
padding: 0;
|
|
58
|
+
margin: 0;
|
|
59
|
+
box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
|
|
60
|
+
width: 3.6rem;
|
|
61
|
+
height: 3.6rem;
|
|
62
|
+
z-index: 1;
|
|
63
|
+
border-radius: 50%;
|
|
64
|
+
color: var(--text-body);
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
}
|
|
69
|
+
.embla__button:disabled {
|
|
70
|
+
color: var(--detail-high-contrast);
|
|
71
|
+
}
|
|
72
|
+
.embla__button__svg {
|
|
73
|
+
width: 35%;
|
|
74
|
+
height: 35%;
|
|
75
|
+
}
|
|
76
|
+
.embla__dots {
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
margin-right: 0;
|
|
79
|
+
height: 50px;
|
|
80
|
+
margin: 0 auto;
|
|
81
|
+
}
|
|
82
|
+
.embla__dot {
|
|
83
|
+
-webkit-tap-highlight-color: rgba(var(--text-high-contrast-rgb-value), 0.5);
|
|
84
|
+
-webkit-appearance: none;
|
|
85
|
+
appearance: none;
|
|
86
|
+
background-color: transparent;
|
|
87
|
+
touch-action: manipulation;
|
|
88
|
+
display: inline-flex;
|
|
89
|
+
text-decoration: none;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
border: 0;
|
|
92
|
+
padding: 0;
|
|
93
|
+
margin: 0;
|
|
94
|
+
width: 2.6rem;
|
|
95
|
+
height: 2.6rem;
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
}
|
|
100
|
+
.embla__dot:after {
|
|
101
|
+
box-shadow: inset 0 0 0 0.2rem var(--detail-medium-contrast);
|
|
102
|
+
width: 1.4rem;
|
|
103
|
+
height: 1.4rem;
|
|
104
|
+
border-radius: 50%;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
content: '';
|
|
108
|
+
}
|
|
109
|
+
.embla__dot--selected:after {
|
|
110
|
+
box-shadow: inset 0 0 0 0.2rem var(--text-body);
|
|
111
|
+
}
|
|
112
|
+
.carousel-provider {
|
|
113
|
+
height: 100%;
|
|
114
|
+
}
|
|
115
|
+
.embla {
|
|
116
|
+
height: 100%;
|
|
117
|
+
}
|
|
118
|
+
.embla__viewport {
|
|
119
|
+
height: 100%;
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
}
|
|
123
|
+
.embla__container {
|
|
124
|
+
flex: 1;
|
|
125
|
+
}
|
|
@@ -50,8 +50,10 @@ export function extractTextStyle<T extends TextPropsGenerated['attributes']>(
|
|
|
50
50
|
style.paddingTop = v as React.CSSProperties['paddingTop'];
|
|
51
51
|
style.paddingBottom = v as React.CSSProperties['paddingBottom'];
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const marginHorizontalRaw = (attributes as Record<string, unknown>)
|
|
54
|
+
.marginHorizontal as string | number | undefined;
|
|
55
|
+
if (marginHorizontalRaw !== undefined) {
|
|
56
|
+
const v = parseSize(marginHorizontalRaw);
|
|
55
57
|
style.marginLeft = v as React.CSSProperties['marginLeft'];
|
|
56
58
|
style.marginRight = v as React.CSSProperties['marginRight'];
|
|
57
59
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ViewPropsGenerated } from '../build-components/View/ViewProps.generated';
|
|
2
2
|
import type { NodeData } from '../types/Node';
|
|
3
|
+
import { parseSize } from '../size-matters';
|
|
3
4
|
|
|
4
5
|
export function extractViewStyle<T extends ViewPropsGenerated['attributes']>(
|
|
5
6
|
node: NodeData<T>,
|
|
@@ -31,14 +32,57 @@ export function extractViewStyle<T extends ViewPropsGenerated['attributes']>(
|
|
|
31
32
|
if (attributes.justifyContent)
|
|
32
33
|
style.justifyContent =
|
|
33
34
|
attributes.justifyContent as React.CSSProperties['justifyContent'];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const setParsedSize = <K extends keyof React.CSSProperties>(
|
|
36
|
+
property: K,
|
|
37
|
+
rawValue: string | number | undefined,
|
|
38
|
+
) => {
|
|
39
|
+
if (rawValue === undefined) return;
|
|
40
|
+
const parsed = parseSize(rawValue);
|
|
41
|
+
style[property] = parsed as React.CSSProperties[K];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
setParsedSize('gap', attributes.gap);
|
|
45
|
+
setParsedSize('padding', attributes.padding);
|
|
46
|
+
setParsedSize('margin', attributes.margin);
|
|
47
|
+
|
|
48
|
+
if (attributes.paddingHorizontal !== undefined) {
|
|
49
|
+
const parsed = parseSize(attributes.paddingHorizontal);
|
|
50
|
+
style.paddingLeft = parsed as React.CSSProperties['paddingLeft'];
|
|
51
|
+
style.paddingRight = parsed as React.CSSProperties['paddingRight'];
|
|
52
|
+
}
|
|
53
|
+
if (attributes.paddingVertical !== undefined) {
|
|
54
|
+
const parsed = parseSize(attributes.paddingVertical);
|
|
55
|
+
style.paddingTop = parsed as React.CSSProperties['paddingTop'];
|
|
56
|
+
style.paddingBottom = parsed as React.CSSProperties['paddingBottom'];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const marginHorizontalRaw = (attributes as Record<string, unknown>)
|
|
60
|
+
.marginHorizontal as string | number | undefined;
|
|
61
|
+
if (marginHorizontalRaw !== undefined) {
|
|
62
|
+
const parsed = parseSize(marginHorizontalRaw);
|
|
63
|
+
style.marginLeft = parsed as React.CSSProperties['marginLeft'];
|
|
64
|
+
style.marginRight = parsed as React.CSSProperties['marginRight'];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (attributes.marginVertical !== undefined) {
|
|
68
|
+
const parsed = parseSize(attributes.marginVertical);
|
|
69
|
+
style.marginTop = parsed as React.CSSProperties['marginTop'];
|
|
70
|
+
style.marginBottom = parsed as React.CSSProperties['marginBottom'];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
setParsedSize('paddingTop', attributes.paddingTop);
|
|
74
|
+
setParsedSize('paddingBottom', attributes.paddingBottom);
|
|
75
|
+
setParsedSize('paddingLeft', attributes.paddingLeft);
|
|
76
|
+
setParsedSize('paddingRight', attributes.paddingRight);
|
|
77
|
+
setParsedSize('marginTop', attributes.marginTop);
|
|
78
|
+
setParsedSize('marginBottom', attributes.marginBottom);
|
|
79
|
+
setParsedSize('marginLeft', attributes.marginLeft);
|
|
80
|
+
setParsedSize('marginRight', attributes.marginRight);
|
|
81
|
+
|
|
37
82
|
if (attributes.backgroundColor)
|
|
38
83
|
style.backgroundColor = attributes.backgroundColor;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (attributes.height !== undefined) style.height = attributes.height;
|
|
84
|
+
setParsedSize('borderRadius', attributes.borderRadius);
|
|
85
|
+
setParsedSize('width', attributes.width);
|
|
86
|
+
setParsedSize('height', attributes.height);
|
|
43
87
|
return style;
|
|
44
88
|
}
|
package/src/utils/patterns.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import { patterns as generatedPatterns } from '../build-components';
|
|
2
2
|
import type { NodeDefaultAttribute } from '../types/Node';
|
|
3
3
|
|
|
4
|
+
export type AttributeMeta = {
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
category?: 'style' | 'container' | 'other' | string;
|
|
8
|
+
specialCategory?: 'padding' | 'margin' | 'offset' | null | string;
|
|
9
|
+
sort?: number;
|
|
10
|
+
preferedScale?: 's' | 'vs' | 'f' | '%' | '' | string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type SpecialCategoryMeta = {
|
|
14
|
+
label?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
category?: 'style' | 'container' | 'other' | string;
|
|
17
|
+
sort?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type PatternMeta = {
|
|
21
|
+
label?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
attributes?: Record<string, AttributeMeta>;
|
|
24
|
+
specialCategories?: Record<string, SpecialCategoryMeta>;
|
|
25
|
+
desiredParent?: string[];
|
|
26
|
+
desiredChildren?: string[];
|
|
27
|
+
};
|
|
28
|
+
|
|
4
29
|
type Pattern = {
|
|
5
30
|
schemaVersion: number;
|
|
6
31
|
allowUnknownAttributes: boolean;
|
|
@@ -17,6 +42,7 @@ type Pattern = {
|
|
|
17
42
|
// where the inner record maps fieldName -> primitive type or enum options
|
|
18
43
|
types?: Record<string, Record<string, string | string[]>>;
|
|
19
44
|
// Optional defaults to be applied to node.attributes if not provided
|
|
45
|
+
meta?: PatternMeta;
|
|
20
46
|
};
|
|
21
47
|
|
|
22
48
|
const patterns: Pattern[] = generatedPatterns as unknown as Pattern[];
|
|
@@ -38,6 +64,13 @@ export function getAttributeSchema(
|
|
|
38
64
|
return p?.pattern.attributes;
|
|
39
65
|
}
|
|
40
66
|
|
|
67
|
+
export function getAttributeMeta(
|
|
68
|
+
type?: string | null,
|
|
69
|
+
): Record<string, AttributeMeta> | undefined {
|
|
70
|
+
const p = getPatternByType(type);
|
|
71
|
+
return p?.meta?.attributes;
|
|
72
|
+
}
|
|
73
|
+
|
|
41
74
|
/** Returns defaults block (if any) for a given component type */
|
|
42
75
|
export function getDefaultsForType(
|
|
43
76
|
type?: string | null,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { NodeData } from '../../types/Node';
|
|
2
|
-
export interface OnboardDotPropsGenerated {
|
|
3
|
-
child: string;
|
|
4
|
-
attributes: {
|
|
5
|
-
dotType?: 'expanding_dot' | 'normal_dot' | 'scaling_dot' | 'sliding_border' | 'sliding_dot' | 'liquid_like';
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export interface OnboardDotComponentProps {
|
|
9
|
-
node: NodeData<OnboardDotPropsGenerated['attributes']>;
|
|
10
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* AUTO-GENERATED FILE - DO NOT EDIT */
|
|
2
|
-
|
|
3
|
-
import type { NodeData } from '../../types/Node';
|
|
4
|
-
|
|
5
|
-
export interface OnboardDotPropsGenerated {
|
|
6
|
-
child: string;
|
|
7
|
-
attributes: {
|
|
8
|
-
dotType?:
|
|
9
|
-
| 'expanding_dot'
|
|
10
|
-
| 'normal_dot'
|
|
11
|
-
| 'scaling_dot'
|
|
12
|
-
| 'sliding_border'
|
|
13
|
-
| 'sliding_dot'
|
|
14
|
-
| 'liquid_like';
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface OnboardDotComponentProps {
|
|
19
|
-
node: NodeData<OnboardDotPropsGenerated['attributes']>;
|
|
20
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Color palette
|
|
2
|
-
$color-background: #f3f4f6;
|
|
3
|
-
$color-border: #e5e7eb;
|
|
4
|
-
$color-text: #111827;
|
|
5
|
-
$color-muted: #9ca3af;
|
|
6
|
-
$color-error: #ef4444;
|
|
7
|
-
$color-button: cornflowerblue;
|
|
8
|
-
|
|
9
|
-
// Spacing
|
|
10
|
-
$space-1: 4px;
|
|
11
|
-
$space-2: 8px;
|
|
12
|
-
$space-3: 12px;
|
|
13
|
-
$space-4: 16px;
|
|
14
|
-
$space-5: 20px;
|
|
15
|
-
$space-6: 24px;
|
|
16
|
-
|
|
17
|
-
// Radius & shadow
|
|
18
|
-
$radius-xs: 4px;
|
|
19
|
-
$radius-sm: 8px;
|
|
20
|
-
$radius-md: 12px;
|
|
21
|
-
$radius-lg: 24px;
|
|
22
|
-
$shadow-card: 0 10px 30px rgba(0, 0, 0, 0.12);
|
|
23
|
-
|
|
24
|
-
// Fonts
|
|
25
|
-
$font-sans:
|
|
26
|
-
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
|
|
27
|
-
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
|
package/src/styles/builder.scss
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
@use './variables' as *;
|
|
2
|
-
@use './mixins' as *;
|
|
3
|
-
|
|
4
|
-
.builder {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: $space-3;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.builder__breadcrumbs {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: row;
|
|
13
|
-
gap: $space-2;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.builder__breadcrumb {
|
|
17
|
-
color: $color-muted;
|
|
18
|
-
font-size: 12px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.builder__current {
|
|
22
|
-
font-weight: 600;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.builder__list {
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-wrap: wrap;
|
|
28
|
-
gap: $space-2;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.builder__button {
|
|
32
|
-
@include card;
|
|
33
|
-
padding: $space-3 $space-3;
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
background: $color-button;
|
|
36
|
-
color: #fff;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.builder__node {
|
|
41
|
-
@include card;
|
|
42
|
-
padding: $space-3;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.builder__node-type {
|
|
46
|
-
margin: 0 0 $space-2 0;
|
|
47
|
-
font-weight: 600;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.builder__children {
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: column;
|
|
53
|
-
gap: $space-2;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.builder__text,
|
|
57
|
-
.builder__placeholder {
|
|
58
|
-
color: $color-muted;
|
|
59
|
-
font-size: 12px;
|
|
60
|
-
}
|