mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Replaced deprecated RxJS operators
This commit is contained in:
29
material/assets/javascripts/bundle.52fb055a.min.js
vendored
Normal file
29
material/assets/javascripts/bundle.52fb055a.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
material/assets/javascripts/bundle.52fb055a.min.js.map
Normal file
8
material/assets/javascripts/bundle.52fb055a.min.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -214,7 +214,7 @@
|
|||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
<script src="{{ 'assets/javascripts/bundle.ce0c0ed4.min.js' | url }}"></script>
|
<script src="{{ 'assets/javascripts/bundle.52fb055a.min.js' | url }}"></script>
|
||||||
{% for path in config["extra_javascript"] %}
|
{% for path in config["extra_javascript"] %}
|
||||||
<script src="{{ path | url }}"></script>
|
<script src="{{ path | url }}"></script>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
Observable,
|
Observable,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
fromEventPattern,
|
fromEventPattern,
|
||||||
mapTo,
|
map,
|
||||||
merge,
|
merge,
|
||||||
startWith,
|
startWith,
|
||||||
switchMap
|
switchMap
|
||||||
@@ -65,8 +65,8 @@ export function watchMedia(query: string): Observable<boolean> {
|
|||||||
export function watchPrint(): Observable<boolean> {
|
export function watchPrint(): Observable<boolean> {
|
||||||
const media = matchMedia("print")
|
const media = matchMedia("print")
|
||||||
return merge(
|
return merge(
|
||||||
fromEvent(window, "beforeprint").pipe(mapTo(true)),
|
fromEvent(window, "beforeprint").pipe(map(() => true)),
|
||||||
fromEvent(window, "afterprint").pipe(mapTo(false))
|
fromEvent(window, "afterprint").pipe(map(() => false))
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
startWith(media.matches)
|
startWith(media.matches)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
defer,
|
defer,
|
||||||
finalize,
|
finalize,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
mapTo,
|
map,
|
||||||
merge,
|
merge,
|
||||||
switchMap,
|
switchMap,
|
||||||
take,
|
take,
|
||||||
@@ -62,7 +62,7 @@ export function watchScript(src: string): Observable<void> {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo(undefined),
|
map(() => undefined),
|
||||||
finalize(() => document.head.removeChild(script)),
|
finalize(() => document.head.removeChild(script)),
|
||||||
take(1)
|
take(1)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
fromEvent,
|
fromEvent,
|
||||||
map,
|
map,
|
||||||
share,
|
share,
|
||||||
switchMapTo,
|
switchMap,
|
||||||
tap,
|
tap,
|
||||||
throttle
|
throttle
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
@@ -100,7 +100,7 @@ export function watchWorker<T extends WorkerMessage>(
|
|||||||
.pipe(
|
.pipe(
|
||||||
throttle(() => rx$, { leading: true, trailing: true }),
|
throttle(() => rx$, { leading: true, trailing: true }),
|
||||||
tap(message => worker.postMessage(message)),
|
tap(message => worker.postMessage(message)),
|
||||||
switchMapTo(rx$),
|
switchMap(() => rx$),
|
||||||
share()
|
share()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
mapTo,
|
map,
|
||||||
of,
|
of,
|
||||||
shareReplay,
|
shareReplay,
|
||||||
tap
|
tap
|
||||||
@@ -94,7 +94,7 @@ export function mountMermaid(
|
|||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
themeCSS
|
themeCSS
|
||||||
})),
|
})),
|
||||||
mapTo(undefined),
|
map(() => undefined),
|
||||||
shareReplay(1)
|
shareReplay(1)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -117,6 +117,6 @@ export function mountMermaid(
|
|||||||
/* Create and return component */
|
/* Create and return component */
|
||||||
return mermaid$
|
return mermaid$
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo({ ref: el })
|
map(() => ({ ref: el }))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import {
|
|||||||
filter,
|
filter,
|
||||||
finalize,
|
finalize,
|
||||||
map,
|
map,
|
||||||
mapTo,
|
|
||||||
merge,
|
merge,
|
||||||
tap
|
tap
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
@@ -89,7 +88,9 @@ export function watchDetails(
|
|||||||
.pipe(
|
.pipe(
|
||||||
map(target => target.closest("details:not([open])")!),
|
map(target => target.closest("details:not([open])")!),
|
||||||
filter(details => el === details),
|
filter(details => el === details),
|
||||||
mapTo<Details>({ action: "open", reveal: true })
|
map(() => ({
|
||||||
|
action: "open", reveal: true
|
||||||
|
}) as Details)
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Open details on print and close afterwards */
|
/* Open details on print and close afterwards */
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import {
|
|||||||
finalize,
|
finalize,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
map,
|
map,
|
||||||
mapTo,
|
|
||||||
merge,
|
merge,
|
||||||
startWith,
|
startWith,
|
||||||
subscribeOn,
|
subscribeOn,
|
||||||
@@ -79,9 +78,9 @@ export function watchContentTabs(
|
|||||||
const active = inputs.find(input => input.checked) || inputs[0]
|
const active = inputs.find(input => input.checked) || inputs[0]
|
||||||
return merge(...inputs.map(input => fromEvent(input, "change")
|
return merge(...inputs.map(input => fromEvent(input, "change")
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo<ContentTabs>({
|
map(() => ({
|
||||||
active: getElement(`label[for=${input.id}]`)
|
active: getElement(`label[for=${input.id}]`)
|
||||||
})
|
}) as ContentTabs)
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
.pipe(
|
.pipe(
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import {
|
|||||||
finalize,
|
finalize,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
map,
|
map,
|
||||||
mapTo,
|
|
||||||
mergeMap,
|
mergeMap,
|
||||||
observeOn,
|
observeOn,
|
||||||
of,
|
of,
|
||||||
@@ -87,7 +86,7 @@ export function watchPalette(
|
|||||||
.pipe(
|
.pipe(
|
||||||
mergeMap(input => fromEvent(input, "change")
|
mergeMap(input => fromEvent(input, "change")
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo(input)
|
map(() => input)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
startWith(inputs[Math.max(0, current.index)]),
|
startWith(inputs[Math.max(0, current.index)]),
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import ClipboardJS from "clipboard"
|
|||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
Subject,
|
Subject,
|
||||||
mapTo,
|
map,
|
||||||
tap
|
tap
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ export function setupClipboardJS(
|
|||||||
const trigger = ev.trigger as HTMLElement
|
const trigger = ev.trigger as HTMLElement
|
||||||
trigger.focus()
|
trigger.focus()
|
||||||
}),
|
}),
|
||||||
mapTo(translation("clipboard.copied"))
|
map(() => translation("clipboard.copied"))
|
||||||
)
|
)
|
||||||
.subscribe(alert$)
|
.subscribe(alert$)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,7 @@ import {
|
|||||||
fromEvent,
|
fromEvent,
|
||||||
map,
|
map,
|
||||||
of,
|
of,
|
||||||
switchMap,
|
switchMap
|
||||||
switchMapTo
|
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
|
|
||||||
import { configuration } from "~/_"
|
import { configuration } from "~/_"
|
||||||
@@ -135,7 +134,7 @@ export function setupVersionSelector(
|
|||||||
})
|
})
|
||||||
|
|
||||||
/* Integrate outdated version banner with instant loading */
|
/* Integrate outdated version banner with instant loading */
|
||||||
document$.pipe(switchMapTo(current$))
|
document$.pipe(switchMap(() => current$))
|
||||||
.subscribe(current => {
|
.subscribe(current => {
|
||||||
|
|
||||||
/* Check if version state was already determined */
|
/* Check if version state was already determined */
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
mapTo,
|
map,
|
||||||
mergeMap,
|
mergeMap,
|
||||||
switchMap,
|
switchMap,
|
||||||
takeWhile,
|
takeWhile,
|
||||||
@@ -72,7 +72,7 @@ export function patchIndeterminate(
|
|||||||
mergeMap(el => fromEvent(el, "change")
|
mergeMap(el => fromEvent(el, "change")
|
||||||
.pipe(
|
.pipe(
|
||||||
takeWhile(() => el.hasAttribute("data-md-state")),
|
takeWhile(() => el.hasAttribute("data-md-state")),
|
||||||
mapTo(el)
|
map(() => el)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
withLatestFrom(tablet$)
|
withLatestFrom(tablet$)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
Observable,
|
Observable,
|
||||||
filter,
|
filter,
|
||||||
fromEvent,
|
fromEvent,
|
||||||
mapTo,
|
map,
|
||||||
mergeMap,
|
mergeMap,
|
||||||
switchMap,
|
switchMap,
|
||||||
tap
|
tap
|
||||||
@@ -81,7 +81,7 @@ export function patchScrollfix(
|
|||||||
filter(isAppleDevice),
|
filter(isAppleDevice),
|
||||||
mergeMap(el => fromEvent(el, "touchstart")
|
mergeMap(el => fromEvent(el, "touchstart")
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo(el)
|
map(() => el)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
identity,
|
identity,
|
||||||
catchError,
|
catchError,
|
||||||
defer,
|
defer,
|
||||||
mapTo,
|
map,
|
||||||
mergeWith,
|
mergeWith,
|
||||||
of,
|
of,
|
||||||
switchMap,
|
switchMap,
|
||||||
@@ -144,7 +144,7 @@ export function watch(
|
|||||||
export function mkdir(directory: string): Observable<string> {
|
export function mkdir(directory: string): Observable<string> {
|
||||||
return defer(() => fs.mkdir(directory, { recursive: true }))
|
return defer(() => fs.mkdir(directory, { recursive: true }))
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo(directory)
|
map(() => directory)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ export function write(file: string, data: string): Observable<string> {
|
|||||||
cache.set(file, data)
|
cache.set(file, data)
|
||||||
return defer(() => fs.writeFile(file, data))
|
return defer(() => fs.writeFile(file, data))
|
||||||
.pipe(
|
.pipe(
|
||||||
mapTo(file),
|
map(() => file),
|
||||||
process.argv.includes("--verbose")
|
process.argv.includes("--verbose")
|
||||||
? tap(file => console.log(`${now()} + ${file}`))
|
? tap(file => console.log(`${now()} + ${file}`))
|
||||||
: identity
|
: identity
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import * as path from "path"
|
|||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
from,
|
from,
|
||||||
mapTo,
|
map,
|
||||||
mergeMap,
|
mergeMap,
|
||||||
switchMap
|
switchMap
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
@@ -82,7 +82,7 @@ export function copy(
|
|||||||
switchMap(data => write(options.to, data))
|
switchMap(data => write(options.to, data))
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
mapTo(options.to)
|
map(() => options.to)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import {
|
|||||||
scan,
|
scan,
|
||||||
startWith,
|
startWith,
|
||||||
switchMap,
|
switchMap,
|
||||||
switchMapTo,
|
|
||||||
toArray,
|
toArray,
|
||||||
zip
|
zip
|
||||||
} from "rxjs"
|
} from "rxjs"
|
||||||
@@ -189,7 +188,7 @@ const manifest$ = merge(
|
|||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
startWith("*"),
|
startWith("*"),
|
||||||
switchMapTo(observable$.pipe(toArray()))
|
switchMap(() => observable$.pipe(toArray()))
|
||||||
)
|
)
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user