@plone/volto 19.0.0-alpha.26 → 19.0.0-alpha.28

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.
Files changed (203) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc +0 -3
  3. package/CHANGELOG.md +69 -0
  4. package/README.md +0 -1
  5. package/babel.js +0 -6
  6. package/locales/af/LC_MESSAGES/volto.po +5455 -0
  7. package/locales/af.json +1 -1
  8. package/locales/ar/LC_MESSAGES/volto.po +5455 -0
  9. package/locales/ar.json +1 -1
  10. package/locales/bg/LC_MESSAGES/volto.po +5455 -0
  11. package/locales/bg.json +1 -1
  12. package/locales/bn/LC_MESSAGES/volto.po +5455 -0
  13. package/locales/bn.json +1 -1
  14. package/locales/ca/LC_MESSAGES/volto.po +406 -345
  15. package/locales/ca.json +1 -1
  16. package/locales/cs/LC_MESSAGES/volto.po +5455 -0
  17. package/locales/cs.json +1 -1
  18. package/locales/cy/LC_MESSAGES/volto.po +5455 -0
  19. package/locales/cy.json +1 -1
  20. package/locales/da/LC_MESSAGES/volto.po +5455 -0
  21. package/locales/da.json +1 -1
  22. package/locales/de/LC_MESSAGES/volto.po +70 -8
  23. package/locales/de.json +1 -1
  24. package/locales/el/LC_MESSAGES/volto.po +5455 -0
  25. package/locales/el.json +1 -1
  26. package/locales/en/LC_MESSAGES/volto.po +66 -0
  27. package/locales/en.json +1 -1
  28. package/locales/en_AU/LC_MESSAGES/volto.po +5455 -0
  29. package/locales/en_AU.json +1 -1
  30. package/locales/en_GB/LC_MESSAGES/volto.po +5455 -0
  31. package/locales/en_GB.json +1 -1
  32. package/locales/eo/LC_MESSAGES/volto.po +5455 -0
  33. package/locales/eo.json +1 -1
  34. package/locales/es/LC_MESSAGES/volto.po +173 -112
  35. package/locales/es.json +1 -1
  36. package/locales/et/LC_MESSAGES/volto.po +5455 -0
  37. package/locales/et.json +1 -1
  38. package/locales/eu/LC_MESSAGES/volto.po +256 -195
  39. package/locales/eu.json +1 -1
  40. package/locales/fa/LC_MESSAGES/volto.po +5455 -0
  41. package/locales/fa.json +1 -1
  42. package/locales/fi/LC_MESSAGES/volto.po +62 -1
  43. package/locales/fi.json +1 -1
  44. package/locales/fr/LC_MESSAGES/volto.po +61 -0
  45. package/locales/fr.json +1 -1
  46. package/locales/fu/LC_MESSAGES/volto.po +5455 -0
  47. package/locales/fu.json +1 -1
  48. package/locales/gl/LC_MESSAGES/volto.po +5456 -0
  49. package/locales/gl.json +1 -1
  50. package/locales/he/LC_MESSAGES/volto.po +5455 -0
  51. package/locales/he.json +1 -1
  52. package/locales/hi/LC_MESSAGES/volto.po +66 -0
  53. package/locales/hi.json +1 -1
  54. package/locales/hr/LC_MESSAGES/volto.po +5455 -0
  55. package/locales/hr.json +1 -1
  56. package/locales/hu/LC_MESSAGES/volto.po +5455 -0
  57. package/locales/hu.json +1 -1
  58. package/locales/hy/LC_MESSAGES/volto.po +5455 -0
  59. package/locales/hy.json +1 -1
  60. package/locales/id/LC_MESSAGES/volto.po +5455 -0
  61. package/locales/id.json +1 -1
  62. package/locales/it/LC_MESSAGES/volto.po +90 -24
  63. package/locales/it.json +1 -1
  64. package/locales/ja/LC_MESSAGES/volto.po +105 -43
  65. package/locales/ja.json +1 -1
  66. package/locales/ka/LC_MESSAGES/volto.po +5455 -0
  67. package/locales/ka.json +1 -1
  68. package/locales/kn/LC_MESSAGES/volto.po +5455 -0
  69. package/locales/kn.json +1 -1
  70. package/locales/ko/LC_MESSAGES/volto.po +5455 -0
  71. package/locales/ko.json +1 -1
  72. package/locales/lt/LC_MESSAGES/volto.po +5455 -0
  73. package/locales/lt.json +1 -1
  74. package/locales/lv/LC_MESSAGES/volto.po +5455 -0
  75. package/locales/lv.json +1 -1
  76. package/locales/mi/LC_MESSAGES/volto.po +5455 -0
  77. package/locales/mi.json +1 -1
  78. package/locales/mk/LC_MESSAGES/volto.po +5455 -0
  79. package/locales/mk.json +1 -1
  80. package/locales/my/LC_MESSAGES/volto.po +5455 -0
  81. package/locales/my.json +1 -1
  82. package/locales/nb_NO/LC_MESSAGES/volto.po +5455 -0
  83. package/locales/nb_NO.json +1 -1
  84. package/locales/nl/LC_MESSAGES/volto.po +93 -31
  85. package/locales/nl.json +1 -1
  86. package/locales/nn/LC_MESSAGES/volto.po +5455 -0
  87. package/locales/nn.json +1 -1
  88. package/locales/pl/LC_MESSAGES/volto.po +5455 -0
  89. package/locales/pl.json +1 -1
  90. package/locales/pt/LC_MESSAGES/volto.po +723 -662
  91. package/locales/pt.json +1 -1
  92. package/locales/pt_BR/LC_MESSAGES/volto.po +61 -0
  93. package/locales/pt_BR.json +1 -1
  94. package/locales/rm/LC_MESSAGES/volto.po +5455 -0
  95. package/locales/rm.json +1 -1
  96. package/locales/ro/LC_MESSAGES/volto.po +61 -0
  97. package/locales/ro.json +1 -1
  98. package/locales/ru/LC_MESSAGES/volto.po +61 -0
  99. package/locales/ru.json +1 -1
  100. package/locales/sk/LC_MESSAGES/volto.po +5455 -0
  101. package/locales/sk.json +1 -1
  102. package/locales/sl/LC_MESSAGES/volto.po +5455 -0
  103. package/locales/sl.json +1 -1
  104. package/locales/sm/LC_MESSAGES/volto.po +5455 -0
  105. package/locales/sm.json +1 -1
  106. package/locales/sq/LC_MESSAGES/volto.po +5455 -0
  107. package/locales/sq.json +1 -1
  108. package/locales/sr/LC_MESSAGES/volto.po +5455 -0
  109. package/locales/sr.json +1 -1
  110. package/locales/sr@cyrl/LC_MESSAGES/volto.po +5455 -0
  111. package/locales/sr@cyrl.json +1 -1
  112. package/locales/sr@latn/LC_MESSAGES/volto.po +5455 -0
  113. package/locales/sr@latn.json +1 -1
  114. package/locales/sv/LC_MESSAGES/volto.po +5455 -0
  115. package/locales/sv.json +1 -1
  116. package/locales/ta/LC_MESSAGES/volto.po +5456 -0
  117. package/locales/ta.json +1 -1
  118. package/locales/te/LC_MESSAGES/volto.po +5455 -0
  119. package/locales/te.json +1 -1
  120. package/locales/th/LC_MESSAGES/volto.po +5455 -0
  121. package/locales/th.json +1 -1
  122. package/locales/to/LC_MESSAGES/volto.po +5455 -0
  123. package/locales/to.json +1 -1
  124. package/locales/tr/LC_MESSAGES/volto.po +5456 -0
  125. package/locales/tr.json +1 -1
  126. package/locales/uk/LC_MESSAGES/volto.po +5455 -0
  127. package/locales/uk.json +1 -1
  128. package/locales/vi/LC_MESSAGES/volto.po +5455 -0
  129. package/locales/vi.json +1 -1
  130. package/locales/volto.pot +62 -1
  131. package/locales/zh_CN/LC_MESSAGES/volto.po +62 -0
  132. package/locales/zh_CN.json +1 -1
  133. package/locales/zh_Hant/LC_MESSAGES/volto.po +5455 -0
  134. package/locales/zh_Hant.json +1 -1
  135. package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +5455 -0
  136. package/locales/zh_Hant_HK.json +1 -1
  137. package/package.json +19 -35
  138. package/razzle.config.js +12 -5
  139. package/src/actions/blockTypes/blockTypes.ts +24 -0
  140. package/src/components/manage/Add/Add.jsx +7 -6
  141. package/src/components/manage/Blocks/Block/Order/Item.jsx +9 -3
  142. package/src/components/manage/Blocks/Block/Order/Order.jsx +116 -67
  143. package/src/components/manage/Blocks/Block/Order/utilities.js +28 -11
  144. package/src/components/manage/Blocks/Listing/Edit.jsx +1 -0
  145. package/src/components/manage/Blocks/Title/Edit.jsx +5 -0
  146. package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +7 -0
  147. package/src/components/manage/Controlpanels/BlockType.tsx +166 -0
  148. package/src/components/manage/Controlpanels/BlockTypes.tsx +145 -0
  149. package/src/components/manage/Controlpanels/Controlpanels.jsx +28 -5
  150. package/src/components/manage/Controlpanels/Controlpanels.test.jsx +10 -0
  151. package/src/components/manage/Controlpanels/DatabaseInformation.jsx +9 -0
  152. package/src/components/manage/Controlpanels/ModerateComments.jsx +8 -0
  153. package/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +4 -5
  154. package/src/components/manage/Controlpanels/Users/UsersControlpanel.test.jsx +57 -11
  155. package/src/components/manage/Diff/Diff.jsx +201 -298
  156. package/src/components/manage/Multilingual/CreateTranslation.jsx +8 -5
  157. package/src/components/manage/Multilingual/ManageTranslations.jsx +1 -1
  158. package/src/components/manage/Multilingual/TranslationObject.jsx +9 -6
  159. package/src/components/manage/Preferences/PersonalPreferences.jsx +8 -5
  160. package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +5 -1
  161. package/src/components/manage/Toolbar/Types.crash.test.jsx +48 -0
  162. package/src/components/manage/Widgets/FileWidget.jsx +7 -0
  163. package/src/components/manage/Widgets/RegistryImageWidget.jsx +1 -1
  164. package/src/components/theme/PasswordReset/PasswordReset.jsx +108 -191
  165. package/src/config/ControlPanels.js +2 -0
  166. package/src/config/index.js +1 -1
  167. package/src/config/validation.ts +8 -0
  168. package/src/constants/ActionTypes.js +1 -0
  169. package/src/express-middleware/devproxy.js +3 -1
  170. package/src/helpers/Blocks/Blocks.js +81 -18
  171. package/src/helpers/FormValidation/FormValidation.test.js +31 -0
  172. package/src/helpers/FormValidation/validators.ts +21 -0
  173. package/src/helpers/MessageLabels/MessageLabels.js +5 -0
  174. package/src/helpers/Utils/Utils.jsx +17 -0
  175. package/src/helpers/Utils/Utils.test.jsx +39 -0
  176. package/src/middleware/api.js +7 -3
  177. package/src/reducers/blockTypes/blockTypes.js +38 -0
  178. package/src/reducers/index.js +2 -0
  179. package/src/reducers/users/users.js +1 -1
  180. package/src/routes.js +10 -0
  181. package/src/server.jsx +7 -5
  182. package/test-setup-globals.js +26 -0
  183. package/theme/themes/pastanaga/extras/block-types.less +17 -0
  184. package/theme/themes/pastanaga/extras/main.less +1 -2
  185. package/types/actions/blockTypes/blockTypes.d.ts +7 -0
  186. package/types/components/index.d.ts +1 -1
  187. package/types/components/manage/Blocks/Block/Order/utilities.d.ts +2 -1
  188. package/types/components/manage/Controlpanels/BlockType.d.ts +7 -0
  189. package/types/components/manage/Controlpanels/BlockTypes.d.ts +7 -0
  190. package/types/components/manage/Diff/Diff.d.ts +7 -2
  191. package/types/components/manage/Toolbar/Types.crash.test.d.ts +1 -0
  192. package/types/components/theme/PasswordReset/PasswordReset.d.ts +6 -2
  193. package/types/config/ControlPanels.d.ts +1 -0
  194. package/types/constants/ActionTypes.d.ts +1 -0
  195. package/types/helpers/Blocks/Blocks.d.ts +3 -0
  196. package/types/helpers/FormValidation/validators.d.ts +7 -0
  197. package/types/helpers/MessageLabels/MessageLabels.d.ts +100 -94
  198. package/types/helpers/Utils/Utils.d.ts +1 -0
  199. package/types/reducers/blockTypes/blockTypes.d.ts +16 -0
  200. package/types/reducers/index.d.ts +2 -0
  201. package/types/routes.d.ts +7 -5
  202. package/vitest.config.mjs +84 -42
  203. package/webpack-plugins/webpack-less-plugin.js +1 -1
@@ -8,6 +8,12 @@ const schema = {
8
8
  username: { title: 'Username', type: 'string', description: '' },
9
9
  email: { title: 'Email', type: 'string', widget: 'email', description: '' },
10
10
  url: { title: 'url', type: 'string', widget: 'url', description: '' },
11
+ file: {
12
+ title: 'file',
13
+ type: 'object',
14
+ description: '',
15
+ size: 5,
16
+ },
11
17
  },
12
18
  fieldsets: [
13
19
  { id: 'default', title: 'FIXME: User Data', fields: ['username'] },
@@ -181,6 +187,31 @@ describe('FormValidation', () => {
181
187
  ).toEqual({});
182
188
  });
183
189
 
190
+ it('file - validates invalid size', () => {
191
+ const validationErrorMessages = [messages.maxSize.defaultMessage];
192
+ validationErrorMessages.title = 'file';
193
+
194
+ expect(
195
+ FormValidation.validateFieldsPerFieldset({
196
+ schema,
197
+ formData: { ...formData, file: { size: 10 } },
198
+ formatMessage,
199
+ }),
200
+ ).toEqual({
201
+ file: validationErrorMessages,
202
+ });
203
+ });
204
+
205
+ it('file - validates size', () => {
206
+ expect(
207
+ FormValidation.validateFieldsPerFieldset({
208
+ schema,
209
+ formData: { ...formData, file: { size: 1 } },
210
+ formatMessage,
211
+ }),
212
+ ).toEqual({});
213
+ });
214
+
184
215
  it('widget - validator from block - Fails', () => {
185
216
  let newSchema = {
186
217
  properties: {
@@ -1,5 +1,6 @@
1
1
  import { validationMessage } from '@plone/volto/helpers/FormValidation/FormValidation';
2
2
  import { messages } from '@plone/volto/helpers/MessageLabels/MessageLabels';
3
+ import config from '@plone/volto/registry';
3
4
 
4
5
  type MinMaxValidator = {
5
6
  value: string | number;
@@ -26,6 +27,13 @@ type ChoiceValidator = {
26
27
  formatMessage: Function;
27
28
  };
28
29
 
30
+ type FileValidator = {
31
+ value: Record<string, any>;
32
+ field: Record<string, any>;
33
+ formData: any;
34
+ formatMessage: Function;
35
+ };
36
+
29
37
  export const isMaxPropertyValid = ({
30
38
  value,
31
39
  fieldSpec,
@@ -232,3 +240,16 @@ export const defaultLanguageControlPanelValidator = ({
232
240
  formData.available_languages.includes(token));
233
241
  return !isValid ? formatMessage(messages.defaultLanguage) : null;
234
242
  };
243
+
244
+ export const sizeValidator = ({
245
+ value,
246
+ field,
247
+ formatMessage,
248
+ }: FileValidator) => {
249
+ const maxSize = field.size
250
+ ? parseInt(field.size, 10)
251
+ : config.settings.maxFileUploadSize;
252
+ return maxSize && value.size > maxSize
253
+ ? formatMessage(messages.maxSize, { maxSize, size: value.size })
254
+ : null;
255
+ };
@@ -25,6 +25,11 @@ export const messages = defineMessages({
25
25
  id: 'Maximum value is {len}.',
26
26
  defaultMessage: 'Maximum value is {len}.',
27
27
  },
28
+ maxSize: {
29
+ id: 'Maximum file size is {maxSize} bytes, but the uploaded file is {size} bytes.',
30
+ defaultMessage:
31
+ 'Maximum file size is {maxSize} bytes, but the uploaded file is {size} bytes.',
32
+ },
28
33
  uniqueItems: {
29
34
  id: 'Items must be unique.',
30
35
  defaultMessage: 'Items must be unique.',
@@ -37,6 +37,23 @@ export const safeWrapper = (func) => (config) => {
37
37
  return res;
38
38
  };
39
39
 
40
+ /**
41
+ * Extract a readable error message from several possible error shapes
42
+ * @param {object} error
43
+ * @returns {string} message
44
+ */
45
+ export const getErrorMessage = (error) => {
46
+ const respBody = error?.response?.body;
47
+ if (respBody?.error?.message) return respBody.error.message;
48
+ if (respBody?.message) return respBody.message;
49
+ if (error?.message) return error.message;
50
+ try {
51
+ return JSON.stringify(error);
52
+ } catch (e) {
53
+ return String(error);
54
+ }
55
+ };
56
+
40
57
  /**
41
58
  * A helper to pipe a configuration object through configuration loaders
42
59
  *
@@ -3,6 +3,7 @@ import config from '@plone/volto/registry';
3
3
  import {
4
4
  applyConfig,
5
5
  difference,
6
+ getErrorMessage,
6
7
  getColor,
7
8
  getInitials,
8
9
  hasApiExpander,
@@ -246,6 +247,44 @@ describe('Utils tests', () => {
246
247
  });
247
248
  });
248
249
 
250
+ describe('getErrorMessage', () => {
251
+ it('returns nested backend error message', () => {
252
+ const error = {
253
+ response: {
254
+ body: {
255
+ error: {
256
+ message: 'Backend nested message',
257
+ },
258
+ },
259
+ },
260
+ };
261
+
262
+ expect(getErrorMessage(error)).toEqual('Backend nested message');
263
+ });
264
+
265
+ it('returns body message when present', () => {
266
+ const error = {
267
+ response: {
268
+ body: {
269
+ message: 'Backend body message',
270
+ },
271
+ },
272
+ };
273
+
274
+ expect(getErrorMessage(error)).toEqual('Backend body message');
275
+ });
276
+
277
+ it('returns generic error.message fallback', () => {
278
+ expect(getErrorMessage(new Error('Generic message'))).toEqual(
279
+ 'Generic message',
280
+ );
281
+ });
282
+
283
+ it('returns stringified object as final fallback', () => {
284
+ expect(getErrorMessage({ foo: 'bar' })).toEqual('{"foo":"bar"}');
285
+ });
286
+ });
287
+
249
288
  describe('safeWrapper', () => {
250
289
  it('calls the function with config', () => {
251
290
  expect(
@@ -287,9 +287,13 @@ const apiMiddlewareFactory =
287
287
  const langFileName = toGettextLang(lang);
288
288
  import(
289
289
  /* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
290
- ).then((locale) => {
291
- dispatch(changeLanguage(lang, locale.default));
292
- });
290
+ )
291
+ .then((locale) => {
292
+ dispatch(changeLanguage(lang, locale.default));
293
+ })
294
+ .catch(() => {
295
+ dispatch(changeLanguage(lang, {}));
296
+ });
293
297
  }
294
298
  }
295
299
 
@@ -0,0 +1,38 @@
1
+ import { GET_BLOCKTYPES_INDEX } from '@plone/volto/constants/ActionTypes';
2
+
3
+ const initialState = {
4
+ error: null,
5
+ items: {},
6
+ loaded: false,
7
+ loading: false,
8
+ };
9
+
10
+ export default function blockTypes(state = initialState, action = {}) {
11
+ switch (action.type) {
12
+ case `${GET_BLOCKTYPES_INDEX}_PENDING`:
13
+ return {
14
+ ...state,
15
+ error: null,
16
+ loaded: false,
17
+ loading: true,
18
+ };
19
+ case `${GET_BLOCKTYPES_INDEX}_SUCCESS`:
20
+ return {
21
+ ...state,
22
+ error: null,
23
+ items: action.result,
24
+ loaded: true,
25
+ loading: false,
26
+ };
27
+ case `${GET_BLOCKTYPES_INDEX}_FAIL`:
28
+ return {
29
+ ...state,
30
+ error: action.error,
31
+ items: {},
32
+ loaded: false,
33
+ loading: false,
34
+ };
35
+ default:
36
+ return state;
37
+ }
38
+ }
@@ -53,6 +53,7 @@ import upgrade from './upgrade/upgrade';
53
53
  import userschema from './userschema/userschema';
54
54
  import site from './site/site';
55
55
  import navroot from './navroot/navroot';
56
+ import blockTypes from './blockTypes/blockTypes';
56
57
 
57
58
  /**
58
59
  * Root reducer.
@@ -111,6 +112,7 @@ const reducers = {
111
112
  userschema,
112
113
  site,
113
114
  navroot,
115
+ blockTypes,
114
116
  };
115
117
 
116
118
  export default reducers;
@@ -117,7 +117,7 @@ export default function users(state = initialState, action = {}) {
117
117
  case `${LIST_USERS}_SUCCESS`:
118
118
  return {
119
119
  ...state,
120
- users: action.result,
120
+ users: action.result.items ? action.result.items : action.result,
121
121
  [getRequestKey(action.type)]: {
122
122
  loading: false,
123
123
  loaded: true,
package/src/routes.js CHANGED
@@ -51,6 +51,8 @@ import {
51
51
  UndoControlpanel,
52
52
  UpgradeControlPanel,
53
53
  } from '@plone/volto/components/manage/Controlpanels';
54
+ import BlockTypesControlpanel from './components/manage/Controlpanels/BlockTypes';
55
+ import BlockTypeControlpanel from './components/manage/Controlpanels/BlockType';
54
56
 
55
57
  import withClientSideContent from '@plone/volto/helpers/Content/withClientSideContent';
56
58
 
@@ -232,6 +234,14 @@ export const defaultRoutes = [
232
234
  path: '/controlpanel/relations',
233
235
  component: RelationsControlpanel,
234
236
  },
237
+ {
238
+ path: '/controlpanel/block-types/:id',
239
+ component: BlockTypeControlpanel,
240
+ },
241
+ {
242
+ path: '/controlpanel/block-types',
243
+ component: BlockTypesControlpanel,
244
+ },
235
245
  {
236
246
  path: '/controlpanel/:id',
237
247
  component: Controlpanel,
package/src/server.jsx CHANGED
@@ -51,11 +51,13 @@ let locales = {};
51
51
  if (config.settings) {
52
52
  config.settings.supportedLanguages.forEach((lang) => {
53
53
  const langFileName = toGettextLang(lang);
54
- import(
55
- /* @vite-ignore */ '@root/../locales/' + langFileName + '.json'
56
- ).then((locale) => {
57
- locales = { ...locales, [toReactIntlLang(lang)]: locale.default };
58
- });
54
+ import(/* @vite-ignore */ '@root/../locales/' + langFileName + '.json')
55
+ .then((locale) => {
56
+ locales = { ...locales, [toReactIntlLang(lang)]: locale.default };
57
+ })
58
+ .catch((error) => {
59
+ // Error loading locale file
60
+ });
59
61
  });
60
62
  }
61
63
 
@@ -1,3 +1,4 @@
1
+ import { vi } from 'vitest';
1
2
  import '@testing-library/jest-dom';
2
3
 
3
4
  global.__CLIENT__ = true;
@@ -38,3 +39,28 @@ vi.stubGlobal('sessionStorage', {
38
39
  removeItem: vi.fn(),
39
40
  clear: vi.fn(),
40
41
  });
42
+
43
+ global.jest = {
44
+ fn: vi.fn.bind(vi),
45
+ };
46
+
47
+ // Mock IntersectionObserver for Vitest
48
+ const IntersectionObserverMock = vi.fn((callback, options = {}) => {
49
+ const instance = {
50
+ thresholds: Array.isArray(options.threshold)
51
+ ? options.threshold
52
+ : [options.threshold ?? 0],
53
+ root: options.root ?? null,
54
+ rootMargin: options.rootMargin ?? '',
55
+ observe: vi.fn(),
56
+ unobserve: vi.fn(),
57
+ disconnect: vi.fn(),
58
+ takeRecords: vi.fn(() => []),
59
+ };
60
+
61
+ return instance;
62
+ });
63
+
64
+ vi.stubGlobal('IntersectionObserver', IntersectionObserverMock);
65
+ global.IntersectionObserver = IntersectionObserverMock;
66
+ window.IntersectionObserver = IntersectionObserverMock;
@@ -0,0 +1,17 @@
1
+ .react-aria-Table.cmsui-table {
2
+ --plone-table-cell-border-bottom: 1px solid var(--quanta-smoke);
3
+ --plone-table-header-border-bottom: 2px solid var(--quanta-silver);
4
+ width: 100%;
5
+ border-radius: 0;
6
+
7
+ .react-aria-Row {
8
+ --radius-top: 0px;
9
+ --radius-bottom: 0px;
10
+ border-bottom: none;
11
+ }
12
+
13
+ .react-aria-Column[data-key$='occurrences'],
14
+ .react-aria-Cell[data-key$=':occurrences'] {
15
+ text-align: right;
16
+ }
17
+ }
@@ -394,8 +394,6 @@ button {
394
394
  }
395
395
 
396
396
  .users-control-panel .table {
397
- overflow-x: scroll;
398
-
399
397
  &::-webkit-scrollbar {
400
398
  width: 3px;
401
399
  height: 3px; /* scrollbar height */
@@ -713,5 +711,6 @@ img.responsive {
713
711
  @import 'views';
714
712
  @import 'toc';
715
713
  @import 'grid.less';
714
+ @import 'block-types.less';
716
715
  @import 'videoembed.less';
717
716
  .loadUIOverrides();
@@ -0,0 +1,7 @@
1
+ export declare function getBlockTypes(id?: string | null, path?: string | null): {
2
+ type: string;
3
+ request: {
4
+ op: string;
5
+ path: string;
6
+ };
7
+ };
@@ -54,7 +54,7 @@ export { default as Actions } from "@plone/volto/components/manage/Actions/Actio
54
54
  export { default as Add } from "@plone/volto/components/manage/Add/Add";
55
55
  export { default as Circle } from "@plone/volto/components/manage/Contents/circle";
56
56
  export { default as Delete } from "@plone/volto/components/manage/Delete/Delete";
57
- export const Diff: import("@loadable/component").LoadableClassComponent<any>;
57
+ export const Diff: import("@loadable/component").LoadableComponent<any>;
58
58
  export const DiffField: import("@loadable/component").LoadableClassComponent<any>;
59
59
  export { default as Display } from "@plone/volto/components/manage/Display/Display";
60
60
  export { default as Edit } from "@plone/volto/components/manage/Edit/Edit";
@@ -1,8 +1,9 @@
1
1
  export function getProjection(items: any, activeId: any, overId: any, dragOffset: any, indentationWidth: any, arrayMove: any): {
2
+ parentId: any;
3
+ parentType: any;
2
4
  depth: any;
3
5
  maxDepth: any;
4
6
  minDepth: any;
5
- parentId: any;
6
7
  };
7
8
  export function flattenTree(items: any): any;
8
9
  export function findItem(items: any, itemId: any): any;
@@ -0,0 +1,7 @@
1
+ import type { Location } from 'history';
2
+ type RouteProps = {
3
+ history: History;
4
+ location: Location;
5
+ };
6
+ declare const BlockTypeControlpanel: (props: RouteProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default BlockTypeControlpanel;
@@ -0,0 +1,7 @@
1
+ import type { Location } from 'history';
2
+ type RouteProps = {
3
+ history: History;
4
+ location: Location;
5
+ };
6
+ declare const BlockTypesControlpanel: (props: RouteProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default BlockTypesControlpanel;
@@ -1,2 +1,7 @@
1
- declare const _default: any;
2
- export default _default;
1
+ export default Diff;
2
+ /**
3
+ * Diff component.
4
+ * @function Diff
5
+ * @returns {JSX.Element}
6
+ */
7
+ declare function Diff(): JSX.Element;
@@ -1,2 +1,6 @@
1
- declare const _default: any;
2
- export default _default;
1
+ export default PasswordReset;
2
+ /**
3
+ * @function PasswordReset
4
+ * @returns {JSX.Element}
5
+ */
6
+ declare function PasswordReset(): JSX.Element;
@@ -20,6 +20,7 @@ export const controlPanelsIcons: {
20
20
  undo: string;
21
21
  aliases: string;
22
22
  relations: string;
23
+ 'block-types': string;
23
24
  };
24
25
  export function filterControlPanels(controlpanels?: any[]): any[];
25
26
  export namespace unwantedControlPanelsFields {
@@ -144,3 +144,4 @@ export const GET_NAVROOT: "GET_NAVROOT";
144
144
  export const SET_FORM_DATA: "SET_FORM_DATA";
145
145
  export const SET_UI_STATE: "SET_UI_STATE";
146
146
  export const UPDATE_UPLOADED_FILES: "UPDATE_UPLOADED_FILES";
147
+ export const GET_BLOCKTYPES_INDEX: "GET_BLOCKTYPES_INDEX";
@@ -194,3 +194,6 @@ export function getBlocksHierarchy(properties: any): any;
194
194
  export function findContainer(formData: object, { containerId }: {
195
195
  containerId: string;
196
196
  }): object | undefined;
197
+ export function findParent(formData: object, { blockId }: {
198
+ blockId: string;
199
+ }): object | undefined;
@@ -20,6 +20,12 @@ type ChoiceValidator = {
20
20
  formData: any;
21
21
  formatMessage: Function;
22
22
  };
23
+ type FileValidator = {
24
+ value: Record<string, any>;
25
+ field: Record<string, any>;
26
+ formData: any;
27
+ formatMessage: Function;
28
+ };
23
29
  export declare const isMaxPropertyValid: ({ value, fieldSpec, criterion, formatMessage, }: MinMaxValidator) => any;
24
30
  export declare const isMinPropertyValid: ({ value, fieldSpec, criterion, formatMessage, }: MinMaxValidator) => any;
25
31
  export declare const minLengthValidator: ({ value, field, formatMessage, }: Validator) => any;
@@ -37,4 +43,5 @@ export declare const patternValidator: ({ value, field, formatMessage, }: Valida
37
43
  export declare const maxItemsValidator: ({ value, field, formatMessage, }: Validator) => any;
38
44
  export declare const minItemsValidator: ({ value, field, formatMessage, }: Validator) => any;
39
45
  export declare const defaultLanguageControlPanelValidator: ({ value, formData, formatMessage, }: ChoiceValidator) => any;
46
+ export declare const sizeValidator: ({ value, field, formatMessage, }: FileValidator) => any;
40
47
  export {};