diff --git a/.lagoon.yml b/.lagoon.yml index 22179218c..ecaee933c 100644 --- a/.lagoon.yml +++ b/.lagoon.yml @@ -69,3 +69,16 @@ environments: schedule: '*/15 * * * *' command: drush cron service: cli + demo-zhinst: + routes: + - nginx: + - zhinst.cms.amazeelabs.dev + - build: + - zhinst.build.amazeelabs.dev + - preview: + - zhinst.preview.amazeelabs.dev + cronjobs: + - name: drush cron + schedule: '*/15 * * * *' + command: drush cron + service: cli diff --git a/apps/cms/.lagoon.env.demo-zhinst b/apps/cms/.lagoon.env.demo-zhinst new file mode 100644 index 000000000..e2eb34eb2 --- /dev/null +++ b/apps/cms/.lagoon.env.demo-zhinst @@ -0,0 +1,7 @@ +PROJECT_NAME=example +PUBLISHER_URL="https://zhinst.build.amazeelabs.dev" +NETLIFY_URL="https://zhinst.amazeelabs.dev" +PREVIEW_URL="https://zhinst.preview.amazeelabs.dev" + +# Used to set the original client secret. +PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME diff --git a/apps/cms/composer.json b/apps/cms/composer.json index bb6feeb43..1cff7be62 100644 --- a/apps/cms/composer.json +++ b/apps/cms/composer.json @@ -58,11 +58,13 @@ "drupal/entity_usage": "^2.0@beta", "drupal/environment_indicator": "^4.0.14", "drupal/field_group": "^3.4", + "drupal/highlight_php": "^1.0", "drupal/honeypot": "^2.1.2", "drupal/key_auth": "^2.1", "drupal/lagoon_logs": "^2.1.1", "drupal/linkit": "^6.0@beta", "drupal/masquerade": "^2.0@RC", + "drupal/mathjax": "^4.0", "drupal/menu_admin_per_menu": "^1.5", "drupal/metatag": "^2.0", "drupal/pathauto": "^1.11", diff --git a/apps/cms/composer.lock b/apps/cms/composer.lock index 6aa58607b..9ec90adff 100644 --- a/apps/cms/composer.lock +++ b/apps/cms/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2375207790855cc777235f699c7c2b9", + "content-hash": "b8008c19736458ea93a6705341df0fec", "packages": [ { "name": "amazeeio/drupal_integrations", @@ -3301,6 +3301,56 @@ "issues": "https://www.drupal.org/project/issues/gutenberg" } }, + { + "name": "drupal/highlight_php", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/highlight_php.git", + "reference": "1.0.1" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/highlight_php-1.0.1.zip", + "reference": "1.0.1", + "shasum": "3bb0c8f15bf39de9157e0a98981bd60b29e891f0" + }, + "require": { + "drupal/core": "^9 || ^10", + "scrivo/highlight.php": "^9.17" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "1.0.1", + "datestamp": "1694018897", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Sam Mortenson", + "homepage": "https://www.drupal.org/user/3547706", + "email": "samuel@mortenson.coffee" + }, + { + "name": "samuel.mortenson", + "homepage": "https://www.drupal.org/user/2582268" + } + ], + "description": "highlight.php filter integration.", + "homepage": "https://www.drupal.org/project/highlight_php", + "support": { + "source": "https://git.drupalcode.org/project/highlight_php" + } + }, { "name": "drupal/honeypot", "version": "2.1.3", @@ -3619,6 +3669,58 @@ "irc": "irc://irc.freenode.org/drupal-contribute" } }, + { + "name": "drupal/mathjax", + "version": "4.0.2", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/mathjax.git", + "reference": "4.0.2" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/mathjax-4.0.2.zip", + "reference": "4.0.2", + "shasum": "e92f2f50aa8149e55af8b1f744cad84cf680d91f" + }, + "require": { + "drupal/core": "^9.1 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "4.0.2", + "datestamp": "1673381514", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "cilefen", + "homepage": "https://www.drupal.org/user/1850070" + }, + { + "name": "joelpittet", + "homepage": "https://www.drupal.org/user/160302" + }, + { + "name": "julou", + "homepage": "https://www.drupal.org/user/273952" + } + ], + "description": "Javascript-based LaTeX rendering solution for your Drupal website.", + "homepage": "https://www.drupal.org/project/mathjax", + "support": { + "source": "https://git.drupalcode.org/project/mathjax" + } + }, { "name": "drupal/menu_admin_per_menu", "version": "1.5.0", @@ -7158,6 +7260,84 @@ }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "scrivo/highlight.php", + "version": "v9.18.1.10", + "source": { + "type": "git", + "url": "https://github.com/scrivo/highlight.php.git", + "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/850f4b44697a2552e892ffe71490ba2733c2fc6e", + "reference": "850f4b44697a2552e892ffe71490ba2733c2fc6e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.4" + }, + "require-dev": { + "phpunit/phpunit": "^4.8|^5.7", + "sabberworm/php-css-parser": "^8.3", + "symfony/finder": "^2.8|^3.4|^5.4", + "symfony/var-dumper": "^2.8|^3.4|^5.4" + }, + "suggest": { + "ext-mbstring": "Allows highlighting code with unicode characters and supports language with unicode keywords" + }, + "type": "library", + "autoload": { + "files": [ + "HighlightUtilities/functions.php" + ], + "psr-0": { + "Highlight\\": "", + "HighlightUtilities\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Geert Bergman", + "homepage": "http://www.scrivo.org/", + "role": "Project Author" + }, + { + "name": "Vladimir Jimenez", + "homepage": "https://allejo.io", + "role": "Maintainer" + }, + { + "name": "Martin Folkers", + "homepage": "https://twobrain.io", + "role": "Contributor" + } + ], + "description": "Server side syntax highlighter that supports 185 languages. It's a PHP port of highlight.js", + "keywords": [ + "code", + "highlight", + "highlight.js", + "highlight.php", + "syntax" + ], + "support": { + "issues": "https://github.com/scrivo/highlight.php/issues", + "source": "https://github.com/scrivo/highlight.php" + }, + "funding": [ + { + "url": "https://github.com/allejo", + "type": "github" + } + ], + "time": "2022-12-17T21:53:22+00:00" + }, { "name": "sebastian/diff", "version": "4.0.5", diff --git a/apps/cms/config/sync/core.base_field_override.node.blog.promote.yml b/apps/cms/config/sync/core.base_field_override.node.blog.promote.yml new file mode 100644 index 000000000..40609226d --- /dev/null +++ b/apps/cms/config/sync/core.base_field_override.node.blog.promote.yml @@ -0,0 +1,22 @@ +uuid: 788b4898-b392-4178-a030-afec42ece15d +langcode: en +status: true +dependencies: + config: + - node.type.blog +id: node.blog.promote +field_name: promote +entity_type: node +bundle: blog +label: 'Promoted to front page' +description: '' +required: false +translatable: true +default_value: + - + value: 0 +default_value_callback: '' +settings: + on_label: 'On' + off_label: 'Off' +field_type: boolean diff --git a/apps/cms/config/sync/core.entity_form_display.node.blog.default.yml b/apps/cms/config/sync/core.entity_form_display.node.blog.default.yml new file mode 100644 index 000000000..847429c5c --- /dev/null +++ b/apps/cms/config/sync/core.entity_form_display.node.blog.default.yml @@ -0,0 +1,127 @@ +uuid: 04c755ba-8a45-464c-8050-931066d30d22 +langcode: en +status: true +dependencies: + config: + - field.field.node.blog.body + - field.field.node.blog.field_blog_tags + - field.field.node.blog.field_metatags + - field.field.node.blog.field_teaser_image + - node.type.blog + module: + - content_moderation + - media_library + - metatag + - path + - text +id: node.blog.default +targetEntityType: node +bundle: blog +mode: default +content: + body: + type: text_textarea_with_summary + weight: 11 + region: content + settings: + rows: 9 + summary_rows: 3 + placeholder: '' + show_summary: false + third_party_settings: { } + created: + type: datetime_timestamp + weight: 3 + region: content + settings: { } + third_party_settings: { } + field_blog_tags: + type: options_buttons + weight: 13 + region: content + settings: { } + third_party_settings: { } + field_metatags: + type: metatag_firehose + weight: 14 + region: content + settings: + sidebar: true + use_details: true + third_party_settings: { } + field_teaser_image: + type: media_library_widget + weight: 12 + region: content + settings: + media_types: { } + third_party_settings: { } + langcode: + type: language_select + weight: 1 + region: content + settings: + include_locked: true + third_party_settings: { } + moderation_state: + type: moderation_state_default + weight: 9 + region: content + settings: { } + third_party_settings: { } + path: + type: path + weight: 7 + region: content + settings: { } + third_party_settings: { } + promote: + type: boolean_checkbox + weight: 5 + region: content + settings: + display_label: true + third_party_settings: { } + status: + type: boolean_checkbox + weight: 10 + region: content + settings: + display_label: true + third_party_settings: { } + sticky: + type: boolean_checkbox + weight: 6 + region: content + settings: + display_label: true + third_party_settings: { } + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + translation: + weight: 4 + region: content + settings: { } + third_party_settings: { } + uid: + type: entity_reference_autocomplete + weight: 2 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + url_redirects: + weight: 8 + region: content + settings: { } + third_party_settings: { } +hidden: { } diff --git a/apps/cms/config/sync/core.entity_form_display.node.page.default.yml b/apps/cms/config/sync/core.entity_form_display.node.page.default.yml index 7ec9ef2a3..ab107b92b 100644 --- a/apps/cms/config/sync/core.entity_form_display.node.page.default.yml +++ b/apps/cms/config/sync/core.entity_form_display.node.page.default.yml @@ -19,7 +19,7 @@ mode: default content: body: type: text_textarea_with_summary - weight: 121 + weight: 11 region: content settings: rows: 9 @@ -29,13 +29,13 @@ content: third_party_settings: { } created: type: datetime_timestamp - weight: 10 + weight: 3 region: content settings: { } third_party_settings: { } field_metatags: type: metatag_firehose - weight: 122 + weight: 13 region: content settings: sidebar: true @@ -43,60 +43,60 @@ content: third_party_settings: { } langcode: type: language_select - weight: 2 + weight: 1 region: content settings: include_locked: true third_party_settings: { } moderation_state: type: moderation_state_default - weight: 100 + weight: 9 region: content settings: { } third_party_settings: { } path: type: path - weight: 30 + weight: 7 region: content settings: { } third_party_settings: { } promote: type: boolean_checkbox - weight: 15 + weight: 5 region: content settings: display_label: true third_party_settings: { } status: type: boolean_checkbox - weight: 120 + weight: 10 region: content settings: display_label: true third_party_settings: { } sticky: type: boolean_checkbox - weight: 16 + weight: 6 region: content settings: display_label: true third_party_settings: { } title: type: string_textfield - weight: -5 + weight: 0 region: content settings: size: 60 placeholder: '' third_party_settings: { } translation: - weight: 10 + weight: 4 region: content settings: { } third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 5 + weight: 2 region: content settings: match_operator: CONTAINS @@ -105,7 +105,7 @@ content: placeholder: '' third_party_settings: { } url_redirects: - weight: 50 + weight: 8 region: content settings: { } third_party_settings: { } diff --git a/apps/cms/config/sync/core.entity_view_display.node.blog.default.yml b/apps/cms/config/sync/core.entity_view_display.node.blog.default.yml new file mode 100644 index 000000000..679d2442b --- /dev/null +++ b/apps/cms/config/sync/core.entity_view_display.node.blog.default.yml @@ -0,0 +1,47 @@ +uuid: 76d7ee89-96a3-4abe-8d5e-54adda6b8242 +langcode: en +status: true +dependencies: + config: + - field.field.node.blog.body + - field.field.node.blog.field_blog_tags + - field.field.node.blog.field_metatags + - field.field.node.blog.field_teaser_image + - node.type.blog + module: + - silverback_external_preview + - user +id: node.blog.default +targetEntityType: node +bundle: blog +mode: default +content: + external_preview_link: + type: external_preview_iframe_formatter + label: hidden + settings: + width: 100% + height: 900 + view_live_link: true + third_party_settings: { } + weight: 0 + region: content + field_teaser_image: + type: entity_reference_entity_view + label: above + settings: + view_mode: default + link: false + third_party_settings: { } + weight: 3 + region: content + links: + settings: { } + third_party_settings: { } + weight: 1 + region: content +hidden: + body: true + field_blog_tags: true + field_metatags: true + langcode: true diff --git a/apps/cms/config/sync/core.entity_view_display.node.blog.teaser.yml b/apps/cms/config/sync/core.entity_view_display.node.blog.teaser.yml new file mode 100644 index 000000000..f561dd0b2 --- /dev/null +++ b/apps/cms/config/sync/core.entity_view_display.node.blog.teaser.yml @@ -0,0 +1,48 @@ +uuid: 440355e0-b2da-4e44-bf70-781ce3a32de5 +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.blog.body + - field.field.node.blog.field_blog_tags + - field.field.node.blog.field_metatags + - field.field.node.blog.field_teaser_image + - node.type.blog + module: + - silverback_external_preview + - text + - user +id: node.blog.teaser +targetEntityType: node +bundle: blog +mode: teaser +content: + body: + type: text_summary_or_trimmed + label: hidden + settings: + trim_length: 600 + third_party_settings: { } + weight: 101 + region: content + external_preview_link: + type: external_preview_iframe_formatter + label: hidden + settings: + width: 100% + height: 900 + view_live_link: true + third_party_settings: { } + weight: -5 + region: content + links: + settings: { } + third_party_settings: { } + weight: 100 + region: content +hidden: + field_blog_tags: true + field_metatags: true + field_teaser_image: true + langcode: true diff --git a/apps/cms/config/sync/core.extension.yml b/apps/cms/config/sync/core.extension.yml index c32cf22ef..0945b254c 100644 --- a/apps/cms/config/sync/core.extension.yml +++ b/apps/cms/config/sync/core.extension.yml @@ -42,6 +42,7 @@ module: linkit: 0 locale: 0 masquerade: 0 + mathjax: 0 media: 0 media_library: 0 menu_link_content: 0 diff --git a/apps/cms/config/sync/field.field.node.blog.body.yml b/apps/cms/config/sync/field.field.node.blog.body.yml new file mode 100644 index 000000000..895592d1d --- /dev/null +++ b/apps/cms/config/sync/field.field.node.blog.body.yml @@ -0,0 +1,24 @@ +uuid: 96e2ccd4-0d2e-4c73-9c5d-ccfc2a9e4976 +langcode: en +status: true +dependencies: + config: + - field.storage.node.body + - node.type.blog + module: + - text +id: node.blog.body +field_name: body +entity_type: node +bundle: blog +label: Body +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: + display_summary: true + required_summary: false + allowed_formats: { } +field_type: text_with_summary diff --git a/apps/cms/config/sync/field.field.node.blog.field_blog_tags.yml b/apps/cms/config/sync/field.field.node.blog.field_blog_tags.yml new file mode 100644 index 000000000..2d3767919 --- /dev/null +++ b/apps/cms/config/sync/field.field.node.blog.field_blog_tags.yml @@ -0,0 +1,29 @@ +uuid: c6568e98-731e-4505-9cd8-4745f8738818 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_blog_tags + - node.type.blog + - taxonomy.vocabulary.blog_tags +id: node.blog.field_blog_tags +field_name: field_blog_tags +entity_type: node +bundle: blog +label: Tags +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:taxonomy_term' + handler_settings: + target_bundles: + blog_tags: blog_tags + sort: + field: name + direction: asc + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/apps/cms/config/sync/field.field.node.blog.field_metatags.yml b/apps/cms/config/sync/field.field.node.blog.field_metatags.yml new file mode 100644 index 000000000..ac73188e1 --- /dev/null +++ b/apps/cms/config/sync/field.field.node.blog.field_metatags.yml @@ -0,0 +1,21 @@ +uuid: ceb9d0ce-b1d7-4602-a99b-d70b42895816 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_metatags + - node.type.blog + module: + - metatag +id: node.blog.field_metatags +field_name: field_metatags +entity_type: node +bundle: blog +label: Metatags +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: metatag diff --git a/apps/cms/config/sync/field.field.node.blog.field_teaser_image.yml b/apps/cms/config/sync/field.field.node.blog.field_teaser_image.yml new file mode 100644 index 000000000..fd1f79c3c --- /dev/null +++ b/apps/cms/config/sync/field.field.node.blog.field_teaser_image.yml @@ -0,0 +1,29 @@ +uuid: e2cae156-a26f-4cb6-914f-88e351e37db8 +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_teaser_image + - media.type.image + - node.type.blog +id: node.blog.field_teaser_image +field_name: field_teaser_image +entity_type: node +bundle: blog +label: 'Teaser image' +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + image: image + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/apps/cms/config/sync/field.storage.node.field_blog_tags.yml b/apps/cms/config/sync/field.storage.node.field_blog_tags.yml new file mode 100644 index 000000000..19903ebe9 --- /dev/null +++ b/apps/cms/config/sync/field.storage.node.field_blog_tags.yml @@ -0,0 +1,20 @@ +uuid: 512dd294-b775-489a-b5ce-2b59c3bb1de5 +langcode: en +status: true +dependencies: + module: + - node + - taxonomy +id: node.field_blog_tags +field_name: field_blog_tags +entity_type: node +type: entity_reference +settings: + target_type: taxonomy_term +module: core +locked: false +cardinality: -1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/apps/cms/config/sync/field.storage.node.field_teaser_image.yml b/apps/cms/config/sync/field.storage.node.field_teaser_image.yml new file mode 100644 index 000000000..d9e4e4020 --- /dev/null +++ b/apps/cms/config/sync/field.storage.node.field_teaser_image.yml @@ -0,0 +1,20 @@ +uuid: 56710af2-f42a-4d50-a138-e95680d8ac4b +langcode: en +status: true +dependencies: + module: + - media + - node +id: node.field_teaser_image +field_name: field_teaser_image +entity_type: node +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/apps/cms/config/sync/gutenberg.settings.yml b/apps/cms/config/sync/gutenberg.settings.yml index ed9ef9d7d..047b36044 100644 --- a/apps/cms/config/sync/gutenberg.settings.yml +++ b/apps/cms/config/sync/gutenberg.settings.yml @@ -95,3 +95,100 @@ page_allowed_drupal_blocks: drupalblock/all_webform: 0 webform_block: 0 webform_submission_limit_block: 0 +blog_enable_full: 1 +blog_template: "[\r\n [\"custom/content-blog\", {}]\r\n]" +blog_template_lock: all +blog_allowed_blocks: + core/paragraph: core/paragraph + core/list: core/list + core/quote: core/quote + core/code: core/code + core/table: core/table + core/all: 0 + core/image: 0 + core/heading: 0 + core/gallery: 0 + core/audio: 0 + core/button: 0 + core/buttons: 0 + core/group: 0 + core/columns: 0 + core/column: 0 + core/cover: 0 + core/embed: 0 + core/file: 0 + core/freeform: 0 + core/html: 0 + core/media-text: 0 + core/preformatted: 0 + core/pullquote: 0 + core/separator: 0 + core/block: 0 + core/spacer: 0 + core/subhead: 0 + core/text-columns: 0 + core/verse: 0 + core/video: 0 + core-embed/all: 0 + core-embed/twitter: 0 + core-embed/youtube: 0 + core-embed/facebook: 0 + core-embed/instagram: 0 + core-embed/wordpress: 0 + core-embed/soundcloud: 0 + core-embed/spotify: 0 + core-embed/flickr: 0 + core-embed/vimeo: 0 + core-embed/amazon-kindle: 0 + core-embed/animoto: 0 + core-embed/cloudup: 0 + core-embed/collegehumor: 0 + core-embed/crowdsignal: 0 + core-embed/dailymotion: 0 + embed: 0 + core-embed/hulu: 0 + core-embed/imgur: 0 + core-embed/issuu: 0 + core-embed/kickstarter: 0 + core-embed/meetup-com: 0 + core-embed/mixcloud: 0 + core-embed/polldaddy: 0 + core-embed/reddit: 0 + core-embed/reverbnation: 0 + core-embed/screencast: 0 + core-embed/scribd: 0 + core-embed/slideshare: 0 + core-embed/smugmug: 0 + core-embed/speaker-deck: 0 + core-embed/speaker: 0 + core-embed/tiktok: 0 + core-embed/ted: 0 + core-embed/tumblr: 0 + core-embed/videopress: 0 + core-embed/wordpress-tv: 0 +blog_allowed_drupal_blocks: + drupalblock/all_config_pages: 0 + config_pages_block: 0 + drupalblock/all_core: 0 + page_title_block: 0 + drupalblock/all_forms: 0 + masquerade: 0 + user_login_block: 0 + drupalblock/all_lists_views_: 0 + 'views_block:content_recent-block_1': 0 + 'views_block:who_s_online-who_s_online_block': 0 + drupalblock/all_menus: 0 + 'system_menu_block:footer': 0 + 'system_menu_block:main': 0 + 'system_menu_block:account': 0 + drupalblock/all_system: 0 + system_breadcrumb_block: 0 + 'language_block:language_interface': 0 + system_messages_block: 0 + system_powered_by_block: 0 + system_branding_block: 0 + node_syndicate_block: 0 + drupalblock/all_user: 0 + drupalblock/all_webform: 0 + webform_block: 0 + webform_submission_limit_block: 0 diff --git a/apps/cms/config/sync/language.content_settings.node.blog.yml b/apps/cms/config/sync/language.content_settings.node.blog.yml new file mode 100644 index 000000000..fd82bd6cf --- /dev/null +++ b/apps/cms/config/sync/language.content_settings.node.blog.yml @@ -0,0 +1,16 @@ +uuid: d459f363-8f57-49ca-a141-e68eabcce715 +langcode: en +status: true +dependencies: + config: + - node.type.blog + module: + - content_translation +third_party_settings: + content_translation: + enabled: true +id: node.blog +target_entity_type_id: node +target_bundle: blog +default_langcode: site_default +language_alterable: true diff --git a/apps/cms/config/sync/language.content_settings.taxonomy_term.blog_tags.yml b/apps/cms/config/sync/language.content_settings.taxonomy_term.blog_tags.yml new file mode 100644 index 000000000..5e98fad2e --- /dev/null +++ b/apps/cms/config/sync/language.content_settings.taxonomy_term.blog_tags.yml @@ -0,0 +1,16 @@ +uuid: 7a0b7fdd-d913-4443-acc0-27a0b5534937 +langcode: en +status: true +dependencies: + config: + - taxonomy.vocabulary.blog_tags + module: + - content_translation +third_party_settings: + content_translation: + enabled: true +id: taxonomy_term.blog_tags +target_entity_type_id: taxonomy_term +target_bundle: blog_tags +default_langcode: site_default +language_alterable: true diff --git a/apps/cms/config/sync/mathjax.settings.yml b/apps/cms/config/sync/mathjax.settings.yml new file mode 100644 index 000000000..8f3e2c26f --- /dev/null +++ b/apps/cms/config/sync/mathjax.settings.yml @@ -0,0 +1,8 @@ +_core: + default_config_hash: UOFmZIwiZl6qJ50XXrC2r_F26ZTYR_3-d93LAnL8J4w +use_cdn: 1 +cdn_url: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML' +config_type: 1 +default_config_string: '{"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"processEscapes":"true"},"showProcessingMessages":"false","messageStyle":"none"}' +config_string: '{"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"processEscapes":"true"},"showProcessingMessages":"false","messageStyle":"none"}' +enable_for_admin: 1 diff --git a/apps/cms/config/sync/node.type.blog.yml b/apps/cms/config/sync/node.type.blog.yml new file mode 100644 index 000000000..2f2fa7d96 --- /dev/null +++ b/apps/cms/config/sync/node.type.blog.yml @@ -0,0 +1,17 @@ +uuid: b1839ba8-be8d-44d4-b356-8e9191652564 +langcode: en +status: true +dependencies: + module: + - menu_ui +third_party_settings: + menu_ui: + available_menus: { } + parent: '' +name: Blog +type: blog +description: '' +help: '' +new_revision: true +preview_mode: 1 +display_submitted: false diff --git a/apps/cms/config/sync/node.type.page.yml b/apps/cms/config/sync/node.type.page.yml index f40b23647..b3d357422 100644 --- a/apps/cms/config/sync/node.type.page.yml +++ b/apps/cms/config/sync/node.type.page.yml @@ -10,7 +10,7 @@ third_party_settings: - footer - main parent: 'main:' -name: 'Basic page' +name: Page type: page description: '' help: '' diff --git a/apps/cms/config/sync/taxonomy.vocabulary.blog_tags.yml b/apps/cms/config/sync/taxonomy.vocabulary.blog_tags.yml new file mode 100644 index 000000000..248dd0974 --- /dev/null +++ b/apps/cms/config/sync/taxonomy.vocabulary.blog_tags.yml @@ -0,0 +1,8 @@ +uuid: 4d9a4e65-f824-4622-8522-e29bf009f317 +langcode: en +status: true +dependencies: { } +name: 'Blog tags' +vid: blog_tags +description: '' +weight: 0 diff --git a/apps/cms/scaffold/settings.php.append.txt b/apps/cms/scaffold/settings.php.append.txt index 00575f853..e8c60b5a2 100644 --- a/apps/cms/scaffold/settings.php.append.txt +++ b/apps/cms/scaffold/settings.php.append.txt @@ -19,8 +19,8 @@ $config['graphql.graphql_servers.main']['schema_configuration']['directable']['b $settings['silverback_graphql_persisted_map'] = '../node_modules/@custom/schema/build/operations.json'; // Environment indicator. -$config['environment_indicator.indicator']['name'] = 'Local Silverback'; -$config['environment_indicator.indicator']['bg_color'] = '#42a877'; +$config['environment_indicator.indicator']['name'] = 'Gutenberg demo'; +$config['environment_indicator.indicator']['bg_color'] = '#009ee0'; $config['environment_indicator.indicator']['fg_color'] = '#ffffff'; if (getenv('LAGOON')) { diff --git a/apps/preview/.lagoon.env.demo-zhinst b/apps/preview/.lagoon.env.demo-zhinst new file mode 100644 index 000000000..b26e5d193 --- /dev/null +++ b/apps/preview/.lagoon.env.demo-zhinst @@ -0,0 +1 @@ +DRUPAL_URL="https://zhinst.cms.amazeelabs.dev" diff --git a/apps/website/.lagoon.env.demo-zhinst b/apps/website/.lagoon.env.demo-zhinst new file mode 100644 index 000000000..dc05ba1f7 --- /dev/null +++ b/apps/website/.lagoon.env.demo-zhinst @@ -0,0 +1,29 @@ +PROJECT_NAME=example +DRUPAL_INTERNAL_URL="http://nginx:8080" +DRUPAL_EXTERNAL_URL="https://zhinst.cms.amazeelabs.dev" +NETLIFY_URL="https://zhinst.amazeelabs.dev" +NETLIFY_SITE_ID="4ec8534f-e75c-47bb-8052-20a96842c1fe" + +# ----------------------------------------------- +# Publisher authentication with Drupal (OAuth2). +# See main ./README.md for more information. +# ----------------------------------------------- +# Set to true to fully skip authentication. +PUBLISHER_SKIP_AUTHENTICATION=false + +# Secret from the Drupal Publisher Consumer. +PUBLISHER_OAUTH2_CLIENT_SECRET=REPLACE_ME + +# Client id from the Drupal Publisher Consumer. +PUBLISHER_OAUTH2_CLIENT_ID=publisher + +# A random string, used to encrypt the session. +PUBLISHER_OAUTH2_SESSION_SECRET=REPLACE_ME + +# "development" or "production", production will trust first proxy +# and serve secure cookies. +PUBLISHER_OAUTH2_ENVIRONMENT_TYPE=production + +# DRUPAL_EXTERNAL_URL is used by default, but can be overridden +# to match the Drupal production url, without the nginx prefix. +PUBLISHER_OAUTH2_TOKEN_HOST="${DRUPAL_EXTERNAL_URL}" diff --git a/apps/website/src/templates/blog.tsx b/apps/website/src/templates/blog.tsx new file mode 100644 index 000000000..94f17f312 --- /dev/null +++ b/apps/website/src/templates/blog.tsx @@ -0,0 +1,53 @@ +import { graphql } from '@amazeelabs/gatsby-plugin-operations'; +import { OperationExecutor, useLocation, ViewPageQuery } from '@custom/schema'; +import { Blog } from '@custom/ui/routes/Blog'; +import { HeadProps, PageProps } from 'gatsby'; +import React from 'react'; + +export const query = graphql(ViewPageQuery); + +export function Head({ data }: HeadProps) { + return data.page ? ( + <> + {data.page.title} + {data.page.metaTags?.map((metaTag, index) => { + if (metaTag?.tag === 'meta') { + return ( + + ); + } else if (metaTag?.tag === 'link') { + return ( + + ); + } + return null; + }) || null} + + ) : null; +} + +export default function BlogTemplate({ data }: PageProps) { + // Retrieve the current location and prefill the + // "ViewPageQuery" with these arguments. + // That makes shure the `useOperation(ViewPageQuery, ...)` with this + // path immediately returns this data. + const [location] = useLocation(); + return ( + + + + ); +} diff --git a/packages/drupal/gutenberg_blocks/css/edit.css b/packages/drupal/gutenberg_blocks/css/edit.css index 39ab66473..f1fa3afcb 100644 --- a/packages/drupal/gutenberg_blocks/css/edit.css +++ b/packages/drupal/gutenberg_blocks/css/edit.css @@ -1,10 +1,16 @@ /* We can put any editor specific styling in here */ +/* We can put any editor specific styling in here */ .gutenberg__editor .editor-styles-wrapper { - font-family:inherit; + font-family: inherit; } .gutenberg__editor blockquote { - margin:0; + margin: 0; +} + +/* We do not want the preview button in the editor, we have the external preview feature. */ +.block-editor-post-preview__dropdown { + display: none; } .gutenberg__editor blockquote .quote-image img { @@ -18,13 +24,30 @@ content: ''; } +.components-toolbar-group button[aria-label='Align'] { + display: none; +} + +body a { + color: inherit; +} + +body a:hover, +body a:focus { + color: inherit; +} + .gutenberg__editor .container-wrapper { display: block; position: relative; margin: 40px 0; - border-left: 34px solid #666666; + border-left: 34px solid #373530; padding-left: 10px; - min-height: 250px; + min-height: 200px; +} + +.gutenberg__editor .container-wrapper.container-wrapper-long { + min-height: 300px; } .gutenberg__editor .container-wrapper .container-label { @@ -40,4 +63,83 @@ left: 0; transform-origin: 0 0; transform: rotate(90deg); -} \ No newline at end of file +} + +.gutenberg__editor .circle-wrapper { + height: 29px; + width: 29px; + float: right; + border-radius: 50%; + background-color: #fff; + margin-top: 10px; + margin-right: 10px; +} + +.gutenberg__editor .circle { + height: 25px; + width: 25px; + border-radius: 50%; + float: right; + margin-top: 2px; + margin-right: 2px; +} + +div[data-type='custom/remote-video'] iframe { + max-width: 100%; +} + +.components-panel .indent-0 { + margin-left: 0; +} + +.components-panel .indent-2 { + margin-left: 20px; +} + +.components-panel .indent-4 { + margin-left: 40px; +} + +.components-panel .components-base-control.components-checkbox-control { + margin-bottom: 0; +} + +.link-hidden span.block-editor-link-control__search-item-info { + display: none !important; +} + +.gutenberg__editor .edit-post-visual-editor__content-area hr { + border-color: #373530; +} + +@media (min-width: 1024px) { + .gutenberg__editor blockquote .lg\:text-3xl { + font-size: 2rem !important; + } +} + +.page-node-type-blog .gutenberg__editor .edit-post-visual-editor__content-area .lg\:prose-xl { + font-size: inherit; + line-height: inherit; +} + +/* +.gutenberg__editor .wp-block-custom-heading .block-editor-rich-text__editable { + color: #009ee0; +} +*/ + +.gutenberg__editor div[data-type="custom/image-with-caption"] .wp-block-paragraph { + color: #2e2e2e; + font-style: italic; +} + +.gutenberg__editor .two-columns { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 50px; +} + +.gutenberg__editor .button--primary { + background-color: #009ee0; +} diff --git a/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/AccordionItemTextValidator.php b/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/AccordionItemTextValidator.php new file mode 100644 index 000000000..4ab6b31ab --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/AccordionItemTextValidator.php @@ -0,0 +1,51 @@ + [ + 'field_label' => $this->t('Title'), + 'rules' => ['required'], + ], + ]; + } + + /** + * {@inheritDoc} + */ + public function validateContent($block = []): array { + $expectedChildren = [ + 'validationType' => GutenbergCardinalityValidatorInterface::CARDINALITY_ANY, + 'min' => 1, + 'max' => GutenbergCardinalityValidatorInterface::CARDINALITY_UNLIMITED, + ]; + return $this->validateCardinality($block, $expectedChildren); + } + +} diff --git a/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/AccordionValidator.php b/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/AccordionValidator.php new file mode 100644 index 000000000..d0bae38b0 --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/Plugin/Validation/GutenbergValidator/AccordionValidator.php @@ -0,0 +1,42 @@ + 'custom/accordion-item-text', + 'blockLabel' => $this->t('Accordion'), + 'min' => 1, + 'max' => GutenbergCardinalityValidatorInterface::CARDINALITY_UNLIMITED, + ], + ]; + return $this->validateCardinality($block, $expectedChildren); + } + +} diff --git a/packages/drupal/gutenberg_blocks/src/blocks/accordion-item-text.tsx b/packages/drupal/gutenberg_blocks/src/blocks/accordion-item-text.tsx new file mode 100644 index 000000000..dd50cd99e --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/blocks/accordion-item-text.tsx @@ -0,0 +1,85 @@ +import React, { Fragment } from 'react'; +import { + InnerBlocks, + InspectorControls, + RichText, +} from 'wordpress__block-editor'; +import { registerBlockType } from 'wordpress__blocks'; +import { PanelBody, SelectControl } from 'wordpress__components'; +import { compose, withState } from 'wordpress__compose'; + +// @ts-ignore +const { t: __ } = Drupal; +// @ts-ignore +registerBlockType('custom/accordion-item-text', { + title: 'Accordion Item Text', + icon: 'text', + category: 'layout', + parent: ['custom/accordion'], + attributes: { + title: { + type: 'string', + }, + icon: { + type: 'string', + }, + }, + // @ts-ignore + edit: compose(withState())((props) => { + const { attributes, setAttributes } = props; + const icons = [ + { label: __('- Select an optional icon -'), value: '' }, + { label: __('Checkmark'), value: 'checkmark' }, + { label: __('Questionmark'), value: 'questionmark' }, + { label: __('Arrow'), value: 'arrow' }, + ]; + setAttributes({ + icon: attributes.icon === undefined ? '' : attributes.icon, + }); + + return ( + + + + { + setAttributes({ + icon: newValue, + }); + }} + /> + + +
+
{__('Accordion Item Text')}
+
+ { + setAttributes({ title: newValue }); + }} + /> + +
+
+
+ ); + }), + + save: () => { + return ; + }, +}); diff --git a/packages/drupal/gutenberg_blocks/src/blocks/accordion.tsx b/packages/drupal/gutenberg_blocks/src/blocks/accordion.tsx new file mode 100644 index 000000000..924746dd8 --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/blocks/accordion.tsx @@ -0,0 +1,25 @@ +import { InnerBlocks } from 'wordpress__block-editor'; +import { registerBlockType } from 'wordpress__blocks'; + +// @ts-ignore +const { t: __ } = Drupal; + +registerBlockType('custom/accordion', { + title: __('Accordion'), + icon: 'menu', + category: 'layout', + attributes: {}, + edit: () => { + return ( +
+
{__('Accordion')}
+ +
+ ); + }, + save: () => , +}); diff --git a/packages/drupal/gutenberg_blocks/src/blocks/content-blog.tsx b/packages/drupal/gutenberg_blocks/src/blocks/content-blog.tsx new file mode 100644 index 000000000..4b7e2bf96 --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/blocks/content-blog.tsx @@ -0,0 +1,48 @@ +import { InnerBlocks } from 'wordpress__block-editor'; +import { registerBlockType } from 'wordpress__blocks'; + +// @ts-ignore +const { t: __ } = Drupal; + +const style = { + minHeight: '40px', + margin: '0 -40px', + padding: '0 40px', +}; + +registerBlockType(`custom/content-blog`, { + title: __('Content'), + category: 'layout', + icon: 'media-document', + attributes: {}, + supports: { + inserter: false, + align: true, + html: false, + }, + edit() { + return ( +
+ +
+ ); + }, + + save() { + return ; + }, +}); diff --git a/packages/drupal/gutenberg_blocks/src/blocks/content.tsx b/packages/drupal/gutenberg_blocks/src/blocks/content.tsx index 1aff9b0ac..c6f11cd67 100644 --- a/packages/drupal/gutenberg_blocks/src/blocks/content.tsx +++ b/packages/drupal/gutenberg_blocks/src/blocks/content.tsx @@ -23,7 +23,25 @@ registerBlockType(`custom/content`, { edit() { return (
- +
); }, diff --git a/packages/drupal/gutenberg_blocks/src/blocks/cta.tsx b/packages/drupal/gutenberg_blocks/src/blocks/cta.tsx index 83bfd63de..d66fba3e2 100644 --- a/packages/drupal/gutenberg_blocks/src/blocks/cta.tsx +++ b/packages/drupal/gutenberg_blocks/src/blocks/cta.tsx @@ -34,6 +34,9 @@ registerBlockType('custom/cta', { 'data-entity-type': { type: 'string', }, + primary: { + type: 'boolean', + }, openInNewTab: { type: 'boolean', }, @@ -48,11 +51,14 @@ registerBlockType('custom/cta', { }, // @ts-ignore edit: compose(withState({}))((props) => { + const buttonType = props.attributes.primary + ? 'button--primary' + : 'button--secondary'; return (
+ { + props.setAttributes({ + primary, + }); + }} + /> { + return ( + <> + + + { + props.setAttributes({ + useModal, + }); + }} + /> + + +
+
{__('Image with Caption')}
+ { + // @ts-ignore + error = typeof error === 'string' ? error : error[2]; + dispatch('core/notices').createWarningNotice(error); + }} + /> +

{__('Caption')}

+ +
+ + ); + }, + save: () => , +}); diff --git a/packages/drupal/gutenberg_blocks/src/blocks/image-with-link.tsx b/packages/drupal/gutenberg_blocks/src/blocks/image-with-link.tsx new file mode 100644 index 000000000..9813828f4 --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/blocks/image-with-link.tsx @@ -0,0 +1,71 @@ +import { + // @ts-ignore + __experimentalLinkControl as LinkControl, + InnerBlocks, + InspectorControls, +} from 'wordpress__block-editor'; +import { registerBlockType } from 'wordpress__blocks'; +import { PanelBody } from 'wordpress__components'; +import { dispatch } from 'wordpress__data'; + +import { DrupalMediaEntity } from '../utils/drupal-media'; + +// @ts-ignore +const { t: __ } = Drupal; + +registerBlockType('custom/image-with-link', { + title: __('Image with Link'), + icon: 'cover-image', + category: 'layout', + attributes: { + mediaEntityIds: { + type: 'array', + }, + link: { + type: 'string', + }, + uuid: { + type: 'string', + }, + }, + edit: (props) => { + return ( + <> + + + { + props.setAttributes({ + link: link.url, + uuid: link.id, + }); + }} + /> + + +
+
{__('Image with Link')}
+ { + // @ts-ignore + error = typeof error === 'string' ? error : error[2]; + dispatch('core/notices').createWarningNotice(error); + }} + /> +
+ + ); + }, + save: () => , +}); diff --git a/packages/drupal/gutenberg_blocks/src/blocks/image.tsx b/packages/drupal/gutenberg_blocks/src/blocks/image.tsx new file mode 100644 index 000000000..1ff5e8999 --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/blocks/image.tsx @@ -0,0 +1,42 @@ +import { InnerBlocks } from 'wordpress__block-editor'; +import { registerBlockType } from 'wordpress__blocks'; +import { dispatch } from 'wordpress__data'; + +import { DrupalMediaEntity } from '../utils/drupal-media'; + +// @ts-ignore +const { t: __ } = Drupal; + +registerBlockType('custom/image', { + title: __('Image'), + icon: 'cover-image', + category: 'layout', + attributes: { + mediaEntityIds: { + type: 'array', + }, + }, + edit: (props) => { + return ( + <> + { + // @ts-ignore + error = typeof error === 'string' ? error : error[2]; + dispatch('core/notices').createWarningNotice(error); + }} + /> + + ); + }, + save: () => , +}); diff --git a/packages/drupal/gutenberg_blocks/src/blocks/mathjax.tsx b/packages/drupal/gutenberg_blocks/src/blocks/mathjax.tsx new file mode 100644 index 000000000..964f1b2eb --- /dev/null +++ b/packages/drupal/gutenberg_blocks/src/blocks/mathjax.tsx @@ -0,0 +1,55 @@ +import { registerBlockType } from 'wordpress__blocks'; +import { compose, withState } from 'wordpress__compose'; + +// @ts-ignore +const { t: __ } = Drupal; + +registerBlockType(`custom/mathjax`, { + title: __('MathJax'), + category: 'layout', + icon: 'media-document', + attributes: { + formula: { + source: 'html', + selector: 'div', + type: 'string', + }, + }, + // @ts-ignore + edit: compose(withState({}))((props) => { + const { isSelected, attributes, setAttributes, className } = props; + const { formula } = attributes; + const id = `mathjax-${Math.random().toString(36).substr(2, 9)}`; + + if (isSelected) { + return ( +
+ +