react-cheminfo 0.128.0 → 0.130.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.
Files changed (71) hide show
  1. package/README.md +79 -43
  2. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  3. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  4. package/lib/locales/de.json +9 -0
  5. package/lib/locales/en.json +9 -0
  6. package/lib/locales/es.json +9 -0
  7. package/lib/locales/fr.json +9 -0
  8. package/lib/locales/it.json +9 -0
  9. package/lib/mass/ui/MassChart.d.ts.map +1 -1
  10. package/lib/mass/ui/MassChart.js +4 -2
  11. package/lib/mass/ui/MassChart.js.map +1 -1
  12. package/lib/mass/ui/PeakLabels.d.ts +9 -3
  13. package/lib/mass/ui/PeakLabels.d.ts.map +1 -1
  14. package/lib/mass/ui/PeakLabels.js +38 -15
  15. package/lib/mass/ui/PeakLabels.js.map +1 -1
  16. package/lib/mass/ui/massChartProps.d.ts +8 -0
  17. package/lib/mass/ui/massChartProps.d.ts.map +1 -1
  18. package/lib/share/core/exampleMark.d.ts +31 -0
  19. package/lib/share/core/exampleMark.d.ts.map +1 -0
  20. package/lib/share/core/exampleMark.js +31 -0
  21. package/lib/share/core/exampleMark.js.map +1 -0
  22. package/lib/share/core/index.d.ts +5 -0
  23. package/lib/share/core/index.d.ts.map +1 -1
  24. package/lib/share/core/index.js +3 -0
  25. package/lib/share/core/index.js.map +1 -1
  26. package/lib/share/core/linkBytes.d.ts +29 -0
  27. package/lib/share/core/linkBytes.d.ts.map +1 -0
  28. package/lib/share/core/linkBytes.js +70 -0
  29. package/lib/share/core/linkBytes.js.map +1 -0
  30. package/lib/share/core/linkValue.d.ts +34 -0
  31. package/lib/share/core/linkValue.d.ts.map +1 -0
  32. package/lib/share/core/linkValue.js +58 -0
  33. package/lib/share/core/linkValue.js.map +1 -0
  34. package/lib/share/core/opensOn.d.ts +133 -0
  35. package/lib/share/core/opensOn.d.ts.map +1 -0
  36. package/lib/share/core/opensOn.js +82 -0
  37. package/lib/share/core/opensOn.js.map +1 -0
  38. package/lib/share/core/seal.d.ts.map +1 -1
  39. package/lib/share/core/seal.js +3 -32
  40. package/lib/share/core/seal.js.map +1 -1
  41. package/lib/share/ui/ShareOpensOn.d.ts +32 -0
  42. package/lib/share/ui/ShareOpensOn.d.ts.map +1 -0
  43. package/lib/share/ui/ShareOpensOn.js +49 -0
  44. package/lib/share/ui/ShareOpensOn.js.map +1 -0
  45. package/lib/share/ui/index.d.ts +4 -0
  46. package/lib/share/ui/index.d.ts.map +1 -1
  47. package/lib/share/ui/index.js +2 -0
  48. package/lib/share/ui/index.js.map +1 -1
  49. package/lib/share/ui/useOpensOnShare.d.ts +65 -0
  50. package/lib/share/ui/useOpensOnShare.d.ts.map +1 -0
  51. package/lib/share/ui/useOpensOnShare.js +60 -0
  52. package/lib/share/ui/useOpensOnShare.js.map +1 -0
  53. package/package.json +1 -1
  54. package/src/locales/de.json +9 -0
  55. package/src/locales/en.json +9 -0
  56. package/src/locales/es.json +9 -0
  57. package/src/locales/fr.json +9 -0
  58. package/src/locales/it.json +9 -0
  59. package/src/mass/ui/MassChart.tsx +4 -0
  60. package/src/mass/ui/PeakLabels.tsx +50 -18
  61. package/src/mass/ui/massChartProps.ts +8 -0
  62. package/src/share/core/exampleMark.ts +52 -0
  63. package/src/share/core/index.ts +25 -0
  64. package/src/share/core/linkBytes.ts +75 -0
  65. package/src/share/core/linkValue.ts +66 -0
  66. package/src/share/core/opensOn.ts +203 -0
  67. package/src/share/core/seal.ts +3 -36
  68. package/src/share/ui/ShareOpensOn.tsx +169 -0
  69. package/src/share/ui/index.ts +7 -0
  70. package/src/share/ui/useOpensOnShare.tsx +152 -0
  71. package/styles/chrome.css +18 -0
@@ -0,0 +1,133 @@
1
+ /**
2
+ * What a link to a page holding a document opens on: what is on screen, one
3
+ * of the examples the site comes with, or the page alone. A site whose folder
4
+ * panel lists examples lets its Share dialog hand out any of them, so a link
5
+ * to an example can always be made, whatever is on screen.
6
+ */
7
+ import type { QueryEntry } from '../../router/core/query.ts';
8
+ /** The parameter naming the example a link opens on, on every site. */
9
+ export declare const EXAMPLE_PARAM = "example";
10
+ /** What a link opens the page on. */
11
+ export type OpensOnTarget = 'screen' | 'example' | 'none';
12
+ /** An example a link can open on, as the folder panel lists it. */
13
+ export interface ShareExample {
14
+ /** Its identifier. */
15
+ id: string;
16
+ /** Its name. */
17
+ name: string;
18
+ /**
19
+ * What it shows, in a few words.
20
+ * @default undefined — its name alone
21
+ */
22
+ description?: string;
23
+ /**
24
+ * The group the picker lists it under: its field, its family.
25
+ * @default undefined — no group
26
+ */
27
+ group?: string;
28
+ }
29
+ /** Where a link goes, beyond the parameters the page keeps. */
30
+ export interface ShareAddress {
31
+ /** The parameters it adds. */
32
+ entries: readonly QueryEntry[];
33
+ /**
34
+ * The page it opens, as a path from the origin.
35
+ * @default undefined — the page on screen
36
+ */
37
+ path?: string;
38
+ }
39
+ /** What is on screen, as a link carries it, or why it cannot. */
40
+ export type ScreenLink = ShareAddress | 'too-large';
41
+ /** How a site writes a link to an example, and to the page alone. */
42
+ export interface OpensOnAddresses {
43
+ /**
44
+ * The link to an example.
45
+ * @default `?example=<id>` on the page on screen
46
+ */
47
+ example?: (id: string) => ShareAddress;
48
+ /**
49
+ * The link to the page alone.
50
+ * @default the page on screen, with nothing added
51
+ */
52
+ alone?: ShareAddress;
53
+ }
54
+ /** What is on screen as the Share dialog opens. */
55
+ export interface ShareOnScreen {
56
+ /**
57
+ * The example the page opened on, changed since or not.
58
+ * @default null — none
59
+ */
60
+ example?: string | null;
61
+ /**
62
+ * Whether what is on screen has changed since that example opened.
63
+ * @default false
64
+ */
65
+ changed?: boolean;
66
+ /**
67
+ * What is on screen, as a link carries it.
68
+ * @default undefined — nothing is on screen, or the site writes no
69
+ * document into its links
70
+ */
71
+ screen?: ScreenLink;
72
+ }
73
+ /** What the Share dialog can hand out for the page on screen. */
74
+ export interface OpensOnLinks {
75
+ /** The page's own query string, what it opened on left out. */
76
+ search: string;
77
+ /** The example the page opened on, or `null`. */
78
+ example: string | null;
79
+ /** Whether what is on screen has changed since that example opened. */
80
+ changed: boolean;
81
+ /**
82
+ * What is on screen, as a link carries it: `undefined` when nothing is,
83
+ * and for an example still as it opened, which the link names instead.
84
+ */
85
+ screen: ScreenLink | undefined;
86
+ }
87
+ /** What the link opens on, and which example. */
88
+ export interface OpensOnChoice {
89
+ /** What the link opens the page on. */
90
+ opensOn: OpensOnTarget;
91
+ /** The example the link names when it opens on one. */
92
+ example: string;
93
+ }
94
+ /**
95
+ * What the Share dialog can hand out for the page on screen.
96
+ * @param search - The query string of the page.
97
+ * @param openedOn - The parameters naming what a page opens on, which a link
98
+ * replaces: the example, and whatever carries a document.
99
+ * @param onScreen - What is on screen.
100
+ * @returns The links.
101
+ */
102
+ export declare function opensOnLinks(search: string, openedOn: readonly string[], onScreen: ShareOnScreen): OpensOnLinks;
103
+ /**
104
+ * What the dialog opens on: the example on screen while it is as it opened,
105
+ * else what is on screen when a link can carry it, else the example it was
106
+ * changed from, else the page alone.
107
+ * @param links - What the dialog can hand out.
108
+ * @param examples - The examples a link can open on, in the order they are
109
+ * listed.
110
+ * @returns The choice.
111
+ */
112
+ export declare function defaultOpensOn(links: OpensOnLinks, examples: readonly ShareExample[]): OpensOnChoice;
113
+ /**
114
+ * The address of a link: the query string, and the page when it is not the
115
+ * page on screen.
116
+ * @param links - What the dialog can hand out.
117
+ * @param choice - What the link opens on.
118
+ * @param addresses - How the site writes a link to an example, and to the
119
+ * page alone.
120
+ * @default {} — `?example=<id>` and the page on screen
121
+ * @returns The query string, and the path or `undefined`.
122
+ */
123
+ export declare function opensOnAddress(links: OpensOnLinks, choice: OpensOnChoice, addresses?: OpensOnAddresses): {
124
+ search: string;
125
+ path: string | undefined;
126
+ };
127
+ /**
128
+ * What is on screen, when a link can carry it.
129
+ * @param screen - What is on screen, as a link carries it.
130
+ * @returns The address, or `undefined` when there is nothing a link carries.
131
+ */
132
+ export declare function carriedScreen(screen: ScreenLink | undefined): ShareAddress | undefined;
133
+ //# sourceMappingURL=opensOn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opensOn.d.ts","sourceRoot":"","sources":["../../../src/share/core/opensOn.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM7D,uEAAuE;AACvE,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,qCAAqC;AACrC,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,+DAA+D;AAC/D,MAAM,WAAW,YAAY;IAC3B,8BAA8B;IAC9B,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;AAEpD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,CAAC;IACvC;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;CAChC;AAED,iDAAiD;AACjD,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,OAAO,EAAE,aAAa,CAAC;IACvB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,QAAQ,EAAE,aAAa,GACtB,YAAY,CAYd;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,SAAS,YAAY,EAAE,GAChC,aAAa,CAQf;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,EACrB,SAAS,GAAE,gBAAqB,GAC/B;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAI9C;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,GAAG,SAAS,GAC7B,YAAY,GAAG,SAAS,CAE1B"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * What a link to a page holding a document opens on: what is on screen, one
3
+ * of the examples the site comes with, or the page alone. A site whose folder
4
+ * panel lists examples lets its Share dialog hand out any of them, so a link
5
+ * to an example can always be made, whatever is on screen.
6
+ */
7
+ import { formatQueryEntries, parseQueryEntries, } from "../../router/core/query.js";
8
+ /** The parameter naming the example a link opens on, on every site. */
9
+ export const EXAMPLE_PARAM = 'example';
10
+ /**
11
+ * What the Share dialog can hand out for the page on screen.
12
+ * @param search - The query string of the page.
13
+ * @param openedOn - The parameters naming what a page opens on, which a link
14
+ * replaces: the example, and whatever carries a document.
15
+ * @param onScreen - What is on screen.
16
+ * @returns The links.
17
+ */
18
+ export function opensOnLinks(search, openedOn, onScreen) {
19
+ const kept = parseQueryEntries(search).filter(([key]) => !openedOn.includes(key));
20
+ const example = onScreen.example ?? null;
21
+ const changed = example !== null && (onScreen.changed ?? false);
22
+ return {
23
+ search: formatQueryEntries(kept),
24
+ example,
25
+ changed,
26
+ screen: example !== null && !changed ? undefined : onScreen.screen,
27
+ };
28
+ }
29
+ /**
30
+ * What the dialog opens on: the example on screen while it is as it opened,
31
+ * else what is on screen when a link can carry it, else the example it was
32
+ * changed from, else the page alone.
33
+ * @param links - What the dialog can hand out.
34
+ * @param examples - The examples a link can open on, in the order they are
35
+ * listed.
36
+ * @returns The choice.
37
+ */
38
+ export function defaultOpensOn(links, examples) {
39
+ const listed = links.example !== null &&
40
+ examples.some((example) => example.id === links.example);
41
+ const example = listed ? (links.example ?? '') : (examples[0]?.id ?? '');
42
+ if (listed && !links.changed)
43
+ return { opensOn: 'example', example };
44
+ if (carriedScreen(links.screen))
45
+ return { opensOn: 'screen', example };
46
+ return { opensOn: listed ? 'example' : 'none', example };
47
+ }
48
+ /**
49
+ * The address of a link: the query string, and the page when it is not the
50
+ * page on screen.
51
+ * @param links - What the dialog can hand out.
52
+ * @param choice - What the link opens on.
53
+ * @param addresses - How the site writes a link to an example, and to the
54
+ * page alone.
55
+ * @default {} — `?example=<id>` and the page on screen
56
+ * @returns The query string, and the path or `undefined`.
57
+ */
58
+ export function opensOnAddress(links, choice, addresses = {}) {
59
+ const added = addressOf(links, choice, addresses);
60
+ const entries = [...parseQueryEntries(links.search), ...added.entries];
61
+ return { search: formatQueryEntries(entries), path: added.path };
62
+ }
63
+ /**
64
+ * What is on screen, when a link can carry it.
65
+ * @param screen - What is on screen, as a link carries it.
66
+ * @returns The address, or `undefined` when there is nothing a link carries.
67
+ */
68
+ export function carriedScreen(screen) {
69
+ return screen === undefined || screen === 'too-large' ? undefined : screen;
70
+ }
71
+ function addressOf(links, choice, addresses) {
72
+ const alone = addresses.alone ?? { entries: [] };
73
+ if (choice.opensOn === 'screen')
74
+ return carriedScreen(links.screen) ?? alone;
75
+ if (choice.opensOn === 'example' && choice.example !== '') {
76
+ return (addresses.example?.(choice.example) ?? {
77
+ entries: [[EXAMPLE_PARAM, choice.example]],
78
+ });
79
+ }
80
+ return alone;
81
+ }
82
+ //# sourceMappingURL=opensOn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opensOn.js","sourceRoot":"","sources":["../../../src/share/core/opensOn.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,uEAAuE;AACvE,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AA8FvC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAc,EACd,QAA2B,EAC3B,QAAuB;IAEvB,MAAM,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAC3C,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CACnC,CAAC;IACF,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC;IACzC,MAAM,OAAO,GAAG,OAAO,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC;IAChE,OAAO;QACL,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC;QAChC,OAAO;QACP,OAAO;QACP,MAAM,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM;KACnE,CAAC;AACJ,CAAC;AAED;;;;;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AO,CAAC,YAAY,CAAC,CAkCtE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS/D"}
1
+ {"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../../../src/share/core/seal.ts"],"names":[],"mappings":"AAIA,8EAA8E;AAC9E,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B,6CAA6C;AAC7C,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;AAEnE,uCAAuC;AACvC,MAAM,MAAM,YAAY,GACtB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AA0BpE;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB9D;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAkCtE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS/D"}
@@ -1,4 +1,5 @@
1
1
  import { EMBED_PARAM } from "./config.js";
2
+ import { fromBase64Url, pipeBytes, toBase64Url } from "./linkBytes.js";
2
3
  import { firstValues, parseQuery, serializeQuery } from "./query.js";
3
4
  /** The query parameter a sealed link carries, and the only one it carries. */
4
5
  export const SEAL_PARAM = 's';
@@ -27,7 +28,7 @@ const keys = new Map();
27
28
  */
28
29
  export async function sealQuery(query) {
29
30
  const plain = new TextEncoder().encode(query);
30
- const packed = await transform(plain, new CompressionStream('deflate-raw'));
31
+ const packed = await pipeBytes(plain, new CompressionStream('deflate-raw'));
31
32
  const compressed = packed.length < plain.length;
32
33
  const body = compressed ? packed : plain;
33
34
  const message = new Uint8Array(1 + body.length);
@@ -71,7 +72,7 @@ export async function unsealQuery(token) {
71
72
  const body = message.subarray(1);
72
73
  try {
73
74
  const plain = flags === COMPRESSED
74
- ? await transform(body, new DecompressionStream('deflate-raw'))
75
+ ? await pipeBytes(body, new DecompressionStream('deflate-raw'))
75
76
  : body;
76
77
  const query = new TextDecoder('utf-8', { fatal: true }).decode(plain);
77
78
  return { ok: true, query };
@@ -152,34 +153,4 @@ function sameBytes(left, right) {
152
153
  }
153
154
  return difference === 0;
154
155
  }
155
- async function transform(bytes, stream) {
156
- const source = new ReadableStream({
157
- start(controller) {
158
- controller.enqueue(bytes);
159
- controller.close();
160
- },
161
- });
162
- const output = await new Response(source.pipeThrough(stream)).arrayBuffer();
163
- return new Uint8Array(output);
164
- }
165
- function toBase64Url(bytes) {
166
- let binary = '';
167
- for (const byte of bytes)
168
- binary += String.fromCodePoint(byte);
169
- return btoa(binary)
170
- .replaceAll('+', '-')
171
- .replaceAll('/', '_')
172
- .replace(/[=]+$/, '');
173
- }
174
- function fromBase64Url(text) {
175
- if (!/^[\w-]*$/.test(text) || text.length % 4 === 1)
176
- return null;
177
- const base64 = text.replaceAll('-', '+').replaceAll('_', '/');
178
- const binary = atob(base64.padEnd(Math.ceil(base64.length / 4) * 4, '='));
179
- const bytes = new Uint8Array(binary.length);
180
- for (let index = 0; index < binary.length; index++) {
181
- bytes[index] = binary.codePointAt(index) ?? 0;
182
- }
183
- return bytes;
184
- }
185
156
  //# sourceMappingURL=seal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"seal.js","sourceRoot":"","sources":["../../../src/share/core/seal.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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AC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,UAAU,KAAK,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ import type { OpensOnChoice, OpensOnLinks, ShareExample } from '../core/opensOn.ts';
3
+ /** Props of {@link ShareOpensOn}. */
4
+ export interface ShareOpensOnProps {
5
+ /** What the dialog can hand out for the page on screen. */
6
+ links: OpensOnLinks;
7
+ /** What the link opens on. */
8
+ choice: OpensOnChoice;
9
+ /** Called with the choice the reader makes. */
10
+ onChange: (choice: OpensOnChoice) => void;
11
+ /** The examples a link can open on, in the order they are listed. */
12
+ examples: readonly ShareExample[];
13
+ /**
14
+ * What the site calls what is on screen: "This circuit", "This drawing".
15
+ * @default the chrome's own words
16
+ */
17
+ screenLabel?: string;
18
+ /**
19
+ * What a site adds under the choice: the style a link sets, say.
20
+ * @default undefined — nothing
21
+ */
22
+ children?: ReactNode;
23
+ }
24
+ /**
25
+ * The section of the Share dialog saying what the link opens on: what is on
26
+ * screen, when a link can carry it; any of the examples, whatever is on
27
+ * screen; or the page alone.
28
+ * @param props - See {@link ShareOpensOnProps}.
29
+ * @returns The section's content.
30
+ */
31
+ export declare function ShareOpensOn(props: ShareOpensOnProps): ReactElement;
32
+ //# sourceMappingURL=ShareOpensOn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShareOpensOn.d.ts","sourceRoot":"","sources":["../../../src/share/ui/ShareOpensOn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EAEZ,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,KAAK,EAAE,YAAY,CAAC;IACpB,8BAA8B;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,qEAAqE;IACrE,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAkFnE"}
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { H6, HTMLSelect, Radio } from '@blueprintjs/core';
3
+ import { useId } from 'react';
4
+ import { useChromeT } from "../../i18n/ui/useT.js";
5
+ /**
6
+ * The section of the Share dialog saying what the link opens on: what is on
7
+ * screen, when a link can carry it; any of the examples, whatever is on
8
+ * screen; or the page alone.
9
+ * @param props - See {@link ShareOpensOnProps}.
10
+ * @returns The section's content.
11
+ */
12
+ export function ShareOpensOn(props) {
13
+ const { links, choice, onChange, examples, screenLabel, children } = props;
14
+ const t = useChromeT();
15
+ const group = useId();
16
+ const select = (opensOn) => () => {
17
+ onChange({ ...choice, opensOn });
18
+ };
19
+ const tooLarge = links.screen === 'too-large';
20
+ const shown = examples.find((example) => example.id === choice.example);
21
+ const changed = links.changed && choice.example === links.example;
22
+ return (_jsxs("div", { role: "radiogroup", "aria-label": t('share.opensOn'), className: "share-opens-on", children: [_jsx(H6, { children: t('share.opensOn') }), links.screen === undefined ? null : (_jsx(Radio, { name: group, value: "screen", checked: choice.opensOn === 'screen', disabled: tooLarge, onChange: select('screen'), labelElement: _jsx(Option, { title: screenLabel ?? t('share.opensOnScreen'), note: tooLarge
23
+ ? t('share.opensOnTooLarge')
24
+ : t('share.opensOnScreenNote') }) })), examples.length === 0 ? null : (_jsxs(_Fragment, { children: [_jsx(Radio, { name: group, value: "example", checked: choice.opensOn === 'example', onChange: select('example'), label: t('share.opensOnExample') }), _jsxs("div", { className: "share-opens-on__under", children: [_jsx(HTMLSelect, { fill: true, "aria-label": t('share.opensOnExampleLabel'), value: choice.example, onChange: (event) => {
25
+ onChange({ opensOn: 'example', example: event.target.value });
26
+ }, children: _jsx(ExampleOptions, { examples: examples }) }), shown?.description ? (_jsx("span", { className: "share-opens-on__note", children: shown.description })) : null, changed ? (_jsx("span", { className: "share-opens-on__note", children: t('share.opensOnChanged') })) : null] })] })), _jsx(Radio, { name: group, value: "none", checked: choice.opensOn === 'none', onChange: select('none'), labelElement: _jsx(Option, { title: t('share.opensOnNone'), note: t('share.opensOnNoneNote') }) }), children] }));
27
+ }
28
+ // The title in a span of its own, so it is what a click on the words finds.
29
+ function Option(props) {
30
+ return (_jsxs(_Fragment, { children: [_jsx("span", { className: "share-opens-on__title", children: props.title }), _jsx("span", { className: "share-opens-on__note", children: props.note })] }));
31
+ }
32
+ // Listed under their groups when they have any, in the order they come.
33
+ function ExampleOptions(props) {
34
+ const groups = new Map();
35
+ const loose = [];
36
+ for (const example of props.examples) {
37
+ if (example.group === undefined) {
38
+ loose.push(example);
39
+ continue;
40
+ }
41
+ const group = groups.get(example.group);
42
+ if (group)
43
+ group.push(example);
44
+ else
45
+ groups.set(example.group, [example]);
46
+ }
47
+ return (_jsxs(_Fragment, { children: [loose.map((example) => (_jsx("option", { value: example.id, children: example.name }, example.id))), [...groups].map(([label, members]) => (_jsx("optgroup", { label: label, children: members.map((example) => (_jsx("option", { value: example.id, children: example.name }, example.id))) }, label)))] }));
48
+ }
49
+ //# sourceMappingURL=ShareOpensOn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShareOpensOn.js","sourceRoot":"","sources":["../../../src/share/ui/ShareOpensOn.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAA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,mBAAsB,KAAK,EAAE,KAAK,YAC/B,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CACxB,iBAAyB,KAAK,EAAE,OAAO,CAAC,EAAE,YACvC,OAAO,CAAC,IAAI,IADF,OAAO,CAAC,EAAE,CAEd,CACV,CAAC,IALW,KAAK,CAMT,CACZ,CAAC,IACD,CACJ,CAAC;AACJ,CAAC"}
@@ -9,7 +9,11 @@ export type { ShareButtonProps, ShareButtonVariant } from './ShareButton.tsx';
9
9
  export { ShareButton } from './ShareButton.tsx';
10
10
  export type { ShareDialogProps } from './ShareDialog.tsx';
11
11
  export type { SharePartDescriptions } from './SharePartRow.tsx';
12
+ export type { ShareOpensOnProps } from './ShareOpensOn.tsx';
13
+ export { ShareOpensOn } from './ShareOpensOn.tsx';
12
14
  export type { ShareQrCodeProps } from './ShareQrCode.tsx';
13
15
  export { ShareQrCode } from './ShareQrCode.tsx';
14
16
  export { ShareDialog } from './ShareDialog.tsx';
17
+ export type { OpensOnShareOptions, OpensOnShareProps, } from './useOpensOnShare.tsx';
18
+ export { useOpensOnShare } from './useOpensOnShare.tsx';
15
19
  //# sourceMappingURL=index.d.ts.map
@@ -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,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,YAAY,EAAE,gBAAgB,EAAE,kBAAkB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O,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -3,6 +3,8 @@ export { useIsHidden } from "./hiddenParts.js";
3
3
  export { PagePart } from "./PagePart.js";
4
4
  export { SealedLinkRefused } from "./SealedLinkRefused.js";
5
5
  export { ShareButton } from "./ShareButton.js";
6
+ export { ShareOpensOn } from "./ShareOpensOn.js";
6
7
  export { ShareQrCode } from "./ShareQrCode.js";
7
8
  export { ShareDialog } from "./ShareDialog.js";
9
+ export { useOpensOnShare } from "./useOpensOnShare.js";
8
10
  //# 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,iBAAiB,EAAE,MAAM,wBAAyB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,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;AAIhD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAmB,CAAC;AAKhD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAuB,CAAC"}
@@ -0,0 +1,65 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ShareAddress, ShareExample, ShareOnScreen } from '../core/opensOn.ts';
3
+ /** What {@link useOpensOnShare} is told of the page. */
4
+ export interface OpensOnShareOptions {
5
+ /**
6
+ * Whether the page holding the document is the page on show. Any other page
7
+ * hands out its own address.
8
+ */
9
+ active: boolean;
10
+ /** The examples a link can open on, in the order the folder lists them. */
11
+ examples: readonly ShareExample[];
12
+ /**
13
+ * What is on screen, read as the dialog opens. A promise when writing it
14
+ * into a link takes a moment: the dialog then opens once it is written.
15
+ */
16
+ onScreen: () => ShareOnScreen | Promise<ShareOnScreen>;
17
+ /**
18
+ * The parameters naming what a page opens on, besides `example`, which a
19
+ * link replaces: the one carrying a document, say.
20
+ * @default [] — `example` alone
21
+ */
22
+ openedOn?: readonly string[];
23
+ /**
24
+ * The link to an example.
25
+ * @default `?example=<id>` on the page on screen
26
+ */
27
+ exampleAddress?: (id: string) => ShareAddress;
28
+ /**
29
+ * The link to the page alone.
30
+ * @default the page on screen, with nothing added
31
+ */
32
+ aloneAddress?: ShareAddress;
33
+ /**
34
+ * What the site calls what is on screen: "This circuit", "This drawing".
35
+ * @default the chrome's own words
36
+ */
37
+ screenLabel?: string;
38
+ /**
39
+ * What a site adds under the choice: the style a link sets, say.
40
+ * @default undefined — nothing
41
+ */
42
+ children?: ReactNode;
43
+ }
44
+ /** What the header's Share control is told, beyond what every page shares. */
45
+ export interface OpensOnShareProps {
46
+ /** Whether the dialog is open. */
47
+ open: boolean;
48
+ /** Called when the dialog opens or closes. */
49
+ onOpenChange: (open: boolean) => void;
50
+ /** The query string the link is built from. */
51
+ search: string | undefined;
52
+ /** The page the link opens, when it is not the page on screen. */
53
+ baseUrl: string | undefined;
54
+ /** The section saying what the link opens on. */
55
+ children: ReactNode;
56
+ }
57
+ /**
58
+ * The Share dialog of a page holding a document says what the link opens on:
59
+ * what is on screen, any of the examples the site comes with, or the page
60
+ * alone. Spread it into the header's `share` prop.
61
+ * @param options - See {@link OpensOnShareOptions}.
62
+ * @returns What the header's Share control is told.
63
+ */
64
+ export declare function useOpensOnShare(options: OpensOnShareOptions): OpensOnShareProps;
65
+ //# sourceMappingURL=useOpensOnShare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOpensOnShare.d.ts","sourceRoot":"","sources":["../../../src/share/ui/useOpensOnShare.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAGV,YAAY,EACZ,YAAY,EACZ,aAAa,EACd,MAAM,oBAAoB,CAAC;AAU5B,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC;;;OAGG;IACH,QAAQ,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACvD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,YAAY,CAAC;IAC9C;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,8CAA8C;IAC9C,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,+CAA+C;IAC/C,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kEAAkE;IAClE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,mBAAmB,GAC3B,iBAAiB,CAmEnB"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef, useState } from 'react';
3
+ import { EXAMPLE_PARAM, defaultOpensOn, opensOnAddress, opensOnLinks, } from "../core/opensOn.js";
4
+ import { ShareOpensOn } from "./ShareOpensOn.js";
5
+ /**
6
+ * The Share dialog of a page holding a document says what the link opens on:
7
+ * what is on screen, any of the examples the site comes with, or the page
8
+ * alone. Spread it into the header's `share` prop.
9
+ * @param options - See {@link OpensOnShareOptions}.
10
+ * @returns What the header's Share control is told.
11
+ */
12
+ export function useOpensOnShare(options) {
13
+ const { active, examples, onScreen, exampleAddress, aloneAddress, screenLabel, children, } = options;
14
+ const openedOn = [EXAMPLE_PARAM, ...(options.openedOn ?? [])];
15
+ const [shared, setShared] = useState(null);
16
+ const [choice, setChoice] = useState(null);
17
+ // A dialog closed before what is on screen was written stays closed.
18
+ const asked = useRef(0);
19
+ function onOpenChange(open) {
20
+ const request = ++asked.current;
21
+ if (!open) {
22
+ setShared(null);
23
+ return;
24
+ }
25
+ const { search } = globalThis.location;
26
+ if (!active) {
27
+ setShared(search);
28
+ return;
29
+ }
30
+ const show = (screen) => {
31
+ if (request !== asked.current)
32
+ return;
33
+ const links = opensOnLinks(search, openedOn, screen);
34
+ setChoice(defaultOpensOn(links, examples));
35
+ setShared(links);
36
+ };
37
+ const read = onScreen();
38
+ if (read instanceof Promise)
39
+ void read.then(show);
40
+ else
41
+ show(read);
42
+ }
43
+ const links = typeof shared === 'string' ? null : shared;
44
+ const address = links === null || choice === null
45
+ ? undefined
46
+ : opensOnAddress(links, choice, {
47
+ example: exampleAddress,
48
+ alone: aloneAddress,
49
+ });
50
+ return {
51
+ open: shared !== null,
52
+ onOpenChange,
53
+ search: typeof shared === 'string' ? shared : address?.search,
54
+ baseUrl: address?.path === undefined
55
+ ? undefined
56
+ : new URL(address.path, globalThis.location.href).href,
57
+ children: links === null || choice === null ? undefined : (_jsx(ShareOpensOn, { links: links, choice: choice, onChange: setChoice, examples: examples, screenLabel: screenLabel, children: children })),
58
+ };
59
+ }
60
+ //# sourceMappingURL=useOpensOnShare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOpensOnShare.js","sourceRoot":"","sources":["../../../src/share/ui/useOpensOnShare.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASzC,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,YAAY,GACb,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAoB,CAAC;AA0DlD;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,OAA4B;IAE5B,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,GACT,GAAG,OAAO,CAAC;IACZ,MAAM,QAAQ,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAA+B,IAAI,CAAC,CAAC;IACzE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAuB,IAAI,CAAC,CAAC;IACjE,qEAAqE;IACrE,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAExB,SAAS,YAAY,CAA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CAAC,CAAC,CAAC,OAAO,EAAE,MAAM;QAC7D,OAAO,EACL,OAAO,EAAE,IAAI,KAAK,SAAS;YACzB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI;QAC1D,QAAQ,EACN,KAAK,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAC9C,KAAC,YAAY,IACX,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,YAEvB,QAAQ,GACI,CAChB;KACJ,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-cheminfo",
3
- "version": "0.128.0",
3
+ "version": "0.130.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",
@@ -179,6 +179,15 @@
179
179
  "share.copyQrSvg": "Als SVG kopieren",
180
180
  "share.qrCodeHint": "Das PNG lässt sich überall einfügen; das SVG bleibt in jeder Größe scharf.",
181
181
  "share.qrCodeTooLong": "Dieser Link ist zu lang für einen QR-Code. Kopieren Sie stattdessen den Link.",
182
+ "share.opensOn": "Der Link öffnet",
183
+ "share.opensOnScreen": "Was auf dem Bildschirm ist",
184
+ "share.opensOnScreenNote": "Der Link enthält es vollständig, es ist also keine Datei zu senden.",
185
+ "share.opensOnTooLarge": "Zu groß für einen Link: Speichern Sie es als Datei und senden Sie die Datei.",
186
+ "share.opensOnExample": "Ein Beispiel",
187
+ "share.opensOnExampleLabel": "Beispiel",
188
+ "share.opensOnChanged": "Das Beispiel im Original: Die hier gemachten Änderungen bleiben zurück.",
189
+ "share.opensOnNone": "Nur die Seite",
190
+ "share.opensOnNoneNote": "Jeder Besucher findet dort, was er zurückgelassen hat, oder eine leere Seite.",
182
191
  "seal.refusedTitle": "Dieser Link lässt sich nicht öffnen",
183
192
  "seal.refusedBody": "Er wurde nach dem Erstellen verändert oder ist unvollständig, daher wurde nichts geöffnet. Bitten Sie erneut um den Link.",
184
193
  "seal.openWithout": "Das Werkzeug ohne den Link öffnen",