@adminide-stack/clock-tik-browser 12.0.35 → 12.0.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/lib/pages/Home/__tests__/connectors.test.d.ts +2 -0
- package/lib/pages/Home/__tests__/connectors.test.d.ts.map +1 -0
- package/lib/pages/Home/__tests__/history.test.d.ts +2 -0
- package/lib/pages/Home/__tests__/history.test.d.ts.map +1 -0
- package/lib/pages/Home/chat/ChoresChat.d.ts.map +1 -1
- package/lib/pages/Home/chat/ChoresChat.js +163 -32
- package/lib/pages/Home/chat/ChoresChat.js.map +1 -1
- package/lib/pages/Home/chat/ChoresPanel.d.ts +10 -1
- package/lib/pages/Home/chat/ChoresPanel.d.ts.map +1 -1
- package/lib/pages/Home/chat/ChoresPanel.js +24 -17
- package/lib/pages/Home/chat/ChoresPanel.js.map +1 -1
- package/lib/pages/Home/chat/ConnectorsPanel.d.ts +23 -0
- package/lib/pages/Home/chat/ConnectorsPanel.d.ts.map +1 -0
- package/lib/pages/Home/chat/ConnectorsPanel.js +132 -0
- package/lib/pages/Home/chat/ConnectorsPanel.js.map +1 -0
- package/lib/pages/Home/chat/HistoryPanel.d.ts +27 -0
- package/lib/pages/Home/chat/HistoryPanel.d.ts.map +1 -0
- package/lib/pages/Home/chat/HistoryPanel.js +234 -0
- package/lib/pages/Home/chat/HistoryPanel.js.map +1 -0
- package/lib/pages/Home/chat/chatTheme.d.ts.map +1 -1
- package/lib/pages/Home/chat/chatTheme.js +249 -7
- package/lib/pages/Home/chat/chatTheme.js.map +1 -1
- package/lib/pages/Home/chat/connectors.d.ts +37 -0
- package/lib/pages/Home/chat/connectors.d.ts.map +1 -0
- package/lib/pages/Home/chat/connectors.js +73 -0
- package/lib/pages/Home/chat/connectors.js.map +1 -0
- package/lib/pages/Home/chat/history.d.ts +51 -0
- package/lib/pages/Home/chat/history.d.ts.map +1 -0
- package/lib/pages/Home/chat/history.js +186 -0
- package/lib/pages/Home/chat/history.js.map +1 -0
- package/lib/pages/Home/chat/lucy.d.ts.map +1 -1
- package/lib/pages/Home/chat/lucy.js +1 -1
- package/lib/pages/Home/chat/lucy.js.map +1 -1
- package/lib/pages/Home/chat/thread.d.ts +2 -0
- package/lib/pages/Home/chat/thread.d.ts.map +1 -1
- package/lib/pages/Home/chat/thread.js +4 -3
- package/lib/pages/Home/chat/thread.js.map +1 -1
- package/lib/pages/Home/chat/tour/tourSteps.d.ts +4 -3
- package/lib/pages/Home/chat/tour/tourSteps.d.ts.map +1 -1
- package/lib/pages/Home/chat/tour/tourSteps.js +23 -3
- package/lib/pages/Home/chat/tour/tourSteps.js.map +1 -1
- package/lib/pages/Home/chat/useChores.d.ts +5 -0
- package/lib/pages/Home/chat/useChores.d.ts.map +1 -1
- package/lib/pages/Home/chat/useChores.js +4 -1
- package/lib/pages/Home/chat/useChores.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import {jsxs,Fragment,jsx}from'react/jsx-runtime';import {useRef,useEffect}from'react';import {SiGmail}from'@react-icons/all-files/si/SiGmail.js';import {SiGooglecalendar}from'@react-icons/all-files/si/SiGooglecalendar.js';import {X,Plug,ArrowUpRight,CreditCard,House,KeyRound}from'lucide-react';import {useAnchoredPanel}from'./ChoresPanel.js';import {allConnectorsLink,CONNECTOR_GROUPS,LUCY_CONNECTORS,connectVerb,connectLink,appHost}from'./connectors.js';/** What is kept in Yantra's vault, drawn as the chat draws its own things. */
|
|
2
|
+
const KIND_ICONS = {
|
|
3
|
+
'site-login': KeyRound,
|
|
4
|
+
'autofill-address': House,
|
|
5
|
+
'autofill-payment-card': CreditCard
|
|
6
|
+
};
|
|
7
|
+
/** An app's own mark in its colours on a white tile; anything else in the chat's warm tile. */
|
|
8
|
+
function ConnectorLogo({
|
|
9
|
+
id,
|
|
10
|
+
size = 17,
|
|
11
|
+
className = ''
|
|
12
|
+
}) {
|
|
13
|
+
if (id === 'google-calendar' || id === 'google-gmail') {
|
|
14
|
+
const Mark = id === 'google-calendar' ? SiGooglecalendar : SiGmail;
|
|
15
|
+
return jsx("span", {
|
|
16
|
+
className: `cbh-apps-logo ${className}`,
|
|
17
|
+
"aria-hidden": true,
|
|
18
|
+
children: jsx(Mark, {
|
|
19
|
+
size: size,
|
|
20
|
+
color: id === 'google-calendar' ? '#4285F4' : '#EA4335'
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const Icon = KIND_ICONS[id] ?? Plug;
|
|
25
|
+
return jsx("span", {
|
|
26
|
+
className: `cbh-chores-icon ${className}`,
|
|
27
|
+
"aria-hidden": true,
|
|
28
|
+
children: jsx(Icon, {
|
|
29
|
+
size: size - 1
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function ConnectorsPanel({
|
|
34
|
+
open,
|
|
35
|
+
onClose,
|
|
36
|
+
appUrl,
|
|
37
|
+
anchor
|
|
38
|
+
}) {
|
|
39
|
+
const panelRef = useRef(null);
|
|
40
|
+
const place = useAnchoredPanel(open, anchor, onClose);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (open) panelRef.current?.focus();
|
|
43
|
+
}, [open]);
|
|
44
|
+
if (!open) return null;
|
|
45
|
+
const everything = allConnectorsLink(appUrl);
|
|
46
|
+
return jsxs(Fragment, {
|
|
47
|
+
children: [jsx("div", {
|
|
48
|
+
className: "cbh-chores-scrim",
|
|
49
|
+
onClick: onClose,
|
|
50
|
+
"aria-hidden": true
|
|
51
|
+
}), jsxs("div", {
|
|
52
|
+
ref: panelRef,
|
|
53
|
+
role: "dialog",
|
|
54
|
+
"aria-label": "Connect your apps",
|
|
55
|
+
tabIndex: -1,
|
|
56
|
+
className: "cbh-chores cbh-apps",
|
|
57
|
+
style: place,
|
|
58
|
+
children: [jsxs("div", {
|
|
59
|
+
className: "cbh-chores-head",
|
|
60
|
+
children: [jsxs("div", {
|
|
61
|
+
children: [jsx("h2", {
|
|
62
|
+
children: "Connect your apps"
|
|
63
|
+
}), jsx("p", {
|
|
64
|
+
children: "Lucy can do more once they\u2019re connected. You connect them on Yantra, where Clockbook runs."
|
|
65
|
+
})]
|
|
66
|
+
}), jsx("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
className: "cbh-chores-close",
|
|
69
|
+
onClick: onClose,
|
|
70
|
+
"aria-label": "Close",
|
|
71
|
+
children: jsx(X, {
|
|
72
|
+
size: 16,
|
|
73
|
+
"aria-hidden": true
|
|
74
|
+
})
|
|
75
|
+
})]
|
|
76
|
+
}), jsxs("div", {
|
|
77
|
+
className: "cbh-chores-body",
|
|
78
|
+
children: [CONNECTOR_GROUPS.map(([group, heading]) => jsxs("section", {
|
|
79
|
+
className: "cbh-chores-section",
|
|
80
|
+
children: [jsx("h3", {
|
|
81
|
+
children: heading
|
|
82
|
+
}), jsx("ul", {
|
|
83
|
+
children: LUCY_CONNECTORS.filter(c => c.group === group).map(c => {
|
|
84
|
+
const verb = connectVerb(c);
|
|
85
|
+
const href = connectLink(appUrl, c.id);
|
|
86
|
+
return jsxs("li", {
|
|
87
|
+
className: "cbh-apps-row",
|
|
88
|
+
children: [jsx(ConnectorLogo, {
|
|
89
|
+
id: c.id
|
|
90
|
+
}), jsxs("span", {
|
|
91
|
+
className: "cbh-chores-row-text",
|
|
92
|
+
children: [jsx("b", {
|
|
93
|
+
children: c.name
|
|
94
|
+
}), jsx("small", {
|
|
95
|
+
children: c.does
|
|
96
|
+
})]
|
|
97
|
+
}), href ? jsx("a", {
|
|
98
|
+
className: "cbh-apps-connect",
|
|
99
|
+
"data-group": c.group,
|
|
100
|
+
href: href,
|
|
101
|
+
target: "_blank",
|
|
102
|
+
rel: "noopener noreferrer",
|
|
103
|
+
"data-track": "chat_app_connect",
|
|
104
|
+
"aria-label": `${verb} ${c.name} on Yantra, in a new tab`,
|
|
105
|
+
children: verb
|
|
106
|
+
}) : null]
|
|
107
|
+
}, c.id);
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
}, group)), everything ? jsxs("a", {
|
|
111
|
+
className: "cbh-apps-all",
|
|
112
|
+
href: everything,
|
|
113
|
+
target: "_blank",
|
|
114
|
+
rel: "noopener noreferrer",
|
|
115
|
+
"data-track": "chat_apps_all",
|
|
116
|
+
children: [jsx(Plug, {
|
|
117
|
+
size: 15,
|
|
118
|
+
"aria-hidden": true
|
|
119
|
+
}), jsx("span", {
|
|
120
|
+
children: "Every connector on Yantra"
|
|
121
|
+
}), jsx(ArrowUpRight, {
|
|
122
|
+
size: 15,
|
|
123
|
+
"aria-hidden": true
|
|
124
|
+
})]
|
|
125
|
+
}) : null, jsxs("p", {
|
|
126
|
+
className: "cbh-apps-note",
|
|
127
|
+
children: ["Opens ", appHost(appUrl) || 'Yantra', " in a new tab. Lucy asks before she pays or changes an account."]
|
|
128
|
+
})]
|
|
129
|
+
})]
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
|
+
}export{ConnectorLogo,ConnectorsPanel};//# sourceMappingURL=ConnectorsPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorsPanel.js","sources":["../../../../src/pages/Home/chat/ConnectorsPanel.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"ycAaA;AACA,MAAM,UAAU,GAA+B;AAC3C,EAAA,YAAA,EAAY,QAAU;AACtB,EAAA,kBAAA,EAAkB,KAAO;AACzB,EAAA,uBAAA,EAAuB;CAC1B;AAED;AACgB,SAAA,aAAa,CAAC;IAC1B;AACI,EAAA,IAAA,GAAA,EAAA;AACA,EAAA,SAAA,GAAA;;MAME,EAAA,KAAA,iBAAoB,IAAC,OAAS,cAAA,EAAA;AACpC,IAAA,MAAA,IACU,GAAA,EAAA,KAAA,iBAA8B,GAAA,gBAAA,GAAA,OAChC;AAGZ,IAAC,OAAAA,GAAA,CAAA,MAAA,EAAA;AAWD,MAAM,SAAA,EAAyB,CAAA,cAAC,EAAE,SAAM,CAAA,CAAA;AACpC,MAAA,aAAiB,EAAA,IAAA;MACX,QAAA,EAAQA,GAAA,CAAA,IAAA,EAAA;QACL,IAAA,EAAC,IAAK;AACX,QAAA,KAAQ,EAAA,EAAA,KAAA,iBAAA,GAAA,SAAA,GAAA;AAAE,OAAA;AACd,KAAC,CAAE;AAEH;AAAW,EAAA,MAAA,IAAA,GAAO,UAAK,CAAA,EAAA,CAAA,IAAA,IAAA;AACvB,EAAA,OAAAA,UAAgB,EAAG;IACnB,SAEQ,EAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,CAAA;AA0BwB,IAAA,aAAA,EAAA,IAAA;;AAEA,MAAA,IAAA,EAAA,IAAA,GAAA;AAsBJ,KAAA;AAyBhC,GAAC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The chat's history: the conversations New chat put away (history.ts), to open one again. The
|
|
3
|
+
* Chores panel's sheet and card (ChoresPanel, chatTheme.tsx), holding past chats instead, newest
|
|
4
|
+
* first and by day. Opening one while Lucy works asks first, as New chat does: it stops her chore.
|
|
5
|
+
*/
|
|
6
|
+
import { type RefObject } from 'react';
|
|
7
|
+
import { type PastChat } from './history';
|
|
8
|
+
/** The header's way in, beside New chat. */
|
|
9
|
+
export declare function HistoryButton({ open, onClick, buttonRef, }: {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
buttonRef: RefObject<HTMLButtonElement | null>;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export interface HistoryPanelProps {
|
|
15
|
+
/** The past chats, newest first (listPastChats). */
|
|
16
|
+
chats: readonly PastChat[];
|
|
17
|
+
open: boolean;
|
|
18
|
+
/** Lucy is on a chore in the chat on screen: opening another one stops it, so it asks first. */
|
|
19
|
+
busy: boolean;
|
|
20
|
+
onOpen: (id: string) => void;
|
|
21
|
+
onDelete: (id: string) => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
/** The header button: on a wide screen the panel hangs under it, and focus goes back to it. */
|
|
24
|
+
anchor: RefObject<HTMLButtonElement | null>;
|
|
25
|
+
}
|
|
26
|
+
export declare function HistoryPanel({ chats, open, busy, onOpen, onDelete, onClose, anchor }: HistoryPanelProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=HistoryPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryPanel.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/HistoryPanel.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1F,OAAO,EAAqC,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE7E,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,EAC1B,IAAI,EACJ,OAAO,EACP,SAAS,GACZ,EAAE;IACC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAClD,+BAqBA;AAED,MAAM,WAAW,iBAAiB;IAC9B,oDAAoD;IACpD,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,gGAAgG;IAChG,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+FAA+F;IAC/F,MAAM,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC/C;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,iBAAiB,+BAgLvG"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useRef,useState,useCallback,useEffect,useMemo}from'react';import {History,X,MessageSquareText,Trash2}from'lucide-react';import {useNow,useAnchoredPanel}from'./ChoresPanel.js';import {chatWhen,CHAT_AGES}from'./history.js';/** The header's way in, beside New chat. */
|
|
2
|
+
function HistoryButton({
|
|
3
|
+
open,
|
|
4
|
+
onClick,
|
|
5
|
+
buttonRef
|
|
6
|
+
}) {
|
|
7
|
+
return jsxs("button", {
|
|
8
|
+
ref: buttonRef,
|
|
9
|
+
type: "button",
|
|
10
|
+
"data-tour": "history",
|
|
11
|
+
"data-track": "chat_history",
|
|
12
|
+
onClick: onClick,
|
|
13
|
+
"aria-haspopup": "dialog",
|
|
14
|
+
"aria-expanded": open,
|
|
15
|
+
"aria-label": "Chat history",
|
|
16
|
+
title: "Your past chats",
|
|
17
|
+
// A phone's header has no room for the word.
|
|
18
|
+
className: `inline-flex items-center gap-1.5 rounded-md p-1.5 text-xs font-medium hover:bg-muted hover:text-foreground sm:px-2 ${open ? 'bg-muted text-foreground' : 'text-muted-foreground'}`,
|
|
19
|
+
children: [jsx(History, {
|
|
20
|
+
className: "h-4 w-4",
|
|
21
|
+
"aria-hidden": true
|
|
22
|
+
}), jsx("span", {
|
|
23
|
+
className: "hidden sm:inline",
|
|
24
|
+
children: "History"
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function HistoryPanel({
|
|
29
|
+
chats,
|
|
30
|
+
open,
|
|
31
|
+
busy,
|
|
32
|
+
onOpen,
|
|
33
|
+
onDelete,
|
|
34
|
+
onClose,
|
|
35
|
+
anchor
|
|
36
|
+
}) {
|
|
37
|
+
const panelRef = useRef(null);
|
|
38
|
+
const now = useNow(open, 60_000);
|
|
39
|
+
const place = useAnchoredPanel(open, anchor, onClose);
|
|
40
|
+
// The chat to open once the person says so (Lucy is working), and the one to delete once they do.
|
|
41
|
+
const [opening, setOpening] = useState(null);
|
|
42
|
+
const [deleting, setDeleting] = useState(null);
|
|
43
|
+
// A question's first answer takes the focus, as the button that asked it goes.
|
|
44
|
+
const focusFirst = useCallback(button => button?.focus(), []);
|
|
45
|
+
// Each time it opens: read from the top, with no question left over from the last time.
|
|
46
|
+
const bodyRef = useRef(null);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
setOpening(null);
|
|
49
|
+
setDeleting(null);
|
|
50
|
+
if (!open) return;
|
|
51
|
+
if (bodyRef.current) bodyRef.current.scrollTop = 0;
|
|
52
|
+
panelRef.current?.focus();
|
|
53
|
+
}, [open]);
|
|
54
|
+
// She finished while it was asking: there is no chore left to stop.
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (!busy) setOpening(null);
|
|
57
|
+
}, [busy]);
|
|
58
|
+
const sections = useMemo(() => {
|
|
59
|
+
const byAge = new Map();
|
|
60
|
+
for (const chat of chats) {
|
|
61
|
+
const {
|
|
62
|
+
age,
|
|
63
|
+
label
|
|
64
|
+
} = chatWhen(chat.at, now);
|
|
65
|
+
byAge.set(age, [...(byAge.get(age) ?? []), {
|
|
66
|
+
chat,
|
|
67
|
+
when: label
|
|
68
|
+
}]);
|
|
69
|
+
}
|
|
70
|
+
return CHAT_AGES.flatMap(age => {
|
|
71
|
+
const rows = byAge.get(age);
|
|
72
|
+
return rows ? [{
|
|
73
|
+
age,
|
|
74
|
+
rows
|
|
75
|
+
}] : [];
|
|
76
|
+
});
|
|
77
|
+
}, [chats, now]);
|
|
78
|
+
const settle = () => {
|
|
79
|
+
setDeleting(null);
|
|
80
|
+
panelRef.current?.focus();
|
|
81
|
+
};
|
|
82
|
+
if (!open) return null;
|
|
83
|
+
return jsxs(Fragment, {
|
|
84
|
+
children: [jsx("div", {
|
|
85
|
+
className: "cbh-chores-scrim",
|
|
86
|
+
onClick: onClose,
|
|
87
|
+
"aria-hidden": true
|
|
88
|
+
}), jsxs("div", {
|
|
89
|
+
ref: panelRef,
|
|
90
|
+
role: "dialog",
|
|
91
|
+
"aria-label": "Your past chats",
|
|
92
|
+
tabIndex: -1,
|
|
93
|
+
className: "cbh-chores cbh-history",
|
|
94
|
+
style: place,
|
|
95
|
+
children: [jsxs("div", {
|
|
96
|
+
className: "cbh-chores-head",
|
|
97
|
+
children: [jsxs("div", {
|
|
98
|
+
children: [jsx("h2", {
|
|
99
|
+
children: "Your past chats"
|
|
100
|
+
}), jsx("p", {
|
|
101
|
+
children: "Kept on this device. Lucy picks up where you left off."
|
|
102
|
+
})]
|
|
103
|
+
}), jsx("button", {
|
|
104
|
+
type: "button",
|
|
105
|
+
className: "cbh-chores-close",
|
|
106
|
+
onClick: onClose,
|
|
107
|
+
"aria-label": "Close",
|
|
108
|
+
children: jsx(X, {
|
|
109
|
+
size: 16,
|
|
110
|
+
"aria-hidden": true
|
|
111
|
+
})
|
|
112
|
+
})]
|
|
113
|
+
}), jsx("div", {
|
|
114
|
+
className: "cbh-chores-body",
|
|
115
|
+
ref: bodyRef,
|
|
116
|
+
children: sections.length ? sections.map(({
|
|
117
|
+
age,
|
|
118
|
+
rows
|
|
119
|
+
}) => jsxs("section", {
|
|
120
|
+
className: "cbh-chores-section",
|
|
121
|
+
children: [jsx("h3", {
|
|
122
|
+
children: age
|
|
123
|
+
}), jsx("ul", {
|
|
124
|
+
children: rows.map(({
|
|
125
|
+
chat,
|
|
126
|
+
when
|
|
127
|
+
}) => jsxs("li", {
|
|
128
|
+
children: [deleting === chat.id ? jsxs("div", {
|
|
129
|
+
className: "cbh-history-ask",
|
|
130
|
+
role: "group",
|
|
131
|
+
"aria-label": "Delete this chat?",
|
|
132
|
+
children: [jsxs("p", {
|
|
133
|
+
children: [jsxs("b", {
|
|
134
|
+
children: ["Delete \u201C", chat.title, "\u201D?"]
|
|
135
|
+
}), "It\u2019s gone from this device for good."]
|
|
136
|
+
}), jsxs("div", {
|
|
137
|
+
className: "cbh-history-ask-actions",
|
|
138
|
+
children: [jsx("button", {
|
|
139
|
+
type: "button",
|
|
140
|
+
ref: focusFirst,
|
|
141
|
+
onClick: settle,
|
|
142
|
+
children: "Cancel"
|
|
143
|
+
}), jsx("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
className: "cbh-history-danger",
|
|
146
|
+
"data-track": "chat_history_delete",
|
|
147
|
+
onClick: () => {
|
|
148
|
+
onDelete(chat.id);
|
|
149
|
+
settle();
|
|
150
|
+
},
|
|
151
|
+
children: "Delete"
|
|
152
|
+
})]
|
|
153
|
+
})]
|
|
154
|
+
}) : jsxs("div", {
|
|
155
|
+
className: "cbh-history-line",
|
|
156
|
+
children: [jsxs("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
className: "cbh-chores-row",
|
|
159
|
+
"data-track": "chat_history_open",
|
|
160
|
+
onClick: () => busy ? setOpening(chat.id) : onOpen(chat.id),
|
|
161
|
+
"aria-expanded": busy ? opening === chat.id : undefined,
|
|
162
|
+
children: [jsx("span", {
|
|
163
|
+
className: "cbh-chores-icon",
|
|
164
|
+
"aria-hidden": true,
|
|
165
|
+
children: jsx(MessageSquareText, {
|
|
166
|
+
size: 16
|
|
167
|
+
})
|
|
168
|
+
}), jsxs("span", {
|
|
169
|
+
className: "cbh-chores-row-text",
|
|
170
|
+
children: [jsx("b", {
|
|
171
|
+
children: chat.title
|
|
172
|
+
}), jsx("small", {
|
|
173
|
+
children: when
|
|
174
|
+
})]
|
|
175
|
+
})]
|
|
176
|
+
}), jsx("button", {
|
|
177
|
+
type: "button",
|
|
178
|
+
className: "cbh-history-delete",
|
|
179
|
+
onClick: () => {
|
|
180
|
+
setOpening(null);
|
|
181
|
+
setDeleting(chat.id);
|
|
182
|
+
},
|
|
183
|
+
"aria-label": `Delete “${chat.title}”`,
|
|
184
|
+
title: "Delete chat",
|
|
185
|
+
children: jsx(Trash2, {
|
|
186
|
+
size: 15,
|
|
187
|
+
"aria-hidden": true
|
|
188
|
+
})
|
|
189
|
+
})]
|
|
190
|
+
}), opening === chat.id && deleting !== chat.id ? jsxs("div", {
|
|
191
|
+
className: "cbh-history-ask",
|
|
192
|
+
role: "group",
|
|
193
|
+
"aria-label": "Open this chat?",
|
|
194
|
+
children: [jsxs("p", {
|
|
195
|
+
children: [jsx("b", {
|
|
196
|
+
children: "Lucy is still working."
|
|
197
|
+
}), "Opening this chat stops the chore she\u2019s on."]
|
|
198
|
+
}), jsxs("div", {
|
|
199
|
+
className: "cbh-history-ask-actions",
|
|
200
|
+
children: [jsx("button", {
|
|
201
|
+
type: "button",
|
|
202
|
+
ref: focusFirst,
|
|
203
|
+
onClick: () => setOpening(null),
|
|
204
|
+
children: "Keep going"
|
|
205
|
+
}), jsx("button", {
|
|
206
|
+
type: "button",
|
|
207
|
+
className: "cbh-history-go",
|
|
208
|
+
onClick: () => onOpen(chat.id),
|
|
209
|
+
children: "Open chat"
|
|
210
|
+
})]
|
|
211
|
+
})]
|
|
212
|
+
}) : null]
|
|
213
|
+
}, chat.id))
|
|
214
|
+
})]
|
|
215
|
+
}, age)) : jsxs("div", {
|
|
216
|
+
className: "cbh-chores-empty",
|
|
217
|
+
children: [jsx("span", {
|
|
218
|
+
className: "cbh-chores-icon",
|
|
219
|
+
"aria-hidden": true,
|
|
220
|
+
children: jsx(History, {
|
|
221
|
+
size: 18
|
|
222
|
+
})
|
|
223
|
+
}), jsx("p", {
|
|
224
|
+
children: jsx("b", {
|
|
225
|
+
children: "No past chats yet"
|
|
226
|
+
})
|
|
227
|
+
}), jsx("p", {
|
|
228
|
+
children: "When you start a new chat, this one is kept here so you can pick it up again."
|
|
229
|
+
})]
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
}export{HistoryButton,HistoryPanel};//# sourceMappingURL=HistoryPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryPanel.js","sources":["../../../../src/pages/Home/chat/HistoryPanel.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"uRAUA;AACM,SAAU,aAAa,CAAC;MASnB;SAW8C;AAC7C,EAAA;AAQZ,CAAC,EAAA;AAeD,EAAA,oBAA4B,EAAA;AACxB,IAAA,GAAA,EAAA,SAAc;IACd,IAAM,EAAA,QAAY;IAClB,WAAW,EAAG,SAAA;IACd,YAAkG,EAAA,cAAA;IAClG,OAAO,EAAO,OAAE;IAChB,eAAe,EAAE,QAAW;IAC5B,eAA+E,EAAA,IAAA;AAC/E,IAAA,4BAAmB;IAEnB,KAAwF,EAAA,iBAAA;AACxF;IACA,SAAS,sHAAM,EAAA,IAAA,GAAA,0BAAA,GAAA,uBAAA,CAAA,CAAA;YACD,EAAA,CAAAA,GAAC,CAAI,OAAE,EAAA;eACN,EAAA,SAAO;AAClB,MAAA,aAAS,EAAA;WAAE,CAAO,MAAA,EAAA;eACd,EAAA,kBAAe;AAAE,MAAA,QAAA,EAAA;AACrB,KAAA,CAAA;AACJ,GAAA,CAAA;;AAES,qBAAM,CAAA;AACX,EAAA,KAAA;;AACJ,EAAA,IAAG;AAEH,EAAA,MAAA;AACI,EAAA,QAAA;AACA,EAAA,OAAA;AACI,EAAA;;QAEJ,QAAC,GAAA,MAAA,CAAA,IAAA,CAAA;AACD,EAAA,MAAA,GAAA,GAAA,WAAiB,EAAA,MAAQ,CAAC;aAChB,GAAA,qBAAiB,EAAI,MAAC,EAAA,OAAA,CAAA;AAC5B;AACJ,EAAA,MAAA,CAAC,OAAE,EAAA,UAAA,CAAA,GAAA,QAAA,CAAA,IAAA,CAAA;AACP,EAAA,MAAI,CAAA,QAAU,EAAC,WAAE,CAAA,GAAA,QAAA,CAAA,IAAA,CAAA;;QAGb,UAAW,GAAK,WAAE,CAAA,MAAA,IAAA,MAAA,EAAA,KAAA,EAAA,EAAA,EAAA,CAAA;AAClB;AACJ,EAAA,MAAE,OAAA,GAAA,MAAA,CAAA,IAAA,CAAA;AAEF,EAAA,SAAS,CAAA,MAAA;AAAE,IAAA,UAAA,CAAO,IAAI,CAAC;IACvB;AA+C4D,IAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA,IAAA,OAAA,CAAA,OAAA,EAAA,OAAA,CAAA,OAAA,CAAA,SAAA,GAAA,CAAA;;;AA6BJ;AACJ,EAAA,SAAA,CAAA,MAAA;AAwDxD,IAAC,IAAA,CAAA,IAAA,EAAA,UAAA,CAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatTheme.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/chatTheme.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"chatTheme.d.ts","sourceRoot":"","sources":["../../../../src/pages/Home/chat/chatTheme.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAqvD1B,wBAAgB,SAAS,sBAGxB"}
|