design-comuni-plone-theme 11.29.2 → 12.0.0
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.
- package/.github/workflows/main.yml +16 -16
- package/.github/workflows/npm.yml +1 -1
- package/.github/workflows/withnewsletter.yml +47 -0
- package/.release-it.json +1 -0
- package/.yarn/cache/@babel-helper-module-imports-npm-7.24.3-edb733448b-c23492189b.zip +0 -0
- package/.yarn/cache/@babel-types-npm-7.24.0-a0508cb308-4b574a37d4.zip +0 -0
- package/.yarn/cache/babel-plugin-lodash-npm-3.3.4-c7161075b6-044a4261e6.zip +0 -0
- package/.yarn/cache/braces-npm-3.0.3-582c14023c-b95aa0b3bd.zip +0 -0
- package/.yarn/cache/fill-range-npm-7.1.1-bf491486db-b4abfbca38.zip +0 -0
- package/.yarn/cache/micromatch-npm-4.0.8-c9570e4aca-79920eb634.zip +0 -0
- package/.yarn/cache/require-package-name-npm-2.0.1-ac9a206b63-00f4e9e467.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +1728 -1659
- package/RELEASE.md +6 -0
- package/locales/de/LC_MESSAGES/volto.po +86 -19
- package/locales/en/LC_MESSAGES/volto.po +86 -19
- package/locales/es/LC_MESSAGES/volto.po +86 -19
- package/locales/fr/LC_MESSAGES/volto.po +86 -19
- package/locales/it/LC_MESSAGES/volto.po +87 -20
- package/locales/volto.pot +87 -20
- package/package.json +3 -1
- package/publiccode.yml +2 -2
- package/src/components/Collapse.jsx +1 -0
- package/src/components/ItaliaTheme/AppExtras/SiteSettingsExtras.jsx +0 -6
- package/src/components/ItaliaTheme/Blocks/Accordion/Block/EditBlock.jsx +29 -24
- package/src/components/ItaliaTheme/Blocks/Accordion/Block/ViewBlock.jsx +4 -12
- package/src/components/ItaliaTheme/Blocks/Accordion/Edit.jsx +118 -42
- package/src/components/ItaliaTheme/Blocks/Accordion/View.jsx +4 -18
- package/src/components/ItaliaTheme/Blocks/Alert/Edit.jsx +60 -113
- package/src/components/ItaliaTheme/Blocks/Alert/Sidebar.jsx +1 -0
- package/src/components/ItaliaTheme/Blocks/Alert/View.jsx +5 -14
- package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Block.jsx +16 -11
- package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Body.jsx +2 -1
- package/src/components/ItaliaTheme/Blocks/ArgumentsInEvidence/Edit.jsx +39 -1
- package/src/components/ItaliaTheme/Blocks/CTABlock/Block.jsx +35 -95
- package/src/components/ItaliaTheme/Blocks/Callout/Edit.jsx +108 -0
- package/src/components/ItaliaTheme/Blocks/Callout/Sidebar.jsx +173 -0
- package/src/components/ItaliaTheme/Blocks/Callout/View.jsx +45 -0
- package/src/components/ItaliaTheme/Blocks/ContactsBlock/Block/EditBlock.jsx +86 -63
- package/src/components/ItaliaTheme/Blocks/ContactsBlock/Block/ViewBlock.jsx +19 -39
- package/src/components/ItaliaTheme/Blocks/ContactsBlock/Edit.jsx +101 -22
- package/src/components/ItaliaTheme/Blocks/ContactsBlock/View.jsx +13 -21
- package/src/components/ItaliaTheme/Blocks/CountDown/Edit.jsx +21 -25
- package/src/components/ItaliaTheme/Blocks/CountDown/View.jsx +6 -15
- package/src/components/ItaliaTheme/Blocks/IconBlocks/Block/EditBlock.jsx +52 -22
- package/src/components/ItaliaTheme/Blocks/IconBlocks/Block/ViewBlock.jsx +9 -29
- package/src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx +108 -21
- package/src/components/ItaliaTheme/Blocks/IconBlocks/Sidebar.jsx +1 -9
- package/src/components/ItaliaTheme/Blocks/IconBlocks/View.jsx +6 -14
- package/src/components/ItaliaTheme/Blocks/Listing/CardWithSlideUpTextTemplate.jsx +0 -1
- package/src/components/ItaliaTheme/Blocks/NumbersBlock/Block/EditBlock.jsx +45 -15
- package/src/components/ItaliaTheme/Blocks/NumbersBlock/Block/ViewBlock.jsx +2 -18
- package/src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx +98 -11
- package/src/components/ItaliaTheme/Blocks/NumbersBlock/View.jsx +2 -7
- package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Block.jsx +35 -67
- package/src/components/ItaliaTheme/Blocks/TextCard/CardWithImage/Edit.jsx +2 -8
- package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/BodyWrapper.jsx +2 -1
- package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Edit.jsx +98 -84
- package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/View.jsx +20 -3
- package/src/components/ItaliaTheme/Blocks/UOSearch/Sidebar.jsx +11 -11
- package/src/components/ItaliaTheme/Blocks/__tests__/Accordion.test.jsx +11 -28
- package/src/components/ItaliaTheme/Blocks/__tests__/Alert.test.jsx +10 -14
- package/src/components/ItaliaTheme/Blocks/__tests__/ArgumentsInEvidence.test.jsx +20 -28
- package/src/components/ItaliaTheme/Blocks/__tests__/CTABlock.test.jsx +14 -29
- package/src/components/ItaliaTheme/Blocks/__tests__/CardWithImage.test.jsx +11 -28
- package/src/components/ItaliaTheme/Blocks/__tests__/ContactsBlock.test.jsx +75 -140
- package/src/components/ItaliaTheme/Blocks/__tests__/Countdown.test.jsx +20 -28
- package/src/components/ItaliaTheme/Blocks/__tests__/IconBlocks.test.jsx +22 -56
- package/src/components/ItaliaTheme/Blocks/__tests__/NumbersBlock.test.jsx +14 -43
- package/src/components/ItaliaTheme/Blocks/__tests__/SimpleCard.test.jsx +14 -30
- package/src/components/ItaliaTheme/BrandText/BrandText.jsx +8 -14
- package/src/components/ItaliaTheme/BrandTextFooter/BrandTextFooter.jsx +31 -2
- package/src/components/ItaliaTheme/Footer/FooterInfos.jsx +21 -8
- package/src/components/ItaliaTheme/Footer/FooterNavigation.jsx +3 -3
- package/src/components/ItaliaTheme/Header/HeaderSlim/HeaderSlim.jsx +0 -7
- package/src/components/ItaliaTheme/Icons/Icon.jsx +0 -1
- package/src/components/ItaliaTheme/MegaMenu/MegaMenu.jsx +5 -1
- package/src/components/ItaliaTheme/View/BandoView/BandoApprofondimenti.jsx +1 -2
- package/src/components/ItaliaTheme/View/CartellaModulisticaView/DocRow.jsx +14 -5
- package/src/components/ItaliaTheme/View/Commons/Attachment.jsx +19 -3
- package/src/components/ItaliaTheme/View/Commons/Attachments.jsx +0 -1
- package/src/components/ItaliaTheme/View/Commons/DownloadFileFormat.jsx +11 -7
- package/src/components/ItaliaTheme/View/Commons/Gallery.jsx +1 -0
- package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeaderEventDates.jsx +0 -1
- package/src/components/ItaliaTheme/View/Commons/PageHeader/PageHeaderLinkServizio.jsx +6 -2
- package/src/components/ItaliaTheme/View/Commons/RichTextRender.jsx +8 -6
- package/src/components/ItaliaTheme/View/Commons/__tests__/RichText.test.jsx +14 -17
- package/src/components/ItaliaTheme/View/EventoView/EventoContattiOrganizzatoreEsterno.jsx +1 -1
- package/src/components/ItaliaTheme/View/EventoView/EventoUlterioriInformazioni.jsx +0 -4
- package/src/components/ItaliaTheme/View/ServizioView/ServizioAccedi.jsx +10 -7
- package/src/components/ItaliaTheme/View/ServizioView/ServizioMetatag.jsx +4 -3
- package/src/components/ItaliaTheme/View/__disabled_tests__/IncaricoView.test__disabled.jsx +24 -30
- package/src/components/ItaliaTheme/View/__tests__/CartellaModulisticaView.test.jsx +12 -1
- package/src/components/ItaliaTheme/View/__tests__/PageView.test.jsx +24 -2
- package/src/components/ItaliaTheme/View/__tests__/PersonaView.test.jsx +96 -92
- package/src/components/ItaliaTheme/View/__tests__/ServizioAChiSiRivolge.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioAccedi.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioCasiParticolari.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioComeFare.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioCondizioni.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioContatti.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioCosE.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioCosaServe.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioCosaSiOttiene.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioCostiVincoli.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioMetadati.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioModulistica.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioProcedure.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioSitiEsterni.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioTempiScadenze.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioUlterioriInformazioni.test.jsx +240 -286
- package/src/components/ItaliaTheme/View/__tests__/ServizioView.test.jsx +470 -560
- package/src/components/ItaliaTheme/View/__tests__/TrasparenzaView.test.jsx +12 -1
- package/src/components/ItaliaTheme/index.js +0 -1
- package/src/components/ItaliaTheme/manage/Widgets/ColorListWidget.jsx +11 -2
- package/src/components/ItaliaTheme/manage/Widgets/HtmlSlateWidget.jsx +156 -0
- package/src/components/ItaliaTheme/manage/Widgets/RichTextWidget.jsx +88 -0
- package/src/components/ItaliaTheme/manage/Widgets/SimpleTextEditorWidget.jsx +158 -0
- package/src/components/ItaliaTheme/manage/Widgets/TextEditorWidget.jsx +167 -270
- package/src/config/Blocks/ListingOptions/index.js +0 -1
- package/src/config/Blocks/ListingOptions/utils.js +0 -7
- package/src/config/Blocks/blocks.js +29 -8
- package/src/config/Blocks/listingVariations.js +1 -1
- package/src/config/Slate/Alignment/AlignMenu.jsx +169 -0
- package/src/config/Slate/Alignment/index.js +42 -0
- package/src/config/Slate/Blockquote/BlockquoteMenu.jsx +151 -0
- package/src/config/Slate/Blockquote/index.js +19 -0
- package/src/config/Slate/Headings/HeadingsMenu.jsx +139 -0
- package/src/config/Slate/Headings/headingsMenu.scss +44 -0
- package/src/config/Slate/Headings/index.js +62 -0
- package/src/config/Slate/Link/deserializer.js +25 -0
- package/src/config/Slate/Link/index.js +126 -0
- package/src/config/Slate/Link/renderer.jsx +99 -0
- package/src/config/Slate/LinkButton/index.js +47 -0
- package/src/config/Slate/TextLarger/index.js +51 -0
- package/src/config/Slate/Underline/index.js +10 -0
- package/src/config/Slate/config.js +43 -0
- package/src/config/Slate/deserializers.js +66 -0
- package/src/config/Slate/dropdownStyle.scss +14 -0
- package/src/config/Slate/dropdownUtils.js +422 -0
- package/src/config/Slate/extensions/breakList.js +91 -0
- package/src/config/Slate/handlers.js +243 -0
- package/src/config/Slate/utils.js +73 -0
- package/src/config/Widgets/widgets.js +1 -2
- package/src/config/italiaConfig.js +5 -53
- package/src/customizations/volto/components/manage/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +361 -0
- package/src/customizations/volto/components/manage/Blocks/HeroImageLeft/Edit.jsx +75 -200
- package/src/customizations/volto/components/manage/Blocks/Video/Body.jsx +0 -1
- package/src/customizations/volto/components/manage/Blocks/Video/Edit.jsx +1 -1
- package/src/customizations/volto/components/manage/Form/BlocksToolbar.jsx +1 -1
- package/src/customizations/volto/components/manage/UniversalLink/UniversalLink.jsx +76 -18
- package/src/customizations/volto/components/manage/Widgets/RecurrenceWidget/RecurrenceWidget.jsx +4 -0
- package/src/customizations/volto-form-block/components/Field.jsx +45 -22
- package/src/helpers/EnhanceLink.js +44 -0
- package/src/helpers/FormValidation/FormValidationHelpers.js +3 -0
- package/src/helpers/blocks.js +80 -0
- package/src/helpers/files.js +13 -13
- package/src/helpers/index.js +4 -3
- package/src/helpers/richTextHelper.js +10 -0
- package/src/icons/Group.svg +1 -0
- package/src/icons/blocco-icone.svg +0 -3
- package/src/icons/blockquote-card-dark.svg +1 -0
- package/src/icons/blockquote-card.svg +1 -0
- package/src/icons/blockquote-simple.svg +1 -0
- package/src/icons/text-larger.svg +1 -0
- package/src/theme/ItaliaTheme/Blocks/_accordion.scss +2 -22
- package/src/theme/ItaliaTheme/Blocks/_alert.scss +51 -4
- package/src/theme/ItaliaTheme/Blocks/_bandiInEvidenceTemplate.scss +1 -0
- package/src/theme/ItaliaTheme/Blocks/_callout.scss +32 -0
- package/src/theme/ItaliaTheme/Blocks/_contacts.scss +17 -51
- package/src/theme/ItaliaTheme/Blocks/_countdown.scss +10 -1
- package/src/theme/ItaliaTheme/Blocks/_ctaBlock.scss +7 -23
- package/src/theme/ItaliaTheme/Blocks/_gridBlock.scss +1 -1
- package/src/theme/ItaliaTheme/Blocks/_hero.scss +1 -8
- package/src/theme/ItaliaTheme/Blocks/_iconBlocks.scss +6 -77
- package/src/theme/ItaliaTheme/Blocks/_imageCardTextBlock.scss +3 -2
- package/src/theme/ItaliaTheme/Blocks/_numbers.scss +6 -20
- package/src/theme/ItaliaTheme/Blocks/_simpleCardTextBlock.scss +8 -2
- package/src/theme/ItaliaTheme/Blocks/_subblocks-edit.scss +3 -1
- package/src/theme/ItaliaTheme/Blocks/_tableOfContents.scss +1 -0
- package/src/theme/ItaliaTheme/Components/_megamenu.scss +0 -4
- package/src/theme/ItaliaTheme/Components/_mobileMenu.scss +12 -16
- package/src/theme/ItaliaTheme/Print/_page.scss +1 -1
- package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Blocks/_contacts.scss +3 -0
- package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Blocks/_cta.scss +1 -0
- package/src/theme/ItaliaTheme/Subsites/ItaliaTheme/Blocks/_searchSections.scss +1 -0
- package/src/theme/ItaliaTheme/Subsites/bootstrap-italia/custom/_headercenter.scss +1 -0
- package/src/theme/ItaliaTheme/Views/_cartellaModulistica.scss +11 -2
- package/src/theme/ItaliaTheme/Views/_servizio.scss +2 -2
- package/src/theme/ItaliaTheme/Views/_slider.scss +3 -0
- package/src/theme/ItaliaTheme/Widgets/_iconWidget.scss +4 -0
- package/src/theme/ItaliaTheme/_common.scss +1 -0
- package/src/theme/ItaliaTheme/_home.scss +0 -4
- package/src/theme/ItaliaTheme/_main.scss +78 -84
- package/src/theme/_cms-ui.scss +63 -160
- package/src/theme/_mixins.scss +13 -0
- package/src/theme/bootstrap-override/_bootstrap-italia-site.scss +1 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_footer.scss +1 -1
- package/src/theme/bootstrap-override/bootstrap-italia/_forms.scss +7 -0
- package/src/theme/bootstrap-override/bootstrap-italia/_headercenter.scss +8 -3
- package/src/theme/extras/_forms.scss +2 -14
- package/src/theme/site.scss +1 -1
- package/test-setup-config.js +58 -0
- package/.yarn/cache/braces-npm-3.0.2-782240b28a-e2a8e769a8.zip +0 -0
- package/.yarn/cache/fill-range-npm-7.0.1-b8b1817caa-cc283f4e65.zip +0 -0
- package/.yarn/cache/micromatch-npm-4.0.5-cfab5d7669-02a17b671c.zip +0 -0
- package/src/components/ItaliaTheme/Blocks/TextCard/SimpleCard/Block.jsx +0 -151
- package/src/components/ItaliaTheme/RemoveBodyClass/RemoveBodyClass.jsx +0 -84
- package/src/config/RichTextEditor/LinkEntity.jsx +0 -27
- package/src/config/RichTextEditor/Plugins/AnchorPlugin/components/Link/index.jsx +0 -44
- package/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/AddLinkForm.jsx +0 -349
- package/src/config/RichTextEditor/Plugins/AnchorPlugin/components/LinkButton/index.js +0 -150
- package/src/config/RichTextEditor/Plugins/AnchorPlugin/index.js +0 -88
- package/src/config/RichTextEditor/ToolbarButtons/AlignButton.jsx +0 -61
- package/src/config/RichTextEditor/ToolbarButtons/ButtonsButton.jsx +0 -14
- package/src/config/RichTextEditor/ToolbarButtons/CalloutsButton.jsx +0 -38
- package/src/config/RichTextEditor/ToolbarButtons/DraftJsDropdownButton.jsx +0 -106
- package/src/config/RichTextEditor/ToolbarButtons/HeadingsButton.jsx +0 -57
- package/src/config/RichTextEditor/ToolbarButtons/TextSizeButton.jsx +0 -65
- package/src/config/RichTextEditor/ToolbarButtons/UnderlineButton.jsx +0 -14
- package/src/config/RichTextEditor/config.js +0 -253
- package/src/config/volto-gdpr-privacy-defaultPanelConfig.js +0 -292
- package/src/customizations/volto/components/manage/Blocks/ToC/View.jsx +0 -134
- package/src/customizations/volto/components/manage/Blocks/ToC/variations/DefaultTocRenderer.jsx +0 -99
- package/src/customizations/volto/config/RichTextEditor/Plugins.jsx +0 -63
- package/src/helpers/redraftHelper.js +0 -9
- package/src/theme/ItaliaTheme/Components/_logo.scss +0 -10
|
@@ -80,20 +80,27 @@ iframe {
|
|
|
80
80
|
|
|
81
81
|
.public-ui,
|
|
82
82
|
.cms-ui {
|
|
83
|
-
blockquote
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
blockquote,
|
|
84
|
+
.blockquote {
|
|
85
|
+
display: flow-root; //serve per quando i blockquote sono affiancati alle immagini allineate a dx o sx
|
|
86
|
+
border-color: $primary !important;
|
|
87
|
+
|
|
88
|
+
ul:first-child,
|
|
89
|
+
ol:first-child {
|
|
90
|
+
margin-top: 0;
|
|
91
|
+
}
|
|
87
92
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
ul:last-child,
|
|
94
|
+
ol:last-child,
|
|
95
|
+
p:last-child,
|
|
96
|
+
p:last-of-type {
|
|
97
|
+
margin-bottom: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.dark {
|
|
101
|
+
a {
|
|
102
|
+
color: $primary-text;
|
|
103
|
+
}
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
106
|
|
|
@@ -109,96 +116,83 @@ iframe {
|
|
|
109
116
|
}
|
|
110
117
|
}
|
|
111
118
|
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
background-color: $primary-c1;
|
|
116
|
-
|
|
117
|
-
p,
|
|
118
|
-
.public-DraftStyleDefault-block {
|
|
119
|
-
&:last-of-type {
|
|
120
|
-
margin-bottom: 0;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
119
|
+
.text-larger {
|
|
120
|
+
//.text-larger: stile applicabile da editor Slate
|
|
121
|
+
font-size: 1.75em;
|
|
123
122
|
}
|
|
123
|
+
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
//slate LINK
|
|
126
|
+
/*
|
|
127
|
+
Safari rendering issue workaround - B#60364
|
|
128
|
+
Safari rendering fix, icons and fonts coming late means shenanigans for Safari rendering, as
|
|
129
|
+
Safari is lazy and slow in loading fonts and icons dynamically.
|
|
130
|
+
Problem: Safari (tested on Safari 17.6) sometimes fails to calculate the layout correctly
|
|
131
|
+
when dealing with dynamic content such as lazy-loaded icons or fonts, combined with
|
|
132
|
+
`display: inline-block`. This can result in improperly positioned elements
|
|
133
|
+
until the page is re-rendered or refocused.
|
|
134
|
+
|
|
135
|
+
Solution: To fix this issue:
|
|
136
|
+
1. Replace `display: inline-block` with `display: inline-flex`. This ensures Safari
|
|
137
|
+
handles the box model and inline context properly, especially when the element's
|
|
138
|
+
size or alignment depends on dynamic content.
|
|
139
|
+
2. Add `position: relative;` to force a recalculation of layout, resolving rendering quirks.
|
|
140
|
+
|
|
141
|
+
Background: Safari's WebKit engine has known issues with `inline-block` combined
|
|
142
|
+
with delayed content rendering, such as lazy-loaded icons. Switching to `inline-flex`
|
|
143
|
+
better aligns with modern CSS rendering engines, while `position: relative;`
|
|
144
|
+
ensures the layout is recalculated.
|
|
145
|
+
|
|
146
|
+
References:
|
|
147
|
+
- CSS-Tricks: What Forces Layout or Reflow: https://css-tricks.com/what-forces-layout-reflow/
|
|
148
|
+
- WebKit Bug Reports on `inline-block` rendering issues with dynamic content.
|
|
149
|
+
- Testing and observations on Safari 17.6 behavior with lazy-loaded assets.
|
|
150
|
+
*/
|
|
151
|
+
@supports (-webkit-appearance: none) {
|
|
152
|
+
a.with-external-link-icon {
|
|
153
|
+
display: inline-flex; /* Evita problemi con inline-block */
|
|
154
|
+
position: relative; /* Forza Safari a calcolare il layout reflow correttamente */
|
|
127
155
|
}
|
|
156
|
+
}
|
|
157
|
+
// .inline-link {
|
|
158
|
+
// margin-left: 0.5rem;
|
|
159
|
+
// margin-right: 0.5rem;
|
|
160
|
+
// }
|
|
128
161
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
162
|
+
svg.external-link {
|
|
163
|
+
fill: currentColor;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.slate-editor-link {
|
|
167
|
+
clear: both;
|
|
132
168
|
|
|
133
|
-
|
|
169
|
+
&.btn {
|
|
170
|
+
display: inline-block;
|
|
171
|
+
padding: 12px 24px;
|
|
172
|
+
border-radius: $btn-border-radius;
|
|
134
173
|
margin: 0;
|
|
135
|
-
|
|
174
|
+
font-weight: 600;
|
|
175
|
+
text-align: center;
|
|
176
|
+
text-decoration: none;
|
|
177
|
+
|
|
178
|
+
&:hover,
|
|
179
|
+
&:active {
|
|
180
|
+
font-weight: 600;
|
|
181
|
+
}
|
|
136
182
|
|
|
137
|
-
|
|
138
|
-
display: inline-block;
|
|
139
|
-
padding: 1em 2em;
|
|
140
|
-
border-radius: $btn-border-radius;
|
|
141
|
-
margin: 0.5em 1em 0.5em 0;
|
|
183
|
+
&.btn-primary {
|
|
142
184
|
background-color: $primary;
|
|
143
185
|
color: $primary-text;
|
|
144
|
-
font-weight: 700;
|
|
145
|
-
text-align: center;
|
|
146
|
-
text-decoration: none;
|
|
147
186
|
|
|
148
187
|
&:hover,
|
|
149
188
|
&:active {
|
|
150
189
|
background-color: darken($primary, 8);
|
|
151
190
|
color: $primary-text;
|
|
152
|
-
font-weight: 700;
|
|
153
191
|
}
|
|
154
192
|
&.link-anchorlink-theme {
|
|
155
193
|
color: $primary-text !important;
|
|
156
194
|
}
|
|
157
195
|
}
|
|
158
|
-
/*
|
|
159
|
-
Safari rendering issue workaround - B#60364
|
|
160
|
-
Safari rendering fix, icons and fonts coming late means shenanigans for Safari rendering, as
|
|
161
|
-
Safari is lazy and slow in loading fonts and icons dynamically.
|
|
162
|
-
Problem: Safari (tested on Safari 17.6) sometimes fails to calculate the layout correctly
|
|
163
|
-
when dealing with dynamic content such as lazy-loaded icons or fonts, combined with
|
|
164
|
-
`display: inline-block`. This can result in improperly positioned elements
|
|
165
|
-
until the page is re-rendered or refocused.
|
|
166
|
-
|
|
167
|
-
Solution: To fix this issue:
|
|
168
|
-
1. Replace `display: inline-block` with `display: inline-flex`. This ensures Safari
|
|
169
|
-
handles the box model and inline context properly, especially when the element's
|
|
170
|
-
size or alignment depends on dynamic content.
|
|
171
|
-
2. Add `position: relative;` to force a recalculation of layout, resolving rendering quirks.
|
|
172
|
-
|
|
173
|
-
Background: Safari's WebKit engine has known issues with `inline-block` combined
|
|
174
|
-
with delayed content rendering, such as lazy-loaded icons. Switching to `inline-flex`
|
|
175
|
-
better aligns with modern CSS rendering engines, while `position: relative;`
|
|
176
|
-
ensures the layout is recalculated.
|
|
177
|
-
|
|
178
|
-
References:
|
|
179
|
-
- CSS-Tricks: What Forces Layout or Reflow: https://css-tricks.com/what-forces-layout-reflow/
|
|
180
|
-
- WebKit Bug Reports on `inline-block` rendering issues with dynamic content.
|
|
181
|
-
- Testing and observations on Safari 17.6 behavior with lazy-loaded assets.
|
|
182
|
-
*/
|
|
183
|
-
@supports (-webkit-appearance: none) {
|
|
184
|
-
a {
|
|
185
|
-
display: inline-flex; /* Evita problemi con inline-block */
|
|
186
|
-
position: relative; /* Forza Safari a calcolare il layout reflow correttamente */
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
div[class^='draftJsToolbar__toolbar__'] {
|
|
192
|
-
line-height: 1rem;
|
|
193
|
-
|
|
194
|
-
.icon {
|
|
195
|
-
font-size: 1rem;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.ui.input > input {
|
|
199
|
-
height: auto;
|
|
200
|
-
font-size: 0.8rem;
|
|
201
|
-
}
|
|
202
196
|
}
|
|
203
197
|
}
|
|
204
198
|
|
package/src/theme/_cms-ui.scss
CHANGED
|
@@ -18,7 +18,9 @@ body.cms-ui {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.block {
|
|
21
|
-
font-family: $font-family-serif;
|
|
21
|
+
font-family: $font-family-sans-serif;
|
|
22
|
+
font-weight: $font-weight-base;
|
|
23
|
+
line-height: $line-height-base;
|
|
22
24
|
|
|
23
25
|
%heading {
|
|
24
26
|
margin-top: 0; /* 1*/
|
|
@@ -64,21 +66,6 @@ body.cms-ui {
|
|
|
64
66
|
|
|
65
67
|
@import 'bootstrap-italia/src/scss/custom/type'; //to apply styles for headers on different screen sizes
|
|
66
68
|
|
|
67
|
-
// Placeholder block title
|
|
68
|
-
.title {
|
|
69
|
-
.public-DraftEditorPlaceholder-inner {
|
|
70
|
-
font-family: $font-family-sans-serif;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
&.title {
|
|
75
|
-
.public-DraftEditorPlaceholder-inner {
|
|
76
|
-
font-size: 2.66rem;
|
|
77
|
-
font-weight: bold;
|
|
78
|
-
line-height: 1.25;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
69
|
//align
|
|
83
70
|
.text-center {
|
|
84
71
|
text-align: center;
|
|
@@ -143,15 +130,34 @@ body.cms-ui {
|
|
|
143
130
|
&.contenttype-argomento,
|
|
144
131
|
&.contenttype-pagina-argomento,
|
|
145
132
|
&.contenttype-cartellamodulistica {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
133
|
+
.block {
|
|
134
|
+
font-family: $font-family-sans-serif;
|
|
135
|
+
font-weight: 300;
|
|
136
|
+
line-height: 1.555;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.simple-text-editor-widget {
|
|
141
|
+
.simple-text-input {
|
|
142
|
+
display: inline-block;
|
|
143
|
+
min-width: 1px;
|
|
144
|
+
|
|
145
|
+
&:empty:before {
|
|
146
|
+
display: block; /* For Firefox */
|
|
147
|
+
content: attr(placeholder);
|
|
148
|
+
font-weight: inherit;
|
|
149
|
+
opacity: 0.333;
|
|
150
|
+
pointer-events: none;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
.detached-slate-editor {
|
|
156
|
+
p:not(:last-child) {
|
|
157
|
+
margin-bottom: 1rem !important;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
155
161
|
.blocks-widget-container {
|
|
156
162
|
.block.table .toolbar {
|
|
157
163
|
top: -3.34rem;
|
|
@@ -209,8 +215,10 @@ body.cms-ui {
|
|
|
209
215
|
}
|
|
210
216
|
|
|
211
217
|
input#field-link {
|
|
218
|
+
height: auto;
|
|
212
219
|
height: auto;
|
|
213
220
|
color: #444;
|
|
221
|
+
font-size: 0.7rem;
|
|
214
222
|
font-weight: normal;
|
|
215
223
|
}
|
|
216
224
|
|
|
@@ -290,14 +298,6 @@ body.cms-ui {
|
|
|
290
298
|
}
|
|
291
299
|
}
|
|
292
300
|
|
|
293
|
-
.menu-configuration-widget {
|
|
294
|
-
.menu-blocks-container {
|
|
295
|
-
.DraftEditor-editorContainer .public-DraftEditor-content {
|
|
296
|
-
min-height: 19px;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
301
|
//cookie banner icons
|
|
302
302
|
// replaced icon code with left and right as they actually render correctly
|
|
303
303
|
// and rotated the icon
|
|
@@ -319,6 +319,10 @@ body.cms-ui {
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
+
.sidebar-container-enter-done {
|
|
323
|
+
z-index: 150000 !important;
|
|
324
|
+
}
|
|
325
|
+
|
|
322
326
|
.sidebar-container .object-listing,
|
|
323
327
|
.icon-align-name {
|
|
324
328
|
svg.icon {
|
|
@@ -408,6 +412,11 @@ body.cms-ui {
|
|
|
408
412
|
}
|
|
409
413
|
}
|
|
410
414
|
}
|
|
415
|
+
|
|
416
|
+
.slate-editor ul li {
|
|
417
|
+
display: list-item;
|
|
418
|
+
padding: 0;
|
|
419
|
+
}
|
|
411
420
|
}
|
|
412
421
|
|
|
413
422
|
.icon-align-name {
|
|
@@ -446,20 +455,34 @@ body.cms-ui {
|
|
|
446
455
|
background-color: $tertiary;
|
|
447
456
|
}
|
|
448
457
|
|
|
449
|
-
|
|
450
|
-
.button.
|
|
451
|
-
|
|
452
|
-
background-color: $alert-info;
|
|
458
|
+
.button.success,
|
|
459
|
+
.button.success.active {
|
|
460
|
+
background-color: $success;
|
|
453
461
|
}
|
|
454
462
|
|
|
455
463
|
.button.warning,
|
|
456
|
-
.button.warning
|
|
457
|
-
background-color: $
|
|
464
|
+
.button.success.warning {
|
|
465
|
+
background-color: $warning;
|
|
458
466
|
}
|
|
459
467
|
|
|
460
468
|
.button.danger,
|
|
461
469
|
.button.danger.active {
|
|
462
|
-
background-color: $
|
|
470
|
+
background-color: $danger;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.button.callout_default,
|
|
474
|
+
.button.callout_default.active {
|
|
475
|
+
background-color: $secondary;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.button.callout_note,
|
|
479
|
+
.button.callout_note.active {
|
|
480
|
+
background-color: $primary;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.button.info,
|
|
484
|
+
.button.info.active {
|
|
485
|
+
background-color: $info;
|
|
463
486
|
}
|
|
464
487
|
}
|
|
465
488
|
|
|
@@ -475,48 +498,16 @@ body.cms-ui {
|
|
|
475
498
|
}
|
|
476
499
|
}
|
|
477
500
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
h3,
|
|
483
|
-
h4,
|
|
484
|
-
h5,
|
|
485
|
-
h6 {
|
|
486
|
-
font-family: $font-family-sans-serif;
|
|
487
|
-
}
|
|
488
|
-
}*/
|
|
489
|
-
|
|
490
|
-
//stili per l'editor di testo dei ct con i campi
|
|
491
|
-
.DraftEditor-root {
|
|
492
|
-
.public-DraftStyleDefault-block {
|
|
493
|
-
margin-bottom: 1rem;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
li {
|
|
497
|
-
.public-DraftStyleDefault-block {
|
|
498
|
-
margin-bottom: unset;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.block.text {
|
|
504
|
-
.DraftEditor-root {
|
|
505
|
-
.public-DraftStyleDefault-block {
|
|
506
|
-
margin-bottom: unset;
|
|
501
|
+
.field-wrapper-icon {
|
|
502
|
+
.icon-container.italia-icon {
|
|
503
|
+
svg.icon {
|
|
504
|
+
height: 1.5em;
|
|
507
505
|
}
|
|
508
506
|
}
|
|
509
507
|
}
|
|
510
508
|
|
|
511
509
|
// z-index necessario su Volto 17 finché non passiamo ad usare slate
|
|
512
510
|
.block {
|
|
513
|
-
.DraftEditor-root {
|
|
514
|
-
.DraftEditor-editorContainer,
|
|
515
|
-
.public-DraftEditorPlaceholder-root {
|
|
516
|
-
z-index: 0;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
|
|
520
511
|
&.image {
|
|
521
512
|
.block.align {
|
|
522
513
|
&.left,
|
|
@@ -537,18 +528,6 @@ body.cms-ui {
|
|
|
537
528
|
}
|
|
538
529
|
}
|
|
539
530
|
|
|
540
|
-
.footer-configuration-widget {
|
|
541
|
-
.DraftEditor-editorContainer {
|
|
542
|
-
a.link-anchorlink-theme {
|
|
543
|
-
color: #06c;
|
|
544
|
-
|
|
545
|
-
&:hover {
|
|
546
|
-
color: darken(#06c, 20);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
531
|
&.section-controlpanel {
|
|
553
532
|
.grid > .row {
|
|
554
533
|
// HIDE TAXONOMIES CONTROLPANEL UNTIL #62343 IS DONE
|
|
@@ -603,10 +582,6 @@ body.cms-ui {
|
|
|
603
582
|
|
|
604
583
|
.block-editor-title,
|
|
605
584
|
.block-editor-description {
|
|
606
|
-
.DraftEditor-root {
|
|
607
|
-
padding: 0 1.333em;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
585
|
& + [class^='block-editor'] {
|
|
611
586
|
margin-top: 2.8rem;
|
|
612
587
|
}
|
|
@@ -628,78 +603,6 @@ body.cms-ui {
|
|
|
628
603
|
|
|
629
604
|
/////
|
|
630
605
|
|
|
631
|
-
.draftJsToolbarDropdown {
|
|
632
|
-
position: relative;
|
|
633
|
-
|
|
634
|
-
.draftJsToolbarDropdown-toggle {
|
|
635
|
-
display: flex;
|
|
636
|
-
width: 42px;
|
|
637
|
-
align-items: center;
|
|
638
|
-
justify-content: space-between;
|
|
639
|
-
|
|
640
|
-
.caret {
|
|
641
|
-
display: inline-block;
|
|
642
|
-
width: 0;
|
|
643
|
-
height: 0;
|
|
644
|
-
|
|
645
|
-
border: 5px solid transparent;
|
|
646
|
-
|
|
647
|
-
&.down {
|
|
648
|
-
border-top-color: #888;
|
|
649
|
-
margin-top: 5px;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
&.up {
|
|
653
|
-
border-bottom-color: #888;
|
|
654
|
-
margin-bottom: 5px;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
ul.draftJsToolbarDropdown-optionswrapper {
|
|
660
|
-
position: absolute;
|
|
661
|
-
top: 35px;
|
|
662
|
-
left: 50%;
|
|
663
|
-
padding: 0;
|
|
664
|
-
margin: 0;
|
|
665
|
-
background-color: #fff;
|
|
666
|
-
border-bottom-left-radius: 3px;
|
|
667
|
-
border-bottom-right-radius: 3px;
|
|
668
|
-
box-shadow:
|
|
669
|
-
0 0 8px rgba(0, 0, 0, 0.1),
|
|
670
|
-
0 2px 4px rgba(0, 0, 0, 0.05);
|
|
671
|
-
list-style-type: none;
|
|
672
|
-
transform: translateX(-50%);
|
|
673
|
-
|
|
674
|
-
&.hide {
|
|
675
|
-
display: none;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
.draftJsToolbarDropdown-option {
|
|
679
|
-
padding: 0.5rem;
|
|
680
|
-
color: $neutral-2-b5;
|
|
681
|
-
|
|
682
|
-
svg {
|
|
683
|
-
fill: $neutral-2-b5 !important;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
> * {
|
|
687
|
-
display: block;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
button {
|
|
691
|
-
width: 100%;
|
|
692
|
-
height: auto;
|
|
693
|
-
|
|
694
|
-
> * {
|
|
695
|
-
margin: 0;
|
|
696
|
-
color: $neutral-2-b5;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
|
|
703
606
|
.column.color-chooser {
|
|
704
607
|
padding-top: 0.5em;
|
|
705
608
|
padding-bottom: 0.5em;
|
package/src/theme/_mixins.scss
CHANGED
|
@@ -5,3 +5,16 @@
|
|
|
5
5
|
@mixin margin-size($key, $value) {
|
|
6
6
|
#{$key}: calc($value / 18) + em;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
@mixin blocks-with-bg-edit-buttons {
|
|
10
|
+
> .ui.basic.button.delete-button {
|
|
11
|
+
padding: 0.35rem;
|
|
12
|
+
text-align: center;
|
|
13
|
+
border-radius: 100%;
|
|
14
|
+
top: -0.25rem;
|
|
15
|
+
|
|
16
|
+
&:not(:hover):not(:focus):not(:focus-within) {
|
|
17
|
+
color: #fff !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
@import 'bootstrap-italia/src/scss/custom/form-select';
|
|
112
112
|
@import './bootstrap-italia/form-select';
|
|
113
113
|
@import 'bootstrap-italia/src/scss/custom/form-transfer';
|
|
114
|
+
@import './bootstrap-italia/forms';
|
|
114
115
|
@import 'bootstrap-italia/src/scss/custom/dropdown';
|
|
115
116
|
@import 'bootstrap-italia/src/scss/custom/pager';
|
|
116
117
|
@import 'bootstrap-italia/src/scss/custom/tab';
|
|
@@ -12,7 +12,7 @@ $sidebarFormBg: #fafafa;
|
|
|
12
12
|
.ui.input input[type='text'],
|
|
13
13
|
.ui.input input[type='url'],
|
|
14
14
|
textarea,
|
|
15
|
-
.
|
|
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
|
-
.
|
|
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
|
}
|
package/src/theme/site.scss
CHANGED
|
@@ -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';
|
|
@@ -122,7 +123,6 @@
|
|
|
122
123
|
@import 'ItaliaTheme/Widgets/luoghiCorrelatiEventoWidget';
|
|
123
124
|
@import 'ItaliaTheme/Components/megamenu';
|
|
124
125
|
@import 'ItaliaTheme/Components/sharing';
|
|
125
|
-
@import 'ItaliaTheme/Components/logo';
|
|
126
126
|
@import 'ItaliaTheme/Components/mobileMenu';
|
|
127
127
|
@import 'ItaliaTheme/Components/relatedItemInEvidence';
|
|
128
128
|
@import 'ItaliaTheme/Components/pageLoader';
|
package/test-setup-config.js
CHANGED
|
@@ -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
|
+
});
|