diff --git a/apps/cms/config/sync/core.entity_view_display.media.image.quote.yml b/apps/cms/config/sync/core.entity_view_display.media.image.quote.yml new file mode 100644 index 000000000..b88657103 --- /dev/null +++ b/apps/cms/config/sync/core.entity_view_display.media.image.quote.yml @@ -0,0 +1,33 @@ +uuid: 195a40ca-6da4-4e2e-bc2f-c9c1fc0385bb +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.media.quote + - field.field.media.image.field_media_image + - image.style.quote + - media.type.image + module: + - image +id: media.image.quote +targetEntityType: media +bundle: image +mode: quote +content: + field_media_image: + type: image + label: visually_hidden + settings: + image_link: '' + image_style: quote + image_loading: + attribute: lazy + third_party_settings: { } + weight: 0 + region: content +hidden: + created: true + langcode: true + name: true + thumbnail: true + uid: true diff --git a/apps/cms/config/sync/core.entity_view_mode.media.quote.yml b/apps/cms/config/sync/core.entity_view_mode.media.quote.yml new file mode 100644 index 000000000..51148e9b4 --- /dev/null +++ b/apps/cms/config/sync/core.entity_view_mode.media.quote.yml @@ -0,0 +1,11 @@ +uuid: f54c9109-a0ff-4a09-9772-748af96b8eb0 +langcode: en +status: true +dependencies: + module: + - media +id: media.quote +label: Quote +description: '' +targetEntityType: media +cache: true diff --git a/apps/cms/config/sync/image.style.quote.yml b/apps/cms/config/sync/image.style.quote.yml new file mode 100644 index 000000000..b7a85ee89 --- /dev/null +++ b/apps/cms/config/sync/image.style.quote.yml @@ -0,0 +1,15 @@ +uuid: 983e88dc-78f8-463d-b088-026d7d96bcc0 +langcode: en +status: true +dependencies: { } +name: quote +label: 'Quote (24x24)' +effects: + 3ac18111-aeda-4cd7-aafc-5cd66d0cbf7e: + uuid: 3ac18111-aeda-4cd7-aafc-5cd66d0cbf7e + id: image_scale_and_crop + weight: 1 + data: + width: 24 + height: 24 + anchor: center-center diff --git a/packages/drupal/gutenberg_blocks/css/edit.css b/packages/drupal/gutenberg_blocks/css/edit.css index 1c603451e..39ab66473 100644 --- a/packages/drupal/gutenberg_blocks/css/edit.css +++ b/packages/drupal/gutenberg_blocks/css/edit.css @@ -7,16 +7,17 @@ margin:0; } +.gutenberg__editor blockquote .quote-image img { + object-fit: cover; + max-width: 100%; + border-radius: 9999px; +} + .gutenberg__editor blockquote::before, .gutenberg__editor blockquote::after { content: ''; } -.gutenberg__editor blockquote .quote-author, -.gutenberg__editor blockquote .quote-role { - text-align: right; -} - .gutenberg__editor .container-wrapper { display: block; position: relative; diff --git a/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx b/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx index 1aea31b6a..d5873d2d7 100644 --- a/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx +++ b/packages/drupal/gutenberg_blocks/src/blocks/quote.tsx @@ -35,63 +35,83 @@ registerBlockType(`custom/quote`, { // @ts-ignore edit: compose(withState())((props) => { return ( -
- { - props.setAttributes({ - quote: cleanUpText(quote, ['strong']), - }); - }} - /> - { - setPlainTextAttribute(props, 'author', author); - }} - /> - { - setPlainTextAttribute(props, 'role', role); - }} - /> - { +
+
+ + + + -
+ disableLineBreaks={false} + placeholder={__('Quote')} + keepPlaceholderOnFocus={false} + onChange={(quote) => { + props.setAttributes({ + quote: cleanUpText(quote, ['strong']), + }); + }} + /> +
+
+ { + // @ts-ignore + error = typeof error === 'string' ? error : error[2]; + dispatch('core/notices').createWarningNotice(error); + }} + /> +
+ { + setPlainTextAttribute(props, 'author', author); + }} + /> + / + { + setPlainTextAttribute(props, 'role', role); + }} + /> +
+
+ ); }), save() {