umwd-components 0.1.237 → 0.1.239
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/cjs/components/HeroSection.js +31 -2
- package/dist/cjs/components/PageBuilder.js +12 -2
- package/dist/esm/components/HeroSection.js +31 -2
- package/dist/esm/components/PageBuilder.js +12 -2
- package/package.json +1 -1
- package/src/components/HeroSection.tsx +33 -2
- package/src/components/PageBuilder.tsx +11 -0
|
@@ -24,7 +24,22 @@ function HeroSection(_ref) {
|
|
|
24
24
|
logoImage,
|
|
25
25
|
link,
|
|
26
26
|
maxWidth,
|
|
27
|
-
sx = {
|
|
27
|
+
sx = {
|
|
28
|
+
".manipulator": {
|
|
29
|
+
position: "absolute",
|
|
30
|
+
mt: "-100px",
|
|
31
|
+
width: "100%",
|
|
32
|
+
zIndex: -1,
|
|
33
|
+
display: "flex",
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
img: {
|
|
37
|
+
objectFit: "contain",
|
|
38
|
+
width: "100%",
|
|
39
|
+
height: "100%"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
28
43
|
glass = false
|
|
29
44
|
} = data;
|
|
30
45
|
const theme = material.useTheme();
|
|
@@ -81,7 +96,21 @@ function HeroSection(_ref) {
|
|
|
81
96
|
alignItems: "center",
|
|
82
97
|
justifyContent: "center"
|
|
83
98
|
}, logoImage && logoImage.url !== null && /*#__PURE__*/React.createElement(material.Box, {
|
|
84
|
-
className: "manipulator"
|
|
99
|
+
className: "manipulator",
|
|
100
|
+
sx: {
|
|
101
|
+
position: "relative",
|
|
102
|
+
mt: "-100px",
|
|
103
|
+
width: "100%",
|
|
104
|
+
zIndex: -1,
|
|
105
|
+
display: "flex",
|
|
106
|
+
justifyContent: "center",
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
img: {
|
|
109
|
+
objectFit: "contain",
|
|
110
|
+
width: "100%",
|
|
111
|
+
height: "100%"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
85
114
|
}, /*#__PURE__*/React.createElement(StrapiImage.StrapiImage, {
|
|
86
115
|
id: (_logoImage$id = logoImage.id) === null || _logoImage$id === void 0 ? void 0 : _logoImage$id.toString(),
|
|
87
116
|
alternativeText: logoImage.alternativeText,
|
|
@@ -24,6 +24,7 @@ var LogoBarSection = require('./LogoBarSection.js');
|
|
|
24
24
|
var reactDom = require('react-dom');
|
|
25
25
|
var pagebuilderActions = require('../data/actions/pagebuilder-actions.js');
|
|
26
26
|
var SubmitButton = require('./SubmitButton.js');
|
|
27
|
+
var StrapiErrors = require('./StrapiErrors.js');
|
|
27
28
|
|
|
28
29
|
const INITIAL_STATE = {
|
|
29
30
|
zodErrors: null,
|
|
@@ -88,6 +89,7 @@ function blockRenderer(block) {
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
function PageBuilder(_ref) {
|
|
92
|
+
var _formState$zodErrors, _formState$zodErrors2, _formState$zodErrors3, _formState$zodErrors4;
|
|
91
93
|
let {
|
|
92
94
|
data
|
|
93
95
|
} = _ref;
|
|
@@ -117,6 +119,8 @@ function PageBuilder(_ref) {
|
|
|
117
119
|
}, /*#__PURE__*/React.createElement(SubmitButton.SubmitButton, {
|
|
118
120
|
text: "submit",
|
|
119
121
|
loadingText: "loading"
|
|
122
|
+
}), /*#__PURE__*/React.createElement(StrapiErrors.StrapiErrors, {
|
|
123
|
+
error: formState.strapiErrors
|
|
120
124
|
})), /*#__PURE__*/React.createElement(material.Stack, {
|
|
121
125
|
spacing: 2,
|
|
122
126
|
sx: {
|
|
@@ -126,12 +130,18 @@ function PageBuilder(_ref) {
|
|
|
126
130
|
id: "title",
|
|
127
131
|
name: "title",
|
|
128
132
|
label: "title",
|
|
129
|
-
defaultValue: title
|
|
133
|
+
defaultValue: title,
|
|
134
|
+
variant: "outlined",
|
|
135
|
+
error: (formState === null || formState === void 0 || (_formState$zodErrors = formState.zodErrors) === null || _formState$zodErrors === void 0 ? void 0 : _formState$zodErrors.title) != undefined ? true : false,
|
|
136
|
+
helperText: formState === null || formState === void 0 || (_formState$zodErrors2 = formState.zodErrors) === null || _formState$zodErrors2 === void 0 ? void 0 : _formState$zodErrors2.title
|
|
130
137
|
}), /*#__PURE__*/React.createElement(material.TextField, {
|
|
131
138
|
id: "description",
|
|
132
139
|
name: "description",
|
|
133
140
|
label: "description",
|
|
134
|
-
defaultValue: description
|
|
141
|
+
defaultValue: description,
|
|
142
|
+
variant: "outlined",
|
|
143
|
+
error: (formState === null || formState === void 0 || (_formState$zodErrors3 = formState.zodErrors) === null || _formState$zodErrors3 === void 0 ? void 0 : _formState$zodErrors3.description) != undefined ? true : false,
|
|
144
|
+
helperText: formState === null || formState === void 0 || (_formState$zodErrors4 = formState.zodErrors) === null || _formState$zodErrors4 === void 0 ? void 0 : _formState$zodErrors4.description
|
|
135
145
|
})), blocks.map(blockRenderer)));
|
|
136
146
|
}
|
|
137
147
|
|
|
@@ -22,7 +22,22 @@ function HeroSection(_ref) {
|
|
|
22
22
|
logoImage,
|
|
23
23
|
link,
|
|
24
24
|
maxWidth,
|
|
25
|
-
sx = {
|
|
25
|
+
sx = {
|
|
26
|
+
".manipulator": {
|
|
27
|
+
position: "absolute",
|
|
28
|
+
mt: "-100px",
|
|
29
|
+
width: "100%",
|
|
30
|
+
zIndex: -1,
|
|
31
|
+
display: "flex",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
img: {
|
|
35
|
+
objectFit: "contain",
|
|
36
|
+
width: "100%",
|
|
37
|
+
height: "100%"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
26
41
|
glass = false
|
|
27
42
|
} = data;
|
|
28
43
|
const theme = useTheme();
|
|
@@ -79,7 +94,21 @@ function HeroSection(_ref) {
|
|
|
79
94
|
alignItems: "center",
|
|
80
95
|
justifyContent: "center"
|
|
81
96
|
}, logoImage && logoImage.url !== null && /*#__PURE__*/React__default.createElement(Box, {
|
|
82
|
-
className: "manipulator"
|
|
97
|
+
className: "manipulator",
|
|
98
|
+
sx: {
|
|
99
|
+
position: "relative",
|
|
100
|
+
mt: "-100px",
|
|
101
|
+
width: "100%",
|
|
102
|
+
zIndex: -1,
|
|
103
|
+
display: "flex",
|
|
104
|
+
justifyContent: "center",
|
|
105
|
+
alignItems: "center",
|
|
106
|
+
img: {
|
|
107
|
+
objectFit: "contain",
|
|
108
|
+
width: "100%",
|
|
109
|
+
height: "100%"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
83
112
|
}, /*#__PURE__*/React__default.createElement(StrapiImage, {
|
|
84
113
|
id: (_logoImage$id = logoImage.id) === null || _logoImage$id === void 0 ? void 0 : _logoImage$id.toString(),
|
|
85
114
|
alternativeText: logoImage.alternativeText,
|
|
@@ -20,6 +20,7 @@ import { LogoBarSection } from './LogoBarSection.js';
|
|
|
20
20
|
import { useFormState } from 'react-dom';
|
|
21
21
|
import { updatePageAction } from '../data/actions/pagebuilder-actions.js';
|
|
22
22
|
import { SubmitButton } from './SubmitButton.js';
|
|
23
|
+
import { StrapiErrors } from './StrapiErrors.js';
|
|
23
24
|
|
|
24
25
|
const INITIAL_STATE = {
|
|
25
26
|
zodErrors: null,
|
|
@@ -84,6 +85,7 @@ function blockRenderer(block) {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
function PageBuilder(_ref) {
|
|
88
|
+
var _formState$zodErrors, _formState$zodErrors2, _formState$zodErrors3, _formState$zodErrors4;
|
|
87
89
|
let {
|
|
88
90
|
data
|
|
89
91
|
} = _ref;
|
|
@@ -113,6 +115,8 @@ function PageBuilder(_ref) {
|
|
|
113
115
|
}, /*#__PURE__*/React__default.createElement(SubmitButton, {
|
|
114
116
|
text: "submit",
|
|
115
117
|
loadingText: "loading"
|
|
118
|
+
}), /*#__PURE__*/React__default.createElement(StrapiErrors, {
|
|
119
|
+
error: formState.strapiErrors
|
|
116
120
|
})), /*#__PURE__*/React__default.createElement(Stack, {
|
|
117
121
|
spacing: 2,
|
|
118
122
|
sx: {
|
|
@@ -122,12 +126,18 @@ function PageBuilder(_ref) {
|
|
|
122
126
|
id: "title",
|
|
123
127
|
name: "title",
|
|
124
128
|
label: "title",
|
|
125
|
-
defaultValue: title
|
|
129
|
+
defaultValue: title,
|
|
130
|
+
variant: "outlined",
|
|
131
|
+
error: (formState === null || formState === void 0 || (_formState$zodErrors = formState.zodErrors) === null || _formState$zodErrors === void 0 ? void 0 : _formState$zodErrors.title) != undefined ? true : false,
|
|
132
|
+
helperText: formState === null || formState === void 0 || (_formState$zodErrors2 = formState.zodErrors) === null || _formState$zodErrors2 === void 0 ? void 0 : _formState$zodErrors2.title
|
|
126
133
|
}), /*#__PURE__*/React__default.createElement(TextField, {
|
|
127
134
|
id: "description",
|
|
128
135
|
name: "description",
|
|
129
136
|
label: "description",
|
|
130
|
-
defaultValue: description
|
|
137
|
+
defaultValue: description,
|
|
138
|
+
variant: "outlined",
|
|
139
|
+
error: (formState === null || formState === void 0 || (_formState$zodErrors3 = formState.zodErrors) === null || _formState$zodErrors3 === void 0 ? void 0 : _formState$zodErrors3.description) != undefined ? true : false,
|
|
140
|
+
helperText: formState === null || formState === void 0 || (_formState$zodErrors4 = formState.zodErrors) === null || _formState$zodErrors4 === void 0 ? void 0 : _formState$zodErrors4.description
|
|
131
141
|
})), blocks.map(blockRenderer)));
|
|
132
142
|
}
|
|
133
143
|
|
package/package.json
CHANGED
|
@@ -44,7 +44,22 @@ export function HeroSection({ data }: Readonly<HeroSectionProps>) {
|
|
|
44
44
|
logoImage,
|
|
45
45
|
link,
|
|
46
46
|
maxWidth,
|
|
47
|
-
sx = {
|
|
47
|
+
sx = {
|
|
48
|
+
".manipulator": {
|
|
49
|
+
position: "absolute",
|
|
50
|
+
mt: "-100px",
|
|
51
|
+
width: "100%",
|
|
52
|
+
zIndex: -1,
|
|
53
|
+
display: "flex",
|
|
54
|
+
justifyContent: "center",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
img: {
|
|
57
|
+
objectFit: "contain",
|
|
58
|
+
width: "100%",
|
|
59
|
+
height: "100%",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
48
63
|
glass = false,
|
|
49
64
|
} = data;
|
|
50
65
|
|
|
@@ -98,7 +113,23 @@ export function HeroSection({ data }: Readonly<HeroSectionProps>) {
|
|
|
98
113
|
>
|
|
99
114
|
<Stack spacing={5} alignItems="center" justifyContent="center">
|
|
100
115
|
{logoImage && logoImage.url !== null && (
|
|
101
|
-
<Box
|
|
116
|
+
<Box
|
|
117
|
+
className="manipulator"
|
|
118
|
+
sx={{
|
|
119
|
+
position: "relative",
|
|
120
|
+
mt: "-100px",
|
|
121
|
+
width: "100%",
|
|
122
|
+
zIndex: -1,
|
|
123
|
+
display: "flex",
|
|
124
|
+
justifyContent: "center",
|
|
125
|
+
alignItems: "center",
|
|
126
|
+
img: {
|
|
127
|
+
objectFit: "contain",
|
|
128
|
+
width: "100%",
|
|
129
|
+
height: "100%",
|
|
130
|
+
},
|
|
131
|
+
}}
|
|
132
|
+
>
|
|
102
133
|
<StrapiImage
|
|
103
134
|
id={logoImage.id?.toString()}
|
|
104
135
|
alternativeText={logoImage.alternativeText}
|
|
@@ -14,6 +14,8 @@ import { LogoBarSection } from "./LogoBarSection.tsx";
|
|
|
14
14
|
import { useFormState } from "react-dom";
|
|
15
15
|
import { updatePageAction } from "../data/actions/pagebuilder-actions.ts";
|
|
16
16
|
import { SubmitButton } from "./SubmitButton.tsx";
|
|
17
|
+
import { StrapiErrors } from "./StrapiErrors.tsx";
|
|
18
|
+
import { ZodErrors } from "./ZodErrors.tsx";
|
|
17
19
|
|
|
18
20
|
const INITIAL_STATE = {
|
|
19
21
|
zodErrors: null,
|
|
@@ -75,6 +77,7 @@ export default function PageBuilder({
|
|
|
75
77
|
<form action={formAction}>
|
|
76
78
|
<Box sx={{ width: "100%", backgroundColor: "primary.dark", p: 2 }}>
|
|
77
79
|
<SubmitButton text="submit" loadingText="loading" />
|
|
80
|
+
<StrapiErrors error={formState.strapiErrors} />
|
|
78
81
|
</Box>
|
|
79
82
|
<Stack spacing={2} sx={{ p: 2 }}>
|
|
80
83
|
<TextField
|
|
@@ -82,12 +85,20 @@ export default function PageBuilder({
|
|
|
82
85
|
name="title"
|
|
83
86
|
label="title"
|
|
84
87
|
defaultValue={title}
|
|
88
|
+
variant="outlined"
|
|
89
|
+
error={formState?.zodErrors?.title != undefined ? true : false}
|
|
90
|
+
helperText={formState?.zodErrors?.title}
|
|
85
91
|
/>
|
|
86
92
|
<TextField
|
|
87
93
|
id="description"
|
|
88
94
|
name="description"
|
|
89
95
|
label="description"
|
|
90
96
|
defaultValue={description}
|
|
97
|
+
variant="outlined"
|
|
98
|
+
error={
|
|
99
|
+
formState?.zodErrors?.description != undefined ? true : false
|
|
100
|
+
}
|
|
101
|
+
helperText={formState?.zodErrors?.description}
|
|
91
102
|
/>
|
|
92
103
|
</Stack>
|
|
93
104
|
{blocks.map(blockRenderer)}
|