@kitconcept/volto-light-theme 1.0.0 → 2.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/src/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  import { defineMessages } from 'react-intl';
2
2
 
3
3
  import { composeSchema, getPreviousNextBlock } from '@plone/volto/helpers';
4
- import { defaultStylingSchema } from './components/Blocks/schema';
4
+ import {
5
+ defaultStylingSchema,
6
+ removeStylingSchema,
7
+ } from './components/Blocks/schema';
5
8
  import { teaserSchemaEnhancer } from './components/Blocks/Teaser/schema';
6
9
  import { videoBlockSchemaEnhancer } from './components/Blocks/Video/schema';
7
10
  import { gridTeaserDisableStylingSchema } from '@plone/volto/components/manage/Blocks/Teaser/schema';
@@ -48,6 +51,7 @@ defineMessages({
48
51
  const applyConfig = (config) => {
49
52
  config.settings.enableAutoBlockGroupingByBackgroundColor = true;
50
53
  config.settings.navDepth = 3;
54
+ config.settings.enableFatMenu = true;
51
55
  config.settings.slate.useLinkedHeadings = false;
52
56
 
53
57
  // No required blocks (eg. Title)
@@ -184,43 +188,43 @@ const applyConfig = (config) => {
184
188
  colors: BG_COLORS,
185
189
  schemaEnhancer: defaultStylingSchema,
186
190
  icon: gridSVG,
187
- gridAllowedBlocks: ['teaser', 'image', 'slate'],
188
- // One could customize the blocks inside the grid like this:
189
- blocksConfig: {
190
- ...config.blocks.blocksConfig,
191
- slate: {
192
- ...config.blocks.blocksConfig.slate,
193
- // Slate in grids must have an extra wrapper with the `slate` className
194
- view: (props) => {
195
- const EnhancedSlateViewComponent =
196
- config.blocks.blocksConfig.slate.view;
197
- return (
198
- <div className="slate">
199
- <EnhancedSlateViewComponent {...props} />
200
- </div>
201
- );
202
- },
203
- },
204
- image: {
205
- ...config.blocks.blocksConfig.image,
206
- schemaEnhancer: composeSchema(
207
- imageBlockSchemaEnhancer,
208
- gridImageDisableSizeAndPositionHandlersSchema,
209
- ),
210
- },
211
- teaser: {
212
- ...config.blocks.blocksConfig.teaser,
213
- schemaEnhancer: composeSchema(
214
- gridTeaserDisableStylingSchema,
215
- teaserSchemaEnhancer,
216
- ),
217
- },
218
- listing: {
219
- ...config.blocks.blocksConfig.listing,
220
- allowed_headline_tags: [['h2', 'h2']],
221
- variations: config.blocks.blocksConfig.listing.variations,
191
+ };
192
+
193
+ config.blocks.blocksConfig.gridBlock.blocksConfig = {
194
+ ...config.blocks.blocksConfig,
195
+ slate: {
196
+ ...config.blocks.blocksConfig.slate,
197
+ // Slate in grids must have an extra wrapper with the `slate` className
198
+ view: (props) => {
199
+ const EnhancedSlateViewComponent =
200
+ config.blocks.blocksConfig.slate.view;
201
+ return (
202
+ <div className="slate">
203
+ <EnhancedSlateViewComponent {...props} />
204
+ </div>
205
+ );
222
206
  },
223
207
  },
208
+ image: {
209
+ ...config.blocks.blocksConfig.image,
210
+ schemaEnhancer: composeSchema(
211
+ imageBlockSchemaEnhancer,
212
+ gridImageDisableSizeAndPositionHandlersSchema,
213
+ ),
214
+ },
215
+ teaser: {
216
+ ...config.blocks.blocksConfig.teaser,
217
+ schemaEnhancer: composeSchema(
218
+ gridTeaserDisableStylingSchema,
219
+ teaserSchemaEnhancer,
220
+ ),
221
+ },
222
+ listing: {
223
+ ...config.blocks.blocksConfig.listing,
224
+ allowed_headline_tags: [['h2', 'h2']],
225
+ schemaEnhancer: removeStylingSchema,
226
+ variations: [],
227
+ },
224
228
  };
225
229
 
226
230
  config.blocks.blocksConfig.introduction = {
@@ -288,7 +292,7 @@ const applyConfig = (config) => {
288
292
  };
289
293
 
290
294
  // Check if the separator is present before enhancing it
291
- if (config.blocks.blocksConfig.separator.id) {
295
+ if (config.blocks.blocksConfig?.separator?.id) {
292
296
  config.blocks.blocksConfig.separator = {
293
297
  ...config.blocks.blocksConfig.separator,
294
298
  schemaEnhancer: composeSchema(
@@ -50,3 +50,8 @@
50
50
  margin-bottom: 0;
51
51
  }
52
52
  }
53
+
54
+ // Edit mode adjustments
55
+ .block-editor-gridBlock.has--backgroundColor--grey .block h2.headline {
56
+ padding-top: $spacing-xlarge;
57
+ }