@plone/volto 18.0.0-alpha.42 → 18.0.0-alpha.43

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 (137) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/finalreleasechangelog.py +48 -0
  3. package/locales/ca/LC_MESSAGES/volto.po +8 -12
  4. package/locales/ca.json +1 -1
  5. package/locales/de/LC_MESSAGES/volto.po +9 -13
  6. package/locales/de.json +1 -1
  7. package/locales/en/LC_MESSAGES/volto.po +8 -12
  8. package/locales/en.json +1 -1
  9. package/locales/es/LC_MESSAGES/volto.po +9 -13
  10. package/locales/es.json +1 -1
  11. package/locales/eu/LC_MESSAGES/volto.po +9 -13
  12. package/locales/eu.json +1 -1
  13. package/locales/fi/LC_MESSAGES/volto.po +9 -13
  14. package/locales/fi.json +1 -1
  15. package/locales/fr/LC_MESSAGES/volto.po +9 -13
  16. package/locales/fr.json +1 -1
  17. package/locales/hi/LC_MESSAGES/volto.po +9 -13
  18. package/locales/hi.json +1 -1
  19. package/locales/it/LC_MESSAGES/volto.po +9 -13
  20. package/locales/it.json +1 -1
  21. package/locales/ja/LC_MESSAGES/volto.po +8 -12
  22. package/locales/ja.json +1 -1
  23. package/locales/nl/LC_MESSAGES/volto.po +8 -12
  24. package/locales/nl.json +1 -1
  25. package/locales/pt/LC_MESSAGES/volto.po +8 -12
  26. package/locales/pt.json +1 -1
  27. package/locales/pt_BR/LC_MESSAGES/volto.po +9 -13
  28. package/locales/pt_BR.json +1 -1
  29. package/locales/ro/LC_MESSAGES/volto.po +8 -12
  30. package/locales/ro.json +1 -1
  31. package/locales/volto.pot +9 -13
  32. package/locales/zh_CN/LC_MESSAGES/volto.po +9 -13
  33. package/locales/zh_CN.json +1 -1
  34. package/package.json +3 -3
  35. package/razzle.config.js +1 -1
  36. package/src/components/manage/Actions/Actions.stories.jsx +138 -0
  37. package/src/components/manage/Add/Add.jsx +7 -4
  38. package/src/components/manage/BlockChooser/BlockChooser.jsx +9 -1
  39. package/src/components/manage/Blocks/Block/Edit.jsx +24 -8
  40. package/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +17 -1
  41. package/src/components/manage/Blocks/Block/Order/Item.jsx +3 -1
  42. package/src/components/manage/Blocks/Grid/View.jsx +3 -0
  43. package/src/components/manage/Blocks/LeadImage/Edit.jsx +74 -126
  44. package/src/components/manage/Blocks/Search/components/SortOn.jsx +82 -55
  45. package/src/components/manage/Blocks/Search/widgets/SelectMetadataField.jsx +107 -176
  46. package/src/components/manage/Blocks/Teaser/DefaultBody.jsx +15 -8
  47. package/src/components/manage/Blocks/ToC/Edit.jsx +36 -29
  48. package/src/components/manage/Blocks/Video/Edit.jsx +105 -172
  49. package/src/components/manage/Blocks/Video/Edit.stories.jsx +57 -0
  50. package/src/components/manage/Contents/Contents.jsx +3 -0
  51. package/src/components/manage/Contents/ContentsBreadcrumbs.stories.jsx +46 -0
  52. package/src/components/manage/Contents/ContentsPropertiesModal.jsx +85 -52
  53. package/src/components/manage/Contents/ContentsUploadModal.jsx +230 -323
  54. package/src/components/manage/Contents/ContentsUploadModal.stories.jsx +56 -0
  55. package/src/components/manage/Controlpanels/AddonsControlpanel.jsx +323 -441
  56. package/src/components/manage/Controlpanels/Aliases.jsx +452 -580
  57. package/src/components/manage/Controlpanels/Aliases.stories.jsx +74 -0
  58. package/src/components/manage/Controlpanels/Controlpanel.jsx +41 -2
  59. package/src/components/manage/Controlpanels/Controlpanel.test.jsx +55 -24
  60. package/src/components/manage/Controlpanels/DatabaseInformation.jsx +162 -229
  61. package/src/components/manage/Controlpanels/Groups/RenderGroups.jsx +74 -122
  62. package/src/components/manage/Display/Display.jsx +92 -148
  63. package/src/components/manage/Display/Display.stories.jsx +46 -0
  64. package/src/components/manage/Edit/Edit.jsx +2 -4
  65. package/src/components/manage/Preferences/ChangePassword.jsx +94 -172
  66. package/src/components/manage/Preferences/ChangePassword.stories.jsx +41 -0
  67. package/src/components/manage/Preferences/PersonalInformation.jsx +50 -115
  68. package/src/components/manage/Preferences/PersonalPreferences.jsx +46 -100
  69. package/src/components/manage/Preferences/PersonalPreferences.stories.jsx +48 -0
  70. package/src/components/manage/Toolbar/More.jsx +308 -399
  71. package/src/components/manage/Widgets/DatetimeWidget.jsx +121 -175
  72. package/src/components/manage/Widgets/ReferenceWidget.jsx +134 -210
  73. package/src/components/theme/Register/Register.jsx +70 -142
  74. package/src/components/theme/Register/Register.stories.jsx +49 -0
  75. package/src/components/theme/Tags/Tags.jsx +19 -10
  76. package/src/components/theme/Tags/Tags.test.jsx +9 -11
  77. package/src/components/theme/View/AlbumView.jsx +122 -167
  78. package/src/components/theme/View/LinkView.jsx +4 -0
  79. package/src/components/theme/View/LinkView.test.jsx +2 -0
  80. package/src/components/theme/View/View.jsx +0 -6
  81. package/src/config/ControlPanels.js +49 -43
  82. package/src/config/config.test.js +1 -0
  83. package/src/config/index.js +16 -0
  84. package/src/config/slots.js +12 -0
  85. package/src/helpers/Blocks/Blocks.js +12 -7
  86. package/src/helpers/Blocks/Blocks.test.js +15 -0
  87. package/src/helpers/Blocks/cloneBlocks.ts +1 -1
  88. package/src/helpers/FormValidation/FormValidation.jsx +19 -2
  89. package/src/helpers/FormValidation/validators.ts +1 -1
  90. package/src/helpers/Url/Url.test.js +15 -2
  91. package/src/helpers/Url/urlRegex.js +1 -1
  92. package/src/helpers/index.js +2 -0
  93. package/src/middleware/api.js +4 -2
  94. package/src/middleware/index.js +1 -0
  95. package/src/middleware/userSessionReset.js +46 -0
  96. package/src/store.js +2 -0
  97. package/test-setup-config.jsx +3 -0
  98. package/theme/themes/pastanaga/extras/blocks.less +6 -0
  99. package/types/components/manage/Actions/Actions.stories.d.ts +8 -0
  100. package/types/components/manage/Blocks/LeadImage/Edit.d.ts +14 -5
  101. package/types/components/manage/Blocks/Search/widgets/SelectMetadataField.d.ts +0 -5
  102. package/types/components/manage/Blocks/ToC/Edit.d.ts +1 -6
  103. package/types/components/manage/Blocks/Video/Edit.d.ts +1 -1
  104. package/types/components/manage/Blocks/Video/Edit.stories.d.ts +8 -0
  105. package/types/components/manage/Contents/ContentsBreadcrumbs.stories.d.ts +8 -0
  106. package/types/components/manage/Contents/ContentsUploadModal.d.ts +14 -2
  107. package/types/components/manage/Contents/ContentsUploadModal.stories.d.ts +8 -0
  108. package/types/components/manage/Contents/index.d.ts +1 -1
  109. package/types/components/manage/Controlpanels/AddonsControlpanel.d.ts +2 -2
  110. package/types/components/manage/Controlpanels/Aliases.d.ts +2 -2
  111. package/types/components/manage/Controlpanels/Aliases.stories.d.ts +8 -0
  112. package/types/components/manage/Controlpanels/DatabaseInformation.d.ts +2 -2
  113. package/types/components/manage/Controlpanels/Groups/RenderGroups.d.ts +10 -5
  114. package/types/components/manage/Controlpanels/index.d.ts +4 -4
  115. package/types/components/manage/Display/Display.stories.d.ts +8 -0
  116. package/types/components/manage/Preferences/ChangePassword.d.ts +2 -2
  117. package/types/components/manage/Preferences/ChangePassword.stories.d.ts +8 -0
  118. package/types/components/manage/Preferences/PersonalInformation.d.ts +7 -2
  119. package/types/components/manage/Preferences/PersonalPreferences.d.ts +5 -1
  120. package/types/components/manage/Preferences/PersonalPreferences.stories.d.ts +8 -0
  121. package/types/components/manage/Toolbar/More.d.ts +8 -5
  122. package/types/components/manage/Widgets/DatetimeWidget.d.ts +0 -85
  123. package/types/components/manage/Widgets/DatetimeWidget.stories.d.ts +0 -1
  124. package/types/components/manage/Widgets/ReferenceWidget.d.ts +27 -2
  125. package/types/components/manage/Widgets/index.d.ts +1 -1
  126. package/types/components/theme/Register/Register.d.ts +2 -2
  127. package/types/components/theme/Register/Register.stories.d.ts +9 -0
  128. package/types/components/theme/Tags/Tags.d.ts +15 -7
  129. package/types/components/theme/View/AlbumView.d.ts +3 -17
  130. package/types/config/ControlPanels.d.ts +8 -0
  131. package/types/config/Widgets.d.ts +1 -1
  132. package/types/config/slots.d.ts +21 -0
  133. package/types/helpers/Blocks/Blocks.d.ts +6 -0
  134. package/types/helpers/FormValidation/FormValidation.d.ts +1 -0
  135. package/types/helpers/index.d.ts +2 -2
  136. package/types/middleware/index.d.ts +1 -0
  137. package/types/middleware/userSessionReset.d.ts +5 -0
@@ -22,6 +22,7 @@ const TeaserDefaultTemplate = (props) => {
22
22
  const intl = useIntl();
23
23
  const href = data.href?.[0];
24
24
  const image = data.preview_image?.[0];
25
+ const url = data.preview_image?.[0]?.['@id'];
25
26
 
26
27
  const Image = config.getComponent('Image').component;
27
28
  const { openExternalLinkInNewTab } = config.settings;
@@ -50,16 +51,22 @@ const TeaserDefaultTemplate = (props) => {
50
51
  }
51
52
  >
52
53
  <div className="teaser-item default">
53
- {(href.hasPreviewImage || href.image_field || image) && (
54
+ {url && !image?.image_field ? (
54
55
  <div className="image-wrapper">
55
- <Image
56
- item={image || href}
57
- imageField={image ? image.image_field : href.image_field}
58
- alt=""
59
- loading="lazy"
60
- responsive={true}
61
- />
56
+ <Image src={url} alt="" loading="lazy" responsive={true} />
62
57
  </div>
58
+ ) : (
59
+ (href.hasPreviewImage || href.image_field || image) && (
60
+ <div className="image-wrapper">
61
+ <Image
62
+ item={image || href}
63
+ imageField={image ? image.image_field : href.image_field}
64
+ alt=""
65
+ loading="lazy"
66
+ responsive={true}
67
+ />
68
+ </div>
69
+ )
63
70
  )}
64
71
  <div className="content">
65
72
  {data?.head_title && (
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import React from 'react';
2
2
 
3
3
  import { SidebarPortal } from '@plone/volto/components';
4
4
  import { BlockDataForm } from '@plone/volto/components/manage/Form';
@@ -6,35 +6,42 @@ import { BlockDataForm } from '@plone/volto/components/manage/Form';
6
6
  import TableOfContentsSchema from './Schema';
7
7
  import View from './View';
8
8
 
9
- class Edit extends Component {
10
- render() {
11
- const schema = TableOfContentsSchema(this.props);
9
+ const Edit = (props) => {
10
+ const {
11
+ onChangeBlock,
12
+ data,
13
+ block,
14
+ selected,
15
+ navRoot,
16
+ contentType,
17
+ blocksErrors,
18
+ } = props;
19
+ const schema = TableOfContentsSchema(props);
12
20
 
13
- return (
14
- <>
15
- <View {...this.props} mode="edit" />
21
+ return (
22
+ <>
23
+ <View {...props} mode="edit" />
16
24
 
17
- <SidebarPortal selected={this.props.selected}>
18
- <BlockDataForm
19
- schema={schema}
20
- title={schema.title}
21
- onChangeField={(id, value) => {
22
- this.props.onChangeBlock(this.props.block, {
23
- ...this.props.data,
24
- [id]: value,
25
- });
26
- }}
27
- onChangeBlock={this.props.onChangeBlock}
28
- formData={this.props.data}
29
- block={this.props.block}
30
- navRoot={this.props.navRoot}
31
- contentType={this.props.contentType}
32
- errors={this.props.blocksErrors}
33
- />
34
- </SidebarPortal>
35
- </>
36
- );
37
- }
38
- }
25
+ <SidebarPortal selected={selected}>
26
+ <BlockDataForm
27
+ schema={schema}
28
+ title={schema.title}
29
+ onChangeField={(id, value) => {
30
+ onChangeBlock(block, {
31
+ ...data,
32
+ [id]: value,
33
+ });
34
+ }}
35
+ onChangeBlock={onChangeBlock}
36
+ formData={data}
37
+ block={block}
38
+ navRoot={navRoot}
39
+ contentType={contentType}
40
+ errors={blocksErrors}
41
+ />
42
+ </SidebarPortal>
43
+ </>
44
+ );
45
+ };
39
46
 
40
47
  export default Edit;
@@ -1,14 +1,8 @@
1
- /**
2
- * Edit video block.
3
- * @module components/manage/Blocks/Title/Edit
4
- */
5
-
6
- import React, { Component } from 'react';
1
+ import React, { useState, useCallback, useMemo } from 'react';
7
2
  import PropTypes from 'prop-types';
8
- import { defineMessages, injectIntl } from 'react-intl';
3
+ import { defineMessages, useIntl } from 'react-intl';
9
4
  import { Button, Input, Message } from 'semantic-ui-react';
10
5
  import cx from 'classnames';
11
- import { isEqual } from 'lodash';
12
6
 
13
7
  import { Icon, SidebarPortal, VideoSidebar } from '@plone/volto/components';
14
8
  import clearSVG from '@plone/volto/icons/clear.svg';
@@ -16,7 +10,6 @@ import aheadSVG from '@plone/volto/icons/ahead.svg';
16
10
  import videoBlockSVG from '@plone/volto/components/manage/Blocks/Video/block-video.svg';
17
11
  import Body from '@plone/volto/components/manage/Blocks/Video/Body';
18
12
  import { withBlockExtensions } from '@plone/volto/helpers';
19
- import { compose } from 'redux';
20
13
 
21
14
  const messages = defineMessages({
22
15
  VideoFormDescription: {
@@ -29,183 +22,123 @@ const messages = defineMessages({
29
22
  },
30
23
  });
31
24
 
32
- /**
33
- * Edit video block class.
34
- * @class Edit
35
- * @extends Component
36
- */
37
- class Edit extends Component {
38
- /**
39
- * Property types.
40
- * @property {Object} propTypes Property types.
41
- * @static
42
- */
43
- static propTypes = {
44
- selected: PropTypes.bool.isRequired,
45
- block: PropTypes.string.isRequired,
46
- index: PropTypes.number.isRequired,
47
- data: PropTypes.objectOf(PropTypes.any).isRequired,
48
- onChangeBlock: PropTypes.func.isRequired,
49
- onSelectBlock: PropTypes.func.isRequired,
50
- onDeleteBlock: PropTypes.func.isRequired,
51
- onFocusPreviousBlock: PropTypes.func.isRequired,
52
- onFocusNextBlock: PropTypes.func.isRequired,
53
- handleKeyDown: PropTypes.func.isRequired,
54
- };
55
-
56
- /**
57
- * Constructor
58
- * @method constructor
59
- * @param {Object} props Component properties
60
- * @constructs WysiwygEditor
61
- */
62
- constructor(props) {
63
- super(props);
64
-
65
- this.onChangeUrl = this.onChangeUrl.bind(this);
66
- this.onSubmitUrl = this.onSubmitUrl.bind(this);
67
- this.onKeyDownVariantMenuForm = this.onKeyDownVariantMenuForm.bind(this);
68
- this.state = {
69
- url: '',
70
- };
71
- }
72
-
73
- /**
74
- * Change url handler
75
- * @method onChangeUrl
76
- * @param {Object} target Target object
77
- * @returns {undefined}
78
- */
79
- onChangeUrl({ target }) {
80
- this.setState({
81
- url: target.value,
82
- });
83
- }
25
+ const Edit = (props) => {
26
+ const { data, block, onChangeBlock, selected } = props;
27
+ const intl = useIntl();
28
+ const [url, setUrl] = useState('');
84
29
 
85
- /**
86
- * @param {*} nextProps
87
- * @returns {boolean}
88
- * @memberof Edit
89
- */
90
- shouldComponentUpdate(nextProps) {
91
- return (
92
- this.props.selected ||
93
- nextProps.selected ||
94
- !isEqual(this.props.data, nextProps.data)
95
- );
96
- }
30
+ const onChangeUrl = ({ target }) => {
31
+ setUrl(target.value);
32
+ };
97
33
 
98
- /**
99
- * Submit url handler
100
- * @method onSubmitUrl
101
- * @returns {undefined}
102
- */
103
- onSubmitUrl() {
104
- this.props.onChangeBlock(this.props.block, {
105
- ...this.props.data,
106
- url: this.state.url,
34
+ const onSubmitUrl = useCallback(() => {
35
+ onChangeBlock(block, {
36
+ ...data,
37
+ url: url,
107
38
  });
108
- }
39
+ }, [onChangeBlock, block, data, url]);
109
40
 
110
- resetSubmitUrl = () => {
111
- this.setState({
112
- url: '',
113
- });
41
+ const resetSubmitUrl = () => {
42
+ setUrl('');
114
43
  };
115
44
 
116
- /**
117
- * Keydown handler on Variant Menu Form
118
- * This is required since the ENTER key is already mapped to a onKeyDown
119
- * event and needs to be overridden with a child onKeyDown.
120
- * @method onKeyDownVariantMenuForm
121
- * @param {Object} e Event object
122
- * @returns {undefined}
123
- */
124
- onKeyDownVariantMenuForm(e) {
125
- if (e.key === 'Enter') {
126
- e.preventDefault();
127
- e.stopPropagation();
128
- this.onSubmitUrl();
129
- } else if (e.key === 'Escape') {
130
- e.preventDefault();
131
- e.stopPropagation();
132
- // TODO: Do something on ESC key
133
- }
134
- }
45
+ const onKeyDownVariantMenuForm = useCallback(
46
+ (e) => {
47
+ if (e.key === 'Enter') {
48
+ e.preventDefault();
49
+ e.stopPropagation();
50
+ onSubmitUrl();
51
+ } else if (e.key === 'Escape') {
52
+ e.preventDefault();
53
+ e.stopPropagation();
54
+ // TODO: Do something on ESC key
55
+ }
56
+ },
57
+ [onSubmitUrl],
58
+ );
135
59
 
136
- /**
137
- * Render method.
138
- * @method render
139
- * @returns {string} Markup for the component.
140
- */
141
- render() {
142
- const { data } = this.props;
143
- const placeholder =
144
- this.props.data.placeholder ||
145
- this.props.intl.formatMessage(messages.VideoBlockInputPlaceholder);
146
- return (
147
- <div
148
- className={cx(
149
- 'block video align',
150
- {
151
- selected: this.props.selected,
152
- center: !Boolean(this.props.data.align),
153
- },
154
- this.props.data.align,
155
- )}
156
- >
157
- {data.url ? (
158
- <Body data={this.props.data} isEditMode={true} />
159
- ) : (
160
- <Message>
161
- <center>
162
- <img src={videoBlockSVG} alt="" />
163
- <div className="toolbar-inner">
164
- <Input
165
- onKeyDown={this.onKeyDownVariantMenuForm}
166
- onChange={this.onChangeUrl}
167
- placeholder={placeholder}
168
- value={this.state.url}
169
- // Prevents propagation to the Dropzone and the opening
170
- // of the upload browser dialog
171
- onClick={(e) => e.stopPropagation()}
172
- />
173
- {this.state.url && (
174
- <Button.Group>
175
- <Button
176
- basic
177
- className="cancel"
178
- onClick={(e) => {
179
- e.stopPropagation();
180
- this.setState({ url: '' });
181
- }}
182
- >
183
- <Icon name={clearSVG} size="30px" />
184
- </Button>
185
- </Button.Group>
186
- )}
60
+ const placeholder = useMemo(
61
+ () =>
62
+ data.placeholder ||
63
+ intl.formatMessage(messages.VideoBlockInputPlaceholder),
64
+ [intl, data],
65
+ );
66
+
67
+ return (
68
+ <div
69
+ className={cx(
70
+ 'block video align',
71
+ {
72
+ selected: selected,
73
+ center: !Boolean(data.align),
74
+ },
75
+ data.align,
76
+ )}
77
+ >
78
+ {data.url ? (
79
+ <Body data={data} isEditMode={true} />
80
+ ) : (
81
+ <Message>
82
+ <center>
83
+ <img src={videoBlockSVG} alt="" />
84
+ <div className="toolbar-inner">
85
+ <Input
86
+ onKeyDown={onKeyDownVariantMenuForm}
87
+ onChange={onChangeUrl}
88
+ placeholder={placeholder}
89
+ value={url}
90
+ // Prevents propagation to the Dropzone and the opening
91
+ // of the upload browser dialog
92
+ onClick={(e) => e.stopPropagation()}
93
+ />
94
+ {url && (
187
95
  <Button.Group>
188
96
  <Button
189
97
  basic
190
- primary
98
+ className="cancel"
191
99
  onClick={(e) => {
192
100
  e.stopPropagation();
193
- this.onSubmitUrl();
101
+ setUrl('');
194
102
  }}
195
103
  >
196
- <Icon name={aheadSVG} size="30px" />
104
+ <Icon name={clearSVG} size="30px" />
197
105
  </Button>
198
106
  </Button.Group>
199
- </div>
200
- </center>
201
- </Message>
202
- )}
203
- <SidebarPortal selected={this.props.selected}>
204
- <VideoSidebar {...this.props} resetSubmitUrl={this.resetSubmitUrl} />
205
- </SidebarPortal>
206
- </div>
207
- );
208
- }
209
- }
107
+ )}
108
+ <Button.Group>
109
+ <Button
110
+ basic
111
+ primary
112
+ onClick={(e) => {
113
+ e.stopPropagation();
114
+ onSubmitUrl();
115
+ }}
116
+ >
117
+ <Icon name={aheadSVG} size="30px" />
118
+ </Button>
119
+ </Button.Group>
120
+ </div>
121
+ </center>
122
+ </Message>
123
+ )}
124
+ <SidebarPortal selected={selected}>
125
+ <VideoSidebar {...props} resetSubmitUrl={resetSubmitUrl} />
126
+ </SidebarPortal>
127
+ </div>
128
+ );
129
+ };
130
+
131
+ Edit.propTypes = {
132
+ selected: PropTypes.bool.isRequired,
133
+ block: PropTypes.string.isRequired,
134
+ index: PropTypes.number.isRequired,
135
+ data: PropTypes.objectOf(PropTypes.any).isRequired,
136
+ onChangeBlock: PropTypes.func.isRequired,
137
+ onSelectBlock: PropTypes.func.isRequired,
138
+ onDeleteBlock: PropTypes.func.isRequired,
139
+ onFocusPreviousBlock: PropTypes.func.isRequired,
140
+ onFocusNextBlock: PropTypes.func.isRequired,
141
+ handleKeyDown: PropTypes.func.isRequired,
142
+ };
210
143
 
211
- export default compose(injectIntl, withBlockExtensions)(Edit);
144
+ export default withBlockExtensions(Edit);
@@ -0,0 +1,57 @@
1
+ import { injectIntl } from 'react-intl';
2
+ import React from 'react';
3
+ import VideoComponent from './Edit';
4
+ import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook';
5
+
6
+ const IntlVideoComponent = injectIntl(VideoComponent);
7
+
8
+ function StoryComponent(args) {
9
+ return (
10
+ <Wrapper
11
+ customStore={{
12
+ intl: {
13
+ locale: 'en',
14
+ messages: {},
15
+ },
16
+ }}
17
+ >
18
+ <div id="toolbar" style={{ display: 'none' }} />
19
+ <IntlVideoComponent
20
+ data={{
21
+ ...args,
22
+ '@type': 'video',
23
+ }}
24
+ selected={false}
25
+ block="1234"
26
+ onChangeBlock={() => {}}
27
+ onSelectBlock={() => {}}
28
+ onDeleteBlock={() => {}}
29
+ onFocusPreviousBlock={() => {}}
30
+ onFocusNextBlock={() => {}}
31
+ handleKeyDown={() => {}}
32
+ index={1}
33
+ />
34
+ </Wrapper>
35
+ );
36
+ }
37
+
38
+ export const Video = StoryComponent.bind({});
39
+
40
+ Video.args = {
41
+ url: 'https://www.youtube.com/watch?v=ayjNbKju-8s',
42
+ };
43
+
44
+ export default {
45
+ title: 'Public components/Video/Video',
46
+ component: Video,
47
+ decorators: [
48
+ (Story) => (
49
+ <div className="ui segment form attached" style={{ width: '600px' }}>
50
+ <Story />
51
+ </div>
52
+ ),
53
+ ],
54
+ argTypes: {
55
+ // controlled value prop
56
+ },
57
+ };
@@ -1532,6 +1532,9 @@ class Contents extends Component {
1532
1532
  onCancel={this.onPropertiesCancel}
1533
1533
  onOk={this.onPropertiesOk}
1534
1534
  items={this.state.selected}
1535
+ values={map(this.state.selected, (id) =>
1536
+ find(this.state.items, { '@id': id }),
1537
+ ).filter((item) => item)}
1535
1538
  />
1536
1539
  {this.state.showWorkflow && (
1537
1540
  <ContentsWorkflowModal
@@ -0,0 +1,46 @@
1
+ import { injectIntl } from 'react-intl';
2
+ import React from 'react';
3
+ import ContentsBreadcrumbsComponent from './ContentsBreadcrumbs';
4
+ import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook';
5
+
6
+ const IntlContentBreadcrumbsComponent = injectIntl(
7
+ ContentsBreadcrumbsComponent,
8
+ );
9
+ const breadcrumbs = [
10
+ { title: 'Blog', url: '/blog' },
11
+ { title: 'My first blog', url: '/blog/my-first-blog' },
12
+ ];
13
+ function StoryComponent(args) {
14
+ return (
15
+ <Wrapper
16
+ customStore={{
17
+ intl: {
18
+ locale: 'en',
19
+ messages: {},
20
+ },
21
+ }}
22
+ >
23
+ <div id="toolbar" style={{ display: 'none' }} />
24
+ <IntlContentBreadcrumbsComponent
25
+ {...args}
26
+ pathname="/blog"
27
+ items={breadcrumbs}
28
+ />
29
+ </Wrapper>
30
+ );
31
+ }
32
+
33
+ export const ContentBreadcrumbs = StoryComponent.bind({});
34
+
35
+ export default {
36
+ title: 'Public components/Contents/Content Breadcrumbs',
37
+ component: ContentBreadcrumbs,
38
+ decorators: [
39
+ (Story) => (
40
+ <div className="ui segment form attached" style={{ width: '400px' }}>
41
+ <Story />
42
+ </div>
43
+ ),
44
+ ],
45
+ argTypes: {},
46
+ };