react-cheminfo 0.51.0 → 0.53.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 +135 -46
- package/lib/host/core/connectHost.d.ts +75 -0
- package/lib/host/core/connectHost.d.ts.map +1 -0
- package/lib/host/core/connectHost.js +171 -0
- package/lib/host/core/connectHost.js.map +1 -0
- package/lib/host/core/hostStructure.d.ts +52 -0
- package/lib/host/core/hostStructure.d.ts.map +1 -0
- package/lib/host/core/hostStructure.js +106 -0
- package/lib/host/core/hostStructure.js.map +1 -0
- package/lib/host/core/index.d.ts +9 -0
- package/lib/host/core/index.d.ts.map +1 -0
- package/lib/host/core/index.js +5 -0
- package/lib/host/core/index.js.map +1 -0
- package/lib/host/core/kinds.d.ts +73 -0
- package/lib/host/core/kinds.d.ts.map +1 -0
- package/lib/host/core/kinds.js +88 -0
- package/lib/host/core/kinds.js.map +1 -0
- package/lib/host/core/protocol.d.ts +134 -0
- package/lib/host/core/protocol.d.ts.map +1 -0
- package/lib/host/core/protocol.js +92 -0
- package/lib/host/core/protocol.js.map +1 -0
- package/lib/host/testing/sciPeaks.d.ts +21 -0
- package/lib/host/testing/sciPeaks.d.ts.map +1 -0
- package/lib/host/testing/sciPeaks.js +62 -0
- package/lib/host/testing/sciPeaks.js.map +1 -0
- package/lib/host/testing/standInHost.d.ts +47 -0
- package/lib/host/testing/standInHost.d.ts.map +1 -0
- package/lib/host/testing/standInHost.js +85 -0
- package/lib/host/testing/standInHost.js.map +1 -0
- package/lib/host/ui/index.d.ts +3 -0
- package/lib/host/ui/index.d.ts.map +1 -0
- package/lib/host/ui/index.js +2 -0
- package/lib/host/ui/index.js.map +1 -0
- package/lib/host/ui/useHostConnection.d.ts +36 -0
- package/lib/host/ui/useHostConnection.d.ts.map +1 -0
- package/lib/host/ui/useHostConnection.js +62 -0
- package/lib/host/ui/useHostConnection.js.map +1 -0
- package/lib/host-testing.d.ts +8 -0
- package/lib/host-testing.d.ts.map +1 -0
- package/lib/host-testing.js +7 -0
- package/lib/host-testing.js.map +1 -0
- package/lib/host.d.ts +11 -0
- package/lib/host.d.ts.map +1 -0
- package/lib/host.js +11 -0
- package/lib/host.js.map +1 -0
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- 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/package.json +4 -1
- package/src/host/core/connectHost.ts +240 -0
- package/src/host/core/hostStructure.ts +129 -0
- package/src/host/core/index.ts +46 -0
- package/src/host/core/kinds.ts +128 -0
- package/src/host/core/protocol.ts +197 -0
- package/src/host/testing/sciPeaks.ts +66 -0
- package/src/host/testing/standInHost.ts +116 -0
- package/src/host/ui/index.ts +2 -0
- package/src/host/ui/useHostConnection.ts +85 -0
- package/src/host-testing.ts +18 -0
- package/src/host.ts +11 -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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PageLocation } from '../../router/core/pageAddress.ts';
|
|
2
|
+
import type { SealProblem } from './seal.ts';
|
|
3
|
+
/** How the page was opened. */
|
|
4
|
+
export type SealedAddress = {
|
|
5
|
+
status: 'plain';
|
|
6
|
+
} | {
|
|
7
|
+
status: 'sealed';
|
|
8
|
+
} | {
|
|
9
|
+
status: 'refused';
|
|
10
|
+
problem: SealProblem;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Open the page's address before anything reads it. A plain address is left
|
|
14
|
+
* as it is. A sealed one is unsealed and held in memory, so the page reads
|
|
15
|
+
* what the token carries through `pageLocation` while the address bar keeps
|
|
16
|
+
* showing the link that was handed out, whatever the page does next.
|
|
17
|
+
*
|
|
18
|
+
* Call it once at startup, and import every module that reads the address
|
|
19
|
+
* only once it has resolved. Calling it is also what lets the share dialog
|
|
20
|
+
* offer to protect a link: a site that never opens a sealed address must not
|
|
21
|
+
* hand one out.
|
|
22
|
+
* @param location - The address the page was opened at.
|
|
23
|
+
* @returns How the page was opened; on `refused` nothing is held.
|
|
24
|
+
*/
|
|
25
|
+
export declare function openSealedAddress(location?: PageLocation | undefined): Promise<SealedAddress>;
|
|
26
|
+
/**
|
|
27
|
+
* Whether this page opens sealed links, so may hand them out.
|
|
28
|
+
* @returns True once {@link openSealedAddress} has been called.
|
|
29
|
+
*/
|
|
30
|
+
export declare function canOpenSealedAddresses(): boolean;
|
|
31
|
+
//# sourceMappingURL=sealedAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealedAddress.d.ts","sourceRoot":"","sources":["../../../src/share/core/sealedAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG7C,+BAA+B;AAC/B,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAIhD;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,GAAE,YAAY,GAAG,SAA+B,GACvD,OAAO,CAAC,aAAa,CAAC,CAUxB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { holdPageAddress } from "../../router/core/pageAddress.js";
|
|
2
|
+
import { sealedToken, unsealQuery } from "./seal.js";
|
|
3
|
+
let opensSealedAddresses = false;
|
|
4
|
+
/**
|
|
5
|
+
* Open the page's address before anything reads it. A plain address is left
|
|
6
|
+
* as it is. A sealed one is unsealed and held in memory, so the page reads
|
|
7
|
+
* what the token carries through `pageLocation` while the address bar keeps
|
|
8
|
+
* showing the link that was handed out, whatever the page does next.
|
|
9
|
+
*
|
|
10
|
+
* Call it once at startup, and import every module that reads the address
|
|
11
|
+
* only once it has resolved. Calling it is also what lets the share dialog
|
|
12
|
+
* offer to protect a link: a site that never opens a sealed address must not
|
|
13
|
+
* hand one out.
|
|
14
|
+
* @param location - The address the page was opened at.
|
|
15
|
+
* @returns How the page was opened; on `refused` nothing is held.
|
|
16
|
+
*/
|
|
17
|
+
export async function openSealedAddress(location = globalThis.location) {
|
|
18
|
+
opensSealedAddresses = true;
|
|
19
|
+
if (location === undefined)
|
|
20
|
+
return { status: 'plain' };
|
|
21
|
+
const token = sealedToken(location.search);
|
|
22
|
+
if (token === null)
|
|
23
|
+
return { status: 'plain' };
|
|
24
|
+
const result = await unsealQuery(token);
|
|
25
|
+
if (!result.ok)
|
|
26
|
+
return { status: 'refused', problem: result.problem };
|
|
27
|
+
const query = result.query === '' ? '' : `?${result.query}`;
|
|
28
|
+
holdPageAddress(`${location.pathname}${query}${location.hash}`);
|
|
29
|
+
return { status: 'sealed' };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Whether this page opens sealed links, so may hand them out.
|
|
33
|
+
* @returns True once {@link openSealedAddress} has been called.
|
|
34
|
+
*/
|
|
35
|
+
export function canOpenSealedAddresses() {
|
|
36
|
+
return opensSealedAddresses;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=sealedAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealedAddress.js","sourceRoot":"","sources":["../../../src/share/core/sealedAddress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQrD,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAEjC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,WAAqC,UAAU,CAAC,QAAQ;IAExD,oBAAoB,GAAG,IAAI,CAAC;IAC5B,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACvD,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACtE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5D,eAAe,CAAC,GAAG,QAAQ,CAAC,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAChE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export interface SealedLinkRefusedProps {
|
|
3
|
+
/**
|
|
4
|
+
* Where the tool opens without the link.
|
|
5
|
+
* @default the path the link was opened at
|
|
6
|
+
*/
|
|
7
|
+
href?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What a page shows instead of itself when its sealed link cannot be opened —
|
|
11
|
+
* edited, cut, or minted by a newer key — so it never opens something the link
|
|
12
|
+
* did not say, and never a blank page.
|
|
13
|
+
* @param props - Where the tool opens without the link.
|
|
14
|
+
* @returns The whole page.
|
|
15
|
+
*/
|
|
16
|
+
export declare function SealedLinkRefused(props: SealedLinkRefusedProps): ReactElement;
|
|
17
|
+
//# sourceMappingURL=SealedLinkRefused.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SealedLinkRefused.d.ts","sourceRoot":"","sources":["../../../src/share/ui/SealedLinkRefused.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAYzD,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,YAAY,CAc7E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AnchorButton, NonIdealState } from '@blueprintjs/core';
|
|
3
|
+
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
4
|
+
// A grid, because the card's own `height: 100%` keeps a flex row from
|
|
5
|
+
// stretching it, and it would sit at the top of the page.
|
|
6
|
+
const PAGE_STYLE = {
|
|
7
|
+
display: 'grid',
|
|
8
|
+
minHeight: '100vh',
|
|
9
|
+
placeItems: 'center',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* What a page shows instead of itself when its sealed link cannot be opened —
|
|
13
|
+
* edited, cut, or minted by a newer key — so it never opens something the link
|
|
14
|
+
* did not say, and never a blank page.
|
|
15
|
+
* @param props - Where the tool opens without the link.
|
|
16
|
+
* @returns The whole page.
|
|
17
|
+
*/
|
|
18
|
+
export function SealedLinkRefused(props) {
|
|
19
|
+
const { href = globalThis.location?.pathname ?? '/' } = props;
|
|
20
|
+
const t = useChromeT();
|
|
21
|
+
return (_jsx("div", { style: PAGE_STYLE, children: _jsx(NonIdealState, { icon: "lock", title: t('seal.refusedTitle'), description: t('seal.refusedBody'), action: _jsx(AnchorButton, { href: href, text: t('seal.openWithout') }) }) }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SealedLinkRefused.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SealedLinkRefused.js","sourceRoot":"","sources":["../../../src/share/ui/SealedLinkRefused.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,sEAAsE;AACtE,0DAA0D;AAC1D,MAAM,UAAU,GAAkB;IAChC,OAAO,EAAE,MAAM;IACf,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,QAAQ;CACrB,CAAC;AAUF;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA6B;IAC7D,MAAM,EAAE,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,QAAQ,IAAI,GAAG,EAAE,GAAG,KAAK,CAAC;IAC9D,MAAM,CAAC,GAAG,UAAU,EAAE,CAAC;IAEvB,OAAO,CACL,cAAK,KAAK,EAAE,UAAU,YACpB,KAAC,aAAa,IACZ,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,CAAC,CAAC,mBAAmB,CAAC,EAC7B,WAAW,EAAE,CAAC,CAAC,kBAAkB,CAAC,EAClC,MAAM,EAAE,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,kBAAkB,CAAC,GAAI,GACjE,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -12,13 +12,24 @@ export interface ShareConfigOptionsProps {
|
|
|
12
12
|
descriptions: SharePartDescriptions;
|
|
13
13
|
/** Called when the layout is switched. */
|
|
14
14
|
onEmbedChange: (embed: boolean) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the link is handed out sealed.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
sealed?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Called when sealing is switched. Without it the switch is not offered.
|
|
22
|
+
* @default undefined
|
|
23
|
+
*/
|
|
24
|
+
onSealedChange?: (sealed: boolean) => void;
|
|
15
25
|
/** Called with the part and whether the link should switch it off. */
|
|
16
26
|
onPartChange: (part: string, hidden: boolean) => void;
|
|
17
27
|
/** Called with the part the pointer is on, or `null` when it leaves. */
|
|
18
28
|
onPartPointed: (part: string | null) => void;
|
|
19
29
|
}
|
|
20
30
|
/**
|
|
21
|
-
* The switches of the share dialog: the layout
|
|
31
|
+
* The switches of the share dialog: the layout — embedded, and sealed where the
|
|
32
|
+
* site opens sealed links — then one per part of the page.
|
|
22
33
|
* @param props - The draft's layout and parts, and how to change them.
|
|
23
34
|
* @returns The two sections.
|
|
24
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareConfigOptions.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareConfigOptions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAKhE,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,wCAAwC;IACxC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,sDAAsD;IACtD,YAAY,EAAE,qBAAqB,CAAC;IACpC,0CAA0C;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,sEAAsE;IACtE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,wEAAwE;IACxE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C;AAED
|
|
1
|
+
{"version":3,"file":"ShareConfigOptions.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareConfigOptions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAKhE,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,+EAA+E;IAC/E,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,wCAAwC;IACxC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,sDAAsD;IACtD,YAAY,EAAE,qBAAqB,CAAC;IACpC,0CAA0C;IAC1C,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,sEAAsE;IACtE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,wEAAwE;IACxE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAC7B,YAAY,CAkDd"}
|
|
@@ -5,13 +5,14 @@ import { SharePartOptions } from "./SharePartOptions.js";
|
|
|
5
5
|
import { SharePartRow } from "./SharePartRow.js";
|
|
6
6
|
const SECTION_STYLE = { marginBottom: 14 };
|
|
7
7
|
/**
|
|
8
|
-
* The switches of the share dialog: the layout
|
|
8
|
+
* The switches of the share dialog: the layout — embedded, and sealed where the
|
|
9
|
+
* site opens sealed links — then one per part of the page.
|
|
9
10
|
* @param props - The draft's layout and parts, and how to change them.
|
|
10
11
|
* @returns The two sections.
|
|
11
12
|
*/
|
|
12
13
|
export function ShareConfigOptions(props) {
|
|
13
|
-
const { embed, parts, hidden, descriptions, onEmbedChange, onPartChange, onPartPointed, } = props;
|
|
14
|
+
const { embed, parts, hidden, descriptions, onEmbedChange, sealed = false, onSealedChange, onPartChange, onPartPointed, } = props;
|
|
14
15
|
const t = useChromeT();
|
|
15
|
-
return (_jsxs(_Fragment, { children: [_jsxs("section", { className: "share-section", style: SECTION_STYLE, children: [_jsx(H6, { children: t('share.layout') }), _jsx(SharePartRow, { label: t('share.embed'), description: t('share.embedHint'), on: embed, descriptions: descriptions, onChange: onEmbedChange })] }), parts.length > 0 ? (_jsxs("section", { className: "share-section", style: SECTION_STYLE, children: [_jsx(H6, { children: t('share.showOnPage') }), _jsx(SharePartOptions, { parts: parts, hidden: hidden, descriptions: descriptions, onChange: onPartChange, onPointed: onPartPointed })] })) : null] }));
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsxs("section", { className: "share-section", style: SECTION_STYLE, children: [_jsx(H6, { children: t('share.layout') }), _jsx(SharePartRow, { label: t('share.embed'), description: t('share.embedHint'), on: embed, descriptions: descriptions, onChange: onEmbedChange }), onSealedChange === undefined ? null : (_jsx(SharePartRow, { label: t('share.protect'), description: t('share.protectHint'), on: sealed, descriptions: descriptions, onChange: onSealedChange }))] }), parts.length > 0 ? (_jsxs("section", { className: "share-section", style: SECTION_STYLE, children: [_jsx(H6, { children: t('share.showOnPage') }), _jsx(SharePartOptions, { parts: parts, hidden: hidden, descriptions: descriptions, onChange: onPartChange, onPointed: onPartPointed })] })) : null] }));
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=ShareConfigOptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareConfigOptions.js","sourceRoot":"","sources":["../../../src/share/ui/ShareConfigOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAwB,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,MAAM,aAAa,GAAkB,EAAE,YAA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M,GAAG,CAAC,CAAC,CAAC,CAAC,CAClB,mBAAS,SAAS,EAAC,eAAe,EAAC,KAAK,EAAE,aAAa,aACrD,KAAC,EAAE,cAAE,CAAC,CAAC,kBAAkB,CAAC,GAAM,EAChC,KAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,GACxB,IACM,CACX,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareDialogContent.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareDialogContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAGV,gBAAgB,EAIjB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ShareDialogContent.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareDialogContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAIzD,OAAO,KAAK,EAGV,gBAAgB,EAIjB,MAAM,kBAAkB,CAAC;AAc1B,OAAO,KAAK,EAAE,gBAAgB,EAAc,MAAM,mBAAmB,CAAC;AAetE,gFAAgF;AAChF,MAAM,MAAM,uBAAuB,CACjC,MAAM,SAAS,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IACrD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,SAAS,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACvD,KAAK,EAAE,uBAAuB,CAAC,MAAM,CAAC,GAAG,YAAY,CAoJtD"}
|
|
@@ -2,13 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { DialogFooter } from '@blueprintjs/core';
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import { useContainerSize } from "../../hooks/ui/useContainerSize.js";
|
|
5
|
-
import { applySharePreset, buildEmbedCode, buildShareUrl, findSharePreset, isShareConfigured, parseShareConfig, suggestedShareConfig, visibleShareParts, } from "../core/index.js";
|
|
5
|
+
import { applySharePreset, buildEmbedCode, buildShareUrl, canOpenSealedAddresses, findSharePreset, isShareConfigured, parseShareConfig, suggestedShareConfig, visibleShareParts, } from "../core/index.js";
|
|
6
6
|
import { ShareConfigOptions } from "./ShareConfigOptions.js";
|
|
7
7
|
import { ShareLinkBar } from "./ShareLinkBar.js";
|
|
8
8
|
import { SharePanes } from "./SharePanes.js";
|
|
9
9
|
import { SharePresetTabs } from "./SharePresetTabs.js";
|
|
10
10
|
import { SharePreview } from "./SharePreview.js";
|
|
11
11
|
import { withPart } from "./draft.js";
|
|
12
|
+
import { useSealedUrl } from "./useSealedUrl.js";
|
|
12
13
|
const NO_PRESETS = [];
|
|
13
14
|
/** Width below which the two panes stop fitting side by side and become tabs. */
|
|
14
15
|
const TWO_PANE_WIDTH = 720;
|
|
@@ -26,6 +27,7 @@ export function ShareDialogContent(props) {
|
|
|
26
27
|
const base = baseUrl ?? address?.href ?? '';
|
|
27
28
|
const query = search ?? address?.search ?? '';
|
|
28
29
|
const [config, setConfig] = useState(() => initialDraft(query, vocabulary, findPreset(presets, defaultPreset ?? null)));
|
|
30
|
+
const [sealed, setSealed] = useState(false);
|
|
29
31
|
const [pointed, setPointed] = useState(null);
|
|
30
32
|
const [presetKey, setPresetKey] = useState(() => findSharePreset(config, presets, vocabulary)?.key ?? null);
|
|
31
33
|
const body = useRef(null);
|
|
@@ -36,6 +38,8 @@ export function ShareDialogContent(props) {
|
|
|
36
38
|
const narrow = width > 0 && width < TWO_PANE_WIDTH;
|
|
37
39
|
function setEmbed(embed) {
|
|
38
40
|
setConfig((previous) => ({ ...previous, embed }));
|
|
41
|
+
// A sealed page is always embedded, so leaving the frame drops the seal.
|
|
42
|
+
setSealed((previous) => previous && embed);
|
|
39
43
|
}
|
|
40
44
|
function setPartHidden(part, hidden) {
|
|
41
45
|
setConfig((previous) => ({
|
|
@@ -62,17 +66,27 @@ export function ShareDialogContent(props) {
|
|
|
62
66
|
setPartHidden,
|
|
63
67
|
setParam,
|
|
64
68
|
};
|
|
65
|
-
const
|
|
69
|
+
const shown = embeddedWhenSealed(config, sealed);
|
|
70
|
+
const url = buildShareUrl({ base, search: query, config: shown, vocabulary });
|
|
71
|
+
const { link, ready } = useSealedUrl(url, sealed);
|
|
66
72
|
const frame = buildEmbedCode({
|
|
67
|
-
url,
|
|
73
|
+
url: link,
|
|
68
74
|
title: frameTitle ?? title,
|
|
69
75
|
height: frameHeight,
|
|
70
76
|
});
|
|
71
|
-
const options = (_jsx(ShareConfigOptions, { embed:
|
|
77
|
+
const options = (_jsx(ShareConfigOptions, { embed: shown.embed, parts: visibleShareParts(vocabulary.parts, shown.embed), hidden: config.hidden, descriptions: partDescriptions, onEmbedChange: setEmbed, sealed: sealed, onSealedChange: offeredWhenOpened(setSealed), onPartChange: setPartHidden, onPartPointed: setPointed }));
|
|
72
78
|
const openPreset = findPreset(presets, presetKey);
|
|
73
79
|
const optionsPane = (_jsxs("div", { className: "share-dialog__options", children: [openPreset === undefined ? (options) : (_jsx("p", { className: "share-dialog__preset", children: openPreset.description })), children === undefined ? null : (_jsx("section", { className: "share-section", style: SECTION_STYLE, children: typeof children === 'function' ? children(draft) : children }))] }));
|
|
74
|
-
const previewPane = preview ? (_jsx(SharePreview, { url:
|
|
75
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "share-dialog__body", ref: body, children: [presets.length === 0 ? null : (_jsx("div", { className: "share-dialog__top", children: _jsx(SharePresetTabs, { presets: presets, selected: presetKey, onSelect: selectPreset }) })), _jsx(SharePanes, { options: optionsPane, preview: previewPane, narrow: narrow })] }), _jsx(DialogFooter, { actions: _jsx(ShareLinkBar, { url:
|
|
80
|
+
const previewPane = preview ? (_jsx(SharePreview, { url: link, title: frameTitle ?? title, highlight: highlightOf(vocabulary.parts, pointed) })) : null;
|
|
81
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "share-dialog__body", ref: body, children: [presets.length === 0 ? null : (_jsx("div", { className: "share-dialog__top", children: _jsx(SharePresetTabs, { presets: presets, selected: presetKey, onSelect: selectPreset }) })), _jsx(SharePanes, { options: optionsPane, preview: previewPane, narrow: narrow })] }), _jsx(DialogFooter, { actions: _jsx(ShareLinkBar, { url: link, frame: frame, disabled: !ready, onCopied: onClose }) })] }));
|
|
82
|
+
}
|
|
83
|
+
// A sealed page is always embedded, whatever a preset said.
|
|
84
|
+
function embeddedWhenSealed(config, sealed) {
|
|
85
|
+
return sealed ? { ...config, embed: true } : config;
|
|
86
|
+
}
|
|
87
|
+
// A site that never opens a sealed address must not hand one out.
|
|
88
|
+
function offeredWhenOpened(setSealed) {
|
|
89
|
+
return canOpenSealedAddresses() ? setSealed : undefined;
|
|
76
90
|
}
|
|
77
91
|
function initialDraft(search, vocabulary, preset) {
|
|
78
92
|
const current = parseShareConfig(search, vocabulary);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareDialogContent.js","sourceRoot":"","sources":["../../../src/share/ui/ShareDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAStE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,kBAAkB,CA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IACrD,IAAI,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC;QAAE,OAAO,OAAO,CAAC;IAC3D,MAAM,SAAS,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACnD,OAAO,MAAM,KAAK,SAAS;QACzB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AACtD,CAAC;AAED,0EAA0E;AAC1E,4EAA4E;AAC5E,8BAA8B;AAC9B,SAAS,WAAW,CAClB,KAA8B,EAC9B,OAAsB;IAEtB,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO;YAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACzE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,UAAU,CACjB,OAA2C,EAC3C,GAAkB;IAElB,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACnC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,GAAG,KAAK,GAAG;YAAE,OAAO,MAAM,CAAC;IACxC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -9,6 +9,11 @@ export interface ShareLinkBarProps {
|
|
|
9
9
|
* @default undefined
|
|
10
10
|
*/
|
|
11
11
|
onCopied?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the link is not ready to hand out yet, as while it is being sealed.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* The three things one does with a share link, in the dialog's footer and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareLinkBar.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareLinkBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ShareLinkBar.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareLinkBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAoDnE"}
|
|
@@ -17,17 +17,17 @@ import { useChromeT } from "../../i18n/ui/useT.js";
|
|
|
17
17
|
* @returns The bar.
|
|
18
18
|
*/
|
|
19
19
|
export function ShareLinkBar(props) {
|
|
20
|
-
const { url, frame, onCopied } = props;
|
|
20
|
+
const { url, frame, onCopied, disabled = false } = props;
|
|
21
21
|
const t = useChromeT();
|
|
22
22
|
return (_jsxs("div", { className: "share-linkbar", children: [_jsx(HelpTooltip, { content: {
|
|
23
23
|
title: t('share.copyLinkHelpTitle'),
|
|
24
24
|
body: t('share.copyLinkHelp'),
|
|
25
|
-
}, children: _jsx(CopyButton, { content: url, label: t('share.copyLink'), title: "", onCopied: onCopied }) }), _jsx(HelpTooltip, { content: {
|
|
25
|
+
}, children: _jsx(CopyButton, { content: url, label: t('share.copyLink'), title: "", disabled: disabled, onCopied: onCopied }) }), _jsx(HelpTooltip, { content: {
|
|
26
26
|
title: t('share.openInNewTabHelpTitle'),
|
|
27
27
|
body: t('share.openInNewTabHelp'),
|
|
28
|
-
}, children: _jsx(AnchorButton, { icon: "share", text: t('share.openInNewTab'), href: url, target: "_blank", rel: "noopener noreferrer" }) }), _jsx(HelpTooltip, { content: {
|
|
28
|
+
}, children: _jsx(AnchorButton, { icon: "share", text: t('share.openInNewTab'), href: url, disabled: disabled, target: "_blank", rel: "noopener noreferrer" }) }), _jsx(HelpTooltip, { content: {
|
|
29
29
|
title: t('share.copyIframeHelpTitle'),
|
|
30
30
|
body: t('share.copyIframeHelp'),
|
|
31
|
-
}, children: _jsx(CopyButton, { content: frame, icon: "code", label: t('share.copyIframe'), title: "", onCopied: onCopied }) })] }));
|
|
31
|
+
}, children: _jsx(CopyButton, { content: frame, icon: "code", label: t('share.copyIframe'), title: "", disabled: disabled, onCopied: onCopied }) })] }));
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=ShareLinkBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareLinkBar.js","sourceRoot":"","sources":["../../../src/share/ui/ShareLinkBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ShareLinkBar.js","sourceRoot":"","sources":["../../../src/share/ui/ShareLinkBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC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,EAAC,EAAE,EACR,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,GAClB,GACU,IACV,CACP,CAAC;AACJ,CAAC"}
|
package/lib/share/ui/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { HiddenPartsProvider } from './HiddenPartsProvider.tsx';
|
|
|
3
3
|
export { useIsHidden } from './hiddenParts.ts';
|
|
4
4
|
export type { PagePartProps } from './PagePart.tsx';
|
|
5
5
|
export { PagePart } from './PagePart.tsx';
|
|
6
|
+
export type { SealedLinkRefusedProps } from './SealedLinkRefused.tsx';
|
|
7
|
+
export { SealedLinkRefused } from './SealedLinkRefused.tsx';
|
|
6
8
|
export type { ShareButtonProps, ShareButtonVariant } from './ShareButton.tsx';
|
|
7
9
|
export { ShareButton } from './ShareButton.tsx';
|
|
8
10
|
export type { ShareDialogProps } from './ShareDialog.tsx';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/share/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/share/ui/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/lib/share/ui/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { HiddenPartsProvider } from "./HiddenPartsProvider.js";
|
|
2
2
|
export { useIsHidden } from "./hiddenParts.js";
|
|
3
3
|
export { PagePart } from "./PagePart.js";
|
|
4
|
+
export { SealedLinkRefused } from "./SealedLinkRefused.js";
|
|
4
5
|
export { ShareButton } from "./ShareButton.js";
|
|
5
6
|
export { ShareDialog } from "./ShareDialog.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/share/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/share/ui/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAgB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAGhD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** The link the dialog hands out, and whether it may be handed out yet. */
|
|
2
|
+
export interface SealedUrl {
|
|
3
|
+
/** The link: sealed when asked and ready, else the share link itself. */
|
|
4
|
+
link: string;
|
|
5
|
+
/** False while the link is being sealed, when only the plain one exists. */
|
|
6
|
+
ready: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The link the dialog hands out: the share link itself, or its sealed form.
|
|
10
|
+
* Sealing is asynchronous, so a sealed link is not ready at once, and a link
|
|
11
|
+
* sealed for an older draft is never answered for the current one.
|
|
12
|
+
* @param url - The share link.
|
|
13
|
+
* @param sealed - Whether to hand out its sealed form.
|
|
14
|
+
* @returns The link, and whether it is ready.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useSealedUrl(url: string, sealed: boolean): SealedUrl;
|
|
17
|
+
//# sourceMappingURL=useSealedUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSealedUrl.d.ts","sourceRoot":"","sources":["../../../src/share/ui/useSealedUrl.ts"],"names":[],"mappings":"AAIA,2EAA2E;AAC3E,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,SAAS,CAmBpE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { sealShareUrl } from "../core/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* The link the dialog hands out: the share link itself, or its sealed form.
|
|
5
|
+
* Sealing is asynchronous, so a sealed link is not ready at once, and a link
|
|
6
|
+
* sealed for an older draft is never answered for the current one.
|
|
7
|
+
* @param url - The share link.
|
|
8
|
+
* @param sealed - Whether to hand out its sealed form.
|
|
9
|
+
* @returns The link, and whether it is ready.
|
|
10
|
+
*/
|
|
11
|
+
export function useSealedUrl(url, sealed) {
|
|
12
|
+
const [result, setResult] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!sealed)
|
|
15
|
+
return;
|
|
16
|
+
let current = true;
|
|
17
|
+
void sealShareUrl(url).then((to) => {
|
|
18
|
+
if (current)
|
|
19
|
+
setResult({ from: url, to });
|
|
20
|
+
});
|
|
21
|
+
return () => {
|
|
22
|
+
current = false;
|
|
23
|
+
};
|
|
24
|
+
}, [url, sealed]);
|
|
25
|
+
if (!sealed)
|
|
26
|
+
return { link: url, ready: true };
|
|
27
|
+
if (result?.from === url)
|
|
28
|
+
return { link: result.to, ready: true };
|
|
29
|
+
return { link: url, ready: false };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=useSealedUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSealedUrl.js","sourceRoot":"","sources":["../../../src/share/ui/useSealedUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUhD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,MAAe;IACvD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAClC,IAAI,CACL,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,KAAK,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE;YACjC,IAAI,OAAO;gBAAE,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACV,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IAElB,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,MAAM,EAAE,IAAI,KAAK,GAAG;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAClE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-cheminfo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React components, hooks and framework-free helpers shared by the cheminfo sites: site chrome, citations, sharing, routing, pedagogy, charts, and the structure, orbital and 3D molecule viewers",
|
|
6
6
|
"author": "Luc Patiny",
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"./build-info": "./lib/build-info.js",
|
|
19
19
|
"./conformers": "./lib/conformers.js",
|
|
20
20
|
"./core": "./lib/core.js",
|
|
21
|
+
"./host": "./lib/host.js",
|
|
22
|
+
"./host-testing": "./lib/host-testing.js",
|
|
21
23
|
"./ir": "./lib/ir.js",
|
|
22
24
|
"./molecule3d": "./lib/molecule3d.js",
|
|
23
25
|
"./molstar/*": "./lib/molstar/*/index.js",
|
|
@@ -66,6 +68,7 @@
|
|
|
66
68
|
"dependencies": {
|
|
67
69
|
"@formatjs/icu-messageformat-parser": "^3.5.20",
|
|
68
70
|
"@tanstack/react-virtual": "^3.14.13",
|
|
71
|
+
"ajv": "^8.20.0",
|
|
69
72
|
"cheminfo-font": "^1.28.0",
|
|
70
73
|
"cheminfo-types": "^1.16.0",
|
|
71
74
|
"convert-to-jcamp": "^7.0.1",
|