@opengeni/react 2.5.0-canary.1 → 3.0.0-canary.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 +15 -0
- package/dist/accounts.d.ts +64 -0
- package/dist/accounts.js +746 -0
- package/dist/accounts.js.map +1 -0
- package/dist/{browser-viewer-GXUICIAG.js → browser-viewer-AEFHUYZK.js} +3 -3
- package/dist/{chunk-MXJGO7LE.js → chunk-D3UIAJKY.js} +52 -2
- package/dist/chunk-D3UIAJKY.js.map +1 -0
- package/dist/{chunk-QGBJ6GHG.js → chunk-ELIYWBZR.js} +4 -4
- package/dist/{chunk-6H6S5V4Z.js → chunk-HQVCKCLG.js} +758 -871
- package/dist/chunk-HQVCKCLG.js.map +1 -0
- package/dist/{chunk-T7VAYG2I.js → chunk-MZ2G2XBA.js} +54 -2
- package/dist/chunk-MZ2G2XBA.js.map +1 -0
- package/dist/{chunk-X4JAFD5R.js → chunk-OAM4WAAM.js} +4 -4
- package/dist/{chunk-KSDXER4X.js → chunk-RGALCTWO.js} +64 -15
- package/dist/chunk-RGALCTWO.js.map +1 -0
- package/dist/chunk-YFKJ7VZH.js +268 -0
- package/dist/chunk-YFKJ7VZH.js.map +1 -0
- package/dist/{chunk-ATQJEWCA.js → chunk-YJFGAFBD.js} +124 -50
- package/dist/chunk-YJFGAFBD.js.map +1 -0
- package/dist/components/composer.d.ts +8 -0
- package/dist/components/file-browser.d.ts +4 -1
- package/dist/components/sandbox-files.d.ts +4 -1
- package/dist/components/sandbox-workspace.d.ts +5 -0
- package/dist/composer.js +3 -3
- package/dist/{computer-viewer-ZOP4Q7A7.js → computer-viewer-FWEZISW4.js} +3 -3
- package/dist/embedded-session-client.d.ts +23 -0
- package/dist/file-node-visibility.d.ts +15 -0
- package/dist/hooks/use-file-attachments.d.ts +9 -2
- package/dist/human-input.d.ts +3 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +139 -53
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +3 -3
- package/dist/session-ui.js +4 -4
- package/dist/session.d.ts +2 -0
- package/dist/session.js +7 -5
- package/dist/timeline/index.d.ts +1 -0
- package/dist/timeline/screenshot-lightbox.d.ts +16 -1
- package/package.json +6 -2
- package/src/accounts.tsx +970 -0
- package/src/components/chat-composer.tsx +88 -84
- package/src/components/composer.tsx +61 -9
- package/src/components/file-browser.tsx +33 -20
- package/src/components/human-input-surface.tsx +10 -6
- package/src/components/message-timeline.tsx +37 -9
- package/src/components/sandbox-files.tsx +42 -2
- package/src/components/sandbox-workspace.tsx +10 -0
- package/src/embedded-session-client.ts +104 -0
- package/src/file-node-visibility.ts +66 -0
- package/src/hooks/use-composer.ts +64 -2
- package/src/hooks/use-file-attachments.ts +38 -6
- package/src/hooks/use-human-input.ts +31 -4
- package/src/human-input.ts +12 -1
- package/src/index.ts +12 -0
- package/src/session.ts +5 -0
- package/src/timeline/index.ts +1 -0
- package/src/timeline/screenshot-lightbox.tsx +93 -29
- package/styles/compiled.css +11 -1
- package/styles/tokens.css +3 -1
- package/dist/chunk-6H6S5V4Z.js.map +0 -1
- package/dist/chunk-ATQJEWCA.js.map +0 -1
- package/dist/chunk-FK6VG4LL.js +0 -90
- package/dist/chunk-FK6VG4LL.js.map +0 -1
- package/dist/chunk-KSDXER4X.js.map +0 -1
- package/dist/chunk-MXJGO7LE.js.map +0 -1
- package/dist/chunk-T7VAYG2I.js.map +0 -1
- /package/dist/{browser-viewer-GXUICIAG.js.map → browser-viewer-AEFHUYZK.js.map} +0 -0
- /package/dist/{chunk-QGBJ6GHG.js.map → chunk-ELIYWBZR.js.map} +0 -0
- /package/dist/{chunk-X4JAFD5R.js.map → chunk-OAM4WAAM.js.map} +0 -0
- /package/dist/{computer-viewer-ZOP4Q7A7.js.map → computer-viewer-FWEZISW4.js.map} +0 -0
package/README.md
CHANGED
|
@@ -135,6 +135,21 @@ can therefore implement only the methods used by each hook. A shared event feed
|
|
|
135
135
|
also avoids requiring a client-owned event stream at runtime. Workspace-level
|
|
136
136
|
Resume is an optional authority.
|
|
137
137
|
|
|
138
|
+
Use `createEmbeddedSessionClient(base, options)` to bind that narrow surface
|
|
139
|
+
from a full SDK client or host proxy. Delegated methods preserve their SDK
|
|
140
|
+
receiver, `options.overrides.submitComposerDraft` can route atomic submission
|
|
141
|
+
through a host-authenticated endpoint, and `mapComposerDraft` can project every
|
|
142
|
+
read/save/submit draft before React adopts it. Construction fails immediately
|
|
143
|
+
when a required method is missing, and submit returns the host/native
|
|
144
|
+
`SubmitComposerDraftResponse` unchanged apart from an explicitly configured
|
|
145
|
+
draft projection.
|
|
146
|
+
|
|
147
|
+
The styled file surfaces accept a presentation-only node predicate:
|
|
148
|
+
`FileBrowser.isNodeVisible`, `SandboxFiles.isNodeVisible`, and
|
|
149
|
+
`SandboxWorkspace.isFileNodeVisible`. Hidden parents never expose orphaned
|
|
150
|
+
children, hidden selections/reveal requests are ignored, and omitting the prop
|
|
151
|
+
preserves the complete authoritative tree. This is not an authorization seam.
|
|
152
|
+
|
|
138
153
|
The styled root surface ships with ready-to-use CSS. Import it once; the host
|
|
139
154
|
does not need Tailwind:
|
|
140
155
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { BrowserAccountsClientLike, ManagedAuthDeepLinkResolution, ManagedAuthLoginTransaction, ManagedAuthSessionSetProjection } from "@opengeni/sdk/accounts";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export type BrowserAccountTransitionPhase = "preflight" | "blocked" | "committing" | "loading" | "ready" | "recoverable_error";
|
|
4
|
+
export type BrowserAccountTransitionKind = "add" | "select" | "logout_one" | "logout_all" | "reauth" | "cross_tab";
|
|
5
|
+
export type BrowserAccountTransitionBlocker = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
detail?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type BrowserAccountTransition = {
|
|
11
|
+
kind: BrowserAccountTransitionKind;
|
|
12
|
+
from: ManagedAuthSessionSetProjection | null;
|
|
13
|
+
to: ManagedAuthSessionSetProjection | null;
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
};
|
|
16
|
+
export type BrowserAccountsProviderProps = {
|
|
17
|
+
client: BrowserAccountsClientLike;
|
|
18
|
+
/**
|
|
19
|
+
* Hide the authenticated tree, abort old actor work, clear tenant-bound
|
|
20
|
+
* state, recreate credentials/clients, and refetch principal access here.
|
|
21
|
+
* Cross-tab/server invalidation first calls this with `to: null` as a
|
|
22
|
+
* neutral fence before authority is reread, then calls it with the accepted
|
|
23
|
+
* projection after the new actor is known.
|
|
24
|
+
*/
|
|
25
|
+
onActorTransition: (transition: BrowserAccountTransition) => Promise<void>;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
broadcastChannelName?: string | null | undefined;
|
|
28
|
+
/** Adopt the already-authenticated legacy provider session during dual-mode rollout. */
|
|
29
|
+
bootstrapLegacySession?: boolean | undefined;
|
|
30
|
+
};
|
|
31
|
+
type BlockerInspector = () => BrowserAccountTransitionBlocker | null;
|
|
32
|
+
export type BrowserAccountsContextValue = {
|
|
33
|
+
projection: ManagedAuthSessionSetProjection | null;
|
|
34
|
+
phase: BrowserAccountTransitionPhase;
|
|
35
|
+
blockers: BrowserAccountTransitionBlocker[];
|
|
36
|
+
error: Error | null;
|
|
37
|
+
transaction: ManagedAuthLoginTransaction | null;
|
|
38
|
+
hasPendingTransition: boolean;
|
|
39
|
+
refresh: () => Promise<ManagedAuthSessionSetProjection | null>;
|
|
40
|
+
invalidateActor: () => Promise<ManagedAuthSessionSetProjection | null>;
|
|
41
|
+
registerTransitionBlocker: (id: string, inspect: BlockerInspector) => () => void;
|
|
42
|
+
continueTransition: () => Promise<boolean>;
|
|
43
|
+
cancelPendingTransition: () => void;
|
|
44
|
+
beginAdd: (returnIntent?: string | undefined) => Promise<ManagedAuthLoginTransaction>;
|
|
45
|
+
beginReauth: (slotId: string, returnIntent?: string | undefined) => Promise<ManagedAuthLoginTransaction>;
|
|
46
|
+
completeEmailPassword: (input: {
|
|
47
|
+
email: string;
|
|
48
|
+
password: string;
|
|
49
|
+
}) => Promise<boolean>;
|
|
50
|
+
settleExternalLoginTransaction: (transactionId: string) => Promise<boolean>;
|
|
51
|
+
cancelLoginTransaction: () => Promise<void>;
|
|
52
|
+
selectSlot: (slotId: string) => Promise<boolean>;
|
|
53
|
+
logoutSlot: (slotId: string, replacementSlotId: string | null) => Promise<boolean>;
|
|
54
|
+
logoutAll: () => Promise<boolean>;
|
|
55
|
+
resolveDeepLink: (path: string) => Promise<ManagedAuthDeepLinkResolution>;
|
|
56
|
+
};
|
|
57
|
+
export declare function BrowserAccountsProvider({ client, onActorTransition, children, broadcastChannelName, bootstrapLegacySession, }: BrowserAccountsProviderProps): import("react").JSX.Element;
|
|
58
|
+
export declare function useBrowserAccounts(): BrowserAccountsContextValue;
|
|
59
|
+
/** Read the optional controller without requiring non-legacy hosts to mount it. */
|
|
60
|
+
export declare function useOptionalBrowserAccounts(): BrowserAccountsContextValue | null;
|
|
61
|
+
export declare function useBrowserAccountTransitionBlocker(id: string, inspect: BlockerInspector): void;
|
|
62
|
+
/** No-op on legacy hosts that do not mount the optional accounts provider. */
|
|
63
|
+
export declare function useOptionalBrowserAccountTransitionBlocker(id: string, inspect: BlockerInspector): void;
|
|
64
|
+
export {};
|