Skip to content

Commit 4818727

Browse files
author
Zhicheng WANG
committed
Merge remote-tracking branch 'en/main'
2 parents d5871e2 + fedeef7 commit 4818727

File tree

28 files changed

+13519
-13986
lines changed

28 files changed

+13519
-13986
lines changed

.circleci/config.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ var_5: &yarn_install
3535
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
3636
var_6: &workspace_location ~/
3737

38-
orbs:
39-
build-tools: circleci/[email protected]
40-
4138
commands:
4239
store_build_output:
4340
description: 'Stores build artifacts'
@@ -52,26 +49,12 @@ commands:
5249
root: *workspace_location
5350
paths:
5451
- dist
55-
# Command for checking out the source code from GitHub. This also ensures that the source code
56-
# can be merged to the master branch without conflicts.
57-
checkout_and_rebase:
58-
description: Checkout and verify clean merge with master
59-
steps:
60-
- checkout
61-
- run:
62-
name: Set git user.name and user.email for rebase.
63-
# User is required for rebase.
64-
command: |
65-
git config user.name "angular-ci"
66-
git config user.email "angular-ci"
67-
- build-tools/merge-with-parent:
68-
parent: master
6952

7053
jobs:
7154
lint:
7255
<<: *job_defaults
7356
steps:
74-
- checkout_and_rebase
57+
- checkout
7558
- restore_cache:
7659
key: *cache_key
7760
- *yarn_install
@@ -85,7 +68,7 @@ jobs:
8568
# https://circleci.com/docs/2.0/configuration-reference/#resource_class
8669
resource_class: large
8770
steps:
88-
- checkout_and_rebase
71+
- checkout
8972
- restore_cache:
9073
key: *cache_key
9174
- *yarn_install
@@ -96,7 +79,7 @@ jobs:
9679
test:
9780
<<: *job_defaults
9881
steps:
99-
- checkout_and_rebase
82+
- checkout
10083
- restore_cache:
10184
key: *cache_key
10285
- *yarn_install
@@ -107,7 +90,7 @@ jobs:
10790
steps:
10891
- attach_workspace:
10992
at: *workspace_location
110-
- checkout_and_rebase
93+
- checkout
11194
- restore_cache:
11295
key: *cache_key
11396
- *yarn_install
@@ -118,7 +101,7 @@ jobs:
118101
steps:
119102
- attach_workspace:
120103
at: *workspace_location
121-
- checkout_and_rebase
104+
- checkout
122105
- restore_cache:
123106
key: *cache_key
124107
- *yarn_install

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ ui-debug.log
4747
.firebase/
4848
/typings
4949

50+
.firebaserc
51+
5052
#System Files
5153
.DS_Store
5254
Thumbs.db
5355

54-
/prebuilt
56+
/material-cn-prebuilt

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ issues with rendering or layout of the documentation pages, etc.
2828
The guides, examples, and docs content repo
2929
[angular/material2-docs-content](https://github.com/angular/material2-docs-content) contains the
3030
documentation content and examples. They are generated from:
31-
- [Angular Material and CDK Guides](https://github.com/angular/components/tree/master/guides)
32-
- [Material components, services, and directives](https://github.com/angular/components/tree/master/src/material)
33-
- [CDK components, services, and directives](https://github.com/angular/components/tree/master/src/cdk)
31+
- [Angular Material and CDK Guides](https://github.com/angular/components/tree/main/guides)
32+
- [Material components, services, and directives](https://github.com/angular/components/tree/main/src/material)
33+
- [CDK components, services, and directives](https://github.com/angular/components/tree/main/src/cdk)
3434

3535
## Development Setup
3636

angular.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
44
"newProjectRoot": "projects",
5-
"defaultProject": "material-angular-io",
65
"projects": {
76
"material-angular-io": {
87
"root": "",
@@ -328,10 +327,6 @@
328327
}
329328
},
330329
"cli": {
331-
"analytics": "cf155f04-1636-4df9-9ce2-870ba25ad38d",
332-
"defaultCollection": "@angular-eslint/schematics",
333-
"cache": {
334-
"enabled": false
335-
}
330+
"analytics": "cf155f04-1636-4df9-9ce2-870ba25ad38d"
336331
}
337332
}

firebase.json

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/firebase/firebase-tools/master/schema/firebase-config.json",
23
"hosting": {
4+
"target": "mat-aio",
35
"public": "dist/material-angular-io",
46
"cleanUrls": true,
57
"rewrites": [
68
{
7-
"source": "/**/!(*.@(js|ts|html|css|json|svg|png|jpg|jpeg))",
9+
"source": "**/!(*.*)",
810
"destination": "/index.html"
911
}
1012
],
1113
"headers": [
1214
{
13-
"source": "/assets/versions.json",
15+
"source": "**/!(*.*)",
1416
"headers": [
1517
{
16-
"key": "Access-Control-Allow-Origin",
17-
"value": "*"
18+
"key": "Cache-Control",
19+
// The `index.html` file (or when loaded as SPA), should never be cached. Older
20+
// JavaScript sources and assets would be loaded that might no longer be available.
21+
"value": "no-cache"
1822
}
1923
]
2024
},
@@ -49,25 +53,44 @@
4953
"headers": [
5054
{
5155
"key": "Cache-Control",
52-
"value": "public, max-age=15811200, s-maxage=31536000"
56+
// Images and SVGs are not hashed but are also expected to change rarely.
57+
// There are a lot of SVGs in our docs app, and we want to cache them longer.
58+
"value": "public, max-age=8640000" // 100 days.
59+
}
60+
]
61+
},
62+
{
63+
"source": "/assets/versions.json",
64+
"headers": [
65+
{
66+
"key": "Access-Control-Allow-Origin",
67+
"value": "*"
68+
},
69+
{
70+
"key": "Cache-Control",
71+
// The versions file should not be cached for too long since we are
72+
// deploying on a weekly basis and this file is rather small.
73+
"value": "public, max-age=604800" // 7 days.
5374
}
5475
]
5576
},
5677
{
57-
"source": "/*.svg",
78+
"source": "/assets/stack-blitz/**",
5879
"headers": [
5980
{
6081
"key": "Cache-Control",
61-
"value": "public, max-age=31536000"
82+
// StackBlitz assets are not hashed and should not be cached.
83+
"value": "no-cache"
6284
}
6385
]
6486
},
6587
{
66-
"source": "/*.@(webmanifest|ico)",
88+
"source": "/*.ico",
6789
"headers": [
6890
{
6991
"key": "Cache-Control",
70-
"value": "public, max-age=604800, s-maxage=1209600"
92+
// Icons and the favicon are expected to change rarely. We cache it, but not for too long.
93+
"value": "public, max-age=2592000" // 30 days.
7194
}
7295
]
7396
},
@@ -76,17 +99,13 @@
7699
"headers": [
77100
{
78101
"key": "Cache-Control",
79-
"value": "public, max-age=31536000"
102+
// JS ans CSS files are hashed and can be cached indefinitely.
103+
"value": "public, max-age=31536000" // 365 days.
80104
}
81105
]
82106
}
83107
],
84-
"ignore": [
85-
"firebase.json",
86-
"**/node_modules/**",
87-
"tmp",
88-
"deploy"
89-
]
108+
"ignore": ["firebase.json", "**/node_modules/**", "tmp", "deploy"]
90109
},
91110
"emulators": {
92111
"hosting": {

package.json

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,38 @@
3434
},
3535
"private": true,
3636
"dependencies": {
37-
"@angular/animations": "^13.1.0",
38-
"@angular/cdk": "^13.1.1",
39-
"@angular/cdk-experimental": "^13.1.1",
40-
"@angular/common": "^13.1.0",
41-
"@angular/compiler": "^13.1.0",
42-
"@angular/components-examples": "../components/dist/docs-content-pkg/",
43-
"@angular/core": "^13.1.0",
44-
"@angular/forms": "^13.1.0",
45-
"@angular/google-maps": "^13.1.1",
46-
"@angular/localize": "^13.1.0",
47-
"@angular/material": "^13.1.1",
48-
"@angular/material-experimental": "^13.1.1",
49-
"@angular/material-moment-adapter": "^13.1.1",
50-
"@angular/platform-browser": "^13.1.0",
51-
"@angular/platform-browser-dynamic": "^13.1.0",
52-
"@angular/router": "^13.1.0",
53-
"@angular/youtube-player": "^13.1.1",
37+
"@angular/animations": "^14.0.0",
38+
"@angular/cdk": "^14.0.0",
39+
"@angular/cdk-experimental": "^14.0.0",
40+
"@angular/common": "^14.0.0",
41+
"@angular/compiler": "^14.0.0",
42+
"@angular/components-examples": "https://github.com/angular/material2-docs-content.git#9bd54cb435a675b1880f4026a64eb9f1677e7087",
43+
"@angular/core": "^14.0.0",
44+
"@angular/forms": "^14.0.0",
45+
"@angular/google-maps": "^14.0.0",
46+
"@angular/localize": "^14.0.0",
47+
"@angular/material": "^14.0.0",
48+
"@angular/material-experimental": "^14.0.0",
49+
"@angular/material-moment-adapter": "^14.0.0",
50+
"@angular/platform-browser": "14.0.0",
51+
"@angular/platform-browser-dynamic": "14.0.0",
52+
"@angular/router": "14.0.0",
53+
"@angular/youtube-player": "^14.0.0",
5454
"@stackblitz/sdk": "^1.5.2",
55-
"material-components-web": "14.0.0-canary.7d8ea4624.0",
55+
"material-components-web": "14.0.0-canary.9736ddce9.0",
5656
"moment": "^2.29.1",
5757
"rxjs": "^6.6.7",
5858
"tslib": "^2.3.0",
59-
"zone.js": "~0.11.4"
59+
"zone.js": "~0.11.5"
6060
},
6161
"devDependencies": {
62-
"@angular-devkit/build-angular": "^13.1.0",
63-
"@angular-eslint/builder": "^13.0.1",
64-
"@angular-eslint/eslint-plugin": "^13.0.1",
65-
"@angular-eslint/eslint-plugin-template": "^13.0.1",
66-
"@angular-eslint/schematics": "^13.0.1",
67-
"@angular-eslint/template-parser": "^13.0.1",
68-
"@angular/cli": "^13.1.0",
69-
"@angular/compiler-cli": "^13.1.0",
62+
"@angular-devkit/build-angular": "^14.0.0",
63+
"@angular-eslint/builder": "^13.1.0",
64+
"@angular-eslint/eslint-plugin": "^13.1.0",
65+
"@angular-eslint/eslint-plugin-template": "^13.1.0",
66+
"@angular-eslint/template-parser": "^13.1.0",
67+
"@angular/cli": "^14.0.0",
68+
"@angular/compiler-cli": "^14.0.0",
7069
"@awesome-fe/prerender": "^0.0.8",
7170
"@awesome-fe/translate": "^1.1.3",
7271
"@types/imagemin": "^7.0.0",
@@ -80,7 +79,7 @@
8079
"eslint-plugin-import": "^2.22.1",
8180
"eslint-plugin-jsdoc": "^32.3.0",
8281
"eslint-plugin-prefer-arrow": "^1.2.3",
83-
"firebase-tools": "^9.21.0",
82+
"firebase-tools": "^11.0.1",
8483
"http-server-spa": "^1.3.0",
8584
"imagemin": "^7.0.1",
8685
"imagemin-pngquant": "^9.0.2",
@@ -100,6 +99,6 @@
10099
"puppeteer": "~8.0.0",
101100
"shelljs": "^0.8.4",
102101
"ts-node": "^8.10.2",
103-
"typescript": "~4.5.2"
102+
"typescript": "~4.7.2"
104103
}
105104
}

scenes/src/app/scenes/autocomplete/autocomplete-scene.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {NoopAnimationsModule} from '@angular/platform-browser/animations';
1919
templateUrl: './autocomplete-scene.html',
2020
})
2121
export class AutocompleteScene implements AfterViewInit {
22-
myControl = new FormControl();
22+
myControl = new FormControl('');
2323
options: string[] = ['hello', 'hello world'];
2424

2525
@ViewChild(MatInput) input!: MatInput;

scripts/ci/deploy-cn.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ npx nt mark './dist/**/*.html'
1212
commitSha=$(git rev-parse --short HEAD)
1313
commitMessage=$(git log --oneline -n 1)
1414

15-
if [[ ! -d "./prebuilt" ]]; then
16-
git clone [email protected]:ng-docs/prebuilt.git
15+
if [[ ! -d "./material-cn-prebuilt" ]]; then
16+
git clone [email protected]:ng-docs/[email protected]:ng-docs/material-cn-prebuilt.git
1717
fi
1818

19-
cp -r ./dist/material-angular-io/* ./prebuilt
19+
cp -r ./dist/material-angular-io/* ./material-cn-prebuilt
2020

21-
cd ./prebuilt
21+
cd ./material-cn-prebuilt
2222

2323
cp index.html 404.html
2424

src/app/pages/component-sidenav/component-sidenav.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import {
1616
import {FormsModule} from '@angular/forms';
1717
import {MatIconModule} from '@angular/material/icon';
1818
import {MatListModule} from '@angular/material/list';
19-
import {MatSidenav, MatSidenavModule} from '@angular/material/sidenav';
20-
import {MatDrawerToggleResult} from '@angular/material/sidenav/drawer';
19+
import {MatSidenav, MatSidenavModule, MatDrawerToggleResult} from '@angular/material/sidenav';
2120
import {ActivatedRoute, Params, RouterModule, Routes} from '@angular/router';
2221
import {combineLatest, Observable, Subscription} from 'rxjs';
2322
import {map} from 'rxjs/operators';

src/app/shared/doc-viewer/doc-viewer-module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {CodeSnippet} from '../example-viewer/code-snippet';
2626
StackBlitzButtonModule
2727
],
2828
declarations: [DocViewer, ExampleViewer, HeaderLink, CodeSnippet],
29-
entryComponents: [ExampleViewer, HeaderLink],
30-
exports: [DocViewer, ExampleViewer, HeaderLink],
29+
exports: [DocViewer, ExampleViewer, HeaderLink]
3130
})
3231
export class DocViewerModule { }

src/app/shared/documentation-items/documentation-items.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ export const DOCS: { [key: string]: DocItem[] } = {
524524
prefix: 'cdk-collections-',
525525
},
526526
},
527+
{
528+
id: 'dialog',
529+
name: 'Dialog',
530+
summary: 'Directives for building accessible dialogs.',
531+
exampleSpecs: {
532+
prefix: 'cdk-dialog-',
533+
},
534+
},
527535
{
528536
id: 'drag-drop',
529537
name: 'Drag and Drop',
@@ -544,6 +552,14 @@ export const DOCS: { [key: string]: DocItem[] } = {
544552
prefix: 'cdk-layout-',
545553
},
546554
},
555+
{
556+
id: 'menu',
557+
name: 'Menu',
558+
summary: 'Directives for building accessible menus.',
559+
exampleSpecs: {
560+
prefix: 'cdk-menu-',
561+
},
562+
},
547563
{
548564
id: 'observers',
549565
name: 'Observers',

src/app/shared/footer/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="docs-footer-copyright">
2222
<div>
2323
<span>Powered by Google LLC ©2010-2021.</span>
24-
<a href="https://github.com/angular/components/blob/master/LICENSE">Code licensed under an MIT-style License.</a>
24+
<a href="https://github.com/angular/components/blob/main/LICENSE">Code licensed under an MIT-style License.</a>
2525
<span>Documentation licensed under CC BY 4.0.</span>
2626
</div>
2727
</div>

src/app/shared/normalized-version.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {VERSION} from '@angular/material/core';
2+
3+
/**
4+
* Normalized Material version without its additional SHA information if present.
5+
*
6+
* Snapshot builds of Angular will include these as part of their ng-dev release
7+
* stamping. We only want to show the SHA details in the footer of the page.
8+
*
9+
* e.g. `14.0.0-next.3+38.sha-9d233f4` should become `14.0.0-next.3`
10+
*/
11+
export const normalizedMaterialVersion = VERSION.full.match(/(\d+\.\d+\.\d+(?:[^\+]*))/)![1];

0 commit comments

Comments
 (0)