Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream v8.2.11 #78

Merged
merged 14 commits into from
Apr 28, 2022
Merged
2 changes: 1 addition & 1 deletion MKDOCS_MATERIAL_MERGE_BASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
76529c239c94b15c050f1b0b7602a1f781120a78
b8c994404750eb5cc64953a4e4eca06b839189dc
1 change: 1 addition & 0 deletions merge_from_mkdocs_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"CHANGELOG",
"package-lock.json",
"*.md",
"giscus.json",
]

ap = argparse.ArgumentParser()
Expand Down
2,606 changes: 1,366 additions & 1,240 deletions package-lock.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"check:style": "run-p check:style:*",
"check:style:scss": "stylelint \"src/**/*.scss\"",
"check:style:ts": "eslint --cache \"src/**/*.ts\"",
"start": "ts-node -T tools/build --verbose --dirty --watch",
"start": "ts-node -T tools/build --verbose --all --dirty --watch",
"upgrade": "run-s upgrade:*",
"upgrade:bump": "ncu --upgrade --filterVersion \"/^\\^/\"",
"upgrade:install": "npm install"
Expand All @@ -49,57 +49,57 @@
"escape-html": "^1.0.3",
"focus-visible": "^5.2.0",
"resize-observer-polyfill": "^1.5.1",
"rxjs": "^7.5.4",
"rxjs": "^7.5.5",
"unfetch": "^4.2.0",
"url-polyfill": "^1.1.12"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^6.0.0",
"@mdi/svg": "^6.5.95",
"@primer/octicons": "^16.3.1",
"@fortawesome/fontawesome-free": "^6.1.1",
"@mdi/svg": "^6.6.96",
"@primer/octicons": "^17.0.0",
"@types/clipboard": "^2.0.7",
"@types/css-modules": "^1.0.2",
"@types/escape-html": "1.0.1",
"@types/escape-html": "^1.0.2",
"@types/html-minifier": "^4.0.2",
"@types/node": "^17.0.21",
"@types/node": "^17.0.25",
"@types/resize-observer-browser": "^0.1.7",
"@types/rimraf": "^3.0.2",
"@types/sass": "^1.43.1",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"autoprefixer": "^10.4.2",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"autoprefixer": "^10.4.5",
"chokidar": "^3.5.3",
"cssnano": "^5.0.17",
"esbuild": "^0.14.23",
"eslint": "^8.10.0",
"cssnano": "5.0.17",
"esbuild": "^0.14.38",
"eslint": "^8.14.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^37.9.4",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.2.8",
"eslint-plugin-no-null": "^1.0.2",
"github-types": "^1.0.0",
"gitlab": "^14.2.2",
"google-fonts-complete": "^2.1.1",
"html-minifier": "^4.0.0",
"material-design-color": "^2.3.2",
"material-shadows": "^3.0.1",
"npm-check-updates": "^12.4.0",
"npm-check-updates": "^12.5.9",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.7",
"postcss": "^8.4.12",
"postcss-dir-pseudo-class": "^6.0.4",
"postcss-inline-svg": "^5.0.0",
"postcss-logical": "^5.0.4",
"preact": "^10.6.6",
"preact": "^10.7.1",
"rimraf": "^3.0.2",
"sass": "^1.49.9",
"stylelint": "^14.5.3",
"sass": "^1.50.1",
"stylelint": "^14.7.1",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-recommended": "^7.0.0",
"stylelint-config-standard-scss": "^3.0.0",
"stylelint-scss": "^4.1.0",
"svgo": "2.3.1",
"stylelint-scss": "^4.2.0",
"svgo": "^2.8.0",
"tiny-glob": "^0.2.9",
"ts-node": "^10.5.0",
"typescript": "^4.5.5"
"ts-node": "^10.7.0",
"typescript": "^4.6.3"
},
"engines": {
"node": ">= 16"
Expand Down
2 changes: 1 addition & 1 deletion src/assets/javascripts/browser/element/visibility/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const observer$ = defer(() => of(
for (const entry of entries)
entry$.next(entry)
}, {
threshold: 1
threshold: 0
})
))
.pipe(
Expand Down
6 changes: 3 additions & 3 deletions src/assets/javascripts/browser/media/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
Observable,
fromEvent,
fromEventPattern,
mapTo,
map,
merge,
startWith,
switchMap
Expand Down Expand Up @@ -65,8 +65,8 @@ export function watchMedia(query: string): Observable<boolean> {
export function watchPrint(): Observable<boolean> {
const media = matchMedia("print")
return merge(
fromEvent(window, "beforeprint").pipe(mapTo(true)),
fromEvent(window, "afterprint").pipe(mapTo(false))
fromEvent(window, "beforeprint").pipe(map(() => true)),
fromEvent(window, "afterprint").pipe(map(() => false))
)
.pipe(
startWith(media.matches)
Expand Down
4 changes: 2 additions & 2 deletions src/assets/javascripts/browser/script/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
defer,
finalize,
fromEvent,
mapTo,
map,
merge,
switchMap,
take,
Expand Down Expand Up @@ -62,7 +62,7 @@ export function watchScript(src: string): Observable<void> {
)
)
.pipe(
mapTo(undefined),
map(() => undefined),
finalize(() => document.head.removeChild(script)),
take(1)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,15 @@ function findAnnotationMarkers(container: HTMLElement): Text[] {
const markers: Text[] = []
for (const comment of getElements(".c, .c1, .cm", container)) {
let match: RegExpExecArray | null
let text = comment.firstChild as Text

/* Split text at marker and add to list */
while ((match = /\((\d+)\)/.exec(text.textContent!))) {
const marker = text.splitText(match.index)
text = marker.splitText(match[0].length)
markers.push(marker)
}
let text = comment.firstChild as Text
if (text instanceof Text)
while ((match = /\((\d+)\)/.exec(text.textContent!))) {
const marker = text.splitText(match.index)
text = marker.splitText(match[0].length)
markers.push(marker)
}
}
return markers
}
Expand Down
15 changes: 8 additions & 7 deletions src/assets/javascripts/components/content/code/_/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,14 @@ export function mountCodeBlock(
tap(state => push$.next(state)),
finalize(() => push$.complete()),
map(state => ({ ref: el, ...state })),
mergeWith(watchElementSize(container)
.pipe(
takeUntil(push$.pipe(takeLast(1))),
map(({ width, height }) => width && height),
distinctUntilChanged(),
switchMap(active => active ? annotations$ : EMPTY)
)
mergeWith(
watchElementSize(container)
.pipe(
takeUntil(push$.pipe(takeLast(1))),
map(({ width, height }) => width && height),
distinctUntilChanged(),
switchMap(active => active ? annotations$ : EMPTY)
)
)
)
}
Expand Down
53 changes: 29 additions & 24 deletions src/assets/javascripts/components/content/code/mermaid/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ marker {
}

/* Flowchart markers */
#flowchart-circleStart,
#flowchart-circleEnd,
#flowchart-crossStart,
#flowchart-crossEnd,
#flowchart-pointStart,
#flowchart-pointEnd {
defs #flowchart-circleStart,
defs #flowchart-circleEnd,
defs #flowchart-crossStart,
defs #flowchart-crossEnd,
defs #flowchart-pointStart,
defs #flowchart-pointEnd {
stroke: none;
}

Expand Down Expand Up @@ -160,19 +160,19 @@ g.classGroup text {
}

/* Class extension, composition and dependency marker */
#extensionStart,
#extensionEnd,
#compositionStart,
#compositionEnd,
#dependencyStart,
#dependencyEnd {
defs #classDiagram-extensionStart,
defs #classDiagram-extensionEnd,
defs #classDiagram-compositionStart,
defs #classDiagram-compositionEnd,
defs #classDiagram-dependencyStart,
defs #classDiagram-dependencyEnd {
fill: var(--md-mermaid-edge-color) !important;
stroke: var(--md-mermaid-edge-color) !important;
}

/* Class aggregation marker */
#aggregationStart,
#aggregationEnd {
defs #classDiagram-aggregationStart,
defs #classDiagram-aggregationEnd {
fill: var(--md-mermaid-label-bg-color) !important;
stroke: var(--md-mermaid-edge-color) !important;
}
Expand Down Expand Up @@ -253,6 +253,11 @@ g.stateGroup .composit {
stroke: var(--md-default-fg-color--lighter);
}

/* State diagram markers */
defs #statediagram-barbEnd {
stroke: var(--md-mermaid-edge-color);
}

/* ----------------------------------------------------------------------------
* Rules: entity-relationship diagrams
* ------------------------------------------------------------------------- */
Expand Down Expand Up @@ -288,20 +293,20 @@ g.stateGroup .composit {
}

/* Entity relationship line markers */
#ZERO_OR_ONE_START *,
#ZERO_OR_ONE_END *,
#ZERO_OR_MORE_START *,
#ZERO_OR_MORE_END *,
#ONLY_ONE_START *,
#ONLY_ONE_END *,
#ONE_OR_MORE_START *,
#ONE_OR_MORE_END * {
defs #ZERO_OR_ONE_START *,
defs #ZERO_OR_ONE_END *,
defs #ZERO_OR_MORE_START *,
defs #ZERO_OR_MORE_END *,
defs #ONLY_ONE_START *,
defs #ONLY_ONE_END *,
defs #ONE_OR_MORE_START *,
defs #ONE_OR_MORE_END * {
stroke: var(--md-mermaid-edge-color) !important;
}

/* Entity relationship line markers */
#ZERO_OR_MORE_START circle,
#ZERO_OR_MORE_END circle {
defs #ZERO_OR_MORE_START circle,
defs #ZERO_OR_MORE_END circle {
fill: var(--md-mermaid-label-bg-color);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import {
Observable,
mapTo,
map,
of,
shareReplay,
tap
Expand Down Expand Up @@ -69,7 +69,7 @@ let index = 0
*/
function fetchScripts(): Observable<void> {
return typeof mermaid === "undefined" || mermaid instanceof Element
? watchScript("https://unpkg.com/mermaid@8.13.3/dist/mermaid.min.js")
? watchScript("https://unpkg.com/mermaid@9.0.1/dist/mermaid.min.js")
: of(undefined)
}

Expand All @@ -94,7 +94,7 @@ export function mountMermaid(
startOnLoad: false,
themeCSS
})),
mapTo(undefined),
map(() => undefined),
shareReplay(1)
)

Expand All @@ -117,6 +117,6 @@ export function mountMermaid(
/* Create and return component */
return mermaid$
.pipe(
mapTo({ ref: el })
map(() => ({ ref: el }))
)
}
5 changes: 3 additions & 2 deletions src/assets/javascripts/components/content/details/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
filter,
finalize,
map,
mapTo,
merge,
tap
} from "rxjs"
Expand Down Expand Up @@ -89,7 +88,9 @@ export function watchDetails(
.pipe(
map(target => target.closest("details:not([open])")!),
filter(details => el === details),
mapTo<Details>({ action: "open", reveal: true })
map(() => ({
action: "open", reveal: true
}) as Details)
),

/* Open details on print and close afterwards */
Expand Down
15 changes: 10 additions & 5 deletions src/assets/javascripts/components/content/tabs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ import {
Observable,
Subject,
animationFrameScheduler,
asyncScheduler,
auditTime,
combineLatest,
defer,
finalize,
fromEvent,
map,
mapTo,
merge,
startWith,
subscribeOn,
takeLast,
takeUntil,
tap
Expand Down Expand Up @@ -73,17 +74,18 @@ export interface ContentTabs {
export function watchContentTabs(
el: HTMLElement
): Observable<ContentTabs> {
const inputs = getElements(":scope > input", el)
const inputs = getElements<HTMLInputElement>(":scope > input", el)
const active = inputs.find(input => input.checked) || inputs[0]
return merge(...inputs.map(input => fromEvent(input, "change")
.pipe(
mapTo<ContentTabs>({
map(() => ({
active: getElement(`label[for=${input.id}]`)
})
}) as ContentTabs)
)
))
.pipe(
startWith({
active: getElement(`label[for=${inputs[0].id}]`)
active: getElement(`label[for=${active.id}]`)
} as ContentTabs)
)
}
Expand Down Expand Up @@ -144,4 +146,7 @@ export function mountContentTabs(
map(state => ({ ref: el, ...state }))
)
})
.pipe(
subscribeOn(asyncScheduler)
)
}
Loading