Skip to content

Commit

Permalink
Merge pull request #79 from ubc-web-services/d10
Browse files Browse the repository at this point in the history
D10
  • Loading branch information
occupant authored Apr 24, 2024
2 parents 3113b38 + f6fe4db commit 53b295a
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 22 deletions.
31 changes: 20 additions & 11 deletions ubc_editor_config/config/install/editor.editor.filtered_text.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ settings:
- '|'
- undo
- redo
- removeFormat
- showBlocks
- Fullscreen
- sourceEditing
plugins:
Expand All @@ -72,20 +74,30 @@ settings:
ckeditor5_sourceEditing:
allowed_tags:
- '<cite>'
- '<a hreflang class id name data-* aria-*>'
- '<blockquote cite>'
- '<span class>'
- '<ul type>'
- '<ol type>'
- '<iframe allowfullscreen frameborder height max-width src class>'
- '<dd>'
- '<dl>'
- '<dt>'
- '<kbd>'
- '<samp>'
- '<iframe longdesc name scrolling src title align height frameborder width allowfullscreen max-width class>'
- '<img srcset>'
- '<svg viewBox aria-* class>'
- '<use href>'
- '<span>'
- '<drupal-media title class>'
- '<h2 id>'
- '<h3 id>'
- '<h4 id>'
- '<h5 id>'
- '<h6 id>'
ckeditor5_style:
styles:
-
label: 'Text Hug (remove top spacing)'
element: '<p class="text-hug">'
-
label: 'Lead Text'
element: '<p class="text-lead text-ubc-blue-sea">'
element: '<p class="text-lead">'
-
label: 'Text: small'
element: '<p class="text-sm">'
Expand Down Expand Up @@ -170,12 +182,9 @@ settings:
-
label: 'Transparent Button'
element: '<a class="unit-button unit-button--transparent">'
-
label: 'Simple Button'
element: '<a class="unit-button unit-button--simple">'
-
label: 'Hidden Anchor'
element: '<a class="anchor-invisible sr-only">'
element: '<a class="anchor anchor-invisible sr-only">'
editor_advanced_link_link:
enabled_attributes:
- id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
langcode: en
status: true
dependencies:
module:
- focal_point
name: card_focal_point_xl
label: 'Card, focal point, xl'
effects:
6e3afed2-f98e-4eea-9b7a-e8b220af77b1:
uuid: 6e3afed2-f98e-4eea-9b7a-e8b220af77b1
id: focal_point_scale_and_crop
weight: 1
data:
width: 970
height: 843
crop_type: focal_point
14 changes: 14 additions & 0 deletions ubc_image_styles/config/install/image.style.video_thumbnail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
langcode: en
status: true
dependencies: { }
name: video_thumbnail
label: 'Video thumbnail'
effects:
5c2acded-7aed-40d4-a6cc-d12164bb6750:
uuid: 5c2acded-7aed-40d4-a6cc-d12164bb6750
id: image_scale_and_crop
weight: 1
data:
width: 900
height: 506
anchor: center-center
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ dependencies:
config:
- image.style.card_focal_point_lg
- image.style.card_focal_point_sm
- image.style.card_focal_point_xl
- image.style.medium
id: card_focal_point
label: 'Card, focal point'
image_style_mappings:
-
breakpoint_id: responsive_image.viewport_sizing
multiplier: 1x
image_mapping_type: sizes
image_mapping:
sizes: '(min-width:960px) 640px, (min-width:640px) 320px, 100vw'
sizes: '(max-width: 380px) 380px, (max-width: 640px) 640px, 970px'
sizes_image_styles:
- card_focal_point_lg
- card_focal_point_sm
- card_focal_point_xl
breakpoint_id: responsive_image.viewport_sizing
multiplier: 1x
breakpoint_group: responsive_image
fallback_image_style: medium
32 changes: 32 additions & 0 deletions ubc_image_styles/ubc_image_styles.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
<?php

/**
* Implements hook_install().
*
* @ingroup ubc_image_styles
*/
function ubc_image_styles_install() {
$config = \Drupal::service('config.factory');
// alter preexisting responsive image style when installing
$config->getEditable('responsive_image.styles.wide')
->set('dependencies.config', [
'image.style.max_1300x1300',
'image.style.max_2600x2600',
'image.style.max_970x970',
])
->set('image_style_mappings', [
'0' => [
'image_mapping_type' => 'sizes',
'breakpoint_id' => 'responsive_image.viewport_sizing',
'multiplier' => '1x',
'image_mapping' => [
'sizes' => '(min-width: 1290px) 1290px, 100vw',
'sizes_image_styles' => [
'max_1300x1300',
'max_2600x2600',
'max_970x970',
],
],
],
])
->set('fallback_image_style', 'max_970x970')
->save();
}

/**
* Update configuration from file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,64 @@ dependencies:
config:
- core.entity_view_mode.media.full
- field.field.media.remote_video.field_media_oembed_video
- image.style.video_thumbnail
- media.type.remote_video
module:
- field_group
- media
- svg_image
third_party_settings:
field_group:
group_wrapper:
children:
- thumbnail
- field_media_oembed_video
label: Wrapper
parent_name: ''
weight: 20
region: hidden
weight: 4
format_type: html_element
format_settings:
label: Wrapper
classes: media-embed-letterbox
id: ''
element: div
show_label: false
label_element: h3
attributes: ''
effect: none
speed: fast
id: ''
classes: media-embed-letterbox
label: Wrapper
id: media.remote_video.full
targetEntityType: media
bundle: remote_video
mode: full
content:
field_media_oembed_video:
type: oembed
weight: 0
label: hidden
settings:
max_width: 900
max_height: 508
max_height: 506
loading:
attribute: lazy
third_party_settings: { }
weight: 0
region: content
thumbnail:
type: image
label: hidden
settings:
image_link: ''
image_style: video_thumbnail
image_loading:
attribute: lazy
svg_attributes:
width: null
height: null
svg_render_as_image: true
third_party_settings: { }
weight: 0
region: content
hidden:
created: true
name: true
thumbnail: true
uid: true
1 change: 1 addition & 0 deletions ubc_media_entities/ubc_media_entities.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dependencies:
- drupal:media
- drupal:media_bulk_upload
- drupal:svg_image
- ubc_image_styles:ubc_image_styles
core_version_requirement: ^10
62 changes: 62 additions & 0 deletions ubc_media_entities/ubc_media_entities.install
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
<?php


/**
* Implements hook_install().
*
* @ingroup ubc_media_entities
*/
function ubc_media_entities_install() {
$config = \Drupal::service('config.factory');
// alter preexisting media view mode when installing
$config->getEditable('core.entity_view_display.media.remote_video.default')
->set('dependencies.config', [
'field.field.media.remote_video.field_media_oembed_video',
'image.style.video_thumbnail',
'media.type.remote_video',
])
->set('dependencies.module', [
'media',
'svg_image',
])
->set('content', [
'field_media_oembed_video' => [
'type' => 'oembed',
'label' => 'hidden',
'weight' => '0',
'region' => 'content',
'third_party_settings' => [],
'settings' => [
'max_width' => '900',
'max_height' => '506',
'loading' => [
'attribute' => 'lazy',
],
],
],
'thumbnail' => [
'type' => 'image',
'label' => 'hidden',
'weight' => '1',
'region' => 'content',
'third_party_settings' => [],
'settings' => [
'image_link' => '',
'image_style' => 'video_thumbnail',
'image_loading' => [
'attribute' => 'lazy',
],
'svg_attributes' => [
'width' => null,
'height' => null,
],
'svg_render_as_image' => true,
],
],
])
->set('hidden', [
'created' => true,
'name' => true,
'uid' => true,
])
->save();
}


/**
* Update configuration from file.
* https://www.drupal.org/docs/8/api/update-api/introduction-to-update-api-for-drupal-8
Expand Down

0 comments on commit 53b295a

Please sign in to comment.