@plone/volto 18.0.0-alpha.40 → 18.0.0-alpha.42
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/CHANGELOG.md +61 -0
- package/locales/ca/LC_MESSAGES/volto.po +31 -1
- package/locales/ca.json +1 -1
- package/locales/de/LC_MESSAGES/volto.po +31 -1
- package/locales/de.json +1 -1
- package/locales/en/LC_MESSAGES/volto.po +31 -1
- package/locales/en.json +1 -1
- package/locales/es/LC_MESSAGES/volto.po +31 -1
- package/locales/es.json +1 -1
- package/locales/eu/LC_MESSAGES/volto.po +31 -1
- package/locales/eu.json +1 -1
- package/locales/fi/LC_MESSAGES/volto.po +31 -1
- package/locales/fi.json +1 -1
- package/locales/fr/LC_MESSAGES/volto.po +31 -1
- package/locales/fr.json +1 -1
- package/locales/hi/LC_MESSAGES/volto.po +31 -1
- package/locales/hi.json +1 -1
- package/locales/it/LC_MESSAGES/volto.po +31 -1
- package/locales/it.json +1 -1
- package/locales/ja/LC_MESSAGES/volto.po +31 -1
- package/locales/ja.json +1 -1
- package/locales/nl/LC_MESSAGES/volto.po +31 -1
- package/locales/nl.json +1 -1
- package/locales/pt/LC_MESSAGES/volto.po +31 -1
- package/locales/pt.json +1 -1
- package/locales/pt_BR/LC_MESSAGES/volto.po +31 -1
- package/locales/pt_BR.json +1 -1
- package/locales/ro/LC_MESSAGES/volto.po +31 -1
- package/locales/ro.json +1 -1
- package/locales/volto.pot +32 -2
- package/locales/zh_CN/LC_MESSAGES/volto.po +31 -1
- package/locales/zh_CN.json +1 -1
- package/package.json +4 -5
- package/razzle.config.js +2 -2
- package/src/components/index.js +0 -1
- package/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +1 -1
- package/src/components/manage/AnchorPlugin/useLinkEditor.jsx +21 -21
- package/src/components/manage/Blocks/Block/BlocksForm.jsx +5 -0
- package/src/components/manage/Blocks/Block/Order/Item.jsx +6 -2
- package/src/components/manage/Blocks/Block/Order/Order.jsx +2 -0
- package/src/components/manage/Blocks/Container/Data.jsx +10 -2
- package/src/components/manage/Blocks/Image/ImageSidebar.jsx +10 -2
- package/src/components/manage/Blocks/Listing/ListingData.jsx +10 -2
- package/src/components/manage/Blocks/Maps/MapsSidebar.jsx +3 -1
- package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +2 -0
- package/src/components/manage/Blocks/Search/SearchBlockView.jsx +18 -2
- package/src/components/manage/Blocks/Search/hocs/withSearch.jsx +1 -1
- package/src/components/manage/Blocks/Teaser/Data.jsx +10 -2
- package/src/components/manage/Blocks/ToC/Edit.jsx +1 -0
- package/src/components/manage/Blocks/Video/Edit.jsx +1 -1
- package/src/components/manage/Blocks/Video/VideoSidebar.jsx +3 -1
- package/src/components/manage/Contents/Contents.jsx +1 -1
- package/src/components/manage/Controlpanels/ContentTypeSchema.jsx +1 -0
- package/src/components/manage/Controlpanels/UndoControlpanel.jsx +3 -3
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipListing.jsx +28 -12
- package/src/components/manage/Controlpanels/Users/UserGroupMembershipMatrix.jsx +12 -4
- package/src/components/manage/Form/Form.jsx +85 -20
- package/src/components/manage/Form/InlineForm.jsx +4 -6
- package/src/components/manage/Form/ModalForm.jsx +1 -1
- package/src/components/manage/History/History.jsx +1 -1
- package/src/components/manage/Pluggable/Pluggable.test.js +1 -1
- package/src/components/manage/Toolbar/Toolbar.jsx +1 -1
- package/src/components/manage/Widgets/ArrayWidget.jsx +2 -2
- package/src/components/manage/Widgets/ImageWidget.jsx +34 -10
- package/src/components/manage/Widgets/RecurrenceWidget/EndField.jsx +7 -1
- package/src/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +80 -31
- package/src/components/theme/Login/Login.jsx +25 -4
- package/src/components/theme/Logout/Logout.jsx +2 -2
- package/src/components/theme/Search/Search.jsx +13 -5
- package/src/components/theme/View/View.jsx +0 -7
- package/src/components/theme/View/View.test.jsx +0 -3
- package/src/config/Widgets.jsx +1 -1
- package/src/config/index.js +7 -2
- package/src/config/validation.ts +155 -0
- package/src/helpers/Extensions/withBlockExtensions.jsx +1 -1
- package/src/helpers/FormValidation/FormValidation.jsx +109 -170
- package/src/helpers/FormValidation/FormValidation.test.js +836 -8
- package/src/helpers/FormValidation/validators.ts +203 -0
- package/src/helpers/MessageLabels/MessageLabels.js +28 -0
- package/src/helpers/Url/Url.test.js +4 -4
- package/src/helpers/User/User.js +1 -1
- package/src/hooks/client/useClient.js +1 -1
- package/test-setup-config.jsx +7 -0
- package/theme/themes/default/modules/embed.variables +1 -1
- package/theme/themes/pastanaga/collections/form.overrides +36 -2
- package/theme/themes/pastanaga/extras/blocks.less +14 -5
- package/theme/themes/pastanaga/extras/sidebar.less +4 -0
- package/theme/themes/pastanaga/extras/toolbar.less +10 -3
- package/tsconfig.declarations.json +3 -2
- package/types/components/index.d.ts +0 -1
- package/types/components/manage/Blocks/Block/Order/Order.d.ts +2 -1
- package/types/components/theme/Logout/Logout.d.ts +1 -1
- package/types/config/RichTextEditor/ToHTML.d.ts +1 -1
- package/types/config/Widgets.d.ts +2 -2
- package/types/config/validation.d.ts +3 -0
- package/types/helpers/Extensions/withBlockExtensions.d.ts +1 -1
- package/types/helpers/FormValidation/FormValidation.d.ts +1 -0
- package/types/helpers/FormValidation/validators.d.ts +29 -0
- package/types/helpers/MessageLabels/MessageLabels.d.ts +36 -0
- package/types/helpers/User/User.d.ts +1 -1
- package/src/components/theme/SocialSharing/SocialSharing.jsx +0 -48
- package/src/components/theme/SocialSharing/SocialSharing.test.jsx +0 -14
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { validationMessage } from './FormValidation';
|
|
2
|
+
import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels';
|
|
3
|
+
|
|
4
|
+
type MinMaxValidator = {
|
|
5
|
+
value: string | number;
|
|
6
|
+
fieldSpec: string | number;
|
|
7
|
+
criterion: string;
|
|
8
|
+
formatMessage: Function;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type Validator = {
|
|
12
|
+
value: string;
|
|
13
|
+
field: Record<string, any>;
|
|
14
|
+
formData: any;
|
|
15
|
+
formatMessage: Function;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const isMaxPropertyValid = ({
|
|
19
|
+
value,
|
|
20
|
+
fieldSpec,
|
|
21
|
+
criterion,
|
|
22
|
+
formatMessage,
|
|
23
|
+
}: MinMaxValidator) => {
|
|
24
|
+
const isValid = fieldSpec !== undefined ? value <= fieldSpec : true;
|
|
25
|
+
return validationMessage(isValid, criterion, fieldSpec, formatMessage);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const isMinPropertyValid = ({
|
|
29
|
+
value,
|
|
30
|
+
fieldSpec,
|
|
31
|
+
criterion,
|
|
32
|
+
formatMessage,
|
|
33
|
+
}: MinMaxValidator) => {
|
|
34
|
+
const isValid = fieldSpec !== undefined ? value >= fieldSpec : true;
|
|
35
|
+
return validationMessage(isValid, criterion, fieldSpec, formatMessage);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const minLengthValidator = ({
|
|
39
|
+
value,
|
|
40
|
+
field,
|
|
41
|
+
formatMessage,
|
|
42
|
+
}: Validator) =>
|
|
43
|
+
isMinPropertyValid({
|
|
44
|
+
value: value.length,
|
|
45
|
+
fieldSpec: field.minLength,
|
|
46
|
+
criterion: 'minLength',
|
|
47
|
+
formatMessage,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const maxLengthValidator = ({
|
|
51
|
+
value,
|
|
52
|
+
field,
|
|
53
|
+
formatMessage,
|
|
54
|
+
}: Validator) =>
|
|
55
|
+
isMaxPropertyValid({
|
|
56
|
+
value: value.length,
|
|
57
|
+
fieldSpec: field.maxLength,
|
|
58
|
+
criterion: 'maxLength',
|
|
59
|
+
formatMessage,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const urlValidator = ({ value, formatMessage }: Validator) => {
|
|
63
|
+
const urlRegex = new RegExp(
|
|
64
|
+
'^(https?:\\/\\/)?' + // validate protocol
|
|
65
|
+
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // validate domain name
|
|
66
|
+
'((\\d{1,3}\\.){3}\\d{1,3}))|' + // validate OR ip (v4) address
|
|
67
|
+
'(localhost)' + // validate OR localhost address
|
|
68
|
+
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // validate port and path
|
|
69
|
+
'(\\?[;&a-z\\d%_.~+=-]*)?' + // validate query string
|
|
70
|
+
'(\\#[-a-z\\d_]*)?$', // validate fragment locator
|
|
71
|
+
'i',
|
|
72
|
+
);
|
|
73
|
+
const isValid = urlRegex.test(value);
|
|
74
|
+
return !isValid ? formatMessage(messages.isValidURL) : null;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const emailValidator = ({ value, formatMessage }: Validator): string => {
|
|
78
|
+
// Email Regex taken from from WHATWG living standard:
|
|
79
|
+
// https://html.spec.whatwg.org/multipage/input.html#e-mail-state-(type=email)
|
|
80
|
+
const emailRegex =
|
|
81
|
+
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
82
|
+
const isValid = emailRegex.test(value);
|
|
83
|
+
return !isValid ? formatMessage(messages.isValidEmail) : null;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const isNumberValidator = ({ value, formatMessage }: Validator) => {
|
|
87
|
+
const isNumeric = (string: string | number) => Number.isFinite(+string);
|
|
88
|
+
const floatRegex = /^[+-]?\d+(\.\d+)?$/;
|
|
89
|
+
const isValid = isNumeric(value) && floatRegex.test(value);
|
|
90
|
+
// const isValid =
|
|
91
|
+
// typeof value === 'string' && !isNaN(+value) && floatRegex.test(value);
|
|
92
|
+
return !isValid ? formatMessage(messages.isNumber) : null;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const minimumValidator = ({ value, field, formatMessage }: Validator) =>
|
|
96
|
+
isMinPropertyValid({
|
|
97
|
+
value,
|
|
98
|
+
fieldSpec: field.minimum,
|
|
99
|
+
criterion: 'minimum',
|
|
100
|
+
formatMessage,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export const maximumValidator = ({ value, field, formatMessage }: Validator) =>
|
|
104
|
+
isMaxPropertyValid({
|
|
105
|
+
value,
|
|
106
|
+
fieldSpec: field.maximum,
|
|
107
|
+
criterion: 'maximum',
|
|
108
|
+
formatMessage,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export const isIntegerValidator = ({ value, formatMessage }: Validator) => {
|
|
112
|
+
const isNumeric = (string: string | number) => Number.isFinite(+string);
|
|
113
|
+
const intRegex = /^-?[0-9]+$/;
|
|
114
|
+
const isValid = isNumeric(value) && intRegex.test(value);
|
|
115
|
+
return !isValid ? formatMessage(messages.isInteger) : null;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const hasUniqueItemsValidator = ({
|
|
119
|
+
value,
|
|
120
|
+
field,
|
|
121
|
+
formatMessage,
|
|
122
|
+
}: Validator) => {
|
|
123
|
+
if (!field.uniqueItems) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
const isValid =
|
|
127
|
+
field.uniqueItems &&
|
|
128
|
+
value &&
|
|
129
|
+
// unique items
|
|
130
|
+
[...new Set(value)].length === value.length;
|
|
131
|
+
return !isValid ? formatMessage(messages.uniqueItems) : null;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const startEventDateRangeValidator = ({
|
|
135
|
+
value,
|
|
136
|
+
field,
|
|
137
|
+
formData,
|
|
138
|
+
formatMessage,
|
|
139
|
+
}: Validator) => {
|
|
140
|
+
const isValid =
|
|
141
|
+
value && formData.end && new Date(value) < new Date(formData.end);
|
|
142
|
+
return !isValid
|
|
143
|
+
? formatMessage(messages.startEventRange, {
|
|
144
|
+
endDateValueOrEndFieldName: formData.end || 'end',
|
|
145
|
+
})
|
|
146
|
+
: null;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const endEventDateRangeValidator = ({
|
|
150
|
+
value,
|
|
151
|
+
field,
|
|
152
|
+
formData,
|
|
153
|
+
formatMessage,
|
|
154
|
+
}: Validator) => {
|
|
155
|
+
const isValid =
|
|
156
|
+
value && formData.start && new Date(value) > new Date(formData.start);
|
|
157
|
+
return !isValid
|
|
158
|
+
? formatMessage(messages.endEventRange, {
|
|
159
|
+
startDateValueOrStartFieldName: formData.start || 'start',
|
|
160
|
+
})
|
|
161
|
+
: null;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const patternValidator = ({
|
|
165
|
+
value,
|
|
166
|
+
field,
|
|
167
|
+
formatMessage,
|
|
168
|
+
}: Validator) => {
|
|
169
|
+
if (!field.pattern) {
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
const regex = new RegExp(field.pattern);
|
|
173
|
+
const isValid = regex.test(value);
|
|
174
|
+
return !isValid ? formatMessage(messages.pattern) : null;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const maxItemsValidator = ({
|
|
178
|
+
value,
|
|
179
|
+
field,
|
|
180
|
+
formatMessage,
|
|
181
|
+
}: Validator) => {
|
|
182
|
+
if (!field.maxItems) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
const isValid = Array.isArray(value) && value.length <= field.maxItems;
|
|
186
|
+
return !isValid
|
|
187
|
+
? formatMessage(messages.maxItems, { maxItems: field.maxItems })
|
|
188
|
+
: null;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const minItemsValidator = ({
|
|
192
|
+
value,
|
|
193
|
+
field,
|
|
194
|
+
formatMessage,
|
|
195
|
+
}: Validator) => {
|
|
196
|
+
if (!field.minItems) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const isValid = Array.isArray(value) && value.length >= field.minItems;
|
|
200
|
+
return !isValid
|
|
201
|
+
? formatMessage(messages.minItems, { minItems: field.minItems })
|
|
202
|
+
: null;
|
|
203
|
+
};
|
|
@@ -375,4 +375,32 @@ export const messages = defineMessages({
|
|
|
375
375
|
id: 'fileTooLarge',
|
|
376
376
|
defaultMessage: 'This website does not accept files larger than {limit}',
|
|
377
377
|
},
|
|
378
|
+
blocksFieldsErrorTitle: {
|
|
379
|
+
id: 'blocksFieldsErrorTitle',
|
|
380
|
+
defaultMessage: 'Error in the block field {errorField}.',
|
|
381
|
+
},
|
|
382
|
+
startEventRange: {
|
|
383
|
+
id: 'Event start date must be on or before {endDateValueOrEndFieldName}',
|
|
384
|
+
defaultMessage:
|
|
385
|
+
'Event start date must be on or before {endDateValueOrEndFieldName}',
|
|
386
|
+
},
|
|
387
|
+
endEventRange: {
|
|
388
|
+
id: 'Event end date must be on or after {startDateValueOrStartFieldName}',
|
|
389
|
+
defaultMessage:
|
|
390
|
+
'Event end date must be on or after {startDateValueOrStartFieldName}',
|
|
391
|
+
},
|
|
392
|
+
pattern: {
|
|
393
|
+
id: 'The value does not match the pattern {pattern}',
|
|
394
|
+
defaultMessage: 'The value does not match the pattern {pattern}',
|
|
395
|
+
},
|
|
396
|
+
maxItems: {
|
|
397
|
+
id: 'The number of items must be less than or equal to {maxItems}',
|
|
398
|
+
defaultMessage:
|
|
399
|
+
'The number of items must be less than or equal to {maxItems}',
|
|
400
|
+
},
|
|
401
|
+
minItems: {
|
|
402
|
+
id: 'The number of items must be greater than or equal to {minItems}',
|
|
403
|
+
defaultMessage:
|
|
404
|
+
'The number of items must be greater than or equal to {minItems}',
|
|
405
|
+
},
|
|
378
406
|
});
|
|
@@ -66,7 +66,7 @@ describe('Url', () => {
|
|
|
66
66
|
it('return empty string if no url is empty string', () => {
|
|
67
67
|
expect(getBaseUrl('')).toBe('');
|
|
68
68
|
});
|
|
69
|
-
it('return a null/undefined mailto
|
|
69
|
+
it('return a null/undefined mailto address ', () => {
|
|
70
70
|
expect(normaliseMail(null)).toBe('mailto:null');
|
|
71
71
|
expect(normaliseMail(undefined)).toBe('mailto:undefined');
|
|
72
72
|
});
|
|
@@ -163,14 +163,14 @@ describe('Url', () => {
|
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
describe('flattenHTMLToAppURL', () => {
|
|
166
|
-
it('flattens all
|
|
166
|
+
it('flattens all occurrences of the api URL from an html snippet', () => {
|
|
167
167
|
const html = `<a href="${settings.apiPath}/foo/bar">An internal link</a><a href="${settings.apiPath}/foo/baz">second link</a>`;
|
|
168
168
|
expect(flattenHTMLToAppURL(html)).toBe(
|
|
169
169
|
'<a href="/foo/bar">An internal link</a><a href="/foo/baz">second link</a>',
|
|
170
170
|
);
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
-
it('flattens all
|
|
173
|
+
it('flattens all occurrences of the api URL from an html snippet, with settings.internalApiPath', () => {
|
|
174
174
|
const html = `<a href="http://plone:8080/Plone/foo/bar">An internal link</a><a href="http://plone:8080/Plone/foo/baz">second link</a>`;
|
|
175
175
|
const saved = settings.internalApiPath;
|
|
176
176
|
settings.internalApiPath = 'http://plone:8080/Plone';
|
|
@@ -228,7 +228,7 @@ describe('Url', () => {
|
|
|
228
228
|
const href = undefined;
|
|
229
229
|
expect(isInternalURL(href)).toBe(undefined);
|
|
230
230
|
});
|
|
231
|
-
it('tells if an URL is external if settings.externalroutes is
|
|
231
|
+
it('tells if an URL is external if settings.externalroutes is present.', () => {
|
|
232
232
|
const url = `https://localhost:3000/fb/my-page/contents`;
|
|
233
233
|
const blacklistedurl = '/blacklisted';
|
|
234
234
|
settings.externalRoutes = [
|
package/src/helpers/User/User.js
CHANGED
package/test-setup-config.jsx
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from '@plone/volto/config/ControlPanels';
|
|
24
24
|
|
|
25
25
|
import ListingBlockSchema from '@plone/volto/components/manage/Blocks/Listing/schema';
|
|
26
|
+
import { registerValidators } from '@plone/volto/config/validation';
|
|
26
27
|
|
|
27
28
|
config.set('settings', {
|
|
28
29
|
apiPath: 'http://localhost:8080/Plone',
|
|
@@ -153,9 +154,15 @@ config.set('components', {
|
|
|
153
154
|
component: (props) => <img alt="Image component mock" {...props} />,
|
|
154
155
|
},
|
|
155
156
|
});
|
|
157
|
+
|
|
158
|
+
config.set('utilities', {});
|
|
159
|
+
|
|
156
160
|
config.set('experimental', {
|
|
157
161
|
addBlockButton: {
|
|
158
162
|
enabled: false,
|
|
159
163
|
},
|
|
160
164
|
});
|
|
165
|
+
|
|
161
166
|
config.set('slots', {});
|
|
167
|
+
|
|
168
|
+
registerValidators(config);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/* Placeholder */
|
|
15
15
|
@placeholderUnderlay: @background;
|
|
16
16
|
|
|
17
|
-
/* Placeholder
|
|
17
|
+
/* Placeholder Overlaid Background */
|
|
18
18
|
@placeholderBackground: radial-gradient(transparent 45%, rgba(0, 0, 0, 0.3));
|
|
19
19
|
@placeholderBackgroundOpacity: 0.5;
|
|
20
20
|
@placeholderBackgroundTransition: opacity @transitionDuration @transitionEasing;
|
|
@@ -123,16 +123,50 @@
|
|
|
123
123
|
z-index: 1;
|
|
124
124
|
top: 0;
|
|
125
125
|
right: 0;
|
|
126
|
+
left: auto;
|
|
126
127
|
display: flex;
|
|
127
128
|
height: 60px;
|
|
128
129
|
align-items: center;
|
|
129
130
|
margin-right: 1rem;
|
|
131
|
+
background: transparent;
|
|
132
|
+
box-shadow: none;
|
|
133
|
+
transform: none;
|
|
130
134
|
|
|
131
135
|
.item {
|
|
132
136
|
cursor: pointer;
|
|
133
137
|
}
|
|
134
138
|
}
|
|
135
139
|
|
|
140
|
+
.block.form {
|
|
141
|
+
[data-rbd-draggable-context-id] {
|
|
142
|
+
margin-bottom: 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.ui.menu .item > i.icon {
|
|
146
|
+
margin-left: -2px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.square.icon {
|
|
150
|
+
margin-top: -2px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ui.segments > div {
|
|
154
|
+
background: white !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.drag.handle {
|
|
158
|
+
cursor: grab;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.tabular.menu > .item {
|
|
162
|
+
height: 66px;
|
|
163
|
+
|
|
164
|
+
button {
|
|
165
|
+
border-bottom-width: 5px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
136
170
|
.ui.form .field .ui.basic.button.delete-button {
|
|
137
171
|
padding: 0;
|
|
138
172
|
border: none;
|
|
@@ -151,13 +185,13 @@
|
|
|
151
185
|
.ui.form .inline.field .link-form-container {
|
|
152
186
|
.wrapper {
|
|
153
187
|
display: flex;
|
|
154
|
-
border-bottom: 1px solid @lightGreyBorderColor;
|
|
155
188
|
|
|
156
189
|
.ui.input.input-anchorlink-theme {
|
|
157
190
|
vertical-align: unset;
|
|
158
191
|
|
|
159
192
|
input {
|
|
160
|
-
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: unset; // input is only 40px and form.overrides sets height to 60px
|
|
161
195
|
}
|
|
162
196
|
}
|
|
163
197
|
}
|
|
@@ -446,6 +446,7 @@ div.image-upload-widget-image {
|
|
|
446
446
|
text-align: center;
|
|
447
447
|
|
|
448
448
|
.toolbar-wrapper {
|
|
449
|
+
position: relative;
|
|
449
450
|
display: flex;
|
|
450
451
|
flex-direction: column;
|
|
451
452
|
justify-content: flex-end;
|
|
@@ -726,10 +727,22 @@ div.image-upload-widget-image {
|
|
|
726
727
|
|
|
727
728
|
.link-form-container {
|
|
728
729
|
.inline.field .wrapper {
|
|
729
|
-
|
|
730
|
+
width: 270px; // needed to ensure placeholder shows and buttons are aligned to the right
|
|
731
|
+
min-height: initial; // overrides .input.field .wrapper
|
|
732
|
+
justify-content: space-between;
|
|
730
733
|
border-bottom: none;
|
|
731
734
|
}
|
|
732
735
|
|
|
736
|
+
.ui.input-anchorlink-theme {
|
|
737
|
+
width: 100% !important; // overrides form.less width: auto
|
|
738
|
+
max-width: 81%; // needed so buttons don't shift to the right when value is present
|
|
739
|
+
margin-left: 0 !important; // overrides .block .toolbar-inner .ui.input
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.ui.buttons {
|
|
743
|
+
width: auto; // for Add Link popup button to be aligned to the right
|
|
744
|
+
}
|
|
745
|
+
|
|
733
746
|
button {
|
|
734
747
|
padding: 0;
|
|
735
748
|
border: 0;
|
|
@@ -743,10 +756,6 @@ div.image-upload-widget-image {
|
|
|
743
756
|
outline: none;
|
|
744
757
|
}
|
|
745
758
|
}
|
|
746
|
-
|
|
747
|
-
.ui.input {
|
|
748
|
-
min-width: 250px;
|
|
749
|
-
}
|
|
750
759
|
}
|
|
751
760
|
|
|
752
761
|
.blocks-chooser {
|
|
@@ -129,7 +129,7 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
.toolbar-handler {
|
|
132
|
-
button {
|
|
132
|
+
.toolbar-handler-button {
|
|
133
133
|
opacity: 0.3;
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -243,7 +243,7 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
|
|
|
243
243
|
width: 100%;
|
|
244
244
|
justify-content: center;
|
|
245
245
|
|
|
246
|
-
button {
|
|
246
|
+
.toolbar-handler-button {
|
|
247
247
|
width: @toolbarWidth;
|
|
248
248
|
height: 20px;
|
|
249
249
|
padding: 0;
|
|
@@ -428,7 +428,7 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
|
|
|
428
428
|
flex-direction: column;
|
|
429
429
|
justify-content: center;
|
|
430
430
|
|
|
431
|
-
button {
|
|
431
|
+
.toolbar-handler-button {
|
|
432
432
|
width: @toolbarWidthMin;
|
|
433
433
|
height: @toolbarWidth;
|
|
434
434
|
|
|
@@ -752,3 +752,10 @@ body:not(.has-sidebar):not(.has-sidebar-collapsed) {
|
|
|
752
752
|
}
|
|
753
753
|
}
|
|
754
754
|
// End Orphaned CSS
|
|
755
|
+
|
|
756
|
+
// Toolbar handler color in homepage
|
|
757
|
+
.contenttype-plone-site {
|
|
758
|
+
#toolbar .toolbar-handler .toolbar-handler-button:before {
|
|
759
|
+
background: @teal-blue;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
"esModuleInterop": true,
|
|
10
10
|
"jsx": "react-jsx",
|
|
11
11
|
"preserveSymlinks": true,
|
|
12
|
+
"downlevelIteration": true,
|
|
12
13
|
"paths": {
|
|
13
|
-
"@plone/volto/*": ["./src/*"]
|
|
14
|
+
"@plone/volto/*": ["./src/*"]
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
|
-
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.tsx"]
|
|
17
|
+
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.tsx"]
|
|
17
18
|
}
|
|
@@ -33,7 +33,6 @@ export { default as Logout } from "@plone/volto/components/theme/Logout/Logout";
|
|
|
33
33
|
export { default as Sitemap } from "@plone/volto/components/theme/Sitemap/Sitemap";
|
|
34
34
|
export { default as Search } from "@plone/volto/components/theme/Search/Search";
|
|
35
35
|
export { default as Comments } from "@plone/volto/components/theme/Comments/Comments";
|
|
36
|
-
export { default as SocialSharing } from "@plone/volto/components/theme/SocialSharing/SocialSharing";
|
|
37
36
|
export { default as Register } from "@plone/volto/components/theme/Register/Register";
|
|
38
37
|
export { default as PasswordReset } from "@plone/volto/components/theme/PasswordReset/PasswordReset";
|
|
39
38
|
export { default as RequestPasswordReset } from "@plone/volto/components/theme/PasswordReset/RequestPasswordReset";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function Order({ items, onMoveBlock, onDeleteBlock, onSelectBlock, indentationWidth, removable, dndKitCore, dndKitSortable, dndKitUtilities, }: {
|
|
1
|
+
export function Order({ items, onMoveBlock, onDeleteBlock, onSelectBlock, indentationWidth, removable, dndKitCore, dndKitSortable, dndKitUtilities, errors, }: {
|
|
2
2
|
items?: any[];
|
|
3
3
|
onMoveBlock: any;
|
|
4
4
|
onDeleteBlock: any;
|
|
@@ -8,6 +8,7 @@ export function Order({ items, onMoveBlock, onDeleteBlock, onSelectBlock, indent
|
|
|
8
8
|
dndKitCore: any;
|
|
9
9
|
dndKitSortable: any;
|
|
10
10
|
dndKitUtilities: any;
|
|
11
|
+
errors: any;
|
|
11
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
declare const _default: any;
|
|
13
14
|
export default _default;
|
|
@@ -22,7 +22,7 @@ declare namespace inline {
|
|
|
22
22
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Note that children can be
|
|
25
|
+
* Note that children can be mapped to render a list or do other cool stuff
|
|
26
26
|
*/
|
|
27
27
|
declare const blocks: {
|
|
28
28
|
unstyled: (children: any, { keys }: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export namespace widgetMapping {
|
|
2
2
|
export namespace id {
|
|
3
|
-
export { SchemaWidget as schema };
|
|
4
3
|
export { TokenWidget as subjects };
|
|
5
4
|
export { QuerystringWidget as query };
|
|
6
5
|
export { RecurrenceWidget as recurrence };
|
|
@@ -34,6 +33,7 @@ export namespace widgetMapping {
|
|
|
34
33
|
export { SelectAutoComplete as autocomplete };
|
|
35
34
|
export { ColorPickerWidget as color_picker };
|
|
36
35
|
export { SelectWidget as select };
|
|
36
|
+
export { SchemaWidget as schema };
|
|
37
37
|
}
|
|
38
38
|
export let vocabulary: {
|
|
39
39
|
'plone.app.vocabularies.Catalog': import("@loadable/component").LoadableComponent<Omit<import("react-intl").WithIntlProps<import("react-intl").WrappedComponentProps<string>>, "ref"> & import("react").RefAttributes<import("react").ComponentType<import("react-intl").WrappedComponentProps<string>>>>;
|
|
@@ -98,7 +98,6 @@ export namespace widgetMapping {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
export const defaultWidget: import("@loadable/component").LoadableComponent<any>;
|
|
101
|
-
import { SchemaWidget } from '@plone/volto/components/manage/Widgets';
|
|
102
101
|
import { TokenWidget } from '@plone/volto/components/manage/Widgets';
|
|
103
102
|
import { QuerystringWidget } from '@plone/volto/components/manage/Widgets';
|
|
104
103
|
import { RecurrenceWidget } from '@plone/volto/components/manage/Widgets';
|
|
@@ -126,6 +125,7 @@ import { SelectMetadataWidget } from '@plone/volto/components/manage/Widgets';
|
|
|
126
125
|
import { SelectAutoComplete } from '@plone/volto/components/manage/Widgets';
|
|
127
126
|
import { ColorPickerWidget } from '@plone/volto/components/manage/Widgets';
|
|
128
127
|
import { SelectWidget } from '@plone/volto/components/manage/Widgets';
|
|
128
|
+
import { SchemaWidget } from '@plone/volto/components/manage/Widgets';
|
|
129
129
|
import { CheckboxWidget } from '@plone/volto/components/manage/Widgets';
|
|
130
130
|
import { NumberWidget } from '@plone/volto/components/manage/Widgets';
|
|
131
131
|
import { getWidgetView } from '@plone/volto/helpers/Widget/widget';
|
|
@@ -33,7 +33,7 @@ export function resolveExtension(name: any, extensions: any, data: any): any;
|
|
|
33
33
|
* - extensions is the blocksConfig extensions object for that block
|
|
34
34
|
* - resolvedExtensions is an object with
|
|
35
35
|
* `{ variation, <someExtensionA>, <someExtensionB> }` and each of these
|
|
36
|
-
* fields hold the
|
|
36
|
+
* fields hold the corresponding definition object from the block's
|
|
37
37
|
* configuration.
|
|
38
38
|
*/
|
|
39
39
|
export function resolveBlockExtensions(data: any, blocksConfig: any): {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export function validationMessage(isValid: boolean, criterion: string, valueToCompare: string | number, intlFunc: Function): any;
|
|
1
2
|
export function tryParseJSON(requestItem: string): any;
|
|
2
3
|
export default FormValidation;
|
|
3
4
|
export function validateFileUploadSize(file: File, intlFunc: Function): boolean;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type MinMaxValidator = {
|
|
2
|
+
value: string | number;
|
|
3
|
+
fieldSpec: string | number;
|
|
4
|
+
criterion: string;
|
|
5
|
+
formatMessage: Function;
|
|
6
|
+
};
|
|
7
|
+
type Validator = {
|
|
8
|
+
value: string;
|
|
9
|
+
field: Record<string, any>;
|
|
10
|
+
formData: any;
|
|
11
|
+
formatMessage: Function;
|
|
12
|
+
};
|
|
13
|
+
export declare const isMaxPropertyValid: ({ value, fieldSpec, criterion, formatMessage, }: MinMaxValidator) => any;
|
|
14
|
+
export declare const isMinPropertyValid: ({ value, fieldSpec, criterion, formatMessage, }: MinMaxValidator) => any;
|
|
15
|
+
export declare const minLengthValidator: ({ value, field, formatMessage, }: Validator) => any;
|
|
16
|
+
export declare const maxLengthValidator: ({ value, field, formatMessage, }: Validator) => any;
|
|
17
|
+
export declare const urlValidator: ({ value, formatMessage }: Validator) => any;
|
|
18
|
+
export declare const emailValidator: ({ value, formatMessage }: Validator) => string;
|
|
19
|
+
export declare const isNumberValidator: ({ value, formatMessage }: Validator) => any;
|
|
20
|
+
export declare const minimumValidator: ({ value, field, formatMessage }: Validator) => any;
|
|
21
|
+
export declare const maximumValidator: ({ value, field, formatMessage }: Validator) => any;
|
|
22
|
+
export declare const isIntegerValidator: ({ value, formatMessage }: Validator) => any;
|
|
23
|
+
export declare const hasUniqueItemsValidator: ({ value, field, formatMessage, }: Validator) => any;
|
|
24
|
+
export declare const startEventDateRangeValidator: ({ value, field, formData, formatMessage, }: Validator) => any;
|
|
25
|
+
export declare const endEventDateRangeValidator: ({ value, field, formData, formatMessage, }: Validator) => any;
|
|
26
|
+
export declare const patternValidator: ({ value, field, formatMessage, }: Validator) => any;
|
|
27
|
+
export declare const maxItemsValidator: ({ value, field, formatMessage, }: Validator) => any;
|
|
28
|
+
export declare const minItemsValidator: ({ value, field, formatMessage, }: Validator) => any;
|
|
29
|
+
export {};
|
|
@@ -549,4 +549,40 @@ export namespace messages {
|
|
|
549
549
|
let defaultMessage_91: string;
|
|
550
550
|
export { defaultMessage_91 as defaultMessage };
|
|
551
551
|
}
|
|
552
|
+
namespace blocksFieldsErrorTitle {
|
|
553
|
+
let id_92: string;
|
|
554
|
+
export { id_92 as id };
|
|
555
|
+
let defaultMessage_92: string;
|
|
556
|
+
export { defaultMessage_92 as defaultMessage };
|
|
557
|
+
}
|
|
558
|
+
namespace startEventRange {
|
|
559
|
+
let id_93: string;
|
|
560
|
+
export { id_93 as id };
|
|
561
|
+
let defaultMessage_93: string;
|
|
562
|
+
export { defaultMessage_93 as defaultMessage };
|
|
563
|
+
}
|
|
564
|
+
namespace endEventRange {
|
|
565
|
+
let id_94: string;
|
|
566
|
+
export { id_94 as id };
|
|
567
|
+
let defaultMessage_94: string;
|
|
568
|
+
export { defaultMessage_94 as defaultMessage };
|
|
569
|
+
}
|
|
570
|
+
namespace pattern {
|
|
571
|
+
let id_95: string;
|
|
572
|
+
export { id_95 as id };
|
|
573
|
+
let defaultMessage_95: string;
|
|
574
|
+
export { defaultMessage_95 as defaultMessage };
|
|
575
|
+
}
|
|
576
|
+
namespace maxItems {
|
|
577
|
+
let id_96: string;
|
|
578
|
+
export { id_96 as id };
|
|
579
|
+
let defaultMessage_96: string;
|
|
580
|
+
export { defaultMessage_96 as defaultMessage };
|
|
581
|
+
}
|
|
582
|
+
namespace minItems {
|
|
583
|
+
let id_97: string;
|
|
584
|
+
export { id_97 as id };
|
|
585
|
+
let defaultMessage_97: string;
|
|
586
|
+
export { defaultMessage_97 as defaultMessage };
|
|
587
|
+
}
|
|
552
588
|
}
|
|
@@ -11,7 +11,7 @@ export function userHasRoles(user: any, roles?: any[]): boolean;
|
|
|
11
11
|
*/
|
|
12
12
|
export function isManager(user: any): boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Checks if the user can
|
|
14
|
+
* Checks if the user can assign group.
|
|
15
15
|
* @method canAssignGroup
|
|
16
16
|
* @returns {boolean}
|
|
17
17
|
*/
|