From 01c812e8830f35a2477d928d27875f773bf59d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Tue, 10 Dec 2024 12:35:07 +0100 Subject: [PATCH 1/9] Fix footer links if the link is not set. (#445) --- packages/volto-light-theme/news/445.bugfix | 1 + .../volto-light-theme/src/components/Footer/FooterLinks.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 packages/volto-light-theme/news/445.bugfix diff --git a/packages/volto-light-theme/news/445.bugfix b/packages/volto-light-theme/news/445.bugfix new file mode 100644 index 00000000..7c136074 --- /dev/null +++ b/packages/volto-light-theme/news/445.bugfix @@ -0,0 +1 @@ +Fixed footerlinks error if the link is created but not set. @sneridagh diff --git a/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx b/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx index 79c10ce4..a48bec1f 100644 --- a/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx +++ b/packages/volto-light-theme/src/components/Footer/FooterLinks.tsx @@ -14,8 +14,11 @@ const FooterLinks = (props: FooterLinksProps) => { {!isEmpty(links?.blocks) ? links.blocks_layout.items.map((itemId) => { const link = links.blocks[itemId]; + + if (isEmpty(link) || !link.href) return null; + const title = link.title || link.href[0]['title']; - const href = flattenToAppURL(link.href[0]['@id']); + const href = flattenToAppURL(link.href[0]?.['@id']); if (!href) return null; From 2eed4ee41079b8b3977f752c77b2d557b92bd9bf Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Tue, 10 Dec 2024 12:36:04 +0100 Subject: [PATCH 2/9] Release 6.0.0-alpha.6 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- packages/volto-light-theme/CHANGELOG.md | 6 ++++++ packages/volto-light-theme/news/445.bugfix | 1 - packages/volto-light-theme/package.json | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 packages/volto-light-theme/news/445.bugfix diff --git a/CHANGELOG.md b/CHANGELOG.md index e702592e..aec50ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ +## 6.0.0-alpha.6 (2024-12-10) + +### Bugfix + +- Fixed footerlinks error if the link is created but not set. @sneridagh [#445](https://github.com/kitconcept/volto-light-theme/pull/445) + ## 6.0.0-alpha.5 (2024-12-09) ### Bugfix diff --git a/package.json b/package.json index b87b6456..4e22c0d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kitconcept/volto-light-theme-dev", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "description": "Volto Light Theme by kitconcept", "main": "src/index.js", "types": "src/types/index.d.ts", diff --git a/packages/volto-light-theme/CHANGELOG.md b/packages/volto-light-theme/CHANGELOG.md index e702592e..aec50ac7 100644 --- a/packages/volto-light-theme/CHANGELOG.md +++ b/packages/volto-light-theme/CHANGELOG.md @@ -8,6 +8,12 @@ +## 6.0.0-alpha.6 (2024-12-10) + +### Bugfix + +- Fixed footerlinks error if the link is created but not set. @sneridagh [#445](https://github.com/kitconcept/volto-light-theme/pull/445) + ## 6.0.0-alpha.5 (2024-12-09) ### Bugfix diff --git a/packages/volto-light-theme/news/445.bugfix b/packages/volto-light-theme/news/445.bugfix deleted file mode 100644 index 7c136074..00000000 --- a/packages/volto-light-theme/news/445.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed footerlinks error if the link is created but not set. @sneridagh diff --git a/packages/volto-light-theme/package.json b/packages/volto-light-theme/package.json index e5dc7d84..6c8a7b0a 100644 --- a/packages/volto-light-theme/package.json +++ b/packages/volto-light-theme/package.json @@ -1,6 +1,6 @@ { "name": "@kitconcept/volto-light-theme", - "version": "6.0.0-alpha.5", + "version": "6.0.0-alpha.6", "description": "Volto Light Theme by kitconcept", "main": "src/index.ts", "types": "src/types/index.d.ts", From d4e7a71aec5226bdf2d7c32f0006874423fe4432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dante=20=C3=81lvarez?= <89805481+danalvrz@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:03:55 -0600 Subject: [PATCH 3/9] Fix image block schema (#435) Co-authored-by: Steve Piercy Co-authored-by: David Glick --- packages/volto-light-theme/news/435.bugfix | 1 + .../src/components/Blocks/Image/schema.js | 40 +++++++++++-------- .../volto-light-theme/src/config/blocks.tsx | 6 ++- .../src/theme/_variables.scss | 4 +- 4 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 packages/volto-light-theme/news/435.bugfix diff --git a/packages/volto-light-theme/news/435.bugfix b/packages/volto-light-theme/news/435.bugfix new file mode 100644 index 00000000..f10ab461 --- /dev/null +++ b/packages/volto-light-theme/news/435.bugfix @@ -0,0 +1 @@ +Don't show image size and alignment settings for image block inside a grid. @danalvrz \ No newline at end of file diff --git a/packages/volto-light-theme/src/components/Blocks/Image/schema.js b/packages/volto-light-theme/src/components/Blocks/Image/schema.js index e3fc4b19..0128e265 100644 --- a/packages/volto-light-theme/src/components/Blocks/Image/schema.js +++ b/packages/volto-light-theme/src/components/Blocks/Image/schema.js @@ -1,5 +1,5 @@ import { defineMessages } from 'react-intl'; -import { insertInArray, reorderArray } from '@plone/volto/helpers/Utils/Utils'; +import { insertInArray } from '@plone/volto/helpers/Utils/Utils'; import config from '@plone/volto/registry'; const messages = defineMessages({ @@ -19,7 +19,6 @@ const messages = defineMessages({ export const imageBlockSchemaEnhancer = ({ formData, schema, intl }) => { if (formData.url) { - schema.fieldsets = reorderArray(schema.fieldsets, 2, 1); schema.fieldsets[0].fields = insertInArray( schema.fieldsets[0].fields, 'description', @@ -31,6 +30,29 @@ export const imageBlockSchemaEnhancer = ({ formData, schema, intl }) => { 1, ); + schema.properties.description = { + title: intl.formatMessage(messages.Description), + widget: 'textarea', + }; + schema.properties.title = { + title: intl.formatMessage(messages.Title), + }; + } + + return schema; +}; + +export const standAloneImageBlockSchemaEnhancer = ({ + formData, + schema, + intl, +}) => { + if (formData.url) { + schema.properties.align.default = 'center'; + schema.properties.align.actions = ['left', 'right', 'center']; + + schema.properties.size.default = 'l'; + schema.properties.size.disabled = formData.align === 'center'; schema.properties.styles.schema.fieldsets[0].fields = [ 'blockWidth:noprefix', '--image-aspect-ratio', @@ -54,20 +76,6 @@ export const imageBlockSchemaEnhancer = ({ formData, schema, intl }) => { ], }; - schema.properties.description = { - title: intl.formatMessage(messages.Description), - widget: 'textarea', - }; - schema.properties.title = { - title: intl.formatMessage(messages.Title), - }; - - schema.properties.align.default = 'center'; - schema.properties.align.actions = ['left', 'right', 'center']; - - schema.properties.size.default = 'l'; - schema.properties.size.disabled = formData.align === 'center'; - schema.properties.styles.schema.properties['blockWidth:noprefix'].disabled = formData.align === 'left' || formData.align === 'right'; } diff --git a/packages/volto-light-theme/src/config/blocks.tsx b/packages/volto-light-theme/src/config/blocks.tsx index e5ef35a4..ef58bf2a 100644 --- a/packages/volto-light-theme/src/config/blocks.tsx +++ b/packages/volto-light-theme/src/config/blocks.tsx @@ -18,7 +18,10 @@ import GridListingBlockTemplate from '../components/Blocks/Listing/GridTemplate' import { ButtonStylingSchema } from '../components/Blocks/Button/schema'; import { SeparatorStylingSchema } from '../components/Blocks/Separator/schema'; -import { imageBlockSchemaEnhancer } from '../components/Blocks/Image/schema'; +import { + imageBlockSchemaEnhancer, + standAloneImageBlockSchemaEnhancer, +} from '../components/Blocks/Image/schema'; import { ImageBlockDataAdapter } from '../components/Blocks/Image/adapter'; import { AccordionSchemaEnhancer } from '../components/Blocks/Accordion/schema'; @@ -206,6 +209,7 @@ export default function install(config: ConfigType) { schemaEnhancer: composeSchema( defaultStylingSchema, imageBlockSchemaEnhancer, + standAloneImageBlockSchemaEnhancer, ), dataAdapter: ImageBlockDataAdapter, }; diff --git a/packages/volto-light-theme/src/theme/_variables.scss b/packages/volto-light-theme/src/theme/_variables.scss index eb2a2651..a5ef82ac 100644 --- a/packages/volto-light-theme/src/theme/_variables.scss +++ b/packages/volto-light-theme/src/theme/_variables.scss @@ -145,11 +145,11 @@ $secondary-grey: #ececec !default; --link-foreground-color: var(--link-color); // It is possible to set an aspect ratio for all images, using the folowing CSS custom property: - // --image-aspect-ratio: 16/9; + // --image-aspect-ratio: calc(16 / 9); } // Image Aspect Ratio -$aspect-ratio: 16/9 !default; +$aspect-ratio: calc(16 / 9) !default; // Weights $thin: 100 !default; From 2664697e5fdf84ac2fc5d2e3e17cc7469481eb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Wed, 11 Dec 2024 09:37:41 +0100 Subject: [PATCH 4/9] Add aspect-ratio for images/teasers inside grids (#447) --- docs/compatibility.md | 6 ++++- .../volto-light-theme/news/447.documentation | 1 + packages/volto-light-theme/news/447.feature | 1 + .../src/components/Blocks/Image/schema.js | 22 ++++++++++++++++++- .../src/components/Blocks/Teaser/schema.js | 12 ++++++++++ .../Widgets/BackgroundColorWidget.tsx | 3 +-- .../volto-light-theme/src/config/blocks.tsx | 11 +++++++--- .../src/theme/blocks/_grid.scss | 2 +- 8 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 packages/volto-light-theme/news/447.documentation create mode 100644 packages/volto-light-theme/news/447.feature diff --git a/docs/compatibility.md b/docs/compatibility.md index 8564470f..d06f61ce 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -13,8 +13,12 @@ myst: |-------------|---------------| | 3.x.x | >= Volto 17.0.0-alpha.16 | | 4.x.x | < Volto 17.18.0 | -| 5.x.x / 6.x.x | >= Volto 17.18.0 or >=Volto 18.0.0-alpha.36 | +| 5.x.x | >= Volto 17.18.0 | +| 6.x.x | >=Volto 18.0.0 | Compatibility with Volto 16 might be achieved, but it has to be at the customization level in the specific project add-on. This is mainly due to the `RenderBlocks` customization that is based on the one in Volto 17, because of the Grid block in core and the autogrouping feature. + +Same applies for achieving compatibility with Volto 17 beyond 5.x.x series, it will require backporting the utilities registry along with the client transforms for Redux reducers and the `styleWrapperStyleObjectEnhancer` feature. + See more information about the other dependencies in `peerDependencies` in {file}`package.json`. diff --git a/packages/volto-light-theme/news/447.documentation b/packages/volto-light-theme/news/447.documentation new file mode 100644 index 00000000..b9942921 --- /dev/null +++ b/packages/volto-light-theme/news/447.documentation @@ -0,0 +1 @@ +Update compatibility matrix. @sneridagh diff --git a/packages/volto-light-theme/news/447.feature b/packages/volto-light-theme/news/447.feature new file mode 100644 index 00000000..a198f18b --- /dev/null +++ b/packages/volto-light-theme/news/447.feature @@ -0,0 +1 @@ +Image aspect-ratio handlers for Teaser/Image inside a grid. @sneridagh diff --git a/packages/volto-light-theme/src/components/Blocks/Image/schema.js b/packages/volto-light-theme/src/components/Blocks/Image/schema.js index 0128e265..a770bb6c 100644 --- a/packages/volto-light-theme/src/components/Blocks/Image/schema.js +++ b/packages/volto-light-theme/src/components/Blocks/Image/schema.js @@ -1,5 +1,6 @@ import { defineMessages } from 'react-intl'; import { insertInArray } from '@plone/volto/helpers/Utils/Utils'; +import { addStyling } from '@plone/volto/helpers/Extensions/withBlockSchemaEnhancer'; import config from '@plone/volto/registry'; const messages = defineMessages({ @@ -71,8 +72,8 @@ export const standAloneImageBlockSchemaEnhancer = ({ widget: 'select', title: 'Aspect Ratio', choices: [ - ['1', '1:1'], ['16 / 9', '16/9'], + ['1', '1:1'], ], }; @@ -82,3 +83,22 @@ export const standAloneImageBlockSchemaEnhancer = ({ return schema; }; + +export function aspectRatioSchemaEnhancer({ schema, intl }) { + addStyling({ schema, intl }); + + schema.properties.styles.schema.fieldsets[0].fields = [ + ...schema.properties.styles.schema.fieldsets[0].fields, + '--image-aspect-ratio', + ]; + schema.properties.styles.schema.properties['--image-aspect-ratio'] = { + widget: 'select', + title: 'Aspect Ratio', + choices: [ + ['16 / 9', '16/9'], + ['1', '1:1'], + ], + }; + + return schema; +} diff --git a/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js b/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js index c71dbc5a..e0386c3a 100644 --- a/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js +++ b/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js @@ -28,3 +28,15 @@ export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => { schema.properties.styles.schema.fieldsets[0].fields = []; return schema; }; + +export const gridTeaserDisableAlignHandlersSchema = ({ + schema, + formData, + intl, +}) => { + schema.properties.styles.schema.fieldsets[0].fields = + schema.properties.styles.schema.fieldsets[0].fields.filter( + (item) => !['align'].includes(item), + ); + return schema; +}; diff --git a/packages/volto-light-theme/src/components/Widgets/BackgroundColorWidget.tsx b/packages/volto-light-theme/src/components/Widgets/BackgroundColorWidget.tsx index 786cce96..c6b6d94b 100644 --- a/packages/volto-light-theme/src/components/Widgets/BackgroundColorWidget.tsx +++ b/packages/volto-light-theme/src/components/Widgets/BackgroundColorWidget.tsx @@ -3,8 +3,7 @@ import config from '@plone/volto/registry'; import type { ColorPickerWidgetProps } from '@plone/volto/components/manage/Widgets/ColorPickerWidget'; const BackgroundColorWidget = (props: ColorPickerWidgetProps) => { - const colors: ColorPickerWidgetProps['colors'] = - config.settings.backgroundColors; + const colors: ColorPickerWidgetProps['colors'] = config.blocks.themes; const defaultValue = colors.find( (color) => color.name === config.settings.defaultBackgroundColor, diff --git a/packages/volto-light-theme/src/config/blocks.tsx b/packages/volto-light-theme/src/config/blocks.tsx index ef58bf2a..f2034ec4 100644 --- a/packages/volto-light-theme/src/config/blocks.tsx +++ b/packages/volto-light-theme/src/config/blocks.tsx @@ -6,9 +6,12 @@ import cloneDeep from 'lodash/cloneDeep'; import { composeSchema } from '@plone/volto/helpers/Extensions'; import { findStyleByName } from '@plone/volto/helpers/Blocks/Blocks'; import { defaultStylingSchema } from '../components/Blocks/schema'; -import { teaserSchemaEnhancer } from '../components/Blocks/Teaser/schema'; +import { + gridTeaserDisableAlignHandlersSchema, + teaserSchemaEnhancer, +} from '../components/Blocks/Teaser/schema'; import { videoBlockSchemaEnhancer } from '../components/Blocks/Video/schema'; -import { gridTeaserDisableStylingSchema } from '@plone/volto/components/manage/Blocks/Teaser/schema'; + import { gridImageDisableSizeAndPositionHandlersSchema } from '@plone/volto/components/manage/Blocks/Image/schema'; import { disableBgColorSchema } from '../components/Blocks/disableBgColorSchema'; @@ -21,6 +24,7 @@ import { SeparatorStylingSchema } from '../components/Blocks/Separator/schema'; import { imageBlockSchemaEnhancer, standAloneImageBlockSchemaEnhancer, + aspectRatioSchemaEnhancer, } from '../components/Blocks/Image/schema'; import { ImageBlockDataAdapter } from '../components/Blocks/Image/adapter'; @@ -242,13 +246,14 @@ export default function install(config: ConfigType) { config.blocks.blocksConfig.gridBlock.blocksConfig.image.schemaEnhancer = composeSchema( imageBlockSchemaEnhancer, + aspectRatioSchemaEnhancer, gridImageDisableSizeAndPositionHandlersSchema, ); config.blocks.blocksConfig.gridBlock.blocksConfig.image.dataAdapter = ImageBlockDataAdapter; config.blocks.blocksConfig.gridBlock.blocksConfig.teaser.schemaEnhancer = - composeSchema(gridTeaserDisableStylingSchema, teaserSchemaEnhancer); + composeSchema(gridTeaserDisableAlignHandlersSchema, teaserSchemaEnhancer); config.blocks.blocksConfig.gridBlock.blocksConfig.listing.allowed_headline_tags = [['h2', 'h2']]; diff --git a/packages/volto-light-theme/src/theme/blocks/_grid.scss b/packages/volto-light-theme/src/theme/blocks/_grid.scss index 0236cf00..6605410b 100644 --- a/packages/volto-light-theme/src/theme/blocks/_grid.scss +++ b/packages/volto-light-theme/src/theme/blocks/_grid.scss @@ -30,7 +30,7 @@ // Override the Image component `aspect-ratio` .block.image img { - aspect-ratio: $aspect-ratio !important; + aspect-ratio: var(--image-aspect-ratio, $aspect-ratio) !important; } .block.teaser { From 762cdb411e13cce645ded2a2cd242970402fb290 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Wed, 11 Dec 2024 09:38:21 +0100 Subject: [PATCH 5/9] Release 6.0.0-alpha.7 --- CHANGELOG.md | 14 ++++++++++++++ package.json | 2 +- packages/volto-light-theme/CHANGELOG.md | 14 ++++++++++++++ packages/volto-light-theme/news/435.bugfix | 1 - packages/volto-light-theme/news/447.documentation | 1 - packages/volto-light-theme/news/447.feature | 1 - packages/volto-light-theme/package.json | 2 +- 7 files changed, 30 insertions(+), 5 deletions(-) delete mode 100644 packages/volto-light-theme/news/435.bugfix delete mode 100644 packages/volto-light-theme/news/447.documentation delete mode 100644 packages/volto-light-theme/news/447.feature diff --git a/CHANGELOG.md b/CHANGELOG.md index aec50ac7..005665c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,20 @@ +## 6.0.0-alpha.7 (2024-12-11) + +### Feature + +- Image aspect-ratio handlers for Teaser/Image inside a grid. @sneridagh [#447](https://github.com/kitconcept/volto-light-theme/pull/447) + +### Bugfix + +- Don't show image size and alignment settings for image block inside a grid. @danalvrz [#435](https://github.com/kitconcept/volto-light-theme/pull/435) + +### Documentation + +- Update compatibility matrix. @sneridagh [#447](https://github.com/kitconcept/volto-light-theme/pull/447) + ## 6.0.0-alpha.6 (2024-12-10) ### Bugfix diff --git a/package.json b/package.json index 4e22c0d7..7e421855 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kitconcept/volto-light-theme-dev", - "version": "6.0.0-alpha.6", + "version": "6.0.0-alpha.7", "description": "Volto Light Theme by kitconcept", "main": "src/index.js", "types": "src/types/index.d.ts", diff --git a/packages/volto-light-theme/CHANGELOG.md b/packages/volto-light-theme/CHANGELOG.md index aec50ac7..005665c2 100644 --- a/packages/volto-light-theme/CHANGELOG.md +++ b/packages/volto-light-theme/CHANGELOG.md @@ -8,6 +8,20 @@ +## 6.0.0-alpha.7 (2024-12-11) + +### Feature + +- Image aspect-ratio handlers for Teaser/Image inside a grid. @sneridagh [#447](https://github.com/kitconcept/volto-light-theme/pull/447) + +### Bugfix + +- Don't show image size and alignment settings for image block inside a grid. @danalvrz [#435](https://github.com/kitconcept/volto-light-theme/pull/435) + +### Documentation + +- Update compatibility matrix. @sneridagh [#447](https://github.com/kitconcept/volto-light-theme/pull/447) + ## 6.0.0-alpha.6 (2024-12-10) ### Bugfix diff --git a/packages/volto-light-theme/news/435.bugfix b/packages/volto-light-theme/news/435.bugfix deleted file mode 100644 index f10ab461..00000000 --- a/packages/volto-light-theme/news/435.bugfix +++ /dev/null @@ -1 +0,0 @@ -Don't show image size and alignment settings for image block inside a grid. @danalvrz \ No newline at end of file diff --git a/packages/volto-light-theme/news/447.documentation b/packages/volto-light-theme/news/447.documentation deleted file mode 100644 index b9942921..00000000 --- a/packages/volto-light-theme/news/447.documentation +++ /dev/null @@ -1 +0,0 @@ -Update compatibility matrix. @sneridagh diff --git a/packages/volto-light-theme/news/447.feature b/packages/volto-light-theme/news/447.feature deleted file mode 100644 index a198f18b..00000000 --- a/packages/volto-light-theme/news/447.feature +++ /dev/null @@ -1 +0,0 @@ -Image aspect-ratio handlers for Teaser/Image inside a grid. @sneridagh diff --git a/packages/volto-light-theme/package.json b/packages/volto-light-theme/package.json index 6c8a7b0a..020a1654 100644 --- a/packages/volto-light-theme/package.json +++ b/packages/volto-light-theme/package.json @@ -1,6 +1,6 @@ { "name": "@kitconcept/volto-light-theme", - "version": "6.0.0-alpha.6", + "version": "6.0.0-alpha.7", "description": "Volto Light Theme by kitconcept", "main": "src/index.ts", "types": "src/types/index.d.ts", From 01162ab46e78bf7d414b3d1564454b29194151cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Fri, 13 Dec 2024 10:28:29 +0100 Subject: [PATCH 6/9] Remove aspect-ratio by default in teaser and images (#448) --- packages/volto-light-theme/news/448.bugfix | 1 + .../src/components/Blocks/Image/schema.js | 10 ---------- .../src/components/Blocks/Teaser/schema.js | 14 -------------- .../src/theme/blocks/_teaser.scss | 2 +- 4 files changed, 2 insertions(+), 25 deletions(-) create mode 100644 packages/volto-light-theme/news/448.bugfix diff --git a/packages/volto-light-theme/news/448.bugfix b/packages/volto-light-theme/news/448.bugfix new file mode 100644 index 00000000..9959bdea --- /dev/null +++ b/packages/volto-light-theme/news/448.bugfix @@ -0,0 +1 @@ +Remove the `aspect-ratio` handler by default in images and teasers. @sneridagh diff --git a/packages/volto-light-theme/src/components/Blocks/Image/schema.js b/packages/volto-light-theme/src/components/Blocks/Image/schema.js index a770bb6c..fc175129 100644 --- a/packages/volto-light-theme/src/components/Blocks/Image/schema.js +++ b/packages/volto-light-theme/src/components/Blocks/Image/schema.js @@ -56,7 +56,6 @@ export const standAloneImageBlockSchemaEnhancer = ({ schema.properties.size.disabled = formData.align === 'center'; schema.properties.styles.schema.fieldsets[0].fields = [ 'blockWidth:noprefix', - '--image-aspect-ratio', ...schema.properties.styles.schema.fieldsets[0].fields, ]; @@ -68,15 +67,6 @@ export const standAloneImageBlockSchemaEnhancer = ({ actions: config.blocks.widths, }; - schema.properties.styles.schema.properties['--image-aspect-ratio'] = { - widget: 'select', - title: 'Aspect Ratio', - choices: [ - ['16 / 9', '16/9'], - ['1', '1:1'], - ], - }; - schema.properties.styles.schema.properties['blockWidth:noprefix'].disabled = formData.align === 'left' || formData.align === 'right'; } diff --git a/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js b/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js index e0386c3a..ab1641d1 100644 --- a/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js +++ b/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js @@ -1,20 +1,6 @@ export const teaserSchemaEnhancer = ({ schema, formData, intl }) => { schema.properties.href.selectedItemAttrs.push('getRemoteUrl'); - schema.properties.styles.schema.fieldsets[0].fields = [ - ...schema.properties.styles.schema.fieldsets[0].fields, - '--image-aspect-ratio', - ]; - - schema.properties.styles.schema.properties['--image-aspect-ratio'] = { - widget: 'select', - title: 'Aspect Ratio', - choices: [ - ['1', '1:1'], - ['16 / 9', '16/9'], - ], - }; - return schema; }; diff --git a/packages/volto-light-theme/src/theme/blocks/_teaser.scss b/packages/volto-light-theme/src/theme/blocks/_teaser.scss index bdc6780f..db76bad0 100644 --- a/packages/volto-light-theme/src/theme/blocks/_teaser.scss +++ b/packages/volto-light-theme/src/theme/blocks/_teaser.scss @@ -19,7 +19,7 @@ } } - .teaser-item { + .teaser-item:not(.placeholder) { align-items: start; padding-bottom: 40px; // same as vertical spacing in margin-bottom border-bottom: 1px solid $black; From 50c906d4c52eb4cb9cd1efc67ca3ad8c525aa770 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Fri, 13 Dec 2024 10:50:19 +0100 Subject: [PATCH 7/9] Release 6.0.0-alpha.8 --- CHANGELOG.md | 6 ++++++ package.json | 2 +- packages/volto-light-theme/CHANGELOG.md | 6 ++++++ packages/volto-light-theme/news/448.bugfix | 1 - packages/volto-light-theme/package.json | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) delete mode 100644 packages/volto-light-theme/news/448.bugfix diff --git a/CHANGELOG.md b/CHANGELOG.md index 005665c2..9f6a1d76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ +## 6.0.0-alpha.8 (2024-12-13) + +### Bugfix + +- Remove the `aspect-ratio` handler by default in images and teasers. @sneridagh [#448](https://github.com/kitconcept/volto-light-theme/pull/448) + ## 6.0.0-alpha.7 (2024-12-11) ### Feature diff --git a/package.json b/package.json index 7e421855..3c7a31ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kitconcept/volto-light-theme-dev", - "version": "6.0.0-alpha.7", + "version": "6.0.0-alpha.8", "description": "Volto Light Theme by kitconcept", "main": "src/index.js", "types": "src/types/index.d.ts", diff --git a/packages/volto-light-theme/CHANGELOG.md b/packages/volto-light-theme/CHANGELOG.md index 005665c2..9f6a1d76 100644 --- a/packages/volto-light-theme/CHANGELOG.md +++ b/packages/volto-light-theme/CHANGELOG.md @@ -8,6 +8,12 @@ +## 6.0.0-alpha.8 (2024-12-13) + +### Bugfix + +- Remove the `aspect-ratio` handler by default in images and teasers. @sneridagh [#448](https://github.com/kitconcept/volto-light-theme/pull/448) + ## 6.0.0-alpha.7 (2024-12-11) ### Feature diff --git a/packages/volto-light-theme/news/448.bugfix b/packages/volto-light-theme/news/448.bugfix deleted file mode 100644 index 9959bdea..00000000 --- a/packages/volto-light-theme/news/448.bugfix +++ /dev/null @@ -1 +0,0 @@ -Remove the `aspect-ratio` handler by default in images and teasers. @sneridagh diff --git a/packages/volto-light-theme/package.json b/packages/volto-light-theme/package.json index 020a1654..e518eab5 100644 --- a/packages/volto-light-theme/package.json +++ b/packages/volto-light-theme/package.json @@ -1,6 +1,6 @@ { "name": "@kitconcept/volto-light-theme", - "version": "6.0.0-alpha.7", + "version": "6.0.0-alpha.8", "description": "Volto Light Theme by kitconcept", "main": "src/index.ts", "types": "src/types/index.d.ts", From ef23207244e6d8e0fa0d757f5e5884648c177be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Fri, 13 Dec 2024 11:43:50 +0100 Subject: [PATCH 8/9] Remove teaser styling tab inside grids since it's empty (#449) --- packages/volto-light-theme/news/449.bugfix | 1 + .../src/components/Blocks/Teaser/schema.js | 8 +------- packages/volto-light-theme/src/config/blocks.tsx | 5 +++-- 3 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 packages/volto-light-theme/news/449.bugfix diff --git a/packages/volto-light-theme/news/449.bugfix b/packages/volto-light-theme/news/449.bugfix new file mode 100644 index 00000000..2d980cdc --- /dev/null +++ b/packages/volto-light-theme/news/449.bugfix @@ -0,0 +1 @@ +Remove teaser styling tab inside grids since it's empty. @sneridagh diff --git a/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js b/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js index ab1641d1..45163506 100644 --- a/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js +++ b/packages/volto-light-theme/src/components/Blocks/Teaser/schema.js @@ -4,14 +4,8 @@ export const teaserSchemaEnhancer = ({ schema, formData, intl }) => { return schema; }; -// Not sure why, but it was in the new one, check with blockModel3 -// export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => { -// schema.fieldsets = schema.fieldsets.filter((item) => item.id !== 'styling'); -// return schema; -// }; export const gridTeaserDisableStylingSchema = ({ schema, formData, intl }) => { - // Remove all the existing fields from the default schema - schema.properties.styles.schema.fieldsets[0].fields = []; + schema.fieldsets = schema.fieldsets.filter((item) => item.id !== 'styling'); return schema; }; diff --git a/packages/volto-light-theme/src/config/blocks.tsx b/packages/volto-light-theme/src/config/blocks.tsx index f2034ec4..d08f6a35 100644 --- a/packages/volto-light-theme/src/config/blocks.tsx +++ b/packages/volto-light-theme/src/config/blocks.tsx @@ -7,7 +7,7 @@ import { composeSchema } from '@plone/volto/helpers/Extensions'; import { findStyleByName } from '@plone/volto/helpers/Blocks/Blocks'; import { defaultStylingSchema } from '../components/Blocks/schema'; import { - gridTeaserDisableAlignHandlersSchema, + gridTeaserDisableStylingSchema, teaserSchemaEnhancer, } from '../components/Blocks/Teaser/schema'; import { videoBlockSchemaEnhancer } from '../components/Blocks/Video/schema'; @@ -136,6 +136,7 @@ export default function install(config: ConfigType) { if (!data['@type']) return {}; if (data.theme) { const blockConfig = config.blocks.blocksConfig[data['@type']]; + if (!blockConfig) return {}; const blockStyleDefinitions = // We look up for the blockThemes in the block's config, then in the global config // We keep `colors` for BBB, but `themes` should be used @@ -253,7 +254,7 @@ export default function install(config: ConfigType) { ImageBlockDataAdapter; config.blocks.blocksConfig.gridBlock.blocksConfig.teaser.schemaEnhancer = - composeSchema(gridTeaserDisableAlignHandlersSchema, teaserSchemaEnhancer); + composeSchema(teaserSchemaEnhancer, gridTeaserDisableStylingSchema); config.blocks.blocksConfig.gridBlock.blocksConfig.listing.allowed_headline_tags = [['h2', 'h2']]; From db629b1b9f401e62852b18828df906f471f21f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Fri, 13 Dec 2024 18:03:50 +0100 Subject: [PATCH 9/9] Remove the AR handler from images (#450) --- packages/volto-light-theme/news/450.bugfix | 1 + packages/volto-light-theme/src/config/blocks.tsx | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) create mode 100644 packages/volto-light-theme/news/450.bugfix diff --git a/packages/volto-light-theme/news/450.bugfix b/packages/volto-light-theme/news/450.bugfix new file mode 100644 index 00000000..a7a9c2de --- /dev/null +++ b/packages/volto-light-theme/news/450.bugfix @@ -0,0 +1 @@ +Remove the last dangling `aspect-ratio` handler from image block. @sneridagh diff --git a/packages/volto-light-theme/src/config/blocks.tsx b/packages/volto-light-theme/src/config/blocks.tsx index d08f6a35..0a608f5b 100644 --- a/packages/volto-light-theme/src/config/blocks.tsx +++ b/packages/volto-light-theme/src/config/blocks.tsx @@ -24,7 +24,6 @@ import { SeparatorStylingSchema } from '../components/Blocks/Separator/schema'; import { imageBlockSchemaEnhancer, standAloneImageBlockSchemaEnhancer, - aspectRatioSchemaEnhancer, } from '../components/Blocks/Image/schema'; import { ImageBlockDataAdapter } from '../components/Blocks/Image/adapter'; @@ -247,7 +246,6 @@ export default function install(config: ConfigType) { config.blocks.blocksConfig.gridBlock.blocksConfig.image.schemaEnhancer = composeSchema( imageBlockSchemaEnhancer, - aspectRatioSchemaEnhancer, gridImageDisableSizeAndPositionHandlersSchema, ); config.blocks.blocksConfig.gridBlock.blocksConfig.image.dataAdapter =