@plone/volto 19.1.4 → 19.1.6

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 (152) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/locales/af/LC_MESSAGES/volto.po +18 -16
  3. package/locales/af.json +1 -1
  4. package/locales/ar/LC_MESSAGES/volto.po +18 -16
  5. package/locales/ar.json +1 -1
  6. package/locales/bg/LC_MESSAGES/volto.po +18 -16
  7. package/locales/bg.json +1 -1
  8. package/locales/bn/LC_MESSAGES/volto.po +18 -16
  9. package/locales/bn.json +1 -1
  10. package/locales/ca/LC_MESSAGES/volto.po +18 -16
  11. package/locales/ca.json +1 -1
  12. package/locales/cs/LC_MESSAGES/volto.po +18 -16
  13. package/locales/cs.json +1 -1
  14. package/locales/cy/LC_MESSAGES/volto.po +18 -16
  15. package/locales/cy.json +1 -1
  16. package/locales/da/LC_MESSAGES/volto.po +18 -16
  17. package/locales/da.json +1 -1
  18. package/locales/de/LC_MESSAGES/volto.po +18 -16
  19. package/locales/de.json +1 -1
  20. package/locales/el/LC_MESSAGES/volto.po +18 -16
  21. package/locales/el.json +1 -1
  22. package/locales/en/LC_MESSAGES/volto.po +18 -16
  23. package/locales/en.json +1 -1
  24. package/locales/en_AU/LC_MESSAGES/volto.po +18 -16
  25. package/locales/en_AU.json +1 -1
  26. package/locales/en_GB/LC_MESSAGES/volto.po +18 -16
  27. package/locales/en_GB.json +1 -1
  28. package/locales/eo/LC_MESSAGES/volto.po +18 -16
  29. package/locales/eo.json +1 -1
  30. package/locales/es/LC_MESSAGES/volto.po +18 -16
  31. package/locales/es.json +1 -1
  32. package/locales/et/LC_MESSAGES/volto.po +18 -16
  33. package/locales/et.json +1 -1
  34. package/locales/eu/LC_MESSAGES/volto.po +18 -16
  35. package/locales/eu.json +1 -1
  36. package/locales/fa/LC_MESSAGES/volto.po +18 -16
  37. package/locales/fa.json +1 -1
  38. package/locales/fi/LC_MESSAGES/volto.po +18 -16
  39. package/locales/fi.json +1 -1
  40. package/locales/fr/LC_MESSAGES/volto.po +18 -16
  41. package/locales/fr.json +1 -1
  42. package/locales/fu/LC_MESSAGES/volto.po +18 -16
  43. package/locales/fu.json +1 -1
  44. package/locales/gl/LC_MESSAGES/volto.po +18 -16
  45. package/locales/gl.json +1 -1
  46. package/locales/he/LC_MESSAGES/volto.po +18 -16
  47. package/locales/he.json +1 -1
  48. package/locales/hi/LC_MESSAGES/volto.po +18 -16
  49. package/locales/hi.json +1 -1
  50. package/locales/hr/LC_MESSAGES/volto.po +18 -16
  51. package/locales/hr.json +1 -1
  52. package/locales/hu/LC_MESSAGES/volto.po +18 -16
  53. package/locales/hu.json +1 -1
  54. package/locales/hy/LC_MESSAGES/volto.po +18 -16
  55. package/locales/hy.json +1 -1
  56. package/locales/id/LC_MESSAGES/volto.po +18 -16
  57. package/locales/id.json +1 -1
  58. package/locales/it/LC_MESSAGES/volto.po +18 -16
  59. package/locales/it.json +1 -1
  60. package/locales/ja/LC_MESSAGES/volto.po +18 -16
  61. package/locales/ja.json +1 -1
  62. package/locales/ka/LC_MESSAGES/volto.po +18 -16
  63. package/locales/ka.json +1 -1
  64. package/locales/kn/LC_MESSAGES/volto.po +18 -16
  65. package/locales/kn.json +1 -1
  66. package/locales/ko/LC_MESSAGES/volto.po +18 -16
  67. package/locales/ko.json +1 -1
  68. package/locales/lt/LC_MESSAGES/volto.po +18 -16
  69. package/locales/lt.json +1 -1
  70. package/locales/lv/LC_MESSAGES/volto.po +18 -16
  71. package/locales/lv.json +1 -1
  72. package/locales/mi/LC_MESSAGES/volto.po +18 -16
  73. package/locales/mi.json +1 -1
  74. package/locales/mk/LC_MESSAGES/volto.po +18 -16
  75. package/locales/mk.json +1 -1
  76. package/locales/my/LC_MESSAGES/volto.po +18 -16
  77. package/locales/my.json +1 -1
  78. package/locales/nb_NO/LC_MESSAGES/volto.po +18 -16
  79. package/locales/nb_NO.json +1 -1
  80. package/locales/nl/LC_MESSAGES/volto.po +18 -16
  81. package/locales/nl.json +1 -1
  82. package/locales/nn/LC_MESSAGES/volto.po +18 -16
  83. package/locales/nn.json +1 -1
  84. package/locales/pl/LC_MESSAGES/volto.po +18 -16
  85. package/locales/pl.json +1 -1
  86. package/locales/pt/LC_MESSAGES/volto.po +18 -16
  87. package/locales/pt.json +1 -1
  88. package/locales/pt_BR/LC_MESSAGES/volto.po +18 -16
  89. package/locales/pt_BR.json +1 -1
  90. package/locales/rm/LC_MESSAGES/volto.po +18 -16
  91. package/locales/rm.json +1 -1
  92. package/locales/ro/LC_MESSAGES/volto.po +18 -16
  93. package/locales/ro.json +1 -1
  94. package/locales/ru/LC_MESSAGES/volto.po +18 -16
  95. package/locales/ru.json +1 -1
  96. package/locales/sk/LC_MESSAGES/volto.po +18 -16
  97. package/locales/sk.json +1 -1
  98. package/locales/sl/LC_MESSAGES/volto.po +18 -16
  99. package/locales/sl.json +1 -1
  100. package/locales/sm/LC_MESSAGES/volto.po +18 -16
  101. package/locales/sm.json +1 -1
  102. package/locales/sq/LC_MESSAGES/volto.po +18 -16
  103. package/locales/sq.json +1 -1
  104. package/locales/sr/LC_MESSAGES/volto.po +18 -16
  105. package/locales/sr.json +1 -1
  106. package/locales/sr@cyrl/LC_MESSAGES/volto.po +18 -16
  107. package/locales/sr@cyrl.json +1 -1
  108. package/locales/sr@latn/LC_MESSAGES/volto.po +18 -16
  109. package/locales/sr@latn.json +1 -1
  110. package/locales/sv/LC_MESSAGES/volto.po +18 -16
  111. package/locales/sv.json +1 -1
  112. package/locales/ta/LC_MESSAGES/volto.po +18 -16
  113. package/locales/ta.json +1 -1
  114. package/locales/te/LC_MESSAGES/volto.po +18 -16
  115. package/locales/te.json +1 -1
  116. package/locales/th/LC_MESSAGES/volto.po +18 -16
  117. package/locales/th.json +1 -1
  118. package/locales/to/LC_MESSAGES/volto.po +18 -16
  119. package/locales/to.json +1 -1
  120. package/locales/tr/LC_MESSAGES/volto.po +18 -16
  121. package/locales/tr.json +1 -1
  122. package/locales/uk/LC_MESSAGES/volto.po +18 -16
  123. package/locales/uk.json +1 -1
  124. package/locales/vi/LC_MESSAGES/volto.po +18 -16
  125. package/locales/vi.json +1 -1
  126. package/locales/volto.pot +17 -15
  127. package/locales/zh_CN/LC_MESSAGES/volto.po +18 -16
  128. package/locales/zh_CN.json +1 -1
  129. package/locales/zh_Hant/LC_MESSAGES/volto.po +18 -16
  130. package/locales/zh_Hant.json +1 -1
  131. package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +18 -16
  132. package/locales/zh_Hant_HK.json +1 -1
  133. package/package.json +5 -6
  134. package/src/actions/querystringsearch/querystringsearch.js +4 -1
  135. package/src/actions/querystringsearch/querystringsearch.test.js +77 -0
  136. package/src/components/manage/Controlpanels/BlockTypes.test.ts +132 -0
  137. package/src/components/manage/Controlpanels/BlockTypes.tsx +32 -11
  138. package/src/components/manage/Sidebar/ObjectBrowserBody.jsx +23 -2
  139. package/src/components/manage/Toolbar/More.jsx +13 -0
  140. package/src/components/manage/Widgets/ArrayWidget.jsx +3 -2
  141. package/src/components/manage/Widgets/FileWidget.jsx +19 -9
  142. package/src/components/manage/Widgets/QuerystringWidget.jsx +1 -18
  143. package/src/components/manage/Widgets/QuerystringWidget.test.jsx +42 -1
  144. package/src/components/manage/Widgets/RegistryImageWidget.jsx +5 -3
  145. package/src/components/manage/Widgets/SelectStyling.jsx +33 -1
  146. package/src/components/manage/Widgets/SelectWidget.jsx +3 -2
  147. package/theme/themes/pastanaga/extras/focus.less +33 -0
  148. package/theme/themes/pastanaga/extras/main.less +1 -0
  149. package/theme/themes/pastanaga/extras/skiplinks.less +0 -2
  150. package/theme/themes/pastanaga/globals/site.variables +7 -0
  151. package/types/components/manage/Controlpanels/BlockTypes.d.ts +48 -0
  152. package/types/components/manage/Widgets/QuerystringWidget.d.ts +0 -4
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { defineMessages, useIntl } from 'react-intl';
2
3
  import { Popup } from 'semantic-ui-react';
3
4
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
4
5
  import Icon from '@plone/volto/components/theme/Icon/Icon';
@@ -10,6 +11,13 @@ import checkSVG from '@plone/volto/icons/check.svg';
10
11
  import checkBlankSVG from '@plone/volto/icons/check-blank.svg';
11
12
  import clearSVG from '@plone/volto/icons/clear.svg';
12
13
 
14
+ const messages = defineMessages({
15
+ clearSelection: {
16
+ id: 'Clear selection',
17
+ defaultMessage: 'Clear selection',
18
+ },
19
+ });
20
+
13
21
  export const MenuList = ({ children }) => {
14
22
  return <DynamicHeightList>{children}</DynamicHeightList>;
15
23
  };
@@ -118,8 +126,32 @@ export const DropdownIndicator = injectLazyLibs('reactSelect')((props) => {
118
126
 
119
127
  export const ClearIndicator = injectLazyLibs('reactSelect')((props) => {
120
128
  const { ClearIndicator } = props.reactSelect.components;
129
+ const intl = useIntl();
130
+ const fieldLabelId = props.selectProps?.['aria-labelledby'];
131
+ const clearLabelId = `${props.selectProps?.inputId}-clear-label`;
121
132
  return (
122
- <ClearIndicator {...props}>
133
+ <ClearIndicator
134
+ {...props}
135
+ innerProps={{
136
+ ...props.innerProps,
137
+ 'aria-hidden': false,
138
+ ...(fieldLabelId
139
+ ? { 'aria-labelledby': `${fieldLabelId} ${clearLabelId}` }
140
+ : { 'aria-label': intl.formatMessage(messages.clearSelection) }),
141
+ role: 'button',
142
+ tabIndex: 0,
143
+ onKeyDown: (e) => {
144
+ if (e.key === 'Enter' || e.key === ' ' || e.key === 'Spacebar') {
145
+ e.preventDefault();
146
+ e.stopPropagation();
147
+ props.clearValue();
148
+ }
149
+ },
150
+ }}
151
+ >
152
+ <span id={clearLabelId} hidden>
153
+ {intl.formatMessage(messages.clearSelection)}
154
+ </span>
123
155
  <Icon name={clearSVG} size="18px" color="#e40166" />
124
156
  </ClearIndicator>
125
157
  );
@@ -263,9 +263,10 @@ class SelectWidget extends Component {
263
263
  <FormFieldWrapper {...this.props}>
264
264
  <Select
265
265
  id={`field-${id}`}
266
+ fieldTitle={this.props.title}
266
267
  key={choices}
267
268
  name={id}
268
- aria-labelledby={`fieldset-${this.props.fieldSet}-field-label-${id}`}
269
+ aria-label={this.props.title || undefined}
269
270
  menuShouldScrollIntoView={false}
270
271
  isDisabled={disabled}
271
272
  isSearchable={true}
@@ -304,7 +305,7 @@ class SelectWidget extends Component {
304
305
  : undefined,
305
306
  );
306
307
  }}
307
- isClearable={this.props.isClearable}
308
+ isClearable={!this.props.required && this.props.isClearable}
308
309
  />
309
310
  </FormFieldWrapper>
310
311
  );
@@ -0,0 +1,33 @@
1
+ .universal-focus-style() {
2
+ box-shadow: 0 0 0 2px @innerFocusShadow !important;
3
+ outline: @outerFocusOutline auto 2px !important;
4
+ outline-offset: 2px;
5
+ }
6
+
7
+ // Global focus styles for all elements that support :focus-visible
8
+ // Exclude contenteditable elements (slate editors, rich text inputs) — focus is
9
+ // already implied by the text cursor; an outline ring is noisy and confusing.
10
+ :focus-visible:not([contenteditable]):not([data-slate-editor]) {
11
+ .universal-focus-style();
12
+ }
13
+
14
+ //inputs modifications
15
+ input:focus-visible {
16
+ border-color: @outerFocusOutline !important;
17
+ }
18
+
19
+ // Semantic UI checkbox focus styles
20
+ .ui.checkbox input:focus-visible ~ label::before {
21
+ .universal-focus-style();
22
+ outline-offset: 4px;
23
+ }
24
+
25
+ .ui.checkbox input:focus-visible ~ label::before {
26
+ transition: none !important;
27
+ }
28
+
29
+ // Skiplinks focus styles
30
+ .skiplinks-wrapper a:focus-visible {
31
+ border: 2px solid @linkColor;
32
+ outline: 3px solid @linkColor;
33
+ }
@@ -713,6 +713,7 @@ img.responsive {
713
713
  @import 'views';
714
714
  @import 'toc';
715
715
  @import 'grid.less';
716
+ @import 'focus.less';
716
717
  @import 'block-types.less';
717
718
  @import 'videoembed.less';
718
719
  .loadUIOverrides();
@@ -12,9 +12,7 @@
12
12
  top: 10px;
13
13
  left: 10px;
14
14
  padding: 10px;
15
- border: 2px solid @linkColor;
16
15
  background: #fff;
17
- outline: 3px solid @linkColor;
18
16
  }
19
17
 
20
18
  &:hover {
@@ -362,3 +362,10 @@
362
362
  /*--- Dark Tones ---*/
363
363
 
364
364
  /*--- Light Tones ---*/
365
+
366
+ /*-------------------
367
+ Focused Input
368
+ --------------------*/
369
+
370
+ @innerFocusShadow: #fff;
371
+ @outerFocusOutline: #000;
@@ -1,7 +1,55 @@
1
+ import type { IntlShape } from 'react-intl';
1
2
  import type { Location } from 'history';
3
+ import type { BlocksConfigData } from '@plone/types';
2
4
  type RouteProps = {
3
5
  history: History;
4
6
  location: Location;
5
7
  };
8
+ /**
9
+ * List the configured blocks, by title.
10
+ *
11
+ * An add-on can configure a block that was never registered — enhancing one
12
+ * that ships with another add-on, say — which leaves an entry behind that is
13
+ * not a block at all, with no id or no title. `BlockConfigBase` says both are
14
+ * always there, but the config disagrees, so drop those entries rather than
15
+ * list a block that does not exist.
16
+ * @function sortConfigBlocks
17
+ * @param {BlocksConfigData} blocksConfig The blocks configuration.
18
+ * @param {IntlShape} intl Used to translate each block title.
19
+ * @returns {Array} The configured blocks, sorted by translated title.
20
+ */
21
+ export declare function sortConfigBlocks(blocksConfig: BlocksConfigData, intl: IntlShape): {
22
+ title: string;
23
+ id: string;
24
+ icon: string;
25
+ group: string;
26
+ category?: string;
27
+ blockModel?: number;
28
+ view?: React.ComponentType<import("@plone/types").BlockViewProps>;
29
+ edit?: React.ComponentType<import("@plone/types").BlockEditProps>;
30
+ schema?: object;
31
+ blockSchema: import("@plone/types").JSONSchema | ((args?: import("@plone/types").BlockSchemaArgs) => import("@plone/types").JSONSchema);
32
+ dataAdapter?: ({ block, data, id, onChangeBlock, value, }: {
33
+ block: string;
34
+ data: import("@plone/types").BlocksFormData;
35
+ id: string;
36
+ onChangeBlock: (id: string, newData: any) => void;
37
+ value: any;
38
+ }) => void;
39
+ restricted: ((args: {
40
+ properties: import("@plone/types").Content;
41
+ block: import("@plone/types").BlockConfigBase;
42
+ navRoot: import("@plone/types").Content;
43
+ contentType: string;
44
+ user: import("@plone/types").User;
45
+ }) => boolean) | boolean;
46
+ mostUsed: boolean;
47
+ blockHasOwnFocusManagement?: boolean;
48
+ sidebarTab: boolean | 0 | 1;
49
+ schemaEnhancer?: (args: import("@plone/types").SchemaEnhancerArgs) => import("@plone/types").JSONSchema;
50
+ variations?: import("@plone/types").BlockExtension[];
51
+ extensions?: Record<string, import("@plone/types").BlockExtension>;
52
+ blocksConfig?: Partial<BlocksConfigData>;
53
+ }[];
6
54
  declare const BlockTypesControlpanel: (props: RouteProps) => import("react/jsx-runtime").JSX.Element;
7
55
  export default BlockTypesControlpanel;
@@ -13,10 +13,6 @@ export function objectSchema({ intl, isDisabled, value }: {
13
13
  title: any;
14
14
  widget: string;
15
15
  };
16
- depth: {
17
- title: any;
18
- type: string;
19
- };
20
16
  sort_on: {
21
17
  title: any;
22
18
  widget: string;