diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e31e1e065..e689d52cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,15 +21,18 @@ jobs: - name: Commit Compiled Component Library uses: EndBug/add-and-commit@v9 with: + author_name: github-actions[bot] + author_email: github-actions[bot]@users.noreply.github.com add: "node_modules/@yalesites-org/component-library-twig -f" message: "build: commit compiled component library" - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} YALESITES_BUILD_TOKEN: ${{ secrets.YALESITES_BUILD_TOKEN }} - run: npm run semantic-release - - name: Remove Compiled Component Library - uses: EndBug/add-and-commit@v7 - with: - remove: "--cached -r node_modules" - message: "build: removed compiled component library from git" + run: npx semantic-release + - name: Reset branch to prior commit + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + git reset --hard $GITHUB_SHA + git push --force diff --git a/atomic.libraries.yml b/atomic.libraries.yml index 76f2cc647..6098b46b5 100644 --- a/atomic.libraries.yml +++ b/atomic.libraries.yml @@ -80,6 +80,11 @@ text-link: node_modules/@yalesites-org/component-library-twig/dist/js/01-atoms/controls/text-link/yds-text-link.js: {} +text: + js: + node_modules/@yalesites-org/component-library-twig/dist/js/01-atoms/typography/text/yds-text.js: + {} + text-copy-button: js: node_modules/@yalesites-org/component-library-twig/dist/js/01-atoms/controls/text-copy-button/yds-text-copy-button.js: diff --git a/css/admin-theme.css b/css/admin-theme.css index 5bf0da91d..e55da3898 100644 --- a/css/admin-theme.css +++ b/css/admin-theme.css @@ -132,8 +132,11 @@ html.gin--dark-mode form.layout-builder-configure-block.glb-form { // Offcanvas toolbar styles */ #drupal-off-canvas-wrapper { + --off-canvas-button-background-color: #555; + color: var(--gin-color-text) !important; background-color: var(--gin-bg-layer) !important; + font-family: var(--gin-font); } #drupal-off-canvas-wrapper .ui-dialog-titlebar { @@ -141,7 +144,56 @@ html.gin--dark-mode form.layout-builder-configure-block.glb-form { color: var(--gin-color-text) !important; } -/* +#drupal-off-canvas-wrapper .button--primary { + background-color: var(--color-blue-yale) !important; +} + +#drupal-off-canvas-wrapper .button--primary:hover, +#drupal-off-canvas-wrapper .button--primary:focus, +#drupal-off-canvas-wrapper .button--primary:active { + color: var(--off-canvas-primary-button-text-color) !important; + background-color: var(--color-blue-royal) !important; +} + +#drupal-off-canvas-wrapper .button--danger:hover { + background-color: var(--gin-color-danger) !important; +} + +#drupal-off-canvas-wrapper a:not(.button) { + color: var(--menu-link-color) !important; +} + +.gin--dark-mode #drupal-off-canvas-wrapper a:not(.button) { + color: var(--color-blue-light) !important; +} + +/* +Moderation sidebar +*/ + +.moderation-sidebar-container .moderation-sidebar-revision-item { + border-bottom: 1px solid var(--color-text) !important; + margin: 1.5rem 0 !important; +} + +.moderation-sidebar-container .moderation-sidebar-revision-item:last-of-type { + border-bottom: 0 !important; +} + +.entity-moderation-form { + padding: 1rem; + margin: 1rem auto; +} + +.entity-moderation-form input[type="submit"] { + margin-bottom: 0; +} + +.moderation-sidebar-container .moderation-sidebar-revision-log { + border: 1px solid var(--color-text) !important; +} + +/* // Image crop vertical tabs override */ @@ -168,7 +220,7 @@ html.gin--dark-mode form.layout-builder-configure-block.glb-form { color: var(--gin-color-text) !important; } -/* In light mode, gin is displaying a mustard background with a black +/* In light mode, gin is displaying a mustard background with a black foreground. This causes contrast issues. */ #drupal-off-canvas-wrapper .ui-dialog-content diff --git a/css/ckeditor5.css b/css/ckeditor5.css index 79fae313d..9028c15fa 100644 --- a/css/ckeditor5.css +++ b/css/ckeditor5.css @@ -19,6 +19,11 @@ div[contenteditable="true"] #drupal-off-canvas [data-drupal-ck-style-fence] .ck- width: 100%; } +/* Removes the border style in code blocks within ckeditor */ + .ck-content pre code { + border: 0; + } + .glb-table .ck-content * { padding: 0; height: unset; diff --git a/package-lock.json b/package-lock.json index 35f79a3dd..2d9445a5a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2068,9 +2068,9 @@ "inBundle": true }, "node_modules/@yalesites-org/component-library-twig": { - "version": "1.42.1", - "resolved": "https://npm.pkg.github.com/download/@yalesites-org/component-library-twig/1.42.1/7b1ab4fdfb9e698fae18aa1a8092fb2ff7d2c1a8", - "integrity": "sha512-sbf4kI7AVFy5ihx4SJwtczcnoqQgnmbLR8896PmvxxNeReTTyY9/1SEn3UmXKPDXldK+SBGfVCcrsjQly1d/Dw==", + "version": "1.43.0", + "resolved": "https://npm.pkg.github.com/download/@yalesites-org/component-library-twig/1.43.0/d42f87e6deb926ea43fa9d66cc759300633d04db", + "integrity": "sha512-K0LdgmthqmShEerj+IP9mIvxkZGpRiINcZA24Ay2M3ou+CYx2ZCBZykSJjVVDe5sQ1WRdutHGweMDWCElnl25Q==", "hasInstallScript": true, "inBundle": true, "dependencies": { @@ -2081,6 +2081,7 @@ "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^4.6.0", "glob": "^7.2.0", + "highlight.js": "^11.9.0", "imagemin-webpack-plugin": "^2.4.2", "mini-css-extract-plugin": "^1.6.2", "node-sass-glob-importer": "^5.3.2", @@ -2091,6 +2092,15 @@ "webpack-merge": "^5.8.0" } }, + "node_modules/@yalesites-org/component-library-twig/node_modules/highlight.js": { + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz", + "integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==", + "inBundle": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/@yalesites-org/eslint-config-and-other-formatting": { "version": "1.5.4", "resolved": "https://npm.pkg.github.com/download/@yalesites-org/eslint-config-and-other-formatting/1.5.4/99238a7d6c8aa6998aed59412b9cc9ea522a7f7e", @@ -22720,9 +22730,9 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" }, "@yalesites-org/component-library-twig": { - "version": "1.42.1", - "resolved": "https://npm.pkg.github.com/download/@yalesites-org/component-library-twig/1.42.1/7b1ab4fdfb9e698fae18aa1a8092fb2ff7d2c1a8", - "integrity": "sha512-sbf4kI7AVFy5ihx4SJwtczcnoqQgnmbLR8896PmvxxNeReTTyY9/1SEn3UmXKPDXldK+SBGfVCcrsjQly1d/Dw==", + "version": "1.43.0", + "resolved": "https://npm.pkg.github.com/download/@yalesites-org/component-library-twig/1.43.0/d42f87e6deb926ea43fa9d66cc759300633d04db", + "integrity": "sha512-K0LdgmthqmShEerj+IP9mIvxkZGpRiINcZA24Ay2M3ou+CYx2ZCBZykSJjVVDe5sQ1WRdutHGweMDWCElnl25Q==", "requires": { "@storybook/storybook-deployer": "^2.8.11", "@yalesites-org/tokens": "^1.20.0", @@ -22731,6 +22741,7 @@ "clean-webpack-plugin": "^4.0.0", "copy-webpack-plugin": "^4.6.0", "glob": "^7.2.0", + "highlight.js": "^11.9.0", "imagemin-webpack-plugin": "^2.4.2", "mini-css-extract-plugin": "^1.6.2", "node-sass-glob-importer": "^5.3.2", @@ -22739,6 +22750,13 @@ "twig-drupal-filters": "^3.1.2", "webpack": "^4.46.0", "webpack-merge": "^5.8.0" + }, + "dependencies": { + "highlight.js": { + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz", + "integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==" + } } }, "@yalesites-org/eslint-config-and-other-formatting": { diff --git a/package.json b/package.json index 32982dec5..4758b789b 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "husky:pre-commit": "lint-staged", "prepare": "husky install", "prettier": "prettier ./ --ignore-unknown --list-different", - "semantic-release": "semantic-release", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { diff --git a/templates/block/layout-builder/block--inline-block--facts.html.twig b/templates/block/layout-builder/block--inline-block--facts.html.twig new file mode 100644 index 000000000..178b97779 --- /dev/null +++ b/templates/block/layout-builder/block--inline-block--facts.html.twig @@ -0,0 +1,25 @@ +{% extends "@atomic/block/layout-builder/_layout-builder-block-template.twig" %} + +{% block content %} + + {% set facts_and_figures__group__bg_image = content.field_media.0 ? 'true' : 'false' %} + + {% embed "@organisms/facts-and-figures-group/yds-facts-and-figures-group.twig" with { + facts_and_figures__group__heading: content.field_heading.0['#text'], + facts_and_figures__group__content: content.field_text.0['#text'], + facts_and_figures__group__alignment: content.field_style_alignment.0['#markup'], + facts_and_figures__group__grid_count: content.field_style_width.0['#markup'], + facts_and_figures__group__presentation_style: content.field_style_variation.0['#markup'], + facts_and_figured__group__width: 'site', + facts_and_figures__group__theme: content.field_style_color.0['#markup'], + }%} + {% block facts_and_figures__group__items %} + {{ content.field_facts_items }} + {% endblock %} + + {% block facts_and_figures__group__image %} + {{ content.field_media }} + {% endblock %} + {% endembed %} + +{% endblock %} diff --git a/templates/block/layout-builder/block--inline-block--link-grid.html.twig b/templates/block/layout-builder/block--inline-block--link-grid.html.twig new file mode 100644 index 000000000..aa60372e3 --- /dev/null +++ b/templates/block/layout-builder/block--inline-block--link-grid.html.twig @@ -0,0 +1,34 @@ +{% extends "@atomic/block/layout-builder/_layout-builder-block-template.twig" %} + +{% block content %} + {% if parentNode == 'post' or parentNode == 'event' %} + {% set link_grid__width = "content" %} + {% else %} + {% set link_grid__width = "site" %} + {% endif %} + + {# add checks for each link list #} + {% set link_grid__links_one = content.field_link_lists.0 %} + {% set link_grid__links_two = content.field_link_lists.1 %} + {% set link_grid__links_three = content.field_link_lists.2 %} + {% set link_grid__links_four = content.field_link_lists.3 %} + + {% embed "@molecules/link-grid/yds-link-grid.twig" with { + link_grid__theme: content.field_style_color.0['#markup'], + link_grid__heading: content.field_heading.0, + }%} + {% block link_grid__links_one %} + {{content.field_link_lists.0}} + {% endblock %} + {% block link_grid__links_two %} + {{content.field_link_lists.1}} + {% endblock %} + {% block link_grid__links_three %} + {{content.field_link_lists.2}} + {% endblock %} + {% block link_grid__links_four %} + {{content.field_link_lists.3}} + {% endblock %} + {% endembed %} + +{% endblock %} diff --git a/templates/block/layout-builder/block--inline-block--quote-callout.html.twig b/templates/block/layout-builder/block--inline-block--quote-callout.html.twig new file mode 100644 index 000000000..8ae01737d --- /dev/null +++ b/templates/block/layout-builder/block--inline-block--quote-callout.html.twig @@ -0,0 +1,24 @@ +{% extends "@atomic/block/layout-builder/_layout-builder-block-template.twig" %} + +{% block content %} + {{ attach_library('atomic/spotlights') }} + + {% if content.field_media.0 %} + {% set quote_callout__quote_image = 'with-image' %} + {% endif %} + + {% embed "@molecules/quote-callout/yds-quote-callout.twig" with { + quote_callout__quote: content.field_text, + quote_callout__attribution: content.field_caption.0, + quote_callout__style: content.field_style_variation.0['#markup'], + quote_callout__alignment: quote_callout__alignment, + quote_callout__quote_alignment: content.field_style_alignment.0['#markup'], + quote_callout__width: 'content', + quote_callout__accent_theme: content.field_style_color.0['#markup'], + } %} + + {% block quote_callout__image %} + {{ content.field_media }} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/templates/block/layout-builder/block--inline-block--text.html.twig b/templates/block/layout-builder/block--inline-block--text.html.twig index 46b2b0b6a..6e577040a 100644 --- a/templates/block/layout-builder/block--inline-block--text.html.twig +++ b/templates/block/layout-builder/block--inline-block--text.html.twig @@ -2,6 +2,8 @@ {% block content %} + {{ attach_library('atomic/text') }} + {% if parentNode == 'post' or parentNode == 'event' %} {% set text_field__width = "content" %} {% set text_field__alignment = "center" %} diff --git a/templates/block/layout-builder/block--inline-block--tiles.html.twig b/templates/block/layout-builder/block--inline-block--tiles.html.twig new file mode 100644 index 000000000..5123094b3 --- /dev/null +++ b/templates/block/layout-builder/block--inline-block--tiles.html.twig @@ -0,0 +1,13 @@ +{% extends "@atomic/block/layout-builder/_layout-builder-block-template.twig" %} + +{% block content %} + {% embed "@organisms/tiles/yds-tiles.twig" with { + tiles__alignment: content.field_style_alignment.0['#markup'], + tiles__grid_count: content.field_style_width.0['#markup'], + tiles__vertical_alignment: content.field_style_position.0['#markup'], + }%} + {% block tiles__items %} + {{ content.field_tiles }} + {% endblock %} + {% endembed %} +{% endblock %} diff --git a/templates/field/field--block-content--facts.html.twig b/templates/field/field--block-content--facts.html.twig new file mode 100644 index 000000000..18e9f3ea6 --- /dev/null +++ b/templates/field/field--block-content--facts.html.twig @@ -0,0 +1,3 @@ +{% for item in items %} + {{ item.content }} +{% endfor %} diff --git a/templates/field/field--block-content--field-facts-items.html.twig b/templates/field/field--block-content--field-facts-items.html.twig new file mode 100644 index 000000000..18e9f3ea6 --- /dev/null +++ b/templates/field/field--block-content--field-facts-items.html.twig @@ -0,0 +1,3 @@ +{% for item in items %} + {{ item.content }} +{% endfor %} diff --git a/templates/field/field--block-content--field-tiles.html.twig b/templates/field/field--block-content--field-tiles.html.twig new file mode 100644 index 000000000..18e9f3ea6 --- /dev/null +++ b/templates/field/field--block-content--field-tiles.html.twig @@ -0,0 +1,3 @@ +{% for item in items %} + {{ item.content }} +{% endfor %} diff --git a/templates/field/field--block-content--link-grid.html.twig b/templates/field/field--block-content--link-grid.html.twig new file mode 100644 index 000000000..18e9f3ea6 --- /dev/null +++ b/templates/field/field--block-content--link-grid.html.twig @@ -0,0 +1,3 @@ +{% for item in items %} + {{ item.content }} +{% endfor %} diff --git a/templates/field/field--block-content--quote-callout.html.twig b/templates/field/field--block-content--quote-callout.html.twig new file mode 100644 index 000000000..18e9f3ea6 --- /dev/null +++ b/templates/field/field--block-content--quote-callout.html.twig @@ -0,0 +1,3 @@ +{% for item in items %} + {{ item.content }} +{% endfor %} diff --git a/templates/field/field--paragraph--link-list.html.twig b/templates/field/field--paragraph--link-list.html.twig new file mode 100644 index 000000000..83aee455e --- /dev/null +++ b/templates/field/field--paragraph--link-list.html.twig @@ -0,0 +1,7 @@ +{% for item in items %} + {% include "@molecules/link-grid/_yds-link-grid--links.twig" with { + link_grid__link__content: item.content['#title'], + link_grid__link__url: item.content['#url_title'], + } + %} +{% endfor %} diff --git a/templates/field/field--paragraph--tile.html.twig b/templates/field/field--paragraph--tile.html.twig new file mode 100644 index 000000000..748c8ee8d --- /dev/null +++ b/templates/field/field--paragraph--tile.html.twig @@ -0,0 +1,3 @@ +{% for item in items %} + {{item.content}} +{% endfor %} diff --git a/templates/layout/region--header.html.twig b/templates/layout/region--header.html.twig index 888eb0dce..e58b65ce5 100644 --- a/templates/layout/region--header.html.twig +++ b/templates/layout/region--header.html.twig @@ -5,6 +5,13 @@ {% set site_header__site_name_is_image = getHeaderSetting('site_name_image') %} {% endif %} +{# set primary and utility nave variables equal to their drupal elements #} +{# this is necessary to pass the truthiness of the elements to the site-header organism #} +{# which will set {% set site_header__hamburger = 'yes' %} #} +{# and render the hamburger icon if the primary nav exists or the ulitity nav exists #} +{% set primary_nav__items = elements.main_navigation.content['#items'] %} +{% set utility_nav__items = elements.utility_navigation.content['#items'] %} + {% embed "@organisms/site-header/yds-site-header.twig" with { site_name: site_name, site_header__border_thickness: '8', diff --git a/templates/paragraphs/paragraph--facts-item.html.twig b/templates/paragraphs/paragraph--facts-item.html.twig new file mode 100644 index 000000000..b0ec51e7a --- /dev/null +++ b/templates/paragraphs/paragraph--facts-item.html.twig @@ -0,0 +1,12 @@ +{# Get values from parent to pass here #} +{% set parent = paragraph._referringItem.parent.parent.entity %} + +{% embed "@molecules/facts-and-figures/yds-facts-and-figures.twig" with { + facts_and_figures__stat: content.field_heading.0['#text'], + facts_and_figures__content: content.field_text.0, + facts_and_figures__alignment: parent.fields.field_style_alignment.0.value, + facts_and_figures__presentation_style: 'basic', + facts_and_figures__theme: 'none', + } +%} +{% endembed %} diff --git a/templates/paragraphs/paragraph--link-list.html.twig b/templates/paragraphs/paragraph--link-list.html.twig new file mode 100644 index 000000000..b92f65223 --- /dev/null +++ b/templates/paragraphs/paragraph--link-list.html.twig @@ -0,0 +1 @@ +{{content}} diff --git a/templates/paragraphs/paragraph--tile.html.twig b/templates/paragraphs/paragraph--tile.html.twig new file mode 100644 index 000000000..d200674f1 --- /dev/null +++ b/templates/paragraphs/paragraph--tile.html.twig @@ -0,0 +1,18 @@ +{# Get values from parent to pass here #} +{% set parent = paragraph._referringItem.parent.parent.entity %} +{% set tile__item__bg_image = content.field_media.0 ? 'true' : 'false' %} + +{% embed "@molecules/tile-item/yds-tile-item.twig" with { + tile__item__heading: content.field_heading.0['#text'], + tile__item__content: content.field_text.0, + tile__item__content_link: content.field_link.0['#url_title'], + tile__item__alignment: parent.fields.field_style_alignment.0.value, + tile__item__vertical_alignment: parent.fields.field_style_position.0.value, + tile__item__presentation_style: content.field_heading.0['#text'] ? 'heading' : 'text-only', + tile__item__theme: content.field_style_color.0['#markup'], + } +%} + {% block tile__item__image %} + {{ content.field_media }} + {% endblock %} +{% endembed %} diff --git a/templates/ys_embed/embed_wrapper.html.twig b/templates/ys_embed/embed_wrapper.html.twig index 733c10197..253d514ee 100644 --- a/templates/ys_embed/embed_wrapper.html.twig +++ b/templates/ys_embed/embed_wrapper.html.twig @@ -1,6 +1,7 @@ {% set embed_wrapper__embed_type = displayAttributes['embedType']|default('unknown') %} {% set embed_wrapper__width = displayAttributes['width']|default('site') %} {% set embed_wrapper__height = displayAttributes['height']|default('100%') %} +{% set embed_wrapper__allowfullscreen = displayAttributes['allowfullscreen'] == TRUE ? 'true' : 'false' %} {% if displayAttributes['isIframe'] %}