@uxf/cms 13.0.3 → 14.1.0
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/README.md +1 -1
- package/api/index.d.ts +2 -0
- package/api/index.js +2 -2
- package/api/swr.js +71 -6
- package/content-builder/content-builder-header.js +42 -3
- package/content-builder/content-builder.js +140 -18
- package/content-builder/content-builder.stories.js +24 -5
- package/content-builder/forms/content-builder-basic-form.js +212 -25
- package/content-builder/forms/content-builder-seo-form.js +92 -8
- package/forms/change-password-form/change-password-form.js +152 -15
- package/forms/components/wysiwyg-input/wysiwyg-input.js +188 -50
- package/forms/components/wysiwyg-input/wysiwyg-input.stories.js +127 -22
- package/forms/forgotten-password-form/forgotten-password-form.js +119 -15
- package/forms/invite-user-form/invite-user-form.js +171 -13
- package/forms/login-form/login-form.js +122 -13
- package/forms/renew-password-form/renew-password-form.js +148 -16
- package/lib/api/create-axios-instance.d.ts +3 -1
- package/lib/api/create-axios-request.d.ts +3 -1
- package/lib/api/create-axios-request.js +9 -2
- package/lib/api/create-axios-request.test.d.ts +1 -0
- package/lib/api/create-axios-request.test.js +32 -0
- package/lib/layout/layout.js +126 -28
- package/lib/layout/sidebar.js +69 -38
- package/lib/menu/ui/menu-item.js +5 -2
- package/lib/menu/ui/sub-menu/sub-menu-mobile.js +62 -14
- package/lib/menu/ui/sub-menu/sub-menu.js +66 -14
- package/lib/menu/ui/sub-menu/use-sub-menu.js +137 -34
- package/lib/menu/ui/user-menu.js +178 -14
- package/package.json +21 -21
- package/pages/content-builder/components/form-content.js +189 -38
- package/pages/content-builder/components/form-root-fields.js +3 -3
- package/pages/content-builder/components/form.js +142 -27
- package/pages/content-builder/components/header.js +44 -5
- package/pages/content-builder/content/feature-section.js +67 -15
- package/pages/content-builder/content/gallery.js +38 -6
- package/pages/content-builder/content/hero-section.js +39 -6
- package/pages/content-builder/content/people.js +64 -13
- package/pages/content-builder/content/wysiwyg.js +60 -6
- package/pages/content-builder/content-builder-page.js +120 -48
- package/pages/content-builder/content-field.js +216 -35
- package/pages/content-builder/content-header-behaviour.spec.d.ts +1 -0
- package/pages/content-builder/content-header-behaviour.spec.js +22 -0
- package/pages/content-builder/content-header.js +100 -53
- package/pages/content-builder/context/details-visibility-context.js +96 -18
- package/pages/forgotten-password-page/forgotten-password-page.js +29 -46
- package/pages/grid-page/grid-page.js +292 -76
- package/pages/grid-page/history-pathname.d.ts +6 -0
- package/pages/grid-page/history-pathname.js +11 -0
- package/pages/grid-page/history-pathname.test.d.ts +1 -0
- package/pages/grid-page/history-pathname.test.js +11 -0
- package/pages/grid-page/use-hidden-columns.js +29 -8
- package/pages/invite-user-page/invite-user-page.js +39 -16
- package/pages/login-page/login-page.js +44 -50
- package/pages/renew-password-page/renew-password-page.js +35 -43
- package/pages/translations.d.ts +3 -0
- package/pages/translations.js +3 -0
- package/security/restricted-page.js +88 -10
- package/security/use-logged-user.js +33 -8
- package/translations/cs.json +2 -1
- package/translations/translations.d.ts +3 -0
- package/ui/avatar/avatar.js +3 -2
- package/ui/copy-to-clipboard/copy-to-clipboard.js +57 -44
- package/ui/copy-to-clipboard-button/copy-to-clipboard-button.js +47 -46
- package/utils/remove-confirm-handler.js +80 -11
- package/utils/use-viewport-height.js +26 -20
- package/utils/use-viewport-height.test.d.ts +1 -0
- package/utils/use-viewport-height.test.js +37 -0
- package/utils/use-visual-viewport-height.d.ts +2 -0
- package/utils/use-visual-viewport-height.js +26 -0
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FormContent = void 0;
|
|
7
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
7
8
|
const dnd_1 = require("@uxf/dnd");
|
|
8
9
|
const button_1 = require("@uxf/ui/button");
|
|
9
10
|
const dialog_panel_1 = require("@uxf/ui/dialog/dialog-panel");
|
|
@@ -13,51 +14,201 @@ const paper_1 = require("@uxf/ui/paper/paper");
|
|
|
13
14
|
const react_1 = __importDefault(require("react"));
|
|
14
15
|
const react_hook_form_1 = require("react-hook-form");
|
|
15
16
|
const getSection = (sections, type) => {
|
|
16
|
-
return sections.find(
|
|
17
|
+
return sections.find(s => s.getConfig().type === type);
|
|
17
18
|
};
|
|
18
|
-
const AddSectionButton =
|
|
19
|
-
|
|
19
|
+
const AddSectionButton = props => {
|
|
20
|
+
"use no memo";
|
|
21
|
+
return react_1.default.createElement("div", { className: "mt-4 flex justify-center" },
|
|
20
22
|
react_1.default.createElement(button_1.Button, { onClick: () => (0, modal_service_1.openModal)({
|
|
21
|
-
children:
|
|
23
|
+
children: react_1.default.createElement(dialog_panel_1.DialogPanel, { width: "sm" },
|
|
22
24
|
react_1.default.createElement("div", { className: "px-4 py-6" },
|
|
23
25
|
react_1.default.createElement("h2", { className: "uxf-typo-h5 mb-4" }, "P\u0159idat sekci"),
|
|
24
|
-
react_1.default.createElement("div", { className: "space-y-4" }, props.contentComponents.map(
|
|
25
|
-
}), size: "sm", variant: "secondary" }, "P\u0159idat sekci"))
|
|
26
|
+
react_1.default.createElement("div", { className: "space-y-4" }, props.contentComponents.map(component => react_1.default.createElement(button_1.Button, { isFullWidth: true, key: component.getConfig().type, onClick: () => props.createSection(component, props.index), variant: "secondary" }, component.getConfig().label)))))
|
|
27
|
+
}), size: "sm", variant: "secondary" }, "P\u0159idat sekci"));
|
|
26
28
|
};
|
|
27
|
-
const FormContent =
|
|
28
|
-
|
|
29
|
-
const { contentComponents, onRemove, name, index, control, id, createSection, showAddButton
|
|
30
|
-
const
|
|
29
|
+
const FormContent = props => {
|
|
30
|
+
const $ = (0, compiler_runtime_1.c)(37);
|
|
31
|
+
const { contentComponents, onRemove, name, index, control, id, createSection, showAddButton: t0 } = props;
|
|
32
|
+
const showAddButton = t0 === undefined ? true : t0;
|
|
33
|
+
const t1 = `${name}.type`;
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[0] !== control || $[1] !== t1) {
|
|
36
|
+
t2 = {
|
|
37
|
+
control,
|
|
38
|
+
name: t1
|
|
39
|
+
};
|
|
40
|
+
$[0] = control;
|
|
41
|
+
$[1] = t1;
|
|
42
|
+
$[2] = t2;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
t2 = $[2];
|
|
46
|
+
}
|
|
47
|
+
const { field } = (0, react_hook_form_1.useController)(t2);
|
|
31
48
|
const SectionContent = getSection(contentComponents, field.value);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[3] !== id) {
|
|
51
|
+
t3 = {
|
|
52
|
+
id
|
|
53
|
+
};
|
|
54
|
+
$[3] = id;
|
|
55
|
+
$[4] = t3;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
t3 = $[4];
|
|
59
|
+
}
|
|
60
|
+
const { attributes, listeners, isDragging, transform, transition, setNodeRef } = (0, dnd_1.useSortable)(t3);
|
|
61
|
+
const t4 = isDragging ? 0.4 : undefined;
|
|
62
|
+
let t5;
|
|
63
|
+
if ($[5] !== transform) {
|
|
64
|
+
t5 = dnd_1.CSS.Translate.toString(transform);
|
|
65
|
+
$[5] = transform;
|
|
66
|
+
$[6] = t5;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
t5 = $[6];
|
|
70
|
+
}
|
|
71
|
+
let t6;
|
|
72
|
+
if ($[7] !== t4 || $[8] !== t5 || $[9] !== transition) {
|
|
73
|
+
t6 = {
|
|
74
|
+
opacity: t4,
|
|
75
|
+
transform: t5,
|
|
76
|
+
transition
|
|
77
|
+
};
|
|
78
|
+
$[7] = t4;
|
|
79
|
+
$[8] = t5;
|
|
80
|
+
$[9] = transition;
|
|
81
|
+
$[10] = t6;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
t6 = $[10];
|
|
85
|
+
}
|
|
86
|
+
const style = t6;
|
|
40
87
|
if (SectionContent) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
88
|
+
let t7;
|
|
89
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
90
|
+
t7 = react_1.default.createElement(icon_1.Icon, { name: "grip-dots-vertical", size: 20 });
|
|
91
|
+
$[11] = t7;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
t7 = $[11];
|
|
95
|
+
}
|
|
96
|
+
let t8;
|
|
97
|
+
if ($[12] !== attributes || $[13] !== listeners) {
|
|
98
|
+
t8 = react_1.default.createElement("button", { type: "button", ...attributes, ...listeners, className: "absolute -left-7 top-6" }, t7);
|
|
99
|
+
$[12] = attributes;
|
|
100
|
+
$[13] = listeners;
|
|
101
|
+
$[14] = t8;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
t8 = $[14];
|
|
105
|
+
}
|
|
106
|
+
let t9;
|
|
107
|
+
if ($[15] !== contentComponents) {
|
|
108
|
+
t9 = contentComponents.map(_temp);
|
|
109
|
+
$[15] = contentComponents;
|
|
110
|
+
$[16] = t9;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
t9 = $[16];
|
|
114
|
+
}
|
|
115
|
+
let t10;
|
|
116
|
+
if ($[17] !== field || $[18] !== t9) {
|
|
117
|
+
t10 = {
|
|
118
|
+
...field,
|
|
119
|
+
options: t9
|
|
120
|
+
};
|
|
121
|
+
$[17] = field;
|
|
122
|
+
$[18] = t9;
|
|
123
|
+
$[19] = t10;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
t10 = $[19];
|
|
127
|
+
}
|
|
128
|
+
let t11;
|
|
129
|
+
if ($[20] !== contentComponents || $[21] !== createSection || $[22] !== index || $[23] !== showAddButton) {
|
|
130
|
+
t11 = showAddButton && react_1.default.createElement(AddSectionButton, { contentComponents: contentComponents, createSection: createSection, index: index });
|
|
131
|
+
$[20] = contentComponents;
|
|
132
|
+
$[21] = createSection;
|
|
133
|
+
$[22] = index;
|
|
134
|
+
$[23] = showAddButton;
|
|
135
|
+
$[24] = t11;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
t11 = $[24];
|
|
139
|
+
}
|
|
140
|
+
return react_1.default.createElement("div", { className: "relative", ref: setNodeRef, style: style },
|
|
141
|
+
t8,
|
|
44
142
|
react_1.default.createElement(paper_1.Paper, { className: "dark:bg-gray-800" },
|
|
45
|
-
react_1.default.createElement(SectionContent, { TypeInputProps: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
react_1.default.createElement(
|
|
60
|
-
|
|
61
|
-
|
|
143
|
+
react_1.default.createElement(SectionContent, { TypeInputProps: t10, control: control, id: id, index: index, name: `${name}.content`, onRemove: onRemove, title: SectionContent.getConfig().label })),
|
|
144
|
+
t11);
|
|
145
|
+
}
|
|
146
|
+
let t7;
|
|
147
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
148
|
+
t7 = react_1.default.createElement("div", null);
|
|
149
|
+
$[25] = t7;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
t7 = $[25];
|
|
153
|
+
}
|
|
154
|
+
let t8;
|
|
155
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
156
|
+
t8 = react_1.default.createElement("div", { className: "flex grow items-center justify-center" },
|
|
157
|
+
react_1.default.createElement("p", { className: "text-error font-bold" }, "Nepodporovan\u00E1 sekce"));
|
|
158
|
+
$[26] = t8;
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
t8 = $[26];
|
|
162
|
+
}
|
|
163
|
+
let t9;
|
|
164
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
165
|
+
t9 = react_1.default.createElement(icon_1.Icon, { name: "delete" });
|
|
166
|
+
$[27] = t9;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
t9 = $[27];
|
|
170
|
+
}
|
|
171
|
+
let t10;
|
|
172
|
+
if ($[28] !== onRemove) {
|
|
173
|
+
t10 = react_1.default.createElement(paper_1.Paper, { className: "grid grid-cols-[34px_1fr_34px] p-4 dark:bg-gray-800" },
|
|
174
|
+
t7,
|
|
175
|
+
t8,
|
|
176
|
+
react_1.default.createElement(button_1.Button, { isIconButton: true, onClick: onRemove, size: "sm", variant: "secondary" }, t9));
|
|
177
|
+
$[28] = onRemove;
|
|
178
|
+
$[29] = t10;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
t10 = $[29];
|
|
182
|
+
}
|
|
183
|
+
let t11;
|
|
184
|
+
if ($[30] !== contentComponents || $[31] !== createSection || $[32] !== index) {
|
|
185
|
+
t11 = react_1.default.createElement(AddSectionButton, { contentComponents: contentComponents, createSection: createSection, index: index });
|
|
186
|
+
$[30] = contentComponents;
|
|
187
|
+
$[31] = createSection;
|
|
188
|
+
$[32] = index;
|
|
189
|
+
$[33] = t11;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
t11 = $[33];
|
|
193
|
+
}
|
|
194
|
+
let t12;
|
|
195
|
+
if ($[34] !== t10 || $[35] !== t11) {
|
|
196
|
+
t12 = react_1.default.createElement(react_1.default.Fragment, null,
|
|
197
|
+
t10,
|
|
198
|
+
t11);
|
|
199
|
+
$[34] = t10;
|
|
200
|
+
$[35] = t11;
|
|
201
|
+
$[36] = t12;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
t12 = $[36];
|
|
205
|
+
}
|
|
206
|
+
return t12;
|
|
62
207
|
};
|
|
63
208
|
exports.FormContent = FormContent;
|
|
209
|
+
function _temp(s) {
|
|
210
|
+
return {
|
|
211
|
+
id: s.getConfig().type,
|
|
212
|
+
label: s.getConfig().label
|
|
213
|
+
};
|
|
214
|
+
}
|
|
@@ -38,10 +38,10 @@ function FormRootFields(props) {
|
|
|
38
38
|
react_1.default.createElement(hide_1.Hide, { when: Boolean((_b = props.config.hide) === null || _b === void 0 ? void 0 : _b.perex) },
|
|
39
39
|
react_1.default.createElement(textarea_1.Textarea, { control: props.control, label: "Perex", name: "perex", rows: 3 })),
|
|
40
40
|
react_1.default.createElement(hide_1.Hide, { when: Boolean((_c = props.config.hide) === null || _c === void 0 ? void 0 : _c.author) },
|
|
41
|
-
react_1.default.createElement(combobox_1.Combobox, { control: props.control, label: "Autor", loadOptions: (term) => (0, api_1.autocomplete)(null, { name: "content-author" }, { term }).then((r) => r.data), name: "author" })),
|
|
41
|
+
react_1.default.createElement(combobox_1.Combobox, { control: props.control, label: "Autor", loadOptions: (term, requestOptions) => (0, api_1.autocomplete)(null, { name: "content-author" }, { term }, requestOptions).then((r) => r.data), name: "author" })),
|
|
42
42
|
react_1.default.createElement(hide_1.Hide, { when: Boolean((_d = props.config.hide) === null || _d === void 0 ? void 0 : _d.category) },
|
|
43
|
-
react_1.default.createElement(combobox_1.Combobox, { control: props.control, label: "Kategorie", loadOptions: (term) => (0, api_1.autocomplete)(null, { name: "content-category" }, { term }).then((r) => r.data), name: "category" })),
|
|
44
|
-
react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.control, label: "Tagy", loadOptions: (term) => (0, api_1.autocomplete)(null, { name: "content-tag" }, { term }).then((r) => r.data), name: "tags" }),
|
|
43
|
+
react_1.default.createElement(combobox_1.Combobox, { control: props.control, label: "Kategorie", loadOptions: (term, requestOptions) => (0, api_1.autocomplete)(null, { name: "content-category" }, { term }, requestOptions).then((r) => r.data), name: "category" })),
|
|
44
|
+
react_1.default.createElement(multi_combobox_1.MultiCombobox, { control: props.control, label: "Tagy", loadOptions: (term, requestOptions) => (0, api_1.autocomplete)(null, { name: "content-tag" }, { term }, requestOptions).then((r) => r.data), name: "tags" }),
|
|
45
45
|
react_1.default.createElement(hide_1.Hide, { when: Boolean((_e = props.config.hide) === null || _e === void 0 ? void 0 : _e.image) },
|
|
46
46
|
react_1.default.createElement(file_input_1.FileInput, { control: props.control, id: "image", label: "Hlavn\u00ED obr\u00E1zek", name: "image", onUploadFile: fileUploadHandler })),
|
|
47
47
|
react_1.default.createElement(checkbox_input_1.CheckboxInput, { control: props.control, label: "Aktivn\u00ED", name: "active" }),
|
|
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Form = Form;
|
|
37
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
37
38
|
const form_1 = require("@uxf/form/form");
|
|
38
39
|
const rem_1 = require("@uxf/styles/units/rem");
|
|
39
40
|
const react_1 = __importStar(require("react"));
|
|
@@ -57,37 +58,151 @@ const INPUT_TAB_MAP = {
|
|
|
57
58
|
seo: constants_1.ContentBuilderTabs.Seo,
|
|
58
59
|
tags: constants_1.ContentBuilderTabs.Basic,
|
|
59
60
|
type: constants_1.ContentBuilderTabs.Basic,
|
|
60
|
-
visibilityLevel: constants_1.ContentBuilderTabs.Basic
|
|
61
|
+
visibilityLevel: constants_1.ContentBuilderTabs.Basic
|
|
61
62
|
};
|
|
62
63
|
function Form(props) {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const $ = (0, compiler_runtime_1.c)(30);
|
|
65
|
+
let t0;
|
|
66
|
+
if ($[0] !== props.defaultValues) {
|
|
67
|
+
t0 = {
|
|
68
|
+
defaultValues: props.defaultValues
|
|
69
|
+
};
|
|
70
|
+
$[0] = props.defaultValues;
|
|
71
|
+
$[1] = t0;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
t0 = $[1];
|
|
75
|
+
}
|
|
76
|
+
const formApi = (0, react_hook_form_1.useForm)(t0);
|
|
66
77
|
const viewportHeight = (0, use_viewport_height_1.useViewportHeight)(true);
|
|
67
78
|
const [headerHeight, setHeaderHeight] = (0, react_1.useState)(0);
|
|
68
79
|
const [activeTab, setActiveTab] = (0, react_1.useState)(constants_1.ContentBuilderTabs.Basic);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const handleError = (errors) => {
|
|
77
|
-
//TODO: přepnutí na tab s chybou, asi by šlo udělat lépe
|
|
78
|
-
for (const inputName in errors) {
|
|
79
|
-
if (inputName in INPUT_TAB_MAP) {
|
|
80
|
-
setActiveTab(INPUT_TAB_MAP[inputName]);
|
|
81
|
-
break;
|
|
80
|
+
let t1;
|
|
81
|
+
let t2;
|
|
82
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
83
|
+
t1 = () => {
|
|
84
|
+
const header = document.getElementById(constants_1.CONTENT_BUILDER_PAGE_HEADER_ID);
|
|
85
|
+
if (header) {
|
|
86
|
+
setHeaderHeight(header.offsetHeight);
|
|
82
87
|
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
};
|
|
89
|
+
t2 = [];
|
|
90
|
+
$[2] = t1;
|
|
91
|
+
$[3] = t2;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
t1 = $[2];
|
|
95
|
+
t2 = $[3];
|
|
96
|
+
}
|
|
97
|
+
(0, react_1.useEffect)(t1, t2);
|
|
98
|
+
let t3;
|
|
99
|
+
if ($[4] !== viewportHeight) {
|
|
100
|
+
t3 = viewportHeight === "100vh" ? viewportHeight : (0, rem_1.rem)(viewportHeight);
|
|
101
|
+
$[4] = viewportHeight;
|
|
102
|
+
$[5] = t3;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
t3 = $[5];
|
|
106
|
+
}
|
|
107
|
+
const height = t3;
|
|
108
|
+
let t4;
|
|
109
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
110
|
+
t4 = errors => {
|
|
111
|
+
for (const inputName in errors) {
|
|
112
|
+
if (inputName in INPUT_TAB_MAP) {
|
|
113
|
+
setActiveTab(INPUT_TAB_MAP[inputName]);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
$[6] = t4;
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
t4 = $[6];
|
|
122
|
+
}
|
|
123
|
+
const handleError = t4;
|
|
124
|
+
const t5 = props.onSubmit;
|
|
125
|
+
let t6;
|
|
126
|
+
if ($[7] !== headerHeight) {
|
|
127
|
+
t6 = (0, rem_1.rem)(headerHeight);
|
|
128
|
+
$[7] = headerHeight;
|
|
129
|
+
$[8] = t6;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
t6 = $[8];
|
|
133
|
+
}
|
|
134
|
+
let t7;
|
|
135
|
+
if ($[9] !== height || $[10] !== t6) {
|
|
136
|
+
t7 = {
|
|
137
|
+
"--viewport-height": height,
|
|
138
|
+
"--header-height": t6
|
|
139
|
+
};
|
|
140
|
+
$[9] = height;
|
|
141
|
+
$[10] = t6;
|
|
142
|
+
$[11] = t7;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
t7 = $[11];
|
|
146
|
+
}
|
|
147
|
+
const t8 = t7;
|
|
148
|
+
let t9;
|
|
149
|
+
if ($[12] !== formApi.control || $[13] !== props.config.contentComponents) {
|
|
150
|
+
t9 = react_1.default.createElement("div", { className: "grow" },
|
|
151
|
+
react_1.default.createElement(details_visibility_context_1.DetailsVisibilityProvider, null,
|
|
152
|
+
react_1.default.createElement(content_field_1.ContentField, { contentComponents: props.config.contentComponents, control: formApi.control, name: "content" })));
|
|
153
|
+
$[12] = formApi.control;
|
|
154
|
+
$[13] = props.config.contentComponents;
|
|
155
|
+
$[14] = t9;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
t9 = $[14];
|
|
159
|
+
}
|
|
160
|
+
let t10;
|
|
161
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
162
|
+
t10 = react_1.default.createElement("h2", { className: "uxf-typo-h5 px-4 pb-4 pt-6" }, "Nastaven\u00ED");
|
|
163
|
+
$[15] = t10;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
t10 = $[15];
|
|
167
|
+
}
|
|
168
|
+
let t11;
|
|
169
|
+
if ($[16] !== activeTab || $[17] !== formApi.control || $[18] !== props.config || $[19] !== props.id || $[20] !== props.parentAutocomplete) {
|
|
170
|
+
t11 = react_1.default.createElement("div", { className: "shrink-0 basis-[500px] bg-white px-4 pb-8 xl:overflow-y-auto dark:bg-gray-950" },
|
|
171
|
+
t10,
|
|
172
|
+
react_1.default.createElement(form_root_fields_1.FormRootFields, { activeTab: activeTab, config: props.config, control: formApi.control, id: props.id, parentAutocomplete: props.parentAutocomplete, setActiveTab: setActiveTab }));
|
|
173
|
+
$[16] = activeTab;
|
|
174
|
+
$[17] = formApi.control;
|
|
175
|
+
$[18] = props.config;
|
|
176
|
+
$[19] = props.id;
|
|
177
|
+
$[20] = props.parentAutocomplete;
|
|
178
|
+
$[21] = t11;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
t11 = $[21];
|
|
182
|
+
}
|
|
183
|
+
let t12;
|
|
184
|
+
if ($[22] !== t11 || $[23] !== t8 || $[24] !== t9) {
|
|
185
|
+
t12 = react_1.default.createElement("div", { className: "flex flex-col-reverse gap-8 overflow-hidden xl:h-[calc(var(--viewport-height)-var(--header-height))] xl:flex-row", style: t8 },
|
|
186
|
+
t9,
|
|
187
|
+
t11);
|
|
188
|
+
$[22] = t11;
|
|
189
|
+
$[23] = t8;
|
|
190
|
+
$[24] = t9;
|
|
191
|
+
$[25] = t12;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
t12 = $[25];
|
|
195
|
+
}
|
|
196
|
+
let t13;
|
|
197
|
+
if ($[26] !== formApi || $[27] !== props.onSubmit || $[28] !== t12) {
|
|
198
|
+
t13 = react_1.default.createElement(form_1.Form, { formApi: formApi, id: constants_1.CONTENT_BUILDER_FORM_ID, onError: handleError, onSubmit: t5 }, t12);
|
|
199
|
+
$[26] = formApi;
|
|
200
|
+
$[27] = props.onSubmit;
|
|
201
|
+
$[28] = t12;
|
|
202
|
+
$[29] = t13;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
t13 = $[29];
|
|
206
|
+
}
|
|
207
|
+
return t13;
|
|
93
208
|
}
|
|
@@ -4,15 +4,54 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Header = Header;
|
|
7
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
7
8
|
const translations_1 = require("@uxf/core-react/translations");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const layout_container_1 = require("../../../lib/layout/layout-container");
|
|
10
11
|
const constants_1 = require("../constants");
|
|
11
12
|
function Header(props) {
|
|
13
|
+
const $ = (0, compiler_runtime_1.c)(9);
|
|
12
14
|
const t = (0, translations_1.useUxfTranslation)();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
let t0;
|
|
16
|
+
if ($[0] !== props.title) {
|
|
17
|
+
t0 = react_1.default.createElement("h1", { className: "uxf-typo-h5" }, props.title);
|
|
18
|
+
$[0] = props.title;
|
|
19
|
+
$[1] = t0;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
t0 = $[1];
|
|
23
|
+
}
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[2] !== t) {
|
|
26
|
+
t1 = t("uxf-cms-pages-content-builder:components.header.save");
|
|
27
|
+
$[2] = t;
|
|
28
|
+
$[3] = t1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
t1 = $[3];
|
|
32
|
+
}
|
|
33
|
+
let t2;
|
|
34
|
+
if ($[4] !== t1) {
|
|
35
|
+
t2 = react_1.default.createElement("button", { className: "uxf-button uxf-button--color-default uxf-button--size-default uxf-button--variant-default is-hoverable", form: constants_1.CONTENT_BUILDER_FORM_ID, type: "submit" }, t1);
|
|
36
|
+
$[4] = t1;
|
|
37
|
+
$[5] = t2;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
t2 = $[5];
|
|
41
|
+
}
|
|
42
|
+
let t3;
|
|
43
|
+
if ($[6] !== t0 || $[7] !== t2) {
|
|
44
|
+
t3 = react_1.default.createElement("div", { className: "sticky top-0 z-10 bg-white shadow-md dark:bg-gray-950", id: constants_1.CONTENT_BUILDER_PAGE_HEADER_ID },
|
|
45
|
+
react_1.default.createElement(layout_container_1.LayoutContainer, { className: "flex items-center justify-between py-4" },
|
|
46
|
+
t0,
|
|
47
|
+
" ",
|
|
48
|
+
t2));
|
|
49
|
+
$[6] = t0;
|
|
50
|
+
$[7] = t2;
|
|
51
|
+
$[8] = t3;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
t3 = $[8];
|
|
55
|
+
}
|
|
56
|
+
return t3;
|
|
18
57
|
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FeatureSection = void 0;
|
|
7
|
+
const compiler_runtime_1 = require("react/compiler-runtime");
|
|
7
8
|
const upload_file_1 = require("@uxf/core/api/upload-file");
|
|
8
9
|
const translations_1 = require("@uxf/core-react/translations");
|
|
9
10
|
const file_input_1 = require("@uxf/form/file-input");
|
|
@@ -15,13 +16,37 @@ const wysiwyg_input_1 = require("../../../forms/components/wysiwyg-input");
|
|
|
15
16
|
const content_header_1 = require("../content-header");
|
|
16
17
|
const details_visibility_context_1 = require("../context/details-visibility-context");
|
|
17
18
|
const fileUploadHandler = (0, upload_file_1.createUploadHandler)("default");
|
|
18
|
-
const FeatureSection =
|
|
19
|
+
const FeatureSection = props => {
|
|
20
|
+
const $ = (0, compiler_runtime_1.c)(16);
|
|
19
21
|
const [visibility] = (0, details_visibility_context_1.useDetailsVisibilityForSection)(props.id);
|
|
20
22
|
const t = (0, translations_1.useUxfTranslation)();
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const t0 = `${props.name}.features`;
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[0] !== props.control || $[1] !== t0) {
|
|
26
|
+
t1 = {
|
|
27
|
+
control: props.control,
|
|
28
|
+
name: t0
|
|
29
|
+
};
|
|
30
|
+
$[0] = props.control;
|
|
31
|
+
$[1] = t0;
|
|
32
|
+
$[2] = t1;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
t1 = $[2];
|
|
36
|
+
}
|
|
37
|
+
const { fields, remove, append } = (0, react_hook_form_1.useFieldArray)(t1);
|
|
38
|
+
let t2;
|
|
39
|
+
if ($[3] !== props) {
|
|
40
|
+
t2 = react_1.default.createElement(content_header_1.ContentHeader, { ...props });
|
|
41
|
+
$[3] = props;
|
|
42
|
+
$[4] = t2;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
t2 = $[4];
|
|
46
|
+
}
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[5] !== append || $[6] !== fields || $[7] !== props.control || $[8] !== props.name || $[9] !== remove || $[10] !== t || $[11] !== visibility) {
|
|
49
|
+
t3 = visibility && react_1.default.createElement("div", { className: "p-4" },
|
|
25
50
|
react_1.default.createElement("div", { className: "mt-2 grid grid-cols-12 gap-4" },
|
|
26
51
|
react_1.default.createElement("div", { className: "col-span-12 sm:col-span-6" },
|
|
27
52
|
react_1.default.createElement(text_input_1.TextInput, { control: props.control, isRequired: true, label: t("uxf-cms-pages-content-builder:content.feature-section.title"), name: `${props.name}.title` })),
|
|
@@ -30,17 +55,17 @@ const FeatureSection = (props) => {
|
|
|
30
55
|
react_1.default.createElement("div", { className: "col-span-12" },
|
|
31
56
|
fields.map((field, index) => {
|
|
32
57
|
const handleRemove = () => {
|
|
33
|
-
if (
|
|
34
|
-
// eslint-disable-next-line no-alert
|
|
35
|
-
confirm(t("uxf-cms-pages-content-builder:content.feature-section.confirm-delete-feature"))) {
|
|
58
|
+
if (confirm(t("uxf-cms-pages-content-builder:content.feature-section.confirm-delete-feature"))) {
|
|
36
59
|
remove(index);
|
|
37
60
|
}
|
|
38
61
|
};
|
|
39
|
-
return
|
|
62
|
+
return react_1.default.createElement("div", { className: "border-primary mb-8 border-l-2 pl-8", key: field.id },
|
|
40
63
|
react_1.default.createElement("div", { className: "flex justify-between" },
|
|
41
|
-
react_1.default.createElement("h4", { className: "uxf-typo-h6" }, t("uxf-cms-pages-content-builder:content.feature-section.feature-title", {
|
|
42
|
-
|
|
43
|
-
|
|
64
|
+
react_1.default.createElement("h4", { className: "uxf-typo-h6" }, t("uxf-cms-pages-content-builder:content.feature-section.feature-title", {
|
|
65
|
+
index: index + 1
|
|
66
|
+
})),
|
|
67
|
+
index > 0 ? react_1.default.createElement("div", null,
|
|
68
|
+
react_1.default.createElement(button_1.Button, { onClick: handleRemove, size: "sm", variant: "secondary" }, t("uxf-cms-pages-content-builder:content.feature-section.delete-feature"))) : react_1.default.createElement("div", null)),
|
|
44
69
|
react_1.default.createElement("div", { className: "mt-2 grid grid-cols-12 gap-4" },
|
|
45
70
|
react_1.default.createElement("div", { className: "col-span-12 sm:col-span-6" },
|
|
46
71
|
react_1.default.createElement(text_input_1.TextInput, { control: props.control, isRequired: true, label: t("uxf-cms-pages-content-builder:content.feature-section.feature-name"), name: `${props.name}.features[${index}].title` })),
|
|
@@ -49,14 +74,41 @@ const FeatureSection = (props) => {
|
|
|
49
74
|
react_1.default.createElement("div", { className: "col-span-12" },
|
|
50
75
|
react_1.default.createElement(wysiwyg_input_1.WysiwygInput, { control: props.control, name: `${props.name}.features[${index}].text` })),
|
|
51
76
|
react_1.default.createElement("div", { className: "col-span-12" },
|
|
52
|
-
react_1.default.createElement(text_input_1.TextInput, { control: props.control, label: "CTA url", name: `${props.name}.features[${index}].ctaUrl` }))))
|
|
77
|
+
react_1.default.createElement(text_input_1.TextInput, { control: props.control, label: "CTA url", name: `${props.name}.features[${index}].ctaUrl` }))));
|
|
53
78
|
}),
|
|
54
|
-
react_1.default.createElement(button_1.Button, { onClick: () => append({
|
|
79
|
+
react_1.default.createElement(button_1.Button, { onClick: () => append({
|
|
80
|
+
title: ""
|
|
81
|
+
}), size: "sm", variant: "secondary" }, t("uxf-cms-pages-content-builder:content.feature-section.add-feature")))));
|
|
82
|
+
$[5] = append;
|
|
83
|
+
$[6] = fields;
|
|
84
|
+
$[7] = props.control;
|
|
85
|
+
$[8] = props.name;
|
|
86
|
+
$[9] = remove;
|
|
87
|
+
$[10] = t;
|
|
88
|
+
$[11] = visibility;
|
|
89
|
+
$[12] = t3;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
t3 = $[12];
|
|
93
|
+
}
|
|
94
|
+
let t4;
|
|
95
|
+
if ($[13] !== t2 || $[14] !== t3) {
|
|
96
|
+
t4 = react_1.default.createElement("div", { className: "divide-lightBorder dark:divide-darkBorder divide-y" },
|
|
97
|
+
t2,
|
|
98
|
+
t3);
|
|
99
|
+
$[13] = t2;
|
|
100
|
+
$[14] = t3;
|
|
101
|
+
$[15] = t4;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
t4 = $[15];
|
|
105
|
+
}
|
|
106
|
+
return t4;
|
|
55
107
|
};
|
|
56
108
|
exports.FeatureSection = FeatureSection;
|
|
57
109
|
exports.FeatureSection.getConfig = () => {
|
|
58
110
|
return {
|
|
59
111
|
type: "featureSection",
|
|
60
|
-
label: "Feature sekce"
|
|
112
|
+
label: "Feature sekce"
|
|
61
113
|
};
|
|
62
114
|
};
|