2019-09-29 00:30:56 +02:00
|
|
|
/*
|
2020-02-11 11:05:21 +01:00
|
|
|
* Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
2019-09-29 00:30:56 +02:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
|
* IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
// TODO: remove this after we finished refactoring
|
2019-12-20 18:03:31 +01:00
|
|
|
// tslint:disable
|
|
|
|
|
2020-02-27 10:32:42 +01:00
|
|
|
import "../stylesheets/main.scss"
|
|
|
|
import "../stylesheets/palette.scss"
|
2020-02-10 18:32:28 +01:00
|
|
|
|
2020-02-17 17:20:08 +01:00
|
|
|
import { values } from "ramda"
|
2019-12-17 09:53:16 +01:00
|
|
|
import {
|
|
|
|
merge,
|
2020-02-17 11:35:36 +01:00
|
|
|
combineLatest,
|
2020-02-20 17:42:46 +01:00
|
|
|
animationFrameScheduler,
|
|
|
|
fromEvent,
|
|
|
|
of,
|
2020-03-05 17:17:15 +01:00
|
|
|
NEVER,
|
|
|
|
from
|
2019-11-27 19:12:49 +01:00
|
|
|
} from "rxjs"
|
2019-12-17 09:53:16 +01:00
|
|
|
import {
|
|
|
|
delay,
|
|
|
|
switchMap,
|
2020-02-14 17:36:31 +01:00
|
|
|
tap,
|
2020-02-14 19:15:21 +01:00
|
|
|
filter,
|
2020-02-17 11:35:36 +01:00
|
|
|
withLatestFrom,
|
2020-02-18 14:30:06 +01:00
|
|
|
observeOn,
|
2020-02-20 14:44:41 +01:00
|
|
|
take,
|
2020-02-20 17:42:46 +01:00
|
|
|
shareReplay,
|
2020-03-05 17:17:15 +01:00
|
|
|
share
|
2019-11-27 19:12:49 +01:00
|
|
|
} from "rxjs/operators"
|
2019-11-22 18:42:25 +01:00
|
|
|
|
2019-09-29 00:30:56 +02:00
|
|
|
import {
|
2019-12-18 17:14:20 +01:00
|
|
|
watchToggle,
|
2020-02-19 15:09:49 +01:00
|
|
|
setToggle,
|
2020-01-08 18:17:19 +01:00
|
|
|
getElements,
|
2020-01-26 16:03:49 +01:00
|
|
|
watchMedia,
|
2020-02-12 19:13:03 +01:00
|
|
|
watchDocument,
|
2020-02-16 00:23:50 +01:00
|
|
|
watchLocation,
|
2020-02-12 19:13:03 +01:00
|
|
|
watchLocationHash,
|
|
|
|
watchViewport,
|
2020-03-05 17:17:15 +01:00
|
|
|
isLocationInternal,
|
|
|
|
isLocationAnchor
|
|
|
|
} from "./browser"
|
2020-02-13 18:29:44 +01:00
|
|
|
import { setupSearchWorker } from "./workers"
|
2020-02-19 08:57:36 +01:00
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
import {
|
2020-02-13 23:42:12 +01:00
|
|
|
mountHeader,
|
2020-02-14 18:48:46 +01:00
|
|
|
mountHero,
|
2020-02-13 18:29:44 +01:00
|
|
|
mountMain,
|
2020-02-13 18:50:39 +01:00
|
|
|
mountNavigation,
|
|
|
|
mountSearch,
|
2020-02-14 14:47:44 +01:00
|
|
|
mountTableOfContents,
|
2020-02-14 18:48:46 +01:00
|
|
|
mountTabs,
|
2020-02-13 18:50:39 +01:00
|
|
|
useComponent,
|
2020-02-21 10:18:49 +01:00
|
|
|
setupComponents,
|
2020-02-20 14:44:41 +01:00
|
|
|
mountSearchQuery,
|
|
|
|
mountSearchReset,
|
|
|
|
mountSearchResult
|
2020-02-14 18:48:46 +01:00
|
|
|
} from "components"
|
2020-02-19 08:57:36 +01:00
|
|
|
import { setupClipboard } from "./integrations/clipboard"
|
2020-03-05 17:17:15 +01:00
|
|
|
import { setupDialog } from "integrations/dialog"
|
2020-02-19 15:09:49 +01:00
|
|
|
import { setupKeyboard } from "./integrations/keyboard"
|
2020-03-05 17:17:15 +01:00
|
|
|
import { setupInstantLoading } from "integrations/instant"
|
2020-02-19 11:42:51 +01:00
|
|
|
import {
|
|
|
|
patchTables,
|
|
|
|
patchDetails,
|
|
|
|
patchScrollfix,
|
2020-02-29 19:25:42 +01:00
|
|
|
patchSource,
|
|
|
|
patchScripts
|
2020-02-19 11:42:51 +01:00
|
|
|
} from "patches"
|
2020-02-20 10:07:50 +01:00
|
|
|
import { isConfig } from "utilities"
|
2019-12-18 17:14:20 +01:00
|
|
|
|
2020-02-14 17:45:32 +01:00
|
|
|
/* ------------------------------------------------------------------------- */
|
2019-12-18 17:14:20 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
document.documentElement.classList.remove("no-js")
|
|
|
|
document.documentElement.classList.add("js")
|
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
/* Test for iOS */
|
|
|
|
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g))
|
|
|
|
document.documentElement.classList.add("ios")
|
|
|
|
|
2020-03-03 18:19:33 +01:00
|
|
|
/**
|
|
|
|
* Set scroll lock
|
|
|
|
*
|
|
|
|
* @param el - Scrollable element
|
|
|
|
* @param value - Vertical offset
|
|
|
|
*/
|
|
|
|
export function setScrollLock(
|
|
|
|
el: HTMLElement, value: number
|
|
|
|
): void {
|
|
|
|
el.setAttribute("data-md-state", "lock")
|
|
|
|
el.style.top = `-${value}px`
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset scroll lock
|
|
|
|
*
|
|
|
|
* @param el - Scrollable element
|
|
|
|
*/
|
|
|
|
export function resetScrollLock(
|
|
|
|
el: HTMLElement
|
|
|
|
): void {
|
|
|
|
const value = -1 * parseInt(el.style.top, 10)
|
|
|
|
el.removeAttribute("data-md-state")
|
|
|
|
el.style.top = ""
|
|
|
|
if (value)
|
|
|
|
window.scrollTo(0, value)
|
|
|
|
}
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Functions
|
|
|
|
* ------------------------------------------------------------------------- */
|
2019-12-20 18:03:31 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/**
|
|
|
|
* Initialize Material for MkDocs
|
|
|
|
*
|
|
|
|
* @param config - Configuration
|
|
|
|
*/
|
|
|
|
export function initialize(config: unknown) {
|
|
|
|
if (!isConfig(config))
|
|
|
|
throw new SyntaxError(`Invalid configuration: ${JSON.stringify(config)}`)
|
2019-12-20 18:03:31 +01:00
|
|
|
|
2020-02-21 11:36:32 +01:00
|
|
|
/* Setup user interface observables */
|
2020-02-16 00:23:50 +01:00
|
|
|
const location$ = watchLocation()
|
2020-02-21 11:36:32 +01:00
|
|
|
const hash$ = watchLocationHash()
|
2020-02-12 19:13:03 +01:00
|
|
|
const viewport$ = watchViewport()
|
2020-02-21 11:36:32 +01:00
|
|
|
const tablet$ = watchMedia("(min-width: 960px)")
|
|
|
|
const screen$ = watchMedia("(min-width: 1220px)")
|
2020-02-12 19:13:03 +01:00
|
|
|
|
2020-02-21 11:36:32 +01:00
|
|
|
/* Setup document observable */
|
2020-03-05 17:17:15 +01:00
|
|
|
const document$ = config.features.includes("instant")
|
2020-02-21 11:36:32 +01:00
|
|
|
? watchDocument({ location$ })
|
|
|
|
: watchDocument()
|
2020-02-14 17:45:32 +01:00
|
|
|
|
2020-02-21 11:36:32 +01:00
|
|
|
/* Setup component bindings */
|
2020-02-21 10:18:49 +01:00
|
|
|
setupComponents([
|
2020-02-14 17:45:32 +01:00
|
|
|
"container", /* Container */
|
|
|
|
"header", /* Header */
|
|
|
|
"header-title", /* Header title */
|
|
|
|
"hero", /* Hero */
|
|
|
|
"main", /* Main area */
|
|
|
|
"navigation", /* Navigation */
|
|
|
|
"search", /* Search */
|
|
|
|
"search-query", /* Search input */
|
|
|
|
"search-reset", /* Search reset */
|
|
|
|
"search-result", /* Search results */
|
2020-03-05 17:17:15 +01:00
|
|
|
"skip", /* Skip link */
|
2020-02-14 17:45:32 +01:00
|
|
|
"tabs", /* Tabs */
|
|
|
|
"toc" /* Table of contents */
|
|
|
|
], { document$ })
|
2019-11-27 19:12:49 +01:00
|
|
|
|
2020-02-21 10:18:49 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
// External index
|
|
|
|
const index = config.search && config.search.index
|
|
|
|
? config.search.index
|
|
|
|
: undefined
|
|
|
|
|
|
|
|
// TODO: pass URL config as first parameter, options as second
|
|
|
|
const worker = setupSearchWorker(config.url.worker.search, {
|
|
|
|
base: config.url.base, index, location$
|
2020-02-21 11:36:32 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2019-11-26 17:56:45 +01:00
|
|
|
/* Create header observable */
|
2020-02-13 18:29:44 +01:00
|
|
|
const header$ = useComponent("header")
|
2019-12-20 18:03:31 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountHeader({ viewport$ }),
|
|
|
|
shareReplay(1)
|
2019-12-20 18:03:31 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const main$ = useComponent("main")
|
2019-12-20 18:03:31 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountMain({ header$, viewport$ }),
|
|
|
|
shareReplay(1)
|
2019-12-20 18:03:31 +01:00
|
|
|
)
|
|
|
|
|
2020-02-12 19:13:03 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-20 14:44:41 +01:00
|
|
|
/* Mount search query */
|
2020-03-03 14:59:57 +01:00
|
|
|
const query$ = useComponent("search-query")
|
2020-02-20 14:44:41 +01:00
|
|
|
.pipe(
|
|
|
|
mountSearchQuery(worker),
|
2020-03-05 17:17:15 +01:00
|
|
|
shareReplay(1)
|
2020-02-20 14:44:41 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
/* Mount search reset */
|
|
|
|
const reset$ = useComponent("search-reset")
|
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountSearchReset(),
|
|
|
|
shareReplay(1)
|
2020-02-20 14:44:41 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
/* Mount search result */
|
|
|
|
const result$ = useComponent("search-result")
|
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountSearchResult(worker, { query$ }),
|
|
|
|
shareReplay(1)
|
2020-02-20 14:44:41 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const search$ = useComponent("search")
|
2020-02-12 19:13:03 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountSearch({ query$, reset$, result$ }),
|
|
|
|
shareReplay(1)
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-20 14:44:41 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const navigation$ = useComponent("navigation")
|
2019-11-27 19:12:49 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountNavigation({ header$, main$, viewport$, screen$ }),
|
2020-02-22 15:56:08 +01:00
|
|
|
shareReplay(1) // shareReplay because there might be late subscribers
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const toc$ = useComponent("toc")
|
2019-11-22 18:42:25 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountTableOfContents({ header$, main$, viewport$, tablet$ }),
|
|
|
|
shareReplay(1)
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const tabs$ = useComponent("tabs")
|
2019-11-27 19:12:49 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountTabs({ header$, viewport$, screen$ }),
|
|
|
|
shareReplay(1)
|
2019-12-22 17:30:55 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 18:29:44 +01:00
|
|
|
const hero$ = useComponent("hero")
|
2019-12-22 17:30:55 +01:00
|
|
|
.pipe(
|
2020-02-20 17:42:46 +01:00
|
|
|
mountHero({ header$, viewport$ }),
|
|
|
|
shareReplay(1)
|
2019-11-27 19:12:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-13 23:42:12 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-20 10:07:50 +01:00
|
|
|
const keyboard$ = setupKeyboard()
|
2020-02-19 15:09:49 +01:00
|
|
|
|
2020-02-19 17:29:18 +01:00
|
|
|
patchDetails({ document$, hash$ })
|
2020-02-29 19:25:42 +01:00
|
|
|
patchScripts({ document$ })
|
2020-02-19 17:29:18 +01:00
|
|
|
patchSource({ document$ })
|
2020-02-29 19:25:42 +01:00
|
|
|
patchTables({ document$ })
|
2020-02-19 17:29:18 +01:00
|
|
|
|
|
|
|
/* Force 1px scroll offset to trigger overflow scrolling */
|
2020-02-29 19:25:42 +01:00
|
|
|
patchScrollfix({ document$ })
|
2020-02-18 14:30:06 +01:00
|
|
|
|
2020-02-20 14:44:41 +01:00
|
|
|
/* Setup clipboard and dialog */
|
|
|
|
const dialog$ = setupDialog()
|
|
|
|
const clipboard$ = setupClipboard({ document$, dialog$ })
|
2020-02-14 15:00:56 +01:00
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
2019-12-20 18:03:31 +01:00
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
// // put into search...
|
|
|
|
// hash$
|
|
|
|
// .pipe(
|
|
|
|
// switchMap(hash => useToggle("search")
|
|
|
|
// .pipe(
|
|
|
|
// filter(x => x.checked), // only active
|
|
|
|
// tap(toggle => setToggle(toggle, false)),
|
|
|
|
// delay(125), // ensure that it runs after the body scroll reset...
|
|
|
|
// mapTo(hash)
|
|
|
|
// )
|
|
|
|
// )
|
|
|
|
// )
|
|
|
|
// .subscribe(hash => {
|
|
|
|
// getElement(`[id="${hash}"]`)!.scrollIntoView()
|
|
|
|
// })
|
2020-02-16 00:23:50 +01:00
|
|
|
|
2020-02-20 14:44:41 +01:00
|
|
|
// Scroll lock // document -> document$ => { body } !?
|
|
|
|
// put into search...
|
2020-02-17 11:35:36 +01:00
|
|
|
combineLatest([
|
2020-03-05 17:17:15 +01:00
|
|
|
watchToggle("search"),
|
2020-02-17 11:35:36 +01:00
|
|
|
tablet$,
|
|
|
|
])
|
|
|
|
.pipe(
|
|
|
|
withLatestFrom(viewport$),
|
|
|
|
switchMap(([[toggle, tablet], { offset: { y }}]) => {
|
|
|
|
const active = toggle && !tablet
|
2020-02-20 14:44:41 +01:00
|
|
|
return document$
|
2020-02-17 11:35:36 +01:00
|
|
|
.pipe(
|
2020-02-20 14:44:41 +01:00
|
|
|
delay(active ? 400 : 100), // TOOD: directly combine this with the hash!
|
2020-02-17 11:35:36 +01:00
|
|
|
observeOn(animationFrameScheduler),
|
2020-02-20 14:44:41 +01:00
|
|
|
tap(({ body }) => active
|
|
|
|
? setScrollLock(body, y)
|
|
|
|
: resetScrollLock(body)
|
2020-02-17 11:35:36 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
)
|
|
|
|
.subscribe()
|
|
|
|
|
2020-02-18 15:39:36 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
/* Intercept internal link clicks */
|
|
|
|
const link$ = fromEvent<MouseEvent>(document.body, "click")
|
|
|
|
.pipe(
|
|
|
|
filter(ev => !(ev.metaKey || ev.ctrlKey)),
|
|
|
|
switchMap(ev => {
|
|
|
|
if (ev.target instanceof HTMLElement) {
|
|
|
|
const el = ev.target.closest("a") // TODO: abstract as link click?
|
|
|
|
if (el && isLocationInternal(el)) {
|
2020-03-05 21:03:51 +01:00
|
|
|
if (!isLocationAnchor(el) && config.features.includes("instant"))
|
2020-03-05 17:17:15 +01:00
|
|
|
ev.preventDefault()
|
|
|
|
return of(el)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NEVER
|
|
|
|
}),
|
|
|
|
share()
|
2020-02-29 12:38:11 +01:00
|
|
|
)
|
2020-02-22 13:35:26 +01:00
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
/* Always close drawer on click */
|
|
|
|
link$.subscribe(() => {
|
|
|
|
setToggle("drawer", false)
|
|
|
|
})
|
2020-02-22 13:35:26 +01:00
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
// somehow call this setupNavigation ?
|
2020-02-22 13:35:26 +01:00
|
|
|
|
2020-02-20 17:42:46 +01:00
|
|
|
// instant loading
|
2020-03-05 17:17:15 +01:00
|
|
|
if (config.features.includes("instant")) {
|
2020-02-22 13:35:26 +01:00
|
|
|
|
|
|
|
/* Disable automatic scroll restoration, as it doesn't work nicely */
|
|
|
|
if ("scrollRestoration" in history)
|
|
|
|
history.scrollRestoration = "manual"
|
|
|
|
|
|
|
|
/* Resolve relative links for stability */
|
|
|
|
for (const selector of [
|
|
|
|
`link[rel="shortcut icon"]`,
|
|
|
|
`link[rel="stylesheet"]`
|
|
|
|
])
|
|
|
|
for (const el of getElements<HTMLLinkElement>(selector))
|
|
|
|
el.href = el.href
|
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
setupInstantLoading({
|
|
|
|
document$, link$, location$, viewport$
|
2020-02-20 17:42:46 +01:00
|
|
|
})
|
2020-03-05 17:17:15 +01:00
|
|
|
|
2020-02-22 13:35:26 +01:00
|
|
|
}
|
2020-02-20 17:42:46 +01:00
|
|
|
|
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2020-02-18 14:30:06 +01:00
|
|
|
// if we use a single tab outside of search, unhide all permalinks.
|
2020-02-19 15:09:49 +01:00
|
|
|
// TODO: experimental. necessary!?
|
2020-02-18 14:30:06 +01:00
|
|
|
keyboard$
|
|
|
|
.pipe(
|
2020-02-20 10:07:50 +01:00
|
|
|
filter(key => key.mode === "global" && ["Tab"].includes(key.type)),
|
2020-02-18 14:30:06 +01:00
|
|
|
take(1)
|
|
|
|
)
|
|
|
|
.subscribe(() => {
|
|
|
|
for (const link of getElements(".headerlink"))
|
|
|
|
link.style.visibility = "visible"
|
|
|
|
})
|
|
|
|
|
2020-02-02 17:18:18 +01:00
|
|
|
/* ----------------------------------------------------------------------- */
|
|
|
|
|
2019-12-22 17:30:55 +01:00
|
|
|
const state = {
|
2020-03-05 17:17:15 +01:00
|
|
|
|
|
|
|
/* Browser observables */
|
|
|
|
document$,
|
|
|
|
viewport$,
|
|
|
|
|
|
|
|
/* Component observables */
|
|
|
|
header$,
|
|
|
|
hero$,
|
2019-12-22 17:30:55 +01:00
|
|
|
main$,
|
|
|
|
navigation$,
|
2020-03-05 17:17:15 +01:00
|
|
|
search$,
|
2019-12-22 17:30:55 +01:00
|
|
|
tabs$,
|
2020-03-05 17:17:15 +01:00
|
|
|
toc$,
|
2019-11-27 19:12:49 +01:00
|
|
|
|
2020-03-05 17:17:15 +01:00
|
|
|
/* Integation observables */
|
|
|
|
clipboard$,
|
|
|
|
keyboard$,
|
|
|
|
dialog$
|
2019-11-26 17:56:45 +01:00
|
|
|
}
|
2020-03-05 17:17:15 +01:00
|
|
|
|
|
|
|
/* Subscribe to all observables */
|
|
|
|
merge(...values(state))
|
|
|
|
.subscribe()
|
|
|
|
return state
|
2019-09-29 00:30:56 +02:00
|
|
|
}
|