Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit 6b97246

Browse files
authored
Merge pull request #369 from material-components/release/0.6.0
Release 0.6.0
2 parents f011b04 + fdcd8c5 commit 6b97246

111 files changed

Lines changed: 9127 additions & 6494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Build plugin
2+
3+
on:
4+
push:
5+
# Don't run for irrelevant changes.
6+
paths-ignore:
7+
- '__mocks__/**'
8+
- '__static__/**'
9+
- 'bin/**'
10+
- 'packages/e2e-test-utils/**'
11+
- 'packages/e2e-tests/**'
12+
- 'packages/karma-*/**'
13+
- 'plugin/tests/**'
14+
- '**.md'
15+
- '**.yml'
16+
- '**.js.snap'
17+
- '**.neon.dist'
18+
- '**.xml.dist'
19+
- '.editorconfig'
20+
- '.eslint*'
21+
- '.prettier*'
22+
- '.stylelint*'
23+
- '.github/workflows/**'
24+
- '!.github/workflows/build-and-deploy.yml'
25+
branches:
26+
- develop
27+
- full-site-editing
28+
29+
jobs:
30+
build:
31+
name: Build and package artifacts
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 10
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
38+
- name: Setup Node
39+
uses: actions/setup-node@v2.5.1
40+
with:
41+
node-version-file: '.nvmrc'
42+
cache: npm
43+
44+
- name: Setup PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: '7.4'
48+
coverage: none
49+
tools: composer
50+
51+
- name: Install dependencies
52+
run: |
53+
npm ci
54+
env:
55+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
56+
57+
- name: Install PHP dependencies
58+
uses: 'ramsey/composer-install@v1'
59+
with:
60+
composer-options: '--prefer-dist --no-progress --no-interaction'
61+
62+
- name: Build plugin
63+
run: |
64+
npm run build
65+
mkdir -p build/plugin/ build/theme
66+
67+
- name: Bundle regular version
68+
run: |
69+
unzip material-design.zip -d "build/plugin/"
70+
unzip material-design-google.zip -d "build/theme/"
71+
72+
- name: Upload regular bundle
73+
uses: actions/upload-artifact@v2
74+
with:
75+
name: material-design
76+
path: build/
77+
78+
deploy-to-staging:
79+
name: Deploy to staging environment
80+
runs-on: ubuntu-latest
81+
timeout-minutes: 5
82+
needs: build
83+
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
84+
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v2
88+
- name: Download full bundle
89+
uses: actions/download-artifact@v2
90+
with:
91+
name: material-design
92+
path: build
93+
94+
- name: Setup SSH Keys and known_hosts
95+
uses: webfactory/ssh-agent@v0.5.4
96+
with:
97+
ssh-private-key: ${{ secrets.PANTHEON_DEPLOY_KEY }}
98+
99+
- name: Run deployment
100+
run: bash bin/deploy-to-staging.sh master
101+
102+
deploy-to-fse:
103+
name: Deploy to fse environment
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 5
106+
needs: build
107+
if: github.ref == 'refs/heads/full-site-editing' && github.event_name == 'push'
108+
109+
steps:
110+
- name: Checkout
111+
uses: actions/checkout@v2
112+
113+
- name: Download full bundle
114+
uses: actions/download-artifact@v2
115+
with:
116+
name: material-design
117+
path: build
118+
119+
- name: Setup SSH Keys and known_hosts
120+
uses: webfactory/ssh-agent@v0.5.4
121+
with:
122+
ssh-private-key: ${{ secrets.PANTHEON_DEPLOY_KEY }}
123+
124+
- name: Run deployment to fse
125+
run: bash bin/deploy-to-staging.sh fse
126+
127+
- name: Run deployment to traditional
128+
run: bash bin/deploy-to-staging.sh traditional

.wp-env.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"core": "WordPress/WordPress",
3+
"port": 8080,
4+
"mappings": {
5+
"wp-content/plugins/material-design": "./plugin",
6+
"wp-content/themes/material-design-google": "./theme"
7+
},
8+
"env": {
9+
"tests": {
10+
"port": 8081
11+
}
12+
}
13+
}

bin/deploy-to-staging.sh

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/bin/bash
2+
set -e
3+
4+
#
5+
# Copyright 2020 Google LLC
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# https://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
#
19+
20+
# Custom deployment script for Pantheon environment.
21+
# Adapted from https://github.com/google/web-stories-wp/blob/ca31b552fc9fce8b567bda4b0f59e15e1ddbc22c/bin/deploy-to-test-environment.sh
22+
23+
echo "Initializing deployment to Material design theme and plugin to test environment"
24+
25+
PANTHEON_SITE="mdc-web"
26+
PANTHEON_BRANCH=$1
27+
PANTHEON_UUID="395bf65b-d336-4308-9c86-311e8ddce422"
28+
29+
cd "$(dirname "$0")/.."
30+
project_dir="$(pwd)"
31+
repo_dir="$HOME/deployment-targets/$PANTHEON_SITE"
32+
33+
echo "Setting up SSH configuration"
34+
35+
# Dynamic hosts through Pantheon mean constantly checking interactively
36+
# that we mean to connect to an unknown host. We ignore those here.
37+
echo "StrictHostKeyChecking no" > ~/.ssh/config
38+
39+
if ! grep -q "codeserver.dev.$PANTHEON_UUID.drush.in" ~/.ssh/known_hosts; then
40+
ssh-keyscan -p 2222 codeserver.dev.$PANTHEON_UUID.drush.in >> ~/.ssh/known_hosts
41+
fi
42+
43+
if ! grep -q "codeserver.dev.$PANTHEON_UUID.drush.in" ~/.ssh/config; then
44+
echo "" >> ~/.ssh/config
45+
echo "Host $PANTHEON_SITE" >> ~/.ssh/config
46+
echo " Hostname codeserver.dev.$PANTHEON_UUID.drush.in" >> ~/.ssh/config
47+
echo " User codeserver.dev.$PANTHEON_UUID" >> ~/.ssh/config
48+
echo " Port 2222" >> ~/.ssh/config
49+
echo " KbdInteractiveAuthentication no" >> ~/.ssh/config
50+
fi
51+
52+
echo "Fetching remote repository"
53+
54+
git config --global user.name "Travis CI"
55+
git config --global user.email "travis-ci+$PANTHEON_SITE@example.org"
56+
57+
if [ ! -e "$repo_dir/.git" ]; then
58+
git clone -v ssh://codeserver.dev.$PANTHEON_UUID@codeserver.dev.$PANTHEON_UUID.drush.in:2222/~/repository.git --depth 1 --branch "$PANTHEON_BRANCH" --single-branch "$repo_dir"
59+
fi
60+
61+
cd "$repo_dir"
62+
63+
if git rev-parse --verify --quiet "origin/$PANTHEON_BRANCH" > /dev/null; then
64+
git reset --hard "origin/$PANTHEON_BRANCH"
65+
fi
66+
67+
cd "$project_dir"
68+
69+
echo "Moving files to repository"
70+
71+
rsync -avz --delete ./build/plugin/material-design/ "$repo_dir/wp-content/plugins/material-design/"
72+
rsync -avz --delete ./build/theme/material-design-google/ "$repo_dir/wp-content/themes/material-design-google/"
73+
git --no-pager log -1 --format="Build material theme and plugin at %h: %s" > /tmp/commit-message.txt
74+
75+
echo "Committing changes"
76+
77+
# Commit and deploy.
78+
cd "$repo_dir"
79+
git add -A "wp-content/plugins/material-design/" "wp-content/themes/material-design-google/"
80+
git commit -F /tmp/commit-message.txt
81+
82+
echo "Pushing new build to remote repository"
83+
git push origin $PANTHEON_BRANCH
84+
85+
if [ "$PANTHEON_BRANCH" == "master" ]; then
86+
PANTHEON_ENV="dev"
87+
else
88+
PANTHEON_ENV="$PANTHEON_BRANCH"
89+
fi
90+
91+
echo "Cleaning up project dir"
92+
rm -rf "$repo_dir"
93+
94+
echo "View site at http://$PANTHEON_ENV-$PANTHEON_SITE.pantheonsite.io/"
95+
echo "Access Pantheon dashboard at https://dashboard.pantheon.io/sites/$PANTHEON_UUID#$PANTHEON_BRANCH"

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"platform": {
1212
"php": "7.4.2",
1313
"ext-filter": "7.1"
14+
},
15+
"allow-plugins": {
16+
"xwp/wordpress-tests-installer": true,
17+
"dealerdirect/phpcodesniffer-composer-installer": true
1418
}
1519
},
1620
"require": {

contributing/engineering.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ git clone git@github.com:material-components/material-design-for-wordpress.git m
5555
cd material-design
5656
```
5757

58+
### Windows local enviorment
59+
Use WordPress's [wp-env](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/).
60+
61+
1. Install wp-env as mentioned above.
62+
2. Start with `wp-env start` (Assuming you have `wp-env` installed globally with updated PATH variable or use `npx wp-env start` to execute from repository's node_modules):
63+
3. Activate material plugin and theme.
64+
5865
Setup the development tools using [Node.js](https://nodejs.org) and [Composer](https://getcomposer.org):
5966

6067
```bash

plugin/assets/css/src/block-editor.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
@import "./base/variables.css";
2222
@import "./conf/index.css";
2323
@import "./components/masonry-grid.css";
24+
@import "./components/card.css";
2425
@import "./overrides.css";
2526
@import "./material-components.css";
2627

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Copyright 2022 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
18+
/*
19+
* Masonry Grid for query loop with card.
20+
*/
21+
.is-style-material-masonry.wp-block-post-template.is-flex-container {
22+
grid-gap: var(--mdc-layout-grid-margin-desktop, 24px);
23+
grid-template-columns: repeat(auto-fill, minmax(40%, 1fr));
24+
grid-auto-rows: var(--mdc-layout-grid-margin-desktop, 24px);
25+
margin: var(--mdc-layout-grid-margin-desktop, 24px) 0;
26+
padding: var(--mdc-layout-grid-margin-desktop, 24px);
27+
28+
@media (--medium-viewport) {
29+
display: grid;
30+
}
31+
32+
@nest .material-archive__wide & {
33+
grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
34+
}
35+
36+
&.columns-3 {
37+
grid-template-columns: repeat(auto-fill, minmax(30%, 1fr));
38+
}
39+
40+
&.columns-4 {
41+
grid-template-columns: repeat(auto-fill, minmax(20%, 1fr));
42+
}
43+
44+
&.columns-5 {
45+
grid-template-columns: repeat(auto-fill, minmax(16%, 1fr));
46+
}
47+
48+
&.columns-6 {
49+
grid-template-columns: repeat(auto-fill, minmax(14%, 1fr));
50+
}
51+
}
52+
53+
.is-style-material-masonry.wp-block-post-template.is-flex-container > li,
54+
.is-style-material-masonry.wp-block-query-loop.is-flex-container > li {
55+
width: 100% !important;
56+
}
57+
58+
.entry-content h2.post-card__title {
59+
margin: revert;
60+
}

0 commit comments

Comments
 (0)