design-comuni-plone-theme 11.10.1 → 12.0.0-alpha.1

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 (194) hide show
  1. package/.github/workflows/slate.yml +47 -0
  2. package/.yarn/cache/@babel-helper-module-imports-npm-7.24.3-edb733448b-c23492189b.zip +0 -0
  3. package/.yarn/cache/@babel-types-npm-7.24.0-a0508cb308-4b574a37d4.zip +0 -0
  4. package/.yarn/cache/babel-plugin-lodash-npm-3.3.4-c7161075b6-044a4261e6.zip +0 -0
  5. package/.yarn/cache/require-package-name-npm-2.0.1-ac9a206b63-00f4e9e467.zip +0 -0
  6. package/.yarn/cache/{volto-form-block-npm-3.7.2-f24953a510-7387a1b85a.zip → volto-form-block-npm-3.8.2-e49cbe07d5-5b72a06a5e.zip} +0 -0
  7. package/.yarn/install-state.gz +0 -0
  8. package/CHANGELOG.md +878 -904
  9. package/RELEASE.md +8 -0
  10. package/locales/de/LC_MESSAGES/volto.po +86 -18
  11. package/locales/en/LC_MESSAGES/volto.po +86 -18
  12. package/locales/es/LC_MESSAGES/volto.po +86 -18
  13. package/locales/fr/LC_MESSAGES/volto.po +86 -18
  14. package/locales/it/LC_MESSAGES/volto.po +86 -18
  15. package/locales/volto.pot +87 -19
  16. package/package.json +4 -2
  17. package/publiccode.yml +2 -2
  18. package/src/components/Collapse.jsx +1 -0
  19. package/src/components/ItaliaTheme/Blocks/Accordion/Block/EditBlock.jsx +29 -24
  20. package/src/components/ItaliaTheme/Blocks/Accordion/Block/ViewBlock.jsx +4 -12
  21. package/src/components/ItaliaTheme/Blocks/Accordion/Edit.jsx +67 -6
  22. package/src/components/ItaliaTheme/Blocks/Alert/Edit.jsx +60 -113
  23. package/src/components/ItaliaTheme/Blocks/Alert/Sidebar.jsx +1 -0
  24. package/src/components/ItaliaTheme/Blocks/Alert/View.jsx +5 -14
  25. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Block.jsx +16 -11
  26. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Body.jsx +2 -1
  27. package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Edit.jsx +39 -1
  28. package/src/components/ItaliaTheme/Blocks/CTABlock/Block.jsx +35 -95
  29. package/src/components/ItaliaTheme/Blocks/Callout/Edit.jsx +108 -0
  30. package/src/components/ItaliaTheme/Blocks/Callout/Sidebar.jsx +173 -0
  31. package/src/components/ItaliaTheme/Blocks/Callout/View.jsx +45 -0
  32. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Block/EditBlock.jsx +84 -63
  33. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Block/ViewBlock.jsx +19 -39
  34. package/src/components/ItaliaTheme/Blocks/ContactsBlock/Edit.jsx +92 -19
  35. package/src/components/ItaliaTheme/Blocks/ContactsBlock/View.jsx +13 -21
  36. package/src/components/ItaliaTheme/Blocks/CountDown/Edit.jsx +21 -25
  37. package/src/components/ItaliaTheme/Blocks/CountDown/View.jsx +6 -15
  38. package/src/components/ItaliaTheme/Blocks/IconBlocks/Block/EditBlock.jsx +40 -15
  39. package/src/components/ItaliaTheme/Blocks/IconBlocks/Block/ViewBlock.jsx +6 -21
  40. package/src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx +93 -20
  41. package/src/components/ItaliaTheme/Blocks/IconBlocks/Sidebar.jsx +1 -9
  42. package/src/components/ItaliaTheme/Blocks/IconBlocks/View.jsx +4 -17
  43. package/src/components/ItaliaTheme/Blocks/NumbersBlock/Block/EditBlock.jsx +46 -15
  44. package/src/components/ItaliaTheme/Blocks/NumbersBlock/Block/ViewBlock.jsx +2 -18
  45. package/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx +84 -11
  46. package/src/components/ItaliaTheme/Blocks/NumbersBlock/View.jsx +2 -11
  47. package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx +33 -67
  48. package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Edit.jsx +2 -8
  49. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/BodyWrapper.jsx +2 -1
  50. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Edit.jsx +98 -84
  51. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/View.jsx +20 -3
  52. package/src/components/ItaliaTheme/Blocks/__tests__/Accordion.test.jsx +11 -28
  53. package/src/components/ItaliaTheme/Blocks/__tests__/Alert.test.jsx +10 -14
  54. package/src/components/ItaliaTheme/Blocks/__tests__/ArgumentsInEvidence.test.jsx +20 -28
  55. package/src/components/ItaliaTheme/Blocks/__tests__/CTABlock.test.jsx +14 -29
  56. package/src/components/ItaliaTheme/Blocks/__tests__/CardWithImage.test.jsx +11 -28
  57. package/src/components/ItaliaTheme/Blocks/__tests__/ContactsBlock.test.jsx +75 -140
  58. package/src/components/ItaliaTheme/Blocks/__tests__/Countdown.test.jsx +20 -28
  59. package/src/components/ItaliaTheme/Blocks/__tests__/IconBlocks.test.jsx +22 -56
  60. package/src/components/ItaliaTheme/Blocks/__tests__/NumbersBlock.test.jsx +14 -43
  61. package/src/components/ItaliaTheme/Blocks/__tests__/SimpleCard.test.jsx +14 -30
  62. package/src/components/ItaliaTheme/Footer/FooterInfos.jsx +22 -8
  63. package/src/components/ItaliaTheme/Footer/FooterNavigation.jsx +3 -3
  64. package/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx +5 -1
  65. package/src/components/ItaliaTheme/Slider/SingleSlideWrapper.jsx +2 -3
  66. package/src/components/ItaliaTheme/View/BandoView/BandoApprofondimenti.jsx +1 -2
  67. package/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx +14 -5
  68. package/src/components/ItaliaTheme/View/Commons/Attachment.jsx +19 -3
  69. package/src/components/ItaliaTheme/View/Commons/Attachments.jsx +0 -1
  70. package/src/components/ItaliaTheme/View/Commons/DownloadFileFormat.jsx +11 -7
  71. package/src/components/ItaliaTheme/View/Commons/Module.jsx +7 -6
  72. package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeaderLinkServizio.jsx +6 -2
  73. package/src/components/ItaliaTheme/View/Commons/RichTextRender.jsx +8 -6
  74. package/src/components/ItaliaTheme/View/Commons/__tests__/RichText.test.jsx +14 -17
  75. package/src/components/ItaliaTheme/View/ServizioView/ServizioAccedi.jsx +5 -6
  76. package/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx +4 -0
  77. package/src/components/ItaliaTheme/View/__tests__/CartellaModulisticaView.test.jsx +12 -1
  78. package/src/components/ItaliaTheme/View/__tests__/IncaricoView.test.jsx +24 -30
  79. package/src/components/ItaliaTheme/View/__tests__/PageView.test.jsx +24 -2
  80. package/src/components/ItaliaTheme/View/__tests__/PersonaView.test.jsx +96 -92
  81. package/src/components/ItaliaTheme/View/__tests__/ServizioAChiSiRivolge.test.jsx +240 -286
  82. package/src/components/ItaliaTheme/View/__tests__/ServizioAccedi.test.jsx +240 -286
  83. package/src/components/ItaliaTheme/View/__tests__/ServizioCasiParticolari.test.jsx +240 -286
  84. package/src/components/ItaliaTheme/View/__tests__/ServizioComeFare.test.jsx +240 -286
  85. package/src/components/ItaliaTheme/View/__tests__/ServizioCondizioni.test.jsx +240 -286
  86. package/src/components/ItaliaTheme/View/__tests__/ServizioContatti.test.jsx +240 -286
  87. package/src/components/ItaliaTheme/View/__tests__/ServizioCosE.test.jsx +240 -286
  88. package/src/components/ItaliaTheme/View/__tests__/ServizioCosaServe.test.jsx +240 -286
  89. package/src/components/ItaliaTheme/View/__tests__/ServizioCosaSiOttiene.test.jsx +240 -286
  90. package/src/components/ItaliaTheme/View/__tests__/ServizioCostiVincoli.test.jsx +240 -286
  91. package/src/components/ItaliaTheme/View/__tests__/ServizioMetadati.test.jsx +240 -286
  92. package/src/components/ItaliaTheme/View/__tests__/ServizioModulistica.test.jsx +240 -286
  93. package/src/components/ItaliaTheme/View/__tests__/ServizioProcedure.test.jsx +240 -286
  94. package/src/components/ItaliaTheme/View/__tests__/ServizioSitiEsterni.test.jsx +240 -286
  95. package/src/components/ItaliaTheme/View/__tests__/ServizioTempiScadenze.test.jsx +240 -286
  96. package/src/components/ItaliaTheme/View/__tests__/ServizioUlterioriInformazioni.test.jsx +240 -286
  97. package/src/components/ItaliaTheme/View/__tests__/ServizioView.test.jsx +470 -560
  98. package/src/components/ItaliaTheme/View/__tests__/TrasparenzaView.test.jsx +12 -1
  99. package/src/components/ItaliaTheme/manage/Widgets/ColorListWidget.jsx +11 -2
  100. package/src/components/ItaliaTheme/manage/Widgets/HtmlSlateWidget.jsx +154 -0
  101. package/src/components/ItaliaTheme/manage/Widgets/RichTextWidget.jsx +88 -0
  102. package/src/components/ItaliaTheme/manage/Widgets/SimpleTextEditorWidget.jsx +158 -0
  103. package/src/components/ItaliaTheme/manage/Widgets/TextEditorWidget.jsx +167 -270
  104. package/src/config/Blocks/ListingOptions/index.js +0 -1
  105. package/src/config/Blocks/ListingOptions/utils.js +0 -7
  106. package/src/config/Blocks/blocks.js +29 -8
  107. package/src/config/Blocks/listingVariations.js +1 -1
  108. package/src/config/Slate/Alignment/AlignMenu.jsx +169 -0
  109. package/src/config/Slate/Alignment/index.js +42 -0
  110. package/src/config/Slate/Blockquote/BlockquoteMenu.jsx +151 -0
  111. package/src/config/Slate/Blockquote/index.js +12 -0
  112. package/src/config/Slate/Headings/HeadingsMenu.jsx +139 -0
  113. package/src/config/Slate/Headings/headingsMenu.scss +44 -0
  114. package/src/config/Slate/Headings/index.js +62 -0
  115. package/src/config/Slate/Link/deserializer.js +25 -0
  116. package/src/config/Slate/Link/index.js +126 -0
  117. package/src/config/Slate/Link/renderer.jsx +99 -0
  118. package/src/config/Slate/LinkButton/index.js +47 -0
  119. package/src/config/Slate/TextLarger/index.js +51 -0
  120. package/src/config/Slate/Underline/index.js +10 -0
  121. package/src/config/Slate/config.js +43 -0
  122. package/src/config/Slate/deserializers.js +66 -0
  123. package/src/config/Slate/dropdownStyle.scss +14 -0
  124. package/src/config/Slate/dropdownUtils.js +422 -0
  125. package/src/config/Slate/extensions/breakList.js +91 -0
  126. package/src/config/Slate/handlers.js +243 -0
  127. package/src/config/Slate/utils.js +73 -0
  128. package/src/config/Widgets/widgets.js +1 -2
  129. package/src/config/italiaConfig.js +7 -54
  130. package/src/customizations/volto/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +360 -0
  131. package/src/customizations/volto/components/manage/Blocks/HeroImageLeft/Edit.jsx +75 -200
  132. package/src/customizations/volto/components/manage/Blocks/Video/Edit.jsx +1 -1
  133. package/src/customizations/volto/components/manage/Form/BlocksToolbar.jsx +1 -1
  134. package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +59 -6
  135. package/src/customizations/volto-form-block/components/Field.jsx +45 -22
  136. package/src/customizations/volto-form-block/components/FormResult.jsx +74 -0
  137. package/src/customizations/volto-form-block/components/FormView.jsx +79 -66
  138. package/src/customizations/volto-form-block/components/Widget/Button.jsx +50 -0
  139. package/src/helpers/EnhanceLink.js +44 -0
  140. package/src/helpers/FormValidation/FormValidationHelpers.js +3 -0
  141. package/src/helpers/blocks.js +86 -0
  142. package/src/helpers/files.js +14 -14
  143. package/src/helpers/index.js +4 -3
  144. package/src/helpers/richTextHelper.js +10 -0
  145. package/src/icons/Group.svg +1 -0
  146. package/src/icons/blocco-icone.svg +0 -3
  147. package/src/icons/blockquote-card-dark.svg +1 -0
  148. package/src/icons/blockquote-card.svg +1 -0
  149. package/src/icons/blockquote-simple.svg +1 -0
  150. package/src/icons/text-larger.svg +1 -0
  151. package/src/theme/ItaliaTheme/Blocks/_accordion.scss +1 -10
  152. package/src/theme/ItaliaTheme/Blocks/_alert.scss +53 -1
  153. package/src/theme/ItaliaTheme/Blocks/_bandiInEvidenceTemplate.scss +1 -0
  154. package/src/theme/ItaliaTheme/Blocks/_callout.scss +32 -0
  155. package/src/theme/ItaliaTheme/Blocks/_contacts.scss +15 -32
  156. package/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss +0 -14
  157. package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +1 -1
  158. package/src/theme/ItaliaTheme/Blocks/_hero.scss +1 -8
  159. package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +0 -30
  160. package/src/theme/ItaliaTheme/Blocks/_imageCardTextBlock.scss +3 -2
  161. package/src/theme/ItaliaTheme/Blocks/_numbers.scss +1 -5
  162. package/src/theme/ItaliaTheme/Blocks/_simpleCardTextBlock.scss +8 -2
  163. package/src/theme/ItaliaTheme/Blocks/_tableOfContents.scss +1 -0
  164. package/src/theme/ItaliaTheme/Components/_megamenu.scss +0 -4
  165. package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Blocks/_cta.scss +1 -0
  166. package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Blocks/_searchSections.scss +1 -0
  167. package/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss +1 -0
  168. package/src/theme/ItaliaTheme/Views/_cartellaModulistica.scss +11 -2
  169. package/src/theme/ItaliaTheme/Views/_slider.scss +3 -3
  170. package/src/theme/ItaliaTheme/Widgets/_iconWidget.scss +4 -0
  171. package/src/theme/ItaliaTheme/_main.scss +42 -54
  172. package/src/theme/_cms-ui.scss +59 -161
  173. package/src/theme/extras/_forms.scss +2 -14
  174. package/src/theme/site.scss +1 -0
  175. package/test-setup-config.js +58 -0
  176. package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx +0 -151
  177. package/src/config/RichTextEditor/LinkEntity.jsx +0 -27
  178. package/src/config/RichTextEditor/Plugins/AnchorPlugin/components/Link/index.jsx +0 -44
  179. package/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +0 -349
  180. package/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/index.js +0 -150
  181. package/src/config/RichTextEditor/Plugins/AnchorPlugin/index.js +0 -88
  182. package/src/config/RichTextEditor/ToolbarButtons/AlignButton.jsx +0 -61
  183. package/src/config/RichTextEditor/ToolbarButtons/ButtonsButton.jsx +0 -14
  184. package/src/config/RichTextEditor/ToolbarButtons/CalloutsButton.jsx +0 -38
  185. package/src/config/RichTextEditor/ToolbarButtons/DraftJsDropdownButton.jsx +0 -106
  186. package/src/config/RichTextEditor/ToolbarButtons/HeadingsButton.jsx +0 -57
  187. package/src/config/RichTextEditor/ToolbarButtons/TextSizeButton.jsx +0 -65
  188. package/src/config/RichTextEditor/ToolbarButtons/UnderlineButton.jsx +0 -14
  189. package/src/config/RichTextEditor/config.js +0 -253
  190. package/src/config/volto-gdpr-privacy-defaultPanelConfig.js +0 -292
  191. package/src/customizations/volto/components/manage/Blocks/ToC/View.jsx +0 -134
  192. package/src/customizations/volto/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +0 -99
  193. package/src/customizations/volto/config/RichTextEditor/Plugins.jsx +0 -63
  194. package/src/helpers/redraftHelper.js +0 -9
@@ -1,8 +1,17 @@
1
1
  @import 'cms-ui_container';
2
2
 
3
3
  body.cms-ui {
4
+ font-size: 16px;
5
+ line-height: 1.5;
6
+
7
+ @include media-breakpoint-up(sm) {
8
+ font-size: 18px;
9
+ line-height: 1.555;
10
+ }
4
11
  .block {
5
- font-family: $font-family-serif;
12
+ font-family: $font-family-sans-serif;
13
+ font-weight: $font-weight-base;
14
+ line-height: $line-height-base;
6
15
 
7
16
  %heading {
8
17
  margin-top: 0; /* 1*/
@@ -48,21 +57,6 @@ body.cms-ui {
48
57
 
49
58
  @import 'bootstrap-italia/src/scss/custom/type'; //to apply styles for headers on different screen sizes
50
59
 
51
- // Placeholder block title
52
- .title {
53
- .public-DraftEditorPlaceholder-inner {
54
- font-family: $font-family-sans-serif;
55
- }
56
- }
57
-
58
- &.title {
59
- .public-DraftEditorPlaceholder-inner {
60
- font-size: 2.66rem;
61
- font-weight: bold;
62
- line-height: 1.25;
63
- }
64
- }
65
-
66
60
  //align
67
61
  .text-center {
68
62
  text-align: center;
@@ -85,15 +79,33 @@ body.cms-ui {
85
79
  &.contenttype-argomento,
86
80
  &.contenttype-pagina-argomento,
87
81
  &.contenttype-cartellamodulistica {
88
- &:not(.section-add) {
89
- .block {
90
- font-family: $font-family-sans-serif;
91
- font-weight: 300;
92
- line-height: 1.555;
82
+ .block {
83
+ font-family: $font-family-sans-serif;
84
+ font-weight: 300;
85
+ line-height: 1.555;
86
+ }
87
+ }
88
+
89
+ .simple-text-editor-widget {
90
+ .simple-text-input {
91
+ min-width: 1px;
92
+ display: inline-block;
93
+ &:empty:before {
94
+ content: attr(placeholder);
95
+ pointer-events: none;
96
+ display: block; /* For Firefox */
97
+ font-weight: inherit;
98
+ opacity: 0.333;
93
99
  }
94
100
  }
95
101
  }
96
102
 
103
+ .detached-slate-editor {
104
+ p:not(:last-child) {
105
+ margin-bottom: 1rem !important;
106
+ }
107
+ }
108
+
97
109
  .it-header-wrapper,
98
110
  .public-ui {
99
111
  font-size: 18px;
@@ -148,6 +160,8 @@ body.cms-ui {
148
160
  height: auto;
149
161
  color: #444;
150
162
  font-weight: normal;
163
+ height: auto;
164
+ font-size: 0.7rem;
151
165
  }
152
166
 
153
167
  #field-data-element-select {
@@ -252,14 +266,6 @@ body.cms-ui {
252
266
  }
253
267
  }
254
268
 
255
- .menu-configuration-widget {
256
- .menu-blocks-container {
257
- .DraftEditor-editorContainer .public-DraftEditor-content {
258
- min-height: 19px;
259
- }
260
- }
261
- }
262
-
263
269
  .sidebar-container .object-listing,
264
270
  .icon-align-name {
265
271
  svg.icon {
@@ -381,21 +387,33 @@ body.cms-ui {
381
387
  .button.tertiary.active {
382
388
  background-color: $tertiary;
383
389
  }
384
-
385
- // Alert block
386
- .button.info,
387
- .button.info.active {
388
- background-color: $alert-info;
390
+ .button.success,
391
+ .button.success.active {
392
+ background-color: $success;
389
393
  }
390
394
 
391
395
  .button.warning,
392
- .button.warning.active {
393
- background-color: $alert-warning;
396
+ .button.success.warning {
397
+ background-color: $warning;
394
398
  }
395
399
 
396
400
  .button.danger,
397
401
  .button.danger.active {
398
- background-color: $alert-danger;
402
+ background-color: $danger;
403
+ }
404
+
405
+ .button.callout_default,
406
+ .button.callout_default.active {
407
+ background-color: $secondary;
408
+ }
409
+ .button.callout_note,
410
+ .button.callout_note.active {
411
+ background-color: $primary;
412
+ }
413
+
414
+ .button.info,
415
+ .button.info.active {
416
+ background-color: $info;
399
417
  }
400
418
  }
401
419
 
@@ -411,48 +429,16 @@ body.cms-ui {
411
429
  }
412
430
  }
413
431
 
414
- /*.DraftEditor-root {
415
- font-family: $font-family-serif;
416
- h1,
417
- h2,
418
- h3,
419
- h4,
420
- h5,
421
- h6 {
422
- font-family: $font-family-sans-serif;
423
- }
424
- }*/
425
-
426
- //stili per l'editor di testo dei ct con i campi
427
- .DraftEditor-root {
428
- .public-DraftStyleDefault-block {
429
- margin-bottom: 1rem;
430
- }
431
-
432
- li {
433
- .public-DraftStyleDefault-block {
434
- margin-bottom: unset;
435
- }
436
- }
437
- }
438
-
439
- .block.text {
440
- .DraftEditor-root {
441
- .public-DraftStyleDefault-block {
442
- margin-bottom: unset;
432
+ .field-wrapper-icon {
433
+ .icon-container.italia-icon {
434
+ svg.icon {
435
+ height: 1.5em;
443
436
  }
444
437
  }
445
438
  }
446
439
 
447
440
  // z-index necessario su Volto 17 finché non passiamo ad usare slate
448
441
  .block {
449
- .DraftEditor-root {
450
- .DraftEditor-editorContainer,
451
- .public-DraftEditorPlaceholder-root {
452
- z-index: 0;
453
- }
454
- }
455
-
456
442
  &.image {
457
443
  .block.align {
458
444
  &.left,
@@ -473,18 +459,6 @@ body.cms-ui {
473
459
  }
474
460
  }
475
461
 
476
- .footer-configuration-widget {
477
- .DraftEditor-editorContainer {
478
- a.link-anchorlink-theme {
479
- color: #06c;
480
-
481
- &:hover {
482
- color: darken(#06c, 20);
483
- }
484
- }
485
- }
486
- }
487
-
488
462
  &.section-controlpanel {
489
463
  a {
490
464
  text-decoration: none;
@@ -519,10 +493,6 @@ body.cms-ui {
519
493
 
520
494
  .block-editor-title,
521
495
  .block-editor-description {
522
- .DraftEditor-root {
523
- padding: 0 1.333em;
524
- }
525
-
526
496
  & + [class^='block-editor'] {
527
497
  margin-top: 2.8rem;
528
498
  }
@@ -544,78 +514,6 @@ body.cms-ui {
544
514
 
545
515
  /////
546
516
 
547
- .draftJsToolbarDropdown {
548
- position: relative;
549
-
550
- .draftJsToolbarDropdown-toggle {
551
- display: flex;
552
- width: 42px;
553
- align-items: center;
554
- justify-content: space-between;
555
-
556
- .caret {
557
- display: inline-block;
558
- width: 0;
559
- height: 0;
560
-
561
- border: 5px solid transparent;
562
-
563
- &.down {
564
- border-top-color: #888;
565
- margin-top: 5px;
566
- }
567
-
568
- &.up {
569
- border-bottom-color: #888;
570
- margin-bottom: 5px;
571
- }
572
- }
573
- }
574
-
575
- ul.draftJsToolbarDropdown-optionswrapper {
576
- position: absolute;
577
- top: 35px;
578
- left: 50%;
579
- padding: 0;
580
- margin: 0;
581
- background-color: #fff;
582
- border-bottom-left-radius: 3px;
583
- border-bottom-right-radius: 3px;
584
- box-shadow:
585
- 0 0 8px rgba(0, 0, 0, 0.1),
586
- 0 2px 4px rgba(0, 0, 0, 0.05);
587
- list-style-type: none;
588
- transform: translateX(-50%);
589
-
590
- &.hide {
591
- display: none;
592
- }
593
-
594
- .draftJsToolbarDropdown-option {
595
- padding: 0.5rem;
596
- color: $neutral-2-b5;
597
-
598
- svg {
599
- fill: $neutral-2-b5 !important;
600
- }
601
-
602
- > * {
603
- display: block;
604
- }
605
-
606
- button {
607
- width: 100%;
608
- height: auto;
609
-
610
- > * {
611
- margin: 0;
612
- color: $neutral-2-b5;
613
- }
614
- }
615
- }
616
- }
617
- }
618
-
619
517
  .column.color-chooser {
620
518
  padding-top: 0.5em;
621
519
  padding-bottom: 0.5em;
@@ -12,7 +12,7 @@ $sidebarFormBg: #fafafa;
12
12
  .ui.input input[type='text'],
13
13
  .ui.input input[type='url'],
14
14
  textarea,
15
- .DraftEditor-root {
15
+ .slate-editor {
16
16
  padding-right: 10px;
17
17
  padding-left: 10px;
18
18
  margin-top: 0.5rem;
@@ -40,20 +40,8 @@ $sidebarFormBg: #fafafa;
40
40
  padding: 10px;
41
41
  }
42
42
 
43
- .DraftEditor-editorContainer {
44
- .public-DraftEditor-content {
45
- min-height: 60px;
46
- }
47
- }
48
-
49
43
  .blocks-widget-container {
50
- .DraftEditor-editorContainer {
51
- .public-DraftEditor-content {
52
- min-height: unset;
53
- }
54
- }
55
-
56
- .DraftEditor-root {
44
+ .slate-editor {
57
45
  border-bottom: none;
58
46
  background-color: transparent;
59
47
  }
@@ -90,6 +90,7 @@
90
90
  @import 'ItaliaTheme/Blocks/simpleCardTemplate';
91
91
  @import 'ItaliaTheme/Blocks/search';
92
92
  @import 'ItaliaTheme/Blocks/gridBlock';
93
+ @import 'ItaliaTheme/Blocks/callout';
93
94
 
94
95
  @import 'ItaliaTheme/Views/uo';
95
96
  @import 'ItaliaTheme/Views/evento';
@@ -10,6 +10,30 @@
10
10
  import '@plone/volto/config';
11
11
  import config from '@plone/volto/registry';
12
12
  import applyItaliaConfig from './src';
13
+ import TextBlockView from '@plone/volto-slate/blocks/Text/TextBlockView';
14
+ import TextBlockEdit from '@plone/volto-slate/blocks/Text/TextBlockEdit';
15
+ import TextBlockSchema from '@plone/volto-slate/blocks/Text/TextBlockSchema';
16
+
17
+ //slate config need to exists for italiaConfig
18
+ config.set('settings', {
19
+ ...config.settings,
20
+ slate: {
21
+ elements: {
22
+ default: ({ attributes, children }) => <p {...attributes}>{children}</p>,
23
+ },
24
+ leafs: {},
25
+ persistentHelpers: [],
26
+ contextToolbarButtons: [],
27
+ textblockExtensions: [],
28
+ extensions: [],
29
+ elementToolbarButtons: {},
30
+ buttons: {},
31
+ toolbarButtons: [],
32
+ expandedToolbarButtons: [],
33
+ htmlTagsToSlate: {},
34
+ topLevelTargetElements: [],
35
+ },
36
+ });
13
37
 
14
38
  applyItaliaConfig(config);
15
39
 
@@ -83,3 +107,37 @@ config.set('experimental', {
83
107
  enabled: false,
84
108
  },
85
109
  });
110
+
111
+ const slateBlockConfig = {
112
+ id: 'slate',
113
+ view: TextBlockView,
114
+ edit: TextBlockEdit,
115
+ schema: TextBlockSchema,
116
+ blockHasValue: (data) => {
117
+ // TODO: this should be handled better
118
+ return data && !!data.plaintext?.trim();
119
+ },
120
+ tocEntry: (block = {}) => {
121
+ const { value, override_toc, entry_text, level, plaintext } = block;
122
+ const type = value?.[0]?.type;
123
+ return override_toc && level
124
+ ? [parseInt(level.slice(1)), entry_text]
125
+ : config.settings.slate.topLevelTargetElements.includes(type)
126
+ ? [parseInt(type.slice(1)), plaintext]
127
+ : null;
128
+ },
129
+ };
130
+ config.set('blocks', {
131
+ ...config.blocks,
132
+ blocksConfig: {
133
+ ...(config.blocks.blocksConfig ?? {}),
134
+ slate: slateBlockConfig,
135
+ gridBlock: {
136
+ ...(config.blocks.blocksConfig?.gridBlock ?? {}),
137
+ blocksConfig: {
138
+ ...(config.blocks.blocksConfig?.gridBlock?.blocksConfig ?? {}),
139
+ slate: slateBlockConfig,
140
+ },
141
+ },
142
+ },
143
+ });
@@ -1,151 +0,0 @@
1
- /* eslint-disable jsx-a11y/no-static-element-interactions */
2
- /* eslint-disable jsx-a11y/click-events-have-key-events */
3
- import React, { useState, useEffect } from 'react';
4
- import { Card, CardBody, CardTitle } from 'design-react-kit';
5
- import { defineMessages, useIntl } from 'react-intl';
6
- import PropTypes from 'prop-types';
7
- import redraft from 'redraft';
8
- import { TextEditorWidget } from 'design-comuni-plone-theme/components/ItaliaTheme';
9
- import { Divider } from 'semantic-ui-react';
10
- import cx from 'classnames';
11
- import config from '@plone/volto/registry';
12
-
13
- const messages = defineMessages({
14
- simple_card_title: {
15
- id: 'Type the title…',
16
- defaultMessage: 'Type the title…',
17
- },
18
- simple_card_content: {
19
- id: 'Type description…',
20
- defaultMessage: 'Digita la descrizione…',
21
- },
22
- simple_card_click: {
23
- id: 'Type text…',
24
- defaultMessage: 'Digita il testo…',
25
- },
26
- });
27
-
28
- const Block = ({
29
- inEditMode,
30
- data,
31
- block,
32
- onChange,
33
- onSelectBlock,
34
- onAddBlock,
35
- onFocusPreviousBlock,
36
- onFocusNextBlock,
37
- index,
38
- selected,
39
- }) => {
40
- const intl = useIntl();
41
- const title = data?.simple_card_title?.blocks[0]?.text;
42
- const content = data?.simple_card_content;
43
- const [selectedField, setSelectedField] = useState('title');
44
-
45
- useEffect(() => {
46
- if (selected) {
47
- setSelectedField('title');
48
- } else {
49
- setSelectedField(null);
50
- }
51
- }, [selected]);
52
-
53
- return (
54
- <div className="simple-text-card-wrapper">
55
- <Card color="white" className="no-after card-bg rounded" space tag="div">
56
- <CardBody>
57
- <div className={cx('simple-text-card', { 'cms-ui': inEditMode })}>
58
- {inEditMode ? (
59
- <>
60
- <CardTitle tag="h3" className="h4">
61
- <div
62
- onClick={() => {
63
- setSelectedField('title');
64
- }}
65
- onFocus={() => {
66
- setSelectedField('title');
67
- }}
68
- >
69
- <TextEditorWidget
70
- data={data}
71
- fieldName="simple_card_title"
72
- selected={selectedField === 'title'}
73
- block={block}
74
- onChangeBlock={(data) =>
75
- onChange(data, 'simple_card_title')
76
- }
77
- placeholder={intl.formatMessage(
78
- messages.simple_card_title,
79
- )}
80
- showToolbar={false}
81
- onSelectBlock={() => {}}
82
- onAddBlock={() => {
83
- setSelectedField('content');
84
- }}
85
- onFocusNextBlock={() => {
86
- setSelectedField('content');
87
- }}
88
- onFocusPreviousBlock={onFocusPreviousBlock}
89
- />
90
- </div>
91
- </CardTitle>
92
- <Divider />
93
- <div
94
- onClick={() => {
95
- setSelectedField('content');
96
- }}
97
- onFocus={() => {
98
- setSelectedField('content');
99
- }}
100
- >
101
- <TextEditorWidget
102
- data={data}
103
- fieldName="simple_card_content"
104
- selected={selectedField === 'content'}
105
- block={block}
106
- onChangeBlock={(data) =>
107
- onChange(data, 'simple_card_content')
108
- }
109
- placeholder={intl.formatMessage(
110
- messages.simple_card_content,
111
- )}
112
- showToolbar={true}
113
- onSelectBlock={onSelectBlock}
114
- onAddBlock={onAddBlock}
115
- index={index}
116
- onFocusNextBlock={onFocusNextBlock}
117
- onFocusPreviousBlock={() => {
118
- setSelectedField('title');
119
- }}
120
- />
121
- </div>
122
- </>
123
- ) : (
124
- <>
125
- <CardTitle tag="h3" id={block.id + '-title'} className="h4">
126
- {title}
127
- </CardTitle>
128
- <hr />
129
- {redraft(
130
- content,
131
- config.settings.richtextViewSettings.ToHTMLRenderers,
132
- config.settings.richtextViewSettings.ToHTMLOptions,
133
- )}
134
- </>
135
- )}
136
- </div>
137
- </CardBody>
138
- </Card>
139
- </div>
140
- );
141
- };
142
-
143
- Block.propTypes = {
144
- entityMap: PropTypes.any,
145
- data: PropTypes.any,
146
- block: PropTypes.any,
147
- inEditMode: PropTypes.bool.isRequired,
148
- onChange: PropTypes.func,
149
- };
150
-
151
- export default Block;
@@ -1,27 +0,0 @@
1
- import React from 'react';
2
- import { connect } from 'react-redux';
3
- import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
4
- import { IntlProvider } from 'react-intl';
5
-
6
- const LinkEntity = connect((state) => ({
7
- token: state.userSession.token,
8
- }))((props) => {
9
- const { token, url, target, targetUrl, download, children, dataElement } =
10
- props;
11
- const to = token ? url : targetUrl || url;
12
-
13
- return (
14
- <IntlProvider>
15
- <UniversalLink
16
- href={to}
17
- openLinkInNewTab={target === '_blank' || undefined}
18
- download={download}
19
- data-element={dataElement || props['data-element'] || null}
20
- >
21
- {children}
22
- </UniversalLink>
23
- </IntlProvider>
24
- );
25
- });
26
-
27
- export default LinkEntity;
@@ -1,44 +0,0 @@
1
- /**
2
- * Questo è il link quando viene mostrato dentro l'editor nelle viste di edit
3
- * Customizzato
4
- * - aggiunto data-element
5
- * - aggiunto icona link esterno
6
- */
7
- import React from 'react';
8
- import PropTypes from 'prop-types';
9
- import { isInternalURL, flattenToAppURL } from '@plone/volto/helpers';
10
-
11
- const propTypes = {
12
- className: PropTypes.string,
13
- children: PropTypes.node.isRequired,
14
- entityKey: PropTypes.string,
15
- getEditorState: PropTypes.func.isRequired,
16
- target: PropTypes.string,
17
- };
18
-
19
- const Link = ({ children, className, entityKey, getEditorState, target }) => {
20
- const entity = getEditorState().getCurrentContent().getEntity(entityKey);
21
- const entityData = entity ? entity.get('data') : undefined;
22
- const href = (entityData && entityData.url) || undefined;
23
-
24
- return (
25
- <a
26
- className={className}
27
- title={href}
28
- href={isInternalURL(href) ? flattenToAppURL(href) : href}
29
- target={target}
30
- rel="noopener noreferrer"
31
- data-element={entityData.dataElement || entityData['data-element']}
32
- >
33
- {children}
34
- </a>
35
- );
36
- };
37
-
38
- Link.propTypes = propTypes;
39
- Link.defaultProps = {
40
- className: null,
41
- entityKey: null,
42
- target: null,
43
- };
44
- export default Link;