react-cheminfo 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -31
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/i18n/core/index.d.ts +2 -0
- package/lib/i18n/core/index.d.ts.map +1 -1
- package/lib/i18n/core/index.js +1 -0
- package/lib/i18n/core/index.js.map +1 -1
- package/lib/i18n/core/messageCatalog.d.ts +10 -0
- package/lib/i18n/core/messageCatalog.d.ts.map +1 -1
- package/lib/i18n/core/messageCatalog.js +12 -0
- package/lib/i18n/core/messageCatalog.js.map +1 -1
- package/lib/i18n/core/translate.d.ts +35 -0
- package/lib/i18n/core/translate.d.ts.map +1 -0
- package/lib/i18n/core/translate.js +27 -0
- package/lib/i18n/core/translate.js.map +1 -0
- package/lib/i18n/ui/useT.d.ts +2 -12
- package/lib/i18n/ui/useT.d.ts.map +1 -1
- package/lib/i18n/ui/useT.js +2 -8
- package/lib/i18n/ui/useT.js.map +1 -1
- package/lib/i18n/vite/index.d.ts +3 -0
- package/lib/i18n/vite/index.d.ts.map +1 -0
- package/lib/i18n/vite/index.js +2 -0
- package/lib/i18n/vite/index.js.map +1 -0
- package/lib/i18n/vite/localeCatalog.d.ts +70 -0
- package/lib/i18n/vite/localeCatalog.d.ts.map +1 -0
- package/lib/i18n/vite/localeCatalog.js +80 -0
- package/lib/i18n/vite/localeCatalog.js.map +1 -0
- package/lib/language/ui/siteLanguageContext.d.ts.map +1 -1
- package/lib/language/ui/siteLanguageContext.js +2 -1
- package/lib/language/ui/siteLanguageContext.js.map +1 -1
- package/lib/locales/de.json +5 -0
- package/lib/locales/en.json +5 -0
- package/lib/locales/es.json +5 -0
- package/lib/locales/fr.json +5 -0
- package/lib/locales/it.json +5 -0
- package/lib/router/core/history.d.ts +4 -3
- package/lib/router/core/history.d.ts.map +1 -1
- package/lib/router/core/history.js +9 -13
- package/lib/router/core/history.js.map +1 -1
- package/lib/router/core/index.d.ts +2 -0
- package/lib/router/core/index.d.ts.map +1 -1
- package/lib/router/core/index.js +1 -0
- package/lib/router/core/index.js.map +1 -1
- package/lib/router/core/pageAddress.d.ts +61 -0
- package/lib/router/core/pageAddress.d.ts.map +1 -0
- package/lib/router/core/pageAddress.js +69 -0
- package/lib/router/core/pageAddress.js.map +1 -0
- package/lib/share/core/index.d.ts +4 -0
- package/lib/share/core/index.d.ts.map +1 -1
- package/lib/share/core/index.js +2 -0
- package/lib/share/core/index.js.map +1 -1
- package/lib/share/core/preferences.d.ts +2 -2
- package/lib/share/core/preferences.d.ts.map +1 -1
- package/lib/share/core/preferences.js +8 -3
- package/lib/share/core/preferences.js.map +1 -1
- package/lib/share/core/seal.d.ts +42 -0
- package/lib/share/core/seal.d.ts.map +1 -0
- package/lib/share/core/seal.js +185 -0
- package/lib/share/core/seal.js.map +1 -0
- package/lib/share/core/sealedAddress.d.ts +31 -0
- package/lib/share/core/sealedAddress.d.ts.map +1 -0
- package/lib/share/core/sealedAddress.js +38 -0
- package/lib/share/core/sealedAddress.js.map +1 -0
- package/lib/share/ui/SealedLinkRefused.d.ts +17 -0
- package/lib/share/ui/SealedLinkRefused.d.ts.map +1 -0
- package/lib/share/ui/SealedLinkRefused.js +23 -0
- package/lib/share/ui/SealedLinkRefused.js.map +1 -0
- package/lib/share/ui/ShareConfigOptions.d.ts +12 -1
- package/lib/share/ui/ShareConfigOptions.d.ts.map +1 -1
- package/lib/share/ui/ShareConfigOptions.js +4 -3
- package/lib/share/ui/ShareConfigOptions.js.map +1 -1
- package/lib/share/ui/ShareDialogContent.d.ts.map +1 -1
- package/lib/share/ui/ShareDialogContent.js +20 -6
- package/lib/share/ui/ShareDialogContent.js.map +1 -1
- package/lib/share/ui/ShareLinkBar.d.ts +5 -0
- package/lib/share/ui/ShareLinkBar.d.ts.map +1 -1
- package/lib/share/ui/ShareLinkBar.js +4 -4
- package/lib/share/ui/ShareLinkBar.js.map +1 -1
- package/lib/share/ui/index.d.ts +2 -0
- package/lib/share/ui/index.d.ts.map +1 -1
- package/lib/share/ui/index.js +1 -0
- package/lib/share/ui/index.js.map +1 -1
- package/lib/share/ui/useSealedUrl.d.ts +17 -0
- package/lib/share/ui/useSealedUrl.d.ts.map +1 -0
- package/lib/share/ui/useSealedUrl.js +31 -0
- package/lib/share/ui/useSealedUrl.js.map +1 -0
- package/lib/vite.d.ts +1 -0
- package/lib/vite.d.ts.map +1 -1
- package/lib/vite.js +1 -0
- package/lib/vite.js.map +1 -1
- package/package.json +1 -1
- package/src/i18n/core/index.ts +2 -0
- package/src/i18n/core/messageCatalog.ts +13 -0
- package/src/i18n/core/translate.ts +51 -0
- package/src/i18n/ui/useT.ts +6 -29
- package/src/i18n/vite/index.ts +5 -0
- package/src/i18n/vite/localeCatalog.ts +121 -0
- package/src/language/ui/siteLanguageContext.ts +2 -1
- package/src/locales/de.json +5 -0
- package/src/locales/en.json +5 -0
- package/src/locales/es.json +5 -0
- package/src/locales/fr.json +5 -0
- package/src/locales/it.json +5 -0
- package/src/router/core/history.ts +9 -15
- package/src/router/core/index.ts +8 -0
- package/src/router/core/pageAddress.ts +110 -0
- package/src/share/core/index.ts +10 -0
- package/src/share/core/preferences.ts +10 -10
- package/src/share/core/seal.ts +233 -0
- package/src/share/core/sealedAddress.ts +48 -0
- package/src/share/ui/SealedLinkRefused.tsx +43 -0
- package/src/share/ui/ShareConfigOptions.tsx +23 -1
- package/src/share/ui/ShareDialogContent.tsx +37 -6
- package/src/share/ui/ShareLinkBar.tsx +9 -1
- package/src/share/ui/index.ts +2 -0
- package/src/share/ui/useSealedUrl.ts +40 -0
- package/src/vite.ts +1 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A site's catalogs as the build reads them: all of them, off disk, at once.
|
|
3
|
+
*
|
|
4
|
+
* The page and the build want opposite things from the same files. A browser
|
|
5
|
+
* fetches one language — the one being read — so `en.json` is part of the
|
|
6
|
+
* bundle and the others are `import()`ed when a visitor asks, which is what
|
|
7
|
+
* keeps a site nobody reads in German from downloading the German. The build
|
|
8
|
+
* writes a head per address per language in one pass, so it wants every
|
|
9
|
+
* language, synchronously, before the first route table is asked for.
|
|
10
|
+
*
|
|
11
|
+
* Reading them rather than fetching them is what makes that possible. The
|
|
12
|
+
* page's loaders are written bare — `import('../locales/fr.json')` with no
|
|
13
|
+
* `with { type: 'json' }` — because the dev server serves a JSON file as a
|
|
14
|
+
* JavaScript module and a browser refuses a chunk it was promised JSON for.
|
|
15
|
+
* Node demands the attribute, so it cannot run those loaders: a build that
|
|
16
|
+
* awaited them had to be async and still only worked by keeping a second,
|
|
17
|
+
* eagerly imported copy of every catalog beside the first. `readFileSync` has
|
|
18
|
+
* no attribute, so there is nothing to work around.
|
|
19
|
+
*
|
|
20
|
+
* The identity comes from the page's own catalog, never re-typed here: pass
|
|
21
|
+
* `SITE_CATALOG.source` and the two provably name the same files.
|
|
22
|
+
*/
|
|
23
|
+
import { MessageCatalog } from '../core/index.ts';
|
|
24
|
+
/**
|
|
25
|
+
* Which catalog to read, which is the page catalog's own `source`.
|
|
26
|
+
*
|
|
27
|
+
* `MessageCatalog` publishes it for the translate overlay, and it already
|
|
28
|
+
* carries the three things a reader needs. Hand it over rather than writing
|
|
29
|
+
* them twice: a build that names its own directory is a build that can come to
|
|
30
|
+
* disagree with the page about which files the site is translated in.
|
|
31
|
+
*/
|
|
32
|
+
export interface LocaleCatalogSource {
|
|
33
|
+
/**
|
|
34
|
+
* The name the page knows the catalog by, which is the site's host, e.g.
|
|
35
|
+
* `surge.cheminfo.org`. A translator's edit is routed back to the right
|
|
36
|
+
* repository with it, so the build and the page must agree on it.
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/** The GitHub repository the files live in, written `owner/repo`. */
|
|
40
|
+
repository: string;
|
|
41
|
+
/** The directory holding the locale files, relative to the repository root. */
|
|
42
|
+
directory: string;
|
|
43
|
+
}
|
|
44
|
+
/** Where the directory is looked for. */
|
|
45
|
+
export interface LocaleCatalogOptions {
|
|
46
|
+
/**
|
|
47
|
+
* What the source's relative `directory` is resolved against. The default is
|
|
48
|
+
* the working directory, which is the repository root for both callers: a
|
|
49
|
+
* Vite config and a vitest run.
|
|
50
|
+
* @default process.cwd()
|
|
51
|
+
*/
|
|
52
|
+
root?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Every language a site is written in, read off disk into one catalog.
|
|
56
|
+
*
|
|
57
|
+
* For the build and for a site's own tests, never for the page: it reads the
|
|
58
|
+
* filesystem, and the translations it holds are tens of kilobytes a first
|
|
59
|
+
* visit must not pay for. Read one language out of it with `catalogTranslate`.
|
|
60
|
+
*
|
|
61
|
+
* A language whose file is absent is left out, which the catalog already reads
|
|
62
|
+
* as English — a half-translated site serves the pages it has rather than
|
|
63
|
+
* failing the build. A missing English file is a misconfiguration and throws:
|
|
64
|
+
* every key and every fallback is declared there.
|
|
65
|
+
* @param source - The page catalog's own `source`. See {@link LocaleCatalogSource}.
|
|
66
|
+
* @param options - See {@link LocaleCatalogOptions}.
|
|
67
|
+
* @returns The catalog, every language it carries already in memory.
|
|
68
|
+
*/
|
|
69
|
+
export declare function readLocaleCatalog<TKey extends string = string>(source: LocaleCatalogSource, options?: LocaleCatalogOptions): MessageCatalog<TKey>;
|
|
70
|
+
//# sourceMappingURL=localeCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeCatalog.d.ts","sourceRoot":"","sources":["../../../src/i18n/vite/localeCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,EAA+B,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5D,MAAM,EAAE,mBAAmB,EAC3B,OAAO,GAAE,oBAAyB,GACjC,cAAc,CAAC,IAAI,CAAC,CAsBtB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A site's catalogs as the build reads them: all of them, off disk, at once.
|
|
3
|
+
*
|
|
4
|
+
* The page and the build want opposite things from the same files. A browser
|
|
5
|
+
* fetches one language — the one being read — so `en.json` is part of the
|
|
6
|
+
* bundle and the others are `import()`ed when a visitor asks, which is what
|
|
7
|
+
* keeps a site nobody reads in German from downloading the German. The build
|
|
8
|
+
* writes a head per address per language in one pass, so it wants every
|
|
9
|
+
* language, synchronously, before the first route table is asked for.
|
|
10
|
+
*
|
|
11
|
+
* Reading them rather than fetching them is what makes that possible. The
|
|
12
|
+
* page's loaders are written bare — `import('../locales/fr.json')` with no
|
|
13
|
+
* `with { type: 'json' }` — because the dev server serves a JSON file as a
|
|
14
|
+
* JavaScript module and a browser refuses a chunk it was promised JSON for.
|
|
15
|
+
* Node demands the attribute, so it cannot run those loaders: a build that
|
|
16
|
+
* awaited them had to be async and still only worked by keeping a second,
|
|
17
|
+
* eagerly imported copy of every catalog beside the first. `readFileSync` has
|
|
18
|
+
* no attribute, so there is nothing to work around.
|
|
19
|
+
*
|
|
20
|
+
* The identity comes from the page's own catalog, never re-typed here: pass
|
|
21
|
+
* `SITE_CATALOG.source` and the two provably name the same files.
|
|
22
|
+
*/
|
|
23
|
+
import { readFileSync } from 'node:fs';
|
|
24
|
+
import { join, resolve } from 'node:path';
|
|
25
|
+
import { DEFAULT_LANGUAGE, LANGUAGES, MessageCatalog } from "../core/index.js";
|
|
26
|
+
/**
|
|
27
|
+
* Every language a site is written in, read off disk into one catalog.
|
|
28
|
+
*
|
|
29
|
+
* For the build and for a site's own tests, never for the page: it reads the
|
|
30
|
+
* filesystem, and the translations it holds are tens of kilobytes a first
|
|
31
|
+
* visit must not pay for. Read one language out of it with `catalogTranslate`.
|
|
32
|
+
*
|
|
33
|
+
* A language whose file is absent is left out, which the catalog already reads
|
|
34
|
+
* as English — a half-translated site serves the pages it has rather than
|
|
35
|
+
* failing the build. A missing English file is a misconfiguration and throws:
|
|
36
|
+
* every key and every fallback is declared there.
|
|
37
|
+
* @param source - The page catalog's own `source`. See {@link LocaleCatalogSource}.
|
|
38
|
+
* @param options - See {@link LocaleCatalogOptions}.
|
|
39
|
+
* @returns The catalog, every language it carries already in memory.
|
|
40
|
+
*/
|
|
41
|
+
export function readLocaleCatalog(source, options = {}) {
|
|
42
|
+
const { id, repository, directory } = source;
|
|
43
|
+
const folder = resolve(options.root ?? process.cwd(), directory);
|
|
44
|
+
const english = readMessages(folder, DEFAULT_LANGUAGE);
|
|
45
|
+
if (english === undefined) {
|
|
46
|
+
throw new Error(`no ${DEFAULT_LANGUAGE}.json in ${folder}: a catalog declares its keys and its fallbacks there`);
|
|
47
|
+
}
|
|
48
|
+
const translations = {};
|
|
49
|
+
for (const language of LANGUAGES) {
|
|
50
|
+
if (language === DEFAULT_LANGUAGE)
|
|
51
|
+
continue;
|
|
52
|
+
const messages = readMessages(folder, language);
|
|
53
|
+
if (messages !== undefined)
|
|
54
|
+
translations[language] = messages;
|
|
55
|
+
}
|
|
56
|
+
return new MessageCatalog({
|
|
57
|
+
id,
|
|
58
|
+
repository,
|
|
59
|
+
directory,
|
|
60
|
+
source: english,
|
|
61
|
+
translations,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* One language's messages, read off disk.
|
|
66
|
+
* @param folder - The resolved directory holding the locale files.
|
|
67
|
+
* @param language - The language whose file to read.
|
|
68
|
+
* @returns Its messages, or `undefined` when the site does not carry it.
|
|
69
|
+
*/
|
|
70
|
+
function readMessages(folder, language) {
|
|
71
|
+
let text;
|
|
72
|
+
try {
|
|
73
|
+
text = readFileSync(join(folder, `${language}.json`), 'utf8');
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
return JSON.parse(text);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=localeCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localeCatalog.js","sourceRoot":"","sources":["../../../src/i18n/vite/localeCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAkC/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAA2B,EAC3B,UAAgC,EAAE;IAElC,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IACvD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,MAAM,gBAAgB,YAAY,MAAM,uDAAuD,CAChG,CAAC;IACJ,CAAC;IACD,MAAM,YAAY,GAAsD,EAAE,CAAC;IAC3E,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,KAAK,gBAAgB;YAAE,SAAS;QAC5C,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,QAAQ,KAAK,SAAS;YAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAChE,CAAC;IACD,OAAO,IAAI,cAAc,CAAO;QAC9B,EAAE;QACF,UAAU;QACV,SAAS;QACT,MAAM,EAAE,OAAO;QACf,YAAY;KACb,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CACnB,MAAc,EACd,QAAkB;IAElB,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAA2B,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siteLanguageContext.d.ts","sourceRoot":"","sources":["../../../src/language/ui/siteLanguageContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"siteLanguageContext.d.ts","sourceRoot":"","sources":["../../../src/language/ui/siteLanguageContext.ts"],"names":[],"mappings":"AAKA,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,6CAA+C,CAAC;AAEhF;;;;;;;GAOG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,SAAS,CAIpD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, use } from 'react';
|
|
2
|
+
import { pageLocation } from "../../router/core/pageAddress.js";
|
|
2
3
|
import { readLanguageParam } from "../core/languageParam.js";
|
|
3
4
|
/** What a site declares the page is being read in. */
|
|
4
5
|
export const SiteLanguageContext = createContext(undefined);
|
|
@@ -14,6 +15,6 @@ export function useSiteLanguage() {
|
|
|
14
15
|
const declared = use(SiteLanguageContext);
|
|
15
16
|
if (declared !== undefined)
|
|
16
17
|
return declared;
|
|
17
|
-
return readLanguageParam(
|
|
18
|
+
return readLanguageParam(pageLocation()?.search ?? '');
|
|
18
19
|
}
|
|
19
20
|
//# sourceMappingURL=siteLanguageContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siteLanguageContext.js","sourceRoot":"","sources":["../../../src/language/ui/siteLanguageContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,sDAAsD;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAqB,SAAS,CAAC,CAAC;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC1C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC5C,OAAO,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"siteLanguageContext.js","sourceRoot":"","sources":["../../../src/language/ui/siteLanguageContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,sDAAsD;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAqB,SAAS,CAAC,CAAC;AAEhF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC1C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC5C,OAAO,iBAAiB,CAAC,YAAY,EAAE,EAAE,MAAM,IAAI,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
package/lib/locales/de.json
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"share.layout": "Darstellung",
|
|
55
55
|
"share.embed": "In eine andere Seite einbetten",
|
|
56
56
|
"share.embedHint": "Lässt Kopfzeile und Navigation der Website weg, damit die Seite in einer Seite von Ihnen sitzt.",
|
|
57
|
+
"share.protect": "Diesen Link schützen",
|
|
58
|
+
"share.protectHint": "Die Klasse kann weder lesen noch ändern, was der Link einstellt, und die Adresse der Seite bleibt fest. Die Seite wird eingebettet.",
|
|
57
59
|
"share.on": "Ein",
|
|
58
60
|
"share.off": "Aus",
|
|
59
61
|
"share.showOnPage": "Auf der Seite zeigen",
|
|
@@ -76,6 +78,9 @@
|
|
|
76
78
|
"share.copyIframe": "Iframe kopieren",
|
|
77
79
|
"share.copyIframeHelpTitle": "Die Seite in Ihre einbauen",
|
|
78
80
|
"share.copyIframeHelp": "Ein HTML-Schnipsel, das dort eingefügt wird, wo das HTML Ihrer Seite bearbeitet wird: das Werkzeug läuft dann darin.",
|
|
81
|
+
"seal.refusedTitle": "Dieser Link lässt sich nicht öffnen",
|
|
82
|
+
"seal.refusedBody": "Er wurde nach dem Erstellen verändert oder ist unvollständig, daher wurde nichts geöffnet. Bitten Sie erneut um den Link.",
|
|
83
|
+
"seal.openWithout": "Das Werkzeug ohne den Link öffnen",
|
|
79
84
|
"cite.button": "Zitieren",
|
|
80
85
|
"cite.copyReferenceAs": "Literaturangabe kopieren als",
|
|
81
86
|
"cite.pleaseCiteBoth": "Bitte zitieren Sie beide Arbeiten",
|
package/lib/locales/en.json
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"share.layout": "Layout",
|
|
55
55
|
"share.embed": "Embed in another page",
|
|
56
56
|
"share.embedHint": "Drops the site header and its navigation, so the page sits inside a page of your own.",
|
|
57
|
+
"share.protect": "Protect this link",
|
|
58
|
+
"share.protectHint": "The class can neither read nor change what the link sets up, and the page's address stays fixed. The page is embedded.",
|
|
57
59
|
"share.on": "On",
|
|
58
60
|
"share.off": "Off",
|
|
59
61
|
"share.showOnPage": "Show on the page",
|
|
@@ -76,6 +78,9 @@
|
|
|
76
78
|
"share.copyIframe": "Copy the iframe",
|
|
77
79
|
"share.copyIframeHelpTitle": "Put the page inside yours",
|
|
78
80
|
"share.copyIframeHelp": "A snippet of HTML to paste where your own page's HTML is edited: the tool then runs inside it.",
|
|
81
|
+
"seal.refusedTitle": "This link cannot be opened",
|
|
82
|
+
"seal.refusedBody": "It was changed after it was made, or it is incomplete, so nothing was opened. Ask for the link again.",
|
|
83
|
+
"seal.openWithout": "Open the tool without it",
|
|
79
84
|
"cite.button": "Cite",
|
|
80
85
|
"cite.copyReferenceAs": "Copy the reference as",
|
|
81
86
|
"cite.pleaseCiteBoth": "Please cite both works",
|
package/lib/locales/es.json
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"share.layout": "Disposición",
|
|
55
55
|
"share.embed": "Incrustar en otra página",
|
|
56
56
|
"share.embedHint": "Quita la cabecera del sitio y su navegación, para que la página quede dentro de una página suya.",
|
|
57
|
+
"share.protect": "Proteger este enlace",
|
|
58
|
+
"share.protectHint": "La clase no puede leer ni cambiar lo que configura el enlace, y la dirección de la página queda fija. La página se integra.",
|
|
57
59
|
"share.on": "Sí",
|
|
58
60
|
"share.off": "No",
|
|
59
61
|
"share.showOnPage": "Mostrar en la página",
|
|
@@ -76,6 +78,9 @@
|
|
|
76
78
|
"share.copyIframe": "Copiar el iframe",
|
|
77
79
|
"share.copyIframeHelpTitle": "Poner la página dentro de la tuya",
|
|
78
80
|
"share.copyIframeHelp": "Un fragmento de HTML para pegar donde se edita el HTML de tu página: la herramienta funciona dentro de él.",
|
|
81
|
+
"seal.refusedTitle": "Este enlace no se puede abrir",
|
|
82
|
+
"seal.refusedBody": "Se modificó después de crearse, o está incompleto, así que no se abrió nada. Pide el enlace de nuevo.",
|
|
83
|
+
"seal.openWithout": "Abrir la herramienta sin el enlace",
|
|
79
84
|
"cite.button": "Citar",
|
|
80
85
|
"cite.copyReferenceAs": "Copiar la referencia como",
|
|
81
86
|
"cite.pleaseCiteBoth": "Por favor, cite ambos trabajos",
|
package/lib/locales/fr.json
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"share.layout": "Disposition",
|
|
55
55
|
"share.embed": "Intégrer dans une autre page",
|
|
56
56
|
"share.embedHint": "Retire l'en-tête du site et sa navigation, pour que la page prenne place dans une page à vous.",
|
|
57
|
+
"share.protect": "Protéger ce lien",
|
|
58
|
+
"share.protectHint": "La classe ne peut ni lire ni modifier ce que le lien règle, et l'adresse de la page reste fixe. La page est intégrée.",
|
|
57
59
|
"share.on": "Oui",
|
|
58
60
|
"share.off": "Non",
|
|
59
61
|
"share.showOnPage": "Afficher sur la page",
|
|
@@ -76,6 +78,9 @@
|
|
|
76
78
|
"share.copyIframe": "Copier l'iframe",
|
|
77
79
|
"share.copyIframeHelpTitle": "Mettre la page dans la vôtre",
|
|
78
80
|
"share.copyIframeHelp": "Un extrait de HTML à coller là où le HTML de votre page s'édite : l'outil s'exécute alors à l'intérieur.",
|
|
81
|
+
"seal.refusedTitle": "Ce lien ne peut pas être ouvert",
|
|
82
|
+
"seal.refusedBody": "Il a été modifié après sa création, ou il est incomplet : rien n'a été ouvert. Demandez à nouveau le lien.",
|
|
83
|
+
"seal.openWithout": "Ouvrir l'outil sans ce lien",
|
|
79
84
|
"cite.button": "Citer",
|
|
80
85
|
"cite.copyReferenceAs": "Copier la référence en",
|
|
81
86
|
"cite.pleaseCiteBoth": "Merci de citer les deux travaux",
|
package/lib/locales/it.json
CHANGED
|
@@ -54,6 +54,8 @@
|
|
|
54
54
|
"share.layout": "Disposizione",
|
|
55
55
|
"share.embed": "Incorporare in un'altra pagina",
|
|
56
56
|
"share.embedHint": "Toglie l'intestazione del sito e la sua navigazione, così la pagina sta dentro una pagina propria.",
|
|
57
|
+
"share.protect": "Proteggi questo link",
|
|
58
|
+
"share.protectHint": "La classe non può né leggere né modificare ciò che il link imposta, e l'indirizzo della pagina resta fisso. La pagina viene incorporata.",
|
|
57
59
|
"share.on": "Sì",
|
|
58
60
|
"share.off": "No",
|
|
59
61
|
"share.showOnPage": "Mostra nella pagina",
|
|
@@ -76,6 +78,9 @@
|
|
|
76
78
|
"share.copyIframe": "Copia l'iframe",
|
|
77
79
|
"share.copyIframeHelpTitle": "Mettere la pagina dentro la tua",
|
|
78
80
|
"share.copyIframeHelp": "Un frammento di HTML da incollare dove si modifica l'HTML della tua pagina: lo strumento funziona al suo interno.",
|
|
81
|
+
"seal.refusedTitle": "Questo link non può essere aperto",
|
|
82
|
+
"seal.refusedBody": "È stato modificato dopo la creazione, o è incompleto, quindi non si è aperto nulla. Chiedi di nuovo il link.",
|
|
83
|
+
"seal.openWithout": "Apri lo strumento senza il link",
|
|
79
84
|
"cite.button": "Cita",
|
|
80
85
|
"cite.copyReferenceAs": "Copia il riferimento come",
|
|
81
86
|
"cite.pleaseCiteBoth": "Si prega di citare entrambi i lavori",
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* The tab router bound to the browser: read the address on screen, write a new
|
|
3
3
|
* one through the History API, and hear every move.
|
|
4
4
|
*
|
|
5
|
-
* The router itself stays pure. Everything here reads
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The router itself stays pure. Everything here reads and writes the address
|
|
6
|
+
* through `pageLocation` and `pageHistory` — the browser's, or the one a sealed
|
|
7
|
+
* link holds in memory — and does nothing where neither exists, so a prerender
|
|
8
|
+
* script can import a module that uses it.
|
|
8
9
|
*/
|
|
9
10
|
import type { TabRoute, TabRouteInput, TabRouter } from './tabRouter.ts';
|
|
10
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/router/core/history.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/router/core/history.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,SAAS,MAAM,EAC1C,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,GACrB,QAAQ,CAAC,GAAG,CAAC,CAQf;AAED,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IACtC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,GAAG,SAAS,MAAM,EAC3C,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,EACzB,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAsBR;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,SAAS,MAAM,EACjD,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,IAAI,GACvC,MAAM,IAAI,CAUZ;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAIvC"}
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
* The tab router bound to the browser: read the address on screen, write a new
|
|
3
3
|
* one through the History API, and hear every move.
|
|
4
4
|
*
|
|
5
|
-
* The router itself stays pure. Everything here reads
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The router itself stays pure. Everything here reads and writes the address
|
|
6
|
+
* through `pageLocation` and `pageHistory` — the browser's, or the one a sealed
|
|
7
|
+
* link holds in memory — and does nothing where neither exists, so a prerender
|
|
8
|
+
* script can import a module that uses it.
|
|
8
9
|
*/
|
|
9
10
|
import { EMBED_PARAM, HIDE_PARAM } from "../../share/core/config.js";
|
|
11
|
+
import { pageHistory, pageLocation } from "./pageAddress.js";
|
|
10
12
|
import { formatQueryEntries } from "./query.js";
|
|
11
13
|
/**
|
|
12
14
|
* Fired on `globalThis` after {@link writeRoute} changes the address, because
|
|
@@ -27,7 +29,7 @@ export function readRoute(router) {
|
|
|
27
29
|
const adopted = router.legacyAddress(address);
|
|
28
30
|
if (adopted === null)
|
|
29
31
|
return router.parse(address);
|
|
30
|
-
const history =
|
|
32
|
+
const history = pageHistory();
|
|
31
33
|
history?.replaceState(history.state, '', adopted);
|
|
32
34
|
globalThis.dispatchEvent?.(new Event(ROUTE_CHANGE_EVENT));
|
|
33
35
|
return router.parse(adopted);
|
|
@@ -48,8 +50,8 @@ export function readRoute(router) {
|
|
|
48
50
|
export function writeRoute(router, route, options = {}) {
|
|
49
51
|
const current = currentAddress();
|
|
50
52
|
const address = withKeptParams(router, route, current, options.keep ?? []);
|
|
51
|
-
const location =
|
|
52
|
-
const history =
|
|
53
|
+
const location = pageLocation();
|
|
54
|
+
const history = pageHistory();
|
|
53
55
|
if (location === undefined || history === undefined)
|
|
54
56
|
return address;
|
|
55
57
|
const shown = router.mode === 'hash'
|
|
@@ -91,7 +93,7 @@ export function subscribeToRoute(router, listener) {
|
|
|
91
93
|
* @returns It, or `/` where there is no browser.
|
|
92
94
|
*/
|
|
93
95
|
export function currentAddress() {
|
|
94
|
-
const location =
|
|
96
|
+
const location = pageLocation();
|
|
95
97
|
if (location === undefined)
|
|
96
98
|
return '/';
|
|
97
99
|
return `${location.pathname}${location.search}${location.hash}`;
|
|
@@ -113,10 +115,4 @@ function withKeptParams(router, route, current, keep) {
|
|
|
113
115
|
const separator = target.includes('?') ? '&' : '?';
|
|
114
116
|
return `${target}${separator}${formatQueryEntries(kept)}`;
|
|
115
117
|
}
|
|
116
|
-
function browserLocation() {
|
|
117
|
-
return globalThis.location;
|
|
118
|
-
}
|
|
119
|
-
function browserHistory() {
|
|
120
|
-
return globalThis.history;
|
|
121
|
-
}
|
|
122
118
|
//# sourceMappingURL=history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/router/core/history.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/router/core/history.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,6 +4,8 @@ export type { WriteRouteOptions } from './history.ts';
|
|
|
4
4
|
export { ROUTE_CHANGE_EVENT, readRoute, subscribeToRoute, writeRoute, } from './history.ts';
|
|
5
5
|
export type { AdoptLegacyHashOptions, LegacyHashOptions, } from './legacyHash.ts';
|
|
6
6
|
export { adoptLegacyHashAddress, pathFromLegacyHash } from './legacyHash.ts';
|
|
7
|
+
export type { PageHistory, PageLocation } from './pageAddress.ts';
|
|
8
|
+
export { holdPageAddress, isPageAddressHeld, pageHistory, pageLocation, releasePageAddress, } from './pageAddress.ts';
|
|
7
9
|
export type { QueryEntry, QueryStringOptions } from './query.ts';
|
|
8
10
|
export { firstQueryValues, formatQueryEntries, formatQueryString, parseQueryEntries, parseQueryString, } from './query.ts';
|
|
9
11
|
export type { SiteAddresses, SiteAddressesOptions } from './siteAddresses.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EACV,aAAa,EACb,QAAQ,EACR,aAAa,EACb,SAAS,EACT,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/router/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,YAAY,EACV,aAAa,EACb,QAAQ,EACR,aAAa,EACb,SAAS,EACT,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/router/core/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { trimTrailingSlash } from "./address.js";
|
|
|
2
2
|
export { basePathOf, joinBasePath, normalizeBasePath, readMountPath, stripBasePath, } from "./basePath.js";
|
|
3
3
|
export { ROUTE_CHANGE_EVENT, readRoute, subscribeToRoute, writeRoute, } from "./history.js";
|
|
4
4
|
export { adoptLegacyHashAddress, pathFromLegacyHash } from "./legacyHash.js";
|
|
5
|
+
export { holdPageAddress, isPageAddressHeld, pageHistory, pageLocation, releasePageAddress, } from "./pageAddress.js";
|
|
5
6
|
export { firstQueryValues, formatQueryEntries, formatQueryString, parseQueryEntries, parseQueryString, } from "./query.js";
|
|
6
7
|
export { createSiteAddresses } from "./siteAddresses.js";
|
|
7
8
|
export { createTabRouter } from "./tabRouter.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/router/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,UAAU,GACX,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/router/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,gBAAgB,EAChB,UAAU,GACX,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAQzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a page reads its own address and writes it back. Normally that is the
|
|
3
|
+
* browser's `location` and `history`; a page opened from a sealed link holds
|
|
4
|
+
* its address in memory instead, so the app navigates as usual while the
|
|
5
|
+
* address bar keeps showing the link that was handed out.
|
|
6
|
+
*/
|
|
7
|
+
/** The part of `window.location` a page reads its address from. */
|
|
8
|
+
export interface PageLocation {
|
|
9
|
+
/** The path of the address. */
|
|
10
|
+
readonly pathname: string;
|
|
11
|
+
/** The query string, with its leading `?` or empty. */
|
|
12
|
+
readonly search: string;
|
|
13
|
+
/** The fragment, with its leading `#` or empty. */
|
|
14
|
+
readonly hash: string;
|
|
15
|
+
}
|
|
16
|
+
/** The part of `window.history` a page writes its address through. */
|
|
17
|
+
export interface PageHistory {
|
|
18
|
+
/** The state of the current entry. */
|
|
19
|
+
readonly state: unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Add an entry.
|
|
22
|
+
* @param data - The state of the new entry.
|
|
23
|
+
* @param unused - Ignored by browsers.
|
|
24
|
+
* @param url - The new address, absolute or relative to the current one.
|
|
25
|
+
*/
|
|
26
|
+
pushState(data: unknown, unused: string, url: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Rewrite the current entry without adding one.
|
|
29
|
+
* @param data - The state to keep.
|
|
30
|
+
* @param unused - Ignored by browsers.
|
|
31
|
+
* @param url - The new address, absolute or relative to the current one.
|
|
32
|
+
*/
|
|
33
|
+
replaceState(data: unknown, unused: string, url: string): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The address the page reads: the held one when there is one, else the
|
|
37
|
+
* browser's.
|
|
38
|
+
* @returns It, or `undefined` where there is no browser.
|
|
39
|
+
*/
|
|
40
|
+
export declare function pageLocation(): PageLocation | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The history the page writes its address through: the held address when
|
|
43
|
+
* there is one, else the browser's.
|
|
44
|
+
* @returns It, or `undefined` where there is no browser.
|
|
45
|
+
*/
|
|
46
|
+
export declare function pageHistory(): PageHistory | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Hold the page's address in memory from now on. Every read through
|
|
49
|
+
* {@link pageLocation} and every write through {@link pageHistory} uses it, and
|
|
50
|
+
* the browser's address bar is never written again.
|
|
51
|
+
* @param address - The address the page opens on: path, query and fragment.
|
|
52
|
+
*/
|
|
53
|
+
export declare function holdPageAddress(address: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the page's address is held in memory.
|
|
56
|
+
* @returns True after {@link holdPageAddress}.
|
|
57
|
+
*/
|
|
58
|
+
export declare function isPageAddressHeld(): boolean;
|
|
59
|
+
/** Go back to reading and writing the browser's own address. */
|
|
60
|
+
export declare function releasePageAddress(): void;
|
|
61
|
+
//# sourceMappingURL=pageAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageAddress.d.ts","sourceRoot":"","sources":["../../../src/router/core/pageAddress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5D;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAChE;AAOD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,YAAY,GAAG,SAAS,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,WAAW,GAAG,SAAS,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED,gEAAgE;AAChE,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a page reads its own address and writes it back. Normally that is the
|
|
3
|
+
* browser's `location` and `history`; a page opened from a sealed link holds
|
|
4
|
+
* its address in memory instead, so the app navigates as usual while the
|
|
5
|
+
* address bar keeps showing the link that was handed out.
|
|
6
|
+
*/
|
|
7
|
+
// Only parses addresses relative to the held one; never fetched or shown.
|
|
8
|
+
const HELD_ORIGIN = 'https://held.invalid';
|
|
9
|
+
let held;
|
|
10
|
+
/**
|
|
11
|
+
* The address the page reads: the held one when there is one, else the
|
|
12
|
+
* browser's.
|
|
13
|
+
* @returns It, or `undefined` where there is no browser.
|
|
14
|
+
*/
|
|
15
|
+
export function pageLocation() {
|
|
16
|
+
return held ?? globalThis.location;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The history the page writes its address through: the held address when
|
|
20
|
+
* there is one, else the browser's.
|
|
21
|
+
* @returns It, or `undefined` where there is no browser.
|
|
22
|
+
*/
|
|
23
|
+
export function pageHistory() {
|
|
24
|
+
return held ?? globalThis.history;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Hold the page's address in memory from now on. Every read through
|
|
28
|
+
* {@link pageLocation} and every write through {@link pageHistory} uses it, and
|
|
29
|
+
* the browser's address bar is never written again.
|
|
30
|
+
* @param address - The address the page opens on: path, query and fragment.
|
|
31
|
+
*/
|
|
32
|
+
export function holdPageAddress(address) {
|
|
33
|
+
held = new HeldAddress(address);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Whether the page's address is held in memory.
|
|
37
|
+
* @returns True after {@link holdPageAddress}.
|
|
38
|
+
*/
|
|
39
|
+
export function isPageAddressHeld() {
|
|
40
|
+
return held !== undefined;
|
|
41
|
+
}
|
|
42
|
+
/** Go back to reading and writing the browser's own address. */
|
|
43
|
+
export function releasePageAddress() {
|
|
44
|
+
held = undefined;
|
|
45
|
+
}
|
|
46
|
+
class HeldAddress {
|
|
47
|
+
pathname = '/';
|
|
48
|
+
search = '';
|
|
49
|
+
hash = '';
|
|
50
|
+
state = null;
|
|
51
|
+
constructor(address) {
|
|
52
|
+
this.go(null, address);
|
|
53
|
+
}
|
|
54
|
+
pushState(data, unused, url) {
|
|
55
|
+
this.go(data, url);
|
|
56
|
+
}
|
|
57
|
+
replaceState(data, unused, url) {
|
|
58
|
+
this.go(data, url);
|
|
59
|
+
}
|
|
60
|
+
go(data, url) {
|
|
61
|
+
const base = `${HELD_ORIGIN}${this.pathname}${this.search}${this.hash}`;
|
|
62
|
+
const next = new URL(url, base);
|
|
63
|
+
this.pathname = next.pathname;
|
|
64
|
+
this.search = next.search;
|
|
65
|
+
this.hash = next.hash;
|
|
66
|
+
this.state = data;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=pageAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pageAddress.js","sourceRoot":"","sources":["../../../src/router/core/pageAddress.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH,0EAA0E;AAC1E,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAE3C,IAAI,IAA6B,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,IAAI,UAAU,CAAC,QAAQ,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,IAAI,UAAU,CAAC,OAAO,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,KAAK,SAAS,CAAC;AAC5B,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,kBAAkB;IAChC,IAAI,GAAG,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,WAAW;IACf,QAAQ,GAAG,GAAG,CAAC;IACf,MAAM,GAAG,EAAE,CAAC;IACZ,IAAI,GAAG,EAAE,CAAC;IACV,KAAK,GAAY,IAAI,CAAC;IAEtB,YAAY,OAAe;QACzB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,SAAS,CAAC,IAAa,EAAE,MAAc,EAAE,GAAW;QAClD,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,IAAa,EAAE,MAAc,EAAE,GAAW;QACrD,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACrB,CAAC;IAEO,EAAE,CAAC,IAAa,EAAE,GAAW;QACnC,MAAM,IAAI,GAAG,GAAG,WAAW,GAAG,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACxE,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -11,6 +11,10 @@ export type { PreferenceHistory, PreferenceLocation, SyncPreferencesOptions, Url
|
|
|
11
11
|
export { applyPreferencesFromSearch, syncPreferencesWithUrl, writePreferencesToSearch, } from './preferences.ts';
|
|
12
12
|
export type { SharePreset } from './presets.ts';
|
|
13
13
|
export { applySharePreset, findSharePreset } from './presets.ts';
|
|
14
|
+
export type { SealProblem, UnsealResult } from './seal.ts';
|
|
15
|
+
export { SEAL_PARAM, sealQuery, sealShareUrl, sealedToken, unsealQuery, } from './seal.ts';
|
|
16
|
+
export type { SealedAddress } from './sealedAddress.ts';
|
|
17
|
+
export { canOpenSealedAddresses, openSealedAddress } from './sealedAddress.ts';
|
|
14
18
|
export type { EmbedCodeOptions, ShareUrlOptions } from './url.ts';
|
|
15
19
|
export { buildEmbedCode, buildShareUrl } from './url.ts';
|
|
16
20
|
export type { HideablePart, ShareParamCodecs, ShareParamValues, ShareVocabulary, } from './vocabulary.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/share/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACjE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/share/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzD,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
|
package/lib/share/core/index.js
CHANGED
|
@@ -5,5 +5,7 @@ export { SHARE_REGIONS_MESSAGE, SHARE_REGIONS_REQUEST, isShareRegionsRequest, re
|
|
|
5
5
|
export { booleanParam, enumParam, integerParam, numberParam, stringParam, } from "./params.js";
|
|
6
6
|
export { applyPreferencesFromSearch, syncPreferencesWithUrl, writePreferencesToSearch, } from "./preferences.js";
|
|
7
7
|
export { applySharePreset, findSharePreset } from "./presets.js";
|
|
8
|
+
export { SEAL_PARAM, sealQuery, sealShareUrl, sealedToken, unsealQuery, } from "./seal.js";
|
|
9
|
+
export { canOpenSealedAddresses, openSealedAddress } from "./sealedAddress.js";
|
|
8
10
|
export { buildEmbedCode, buildShareUrl } from "./url.js";
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/share/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAQtB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/share/core/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAQtB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEjE,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,WAAW,GACZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -48,12 +48,12 @@ export interface SyncPreferencesOptions {
|
|
|
48
48
|
subscribe: (listener: () => void) => () => void;
|
|
49
49
|
/**
|
|
50
50
|
* The address to read and keep up to date.
|
|
51
|
-
* @default
|
|
51
|
+
* @default pageLocation()
|
|
52
52
|
*/
|
|
53
53
|
location?: PreferenceLocation;
|
|
54
54
|
/**
|
|
55
55
|
* The history to rewrite.
|
|
56
|
-
* @default
|
|
56
|
+
* @default pageHistory()
|
|
57
57
|
*/
|
|
58
58
|
history?: PreferenceHistory;
|
|
59
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/share/core/preferences.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../../src/share/core/preferences.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK;IAClC,wFAAwF;IACxF,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B;;;OAGG;IACH,GAAG,IAAI,KAAK,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACzB;AAED,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE9E,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAChE;AAED,oDAAoD;AACpD,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,WAAW,EAAE,cAAc,CAAC;IAC5B,sGAAsG;IACtG,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,cAAc,GAC1B,MAAM,EAAE,CAWV;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,cAAc,GAC1B,MAAM,CAuBR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,sBAAsB,GAC9B,MAAM,IAAI,CA0BZ"}
|