@plone/volto 18.0.0-alpha.35 → 18.0.0-alpha.36

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 (71) hide show
  1. package/.release-it.json +1 -1
  2. package/CHANGELOG.md +32 -0
  3. package/locales/ca/LC_MESSAGES/volto.po +41 -4
  4. package/locales/ca.json +1 -1
  5. package/locales/de/LC_MESSAGES/volto.po +41 -4
  6. package/locales/de.json +1 -1
  7. package/locales/en/LC_MESSAGES/volto.po +41 -4
  8. package/locales/en.json +1 -1
  9. package/locales/es/LC_MESSAGES/volto.po +41 -4
  10. package/locales/es.json +1 -1
  11. package/locales/eu/LC_MESSAGES/volto.po +41 -4
  12. package/locales/eu.json +1 -1
  13. package/locales/fi/LC_MESSAGES/volto.po +44 -7
  14. package/locales/fi.json +1 -1
  15. package/locales/fr/LC_MESSAGES/volto.po +41 -4
  16. package/locales/fr.json +1 -1
  17. package/locales/hi/LC_MESSAGES/volto.po +41 -4
  18. package/locales/hi.json +1 -1
  19. package/locales/it/LC_MESSAGES/volto.po +41 -4
  20. package/locales/it.json +1 -1
  21. package/locales/ja/LC_MESSAGES/volto.po +41 -4
  22. package/locales/ja.json +1 -1
  23. package/locales/nl/LC_MESSAGES/volto.po +41 -4
  24. package/locales/nl.json +1 -1
  25. package/locales/pt/LC_MESSAGES/volto.po +41 -4
  26. package/locales/pt.json +1 -1
  27. package/locales/pt_BR/LC_MESSAGES/volto.po +41 -4
  28. package/locales/pt_BR.json +1 -1
  29. package/locales/ro/LC_MESSAGES/volto.po +41 -4
  30. package/locales/ro.json +1 -1
  31. package/locales/volto.pot +42 -5
  32. package/locales/zh_CN/LC_MESSAGES/volto.po +41 -4
  33. package/locales/zh_CN.json +1 -1
  34. package/package.json +3 -3
  35. package/src/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +78 -72
  36. package/src/components/manage/AnchorPlugin/useLinkEditor.js +79 -0
  37. package/src/components/manage/Blocks/Image/Edit.jsx +45 -347
  38. package/src/components/manage/Blocks/Teaser/Data.jsx +69 -1
  39. package/src/components/manage/Blocks/Teaser/schema.js +24 -3
  40. package/src/components/manage/Form/BlocksToolbar.jsx +8 -7
  41. package/src/components/manage/Form/Form.jsx +8 -1
  42. package/src/components/manage/Form/InlineForm.jsx +4 -0
  43. package/src/components/manage/Widgets/ImageWidget.jsx +311 -0
  44. package/src/components/manage/Widgets/ImageWidget.stories.jsx +46 -0
  45. package/src/config/NonContentRoutes.jsx +2 -1
  46. package/src/config/Widgets.jsx +2 -0
  47. package/src/helpers/Blocks/cloneBlocks.test.js +54 -0
  48. package/src/helpers/Blocks/cloneBlocks.ts +43 -0
  49. package/src/icons/external-link.svg +4 -0
  50. package/theme/themes/pastanaga/collections/form.overrides +4 -0
  51. package/theme/themes/pastanaga/elements/button.overrides +2 -1
  52. package/theme/themes/pastanaga/extras/blocks.less +40 -4
  53. package/theme/themes/pastanaga/extras/grid.less +3 -3
  54. package/theme/themes/pastanaga/extras/teaser.less +53 -0
  55. package/theme/themes/pastanaga/extras/widgets.less +108 -0
  56. package/types/components/manage/AnchorPlugin/useLinkEditor.d.ts +7 -0
  57. package/types/components/manage/Blocks/Teaser/schema.d.ts +9 -2
  58. package/types/components/manage/Widgets/ImageWidget.d.ts +10 -0
  59. package/types/components/manage/Widgets/ImageWidget.stories.d.ts +11 -0
  60. package/types/config/Widgets.d.ts +2 -0
  61. package/types/helpers/Blocks/cloneBlocks.d.ts +1 -0
  62. package/types/helpers/Blocks/cloneBlocks.test.d.ts +1 -0
  63. /package/src/components/manage/Blocks/Image/{schema.js → schema.jsx} +0 -0
  64. /package/src/components/theme/LanguageSelector/{LanguageSelector.js → LanguageSelector.jsx} +0 -0
  65. /package/src/helpers/Extensions/{withBlockExtensions.js → withBlockExtensions.jsx} +0 -0
  66. /package/src/helpers/Extensions/{withBlockSchemaEnhancer.js → withBlockSchemaEnhancer.jsx} +0 -0
  67. /package/src/helpers/FormValidation/{FormValidation.js → FormValidation.jsx} +0 -0
  68. /package/src/helpers/Helmet/{Helmet.js → Helmet.jsx} +0 -0
  69. /package/src/helpers/Loadable/{Loadable.js → Loadable.jsx} +0 -0
  70. /package/src/helpers/Loadable/__mocks__/{Loadable.js → Loadable.jsx} +0 -0
  71. /package/src/helpers/Utils/{Utils.js → Utils.jsx} +0 -0
@@ -172,3 +172,111 @@ body.babel-view .field.language-independent-field {
172
172
  }
173
173
  }
174
174
  }
175
+
176
+ .image-widget {
177
+ container-type: inline-size;
178
+
179
+ .no-image-wrapper {
180
+ display: flex;
181
+ width: ~'min(100%, 450px)';
182
+ flex-direction: column;
183
+ align-items: center;
184
+ }
185
+
186
+ .toolbar-inner {
187
+ display: flex;
188
+ width: ~'min(100%, 450px)';
189
+ height: 40px;
190
+ padding: 4px;
191
+ border-radius: 2px;
192
+ background-color: rgba(255, 255, 255, 0.975);
193
+ box-shadow:
194
+ 0 0 8px rgba(0, 0, 0, 0.1),
195
+ 0 2px 4px rgba(0, 0, 0, 0.05);
196
+
197
+ .ui.form & .ui.input input[type='text'] {
198
+ height: initial;
199
+ }
200
+
201
+ & > svg {
202
+ display: inline-block !important;
203
+ box-sizing: content-box;
204
+ padding: 4px;
205
+ margin-right: 4px;
206
+ color: @brown !important;
207
+ }
208
+
209
+ .ui.input {
210
+ width: 100%;
211
+ margin-left: 8px;
212
+ }
213
+
214
+ .ui.input > input {
215
+ padding: 0;
216
+ border: none;
217
+ }
218
+
219
+ .ui.icon.button {
220
+ padding: 4px;
221
+ border-radius: 1px;
222
+ margin-left: -3px;
223
+ color: @brown !important;
224
+
225
+ &:hover {
226
+ background-color: #edf1f2 !important;
227
+ }
228
+ }
229
+
230
+ .ui.buttons:first-child {
231
+ & .ui.icon.button {
232
+ margin-left: 0;
233
+ }
234
+ }
235
+ }
236
+
237
+ @blueArctic: #e2f1fd;
238
+ @greySnow: #f3f5f7;
239
+ @greySmoke: #e4e8ec;
240
+
241
+ .image-widget-preview-wrapper {
242
+ position: relative;
243
+ }
244
+
245
+ .ui.basic.button.remove-block-button {
246
+ position: absolute;
247
+ z-index: 2;
248
+ top: 6px;
249
+ right: 2px;
250
+ background-color: transparent;
251
+ box-shadow: none;
252
+
253
+ .icon {
254
+ height: 18px !important;
255
+ }
256
+
257
+ .circled {
258
+ padding: 8px;
259
+ border: 1px solid @greySmoke;
260
+ background: @greySnow;
261
+
262
+ &:hover {
263
+ background-color: @greySmoke;
264
+ }
265
+ }
266
+
267
+ &:hover {
268
+ background-color: transparent !important;
269
+ }
270
+ }
271
+
272
+ .image-widget-filepath-preview {
273
+ display: flex;
274
+ align-items: center;
275
+ padding: 5px;
276
+ word-break: break-all;
277
+
278
+ a {
279
+ margin-left: 5px;
280
+ }
281
+ }
282
+ }
@@ -0,0 +1,7 @@
1
+ export default useLinkEditor;
2
+ declare function useLinkEditor(): {
3
+ anchorNode: React.MutableRefObject<undefined>;
4
+ show: () => void;
5
+ LinkEditor: (props: any) => import("react/jsx-runtime").JSX.Element;
6
+ };
7
+ import React from 'react';
@@ -1,4 +1,5 @@
1
- export function TeaserSchema({ intl }: {
1
+ export function TeaserSchema({ data, intl }: {
2
+ data: any;
2
3
  intl: any;
3
4
  }): {
4
5
  title: any;
@@ -15,6 +16,12 @@ export function TeaserSchema({ intl }: {
15
16
  selectedItemAttrs: string[];
16
17
  allowExternals: boolean;
17
18
  };
19
+ overwrite: {
20
+ title: any;
21
+ description: any;
22
+ type: string;
23
+ default: boolean;
24
+ };
18
25
  title: {
19
26
  title: any;
20
27
  };
@@ -37,7 +44,7 @@ export function TeaserSchema({ intl }: {
37
44
  type: string;
38
45
  };
39
46
  };
40
- required: any[];
47
+ required: string[];
41
48
  };
42
49
  export function gridTeaserDisableStylingSchema({ schema, formData, intl }: {
43
50
  schema: any;
@@ -0,0 +1,10 @@
1
+ export function ImageToolbar({ className, data, id, onChange, selected }: {
2
+ className: any;
3
+ data: any;
4
+ id: any;
5
+ onChange: any;
6
+ selected: any;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export const ImageInput: any;
9
+ export default ImageUploadWidget;
10
+ declare function ImageUploadWidget(props: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ export const Default: any;
2
+ export const Filled: any;
3
+ export const Inline: any;
4
+ declare namespace _default {
5
+ export let title: string;
6
+ export { ImageWidget as component };
7
+ export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
8
+ export let argTypes: {};
9
+ }
10
+ export default _default;
11
+ import ImageWidget from './ImageWidget';
@@ -14,6 +14,7 @@ export namespace widgetMapping {
14
14
  export { DatetimeWidget as date };
15
15
  export { PasswordWidget as password };
16
16
  export { FileWidget as file };
17
+ export { ImageWidget as image };
17
18
  export { AlignWidget as align };
18
19
  export { ButtonsWidget as buttons };
19
20
  export { UrlWidget as url };
@@ -108,6 +109,7 @@ import { TextareaWidget } from '@plone/volto/components/manage/Widgets';
108
109
  import { DatetimeWidget } from '@plone/volto/components/manage/Widgets';
109
110
  import { PasswordWidget } from '@plone/volto/components/manage/Widgets';
110
111
  import { FileWidget } from '@plone/volto/components/manage/Widgets';
112
+ import ImageWidget from '@plone/volto/components/manage/Widgets/ImageWidget';
111
113
  import { AlignWidget } from '@plone/volto/components/manage/Widgets';
112
114
  import { ButtonsWidget } from '@plone/volto/components/manage/Widgets';
113
115
  import { InternalUrlWidget } from '@plone/volto/components/manage/Widgets';
@@ -0,0 +1 @@
1
+ export declare function cloneBlocks(blocksData: any): any;
@@ -0,0 +1 @@
1
+ export {};
File without changes
File without changes