@flamingo-stack/openframe-frontend-core 0.0.691-snapshot.20261001154617 → 0.0.691
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/dist/{chunk-RLNNV46K.js → chunk-4HZXOQRM.js} +2 -2
- package/dist/{chunk-FTK3S57R.cjs → chunk-4N2JOPAQ.cjs} +13 -13
- package/dist/{chunk-FTK3S57R.cjs.map → chunk-4N2JOPAQ.cjs.map} +1 -1
- package/dist/{chunk-WTYQCT4A.cjs → chunk-5N2ZSB42.cjs} +10 -10
- package/dist/{chunk-WTYQCT4A.cjs.map → chunk-5N2ZSB42.cjs.map} +1 -1
- package/dist/{chunk-A5NHAHV6.js → chunk-6Z26ZMR4.js} +2 -2
- package/dist/{chunk-Z7QCNCBN.js → chunk-7WYWPELF.js} +5 -5
- package/dist/{chunk-RTKF5AYA.cjs → chunk-BXAGR3PO.cjs} +3 -3
- package/dist/{chunk-RTKF5AYA.cjs.map → chunk-BXAGR3PO.cjs.map} +1 -1
- package/dist/{chunk-KDCIYRZV.cjs → chunk-BXE2RZEV.cjs} +17 -17
- package/dist/{chunk-KDCIYRZV.cjs.map → chunk-BXE2RZEV.cjs.map} +1 -1
- package/dist/{chunk-X5XFKI6N.js → chunk-CMYDGVTZ.js} +2 -2
- package/dist/{chunk-EXWS2QSD.cjs → chunk-CWXRZVDI.cjs} +50 -588
- package/dist/chunk-CWXRZVDI.cjs.map +1 -0
- package/dist/{chunk-PKZGXRU2.js → chunk-DC3G4XGP.js} +3 -3
- package/dist/{chunk-CG7OWW7X.cjs → chunk-DDWLF2JV.cjs} +4 -4
- package/dist/{chunk-CG7OWW7X.cjs.map → chunk-DDWLF2JV.cjs.map} +1 -1
- package/dist/{chunk-ZAV2F4VX.js → chunk-DZMDG7PC.js} +2 -2
- package/dist/{chunk-KQZMM3QJ.cjs → chunk-ESFPY5FF.cjs} +51 -51
- package/dist/{chunk-KQZMM3QJ.cjs.map → chunk-ESFPY5FF.cjs.map} +1 -1
- package/dist/{chunk-AVAZ6BD6.js → chunk-FNMQ2J44.js} +2 -2
- package/dist/{chunk-DKJDO7YM.cjs → chunk-H54RDLVC.cjs} +18 -18
- package/dist/{chunk-DKJDO7YM.cjs.map → chunk-H54RDLVC.cjs.map} +1 -1
- package/dist/{chunk-RK47E3PP.js → chunk-JSG7WZKV.js} +2 -2
- package/dist/{chunk-CKO6NKNE.js → chunk-KMW2PXBU.js} +212 -750
- package/dist/chunk-KMW2PXBU.js.map +1 -0
- package/dist/{chunk-MCNQKS6I.js → chunk-KVDLL4LU.js} +2 -2
- package/dist/{chunk-5XPK2QGU.cjs → chunk-LCENRN2N.cjs} +3 -3
- package/dist/{chunk-5XPK2QGU.cjs.map → chunk-LCENRN2N.cjs.map} +1 -1
- package/dist/{chunk-IQTQIBZ3.js → chunk-MJI5GVT7.js} +4 -4
- package/dist/{chunk-DUURFYGS.cjs → chunk-N4S7RBUM.cjs} +3 -3
- package/dist/{chunk-DUURFYGS.cjs.map → chunk-N4S7RBUM.cjs.map} +1 -1
- package/dist/{chunk-7BNWMOPM.cjs → chunk-SA4KQCNB.cjs} +36 -36
- package/dist/{chunk-7BNWMOPM.cjs.map → chunk-SA4KQCNB.cjs.map} +1 -1
- package/dist/{chunk-LYQULSK4.js → chunk-TSNGVWQO.js} +5 -5
- package/dist/{chunk-F6LXGP6S.cjs → chunk-WZYIAKIH.cjs} +3 -3
- package/dist/{chunk-F6LXGP6S.cjs.map → chunk-WZYIAKIH.cjs.map} +1 -1
- package/dist/{chunk-TXFGG47A.js → chunk-XBYF4SGD.js} +2 -2
- package/dist/{chunk-Q25VYAEL.cjs → chunk-Y3BC7TOJ.cjs} +17 -17
- package/dist/{chunk-Q25VYAEL.cjs.map → chunk-Y3BC7TOJ.cjs.map} +1 -1
- package/dist/{chunk-ATREVNIN.cjs → chunk-Y3Q76RAA.cjs} +33 -33
- package/dist/{chunk-ATREVNIN.cjs.map → chunk-Y3Q76RAA.cjs.map} +1 -1
- package/dist/{chunk-LYJJH4D6.js → chunk-Y7ZQZOE6.js} +2 -2
- package/dist/{chunk-TEIHEFXP.js → chunk-Z5FHXCXF.js} +4 -4
- package/dist/{chunk-CKUPANVU.cjs → chunk-ZLYLHP64.cjs} +4 -4
- package/dist/{chunk-CKUPANVU.cjs.map → chunk-ZLYLHP64.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +11 -11
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +6 -6
- package/dist/components/docs/index.js +5 -5
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -34
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.d.ts +0 -1
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +1 -33
- package/dist/components/help-center-pages/index.cjs +49 -49
- package/dist/components/help-center-pages/index.js +13 -13
- package/dist/components/index.cjs +32 -64
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +12 -44
- package/dist/components/index.js.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +22 -22
- package/dist/components/meeting-scheduler/index.js +1 -1
- package/dist/components/navigation/index.cjs +5 -5
- package/dist/components/navigation/index.js +4 -4
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/tickets/index.cjs +6 -6
- package/dist/components/tickets/index.js +5 -5
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +6 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -37
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/features/index.ts +0 -1
- package/dist/chunk-CKO6NKNE.js.map +0 -1
- package/dist/chunk-EXWS2QSD.cjs.map +0 -1
- package/dist/components/features/remote-session/index.d.ts +0 -13
- package/dist/components/features/remote-session/index.d.ts.map +0 -1
- package/dist/components/features/remote-session/remote-access-request-card.d.ts +0 -19
- package/dist/components/features/remote-session/remote-access-request-card.d.ts.map +0 -1
- package/dist/components/features/remote-session/remote-session-block.d.ts +0 -41
- package/dist/components/features/remote-session/remote-session-block.d.ts.map +0 -1
- package/dist/components/features/remote-session/remote-session-chat-panel.d.ts +0 -23
- package/dist/components/features/remote-session/remote-session-chat-panel.d.ts.map +0 -1
- package/dist/components/features/remote-session/remote-session-dialog.d.ts +0 -15
- package/dist/components/features/remote-session/remote-session-dialog.d.ts.map +0 -1
- package/dist/components/features/remote-session/remote-session-overlay.d.ts +0 -12
- package/dist/components/features/remote-session/remote-session-overlay.d.ts.map +0 -1
- package/dist/components/features/remote-session/remote-session-parts.d.ts +0 -34
- package/dist/components/features/remote-session/remote-session-parts.d.ts.map +0 -1
- package/dist/components/features/remote-session/types.d.ts +0 -33
- package/dist/components/features/remote-session/types.d.ts.map +0 -1
- package/src/components/features/__tests__/remote-session.test.tsx +0 -97
- package/src/components/features/remote-session/index.ts +0 -36
- package/src/components/features/remote-session/remote-access-request-card.tsx +0 -102
- package/src/components/features/remote-session/remote-session-block.tsx +0 -182
- package/src/components/features/remote-session/remote-session-chat-panel.tsx +0 -178
- package/src/components/features/remote-session/remote-session-dialog.tsx +0 -77
- package/src/components/features/remote-session/remote-session-overlay.tsx +0 -33
- package/src/components/features/remote-session/remote-session-parts.tsx +0 -138
- package/src/components/features/remote-session/types.ts +0 -41
- package/src/stories/RemoteSessionAccessRequest.stories.tsx +0 -71
- package/src/stories/RemoteSessionBlock.stories.tsx +0 -164
- package/src/stories/RemoteSessionDialog.stories.tsx +0 -49
- package/src/stories/RemoteSessionIndicator.stories.tsx +0 -44
- /package/dist/{chunk-RLNNV46K.js.map → chunk-4HZXOQRM.js.map} +0 -0
- /package/dist/{chunk-A5NHAHV6.js.map → chunk-6Z26ZMR4.js.map} +0 -0
- /package/dist/{chunk-Z7QCNCBN.js.map → chunk-7WYWPELF.js.map} +0 -0
- /package/dist/{chunk-X5XFKI6N.js.map → chunk-CMYDGVTZ.js.map} +0 -0
- /package/dist/{chunk-PKZGXRU2.js.map → chunk-DC3G4XGP.js.map} +0 -0
- /package/dist/{chunk-ZAV2F4VX.js.map → chunk-DZMDG7PC.js.map} +0 -0
- /package/dist/{chunk-AVAZ6BD6.js.map → chunk-FNMQ2J44.js.map} +0 -0
- /package/dist/{chunk-RK47E3PP.js.map → chunk-JSG7WZKV.js.map} +0 -0
- /package/dist/{chunk-MCNQKS6I.js.map → chunk-KVDLL4LU.js.map} +0 -0
- /package/dist/{chunk-IQTQIBZ3.js.map → chunk-MJI5GVT7.js.map} +0 -0
- /package/dist/{chunk-LYQULSK4.js.map → chunk-TSNGVWQO.js.map} +0 -0
- /package/dist/{chunk-TXFGG47A.js.map → chunk-XBYF4SGD.js.map} +0 -0
- /package/dist/{chunk-LYJJH4D6.js.map → chunk-Y7ZQZOE6.js.map} +0 -0
- /package/dist/{chunk-TEIHEFXP.js.map → chunk-Z5FHXCXF.js.map} +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { RemoteAccessRequestCard } from './remote-access-request-card';
|
|
2
|
-
export type { RemoteAccessRequestCardProps } from './remote-access-request-card';
|
|
3
|
-
export { RemoteSessionBlockFrame, RemoteSessionEndButton, RemoteSessionMinimizedChip, RemoteSessionSummary, } from './remote-session-block';
|
|
4
|
-
export type { RemoteSessionBlockFrameProps, RemoteSessionMinimizedChipProps, RemoteSessionSummaryProps, } from './remote-session-block';
|
|
5
|
-
export { RemoteSessionChatPanel } from './remote-session-chat-panel';
|
|
6
|
-
export type { RemoteSessionChatPanelProps } from './remote-session-chat-panel';
|
|
7
|
-
export { RemoteSessionDialog } from './remote-session-dialog';
|
|
8
|
-
export type { RemoteSessionDialogProps } from './remote-session-dialog';
|
|
9
|
-
export { RemoteSessionBorder, RemoteSessionPill } from './remote-session-overlay';
|
|
10
|
-
export { REMOTE_SESSION_DRAG_HANDLE_CLASS, RemoteSessionDragger, RemoteSessionOrgLogo, RemoteSessionRecordingTag, RemoteSessionScope, formatRemoteSessionElapsed, useRemoteSessionTimer, } from './remote-session-parts';
|
|
11
|
-
export type { RemoteSessionOrgLogoProps, RemoteSessionScopeProps } from './remote-session-parts';
|
|
12
|
-
export type { RemoteAccessDecision, RemoteSessionChatAuthor, RemoteSessionChatMessage, RemoteSessionDialogVariant, RemoteSessionDragHandlers, RemoteSessionParty, } from './types';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,YAAY,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,gCAAgC,EAChC,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjG,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { RemoteAccessDecision, RemoteSessionParty } from './types';
|
|
2
|
-
export interface RemoteAccessRequestCardProps {
|
|
3
|
-
party: RemoteSessionParty;
|
|
4
|
-
/** The notice that the session will be recorded. */
|
|
5
|
-
showRecordingNotice?: boolean;
|
|
6
|
-
/** The decision in flight, if any; both buttons lock while it is set. */
|
|
7
|
-
deciding?: RemoteAccessDecision | null;
|
|
8
|
-
/** Replaces the "you can end the session" line, e.g. when the decision could not be sent. */
|
|
9
|
-
error?: string | null;
|
|
10
|
-
onDecide: (decision: RemoteAccessDecision) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Opens the organization's site. The button only shows for an https URL:
|
|
13
|
-
* the URL comes from the server, so no other scheme is ever handed out.
|
|
14
|
-
*/
|
|
15
|
-
onOpenSite?: (url: string) => void;
|
|
16
|
-
}
|
|
17
|
-
/** The end user's consent dialog for a remote access request: who is asking, what they get, Decline / Allow Access. */
|
|
18
|
-
export declare function RemoteAccessRequestCard({ party, showRecordingNotice, deciding, error, onDecide, onOpenSite, }: RemoteAccessRequestCardProps): import("react").JSX.Element;
|
|
19
|
-
//# sourceMappingURL=remote-access-request-card.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-access-request-card.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/remote-access-request-card.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAExE,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,kBAAkB,CAAC;IAC1B,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACvC,6FAA6F;IAC7F,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACnD;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAOD,uHAAuH;AACvH,wBAAgB,uBAAuB,CAAC,EACtC,KAAK,EACL,mBAA2B,EAC3B,QAAe,EACf,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE,4BAA4B,+BAiE9B"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { RemoteSessionDragHandlers, RemoteSessionParty } from './types';
|
|
3
|
-
export interface RemoteSessionBlockFrameProps {
|
|
4
|
-
/** The summary or the chat panel. */
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
/** The chat panel has a fixed height; the summary hugs its content. */
|
|
7
|
-
expanded?: boolean;
|
|
8
|
-
onHide: () => void;
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* The session block's card: 440 px wide, the open panel on top and the
|
|
13
|
-
* "Hide this Block" bar at the bottom. The ref is the rendered surface, which
|
|
14
|
-
* a desktop host sizes its window to.
|
|
15
|
-
*/
|
|
16
|
-
export declare const RemoteSessionBlockFrame: import("react").ForwardRefExoticComponent<RemoteSessionBlockFrameProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
-
/** The red End Session action shared by the summary and the chat panel. */
|
|
18
|
-
export declare function RemoteSessionEndButton({ onEndSession }: {
|
|
19
|
-
onEndSession: () => void;
|
|
20
|
-
}): import("react").JSX.Element;
|
|
21
|
-
export interface RemoteSessionSummaryProps {
|
|
22
|
-
party: RemoteSessionParty;
|
|
23
|
-
/** Elapsed session time, e.g. from `useRemoteSessionTimer`. */
|
|
24
|
-
elapsed: string;
|
|
25
|
-
showRecordingTag?: boolean;
|
|
26
|
-
onOpenChat: () => void;
|
|
27
|
-
onEndSession: () => void;
|
|
28
|
-
/** Makes the header row and the dragger move the window. */
|
|
29
|
-
dragHandlers?: RemoteSessionDragHandlers;
|
|
30
|
-
}
|
|
31
|
-
/** The compact block: who is connected and for how long, Open Chat / End Session. */
|
|
32
|
-
export declare function RemoteSessionSummary({ party, elapsed, showRecordingTag, onOpenChat, onEndSession, dragHandlers, }: RemoteSessionSummaryProps): import("react").JSX.Element;
|
|
33
|
-
export interface RemoteSessionMinimizedChipProps {
|
|
34
|
-
party: RemoteSessionParty;
|
|
35
|
-
onExpand: () => void;
|
|
36
|
-
/** Lets the chip move the window too; the host tells a drag from a click. */
|
|
37
|
-
dragHandlers?: RemoteSessionDragHandlers;
|
|
38
|
-
}
|
|
39
|
-
/** The hidden block: the technician's avatar (or the organization's logo) and a chevron to bring it back. */
|
|
40
|
-
export declare const RemoteSessionMinimizedChip: import("react").ForwardRefExoticComponent<RemoteSessionMinimizedChipProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
41
|
-
//# sourceMappingURL=remote-session-block.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-session-block.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/remote-session-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAYnD,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7E,MAAM,WAAW,4BAA4B;IAC3C,qCAAqC;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,yHAwBnC,CAAC;AAGF,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,EAAE,YAAY,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,IAAI,CAAA;CAAE,+BAWpF;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,OAAO,EACP,gBAAwB,EACxB,UAAU,EACV,YAAY,EACZ,YAAY,GACb,EAAE,yBAAyB,+BA4C3B;AAED,MAAM,WAAW,+BAA+B;IAC9C,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAED,6GAA6G;AAC7G,eAAO,MAAM,0BAA0B,+HAoCtC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { RemoteSessionChatMessage, RemoteSessionDragHandlers, RemoteSessionParty } from './types';
|
|
2
|
-
export interface RemoteSessionChatPanelProps {
|
|
3
|
-
party: RemoteSessionParty;
|
|
4
|
-
/** Elapsed session time, e.g. from `useRemoteSessionTimer`. */
|
|
5
|
-
elapsed: string;
|
|
6
|
-
messages: RemoteSessionChatMessage[];
|
|
7
|
-
showRecordingTag?: boolean;
|
|
8
|
-
/** The composer's text; owned by the host so it survives hiding the block. */
|
|
9
|
-
draft: string;
|
|
10
|
-
onDraftChange: (draft: string) => void;
|
|
11
|
-
/** Called with the trimmed text; the composer clears itself through `onDraftChange`. */
|
|
12
|
-
onSend: (text: string) => void;
|
|
13
|
-
/** False while the chat is still connecting: the composer is disabled. */
|
|
14
|
-
ready?: boolean;
|
|
15
|
-
error?: string | null;
|
|
16
|
-
onCloseChat: () => void;
|
|
17
|
-
onEndSession: () => void;
|
|
18
|
-
/** Makes the header and the dragger move the window. */
|
|
19
|
-
dragHandlers?: RemoteSessionDragHandlers;
|
|
20
|
-
}
|
|
21
|
-
/** The chat with the technician inside the session block. */
|
|
22
|
-
export declare function RemoteSessionChatPanel({ party, elapsed, messages, showRecordingTag, draft, onDraftChange, onSend, ready, error, onCloseChat, onEndSession, dragHandlers, }: RemoteSessionChatPanelProps): import("react").JSX.Element;
|
|
23
|
-
//# sourceMappingURL=remote-session-chat-panel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-session-chat-panel.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/remote-session-chat-panel.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvG,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,kBAAkB,CAAC;IAC1B,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,wFAAwF;IACxF,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,wDAAwD;IACxD,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAMD,6DAA6D;AAC7D,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,gBAAwB,EACxB,KAAK,EACL,aAAa,EACb,MAAM,EACN,KAAY,EACZ,KAAK,EACL,WAAW,EACX,YAAY,EACZ,YAAY,GACb,EAAE,2BAA2B,+BAyF7B"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { RemoteSessionDialogVariant } from './types';
|
|
2
|
-
export interface RemoteSessionDialogProps {
|
|
3
|
-
variant: RemoteSessionDialogVariant;
|
|
4
|
-
/** Named in the "ended" and "connection lost" notices. */
|
|
5
|
-
organizationName: string;
|
|
6
|
-
/** End confirm: the end call is in flight. */
|
|
7
|
-
ending?: boolean;
|
|
8
|
-
/** End confirm: the user confirmed. */
|
|
9
|
-
onEndSession?: () => void;
|
|
10
|
-
/** Cancel (end confirm) or Close (the notices). */
|
|
11
|
-
onClose: () => void;
|
|
12
|
-
}
|
|
13
|
-
/** The session's terminal dialogs: the end confirm and the "it is over" notices. */
|
|
14
|
-
export declare function RemoteSessionDialog({ variant, organizationName, ending, onEndSession, onClose, }: RemoteSessionDialogProps): import("react").JSX.Element;
|
|
15
|
-
//# sourceMappingURL=remote-session-dialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-session-dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/remote-session-dialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,0BAA0B,CAAC;IACpC,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;IACzB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,mDAAmD;IACnD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAOD,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,gBAAgB,EAChB,MAAc,EACd,YAAY,EACZ,OAAO,GACR,EAAE,wBAAwB,+BAsC1B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** The warning-yellow frame drawn around a whole screen; it never takes pointer events. */
|
|
2
|
-
export declare function RemoteSessionBorder({ className }: {
|
|
3
|
-
className?: string;
|
|
4
|
-
}): import("react").JSX.Element;
|
|
5
|
-
/**
|
|
6
|
-
* The End Session pill. It sits flush against the top edge of the screen, so
|
|
7
|
-
* only its bottom corners are rounded and it reads as one piece with the border.
|
|
8
|
-
*/
|
|
9
|
-
export declare function RemoteSessionPill({ onEndSession }: {
|
|
10
|
-
onEndSession: () => void;
|
|
11
|
-
}): import("react").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=remote-session-overlay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-session-overlay.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/remote-session-overlay.tsx"],"names":[],"mappings":"AAYA,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAExE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,YAAY,EAAE,EAAE;IAAE,YAAY,EAAE,MAAM,IAAI,CAAA;CAAE,+BAW/E"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { RemoteSessionDragHandlers } from './types';
|
|
3
|
-
export interface RemoteSessionScopeProps {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Root of every remote session surface: the desktop type and spacing scale,
|
|
9
|
-
* and the OpenFrame brand whatever the host app's tenant branding is - the
|
|
10
|
-
* "you are being helped" surfaces are OpenFrame-branded by design.
|
|
11
|
-
*/
|
|
12
|
-
export declare function RemoteSessionScope({ children, className }: RemoteSessionScopeProps): import("react").JSX.Element;
|
|
13
|
-
export interface RemoteSessionOrgLogoProps {
|
|
14
|
-
name: string;
|
|
15
|
-
logoUrl?: string | null;
|
|
16
|
-
/** Width and height in px. */
|
|
17
|
-
sizePx: number;
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
20
|
-
/** Organization logo tile; the OpenFrame mark when there is no logo. */
|
|
21
|
-
export declare function RemoteSessionOrgLogo({ name, logoUrl, sizePx, className }: RemoteSessionOrgLogoProps): import("react").JSX.Element;
|
|
22
|
-
/** The green SESSION RECORDING tag. */
|
|
23
|
-
export declare function RemoteSessionRecordingTag(): import("react").JSX.Element;
|
|
24
|
-
/** Grab cursor on the surfaces the window is moved by. */
|
|
25
|
-
export declare const REMOTE_SESSION_DRAG_HANDLE_CLASS = "cursor-grab active:cursor-grabbing";
|
|
26
|
-
/** The dragger glyph in the top-right corner of a block header: the visible handle for moving it. */
|
|
27
|
-
export declare function RemoteSessionDragger({ dragHandlers }: {
|
|
28
|
-
dragHandlers?: RemoteSessionDragHandlers;
|
|
29
|
-
}): import("react").JSX.Element;
|
|
30
|
-
/** `m:ss` for an elapsed duration; `h:mm:ss` from the first hour on. */
|
|
31
|
-
export declare function formatRemoteSessionElapsed(elapsedMs: number): string;
|
|
32
|
-
/** The session's elapsed time since `startedAt` (ISO), ticking once a second. */
|
|
33
|
-
export declare function useRemoteSessionTimer(startedAt: string): string;
|
|
34
|
-
//# sourceMappingURL=remote-session-parts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-session-parts.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/remote-session-parts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAKhF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AA4BzD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,uBAAuB,+BAMlF;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,yBAAyB,+BA2BnG;AAED,uCAAuC;AACvC,wBAAgB,yBAAyB,gCAOxC;AAED,0DAA0D;AAC1D,eAAO,MAAM,gCAAgC,uCAAuC,CAAC;AAErF,qGAAqG;AACrG,wBAAgB,oBAAoB,CAAC,EAAE,YAAY,EAAE,EAAE;IAAE,YAAY,CAAC,EAAE,yBAAyB,CAAA;CAAE,+BAalG;AAED,wEAAwE;AACxE,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAMpE;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAO/D"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Who is on the other end of a remote session, as the end user's surfaces show
|
|
4
|
-
* it: the organization always, the technician when the backend names one.
|
|
5
|
-
*/
|
|
6
|
-
export interface RemoteSessionParty {
|
|
7
|
-
organizationName: string;
|
|
8
|
-
organizationLogoUrl?: string | null;
|
|
9
|
-
/** Shown under the organization name; offered as a link only when it is https. */
|
|
10
|
-
organizationSiteUrl?: string | null;
|
|
11
|
-
/** Present for the technician variant of the session block; the organization variant otherwise. */
|
|
12
|
-
technicianName?: string | null;
|
|
13
|
-
technicianAvatarUrl?: string | null;
|
|
14
|
-
}
|
|
15
|
-
/** The end user's answer to a remote access request. */
|
|
16
|
-
export type RemoteAccessDecision = 'APPROVED' | 'DENIED';
|
|
17
|
-
export type RemoteSessionChatAuthor = 'technician' | 'user' | 'system';
|
|
18
|
-
export interface RemoteSessionChatMessage {
|
|
19
|
-
id: string;
|
|
20
|
-
author: RemoteSessionChatAuthor;
|
|
21
|
-
/** The technician's display name on their rows; the party's technician otherwise. */
|
|
22
|
-
name?: string | null;
|
|
23
|
-
text: string;
|
|
24
|
-
at: Date;
|
|
25
|
-
}
|
|
26
|
-
/** The terminal dialogs of a session: the end confirm and the two "it is over" notices. */
|
|
27
|
-
export type RemoteSessionDialogVariant = 'end-confirm' | 'session-ended' | 'connection-lost';
|
|
28
|
-
/**
|
|
29
|
-
* Pointer handlers a host attaches to the surfaces the user moves the window
|
|
30
|
-
* by (the desktop chat starts a native window drag from them).
|
|
31
|
-
*/
|
|
32
|
-
export type RemoteSessionDragHandlers = Pick<HTMLAttributes<HTMLElement>, 'onPointerDown' | 'onPointerMove' | 'onPointerUp'>;
|
|
33
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/features/remote-session/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kFAAkF;IAClF,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mGAAmG;IACnG,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED,wDAAwD;AACxD,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzD,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,uBAAuB,CAAC;IAChC,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,IAAI,CAAC;CACV;AAED,2FAA2F;AAC3F,MAAM,MAAM,0BAA0B,GAAG,aAAa,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE7F;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,cAAc,CAAC,WAAW,CAAC,EAC3B,eAAe,GAAG,eAAe,GAAG,aAAa,CAClD,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Remote session widgets: the elapsed format, the consent card's https-only
|
|
3
|
-
* site link and its decision lock, and the chat composer's send.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { fireEvent, render, screen } from '@testing-library/react';
|
|
7
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
8
|
-
import {
|
|
9
|
-
formatRemoteSessionElapsed,
|
|
10
|
-
RemoteAccessRequestCard,
|
|
11
|
-
RemoteSessionChatPanel,
|
|
12
|
-
RemoteSessionMinimizedChip,
|
|
13
|
-
} from '../remote-session';
|
|
14
|
-
|
|
15
|
-
const party = { organizationName: 'TechFlow Solutions', organizationSiteUrl: 'https://www.techflow.com' };
|
|
16
|
-
|
|
17
|
-
describe('formatRemoteSessionElapsed', () => {
|
|
18
|
-
it('counts minutes and seconds, then hours', () => {
|
|
19
|
-
expect(formatRemoteSessionElapsed(0)).toBe('0:00');
|
|
20
|
-
expect(formatRemoteSessionElapsed(323_000)).toBe('5:23');
|
|
21
|
-
expect(formatRemoteSessionElapsed(3_723_000)).toBe('1:02:03');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('never goes negative when the clock is behind the server', () => {
|
|
25
|
-
expect(formatRemoteSessionElapsed(-5_000)).toBe('0:00');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
describe('RemoteAccessRequestCard', () => {
|
|
30
|
-
it('offers the site only when it is https', () => {
|
|
31
|
-
const onOpenSite = vi.fn();
|
|
32
|
-
const { rerender } = render(<RemoteAccessRequestCard party={party} onDecide={() => {}} onOpenSite={onOpenSite} />);
|
|
33
|
-
fireEvent.click(screen.getByRole('button', { name: 'Open website' }));
|
|
34
|
-
expect(onOpenSite).toHaveBeenCalledWith('https://www.techflow.com');
|
|
35
|
-
|
|
36
|
-
rerender(
|
|
37
|
-
<RemoteAccessRequestCard
|
|
38
|
-
party={{ ...party, organizationSiteUrl: 'http://techflow.local' }}
|
|
39
|
-
onDecide={() => {}}
|
|
40
|
-
onOpenSite={onOpenSite}
|
|
41
|
-
/>,
|
|
42
|
-
);
|
|
43
|
-
expect(screen.getByText('techflow.local')).toBeInTheDocument();
|
|
44
|
-
expect(screen.queryByRole('button', { name: 'Open website' })).toBeNull();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('reports the decision, and locks both buttons while one is in flight', () => {
|
|
48
|
-
const onDecide = vi.fn();
|
|
49
|
-
const { rerender } = render(<RemoteAccessRequestCard party={party} onDecide={onDecide} />);
|
|
50
|
-
fireEvent.click(screen.getByRole('button', { name: 'Allow Access' }));
|
|
51
|
-
expect(onDecide).toHaveBeenCalledWith('APPROVED');
|
|
52
|
-
|
|
53
|
-
rerender(<RemoteAccessRequestCard party={party} onDecide={onDecide} deciding="APPROVED" />);
|
|
54
|
-
expect(screen.getByRole('button', { name: 'Decline' })).toBeDisabled();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it('shows the recording notice only when asked to', () => {
|
|
58
|
-
const { rerender } = render(<RemoteAccessRequestCard party={party} onDecide={() => {}} />);
|
|
59
|
-
expect(screen.queryByText(/will be recorded/)).toBeNull();
|
|
60
|
-
rerender(<RemoteAccessRequestCard party={party} onDecide={() => {}} showRecordingNotice />);
|
|
61
|
-
expect(screen.getByText(/will be recorded/)).toBeInTheDocument();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe('RemoteSessionChatPanel', () => {
|
|
66
|
-
it('sends the trimmed draft and clears it; a blank draft sends nothing', () => {
|
|
67
|
-
const onSend = vi.fn();
|
|
68
|
-
const onDraftChange = vi.fn();
|
|
69
|
-
const props = {
|
|
70
|
-
party,
|
|
71
|
-
elapsed: '1:00',
|
|
72
|
-
messages: [],
|
|
73
|
-
onDraftChange,
|
|
74
|
-
onSend,
|
|
75
|
-
onCloseChat: () => {},
|
|
76
|
-
onEndSession: () => {},
|
|
77
|
-
};
|
|
78
|
-
const { rerender } = render(<RemoteSessionChatPanel {...props} draft=" hello " />);
|
|
79
|
-
fireEvent.click(screen.getByRole('button', { name: 'Send message' }));
|
|
80
|
-
expect(onSend).toHaveBeenCalledWith('hello');
|
|
81
|
-
expect(onDraftChange).toHaveBeenCalledWith('');
|
|
82
|
-
|
|
83
|
-
onSend.mockClear();
|
|
84
|
-
rerender(<RemoteSessionChatPanel {...props} draft=" " />);
|
|
85
|
-
fireEvent.click(screen.getByRole('button', { name: 'Send message' }));
|
|
86
|
-
expect(onSend).not.toHaveBeenCalled();
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
describe('RemoteSessionMinimizedChip', () => {
|
|
91
|
-
it('expands on click', () => {
|
|
92
|
-
const onExpand = vi.fn();
|
|
93
|
-
render(<RemoteSessionMinimizedChip party={{ ...party, technicianName: 'Mike Rodriguez' }} onExpand={onExpand} />);
|
|
94
|
-
fireEvent.click(screen.getByRole('button', { name: 'Show session block' }));
|
|
95
|
-
expect(onExpand).toHaveBeenCalledTimes(1);
|
|
96
|
-
});
|
|
97
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export { RemoteAccessRequestCard } from './remote-access-request-card';
|
|
2
|
-
export type { RemoteAccessRequestCardProps } from './remote-access-request-card';
|
|
3
|
-
export {
|
|
4
|
-
RemoteSessionBlockFrame,
|
|
5
|
-
RemoteSessionEndButton,
|
|
6
|
-
RemoteSessionMinimizedChip,
|
|
7
|
-
RemoteSessionSummary,
|
|
8
|
-
} from './remote-session-block';
|
|
9
|
-
export type {
|
|
10
|
-
RemoteSessionBlockFrameProps,
|
|
11
|
-
RemoteSessionMinimizedChipProps,
|
|
12
|
-
RemoteSessionSummaryProps,
|
|
13
|
-
} from './remote-session-block';
|
|
14
|
-
export { RemoteSessionChatPanel } from './remote-session-chat-panel';
|
|
15
|
-
export type { RemoteSessionChatPanelProps } from './remote-session-chat-panel';
|
|
16
|
-
export { RemoteSessionDialog } from './remote-session-dialog';
|
|
17
|
-
export type { RemoteSessionDialogProps } from './remote-session-dialog';
|
|
18
|
-
export { RemoteSessionBorder, RemoteSessionPill } from './remote-session-overlay';
|
|
19
|
-
export {
|
|
20
|
-
REMOTE_SESSION_DRAG_HANDLE_CLASS,
|
|
21
|
-
RemoteSessionDragger,
|
|
22
|
-
RemoteSessionOrgLogo,
|
|
23
|
-
RemoteSessionRecordingTag,
|
|
24
|
-
RemoteSessionScope,
|
|
25
|
-
formatRemoteSessionElapsed,
|
|
26
|
-
useRemoteSessionTimer,
|
|
27
|
-
} from './remote-session-parts';
|
|
28
|
-
export type { RemoteSessionOrgLogoProps, RemoteSessionScopeProps } from './remote-session-parts';
|
|
29
|
-
export type {
|
|
30
|
-
RemoteAccessDecision,
|
|
31
|
-
RemoteSessionChatAuthor,
|
|
32
|
-
RemoteSessionChatMessage,
|
|
33
|
-
RemoteSessionDialogVariant,
|
|
34
|
-
RemoteSessionDragHandlers,
|
|
35
|
-
RemoteSessionParty,
|
|
36
|
-
} from './types';
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { ExternalLinkIcon, InfoCircleIcon } from '../../icons-v2-generated';
|
|
4
|
-
import { Button } from '../../ui/button/button';
|
|
5
|
-
import { RemoteSessionOrgLogo } from './remote-session-parts';
|
|
6
|
-
import type { RemoteAccessDecision, RemoteSessionParty } from './types';
|
|
7
|
-
|
|
8
|
-
export interface RemoteAccessRequestCardProps {
|
|
9
|
-
party: RemoteSessionParty;
|
|
10
|
-
/** The notice that the session will be recorded. */
|
|
11
|
-
showRecordingNotice?: boolean;
|
|
12
|
-
/** The decision in flight, if any; both buttons lock while it is set. */
|
|
13
|
-
deciding?: RemoteAccessDecision | null;
|
|
14
|
-
/** Replaces the "you can end the session" line, e.g. when the decision could not be sent. */
|
|
15
|
-
error?: string | null;
|
|
16
|
-
onDecide: (decision: RemoteAccessDecision) => void;
|
|
17
|
-
/**
|
|
18
|
-
* Opens the organization's site. The button only shows for an https URL:
|
|
19
|
-
* the URL comes from the server, so no other scheme is ever handed out.
|
|
20
|
-
*/
|
|
21
|
-
onOpenSite?: (url: string) => void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** `https://www.techflow.com/` -> `www.techflow.com`. */
|
|
25
|
-
function displaySiteUrl(url: string): string {
|
|
26
|
-
return url.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** The end user's consent dialog for a remote access request: who is asking, what they get, Decline / Allow Access. */
|
|
30
|
-
export function RemoteAccessRequestCard({
|
|
31
|
-
party,
|
|
32
|
-
showRecordingNotice = false,
|
|
33
|
-
deciding = null,
|
|
34
|
-
error,
|
|
35
|
-
onDecide,
|
|
36
|
-
onOpenSite,
|
|
37
|
-
}: RemoteAccessRequestCardProps) {
|
|
38
|
-
const { organizationName } = party;
|
|
39
|
-
const siteUrl = party.organizationSiteUrl ?? undefined;
|
|
40
|
-
const openableSite = siteUrl?.startsWith('https://') ? siteUrl : undefined;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className="flex w-full flex-col gap-[var(--spacing-system-l)] rounded-md border border-ods-border bg-ods-card p-[var(--spacing-system-xl)]">
|
|
44
|
-
<h1 className="w-full text-ods-text-primary text-h2">Your IT support team is requesting remote access</h1>
|
|
45
|
-
|
|
46
|
-
<div className="flex w-full items-center gap-[var(--spacing-system-m)] rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-m)]">
|
|
47
|
-
<RemoteSessionOrgLogo name={organizationName} logoUrl={party.organizationLogoUrl} sizePx={64} />
|
|
48
|
-
<div className="flex min-w-0 flex-1 flex-col">
|
|
49
|
-
<p className="w-full truncate text-ods-text-primary text-h3">{organizationName}</p>
|
|
50
|
-
{siteUrl && <p className="w-full truncate text-ods-text-secondary text-h4">{displaySiteUrl(siteUrl)}</p>}
|
|
51
|
-
</div>
|
|
52
|
-
{openableSite && onOpenSite && (
|
|
53
|
-
<Button variant="outline" size="icon" aria-label="Open website" onClick={() => onOpenSite(openableSite)}>
|
|
54
|
-
<ExternalLinkIcon size={24} color="currentColor" />
|
|
55
|
-
</Button>
|
|
56
|
-
)}
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<p className="w-full text-ods-text-primary text-h4">
|
|
60
|
-
A technician from <span className="text-ods-accent">{organizationName}</span> will be able to view your screen
|
|
61
|
-
and control your mouse and keyboard during this session.
|
|
62
|
-
</p>
|
|
63
|
-
|
|
64
|
-
<div className="flex w-full flex-col gap-[var(--spacing-system-xs)]">
|
|
65
|
-
{showRecordingNotice && (
|
|
66
|
-
<div className="flex w-full items-center gap-[var(--spacing-system-xs)] rounded-md border border-ods-border bg-ods-bg p-[var(--spacing-system-s)]">
|
|
67
|
-
<InfoCircleIcon size={24} color="currentColor" className="shrink-0 text-ods-accent" />
|
|
68
|
-
<p className="min-w-0 flex-1 text-ods-text-primary text-h6">
|
|
69
|
-
This session will be recorded and available upon request.
|
|
70
|
-
</p>
|
|
71
|
-
</div>
|
|
72
|
-
)}
|
|
73
|
-
{error ? (
|
|
74
|
-
<p className="w-full text-ods-text-primary text-h6">{error}</p>
|
|
75
|
-
) : (
|
|
76
|
-
<p className="w-full text-ods-text-secondary text-h6">You can end the session at any time.</p>
|
|
77
|
-
)}
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<div className="flex w-full items-stretch gap-[var(--spacing-system-l)]">
|
|
81
|
-
<Button
|
|
82
|
-
variant="outline"
|
|
83
|
-
fullWidth
|
|
84
|
-
loading={deciding === 'DENIED'}
|
|
85
|
-
disabled={deciding !== null}
|
|
86
|
-
onClick={() => onDecide('DENIED')}
|
|
87
|
-
>
|
|
88
|
-
Decline
|
|
89
|
-
</Button>
|
|
90
|
-
<Button
|
|
91
|
-
variant="accent"
|
|
92
|
-
fullWidth
|
|
93
|
-
loading={deciding === 'APPROVED'}
|
|
94
|
-
disabled={deciding !== null}
|
|
95
|
-
onClick={() => onDecide('APPROVED')}
|
|
96
|
-
>
|
|
97
|
-
Allow Access
|
|
98
|
-
</Button>
|
|
99
|
-
</div>
|
|
100
|
-
</div>
|
|
101
|
-
);
|
|
102
|
-
}
|