cobrowse-agent-ui 1.2.0 → 1.3.1
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 +3 -3
- package/dist/cobrowse-agent-ui.css +1 -0
- package/dist/cobrowse-agent-ui.d.ts +114 -0
- package/dist/cobrowse-agent-ui.js +194 -0
- package/dist/cobrowse-agent-ui.js.map +1 -0
- package/dist/index-CB-5iZZ3.js +639 -0
- package/dist/index-CB-5iZZ3.js.map +1 -0
- package/dist/integrations.d.ts +54 -0
- package/dist/integrations.js +90 -0
- package/dist/integrations.js.map +1 -0
- package/package.json +47 -16
- package/CHANGELOG.md +0 -41
- package/dist/CodeEntry.css +0 -50
- package/dist/CodeEntry.js +0 -226
- package/dist/Device.css +0 -47
- package/dist/Device.js +0 -31
- package/dist/PlatformIcon.css +0 -6
- package/dist/PlatformIcon.js +0 -94
- package/dist/Session.css +0 -60
- package/dist/Session.js +0 -39
- package/dist/SmartConnectButton.css +0 -19
- package/dist/SmartConnectButton.js +0 -11
- package/dist/Stopwatch.js +0 -15
- package/dist/UserIcon.css +0 -16
- package/dist/UserIcon.js +0 -21
- package/dist/deviceType.js +0 -31
- package/dist/i18n.js +0 -120
- package/dist/index.js +0 -7
- package/dist/locales/ar/translation.json +0 -10
- package/dist/locales/cs/translation.json +0 -10
- package/dist/locales/da/translation.json +0 -10
- package/dist/locales/de/translation.json +0 -10
- package/dist/locales/en-us/translation.json +0 -10
- package/dist/locales/es/translation.json +0 -10
- package/dist/locales/et/translation.json +0 -10
- package/dist/locales/fi/translation.json +0 -10
- package/dist/locales/fr/translation.json +0 -10
- package/dist/locales/hi/translation.json +0 -10
- package/dist/locales/it/translation.json +0 -10
- package/dist/locales/ja/translation.json +0 -10
- package/dist/locales/kk/translation.json +0 -10
- package/dist/locales/ko/translation.json +0 -10
- package/dist/locales/lt/translation.json +0 -10
- package/dist/locales/mr/translation.json +0 -10
- package/dist/locales/ms/translation.json +0 -10
- package/dist/locales/nl/translation.json +0 -10
- package/dist/locales/pl/translation.json +0 -10
- package/dist/locales/pt/translation.json +0 -10
- package/dist/locales/ro/translation.json +0 -10
- package/dist/locales/ru/translation.json +0 -10
- package/dist/locales/sk/translation.json +0 -10
- package/dist/locales/sl/translation.json +0 -10
- package/dist/locales/sv/translation.json +0 -10
- package/dist/locales/th/translation.json +0 -10
- package/dist/locales/uk/translation.json +0 -10
- package/dist/locales/vi/translation.json +0 -10
- package/dist/locales/zh/translation.json +0 -10
- package/i18next-parser.config.js +0 -43
- package/icons/android.svg +0 -3
- package/icons/apple.svg +0 -3
- package/icons/default.svg +0 -21
- package/icons/globe.svg +0 -3
- package/icons/windows.svg +0 -5
package/README.md
CHANGED
|
@@ -30,10 +30,10 @@ To add a new locale follow these steps:
|
|
|
30
30
|
|
|
31
31
|
- Add a new entry to the `locales` array inside `i18next-parser.config.js`.
|
|
32
32
|
- Run the `npm run i18n` command to generate a new locale file.
|
|
33
|
-
- Import the new locale JSON file inside `
|
|
33
|
+
- Import the new locale JSON file inside `lib/i18n.js` and add it to the `resources` object (in the i18n instance
|
|
34
34
|
configuration) keyed by the locale key.
|
|
35
|
-
- Import the relevant `
|
|
36
|
-
- Add a new entry to the `SUPPORTED_LOCALES` constant inside `
|
|
35
|
+
- Import the relevant `date-fns` locale inside `lib/i18n.js`.
|
|
36
|
+
- Add a new entry to the `SUPPORTED_LOCALES` constant inside `lib/i18n.js`.
|
|
37
37
|
|
|
38
38
|
**Note:** ensure the locale code matches the ones provided by the
|
|
39
39
|
[date-fns library](https://github.com/date-fns/date-fns/tree/main/src/locale) as these are used to localize dates as well.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.PlatformIcon-module__root__ogAvA{width:.9rem;height:.9rem;vertical-align:middle}.Device-module__root__UZx82{padding:6px;display:flex;align-items:center;position:relative;gap:12px}.Device-module__online__1AxAp .Device-module__deviceStatus__0yCZg{outline:2px solid #c7ea30}.Device-module__lastSeen__6lPw2{font-size:.85rem;color:#777;white-space:nowrap}.Device-module__deviceStatus__0yCZg{height:36px;width:36px;padding:4px;outline:2px solid rgba(4,13,60,.25);border-radius:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:transparent}.Device-module__platformIcon__Y-uEy{height:100%;width:auto;pointer-events:none;display:flex;align-items:center;justify-content:center;color:inherit}.Device-module__details__hiywz{display:flex;flex-direction:column;gap:2px;flex:1;color:inherit}.Session-module__root__cORao{appearance:none;border:none;background:none;padding:6px;display:flex;align-items:center;flex-wrap:wrap;gap:12px;text-align:start;font-size:1rem;font-family:inherit;line-height:inherit;outline:none}.Session-module__clickable__ZEtjv{cursor:pointer;width:100%}.Session-module__root__cORao:focus-visible{outline:2px solid #040d3c;outline-offset:2px}.Session-module__details__oye-t{flex:1;display:flex;flex-direction:column;gap:4px}.Session-module__subdetails__rorhH{display:flex;align-items:baseline;color:#777;gap:12px}.Session-module__recorded__aV5Ih{text-transform:uppercase;font-size:10px;margin-inline-start:3px;letter-spacing:.05rem;color:#0b1220;cursor:pointer}.Session-module__active__1c1v0{color:#fff;font-size:11px;font-weight:700;text-transform:uppercase;background-color:#3cc56e;padding:1px 6px;border-radius:4px;display:inline-block}.Session-module__activated__g-IUA{font-size:.9rem;white-space:nowrap}.Session-module__recorded__aV5Ih:before{content:"";width:8px;height:8px;margin-inline-end:4px;background:red;border-radius:100%;display:inline-block}.Session-module__duration__2WYUC{font-weight:700;font-size:12px;color:inherit}.SmartConnectButton-module__root__11QZi{appearance:none;border:none;display:inline-block;background:#f6f4f8;padding:12px 16px;cursor:not-allowed;border-radius:4px;font-weight:600;font-size:1rem;font-family:inherit;line-height:inherit;opacity:.6;transition:background .15s ease,color .15s ease,transform .12s ease,opacity .12s ease;outline:none}.SmartConnectButton-module__connectable__9zFuL{background:#040d3c;color:#fff;cursor:pointer;opacity:1}.SmartConnectButton-module__root__11QZi:focus-visible{outline:2px solid #040d3c;outline-offset:2px}.SmartConnectButton-module__root__11QZi:active.SmartConnectButton-module__connectable__9zFuL{transform:translateY(1px)}.RefreshButton-module__root__2r6Po{padding:4px;border:none;background:transparent;display:flex;align-items:center;justify-content:center;color:#6f7780;cursor:pointer}.RefreshButton-module__icon__ZMGzA{width:18px;height:18px;transition:transform .2s ease-out}.RefreshButton-module__icon__ZMGzA:hover{transform:rotate(25deg)}@keyframes Loader-module__spin__HaoIa{to{transform:rotate(360deg)}}.Loader-module__root__CuLMw{display:flex;justify-content:center}.Loader-module__icon__vaPyL{width:50px;height:50px;animation:Loader-module__spin__HaoIa 2s linear infinite;color:#040d3c}.CodeEntry-module__root__CEZCb{text-align:center;white-space:nowrap;display:inline-flex;align-items:center;gap:10px;border:none;margin:0;padding:0;min-inline-size:0}.CodeEntry-module__legend__GN0ge{padding:0;display:contents}.CodeEntry-module__digits__aob60{display:inline-flex;align-items:center}.CodeEntry-module__input__Mp3LR{font-size:1rem;width:1.6rem;height:2rem;margin:.2rem;text-align:center;border-radius:4px;border:1px solid #dfe3f0;background:#fff;color:#0b1220;transition:border-color .12s ease,box-shadow .12s ease,transform .12s ease;appearance:textfield}.CodeEntry-module__input__Mp3LR:nth-of-type(3){margin-inline-end:.6rem}.CodeEntry-module__input__Mp3LR[type=number]::-webkit-outer-spin-button,.CodeEntry-module__input__Mp3LR[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}.CodeEntry-module__input__Mp3LR:focus{border-color:#040d3c;box-shadow:0 0 0 3px #040d3c29;outline:none}@keyframes CodeEntry-module__shake__0xLiW{10%,90%{transform:translate3d(-2px,0,0)}20%,80%{transform:translate3d(3px,0,0)}30%,50%,70%{transform:translate3d(-7px,0,0)}40%,60%{transform:translate3d(7px,0,0)}}.CodeEntry-module__invalid__0fo6R{animation:CodeEntry-module__shake__0xLiW .6s cubic-bezier(.16,.07,.19,.97) both;transform:translateZ(0)}.ExternalLink-module__root__7-WiY{position:absolute;right:10px;display:flex;align-items:center;gap:4px;text-decoration:none;color:var(--text-color-base)}.ExternalLink-module__root__7-WiY:hover{text-decoration:underline}.ExternalLink-module__root__7-WiY:visited{color:#0e0c26;color:var(--text-color-base)}.UserIcon-module__root__-NL30{color:#fff;display:inline-flex;align-items:center;justify-content:center;text-align:center;background-size:cover;background-position:center;padding:16px;border-radius:50%;width:1.5rem;height:1.5rem;border:1px solid #ddd;flex:0 0 auto;white-space:nowrap}.Tabs-module__root__vrPV-{--tab-text-color: #6f7780;--tab-active-color: #040d3c;--tab-border-color: #d7dce2;--tab-focus-outline-color: #040d3c;width:100%;display:flex;flex-direction:column;gap:10px}.Tabs-module__header__ZVkH2{display:flex;align-items:center;border-bottom:1px solid var(--tab-border-color);gap:12px}.Tabs-module__tabList__thjbJ{display:flex;margin:0}.Tabs-module__tab__HyAQH{position:relative;margin-bottom:-1px;padding:10px;border:none;background:transparent;color:var(--tab-text-color);font-size:14px;font-weight:600;border-bottom:2px solid transparent;cursor:pointer;transition:color .3s,border .3s}.Tabs-module__tabHover__yC8x3{color:var(--tab-active-color)}.Tabs-module__tab__HyAQH:focus-visible{outline:2px solid var(--tab-focus-outline-color);outline-offset:2px}.Tabs-module__tabActive__4FIE-{color:var(--tab-active-color);border-bottom:2px solid var(--tab-active-color)}.Tabs-module__refresh__MV7Wh{margin-inline-start:auto}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { Device as Device_2 } from 'cobrowse-agent-sdk';
|
|
4
|
+
import { DeviceInfo as DeviceInfo_2 } from 'cobrowse-agent-sdk';
|
|
5
|
+
import { ElementType } from 'react';
|
|
6
|
+
import { ForwardedRef } from 'react';
|
|
7
|
+
import { i18n as i18n_2 } from 'i18next';
|
|
8
|
+
import { JSX } from 'react/jsx-runtime';
|
|
9
|
+
import { ReactNode } from 'react';
|
|
10
|
+
import { Session as Session_2 } from 'cobrowse-agent-sdk';
|
|
11
|
+
import { SVGProps } from 'react';
|
|
12
|
+
|
|
13
|
+
declare interface BaseSessionProps<TSession extends SessionData = SessionData> {
|
|
14
|
+
session: TSession;
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare const CodeEntry: ({ ref, className, inputClassName, focusOnRender, onCode, label, children }: CodeEntryProps) => JSX.Element;
|
|
20
|
+
|
|
21
|
+
declare interface CodeEntryHandle {
|
|
22
|
+
clear: () => void;
|
|
23
|
+
focus: (index: number) => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare interface CodeEntryProps {
|
|
27
|
+
ref?: ForwardedRef<CodeEntryHandle>;
|
|
28
|
+
className?: string;
|
|
29
|
+
inputClassName?: string;
|
|
30
|
+
focusOnRender?: boolean;
|
|
31
|
+
onCode?: (code: string) => Promise<boolean> | boolean;
|
|
32
|
+
label?: ReactNode | false;
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare const DEFAULT_TAG: "div";
|
|
37
|
+
|
|
38
|
+
export declare const Device: <T extends DeviceData = DeviceData>({ style, className, device, children }: DeviceProps<T>) => JSX.Element;
|
|
39
|
+
|
|
40
|
+
export declare type DeviceData = Pick<Device_2, 'id' | 'online' | 'connectable' | 'last_active'> & {
|
|
41
|
+
device: DeviceInfo;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
declare type DeviceInfo = Pick<DeviceInfo_2, 'platform' | 'device'>;
|
|
45
|
+
|
|
46
|
+
export declare interface DeviceProps<T extends DeviceData = DeviceData> {
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
className?: string;
|
|
49
|
+
device: T;
|
|
50
|
+
children?: ReactNode;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export declare const ExternalLink: ({ href, children }: ExternalLinkProps) => JSX.Element;
|
|
54
|
+
|
|
55
|
+
export declare interface ExternalLinkProps {
|
|
56
|
+
href: string;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare const i18n: i18n_2;
|
|
61
|
+
|
|
62
|
+
export declare const Loader: ({ children }: LoaderProps) => JSX.Element;
|
|
63
|
+
|
|
64
|
+
export declare interface LoaderProps {
|
|
65
|
+
children?: ReactNode;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare const PlatformIcon: ({ platform, className, ...props }: PlatformIconProps) => JSX.Element;
|
|
69
|
+
|
|
70
|
+
declare interface PlatformIconProps extends SVGProps<SVGSVGElement> {
|
|
71
|
+
platform: DeviceInfo_2['platform'];
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare type PropsOf<T extends ElementType> = ComponentPropsWithoutRef<T>;
|
|
76
|
+
|
|
77
|
+
export declare const RefreshButton: ({ className, children, ...props }: RefreshButtonProps) => JSX.Element;
|
|
78
|
+
|
|
79
|
+
export declare interface RefreshButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare const Session: <TSession extends SessionData = SessionData, TElement extends ElementType = "div">({ as, session, onClick, className, children, ...props }: SessionProps<TSession, TElement>) => JSX.Element;
|
|
83
|
+
|
|
84
|
+
export declare type SessionData = Pick<Session_2, 'id' | 'state' | 'recorded' | 'activated' | 'ended'> & {
|
|
85
|
+
device: DeviceInfo;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export declare type SessionProps<TSession extends SessionData = SessionData, TElement extends ElementType = typeof DEFAULT_TAG> = BaseSessionProps<TSession> & Omit<PropsOf<TElement>, 'onClick'> & {
|
|
89
|
+
as?: TElement;
|
|
90
|
+
onClick?: (session: TSession) => void;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export declare const SmartConnectButton: <T extends DeviceData = DeviceData>({ device, onClick: onClickCallback, className, children, ...props }: SmartConnectButtonProps<T>) => JSX.Element;
|
|
94
|
+
|
|
95
|
+
export declare interface SmartConnectButtonProps<T extends DeviceData = DeviceData> extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick'> {
|
|
96
|
+
device: T;
|
|
97
|
+
onClick?: (device: T) => void;
|
|
98
|
+
children?: ReactNode;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export declare const UserIcon: ({ user, className }: UserIconProps) => JSX.Element | null;
|
|
102
|
+
|
|
103
|
+
declare interface UserIconProps {
|
|
104
|
+
user?: UserIconUser;
|
|
105
|
+
className?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare interface UserIconUser {
|
|
109
|
+
name?: string;
|
|
110
|
+
picture?: string;
|
|
111
|
+
colour?: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { }
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
var G = Object.defineProperty;
|
|
2
|
+
var S = Object.getOwnPropertySymbols;
|
|
3
|
+
var Z = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var N = (t, o, n) => o in t ? G(t, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[o] = n, P = (t, o) => {
|
|
5
|
+
for (var n in o || (o = {}))
|
|
6
|
+
Z.call(o, n) && N(t, n, o[n]);
|
|
7
|
+
if (S)
|
|
8
|
+
for (var n of S(o))
|
|
9
|
+
q.call(o, n) && N(t, n, o[n]);
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
var A = (t, o, n) => new Promise((d, f) => {
|
|
13
|
+
var g = (a) => {
|
|
14
|
+
try {
|
|
15
|
+
p(n.next(a));
|
|
16
|
+
} catch (h) {
|
|
17
|
+
f(h);
|
|
18
|
+
}
|
|
19
|
+
}, k = (a) => {
|
|
20
|
+
try {
|
|
21
|
+
p(n.throw(a));
|
|
22
|
+
} catch (h) {
|
|
23
|
+
f(h);
|
|
24
|
+
}
|
|
25
|
+
}, p = (a) => a.done ? d(a.value) : Promise.resolve(a.value).then(g, k);
|
|
26
|
+
p((n = n.apply(t, o)).next());
|
|
27
|
+
});
|
|
28
|
+
import { jsxs as R, jsx as _ } from "react/jsx-runtime";
|
|
29
|
+
import * as T from "react";
|
|
30
|
+
import { useState as M, useRef as z, useImperativeHandle as J, useCallback as m, useEffect as Q } from "react";
|
|
31
|
+
import { useTranslation as X } from "react-i18next";
|
|
32
|
+
import $ from "clsx";
|
|
33
|
+
import { P as tt, D as et, S as nt, a as ot, R as rt, L as st, i as ct } from "./index-CB-5iZZ3.js";
|
|
34
|
+
const it = "CodeEntry-module__root__CEZCb", at = "CodeEntry-module__legend__GN0ge", lt = "CodeEntry-module__digits__aob60", ut = "CodeEntry-module__input__Mp3LR", dt = "CodeEntry-module__invalid__0fo6R", I = {
|
|
35
|
+
root: it,
|
|
36
|
+
legend: at,
|
|
37
|
+
digits: lt,
|
|
38
|
+
input: ut,
|
|
39
|
+
invalid: dt
|
|
40
|
+
}, l = 6, x = Array(l).fill(""), ft = "Backspace", b = "ArrowLeft", mt = "ArrowRight", B = (t, o) => t.findIndex((n) => n === o), U = (t, o) => {
|
|
41
|
+
var n;
|
|
42
|
+
(n = t[Math.max(B(t, o) - 1, 0)]) == null || n.focus();
|
|
43
|
+
}, w = (t, o) => {
|
|
44
|
+
var n;
|
|
45
|
+
(n = t[Math.min(B(t, o) + 1, l - 1)]) == null || n.focus();
|
|
46
|
+
}, gt = (t, o, n) => {
|
|
47
|
+
const d = getComputedStyle(o).direction === "rtl";
|
|
48
|
+
(n === b ? !d : d) ? U(t, o) : w(t, o);
|
|
49
|
+
}, pt = ({ ref: t, className: o, inputClassName: n, focusOnRender: d = !1, onCode: f, label: g, children: k }) => {
|
|
50
|
+
const { t: p } = X(), [a, h] = M(!1), [E, D] = M(x), c = z([]);
|
|
51
|
+
J(t, () => ({
|
|
52
|
+
clear() {
|
|
53
|
+
D(x);
|
|
54
|
+
},
|
|
55
|
+
focus(r) {
|
|
56
|
+
var e;
|
|
57
|
+
(e = c.current[r]) == null || e.focus();
|
|
58
|
+
}
|
|
59
|
+
}), []);
|
|
60
|
+
const L = m(() => E.join("").substring(0, l), [E]), j = m(() => {
|
|
61
|
+
var s;
|
|
62
|
+
const r = E.findIndex((i) => i === ""), e = r === -1 ? l - 1 : r;
|
|
63
|
+
(s = c.current[e]) == null || s.focus();
|
|
64
|
+
}, [E]), K = m((r) => A(null, null, function* () {
|
|
65
|
+
h(!0);
|
|
66
|
+
try {
|
|
67
|
+
(yield f == null ? void 0 : f(r)) ? (D(x), c.current[0] && setTimeout(() => {
|
|
68
|
+
var s;
|
|
69
|
+
return (s = c.current[0]) == null ? void 0 : s.focus();
|
|
70
|
+
}, 0)) : setTimeout(() => {
|
|
71
|
+
var s;
|
|
72
|
+
return (s = c.current[l - 1]) == null ? void 0 : s.focus();
|
|
73
|
+
}, 0);
|
|
74
|
+
} catch (e) {
|
|
75
|
+
throw c.current[l - 1] && setTimeout(() => {
|
|
76
|
+
var s;
|
|
77
|
+
return (s = c.current[l - 1]) == null ? void 0 : s.focus();
|
|
78
|
+
}, 0), e;
|
|
79
|
+
} finally {
|
|
80
|
+
h(!1);
|
|
81
|
+
}
|
|
82
|
+
}), [f]);
|
|
83
|
+
Q(() => {
|
|
84
|
+
const r = L();
|
|
85
|
+
r.length === l && K(r);
|
|
86
|
+
}, [L, K]);
|
|
87
|
+
const v = m((r, e) => {
|
|
88
|
+
r > l - 1 || D((s) => {
|
|
89
|
+
const i = [...s];
|
|
90
|
+
return i[r] = e, i;
|
|
91
|
+
});
|
|
92
|
+
}, []), F = m((r) => {
|
|
93
|
+
var y, C;
|
|
94
|
+
if (a)
|
|
95
|
+
return;
|
|
96
|
+
const { clipboardData: e } = r, s = e.getData("Text");
|
|
97
|
+
if (!/^[0-9]+$/.test(s)) {
|
|
98
|
+
r.preventDefault();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const i = s.split("");
|
|
102
|
+
let u = s.length === l ? 0 : parseInt((y = r.currentTarget.getAttribute("data-digit")) != null ? y : "0", 10);
|
|
103
|
+
i.forEach((W) => {
|
|
104
|
+
v(u, W), u += 1;
|
|
105
|
+
}), (C = c.current[Math.min(u, l - 1)]) == null || C.focus(), r.preventDefault();
|
|
106
|
+
}, [v, a]), Y = m((r) => {
|
|
107
|
+
var y, C;
|
|
108
|
+
const { target: e, target: { value: s } } = r, i = parseInt((y = e.getAttribute("data-digit")) != null ? y : "0", 10), u = (C = s.match(/[0-9]/g)) != null ? C : [];
|
|
109
|
+
if (u.length === 0) {
|
|
110
|
+
v(i, "");
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
u.length === 1 && (v(i, u[0]), w(c.current, e));
|
|
114
|
+
}, [v]), H = m((r) => {
|
|
115
|
+
const { key: e, currentTarget: s, metaKey: i, ctrlKey: u } = r;
|
|
116
|
+
s.value.length === 0 && e === ft ? U(c.current, s) : e === b || e === mt ? (gt(c.current, s, e), r.preventDefault()) : !i && !u && e.length === 1 && !/^[0-9]$/.test(e) && r.preventDefault();
|
|
117
|
+
}, []), O = m((r) => {
|
|
118
|
+
const { currentTarget: e, repeat: s } = r, { value: i } = e;
|
|
119
|
+
!s && /[0-9]/.test(i) && w(c.current, e);
|
|
120
|
+
}, []), V = !a && L().length === l;
|
|
121
|
+
return /* @__PURE__ */ R(
|
|
122
|
+
"fieldset",
|
|
123
|
+
{
|
|
124
|
+
className: $(I.root, o),
|
|
125
|
+
children: [
|
|
126
|
+
g !== !1 && /* @__PURE__ */ _(
|
|
127
|
+
"legend",
|
|
128
|
+
{
|
|
129
|
+
className: I.legend,
|
|
130
|
+
onClick: j,
|
|
131
|
+
children: /* @__PURE__ */ _("span", { children: g != null ? g : p("Support code") })
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ R("div", { className: $(I.digits, V && I.invalid), role: "group", children: [
|
|
135
|
+
E.map((r, e) => /* @__PURE__ */ _(
|
|
136
|
+
"input",
|
|
137
|
+
{
|
|
138
|
+
inputMode: "numeric",
|
|
139
|
+
className: $(I.input, n),
|
|
140
|
+
disabled: a,
|
|
141
|
+
onKeyDown: H,
|
|
142
|
+
onKeyUp: O,
|
|
143
|
+
onChange: Y,
|
|
144
|
+
onPaste: F,
|
|
145
|
+
value: r,
|
|
146
|
+
"data-digit": e,
|
|
147
|
+
ref: (s) => {
|
|
148
|
+
c.current[e] = s;
|
|
149
|
+
},
|
|
150
|
+
autoFocus: d && e === 0,
|
|
151
|
+
"aria-label": p("Digit {{digit}}", { digit: e + 1 })
|
|
152
|
+
},
|
|
153
|
+
e
|
|
154
|
+
)),
|
|
155
|
+
k
|
|
156
|
+
] })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}, ht = (t) => /* @__PURE__ */ T.createElement("svg", P({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", width: 14, height: 14, "aria-hidden": "true" }, t), /* @__PURE__ */ T.createElement("path", { d: "M15 3h6v6" }), /* @__PURE__ */ T.createElement("path", { d: "M10 14 21 3" }), /* @__PURE__ */ T.createElement("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })), _t = "ExternalLink-module__root__7-WiY", Et = {
|
|
161
|
+
root: _t
|
|
162
|
+
}, vt = ({ href: t, children: o }) => /* @__PURE__ */ R("a", { className: Et.root, href: t, target: "_blank", rel: "noopener noreferrer", children: [
|
|
163
|
+
o,
|
|
164
|
+
/* @__PURE__ */ _(ht, {})
|
|
165
|
+
] }), yt = "UserIcon-module__root__-NL30", Ct = {
|
|
166
|
+
root: yt
|
|
167
|
+
}, It = ({ user: t, className: o }) => {
|
|
168
|
+
const n = () => !(t != null && t.name) || t.picture ? "" : t.name.trim().split(/\s+/).map((d) => d.toUpperCase().charAt(0)).join("").slice(0, 2);
|
|
169
|
+
return t ? /* @__PURE__ */ _(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
className: $(Ct.root, o),
|
|
173
|
+
title: t.name,
|
|
174
|
+
style: {
|
|
175
|
+
backgroundImage: t.picture ? `url(${t.picture || ""})` : void 0,
|
|
176
|
+
backgroundColor: t.colour
|
|
177
|
+
},
|
|
178
|
+
children: /* @__PURE__ */ _("span", { children: n() })
|
|
179
|
+
}
|
|
180
|
+
) : null;
|
|
181
|
+
}, Rt = pt, wt = vt, Kt = tt, St = et, Nt = nt, Pt = ot, At = It, Mt = rt, bt = st, Bt = ct;
|
|
182
|
+
export {
|
|
183
|
+
Rt as CodeEntry,
|
|
184
|
+
St as Device,
|
|
185
|
+
wt as ExternalLink,
|
|
186
|
+
bt as Loader,
|
|
187
|
+
Kt as PlatformIcon,
|
|
188
|
+
Mt as RefreshButton,
|
|
189
|
+
Nt as Session,
|
|
190
|
+
Pt as SmartConnectButton,
|
|
191
|
+
At as UserIcon,
|
|
192
|
+
Bt as i18n
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=cobrowse-agent-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cobrowse-agent-ui.js","sources":["../lib/components/CodeEntry/index.tsx","../lib/icons/external-link.svg?react","../lib/components/ExternalLink/index.tsx","../lib/components/UserIcon/index.tsx","../lib/main.ts"],"sourcesContent":["import {\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n type ForwardedRef,\n type ReactNode,\n type ClipboardEvent,\n type ChangeEvent,\n type KeyboardEvent\n} from 'react'\nimport { useTranslation } from 'react-i18next'\nimport clsx from 'clsx'\nimport styles from './CodeEntry.module.css'\n\nexport interface CodeEntryHandle {\n clear: () => void\n focus: (index: number) => void\n}\n\nexport interface CodeEntryProps {\n ref?: ForwardedRef<CodeEntryHandle>\n className?: string\n inputClassName?: string\n focusOnRender?: boolean\n onCode?: (code: string) => Promise<boolean> | boolean\n label?: ReactNode | false\n children?: ReactNode\n}\n\nconst CODE_LENGTH = 6\nconst EMTPY_STATE = Array<string>(CODE_LENGTH).fill('')\nconst KEY_BACKSPACE = 'Backspace'\nconst KEY_ARROW_LEFT = 'ArrowLeft'\nconst KEY_ARROW_RIGHT = 'ArrowRight'\n\nconst getElementIndex = (refsArr: Array<HTMLInputElement | null>, elem: HTMLInputElement) =>\n refsArr.findIndex((el) => el === elem)\n\nconst focusPreviousInput = (refsArr: Array<HTMLInputElement | null>, elem: HTMLInputElement) => {\n refsArr[Math.max(getElementIndex(refsArr, elem) - 1, 0)]?.focus()\n}\n\nconst focusNextInput = (refsArr: Array<HTMLInputElement | null>, elem: HTMLInputElement) => {\n refsArr[Math.min(getElementIndex(refsArr, elem) + 1, CODE_LENGTH - 1)]?.focus()\n}\n\nconst moveFocusForArrowKey = (\n refsArr: Array<HTMLInputElement | null>,\n elem: HTMLInputElement,\n key: typeof KEY_ARROW_LEFT | typeof KEY_ARROW_RIGHT\n) => {\n const isRTL = getComputedStyle(elem).direction === 'rtl'\n const movesToPrevious = key === KEY_ARROW_LEFT ? !isRTL : isRTL\n\n if (movesToPrevious) {\n focusPreviousInput(refsArr, elem)\n } else {\n focusNextInput(refsArr, elem)\n }\n}\n\nconst CodeEntry = ({ ref, className, inputClassName, focusOnRender = false, onCode, label, children }: CodeEntryProps) => {\n const { t } = useTranslation()\n const [validating, setValidating] = useState(false)\n const [code, setCode] = useState(EMTPY_STATE)\n const refs = useRef<Array<HTMLInputElement | null>>([])\n\n useImperativeHandle(ref, () => ({\n clear () {\n setCode(EMTPY_STATE)\n },\n focus (index) {\n refs.current[index]?.focus()\n }\n }), [])\n\n const getCode = useCallback(() => code.join('').substring(0, CODE_LENGTH), [code])\n\n const focusFirstEmptyInput = useCallback(() => {\n const firstEmptyIndex = code.findIndex((digit) => digit === '')\n const targetIndex = firstEmptyIndex === -1 ? CODE_LENGTH - 1 : firstEmptyIndex\n\n refs.current[targetIndex]?.focus()\n }, [code])\n\n const tryComplete = useCallback(async (codeValue: string) => {\n setValidating(true)\n\n try {\n const isValid = await onCode?.(codeValue)\n\n if (isValid) {\n setCode(EMTPY_STATE)\n\n if (refs.current[0]) {\n setTimeout(() => refs.current[0]?.focus(), 0)\n }\n } else {\n setTimeout(() => refs.current[CODE_LENGTH - 1]?.focus(), 0)\n }\n } catch (e) {\n if (refs.current[CODE_LENGTH - 1]) {\n setTimeout(() => refs.current[CODE_LENGTH - 1]?.focus(), 0)\n }\n\n throw e\n } finally {\n setValidating(false)\n }\n }, [onCode])\n\n // Run the tryComplete function when the code state changes\n useEffect(() => {\n const code = getCode()\n\n if (code.length !== CODE_LENGTH) {\n return\n }\n\n void tryComplete(code)\n }, [getCode, tryComplete])\n\n const setDigit = useCallback((digit: number, value: string) => {\n if (digit > (CODE_LENGTH - 1)) {\n return\n }\n\n setCode((code) => {\n const updatedCode = [...code]\n\n updatedCode[digit] = value\n\n return updatedCode\n })\n }, [])\n\n const handlePaste = useCallback((event: ClipboardEvent<HTMLInputElement>) => {\n if (validating) {\n return\n }\n\n const { clipboardData } = event\n const pastedData = clipboardData.getData('Text')\n\n // Exit early if the pasted data contains anything other than just digits\n if (!/^[0-9]+$/.test(pastedData)) {\n event.preventDefault()\n\n return\n }\n\n const digits = pastedData.split('')\n // Start pasting from the first digit if the clipboard holds a full code,\n // otherwise just paste from the currently selected input onwards\n let digit = pastedData.length === CODE_LENGTH\n ? 0\n : parseInt(event.currentTarget.getAttribute('data-digit') ?? '0', 10)\n\n digits.forEach((value) => {\n setDigit(digit, value)\n\n digit += 1\n })\n\n refs.current[Math.min(digit, CODE_LENGTH - 1)]?.focus()\n\n event.preventDefault()\n }, [setDigit, validating])\n\n const handleOnChange = useCallback((event: ChangeEvent<HTMLInputElement>) => {\n const { target, target: { value } } = event\n const digit = parseInt(target.getAttribute('data-digit') ?? '0', 10)\n const digits = value.match(/[0-9]/g) ?? []\n\n if (digits.length === 0) {\n setDigit(digit, '')\n\n return\n }\n\n if (digits.length === 1) {\n setDigit(digit, digits[0])\n focusNextInput(refs.current, target)\n }\n }, [setDigit])\n\n const handleKeyDown = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n const { key, currentTarget, metaKey, ctrlKey } = event\n\n // On backspace on empty node go back to previous\n if (currentTarget.value.length === 0 && key === KEY_BACKSPACE) {\n focusPreviousInput(refs.current, currentTarget)\n } else if (key === KEY_ARROW_LEFT || key === KEY_ARROW_RIGHT) {\n // Move focus according to visual direction\n moveFocusForArrowKey(refs.current, currentTarget, key)\n event.preventDefault()\n } else if (!metaKey && !ctrlKey && key.length === 1 && !/^[0-9]$/.test(key)) {\n // Prevent non-numeric characters that might appear in numbers (e.g 'e')\n // but allow backspaces too\n event.preventDefault()\n }\n }, [])\n\n const handleKeyUp = useCallback((event: KeyboardEvent<HTMLInputElement>) => {\n const { currentTarget, repeat } = event\n const { value } = currentTarget\n\n if (!repeat && /[0-9]/.test(value)) {\n focusNextInput(refs.current, currentTarget)\n }\n }, [])\n\n const invalid = !validating && getCode().length === CODE_LENGTH\n\n return (\n <fieldset\n className={clsx(styles.root, className)}\n >\n {label !== false && (\n <legend\n className={styles.legend}\n onClick={focusFirstEmptyInput}\n >\n <span>{label ?? t('Support code')}</span>\n </legend>\n )}\n <div className={clsx(styles.digits, invalid && styles.invalid)} role='group'>\n {code.map((value, index) => (\n <input\n key={index}\n inputMode='numeric'\n className={clsx(styles.input, inputClassName)}\n disabled={validating}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onChange={handleOnChange}\n onPaste={handlePaste}\n value={value}\n data-digit={index}\n ref={(el) => { refs.current[index] = el }}\n autoFocus={focusOnRender && index === 0}\n aria-label={t('Digit {{digit}}', { digit: index + 1 })}\n />\n ))}\n {children}\n </div>\n </fieldset>\n )\n}\n\nexport default CodeEntry\n","import * as React from \"react\";\nconst SvgExternalLink = (props) => /* @__PURE__ */ React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 24 24\", fill: \"none\", stroke: \"currentColor\", strokeWidth: 2, strokeLinecap: \"round\", strokeLinejoin: \"round\", width: 14, height: 14, \"aria-hidden\": \"true\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M15 3h6v6\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M10 14 21 3\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" }));\nexport default SvgExternalLink;\n","import type { ReactNode } from 'react'\nimport IconExternalLink from '@/icons/external-link.svg?react'\nimport styles from './ExternalLink.module.css'\n\nexport interface ExternalLinkProps {\n href: string\n children?: ReactNode\n}\n\nconst ExternalLink = ({ href, children }: ExternalLinkProps) => (\n <a className={styles.root} href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n {children}\n <IconExternalLink />\n </a>\n)\n\nexport default ExternalLink\n","import clsx from 'clsx'\nimport styles from './UserIcon.module.css'\n\nexport interface UserIconUser {\n name?: string\n picture?: string\n colour?: string\n}\n\nexport interface UserIconProps {\n user?: UserIconUser\n className?: string\n}\n\nconst UserIcon = ({ user, className }: UserIconProps) => {\n const initials = (): string => {\n if (!user?.name || user.picture) return ''\n\n return user.name\n .trim()\n .split(/\\s+/)\n .map(part => part.toUpperCase().charAt(0))\n .join('')\n .slice(0, 2)\n }\n\n if (!user) return null\n\n return (\n <div\n className={clsx(styles.root, className)}\n title={user.name}\n style={{\n backgroundImage: user.picture ? `url(${user.picture || ''})` : undefined,\n backgroundColor: user.colour\n }}\n >\n <span>{initials()}</span>\n </div>\n )\n}\n\nexport default UserIcon\n","import CodeEntryComponent from '@/components/CodeEntry'\nimport ExternalLinkComponent from '@/components/ExternalLink'\nimport PlatformIconComponent from '@/components/PlatformIcon'\nimport DeviceComponent from '@/components/Device'\nimport SessionComponent from '@/components/Session'\nimport SmartConnectButtonComponent from '@/components/SmartConnectButton'\nimport UserIconComponent from '@/components/UserIcon'\nimport RefreshButtonComponent from '@/components/RefreshButton'\nimport LoaderComponent from '@/components/Loader'\nimport i18nInstance from '@/i18n'\n\nexport type { CodeEntryProps } from '@/components/CodeEntry'\nexport type { ExternalLinkProps } from '@/components/ExternalLink'\nexport type { DeviceData, DeviceProps } from '@/components/Device'\nexport type { SessionData, SessionProps } from '@/components/Session'\nexport type { SmartConnectButtonProps } from '@/components/SmartConnectButton'\nexport type { RefreshButtonProps } from '@/components/RefreshButton'\nexport type { LoaderProps } from '@/components/Loader'\n\nexport const CodeEntry = CodeEntryComponent\nexport const ExternalLink = ExternalLinkComponent\nexport const PlatformIcon = PlatformIconComponent\nexport const Device = DeviceComponent\nexport const Session = SessionComponent\nexport const SmartConnectButton = SmartConnectButtonComponent\nexport const UserIcon = UserIconComponent\nexport const RefreshButton = RefreshButtonComponent\nexport const Loader = LoaderComponent\nexport const i18n = i18nInstance\n"],"names":["CODE_LENGTH","EMTPY_STATE","KEY_BACKSPACE","KEY_ARROW_LEFT","KEY_ARROW_RIGHT","getElementIndex","refsArr","elem","el","focusPreviousInput","_a","focusNextInput","moveFocusForArrowKey","key","isRTL","CodeEntry","ref","className","inputClassName","focusOnRender","onCode","label","children","t","useTranslation","validating","setValidating","useState","code","setCode","refs","useRef","useImperativeHandle","index","getCode","useCallback","focusFirstEmptyInput","firstEmptyIndex","digit","targetIndex","tryComplete","codeValue","__async","useEffect","setDigit","value","updatedCode","handlePaste","event","clipboardData","pastedData","digits","_b","handleOnChange","target","handleKeyDown","currentTarget","metaKey","ctrlKey","handleKeyUp","repeat","invalid","jsxs","clsx","styles","jsx","SvgExternalLink","props","React","__spreadValues","ExternalLink","href","IconExternalLink","UserIcon","user","initials","part","CodeEntryComponent","ExternalLinkComponent","PlatformIcon","PlatformIconComponent","Device","DeviceComponent","Session","SessionComponent","SmartConnectButton","SmartConnectButtonComponent","UserIconComponent","RefreshButton","RefreshButtonComponent","Loader","LoaderComponent","i18n","i18nInstance"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BMA,IAAc,GACdC,IAAc,MAAcD,CAAW,EAAE,KAAK,EAAE,GAChDE,KAAgB,aAChBC,IAAiB,aACjBC,KAAkB,cAElBC,IAA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