@entropy-softworks/ui 2026.8.34 → 2026.8.36
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/CHANGELOG.md +30 -0
- package/lib/components/auth/PasswordStrengthMeter.d.ts +9 -0
- package/lib/components/auth/PasswordStrengthMeter.d.ts.map +1 -1
- package/lib/components/auth/PasswordStrengthMeter.jsx +10 -4
- package/lib/components/auth/PasswordStrengthMeter.jsx.map +1 -1
- package/lib/components/profile/SecurityTab.d.ts +5 -1
- package/lib/components/profile/SecurityTab.d.ts.map +1 -1
- package/lib/components/profile/SecurityTab.jsx.map +1 -1
- package/lib/components/segmented-toggle.d.ts +9 -0
- package/lib/components/segmented-toggle.d.ts.map +1 -1
- package/lib/components/segmented-toggle.jsx +4 -0
- package/lib/components/segmented-toggle.jsx.map +1 -1
- package/lib/components/social-connections.d.ts +22 -5
- package/lib/components/social-connections.d.ts.map +1 -1
- package/lib/components/social-connections.jsx +37 -11
- package/lib/components/social-connections.jsx.map +1 -1
- package/lib/context/AppConfigContext.d.ts +27 -0
- package/lib/context/AppConfigContext.d.ts.map +1 -1
- package/lib/context/AppConfigContext.jsx.map +1 -1
- package/lib/demos/extension-popup.d.ts +212 -0
- package/lib/demos/extension-popup.d.ts.map +1 -0
- package/lib/demos/extension-popup.jsx +1172 -0
- package/lib/demos/extension-popup.jsx.map +1 -0
- package/lib/demos/index.d.ts +11 -0
- package/lib/demos/index.d.ts.map +1 -0
- package/lib/demos/index.js +14 -0
- package/lib/demos/index.js.map +1 -0
- package/lib/screens/auth/AuthScreen.d.ts +75 -1
- package/lib/screens/auth/AuthScreen.d.ts.map +1 -1
- package/lib/screens/auth/AuthScreen.jsx +356 -122
- package/lib/screens/auth/AuthScreen.jsx.map +1 -1
- package/lib/services/auth.service.d.ts +41 -1
- package/lib/services/auth.service.d.ts.map +1 -1
- package/lib/services/auth.service.js +53 -7
- package/lib/services/auth.service.js.map +1 -1
- package/package.json +7 -1
- package/src/components/auth/PasswordStrengthMeter.tsx +25 -3
- package/src/components/profile/SecurityTab.tsx +11 -1
- package/src/components/segmented-toggle.tsx +13 -0
- package/src/components/social-connections.tsx +66 -20
- package/src/context/AppConfigContext.tsx +27 -0
- package/src/demos/extension-popup.tsx +2051 -0
- package/src/demos/index.ts +38 -0
- package/src/screens/auth/AuthScreen.tsx +701 -312
- package/src/services/auth.service.ts +62 -8
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ are CalVer — `YYYY.M.D` of the publish date, with leading zeros dropped (npm's
|
|
|
7
7
|
them), matching the `entropy-auth` crate. The `0.1.0` entry below predates the switch and was never
|
|
8
8
|
published to npm.
|
|
9
9
|
|
|
10
|
+
## 2026.8.35
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- `AuthService.getCurrentUser()` destroyed the session it was asked about. It
|
|
15
|
+
returned `loadPersistedUser()` and nothing else, and on web that reads a
|
|
16
|
+
module-level variable which is null in every freshly loaded document — so it
|
|
17
|
+
answered "nobody" on each page load and refresh while the session cookie was
|
|
18
|
+
perfectly valid. `useAuth.checkAuth` treats that as a session it cannot
|
|
19
|
+
resolve and calls `logout()`, which POSTs `/auth/logout` and ends the session
|
|
20
|
+
server-side: the user was signed out by the act of loading the page.
|
|
21
|
+
|
|
22
|
+
Observed on Access, whose portal and admin console are separate SPAs on one
|
|
23
|
+
origin — so every navigation between them is a fresh document and therefore a
|
|
24
|
+
guaranteed logout, presenting as an infinite sign-in loop. Its audit log
|
|
25
|
+
recorded the logouts nobody had asked for.
|
|
26
|
+
|
|
27
|
+
Native was affected too, if less visibly: `isAuthenticated()` there is
|
|
28
|
+
satisfied by a token in SecureStore, so a token that outlived its cached user
|
|
29
|
+
record produced the same spurious logout.
|
|
30
|
+
|
|
31
|
+
`getCurrentUser()` now falls back to `GET /auth/me` when nothing is persisted.
|
|
32
|
+
It deliberately does not route through `isAuthenticated()`, whose web branch
|
|
33
|
+
falls back to calling `getCurrentUser()` — going the other way would recurse
|
|
34
|
+
until the stack gave out, on exactly the signed-out path this makes cheap.
|
|
35
|
+
The request is shared with `refreshUserData()` through a private `fetchMe`,
|
|
36
|
+
parameterised on whether a 401 should log out: a refresh of a session
|
|
37
|
+
believed live that 401s means the session died, while a lookup that 401s is
|
|
38
|
+
just an anonymous visitor and must not tear anything down.
|
|
39
|
+
|
|
10
40
|
## 2026.8.17
|
|
11
41
|
|
|
12
42
|
### Fixed
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface PasswordStrengthMeterProps {
|
|
3
3
|
password: string;
|
|
4
|
+
/**
|
|
5
|
+
* Render the (empty) meter instead of nothing while `password` is blank, so
|
|
6
|
+
* the row occupies the same height typed or not. The consolidated
|
|
7
|
+
* AuthScreen needs this: its card height is locked to the tallest mode, and
|
|
8
|
+
* a meter that appears on first keystroke would grow the card right back
|
|
9
|
+
* out. Off by default — the standalone Register/ResetPassword screens want
|
|
10
|
+
* the row gone until there is something to measure.
|
|
11
|
+
*/
|
|
12
|
+
reserveSpace?: boolean;
|
|
4
13
|
}
|
|
5
14
|
export declare function calculatePasswordStrength(pass: string): {
|
|
6
15
|
strength: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordStrengthMeter.d.ts","sourceRoot":"","sources":["../../../src/components/auth/PasswordStrengthMeter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,0BAA0B;IAClC,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PasswordStrengthMeter.d.ts","sourceRoot":"","sources":["../../../src/components/auth/PasswordStrengthMeter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,0BAA0B;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM;;;;EAqDrD;AAED,QAAA,MAAM,qBAAqB,wDA2CzB,CAAC;AAEH,eAAe,qBAAqB,CAAC"}
|
|
@@ -58,12 +58,18 @@ export function calculatePasswordStrength(pass) {
|
|
|
58
58
|
}
|
|
59
59
|
return { strength: Math.min(strength, 100), color, label };
|
|
60
60
|
}
|
|
61
|
-
const PasswordStrengthMeter = React.memo(function PasswordStrengthMeter({ password, }) {
|
|
62
|
-
if (!password) {
|
|
61
|
+
const PasswordStrengthMeter = React.memo(function PasswordStrengthMeter({ password, reserveSpace = false, }) {
|
|
62
|
+
if (!password && !reserveSpace) {
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// Blank password in reserve mode: render the same tree fully transparent, so
|
|
66
|
+
// the block holds its exact height without showing an empty gauge that reads
|
|
67
|
+
// as broken. `label`/`strength` are placeholders that are never visible.
|
|
68
|
+
const blank = !password;
|
|
69
|
+
const { strength, color, label } = blank
|
|
70
|
+
? { strength: 0, color: "#333333", label: "Weak" }
|
|
71
|
+
: calculatePasswordStrength(password);
|
|
72
|
+
return (<View className="gap-2" style={blank ? { opacity: 0 } : undefined} pointerEvents={blank ? "none" : "auto"} accessibilityElementsHidden={blank} importantForAccessibility={blank ? "no-hide-descendants" : "auto"}>
|
|
67
73
|
<View className="flex-row gap-1">
|
|
68
74
|
{[0, 1, 2, 3, 4].map((i) => {
|
|
69
75
|
const threshold = (i + 1) * 20;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordStrengthMeter.jsx","sourceRoot":"","sources":["../../../src/components/auth/PasswordStrengthMeter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"PasswordStrengthMe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C;QACJ,CAAC,CAAC,CACJ;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CAAC,SAAS,CAAC,uCAAuC,CACrD;QAAA,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,EAAE,SAAS,CACjD;QAAA,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,SAAS,CACvD;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,qBAAqB,CAAC"}
|
|
@@ -20,7 +20,11 @@ export interface SecurityTabProps {
|
|
|
20
20
|
*/
|
|
21
21
|
onComputeReWrap?: (currentPassword: string, newPassword: string) => Promise<{
|
|
22
22
|
symmetric_key_enc: string;
|
|
23
|
-
|
|
23
|
+
kdf: string;
|
|
24
|
+
kdf_salt: string;
|
|
25
|
+
kdf_iterations: number;
|
|
26
|
+
kdf_memory_kib?: number;
|
|
27
|
+
kdf_lanes?: number;
|
|
24
28
|
} | undefined>;
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityTab.d.ts","sourceRoot":"","sources":["../../../src/components/profile/SecurityTab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAehE,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAChB,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,KAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"SecurityTab.d.ts","sourceRoot":"","sources":["../../../src/components/profile/SecurityTab.tsx"],"names":[],"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AAC,CACnB,YAAY,CAAC,CAAC,cAAc,CAAC,CAC7B,WAAW,CAAC,uBAAuB,CACnC,KAAK,CAAC,qBAAqB,CAC3B,KAAK,CAAC,CAAC,QAAQ,CAAC,EAElB;cAAA,CAAC,UAAU,CAAC,CAAC,CAAC,CACZ,CAAC,IAAI,CAAC,SAAS,CAAC,gDAAgD,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,CACrF,CAAC,CAAC,CAAC,IAAI,CACR;cAAA,CAAC,MAAM,CACL,OAAO,CAAC,aAAa,CACrB,IAAI,CAAC,IAAI,CACT,SAAS,CAAC,eAAe,CACzB,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAC1B,SAAS,CAAC,CAAC,UAAU,CAAC,CAEtB;;cACF,EAAE,MAAM,CACV;YAAA,GAAG,CACJ,CAAC,CAAC,CAAC,CACF,EACE;cAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CACrE;cAAA,CAAC,MAAM,CACL,OAAO,CAAC,SAAS,CACjB,IAAI,CAAC,IAAI,CACT,SAAS,CAAC,eAAe,CACzB,OAAO,CAAC,CAAC,eAAe,CAAC,CAEzB;;cACF,EAAE,MAAM,CACV;YAAA,GAAG,CACJ,CACH;QAAA,EAAE,WAAW,CACf;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -4,6 +4,15 @@ export interface SegmentedOption<T extends string> {
|
|
|
4
4
|
label: string;
|
|
5
5
|
/** When false the segment is shown but not selectable (e.g. "coming soon"). */
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Optional glyph shown left of the label.
|
|
9
|
+
*
|
|
10
|
+
* A render function rather than a node so the icon can take the segment's
|
|
11
|
+
* current foreground colour — the same reason the label's colour is applied
|
|
12
|
+
* inline. A fixed-colour node would go invisible against the indicator on
|
|
13
|
+
* whichever of the two states it was not drawn for.
|
|
14
|
+
*/
|
|
15
|
+
icon?: (color: string) => React.ReactNode;
|
|
7
16
|
}
|
|
8
17
|
export interface SegmentedToggleProps<T extends string> {
|
|
9
18
|
value: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-toggle.d.ts","sourceRoot":"","sources":["../../src/components/segmented-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM;IAC/C,GAAG,EAAE,CAAC,CAAC;IACP,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"segmented-toggle.d.ts","sourceRoot":"","sources":["../../src/components/segmented-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM;IAC/C,GAAG,EAAE,CAAC,CAAC;IACP,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM;IACpD,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,+EAA+E;IAC/E,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,EAChD,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAgB,EAChB,SAAS,GACV,EAAE,oBAAoB,CAAC,CAAC,CAAC,qBA8EzB;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -44,10 +44,14 @@ export function SegmentedToggle({ value, options, onChange, size = "default", cl
|
|
|
44
44
|
const active = opt.key === value;
|
|
45
45
|
return (<Pressable key={opt.key} accessibilityRole="tab" accessibilityState={{ selected: active, disabled: !!opt.disabled }} disabled={opt.disabled} onPress={() => !opt.disabled && onChange(opt.key)} style={{
|
|
46
46
|
flex: 1,
|
|
47
|
+
flexDirection: "row",
|
|
47
48
|
alignItems: "center",
|
|
49
|
+
justifyContent: "center",
|
|
50
|
+
gap: opt.icon ? 7 : 0,
|
|
48
51
|
paddingVertical: vPad,
|
|
49
52
|
opacity: opt.disabled ? 0.45 : 1,
|
|
50
53
|
}}>
|
|
54
|
+
{opt.icon?.(active ? p.primaryForeground : p.mutedForeground)}
|
|
51
55
|
<Text style={{
|
|
52
56
|
fontSize,
|
|
53
57
|
fontWeight: active ? "700" : "500",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-toggle.jsx","sourceRoot":"","sources":["../../src/components/segmented-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAA0B,MAAM,cAAc,CAAC;AAC7E,OAAO,QAAQ,EAAE,EACf,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"segmented-toggle.jsx","sourceRoot":"","sources":["../../src/components/segmented-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,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|
|
5
5
|
onMicrosoft?: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* "Continue with Entropy" — the first-party identity provider.
|
|
8
|
+
*
|
|
9
|
+
* Listed first because it is the one that always works: the other three are
|
|
10
|
+
* upstream connectors configured inside Entropy Access, so they light up as
|
|
11
|
+
* that configuration lands, while this one needs nothing but the IdP itself.
|
|
12
|
+
*/
|
|
13
|
+
onEntropy?: () => void;
|
|
6
14
|
}
|
|
7
15
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
16
|
+
* Button row for federated sign-in: Entropy / Apple / Google / Microsoft.
|
|
17
|
+
*
|
|
18
|
+
* Each handler is optional — a provider with no handler still renders but fires
|
|
19
|
+
* no action, which is the "coming soon" UX the consumer apps use during a
|
|
20
|
+
* staged rollout. All four route through ONE endpoint on the server
|
|
21
|
+
* (`/api/auth/oidc/start?connector=…`); the difference between them is a hint
|
|
22
|
+
* passed to Access, not a separate flow.
|
|
23
|
+
*
|
|
24
|
+
* The buttons are icon-only, so each carries a tooltip AND an
|
|
25
|
+
* `accessibilityLabel`. The two are not redundant: the tooltip is for a sighted
|
|
26
|
+
* user hovering on web or long-pressing on native, the label is what a screen
|
|
27
|
+
* reader announces. Without the tooltip these are four unlabelled squares, and
|
|
28
|
+
* a user has to guess which mark is which.
|
|
12
29
|
*/
|
|
13
|
-
export declare function SocialConnections({ onApple, onGoogle, onMicrosoft, }: SocialConnectionsProps): React.JSX.Element;
|
|
30
|
+
export declare function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, }: SocialConnectionsProps): React.JSX.Element;
|
|
14
31
|
export default SocialConnections;
|
|
15
32
|
//# sourceMappingURL=social-connections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-connections.d.ts","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"social-connections.d.ts","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAqBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,GACV,EAAE,sBAAsB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsC5C;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,29 +2,55 @@ import React from "react";
|
|
|
2
2
|
import { Pressable, View } from "react-native";
|
|
3
3
|
import { Ionicons } from "@expo/vector-icons";
|
|
4
4
|
import { useColorScheme } from "nativewind";
|
|
5
|
+
import { EntropyMark } from "./entropy-mark";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip";
|
|
5
7
|
const PROVIDERS = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
// The real `>_` company mark, not a stand-in glyph. This is a first-party
|
|
9
|
+
// sign-in sitting next to three brand marks; anything generic reads as a
|
|
10
|
+
// placeholder rather than as an option worth picking.
|
|
11
|
+
{ key: "entropy", label: "Entropy", icon: null },
|
|
12
|
+
{ key: "apple", label: "Apple", icon: "logo-apple" },
|
|
13
|
+
{ key: "google", label: "Google", icon: "logo-google" },
|
|
14
|
+
{ key: "microsoft", label: "Microsoft", icon: "logo-microsoft" },
|
|
9
15
|
];
|
|
10
16
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
17
|
+
* Button row for federated sign-in: Entropy / Apple / Google / Microsoft.
|
|
18
|
+
*
|
|
19
|
+
* Each handler is optional — a provider with no handler still renders but fires
|
|
20
|
+
* no action, which is the "coming soon" UX the consumer apps use during a
|
|
21
|
+
* staged rollout. All four route through ONE endpoint on the server
|
|
22
|
+
* (`/api/auth/oidc/start?connector=…`); the difference between them is a hint
|
|
23
|
+
* passed to Access, not a separate flow.
|
|
24
|
+
*
|
|
25
|
+
* The buttons are icon-only, so each carries a tooltip AND an
|
|
26
|
+
* `accessibilityLabel`. The two are not redundant: the tooltip is for a sighted
|
|
27
|
+
* user hovering on web or long-pressing on native, the label is what a screen
|
|
28
|
+
* reader announces. Without the tooltip these are four unlabelled squares, and
|
|
29
|
+
* a user has to guess which mark is which.
|
|
15
30
|
*/
|
|
16
|
-
export function SocialConnections({ onApple, onGoogle, onMicrosoft, }) {
|
|
31
|
+
export function SocialConnections({ onApple, onGoogle, onMicrosoft, onEntropy, }) {
|
|
17
32
|
const { colorScheme } = useColorScheme();
|
|
18
33
|
const isDark = colorScheme === "dark";
|
|
19
34
|
const handlers = {
|
|
35
|
+
entropy: onEntropy,
|
|
20
36
|
apple: onApple,
|
|
21
37
|
google: onGoogle,
|
|
22
38
|
microsoft: onMicrosoft,
|
|
23
39
|
};
|
|
24
40
|
return (<View className="w-full flex-row items-center justify-center gap-3">
|
|
25
|
-
{PROVIDERS.map(({ key, icon }) => (<
|
|
26
|
-
<
|
|
27
|
-
|
|
41
|
+
{PROVIDERS.map(({ key, icon, label }) => (<Tooltip key={key} delayDuration={200}>
|
|
42
|
+
<TooltipTrigger asChild>
|
|
43
|
+
<Pressable onPress={handlers[key]} className="h-12 w-12 items-center justify-center rounded-lg border border-border dark:border-neutral-600 active:opacity-70" accessibilityRole="button" accessibilityLabel={`Continue with ${label}`}>
|
|
44
|
+
{icon ? (<Ionicons name={icon} size={22} color={isDark ? "#FFFFFF" : "#000000"}/>) : (
|
|
45
|
+
// driftScale 0 collapses the echo offsets onto the mark. The
|
|
46
|
+
// drift is a boot-animation effect and at 18px it just reads as
|
|
47
|
+
// a smear, which next to three crisp brand glyphs looks like a
|
|
48
|
+
// rendering fault rather than a logo.
|
|
49
|
+
<EntropyMark size={20} driftScale={0}/>)}
|
|
50
|
+
</Pressable>
|
|
51
|
+
</TooltipTrigger>
|
|
52
|
+
<TooltipContent>{`Continue with ${label}`}</TooltipContent>
|
|
53
|
+
</Tooltip>))}
|
|
28
54
|
</View>);
|
|
29
55
|
}
|
|
30
56
|
export default SocialConnections;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-connections.jsx","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"social-connections.jsx","sourceRoot":"","sources":["../../src/components/social-connections.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAyBpE,MAAM,SAAS,GAAwB;IACrC,0EAA0E;IAC1E,yEAAyE;IACzE,sDAAsD;IACtD,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE;IAChD,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,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AC,EAAG,CAC1E,CAAC,CAAC,CAAC;YACF,6DAA6D;YAC7D,gEAAgE;YAChE,+DAA+D;YAC/D,sCAAsC;YACtC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAG,CACzC,CACH;YAAA,EAAE,SAAS,CACb;UAAA,EAAE,cAAc,CAChB;UAAA,CAAC,cAAc,CAAC,CAAC,iBAAiB,KAAK,EAAE,CAAC,EAAE,cAAc,CAC5D;QAAA,EAAE,OAAO,CAAC,CACX,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -32,6 +32,17 @@ export type LogoComponent = React.ComponentType<{
|
|
|
32
32
|
*/
|
|
33
33
|
color?: string;
|
|
34
34
|
style?: StyleProp<ViewStyle> | StyleProp<ImageStyle>;
|
|
35
|
+
/**
|
|
36
|
+
* Render the mark flush to its box, without whatever internal padding it
|
|
37
|
+
* normally carries.
|
|
38
|
+
*
|
|
39
|
+
* A mark usually bakes in breathing room so it drops into arbitrary layouts
|
|
40
|
+
* safely. In a lockup that padding fights the layout instead: the caller is
|
|
41
|
+
* already controlling the gap, and the baked margin makes the mark read as
|
|
42
|
+
* smaller than the text it is supposed to match. Logos that have no internal
|
|
43
|
+
* padding can ignore this.
|
|
44
|
+
*/
|
|
45
|
+
bleed?: boolean;
|
|
35
46
|
}>;
|
|
36
47
|
export interface AppConfig {
|
|
37
48
|
/** User-facing brand name. Renders in headings, toasts, MFA issuer, etc. */
|
|
@@ -45,6 +56,22 @@ export interface AppConfig {
|
|
|
45
56
|
* a generic "An Entropy Softworks platform".
|
|
46
57
|
*/
|
|
47
58
|
tagline?: string;
|
|
59
|
+
/**
|
|
60
|
+
* How to set the tagline against the app name. Omit for the default: stacked
|
|
61
|
+
* centred underneath, no rule.
|
|
62
|
+
*
|
|
63
|
+
* "inline" — same line, pipe-separated: `Vault | Password Manager`
|
|
64
|
+
* "ruled" — under the name, hairline rule between the two
|
|
65
|
+
* "lockup" — logo to the LEFT of the name and tagline stacked, with the
|
|
66
|
+
* mark sized to the height of those two lines together. The
|
|
67
|
+
* conventional app lockup, and the tidiest option when the
|
|
68
|
+
* tagline is a short category label.
|
|
69
|
+
*
|
|
70
|
+
* `"inline"` and `"lockup"` both need an app-name text to set against, so a
|
|
71
|
+
* `logoIsWordmark` mark — which renders alone at its natural width — falls
|
|
72
|
+
* back to `"ruled"`.
|
|
73
|
+
*/
|
|
74
|
+
taglineLayout?: "inline" | "ruled" | "lockup";
|
|
48
75
|
/**
|
|
49
76
|
* Optional terms-of-service markdown / plain text. Welcome screen and
|
|
50
77
|
* the dedicated terms screen render this. When omitted, the screens
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfigContext.d.ts","sourceRoot":"","sources":["../../src/context/AppConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/E;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,EAAE,IAAI,CAAC;IACf,cAAc,EAAE,IAAI,CAAC;IACrB,aAAa,EAAE,IAAI,CAAC;IACpB,WAAW,EAAE,IAAI,CAAC;IAClB,YAAY,EAAE,IAAI,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,cAAc,EAAE,IAAI,CAAC;IACrB,aAAa,EAAE,IAAI,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,yEAAyE;IACzE,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,MAA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;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,SAAS;IACxB,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,IAAI,EAAE,aAAa,CAAC;IACpB,yBAAyB;IACzB,MAAM,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC9C;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAGA;AAED,wBAAgB,YAAY,IAAI,SAAS,CAQxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfigContext.jsx","sourceRoot":"","sources":["../../src/context/AppConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AppConfigContext.jsx","sourceRoot":"","sources":["../../src/context/AppConfigContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAoGlE,MAAM,gBAAgB,GAAG,aAAa,CAAmB,IAAI,CAAC,CAAC;AAE/D,MAAM,UAAU,iBAAiB,CAAC,EAChC,MAAM,EACN,QAAQ,GAIT;IACC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,MAAM,GAAG,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Vault browser-extension popup, as a shared component.
|
|
3
|
+
*
|
|
4
|
+
* A faithful recreation of `clients/extension` — the real popup's routes,
|
|
5
|
+
* layout, copy, field labels, sort options and tag/folder structure — running on
|
|
6
|
+
* sample data that never leaves the device. Interactive: open an item, copy a
|
|
7
|
+
* field, reveal a TOTP, switch tabs, walk into settings.
|
|
8
|
+
*
|
|
9
|
+
* It lives HERE rather than in either consumer because both the marketing site
|
|
10
|
+
* and the Vault app show it, and two copies of a 1,000-line recreation would
|
|
11
|
+
* drift the moment the real extension changed. Same reasoning as sharing
|
|
12
|
+
* `PasswordGenerator` instead of rewriting it per app.
|
|
13
|
+
*
|
|
14
|
+
* Two things the website's original did that this deliberately does not:
|
|
15
|
+
*
|
|
16
|
+
* * **No `auto` mode.** That drove a synthetic cursor with `querySelector` and
|
|
17
|
+
* `getBoundingClientRect`, which has no meaning on native. It belongs to that
|
|
18
|
+
* page's choreography, not to the extension, so the showcase keeps it.
|
|
19
|
+
* * **No drag-and-drop in the tags tab.** It used `@dnd-kit`, which is DOM-only.
|
|
20
|
+
* The grip handles remain as affordances because removing them would change
|
|
21
|
+
* the layout this exists to reproduce, but they do not drag.
|
|
22
|
+
*
|
|
23
|
+
* Everything else is the original, moved rather than rewritten.
|
|
24
|
+
*/
|
|
25
|
+
import React from "react";
|
|
26
|
+
import { ScrollView } from "react-native";
|
|
27
|
+
/**
|
|
28
|
+
* The real popup's frame, in px.
|
|
29
|
+
*
|
|
30
|
+
* `HEIGHT` is Chrome's *maximum* for a browser action popup, not a fixed size —
|
|
31
|
+
* the real popup is as tall as it needs to be, up to this. So a host with less
|
|
32
|
+
* vertical room may render it shorter (see the `height` prop) without the thing
|
|
33
|
+
* on screen becoming a lie about what the extension looks like; the item list
|
|
34
|
+
* scrolls inside, exactly as it does at full height.
|
|
35
|
+
*/
|
|
36
|
+
export declare const EXTENSION_POPUP_WIDTH = 380;
|
|
37
|
+
export declare const EXTENSION_POPUP_HEIGHT = 600;
|
|
38
|
+
/** Below this the chrome crowds out the list and it stops reading as the popup. */
|
|
39
|
+
export declare const EXTENSION_POPUP_MIN_HEIGHT = 320;
|
|
40
|
+
export declare function useInk(): {
|
|
41
|
+
fg: string;
|
|
42
|
+
muted: string;
|
|
43
|
+
bg: string;
|
|
44
|
+
border: string;
|
|
45
|
+
secondary: string;
|
|
46
|
+
danger: string;
|
|
47
|
+
star: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function vaultVars(dark: boolean): Record<string, string>;
|
|
50
|
+
export interface Account {
|
|
51
|
+
username: string;
|
|
52
|
+
password: string;
|
|
53
|
+
totp_secret?: string;
|
|
54
|
+
notes?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface Tag {
|
|
57
|
+
name: string;
|
|
58
|
+
color: string;
|
|
59
|
+
icon?: "tag" | "circle" | "star";
|
|
60
|
+
}
|
|
61
|
+
export interface Item {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
url: string;
|
|
65
|
+
favorite: boolean;
|
|
66
|
+
tags: Tag[];
|
|
67
|
+
accounts: Account[];
|
|
68
|
+
created: string;
|
|
69
|
+
updated: string;
|
|
70
|
+
}
|
|
71
|
+
export declare const T: {
|
|
72
|
+
social: Tag;
|
|
73
|
+
shopping: Tag;
|
|
74
|
+
finance: Tag;
|
|
75
|
+
streaming: Tag;
|
|
76
|
+
gaming: Tag;
|
|
77
|
+
};
|
|
78
|
+
export declare const ITEMS: Item[];
|
|
79
|
+
export declare const SORT_OPTIONS: readonly [{
|
|
80
|
+
readonly value: "name_asc";
|
|
81
|
+
readonly label: "Name (A-Z)";
|
|
82
|
+
readonly cmp: (a: Item, b: Item) => number;
|
|
83
|
+
}, {
|
|
84
|
+
readonly value: "name_desc";
|
|
85
|
+
readonly label: "Name (Z-A)";
|
|
86
|
+
readonly cmp: (a: Item, b: Item) => number;
|
|
87
|
+
}, {
|
|
88
|
+
readonly value: "updated_newest";
|
|
89
|
+
readonly label: "Recently updated";
|
|
90
|
+
readonly cmp: (a: Item, b: Item) => number;
|
|
91
|
+
}, {
|
|
92
|
+
readonly value: "created_newest";
|
|
93
|
+
readonly label: "Newest first";
|
|
94
|
+
readonly cmp: (a: Item, b: Item) => number;
|
|
95
|
+
}, {
|
|
96
|
+
readonly value: "created_oldest";
|
|
97
|
+
readonly label: "Oldest first";
|
|
98
|
+
readonly cmp: (a: Item, b: Item) => number;
|
|
99
|
+
}];
|
|
100
|
+
export declare function host(url: string): string;
|
|
101
|
+
export declare function favicon(url: string): string;
|
|
102
|
+
export declare function ItemIcon({ url, size, radius, }: {
|
|
103
|
+
url: string;
|
|
104
|
+
size?: number;
|
|
105
|
+
radius?: number;
|
|
106
|
+
}): React.JSX.Element;
|
|
107
|
+
export declare function useCopy(): {
|
|
108
|
+
copied: string | null;
|
|
109
|
+
copy: (key: string, text: string) => void;
|
|
110
|
+
};
|
|
111
|
+
export declare function totpCode(seed: string, step: number): string;
|
|
112
|
+
export declare function useTotp(secret?: string): {
|
|
113
|
+
code: string;
|
|
114
|
+
remaining: number;
|
|
115
|
+
};
|
|
116
|
+
export declare function RingCountdown({ remaining, size, period, color, }: {
|
|
117
|
+
remaining: number;
|
|
118
|
+
size?: number;
|
|
119
|
+
period?: number;
|
|
120
|
+
color: string;
|
|
121
|
+
}): React.JSX.Element;
|
|
122
|
+
export declare function VaultItemRow({ item, ink, onPress, highlight, }: {
|
|
123
|
+
item: Item;
|
|
124
|
+
ink: ReturnType<typeof useInk>;
|
|
125
|
+
onPress: () => void;
|
|
126
|
+
highlight?: boolean;
|
|
127
|
+
}): React.JSX.Element;
|
|
128
|
+
export declare function Dropdown({ open, onToggle, label, icon, children, ink, }: {
|
|
129
|
+
open: boolean;
|
|
130
|
+
onToggle: () => void;
|
|
131
|
+
label: string;
|
|
132
|
+
icon?: React.ReactNode;
|
|
133
|
+
children: React.ReactNode;
|
|
134
|
+
ink: ReturnType<typeof useInk>;
|
|
135
|
+
}): React.JSX.Element;
|
|
136
|
+
export declare function VaultList({ ink, onOpen, items, scrollRef, highlightId, }: {
|
|
137
|
+
ink: ReturnType<typeof useInk>;
|
|
138
|
+
onOpen: (id: string) => void;
|
|
139
|
+
items?: Item[];
|
|
140
|
+
scrollRef?: React.Ref<ScrollView>;
|
|
141
|
+
highlightId?: string | null;
|
|
142
|
+
}): React.JSX.Element;
|
|
143
|
+
export declare function FieldRow({ label, value, ink, copied, copy, secret, totp, }: {
|
|
144
|
+
label: string;
|
|
145
|
+
value: string;
|
|
146
|
+
ink: ReturnType<typeof useInk>;
|
|
147
|
+
copied: string | null;
|
|
148
|
+
copy: (k: string, t: string) => void;
|
|
149
|
+
secret?: boolean;
|
|
150
|
+
totp?: ReturnType<typeof useTotp>;
|
|
151
|
+
}): React.JSX.Element;
|
|
152
|
+
export declare function ItemDetail({ item, ink, onBack, onDelete, forceCopiedLabel, scrollRef, }: {
|
|
153
|
+
item: Item;
|
|
154
|
+
ink: ReturnType<typeof useInk>;
|
|
155
|
+
onBack: () => void;
|
|
156
|
+
onDelete?: () => void;
|
|
157
|
+
forceCopiedLabel?: string | null;
|
|
158
|
+
scrollRef?: React.Ref<ScrollView>;
|
|
159
|
+
}): React.JSX.Element | null;
|
|
160
|
+
/**
|
|
161
|
+
* The mark in the popup header.
|
|
162
|
+
*
|
|
163
|
+
* Supplied by the caller rather than loaded from a path. The original pointed
|
|
164
|
+
* at `/products/vault_light.png`, which only resolves on the marketing site —
|
|
165
|
+
* a shared package cannot reach into one consumer's public directory. Falls
|
|
166
|
+
* back to the wordmark so the header is never empty.
|
|
167
|
+
*/
|
|
168
|
+
export declare function VaultMark({ logo }: {
|
|
169
|
+
logo?: React.ReactNode;
|
|
170
|
+
}): React.JSX.Element;
|
|
171
|
+
export type ExtRoute = {
|
|
172
|
+
r: "main";
|
|
173
|
+
} | {
|
|
174
|
+
r: "detail";
|
|
175
|
+
id: string;
|
|
176
|
+
} | {
|
|
177
|
+
r: "settings";
|
|
178
|
+
} | {
|
|
179
|
+
r: "new";
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* A parent-driven view of the popup.
|
|
183
|
+
*
|
|
184
|
+
* Lets a scene puppet the popup — scroll the list, highlight a row, open it,
|
|
185
|
+
* show a field as copied — while the popup keeps owning how any of that looks.
|
|
186
|
+
* All of it is RN-safe, which is why it survived the move.
|
|
187
|
+
*
|
|
188
|
+
* What did NOT survive is the original's self-driving `auto` mode: it steered a
|
|
189
|
+
* synthetic cursor with `querySelector` and `getBoundingClientRect`, which have
|
|
190
|
+
* no meaning on native. A scene that wants that keeps its own cursor and drives
|
|
191
|
+
* this controller instead.
|
|
192
|
+
*/
|
|
193
|
+
export interface ExtensionPopupController {
|
|
194
|
+
route: ExtRoute;
|
|
195
|
+
highlightId: string | null;
|
|
196
|
+
autoCopied: string | null;
|
|
197
|
+
listScrollRef: React.Ref<ScrollView>;
|
|
198
|
+
detailScrollRef: React.Ref<ScrollView>;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* The browser-extension popup.
|
|
202
|
+
*
|
|
203
|
+
* Interactive by default. Pass `external` to have a parent scene drive it.
|
|
204
|
+
*/
|
|
205
|
+
export declare function ExtensionPopup({ logo, external, height, }?: {
|
|
206
|
+
logo?: React.ReactNode;
|
|
207
|
+
external?: ExtensionPopupController;
|
|
208
|
+
/** Frame height. Defaults to the full 600; see `EXTENSION_POPUP_HEIGHT`. */
|
|
209
|
+
height?: number;
|
|
210
|
+
}): React.JSX.Element;
|
|
211
|
+
export default ExtensionPopup;
|
|
212
|
+
//# sourceMappingURL=extension-popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-popup.d.ts","sourceRoot":"","sources":["../../src/demos/extension-popup.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAIL,UAAU,EAIX,MAAM,cAAc,CAAC;AA6CtB;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAC1C,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,wBAAgB,MAAM;;;;;;;;EAarB;AAOD,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,0BA8BtC;AAGD,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CAClC;AACD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,EAAE,CA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