@unisim/sdk 0.177.0 → 0.179.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 +29 -0
- package/dist/SafeLink.d.ts +89 -0
- package/dist/SafeLink.d.ts.map +1 -0
- package/dist/SafeLink.js +301 -0
- package/dist/SafeLink.js.map +1 -0
- package/dist/UserProfile.d.ts.map +1 -1
- package/dist/UserProfile.js +8 -8
- package/dist/UserProfile.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/linkSafety.d.ts +97 -0
- package/dist/linkSafety.d.ts.map +1 -0
- package/dist/linkSafety.js +213 -0
- package/dist/linkSafety.js.map +1 -0
- package/dist/linkSafetyCopy.d.ts +32 -0
- package/dist/linkSafetyCopy.d.ts.map +1 -0
- package/dist/linkSafetyCopy.js +194 -0
- package/dist/linkSafetyCopy.js.map +1 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -600,6 +600,35 @@ re-running a decode check against zxing (`Universal_Beam/e2e/beam.e2e.ts` does).
|
|
|
600
600
|
`qr-code-styling` is a normal dependency but is imported dynamically, so it stays out of the
|
|
601
601
|
bundle — and out of any server render — of an app that never draws a code.
|
|
602
602
|
|
|
603
|
+
### Links somebody else wrote (since 0.179.0)
|
|
604
|
+
Lifted from Universal QR's scan screen so chat messages, captions and notes ask the same
|
|
605
|
+
question: is this link safe to open, and what should a careful person notice first?
|
|
606
|
+
|
|
607
|
+
- `classifyLink(href)` → `{ kind, href, host, scheme, reasons, risky }`. `kind` is `web`
|
|
608
|
+
(http/https), `contact` (mailto/tel/sms), `blocked` (every other scheme — allow-list, not
|
|
609
|
+
block-list) or `invalid`. `host` is what the address bar will show: after any `user@`,
|
|
610
|
+
punycode for an IDN host. `reasons` (in this order): `http`, `userinfo`
|
|
611
|
+
(`trusted.com@evil.example`), `lookalike` (an `xn--` label), `ip` (any IPv4 spelling, or
|
|
612
|
+
v6), `shortener`, `dangerous-scheme`. Only `web`/`contact` ever carry an `href`.
|
|
613
|
+
- `linkifyText(text)` → `[{ text }, { text, href }, …]`. Only `http(s)://` and `www.` become
|
|
614
|
+
links (so a typed `javascript:` stays text by construction); punctuation that ends the
|
|
615
|
+
sentence stays outside; the segments' text joins back to the input exactly.
|
|
616
|
+
- `<SafeLink href={anything}>` — a safe link opens like a plain `<a target="_blank"
|
|
617
|
+
rel="noopener noreferrer nofollow ugc">`; a risky one opens a dialog naming the real host
|
|
618
|
+
and the reasons (Cancel focused, **Open anyway**); a blocked one gets no `href` at all and
|
|
619
|
+
explains itself when pressed.
|
|
620
|
+
- `<LinkifiedText text={body} />` — inline, no wrapper: drop it into the `<p>` that held the
|
|
621
|
+
text. `linkClassName` / `linkStyle` style the links.
|
|
622
|
+
- `useLinkGuard()` → `{ onClick, open, dialog }`: `onClick` on an `<a>` or as
|
|
623
|
+
`onClickCapture` on a container of markup you didn't render; `open(href)` from code; render
|
|
624
|
+
`dialog` once. Same-origin and relative links pass untouched.
|
|
625
|
+
- All of them take `language` (default: the provider's, then English (GB) — so they work with
|
|
626
|
+
no `<UniversalProvider>`), `theme` (`'light' | 'dark'`) and `onOpen(href, target)` to open
|
|
627
|
+
through something other than a synthetic `<a>` click. Words: `linkSafetyCopy(lang)` /
|
|
628
|
+
`linkReasonText(reason, lang, { host, scheme })`, in all nine languages.
|
|
629
|
+
- The pure half imports nothing and is also published as **`@unisim/sdk/link-safety`**, so a
|
|
630
|
+
Node test can load it without React. `npm run test:link-safety`, `npm run test:safe-link`.
|
|
631
|
+
|
|
603
632
|
## Where the session is stored
|
|
604
633
|
|
|
605
634
|
`UniversalProvider` picks the store for the platform it is running on — you do
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type CSSProperties, type MouseEvent as ReactMouseEvent, type ReactNode } from 'react';
|
|
2
|
+
import { type MenuTheme } from './menuTheme.js';
|
|
3
|
+
import { type LinkVerdict } from './linkSafety.js';
|
|
4
|
+
export interface LinkGuardOptions {
|
|
5
|
+
/** The dialog's language. Defaults to the provider's, then English (GB). */
|
|
6
|
+
language?: string | null;
|
|
7
|
+
/** The dialog's colourway. Default `'light'`. */
|
|
8
|
+
theme?: MenuTheme;
|
|
9
|
+
/**
|
|
10
|
+
* Opens a link once the guard is satisfied, instead of the default (a
|
|
11
|
+
* synthetic click on an `<a>` with the same target and
|
|
12
|
+
* `rel="noopener noreferrer"`) — e.g. a native shell's in-app browser.
|
|
13
|
+
*/
|
|
14
|
+
onOpen?: (href: string, target: string) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface LinkGuard {
|
|
17
|
+
/**
|
|
18
|
+
* A click handler for an `<a>`, or for a CONTAINER of links (use it as
|
|
19
|
+
* `onClickCapture` to guard markup you didn't render, like Markdown). It
|
|
20
|
+
* finds the `<a href>` that was clicked, lets safe and in-app links through
|
|
21
|
+
* untouched, and stops a risky or blocked one to ask first.
|
|
22
|
+
*/
|
|
23
|
+
onClick: (event: ReactMouseEvent<HTMLElement>) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Open `href` from code: straight away when it is safe, after the dialog
|
|
26
|
+
* when it is risky, never when it is blocked (the dialog says why). Returns
|
|
27
|
+
* the verdict, so the caller can tell which happened.
|
|
28
|
+
*/
|
|
29
|
+
open: (href: string, target?: string) => LinkVerdict;
|
|
30
|
+
/** Render this once, anywhere; it portals to `document.body` while open. */
|
|
31
|
+
dialog: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Guard any links: wire `onClick` to them (or to their container) and render
|
|
35
|
+
* `dialog` once.
|
|
36
|
+
*
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const guard = useLinkGuard({ theme: 'dark' })
|
|
39
|
+
* return <div onClickCapture={guard.onClick}>{markdown}{guard.dialog}</div>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function useLinkGuard(options?: LinkGuardOptions): LinkGuard;
|
|
43
|
+
export interface LinkSafetyDialogProps {
|
|
44
|
+
verdict: LinkVerdict;
|
|
45
|
+
/** What was clicked, verbatim — shown for a blocked link, which has no href. */
|
|
46
|
+
raw?: string;
|
|
47
|
+
language?: string | null;
|
|
48
|
+
theme?: MenuTheme;
|
|
49
|
+
onCancel: () => void;
|
|
50
|
+
/** Only offered for a `web` verdict; a blocked one has Close alone. */
|
|
51
|
+
onOpen: () => void;
|
|
52
|
+
}
|
|
53
|
+
/** The dialog itself, for an app that runs its own flow around it. */
|
|
54
|
+
export declare function LinkSafetyDialog({ verdict, raw, language, theme, onCancel, onOpen }: LinkSafetyDialogProps): import("react").ReactPortal | null;
|
|
55
|
+
export interface SafeLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
56
|
+
/** Anything — a typed URL, a stored note, a scanned code. It is classified, not trusted. */
|
|
57
|
+
href: string;
|
|
58
|
+
language?: string | null;
|
|
59
|
+
theme?: MenuTheme;
|
|
60
|
+
onOpen?: (href: string, target: string) => void;
|
|
61
|
+
/** Defaults to `href` as given. */
|
|
62
|
+
children?: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* An `<a>` for a link somebody else wrote. A safe web link opens in a new tab
|
|
66
|
+
* (`rel="noopener noreferrer nofollow ugc"`); a risky one asks first; a
|
|
67
|
+
* blocked scheme is never given an `href` at all — it renders as link-styled
|
|
68
|
+
* text that explains itself when pressed.
|
|
69
|
+
*/
|
|
70
|
+
export declare function SafeLink({ href, language, theme, onOpen, target, rel, children, onClick, ...rest }: SafeLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export interface LinkifiedTextProps {
|
|
72
|
+
/** Plain text as typed. Only http(s):// and www. become links. */
|
|
73
|
+
text: string;
|
|
74
|
+
language?: string | null;
|
|
75
|
+
theme?: MenuTheme;
|
|
76
|
+
onOpen?: (href: string, target: string) => void;
|
|
77
|
+
/** Class for each link. Without this or `linkStyle`, links are underlined in the text's own colour. */
|
|
78
|
+
linkClassName?: string;
|
|
79
|
+
linkStyle?: CSSProperties;
|
|
80
|
+
/** Default `_blank`. */
|
|
81
|
+
target?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Plain text with its web links made clickable and guarded — for chat
|
|
85
|
+
* messages, captions, comments and notes. Renders inline (fragments, no
|
|
86
|
+
* wrapper), so it drops into the `<p>` that held the text before.
|
|
87
|
+
*/
|
|
88
|
+
export declare function LinkifiedText({ text, language, theme, onOpen, linkClassName, linkStyle, target }: LinkifiedTextProps): import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
//# sourceMappingURL=SafeLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SafeLink.d.ts","sourceRoot":"","sources":["../src/SafeLink.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAElB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAId,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EAAuC,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAiBvF,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,iDAAiD;IACjD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAChD;AAED,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,IAAI,CAAA;IACtD;;;;OAIG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,WAA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,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,uGAAuG;IACvG,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,MAAiB,EAAE,EAAE,kBAAkB,2CA4B/H"}
|
package/dist/SafeLink.js
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Fragment, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
import { NAV_OVERLAY_Z_INDEX } from './DropdownSurface.js';
|
|
6
|
+
import { DEFAULT_LANGUAGE } from './i18n.js';
|
|
7
|
+
import { MENU } from './menuTheme.js';
|
|
8
|
+
import { useOptionalLanguage } from './provider.js';
|
|
9
|
+
import { classifyLink, linkifyText, schemeOf } from './linkSafety.js';
|
|
10
|
+
import { linkSafetyCopy } from './linkSafetyCopy.js';
|
|
11
|
+
const UGC_REL = 'noopener noreferrer nofollow ugc';
|
|
12
|
+
function openDirectly(href, target) {
|
|
13
|
+
// An <a> click rather than window.open: it is what the original link would
|
|
14
|
+
// have done, it honours the same target, and in a native shell it takes the
|
|
15
|
+
// same route out to the system browser as every other link in the app.
|
|
16
|
+
const a = document.createElement('a');
|
|
17
|
+
a.href = href;
|
|
18
|
+
a.target = target;
|
|
19
|
+
a.rel = 'noopener noreferrer';
|
|
20
|
+
a.style.display = 'none';
|
|
21
|
+
document.body.appendChild(a);
|
|
22
|
+
a.click();
|
|
23
|
+
a.remove();
|
|
24
|
+
}
|
|
25
|
+
function sameOrigin(href) {
|
|
26
|
+
try {
|
|
27
|
+
return typeof location !== 'undefined' && new URL(href).origin === location.origin;
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/** True when the guard has nothing to say about this verdict. */
|
|
34
|
+
function passes(verdict) {
|
|
35
|
+
if (verdict.kind === 'contact')
|
|
36
|
+
return true;
|
|
37
|
+
if (verdict.kind !== 'web' || !verdict.href)
|
|
38
|
+
return false;
|
|
39
|
+
// The app's own pages are not a stranger's link — a dev server on
|
|
40
|
+
// http://localhost must not warn about itself — unless they hide behind `@`.
|
|
41
|
+
if (sameOrigin(verdict.href) && !verdict.reasons.includes('userinfo'))
|
|
42
|
+
return true;
|
|
43
|
+
return !verdict.risky;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Guard any links: wire `onClick` to them (or to their container) and render
|
|
47
|
+
* `dialog` once.
|
|
48
|
+
*
|
|
49
|
+
* ```tsx
|
|
50
|
+
* const guard = useLinkGuard({ theme: 'dark' })
|
|
51
|
+
* return <div onClickCapture={guard.onClick}>{markdown}{guard.dialog}</div>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export function useLinkGuard(options = {}) {
|
|
55
|
+
const { language: chosen, theme = 'light', onOpen } = options;
|
|
56
|
+
const providerLang = useOptionalLanguage();
|
|
57
|
+
const language = chosen ?? providerLang ?? DEFAULT_LANGUAGE;
|
|
58
|
+
const [pending, setPending] = useState(null);
|
|
59
|
+
const onOpenRef = useRef(onOpen);
|
|
60
|
+
onOpenRef.current = onOpen;
|
|
61
|
+
// Where focus goes back to when the dialog closes: the link that opened it.
|
|
62
|
+
const returnFocus = useRef(null);
|
|
63
|
+
const go = useCallback((href, target) => {
|
|
64
|
+
if (onOpenRef.current)
|
|
65
|
+
onOpenRef.current(href, target);
|
|
66
|
+
else
|
|
67
|
+
openDirectly(href, target);
|
|
68
|
+
}, []);
|
|
69
|
+
const ask = useCallback((p) => {
|
|
70
|
+
returnFocus.current = typeof document !== 'undefined' ? document.activeElement : null;
|
|
71
|
+
setPending(p);
|
|
72
|
+
}, []);
|
|
73
|
+
const open = useCallback((href, target = '_blank') => {
|
|
74
|
+
const verdict = classifyLink(href);
|
|
75
|
+
if (passes(verdict) && verdict.href)
|
|
76
|
+
go(verdict.href, target);
|
|
77
|
+
else if (verdict.kind === 'web' || verdict.kind === 'blocked')
|
|
78
|
+
ask({ verdict, raw: href, target });
|
|
79
|
+
return verdict;
|
|
80
|
+
}, [ask, go]);
|
|
81
|
+
const onClick = useCallback((event) => {
|
|
82
|
+
if (event.defaultPrevented)
|
|
83
|
+
return;
|
|
84
|
+
const start = event.target;
|
|
85
|
+
const a = start?.closest?.('a');
|
|
86
|
+
if (!a || !event.currentTarget.contains(a))
|
|
87
|
+
return;
|
|
88
|
+
const raw = a.getAttribute('href');
|
|
89
|
+
// No href, `#top`, `/settings`, `?tab=2`: the app's own navigation.
|
|
90
|
+
if (raw === null || !schemeOf(raw))
|
|
91
|
+
return;
|
|
92
|
+
const verdict = classifyLink(raw);
|
|
93
|
+
if (passes(verdict))
|
|
94
|
+
return;
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
if (verdict.kind === 'web' || verdict.kind === 'blocked') {
|
|
97
|
+
ask({ verdict, raw, target: a.target || '_self' });
|
|
98
|
+
}
|
|
99
|
+
}, [ask]);
|
|
100
|
+
const close = useCallback(() => {
|
|
101
|
+
setPending(null);
|
|
102
|
+
const el = returnFocus.current;
|
|
103
|
+
returnFocus.current = null;
|
|
104
|
+
if (el && typeof el.focus === 'function' && el.isConnected)
|
|
105
|
+
el.focus();
|
|
106
|
+
}, []);
|
|
107
|
+
const dialog = pending ? (_jsx(LinkSafetyDialog, { verdict: pending.verdict, raw: pending.raw, language: language, theme: theme, onCancel: close, onOpen: () => {
|
|
108
|
+
const { verdict, target } = pending;
|
|
109
|
+
close();
|
|
110
|
+
if (verdict.kind === 'web' && verdict.href)
|
|
111
|
+
go(verdict.href, target);
|
|
112
|
+
} })) : null;
|
|
113
|
+
return { onClick, open, dialog };
|
|
114
|
+
}
|
|
115
|
+
/** The dialog itself, for an app that runs its own flow around it. */
|
|
116
|
+
export function LinkSafetyDialog({ verdict, raw, language, theme = 'light', onCancel, onOpen }) {
|
|
117
|
+
const providerLang = useOptionalLanguage();
|
|
118
|
+
const copy = linkSafetyCopy(language ?? providerLang ?? DEFAULT_LANGUAGE);
|
|
119
|
+
const p = MENU[theme];
|
|
120
|
+
const blocked = verdict.kind !== 'web';
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
function onKey(e) {
|
|
123
|
+
if (e.key !== 'Escape')
|
|
124
|
+
return;
|
|
125
|
+
e.stopPropagation();
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
onCancel();
|
|
128
|
+
}
|
|
129
|
+
document.addEventListener('keydown', onKey, true);
|
|
130
|
+
return () => document.removeEventListener('keydown', onKey, true);
|
|
131
|
+
}, [onCancel]);
|
|
132
|
+
if (typeof document === 'undefined')
|
|
133
|
+
return null;
|
|
134
|
+
const shownHost = blocked ? `${verdict.scheme}:` : verdict.host;
|
|
135
|
+
const full = verdict.href ?? raw ?? '';
|
|
136
|
+
// A `data:` URL can be megabytes; the first few hundred characters say enough.
|
|
137
|
+
const fullShown = full.length > 400 ? `${full.slice(0, 400)}…` : full;
|
|
138
|
+
return createPortal(_jsx("div", { style: overlayStyle, role: "presentation", onClick: (e) => {
|
|
139
|
+
if (e.target === e.currentTarget)
|
|
140
|
+
onCancel();
|
|
141
|
+
}, children: _jsxs("div", { role: "alertdialog", "aria-modal": "true", "aria-labelledby": "unisim-link-safety-title", "aria-describedby": "unisim-link-safety-reasons", "data-testid": "unisim-link-safety-dialog", "data-link-kind": verdict.kind, style: cardStyle(p), children: [_jsx("h2", { id: "unisim-link-safety-title", style: titleStyle(blocked ? p.danger : p.text), children: blocked ? copy.titleBlocked : copy.titleRisky }), _jsxs("div", { style: scrollStyle, children: [_jsx("div", { style: labelStyle(p), children: copy.goesTo }), _jsx("div", { "data-testid": "unisim-link-safety-host", style: hostStyle(p), children: shownHost }), _jsx("ul", { id: "unisim-link-safety-reasons", style: listStyle(p), children: verdict.reasons.map((r) => (_jsx("li", { "data-reason": r, style: { marginTop: 6 }, children: copy.reasons[r].replace('{host}', verdict.host).replace('{scheme}', verdict.scheme) }, r))) }), fullShown && fullShown !== shownHost ? (_jsxs(_Fragment, { children: [_jsx("div", { style: labelStyle(p), children: copy.fullAddress }), _jsx("div", { "data-testid": "unisim-link-safety-full", style: fullStyle(p), children: fullShown })] })) : null] }), _jsx("div", { style: buttonRowStyle, children: blocked ? (_jsx("button", { type: "button", onClick: onCancel, autoFocus: true, style: primaryButtonStyle(p), children: copy.close })) : (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: onCancel, autoFocus: true, style: primaryButtonStyle(p), children: copy.cancel }), _jsx("button", { type: "button", onClick: onOpen, style: secondaryButtonStyle(p), children: copy.openAnyway })] })) })] }) }), document.body);
|
|
142
|
+
}
|
|
143
|
+
function mergeRel(rel) {
|
|
144
|
+
const parts = new Set(`${rel ?? ''} ${UGC_REL}`.split(/\s+/).filter(Boolean));
|
|
145
|
+
return [...parts].join(' ');
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* An `<a>` for a link somebody else wrote. A safe web link opens in a new tab
|
|
149
|
+
* (`rel="noopener noreferrer nofollow ugc"`); a risky one asks first; a
|
|
150
|
+
* blocked scheme is never given an `href` at all — it renders as link-styled
|
|
151
|
+
* text that explains itself when pressed.
|
|
152
|
+
*/
|
|
153
|
+
export function SafeLink({ href, language, theme, onOpen, target, rel, children, onClick, ...rest }) {
|
|
154
|
+
const verdict = useMemo(() => classifyLink(href), [href]);
|
|
155
|
+
const guard = useLinkGuard({ language, theme, onOpen });
|
|
156
|
+
const providerLang = useOptionalLanguage();
|
|
157
|
+
const content = children ?? href;
|
|
158
|
+
if (!verdict.href) {
|
|
159
|
+
if (verdict.kind !== 'blocked') {
|
|
160
|
+
return _jsx("span", { id: rest.id, className: rest.className, style: rest.style, title: rest.title, children: content });
|
|
161
|
+
}
|
|
162
|
+
const label = linkSafetyCopy(language ?? providerLang ?? DEFAULT_LANGUAGE).blockedLinkLabel.replace('{scheme}', verdict.scheme);
|
|
163
|
+
return (_jsxs(_Fragment, { children: [_jsx("a", { ...rest, role: "link", tabIndex: 0, "aria-label": label, "data-unisim-link": "blocked", style: { cursor: 'pointer', ...rest.style }, onClick: (e) => {
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
guard.open(href);
|
|
166
|
+
}, onKeyDown: (e) => {
|
|
167
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
168
|
+
e.preventDefault();
|
|
169
|
+
guard.open(href);
|
|
170
|
+
}
|
|
171
|
+
}, children: content }), guard.dialog] }));
|
|
172
|
+
}
|
|
173
|
+
const web = verdict.kind === 'web';
|
|
174
|
+
return (_jsxs(_Fragment, { children: [_jsx("a", { ...rest, href: verdict.href, target: web ? (target ?? '_blank') : target, rel: web ? mergeRel(rel) : rel, "data-unisim-link": verdict.risky ? 'risky' : 'safe', onClick: (e) => {
|
|
175
|
+
onClick?.(e);
|
|
176
|
+
guard.onClick(e);
|
|
177
|
+
}, children: content }), guard.dialog] }));
|
|
178
|
+
}
|
|
179
|
+
const DEFAULT_LINK_STYLE = { color: 'inherit', textDecoration: 'underline', textUnderlineOffset: 2 };
|
|
180
|
+
/**
|
|
181
|
+
* Plain text with its web links made clickable and guarded — for chat
|
|
182
|
+
* messages, captions, comments and notes. Renders inline (fragments, no
|
|
183
|
+
* wrapper), so it drops into the `<p>` that held the text before.
|
|
184
|
+
*/
|
|
185
|
+
export function LinkifiedText({ text, language, theme, onOpen, linkClassName, linkStyle, target = '_blank' }) {
|
|
186
|
+
const segments = useMemo(() => linkifyText(text), [text]);
|
|
187
|
+
const guard = useLinkGuard({ language, theme, onOpen });
|
|
188
|
+
if (!segments.some((s) => s.href))
|
|
189
|
+
return _jsx(_Fragment, { children: text });
|
|
190
|
+
const style = linkClassName || linkStyle ? linkStyle : DEFAULT_LINK_STYLE;
|
|
191
|
+
return (_jsxs(_Fragment, { children: [segments.map((s, i) => s.href ? (_jsx("a", { href: s.href, target: target, rel: UGC_REL, className: linkClassName, style: style, "data-unisim-link": classifyLink(s.href).risky ? 'risky' : 'safe', onClick: guard.onClick, children: s.text }, i)) : (_jsx(Fragment, { children: s.text }, i))), guard.dialog] }));
|
|
192
|
+
}
|
|
193
|
+
const overlayStyle = {
|
|
194
|
+
position: 'fixed',
|
|
195
|
+
inset: 0,
|
|
196
|
+
background: 'rgba(15, 23, 42, 0.5)',
|
|
197
|
+
display: 'flex',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
justifyContent: 'center',
|
|
200
|
+
padding: 'max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom))',
|
|
201
|
+
boxSizing: 'border-box',
|
|
202
|
+
zIndex: NAV_OVERLAY_Z_INDEX + 100,
|
|
203
|
+
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif",
|
|
204
|
+
textAlign: 'left',
|
|
205
|
+
};
|
|
206
|
+
const cardStyle = (p) => ({
|
|
207
|
+
width: '100%',
|
|
208
|
+
maxWidth: 420,
|
|
209
|
+
maxHeight: '100%',
|
|
210
|
+
display: 'flex',
|
|
211
|
+
flexDirection: 'column',
|
|
212
|
+
background: p.surface,
|
|
213
|
+
color: p.text,
|
|
214
|
+
borderRadius: 16,
|
|
215
|
+
border: `1px solid ${p.border}`,
|
|
216
|
+
boxShadow: p.shadow,
|
|
217
|
+
padding: '22px 22px 18px',
|
|
218
|
+
boxSizing: 'border-box',
|
|
219
|
+
});
|
|
220
|
+
const scrollStyle = {
|
|
221
|
+
minHeight: 0,
|
|
222
|
+
flex: 1,
|
|
223
|
+
overflowY: 'auto',
|
|
224
|
+
margin: '0 -22px',
|
|
225
|
+
padding: '0 22px',
|
|
226
|
+
};
|
|
227
|
+
const titleStyle = (color) => ({
|
|
228
|
+
margin: 0,
|
|
229
|
+
fontSize: 18,
|
|
230
|
+
fontWeight: 700,
|
|
231
|
+
letterSpacing: '-0.01em',
|
|
232
|
+
lineHeight: 1.3,
|
|
233
|
+
color,
|
|
234
|
+
flexShrink: 0,
|
|
235
|
+
});
|
|
236
|
+
const labelStyle = (p) => ({
|
|
237
|
+
margin: '14px 0 4px',
|
|
238
|
+
fontSize: 11.5,
|
|
239
|
+
fontWeight: 700,
|
|
240
|
+
letterSpacing: '0.04em',
|
|
241
|
+
textTransform: 'uppercase',
|
|
242
|
+
color: p.muted,
|
|
243
|
+
});
|
|
244
|
+
// The host is the one thing to read, so it is the biggest thing on the card.
|
|
245
|
+
const hostStyle = (p) => ({
|
|
246
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
|
|
247
|
+
fontSize: 17,
|
|
248
|
+
fontWeight: 700,
|
|
249
|
+
color: p.text,
|
|
250
|
+
wordBreak: 'break-all',
|
|
251
|
+
lineHeight: 1.35,
|
|
252
|
+
});
|
|
253
|
+
const listStyle = (p) => ({
|
|
254
|
+
margin: '12px 0 0',
|
|
255
|
+
paddingLeft: 18,
|
|
256
|
+
fontSize: 14,
|
|
257
|
+
lineHeight: 1.5,
|
|
258
|
+
color: p.body,
|
|
259
|
+
});
|
|
260
|
+
const fullStyle = (p) => ({
|
|
261
|
+
fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace',
|
|
262
|
+
fontSize: 12.5,
|
|
263
|
+
lineHeight: 1.45,
|
|
264
|
+
color: p.muted,
|
|
265
|
+
wordBreak: 'break-all',
|
|
266
|
+
maxHeight: '6.5em',
|
|
267
|
+
overflowY: 'auto',
|
|
268
|
+
});
|
|
269
|
+
const buttonRowStyle = {
|
|
270
|
+
display: 'flex',
|
|
271
|
+
flexWrap: 'wrap',
|
|
272
|
+
justifyContent: 'flex-end',
|
|
273
|
+
gap: 8,
|
|
274
|
+
marginTop: 18,
|
|
275
|
+
flexShrink: 0,
|
|
276
|
+
};
|
|
277
|
+
// The panel's text and surface colours swapped: the strongest pair the palette
|
|
278
|
+
// has, in either theme. The safe answer gets the solid button.
|
|
279
|
+
const primaryButtonStyle = (p) => ({
|
|
280
|
+
padding: '10px 16px',
|
|
281
|
+
minHeight: 44,
|
|
282
|
+
borderRadius: 10,
|
|
283
|
+
border: 0,
|
|
284
|
+
background: p.text,
|
|
285
|
+
color: p.surface,
|
|
286
|
+
fontSize: 14,
|
|
287
|
+
fontWeight: 600,
|
|
288
|
+
cursor: 'pointer',
|
|
289
|
+
});
|
|
290
|
+
const secondaryButtonStyle = (p) => ({
|
|
291
|
+
padding: '10px 16px',
|
|
292
|
+
minHeight: 44,
|
|
293
|
+
borderRadius: 10,
|
|
294
|
+
border: `1px solid ${p.border}`,
|
|
295
|
+
background: 'transparent',
|
|
296
|
+
color: p.body,
|
|
297
|
+
fontSize: 14,
|
|
298
|
+
fontWeight: 600,
|
|
299
|
+
cursor: 'pointer',
|
|
300
|
+
});
|
|
301
|
+
//# sourceMappingURL=SafeLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SafeLink.js","sourceRoot":"","sources":["../src/SafeLink.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAMT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAkB,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAA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B,KAAK,EACL,SAAS,GACV,EAAE,gBAAgB,2CAwxBlB;AAMD,MAAM,WAAW,kBAAkB;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAiB,EACjB,IAAS,EACT,KAAe,GAChB,EAAE,kBAAkB,2CAgCpB;AA6QD,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,QAAc,CAAA;AAE9C,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,MAAM,CAAA;AAEzC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAKrC,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,QACiB,CAAA"}
|
package/dist/UserProfile.js
CHANGED
|
@@ -228,11 +228,11 @@ export function UserProfile({ name, email, photoUrl, initials, profileHref = 'ht
|
|
|
228
228
|
// nothing an app loaded for the account it left can leak into the one it
|
|
229
229
|
// arrived at.
|
|
230
230
|
//
|
|
231
|
-
//
|
|
232
|
-
//
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
//
|
|
231
|
+
// In the account panel, under Global Tuning (James, 2026-10-04: "put switch
|
|
232
|
+
// to and view as guest inside clicking the enterprise (under global
|
|
233
|
+
// tuning)"). This reverses 0.172.0, which lifted them into the list
|
|
234
|
+
// under the header because James could not find them in the panel
|
|
235
|
+
// (2026-10-01) — he has since asked for the list to be the app's.
|
|
236
236
|
const startAddAccount = async () => {
|
|
237
237
|
await accountSwitch.beginAdd();
|
|
238
238
|
setAddAccountOpen(true);
|
|
@@ -295,7 +295,7 @@ export function UserProfile({ name, email, photoUrl, initials, profileHref = 'ht
|
|
|
295
295
|
// in place under the header (see `accountInline`). AccountLimits is only an
|
|
296
296
|
// element here; it mounts, and queries Supabase, when the panel does.
|
|
297
297
|
const accountLabel = name ?? email ?? t(language, 'limits.title');
|
|
298
|
-
const accountPanelContent = (_jsxs(_Fragment, { children: [limitsEnabled && _jsx(AccountLimits, { language: language, theme: theme }), limitsEnabled && _jsx(Divider, { theme: theme }), profileRow, methodsRow, globalPrefsRow, signOutRow && (_jsxs(_Fragment, { children: [_jsx(Divider, { theme: theme }), signOutRow] }))] }));
|
|
298
|
+
const accountPanelContent = (_jsxs(_Fragment, { children: [limitsEnabled && _jsx(AccountLimits, { language: language, theme: theme }), limitsEnabled && _jsx(Divider, { theme: theme }), profileRow, methodsRow, globalPrefsRow, (switchRow || guestRow) && (_jsxs(_Fragment, { children: [_jsx(Divider, { theme: theme }), switchRow, guestRow] })), signOutRow && (_jsxs(_Fragment, { children: [_jsx(Divider, { theme: theme }), signOutRow] }))] }));
|
|
299
299
|
// A divider under the app's rows only when a plain row follows it — `extras`
|
|
300
300
|
// and a list-level sign-out bring their own, so two would otherwise stack.
|
|
301
301
|
// ⚠️ Asked of the rows, not assumed: 0.143.0 made this `!accountPanelEnabled`
|
|
@@ -334,7 +334,7 @@ export function UserProfile({ name, email, photoUrl, initials, profileHref = 'ht
|
|
|
334
334
|
setAccountInline(!r || (r.left < need && window.innerWidth - r.right < need));
|
|
335
335
|
setLimitsSeen(true);
|
|
336
336
|
setLimitsOpen((v) => !v);
|
|
337
|
-
}, style: headerButtonStyle(theme, limitsOpen), onMouseEnter: headerHoverIn(theme), onMouseLeave: headerHoverOut(theme, limitsOpen), children: [_jsxs("span", { style: { minWidth: 0, flex: 1 }, children: [identityRows, _jsx("span", { style: limitsHintStyle(theme), children: t(language, limitsEnabled ? 'limits.title' : 'profile.label') })] }), _jsx(IconChevronRight, { down: accountTakesOver })] })), showHeader && accountInline && limitsOpen && (
|
|
337
|
+
}, style: headerButtonStyle(theme, limitsOpen), onMouseEnter: headerHoverIn(theme), onMouseLeave: headerHoverOut(theme, limitsOpen), children: [_jsxs("span", { style: { minWidth: 0, flex: 1 }, children: [identityRows, _jsx("span", { style: limitsHintStyle(theme), children: t(language, limitsEnabled ? 'limits.title' : 'profile.label') })] }), _jsx(IconChevronRight, { down: accountTakesOver })] })), showHeader && accountInline && limitsOpen && (_jsx("div", { role: "group", "aria-label": accountLabel, style: accountInlineStyle(theme), children: accountPanelContent })), showHeader && limitsSeen && !accountInline && (_jsx(DropdownSurface, { open: limitsOpen, anchorRef: headerRef, placement: "side",
|
|
338
338
|
// The profile menu lives in the right-hand nav cluster, so the room
|
|
339
339
|
// is on its left. `side` is a preference — DropdownSurface flips it
|
|
340
340
|
// when the panel doesn't fit, which is what a narrow window does.
|
|
@@ -342,7 +342,7 @@ export function UserProfile({ name, email, photoUrl, initials, profileHref = 'ht
|
|
|
342
342
|
// The surface is a plain container; the labelled group is the div
|
|
343
343
|
// inside it, which is the element that can carry the accessible
|
|
344
344
|
// name. The rows inside keep role="menuitem", like the list's.
|
|
345
|
-
role: "none", surfaceStyle: limitsSurfaceStyle(theme), onMouseEnter: hoverOpen, onMouseLeave: hoverClose, onRequestClose: () => setLimitsOpen(false), children: _jsx("div", { ref: limitsRef, role: "group", "aria-label": accountLabel, children: accountPanelContent }) })),
|
|
345
|
+
role: "none", surfaceStyle: limitsSurfaceStyle(theme), onMouseEnter: hoverOpen, onMouseLeave: hoverClose, onRequestClose: () => setLimitsOpen(false), children: _jsx("div", { ref: limitsRef, role: "group", "aria-label": accountLabel, children: accountPanelContent }) })), showSignIn && (
|
|
346
346
|
// Guest / anonymous: the way in comes first, for the same reason the
|
|
347
347
|
// identity does for a signed-in user — it is the first thing the
|
|
348
348
|
// menu should answer. Stays an <a> (not a button) so middle-click /
|