@plone/volto 19.0.0-alpha.29 → 19.0.0-alpha.30

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 (165) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/locales/af/LC_MESSAGES/volto.po +45 -0
  3. package/locales/af.json +1 -1
  4. package/locales/ar/LC_MESSAGES/volto.po +45 -0
  5. package/locales/ar.json +1 -1
  6. package/locales/bg/LC_MESSAGES/volto.po +45 -0
  7. package/locales/bg.json +1 -1
  8. package/locales/bn/LC_MESSAGES/volto.po +45 -0
  9. package/locales/bn.json +1 -1
  10. package/locales/ca/LC_MESSAGES/volto.po +45 -0
  11. package/locales/ca.json +1 -1
  12. package/locales/cs/LC_MESSAGES/volto.po +45 -0
  13. package/locales/cs.json +1 -1
  14. package/locales/cy/LC_MESSAGES/volto.po +45 -0
  15. package/locales/cy.json +1 -1
  16. package/locales/da/LC_MESSAGES/volto.po +45 -0
  17. package/locales/da.json +1 -1
  18. package/locales/de/LC_MESSAGES/volto.po +45 -0
  19. package/locales/de.json +1 -1
  20. package/locales/el/LC_MESSAGES/volto.po +45 -0
  21. package/locales/el.json +1 -1
  22. package/locales/en/LC_MESSAGES/volto.po +45 -0
  23. package/locales/en.json +1 -1
  24. package/locales/en_AU/LC_MESSAGES/volto.po +45 -0
  25. package/locales/en_AU.json +1 -1
  26. package/locales/en_GB/LC_MESSAGES/volto.po +45 -0
  27. package/locales/en_GB.json +1 -1
  28. package/locales/eo/LC_MESSAGES/volto.po +45 -0
  29. package/locales/eo.json +1 -1
  30. package/locales/es/LC_MESSAGES/volto.po +45 -0
  31. package/locales/es.json +1 -1
  32. package/locales/et/LC_MESSAGES/volto.po +45 -0
  33. package/locales/et.json +1 -1
  34. package/locales/eu/LC_MESSAGES/volto.po +45 -0
  35. package/locales/eu.json +1 -1
  36. package/locales/fa/LC_MESSAGES/volto.po +45 -0
  37. package/locales/fa.json +1 -1
  38. package/locales/fi/LC_MESSAGES/volto.po +45 -0
  39. package/locales/fi.json +1 -1
  40. package/locales/fr/LC_MESSAGES/volto.po +45 -0
  41. package/locales/fr.json +1 -1
  42. package/locales/fu/LC_MESSAGES/volto.po +45 -0
  43. package/locales/fu.json +1 -1
  44. package/locales/gl/LC_MESSAGES/volto.po +45 -0
  45. package/locales/gl.json +1 -1
  46. package/locales/he/LC_MESSAGES/volto.po +45 -0
  47. package/locales/he.json +1 -1
  48. package/locales/hi/LC_MESSAGES/volto.po +45 -0
  49. package/locales/hi.json +1 -1
  50. package/locales/hr/LC_MESSAGES/volto.po +45 -0
  51. package/locales/hr.json +1 -1
  52. package/locales/hu/LC_MESSAGES/volto.po +45 -0
  53. package/locales/hu.json +1 -1
  54. package/locales/hy/LC_MESSAGES/volto.po +45 -0
  55. package/locales/hy.json +1 -1
  56. package/locales/id/LC_MESSAGES/volto.po +45 -0
  57. package/locales/id.json +1 -1
  58. package/locales/it/LC_MESSAGES/volto.po +45 -0
  59. package/locales/it.json +1 -1
  60. package/locales/ja/LC_MESSAGES/volto.po +45 -0
  61. package/locales/ja.json +1 -1
  62. package/locales/ka/LC_MESSAGES/volto.po +45 -0
  63. package/locales/ka.json +1 -1
  64. package/locales/kn/LC_MESSAGES/volto.po +45 -0
  65. package/locales/kn.json +1 -1
  66. package/locales/ko/LC_MESSAGES/volto.po +45 -0
  67. package/locales/ko.json +1 -1
  68. package/locales/lt/LC_MESSAGES/volto.po +45 -0
  69. package/locales/lt.json +1 -1
  70. package/locales/lv/LC_MESSAGES/volto.po +45 -0
  71. package/locales/lv.json +1 -1
  72. package/locales/mi/LC_MESSAGES/volto.po +45 -0
  73. package/locales/mi.json +1 -1
  74. package/locales/mk/LC_MESSAGES/volto.po +45 -0
  75. package/locales/mk.json +1 -1
  76. package/locales/my/LC_MESSAGES/volto.po +45 -0
  77. package/locales/my.json +1 -1
  78. package/locales/nb_NO/LC_MESSAGES/volto.po +45 -0
  79. package/locales/nb_NO.json +1 -1
  80. package/locales/nl/LC_MESSAGES/volto.po +45 -0
  81. package/locales/nl.json +1 -1
  82. package/locales/nn/LC_MESSAGES/volto.po +45 -0
  83. package/locales/nn.json +1 -1
  84. package/locales/pl/LC_MESSAGES/volto.po +45 -0
  85. package/locales/pl.json +1 -1
  86. package/locales/pt/LC_MESSAGES/volto.po +45 -0
  87. package/locales/pt.json +1 -1
  88. package/locales/pt_BR/LC_MESSAGES/volto.po +45 -0
  89. package/locales/pt_BR.json +1 -1
  90. package/locales/rm/LC_MESSAGES/volto.po +45 -0
  91. package/locales/rm.json +1 -1
  92. package/locales/ro/LC_MESSAGES/volto.po +100 -55
  93. package/locales/ro.json +1 -1
  94. package/locales/ru/LC_MESSAGES/volto.po +45 -0
  95. package/locales/ru.json +1 -1
  96. package/locales/sk/LC_MESSAGES/volto.po +45 -0
  97. package/locales/sk.json +1 -1
  98. package/locales/sl/LC_MESSAGES/volto.po +45 -0
  99. package/locales/sl.json +1 -1
  100. package/locales/sm/LC_MESSAGES/volto.po +45 -0
  101. package/locales/sm.json +1 -1
  102. package/locales/sq/LC_MESSAGES/volto.po +45 -0
  103. package/locales/sq.json +1 -1
  104. package/locales/sr/LC_MESSAGES/volto.po +45 -0
  105. package/locales/sr.json +1 -1
  106. package/locales/sr@cyrl/LC_MESSAGES/volto.po +45 -0
  107. package/locales/sr@cyrl.json +1 -1
  108. package/locales/sr@latn/LC_MESSAGES/volto.po +45 -0
  109. package/locales/sr@latn.json +1 -1
  110. package/locales/sv/LC_MESSAGES/volto.po +45 -0
  111. package/locales/sv.json +1 -1
  112. package/locales/ta/LC_MESSAGES/volto.po +45 -0
  113. package/locales/ta.json +1 -1
  114. package/locales/te/LC_MESSAGES/volto.po +45 -0
  115. package/locales/te.json +1 -1
  116. package/locales/th/LC_MESSAGES/volto.po +45 -0
  117. package/locales/th.json +1 -1
  118. package/locales/to/LC_MESSAGES/volto.po +45 -0
  119. package/locales/to.json +1 -1
  120. package/locales/tr/LC_MESSAGES/volto.po +45 -0
  121. package/locales/tr.json +1 -1
  122. package/locales/uk/LC_MESSAGES/volto.po +45 -0
  123. package/locales/uk.json +1 -1
  124. package/locales/vi/LC_MESSAGES/volto.po +45 -0
  125. package/locales/vi.json +1 -1
  126. package/locales/volto.pot +46 -1
  127. package/locales/zh_CN/LC_MESSAGES/volto.po +45 -0
  128. package/locales/zh_CN.json +1 -1
  129. package/locales/zh_Hant/LC_MESSAGES/volto.po +45 -0
  130. package/locales/zh_Hant.json +1 -1
  131. package/locales/zh_Hant_HK/LC_MESSAGES/volto.po +45 -0
  132. package/locales/zh_Hant_HK.json +1 -1
  133. package/package.json +26 -28
  134. package/src/components/manage/Blocks/Block/Order/Item.jsx +18 -10
  135. package/src/components/manage/Blocks/Block/Order/Item.test.jsx +90 -0
  136. package/src/components/manage/Contents/ContentsBreadcrumbs.jsx +4 -3
  137. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.test.jsx +3 -0
  138. package/src/components/manage/Toast/Toast.jsx +32 -0
  139. package/src/components/manage/Toast/Toast.test.jsx +9 -5
  140. package/src/components/manage/Widgets/UrlWidget.jsx +47 -18
  141. package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.jsx +1 -0
  142. package/src/components/theme/AlternateHrefLangs/AlternateHrefLangs.test.jsx +30 -0
  143. package/src/components/theme/Sitemap/Sitemap.stories.jsx +82 -0
  144. package/src/components/theme/Unauthorized/Unauthorized.jsx +30 -23
  145. package/src/components/theme/Unauthorized/Unauthorized.test.jsx +28 -1
  146. package/src/components/theme/View/EventView.stories.jsx +89 -0
  147. package/src/components/theme/View/FileView.stories.jsx +50 -0
  148. package/src/components/theme/View/LinkView.stories.jsx +57 -0
  149. package/src/components/theme/View/ListingView.stories.jsx +70 -0
  150. package/src/components/theme/View/NewsItemView.stories.jsx +58 -0
  151. package/src/components/theme/View/RenderBlocks.stories.jsx +112 -0
  152. package/src/components/theme/View/SummaryView.stories.jsx +71 -0
  153. package/src/components/theme/View/TabularView.stories.jsx +66 -0
  154. package/src/helpers/FormValidation/validators.ts +15 -2
  155. package/theme/themes/pastanaga/extras/main.less +1 -0
  156. package/types/components/manage/Blocks/Block/Order/Item.test.d.ts +1 -0
  157. package/types/components/theme/Sitemap/Sitemap.stories.d.ts +13 -0
  158. package/types/components/theme/View/EventView.stories.d.ts +19 -0
  159. package/types/components/theme/View/FileView.stories.d.ts +18 -0
  160. package/types/components/theme/View/LinkView.stories.d.ts +18 -0
  161. package/types/components/theme/View/ListingView.stories.d.ts +24 -0
  162. package/types/components/theme/View/NewsItemView.stories.d.ts +23 -0
  163. package/types/components/theme/View/RenderBlocks.stories.d.ts +23 -0
  164. package/types/components/theme/View/SummaryView.stories.d.ts +23 -0
  165. package/types/components/theme/View/TabularView.stories.d.ts +23 -0
@@ -0,0 +1,66 @@
1
+ import { injectIntl } from 'react-intl';
2
+ import React from 'react';
3
+ import TabularViewComponent from './TabularView';
4
+ import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook';
5
+
6
+ const IntlTabularViewComponent = injectIntl(TabularViewComponent);
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
+ <IntlTabularViewComponent
20
+ content={{
21
+ ...args,
22
+ }}
23
+ />
24
+ </Wrapper>
25
+ );
26
+ }
27
+
28
+ export const Default = StoryComponent.bind({});
29
+ Default.args = {
30
+ title: 'Hello World!',
31
+ description: 'Hi',
32
+ items: [
33
+ {
34
+ title: 'My item 1',
35
+ description: 'My item description 1',
36
+ url: '/item1',
37
+ },
38
+ {
39
+ title: 'My item 2',
40
+ description: 'My item description 2',
41
+ url: '/item2',
42
+ },
43
+ ],
44
+ };
45
+ export default {
46
+ title: 'Public components/View/TabularView',
47
+ component: TabularViewComponent,
48
+ decorators: [
49
+ (Story) => (
50
+ <div className="ui segment form attached" style={{ width: '900px' }}>
51
+ <Story />
52
+ </div>
53
+ ),
54
+ ],
55
+ argTypes: {
56
+ title: {
57
+ description: 'Title of the page listed',
58
+ },
59
+ description: {
60
+ description: 'Description of the page',
61
+ },
62
+ items: {
63
+ description: 'Row items of the page',
64
+ },
65
+ },
66
+ };
@@ -153,6 +153,15 @@ export const hasUniqueItemsValidator = ({
153
153
  return !isValid ? formatMessage(messages.uniqueItems) : null;
154
154
  };
155
155
 
156
+ const formatDateValue = (isoString: string) => {
157
+ const date = new Date(isoString);
158
+ if (isNaN(date.getTime())) return isoString;
159
+ return new Intl.DateTimeFormat(undefined, {
160
+ dateStyle: 'medium',
161
+ timeStyle: 'short',
162
+ }).format(date);
163
+ };
164
+
156
165
  export const startEventDateRangeValidator = ({
157
166
  value,
158
167
  field,
@@ -163,7 +172,9 @@ export const startEventDateRangeValidator = ({
163
172
  value && formData.end && new Date(value) < new Date(formData.end);
164
173
  return !isValid
165
174
  ? formatMessage(messages.startEventRange, {
166
- endDateValueOrEndFieldName: formData.end || 'end',
175
+ endDateValueOrEndFieldName: formData.end
176
+ ? formatDateValue(formData.end)
177
+ : 'end',
167
178
  })
168
179
  : null;
169
180
  };
@@ -178,7 +189,9 @@ export const endEventDateRangeValidator = ({
178
189
  value && formData.start && new Date(value) > new Date(formData.start);
179
190
  return !isValid
180
191
  ? formatMessage(messages.endEventRange, {
181
- startDateValueOrStartFieldName: formData.start || 'start',
192
+ startDateValueOrStartFieldName: formData.start
193
+ ? formatDateValue(formData.start)
194
+ : 'start',
182
195
  })
183
196
  : null;
184
197
  };
@@ -363,6 +363,7 @@ button {
363
363
  margin-left: 8px;
364
364
 
365
365
  h4 {
366
+ display: inline;
366
367
  margin-bottom: 0;
367
368
  font-weight: @bold;
368
369
  }
@@ -0,0 +1,13 @@
1
+ export const Sitemap: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { Sitemap as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ namespace items {
8
+ let control: string;
9
+ let description: string;
10
+ }
11
+ }
12
+ }
13
+ export default _default;
@@ -0,0 +1,19 @@
1
+ export const Default: any;
2
+ export const EventViewAllProps: any;
3
+ export const EventViewWithoutLinkToApiInTheText: any;
4
+ declare namespace _default {
5
+ export let title: string;
6
+ export { EventViewComponent as component };
7
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
8
+ export namespace argTypes {
9
+ namespace end {
10
+ let control: string;
11
+ }
12
+ namespace start {
13
+ let control_1: string;
14
+ export { control_1 as control };
15
+ }
16
+ }
17
+ }
18
+ export default _default;
19
+ import EventViewComponent from './EventView';
@@ -0,0 +1,18 @@
1
+ export const Default: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { FileViewComponent as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ export namespace title_1 {
8
+ let description: string;
9
+ }
10
+ export { title_1 as title };
11
+ export namespace filename {
12
+ let description_1: string;
13
+ export { description_1 as description };
14
+ }
15
+ }
16
+ }
17
+ export default _default;
18
+ import FileViewComponent from './FileView';
@@ -0,0 +1,18 @@
1
+ export const Default: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { LinkViewComponent as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ export namespace title_1 {
8
+ let description: string;
9
+ }
10
+ export { title_1 as title };
11
+ export namespace remoteUrl {
12
+ let description_1: string;
13
+ export { description_1 as description };
14
+ }
15
+ }
16
+ }
17
+ export default _default;
18
+ import LinkViewComponent from './LinkView';
@@ -0,0 +1,24 @@
1
+ export const Default: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { ListingViewComponent as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ export namespace items {
8
+ let control: string;
9
+ let description: string;
10
+ }
11
+ export namespace title_1 {
12
+ let description_1: string;
13
+ export { description_1 as description };
14
+ }
15
+ export { title_1 as title };
16
+ export namespace description_2 {
17
+ let description_3: string;
18
+ export { description_3 as description };
19
+ }
20
+ export { description_2 as description };
21
+ }
22
+ }
23
+ export default _default;
24
+ import ListingViewComponent from './ListingView';
@@ -0,0 +1,23 @@
1
+ export const Default: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { NewsItemViewComponent as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ export namespace title_1 {
8
+ let description: string;
9
+ }
10
+ export { title_1 as title };
11
+ export namespace description_1 {
12
+ let description_2: string;
13
+ export { description_2 as description };
14
+ }
15
+ export { description_1 as description };
16
+ export namespace text {
17
+ let description_3: string;
18
+ export { description_3 as description };
19
+ }
20
+ }
21
+ }
22
+ export default _default;
23
+ import NewsItemViewComponent from './NewsItemView';
@@ -0,0 +1,23 @@
1
+ export const Default: any;
2
+ export const PathToBlocks: any;
3
+ export const InvalidBlocks: any;
4
+ declare namespace _default {
5
+ export let title: string;
6
+ export { RenderBlocksComponent as component };
7
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
8
+ export namespace argTypes {
9
+ namespace view {
10
+ let description: string;
11
+ }
12
+ namespace blocks {
13
+ let description_1: string;
14
+ export { description_1 as description };
15
+ }
16
+ namespace blocks_layout {
17
+ let description_2: string;
18
+ export { description_2 as description };
19
+ }
20
+ }
21
+ }
22
+ export default _default;
23
+ import RenderBlocksComponent from './RenderBlocks';
@@ -0,0 +1,23 @@
1
+ export const Default: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { SummaryViewComponent as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ export namespace title_1 {
8
+ let description: string;
9
+ }
10
+ export { title_1 as title };
11
+ export namespace description_1 {
12
+ let description_2: string;
13
+ export { description_2 as description };
14
+ }
15
+ export { description_1 as description };
16
+ export namespace items {
17
+ let description_3: string;
18
+ export { description_3 as description };
19
+ }
20
+ }
21
+ }
22
+ export default _default;
23
+ import SummaryViewComponent from './SummaryView';
@@ -0,0 +1,23 @@
1
+ export const Default: any;
2
+ declare namespace _default {
3
+ export let title: string;
4
+ export { TabularViewComponent as component };
5
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
6
+ export namespace argTypes {
7
+ export namespace title_1 {
8
+ let description: string;
9
+ }
10
+ export { title_1 as title };
11
+ export namespace description_1 {
12
+ let description_2: string;
13
+ export { description_2 as description };
14
+ }
15
+ export { description_1 as description };
16
+ export namespace items {
17
+ let description_3: string;
18
+ export { description_3 as description };
19
+ }
20
+ }
21
+ }
22
+ export default _default;
23
+ import TabularViewComponent from './TabularView';