-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cc-check-poc
- Loading branch information
Showing
22 changed files
with
245 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Removed the non-breaking space from the external URL icon, removing the strange underline. @Tishasoumya-02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 13 additions & 21 deletions
34
packages/volto-light-theme/src/components/Blocks/Teaser/schema.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,22 @@ | ||
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; | ||
}; | ||
|
||
// 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; | ||
}; | ||
|
||
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
packages/volto-light-theme/src/components/Widgets/SizeWidget.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { defineMessages, useIntl } from 'react-intl'; | ||
import ButtonsWidget, { type ButtonsWidgetProps } from './ButtonsWidget'; | ||
import type { IntlShape } from 'react-intl'; | ||
|
||
const messages = defineMessages({ | ||
s: { | ||
id: 'Small', | ||
defaultMessage: 'Small', | ||
}, | ||
m: { | ||
id: 'Medium', | ||
defaultMessage: 'Medium', | ||
}, | ||
l: { | ||
id: 'Large', | ||
defaultMessage: 'Large', | ||
}, | ||
}); | ||
|
||
export const defaultActionsInfo = ({ intl }: { intl: IntlShape }) => ({ | ||
s: ['S', intl.formatMessage(messages.s)], | ||
m: ['M', intl.formatMessage(messages.m)], | ||
l: ['L', intl.formatMessage(messages.l)], | ||
}); | ||
|
||
const DEFAULT_ACTIONS = [ | ||
{ | ||
name: 's', | ||
label: 'Small', | ||
}, | ||
{ | ||
name: 'm', | ||
label: 'Medium', | ||
}, | ||
{ | ||
name: 'l', | ||
label: 'Large', | ||
}, | ||
]; | ||
|
||
const SizeWidget = (props: ButtonsWidgetProps) => { | ||
const intl = useIntl(); | ||
|
||
const { actions = DEFAULT_ACTIONS, actionsInfoMap, filterActions } = props; | ||
let filteredActions; | ||
if (filterActions) { | ||
filteredActions = actions.filter((action) => | ||
filterActions.includes(action.name), | ||
); | ||
} else { | ||
filteredActions = actions; | ||
} | ||
|
||
const actionsInfo = { | ||
...defaultActionsInfo({ intl }), | ||
...actionsInfoMap, | ||
}; | ||
|
||
return ( | ||
<ButtonsWidget | ||
{...props} | ||
actions={filteredActions} | ||
actionsInfoMap={actionsInfo} | ||
/> | ||
); | ||
}; | ||
|
||
export default SizeWidget; |
Oops, something went wrong.