@admin-layout/tailwind-ui 12.2.4-alpha.62 → 12.2.4-alpha.63
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/components/AIToolbar/hooks/useActiveCharacter.d.ts +0 -2
- package/lib/components/AIToolbar/hooks/useActiveCharacter.d.ts.map +1 -1
- package/lib/components/AIToolbar/hooks/useActiveCharacter.js +2 -1
- package/lib/components/AIToolbar/hooks/useActiveCharacter.js.map +1 -1
- package/lib/components/AIToolbar/index.d.ts +2 -1
- package/lib/components/AIToolbar/index.d.ts.map +1 -1
- package/lib/components/Inbox/Channels/ChannelBar.d.ts +33 -0
- package/lib/components/Inbox/Channels/ChannelBar.d.ts.map +1 -0
- package/lib/components/Inbox/Channels/ChannelBar.js +79 -0
- package/lib/components/Inbox/Channels/ChannelBar.js.map +1 -0
- package/lib/components/Inbox/Channels/ChannelConnectModal.d.ts +24 -0
- package/lib/components/Inbox/Channels/ChannelConnectModal.d.ts.map +1 -0
- package/lib/components/Inbox/Channels/ChannelConnectModal.js +177 -0
- package/lib/components/Inbox/Channels/ChannelConnectModal.js.map +1 -0
- package/lib/components/Inbox/Channels/channelsMeta.d.ts +16 -0
- package/lib/components/Inbox/Channels/channelsMeta.d.ts.map +1 -0
- package/lib/components/Inbox/Channels/channelsMeta.js +127 -0
- package/lib/components/Inbox/Channels/channelsMeta.js.map +1 -0
- package/lib/components/Inbox/Channels/index.d.ts +7 -0
- package/lib/components/Inbox/Channels/index.d.ts.map +1 -0
- package/lib/components/Inbox/index.d.ts +2 -0
- package/lib/components/Inbox/index.d.ts.map +1 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { readPreferredActiveCharacterFileName } from '../../../hooks/activeCharacterPreference';
|
|
2
1
|
export interface ActiveCharacter {
|
|
3
2
|
/** Manifest `name` (or filesystem stem) — e.g. "Seraphina". */
|
|
4
3
|
name: string;
|
|
@@ -39,7 +38,6 @@ export interface MarketplaceCharacterEntry {
|
|
|
39
38
|
* resolves. Triggers a re-render of any active character hook.
|
|
40
39
|
*/
|
|
41
40
|
export declare function setMarketplaceCharacters(entries: MarketplaceCharacterEntry[]): void;
|
|
42
|
-
export { readPreferredActiveCharacterFileName };
|
|
43
41
|
/**
|
|
44
42
|
* Return the active character (name + avatar) or null when none is installed
|
|
45
43
|
* / we're not running under Tauri. Selection follows `pickActiveMerged` (file_name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveCharacter.d.ts","sourceRoot":"","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useActiveCharacter.d.ts","sourceRoot":"","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"names":[],"mappings":"AAyCA,MAAM,WAAW,eAAe;IAC5B,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC5B,sDAAsD;IACtD,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,gFAAgF;IAChF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iFAAiF;IACjF,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC5C;AASD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAkCD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,EAAE,GAAG,IAAI,CASnF;AAkMD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAqC3D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAmFpD"}
|
|
@@ -230,6 +230,7 @@ function useCharacterPreferenceListeners(reload, bump) {
|
|
|
230
230
|
};
|
|
231
231
|
}, [reload, bump]);
|
|
232
232
|
}
|
|
233
|
+
// main API
|
|
233
234
|
/**
|
|
234
235
|
* Return the active character (name + avatar) or null when none is installed
|
|
235
236
|
* / we're not running under Tauri. Selection follows `pickActiveMerged` (file_name
|
|
@@ -356,4 +357,4 @@ function useCharacterPicker() {
|
|
|
356
357
|
activeName,
|
|
357
358
|
setActive
|
|
358
359
|
};
|
|
359
|
-
}export{
|
|
360
|
+
}export{setMarketplaceCharacters,useActiveCharacter,useCharacterPicker};//# sourceMappingURL=useActiveCharacter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActiveCharacter.js","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useActiveCharacter.js","sources":["../../../../src/components/AIToolbar/hooks/useActiveCharacter.ts"],"sourcesContent":[null],"names":[],"mappings":"2ZAyCA;;;;;;AAMI;AACH;AAED;;;AAGI;AACH;AAED;;;;AAII;;;AAGH;AASD;;;;;MASI,uBAAuB,GAAA,0BAAA;;AAEvB;AACH;AAkCD;;;;AAIG,MAAA,8BAAA,GAAA,iCAAA;AACH,MAAA,4BAAgB,GAAA;AA2MhB;;;;AAIG,MAAA,sBAAA,GAAA,IAAA,GAAA,EAAA;AACH,SAAA,oBAAgB,CAAA,EAAA,EAAA;AAuChB,EAAA,sBAAA,CAAA,GAAA,CAAA,EAAA,CAAA;;;AAGG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,6 +2,7 @@ export { AIToolbar, AIToolbarLeading, AIToolbarMain, AIToolbarTrailing, AIToolba
|
|
|
2
2
|
export type { AIToolbarProps, AIToolbarSectionProps, AIToolbarInputSurfaceProps, AIToolbarStatusDotProps, } from './components/AIToolbarPrimitives';
|
|
3
3
|
export * from './components';
|
|
4
4
|
export type { CompletionSubmitOptions, UseCompletionReturn, SystemAudioProps, AIToolbarAppProps, AIToolbarHostPlatform, ChatMessage, ChatConversation, VadConfig, ToolbarAiProvider, ToolbarSelectedProvider, ToolbarAudioDevices, ToolbarAttachedFile, ToolbarScreenshotConfiguration, } from './components/types';
|
|
5
|
-
export { setMarketplaceCharacters, useActiveCharacter, useCharacterPicker
|
|
5
|
+
export { setMarketplaceCharacters, useActiveCharacter, useCharacterPicker } from './hooks/useActiveCharacter';
|
|
6
|
+
export { readPreferredActiveCharacterFileName } from '../../hooks/activeCharacterPreference';
|
|
6
7
|
export type { MarketplaceCharacterEntry, ActiveCharacter, CharacterListEntry, CharacterPicker, } from './hooks/useActiveCharacter';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIToolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACR,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,GAC1B,MAAM,kCAAkC,CAAC;AAE1C,cAAc,cAAc,CAAC;AAE7B,YAAY,EACR,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,8BAA8B,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AIToolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EACR,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,GAC1B,MAAM,kCAAkC,CAAC;AAE1C,cAAc,cAAc,CAAC;AAE7B,YAAY,EACR,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,8BAA8B,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC9G,OAAO,EAAE,oCAAoC,EAAE,MAAM,uCAAuC,CAAC;AAC7F,YAAY,EACR,yBAAyB,EACzB,eAAe,EACf,kBAAkB,EAClB,eAAe,GAClB,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ChannelMeta } from './channelsMeta';
|
|
3
|
+
import { type PairingTokenResult } from './ChannelConnectModal';
|
|
4
|
+
export interface ChannelBarProps {
|
|
5
|
+
/** Override the default channel list (Telegram/Discord/Slack/WhatsApp/Teams) */
|
|
6
|
+
channels?: ChannelMeta[];
|
|
7
|
+
/** Ids of currently connected channels (controlled) */
|
|
8
|
+
connectedChannelIds?: string[];
|
|
9
|
+
/** Called when a disconnected channel is clicked. If onConnect returns a PairingTokenResult
|
|
10
|
+
* (or a Promise that resolves to one), the modal switches to pairing mode and displays the
|
|
11
|
+
* QR + deep-link. Return void to render the token-entry / placeholder modal. */
|
|
12
|
+
onConnect?: (channel: ChannelMeta) => void | PairingTokenResult | Promise<void | PairingTokenResult>;
|
|
13
|
+
/** Called when the modal submits a token (non-pairing flow). */
|
|
14
|
+
onSubmitToken?: (channel: ChannelMeta, token: string) => void | Promise<void>;
|
|
15
|
+
/** Called when a connected channel is clicked. */
|
|
16
|
+
onDisconnect?: (channel: ChannelMeta) => void | Promise<void>;
|
|
17
|
+
/** Called when the modal is closed (cancel/X/backdrop). */
|
|
18
|
+
onModalClose?: (channel: ChannelMeta) => void;
|
|
19
|
+
/** External loading flag for the modal (e.g. while a parent gateway call is in flight) */
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
/** External error string for the modal */
|
|
22
|
+
error?: string;
|
|
23
|
+
/** When supplied while modal is open, modal renders in pairing mode (QR + deep link). */
|
|
24
|
+
pairing?: PairingTokenResult;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
declare function ChannelBar({ channels, connectedChannelIds, onConnect, onSubmitToken, onDisconnect, onModalClose, loading, error, pairing, className, }: ChannelBarProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare namespace ChannelBar {
|
|
29
|
+
var displayName: string;
|
|
30
|
+
}
|
|
31
|
+
declare const _default: React.MemoExoticComponent<typeof ChannelBar>;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=ChannelBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelBar.d.ts","sourceRoot":"","sources":["../../../../src/components/Inbox/Channels/ChannelBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAA4B,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAIrF,MAAM,WAAW,eAAe;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,uDAAuD;IACvD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B;;qFAEiF;IACjF,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,kBAAkB,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IACrG,gEAAgE;IAChE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,kDAAkD;IAClD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,2DAA2D;IAC3D,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yFAAyF;IACzF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,iBAAS,UAAU,CAAC,EAChB,QAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,KAAK,EACL,OAAO,EACP,SAAS,GACZ,EAAE,eAAe,2CA8FjB;kBAzGQ,UAAU;;;;AA6GnB,wBAAsC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {jsxs,Fragment,jsx}from'react/jsx-runtime';import React__default,{useState,useMemo,useCallback}from'react';import {CHANNELS}from'./channelsMeta.js';import ChannelConnectModal from'./ChannelConnectModal.js';// main component
|
|
2
|
+
function ChannelBar({
|
|
3
|
+
channels = CHANNELS,
|
|
4
|
+
connectedChannelIds,
|
|
5
|
+
onConnect,
|
|
6
|
+
onSubmitToken,
|
|
7
|
+
onDisconnect,
|
|
8
|
+
onModalClose,
|
|
9
|
+
loading,
|
|
10
|
+
error,
|
|
11
|
+
pairing,
|
|
12
|
+
className
|
|
13
|
+
}) {
|
|
14
|
+
const [selected, setSelected] = useState(null);
|
|
15
|
+
const [internalPairing, setInternalPairing] = useState(null);
|
|
16
|
+
const [internalLoading, setInternalLoading] = useState(false);
|
|
17
|
+
const connectedSet = useMemo(() => new Set(connectedChannelIds ?? []), [connectedChannelIds]);
|
|
18
|
+
const handleClose = useCallback(() => {
|
|
19
|
+
const ch = selected;
|
|
20
|
+
setSelected(null);
|
|
21
|
+
setInternalPairing(null);
|
|
22
|
+
setInternalLoading(false);
|
|
23
|
+
if (ch) onModalClose?.(ch);
|
|
24
|
+
}, [selected, onModalClose]);
|
|
25
|
+
const handleClick = useCallback(async channel => {
|
|
26
|
+
if (connectedSet.has(channel.id)) {
|
|
27
|
+
await onDisconnect?.(channel);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setSelected(channel);
|
|
31
|
+
setInternalPairing(null);
|
|
32
|
+
if (!onConnect) return;
|
|
33
|
+
setInternalLoading(true);
|
|
34
|
+
try {
|
|
35
|
+
const result = await onConnect(channel);
|
|
36
|
+
if (result && typeof result === 'object' && 'token' in result) {
|
|
37
|
+
setInternalPairing(result);
|
|
38
|
+
}
|
|
39
|
+
} finally {
|
|
40
|
+
setInternalLoading(false);
|
|
41
|
+
}
|
|
42
|
+
}, [connectedSet, onConnect, onDisconnect]);
|
|
43
|
+
const handleSubmitToken = useCallback(async token => {
|
|
44
|
+
if (!selected) return;
|
|
45
|
+
await onSubmitToken?.(selected, token);
|
|
46
|
+
handleClose();
|
|
47
|
+
}, [selected, onSubmitToken, handleClose]);
|
|
48
|
+
const effectivePairing = pairing ?? internalPairing ?? undefined;
|
|
49
|
+
const effectiveLoading = loading || internalLoading;
|
|
50
|
+
return jsxs(Fragment, {
|
|
51
|
+
children: [jsx("div", {
|
|
52
|
+
className: `flex items-center justify-center gap-1 mt-2 flex-wrap max-w-xs mx-auto ${className ?? ''}`,
|
|
53
|
+
children: channels.map(channel => {
|
|
54
|
+
const isConnected = connectedSet.has(channel.id);
|
|
55
|
+
return jsxs("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: () => handleClick(channel),
|
|
58
|
+
className: `relative group flex items-center justify-center w-8 h-8 rounded-lg transition-all ${isConnected ? 'text-green-600 bg-green-500/10 hover:bg-green-500/20' : 'text-gray-500 hover:text-gray-900 hover:bg-gray-100'}`,
|
|
59
|
+
title: `${channel.name}${isConnected ? ' (connected — click to disconnect)' : ''}`,
|
|
60
|
+
"aria-label": `Connect ${channel.name}`,
|
|
61
|
+
children: [channel.icon, isConnected && jsx("span", {
|
|
62
|
+
className: "absolute -bottom-0.5 -right-0.5 block w-3 h-3 rounded-full bg-green-500 ring-2 ring-white",
|
|
63
|
+
"aria-hidden": "true"
|
|
64
|
+
})]
|
|
65
|
+
}, channel.id);
|
|
66
|
+
})
|
|
67
|
+
}), selected && jsx(ChannelConnectModal, {
|
|
68
|
+
isOpen: !!selected,
|
|
69
|
+
channel: selected,
|
|
70
|
+
loading: effectiveLoading,
|
|
71
|
+
error: error,
|
|
72
|
+
pairing: effectivePairing,
|
|
73
|
+
onClose: handleClose,
|
|
74
|
+
onConnect: handleSubmitToken
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
ChannelBar.displayName = 'ChannelBar';
|
|
79
|
+
var ChannelBar_default = React__default.memo(ChannelBar);export{ChannelBar_default as default};//# sourceMappingURL=ChannelBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelBar.js","sources":["../../../../src/components/Inbox/Channels/ChannelBar.tsx"],"sourcesContent":[null],"names":[],"mappings":";AAQI,SAAA,UAAW,CAAA;UACX,GAAA,QAAA;AACA,EAAA,mBAAA;AACA,EAAA,SAAA;;AAEiF,EAAA,YAAA;AACjF,EAAA,YAAU;SACV;AACA,EAAA,KAAA;SACA;AACA,EAAA;;QAEA,CAAA,QAAa,EAAE,WAAU,CAAA,GAAA,QAAW,CAAA;QACpC,CAAA,eAAA,EAAA,kBAAA,CAAA,GAAA,QAAA,CAAA,IAAA,CAAA;QACA,CAAA,eAAkB,EAAA,kBAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;QAClB,YAAA,GAAA,OAAA,CAAA,MAAA,IAAA,GAAA,CAAA,mBAA0C,IAAA,EAAA,CAAA,EAAA,CAAA,mBAAA,CAAA,CAAA;QAC1C,WAAe,GAAA,WAAA,CAAA,MAAA;IACf,MAAA,EAAA,GAAA,QAAA;IACA,WAAU,CAAA,IAAA,CAAA;IACV,kBAAkB,CAAC,IAAA,CAAA;AACtB,IAAA,kBAAA,CAAA,KAAA,CAAA;AAID,IAAA,IAAA,EAAA,EAAA,YAAS,GAAU,EAAC,CAChB;4BADe,CAAA,CAAA;;;;AA6GnB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ChannelMeta } from './channelsMeta';
|
|
3
|
+
export interface PairingTokenResult {
|
|
4
|
+
token: string;
|
|
5
|
+
deepLink?: string;
|
|
6
|
+
expiresAt?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ChannelConnectModalProps {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
channel: ChannelMeta;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
/** When present, modal renders QR + deep-link pairing UI instead of token entry. */
|
|
14
|
+
pairing?: PairingTokenResult;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onConnect: (token: string) => Promise<void> | void;
|
|
17
|
+
}
|
|
18
|
+
declare function ChannelConnectModal({ isOpen, channel, loading, error, pairing, onClose, onConnect, }: ChannelConnectModalProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare namespace ChannelConnectModal {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: React.MemoExoticComponent<typeof ChannelConnectModal>;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=ChannelConnectModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelConnectModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Inbox/Channels/ChannelConnectModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACtD;AAUD,iBAAS,mBAAmB,CAAC,EACzB,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,GACZ,EAAE,wBAAwB,2CAuM1B;kBA/MQ,mBAAmB;;;;AAmN5B,wBAA+C"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import React__default,{useState,useEffect,useCallback}from'react';// helper functions
|
|
2
|
+
function buildQrUrl(data) {
|
|
3
|
+
return `https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${encodeURIComponent(data)}`;
|
|
4
|
+
}
|
|
5
|
+
// main component
|
|
6
|
+
function ChannelConnectModal({
|
|
7
|
+
isOpen,
|
|
8
|
+
channel,
|
|
9
|
+
loading,
|
|
10
|
+
error,
|
|
11
|
+
pairing,
|
|
12
|
+
onClose,
|
|
13
|
+
onConnect
|
|
14
|
+
}) {
|
|
15
|
+
const [token, setToken] = useState('');
|
|
16
|
+
const [copied, setCopied] = useState(false);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (isOpen) {
|
|
19
|
+
setToken('');
|
|
20
|
+
setCopied(false);
|
|
21
|
+
}
|
|
22
|
+
}, [isOpen, channel.id]);
|
|
23
|
+
const handleSubmit = useCallback(e => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
onConnect(token.trim());
|
|
26
|
+
}, [token, onConnect]);
|
|
27
|
+
const handleBackdropClick = useCallback(e => {
|
|
28
|
+
if (e.target === e.currentTarget && !loading) onClose();
|
|
29
|
+
}, [onClose, loading]);
|
|
30
|
+
const handleCopy = useCallback(() => {
|
|
31
|
+
if (!pairing?.token) return;
|
|
32
|
+
navigator.clipboard?.writeText(pairing.token).then(() => {
|
|
33
|
+
setCopied(true);
|
|
34
|
+
setTimeout(() => setCopied(false), 1500);
|
|
35
|
+
});
|
|
36
|
+
}, [pairing]);
|
|
37
|
+
if (!isOpen) return null;
|
|
38
|
+
const inPairingMode = !!pairing;
|
|
39
|
+
const tokenRequired = !inPairingMode && channel.tokenLabel.length > 0;
|
|
40
|
+
const canSubmit = tokenRequired ? token.trim().length > 0 && !loading : !loading;
|
|
41
|
+
const qrPayload = pairing ? pairing.deepLink ?? pairing.token : '';
|
|
42
|
+
return jsx("div", {
|
|
43
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm px-4",
|
|
44
|
+
onClick: handleBackdropClick,
|
|
45
|
+
role: "dialog",
|
|
46
|
+
"aria-modal": "true",
|
|
47
|
+
"aria-labelledby": "channel-connect-title",
|
|
48
|
+
children: jsx("div", {
|
|
49
|
+
className: "w-full max-w-md bg-white rounded-2xl shadow-xl overflow-hidden",
|
|
50
|
+
children: jsxs("form", {
|
|
51
|
+
onSubmit: handleSubmit,
|
|
52
|
+
children: [jsxs("div", {
|
|
53
|
+
className: "px-6 py-5 border-b border-gray-100 flex items-center gap-3",
|
|
54
|
+
children: [jsx("div", {
|
|
55
|
+
className: "flex items-center justify-center w-10 h-10 rounded-lg bg-gray-50 text-gray-700",
|
|
56
|
+
children: channel.icon
|
|
57
|
+
}), jsxs("div", {
|
|
58
|
+
className: "flex-1 min-w-0",
|
|
59
|
+
children: [jsxs("h3", {
|
|
60
|
+
id: "channel-connect-title",
|
|
61
|
+
className: "text-base font-semibold text-gray-900 truncate",
|
|
62
|
+
children: ["Connect ", channel.name]
|
|
63
|
+
}), jsx("p", {
|
|
64
|
+
className: "text-xs text-gray-500 truncate",
|
|
65
|
+
children: channel.description
|
|
66
|
+
})]
|
|
67
|
+
}), jsx("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
onClick: onClose,
|
|
70
|
+
disabled: loading,
|
|
71
|
+
className: "text-gray-400 hover:text-gray-700 disabled:opacity-50",
|
|
72
|
+
"aria-label": "Close",
|
|
73
|
+
children: jsx("svg", {
|
|
74
|
+
width: 20,
|
|
75
|
+
height: 20,
|
|
76
|
+
viewBox: "0 0 24 24",
|
|
77
|
+
fill: "none",
|
|
78
|
+
stroke: "currentColor",
|
|
79
|
+
strokeWidth: 2,
|
|
80
|
+
children: jsx("path", {
|
|
81
|
+
d: "M18 6L6 18M6 6l12 12"
|
|
82
|
+
})
|
|
83
|
+
})
|
|
84
|
+
})]
|
|
85
|
+
}), jsxs("div", {
|
|
86
|
+
className: "px-6 py-5 space-y-4",
|
|
87
|
+
children: [inPairingMode ? jsxs("div", {
|
|
88
|
+
className: "flex flex-col items-center gap-3",
|
|
89
|
+
children: [jsx("div", {
|
|
90
|
+
className: "flex items-center justify-center p-3 rounded-lg bg-white border border-gray-200",
|
|
91
|
+
children: jsx("img", {
|
|
92
|
+
src: buildQrUrl(qrPayload),
|
|
93
|
+
alt: `QR code to pair ${channel.name}`,
|
|
94
|
+
width: 200,
|
|
95
|
+
height: 200,
|
|
96
|
+
className: "block"
|
|
97
|
+
})
|
|
98
|
+
}), pairing?.deepLink && jsxs("a", {
|
|
99
|
+
href: pairing.deepLink,
|
|
100
|
+
target: "_blank",
|
|
101
|
+
rel: "noopener noreferrer",
|
|
102
|
+
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700",
|
|
103
|
+
children: ["Open ", channel.name]
|
|
104
|
+
}), pairing?.token && jsx("button", {
|
|
105
|
+
type: "button",
|
|
106
|
+
onClick: handleCopy,
|
|
107
|
+
className: "text-xs text-gray-600 hover:text-gray-900 underline",
|
|
108
|
+
children: copied ? 'Copied!' : 'Copy pairing token'
|
|
109
|
+
}), jsxs("div", {
|
|
110
|
+
className: "flex items-center gap-2 text-xs text-gray-500",
|
|
111
|
+
children: [jsx("svg", {
|
|
112
|
+
className: "animate-spin",
|
|
113
|
+
width: 14,
|
|
114
|
+
height: 14,
|
|
115
|
+
viewBox: "0 0 24 24",
|
|
116
|
+
fill: "none",
|
|
117
|
+
stroke: "currentColor",
|
|
118
|
+
strokeWidth: 2,
|
|
119
|
+
children: jsx("path", {
|
|
120
|
+
d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"
|
|
121
|
+
})
|
|
122
|
+
}), "Waiting for pairing\u2026"]
|
|
123
|
+
})]
|
|
124
|
+
}) : tokenRequired ? jsxs("div", {
|
|
125
|
+
children: [jsx("label", {
|
|
126
|
+
htmlFor: "channel-token-input",
|
|
127
|
+
className: "block text-sm font-medium text-gray-700 mb-1.5",
|
|
128
|
+
children: channel.tokenLabel
|
|
129
|
+
}), jsx("input", {
|
|
130
|
+
id: "channel-token-input",
|
|
131
|
+
type: "text",
|
|
132
|
+
autoComplete: "off",
|
|
133
|
+
spellCheck: false,
|
|
134
|
+
value: token,
|
|
135
|
+
onChange: e => setToken(e.target.value),
|
|
136
|
+
placeholder: channel.tokenPlaceholder,
|
|
137
|
+
disabled: loading,
|
|
138
|
+
className: "w-full px-3 py-2 text-sm rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40 focus:border-blue-500 disabled:bg-gray-50"
|
|
139
|
+
})]
|
|
140
|
+
}) : jsx("div", {
|
|
141
|
+
className: "flex items-center justify-center h-32 rounded-lg border border-dashed border-gray-300 bg-gray-50 text-xs text-gray-500",
|
|
142
|
+
children: loading ? 'Generating pairing token…' : 'Click Connect to start pairing.'
|
|
143
|
+
}), jsxs("p", {
|
|
144
|
+
className: "text-xs text-gray-500 leading-relaxed whitespace-pre-line",
|
|
145
|
+
children: [channel.tokenHelp, channel.docsLink && jsxs(Fragment, {
|
|
146
|
+
children: [' ', jsx("a", {
|
|
147
|
+
href: channel.docsLink,
|
|
148
|
+
target: "_blank",
|
|
149
|
+
rel: "noopener noreferrer",
|
|
150
|
+
className: "text-blue-600 hover:underline",
|
|
151
|
+
children: "Learn more"
|
|
152
|
+
})]
|
|
153
|
+
})]
|
|
154
|
+
}), error && jsx("div", {
|
|
155
|
+
className: "text-xs text-red-600 bg-red-50 border border-red-200 rounded-lg px-3 py-2",
|
|
156
|
+
children: error
|
|
157
|
+
})]
|
|
158
|
+
}), jsxs("div", {
|
|
159
|
+
className: "px-6 py-4 bg-gray-50 flex items-center justify-end gap-2",
|
|
160
|
+
children: [jsx("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
onClick: onClose,
|
|
163
|
+
className: "px-4 py-2 text-sm rounded-lg text-gray-700 hover:bg-gray-200",
|
|
164
|
+
children: inPairingMode ? 'Close' : 'Cancel'
|
|
165
|
+
}), !inPairingMode && jsx("button", {
|
|
166
|
+
type: "submit",
|
|
167
|
+
disabled: !canSubmit,
|
|
168
|
+
className: "px-4 py-2 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
169
|
+
children: loading ? 'Connecting…' : 'Connect'
|
|
170
|
+
})]
|
|
171
|
+
})]
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
ChannelConnectModal.displayName = 'ChannelConnectModal';
|
|
177
|
+
var ChannelConnectModal$1 = React__default.memo(ChannelConnectModal);export{ChannelConnectModal$1 as default};//# sourceMappingURL=ChannelConnectModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelConnectModal.js","sources":["../../../../src/components/Inbox/Channels/ChannelConnectModal.tsx"],"sourcesContent":[null],"names":[],"mappings":"oHAKA;SACS,UAAS,CAAA,IAAA,EAAA;SACd,CAAA,8DAAkB,EAAA,kBAAA,CAAA,IAAA,CAAA,CAAA,CAAA;;AAErB;AAED,4BAAiB,CAAA;QACb;SACA;SACA;OACA;SACA;SACA;;AAEA,CAAA,EAAA;AACH,EAAA,MAAA,CAAA,KAAA,EAAA,QAAA,CAAA,GAAA,QAAA,CAAA,EAAA,CAAA;AAUD,EAAA,MAAA,CAAA,MAAA,EAAS,qBAAoB,CACzB,MAAM;kBADD;;;;AAmNT,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ChannelMeta {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
/** Backend channel-type identifier consumers can map to their own gateway (e.g. 'telegram-webhook'). */
|
|
8
|
+
channelType?: string;
|
|
9
|
+
/** Token field label (empty string => pairing-only flow with no manual token entry) */
|
|
10
|
+
tokenLabel: string;
|
|
11
|
+
tokenPlaceholder: string;
|
|
12
|
+
tokenHelp: string;
|
|
13
|
+
docsLink?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const CHANNELS: ChannelMeta[];
|
|
16
|
+
//# sourceMappingURL=channelsMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelsMeta.d.ts","sourceRoot":"","sources":["../../../../src/components/Inbox/Channels/channelsMeta.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAI9C,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAkED,eAAO,MAAM,QAAQ,EAAE,WAAW,EA0DjC,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';// helper functions
|
|
2
|
+
function TelegramIcon() {
|
|
3
|
+
return jsx("svg", {
|
|
4
|
+
width: 20,
|
|
5
|
+
height: 20,
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "currentColor",
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
children: jsx("path", {
|
|
10
|
+
d: "M12 0C5.37 0 0 5.37 0 12c0 6.627 5.37 12 12 12 6.627 0 12-5.373 12-12C24 5.37 18.627 0 12 0zm5.894 8.221-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.14.18-.357.295-.548.295l.189-2.91 5.305-4.789c.23-.205-.05-.318-.357-.113l-6.554 4.124-2.827-.88c-.614-.192-.627-.614.128-.91l11.05-4.264c.512-.191 1.01.127.814 1.144z"
|
|
11
|
+
})
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function SlackIcon() {
|
|
15
|
+
return jsxs("svg", {
|
|
16
|
+
width: 20,
|
|
17
|
+
height: 20,
|
|
18
|
+
viewBox: "0 0 128 128",
|
|
19
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
children: [jsx("path", {
|
|
22
|
+
d: "M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0",
|
|
23
|
+
fill: "#de1c59"
|
|
24
|
+
}), jsx("path", {
|
|
25
|
+
d: "M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0",
|
|
26
|
+
fill: "#35c5f0"
|
|
27
|
+
}), jsx("path", {
|
|
28
|
+
d: "M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0",
|
|
29
|
+
fill: "#2eb57d"
|
|
30
|
+
}), jsx("path", {
|
|
31
|
+
d: "M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0",
|
|
32
|
+
fill: "#ebb02e"
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function DiscordIcon() {
|
|
37
|
+
return jsx("svg", {
|
|
38
|
+
width: 20,
|
|
39
|
+
height: 20,
|
|
40
|
+
viewBox: "0 0 24 24",
|
|
41
|
+
fill: "currentColor",
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
children: jsx("path", {
|
|
44
|
+
d: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3333-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3333-.946 2.4189-2.1568 2.4189Z"
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function WhatsAppIcon() {
|
|
49
|
+
return jsx("svg", {
|
|
50
|
+
width: 20,
|
|
51
|
+
height: 20,
|
|
52
|
+
viewBox: "0 0 24 24",
|
|
53
|
+
fill: "currentColor",
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
children: jsx("path", {
|
|
56
|
+
d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function TeamsIcon() {
|
|
61
|
+
return jsxs("svg", {
|
|
62
|
+
width: 20,
|
|
63
|
+
height: 20,
|
|
64
|
+
viewBox: "0 0 48 48",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
children: [jsx("path", {
|
|
67
|
+
fill: "#5c6bc0",
|
|
68
|
+
d: "M41.5 13A3.5 3.5 0 1 0 41.5 20 3.5 3.5 0 1 0 41.5 13zM4 40l23 4V4L4 8V40z"
|
|
69
|
+
}), jsx("path", {
|
|
70
|
+
fill: "#fff",
|
|
71
|
+
d: "M21 16.27L21 19 17.01 19.18 16.99 31.04 14.01 30.95 14.01 19.29 10 19.45 10 16.94z"
|
|
72
|
+
}), jsx("path", {
|
|
73
|
+
fill: "#5c6bc0",
|
|
74
|
+
d: "M36 14c0 2.21-1.79 4-4 4-1.2 0-2.27-.53-3-1.36v-5.28c.73-.83 1.8-1.36 3-1.36C34.21 10 36 11.79 36 14zM38 23v11c0 0 1.567 0 3.5 0 1.762 0 3.205-1.306 3.45-3H45v-8H38zM29 20v17c0 0 1.567 0 3.5 0 1.762 0 3.205-1.306 3.45-3H36V20H29z"
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// constants
|
|
79
|
+
const CHANNELS = [{
|
|
80
|
+
id: 'telegram',
|
|
81
|
+
name: 'Telegram',
|
|
82
|
+
description: 'Bridge this chat to a Telegram bot',
|
|
83
|
+
icon: jsx(TelegramIcon, {}),
|
|
84
|
+
channelType: 'telegram-webhook',
|
|
85
|
+
tokenLabel: '',
|
|
86
|
+
tokenPlaceholder: '',
|
|
87
|
+
tokenHelp: '1. Open Telegram and find the configured bot\n2. Tap the deep link below (or scan the QR)\n3. Tap Start to complete pairing',
|
|
88
|
+
docsLink: 'https://core.telegram.org/bots#how-do-i-create-a-bot'
|
|
89
|
+
}, {
|
|
90
|
+
id: 'discord',
|
|
91
|
+
name: 'Discord',
|
|
92
|
+
description: 'Bridge this chat to a Discord channel',
|
|
93
|
+
icon: jsx(DiscordIcon, {}),
|
|
94
|
+
channelType: 'discord-webhook',
|
|
95
|
+
tokenLabel: '',
|
|
96
|
+
tokenPlaceholder: '',
|
|
97
|
+
tokenHelp: '1. Open Discord and DM the configured bot\n2. Send the deep-link command (or paste the token)\n3. The bot confirms pairing',
|
|
98
|
+
docsLink: 'https://discord.com/developers/applications'
|
|
99
|
+
}, {
|
|
100
|
+
id: 'slack',
|
|
101
|
+
name: 'Slack',
|
|
102
|
+
description: 'Bridge this chat to a Slack workspace',
|
|
103
|
+
icon: jsx(SlackIcon, {}),
|
|
104
|
+
channelType: 'slack-webhook',
|
|
105
|
+
tokenLabel: '',
|
|
106
|
+
tokenPlaceholder: '',
|
|
107
|
+
tokenHelp: '1. Open Slack and DM the configured bot\n2. Send the pairing command from the deep link\n3. The bot confirms pairing',
|
|
108
|
+
docsLink: 'https://api.slack.com/start'
|
|
109
|
+
}, {
|
|
110
|
+
id: 'whatsapp',
|
|
111
|
+
name: 'WhatsApp',
|
|
112
|
+
description: 'Pair WhatsApp via QR code',
|
|
113
|
+
icon: jsx(WhatsAppIcon, {}),
|
|
114
|
+
channelType: 'whatsapp-webhook',
|
|
115
|
+
tokenLabel: '',
|
|
116
|
+
tokenPlaceholder: '',
|
|
117
|
+
tokenHelp: 'Scan the QR code shown in the connect dialog with WhatsApp on your phone.'
|
|
118
|
+
}, {
|
|
119
|
+
id: 'teams',
|
|
120
|
+
name: 'Microsoft Teams',
|
|
121
|
+
description: 'Bridge this chat to Microsoft Teams',
|
|
122
|
+
icon: jsx(TeamsIcon, {}),
|
|
123
|
+
channelType: 'teams-webhook',
|
|
124
|
+
tokenLabel: '',
|
|
125
|
+
tokenPlaceholder: '',
|
|
126
|
+
tokenHelp: '1. Open Teams and DM the configured bot\n2. Send the pairing command from the deep link\n3. The bot confirms pairing'
|
|
127
|
+
}];export{CHANNELS};//# sourceMappingURL=channelsMeta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelsMeta.js","sources":["../../../../src/components/Inbox/Channels/channelsMeta.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"yCAIA;qBACe,GAAA;SACPA,SAAS,EAAA;IACb,KAAA,EAAA,EAAA;IACA,MAAM;IACN,OAAA,EAAA,WAAA;IACA,IAAA,EAAA,cAAoB;IACpB,aAAA,EAAA,MAAA;IACA,QAAA,EAAUA,UAAS,EAAA;MACnB,CAAA,EAAA;KACA;IACA;AACH;AAkED,SAAA,SAAO,GAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as ChannelBar } from './ChannelBar';
|
|
2
|
+
export type { ChannelBarProps } from './ChannelBar';
|
|
3
|
+
export { default as ChannelConnectModal } from './ChannelConnectModal';
|
|
4
|
+
export type { ChannelConnectModalProps, PairingTokenResult } from './ChannelConnectModal';
|
|
5
|
+
export { CHANNELS } from './channelsMeta';
|
|
6
|
+
export type { ChannelMeta } from './channelsMeta';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Inbox/Channels/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Inbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -14,6 +14,7 @@ export * from './ThemeProvider';
|
|
|
14
14
|
export * from './LanguageMenuDropdown';
|
|
15
15
|
export * from './InputToolBar';
|
|
16
16
|
export * from './AIToolbar';
|
|
17
|
+
export * from './Inbox';
|
|
17
18
|
export * from './YantraIcon';
|
|
18
19
|
export { Markdown as AIToolbarMarkdown } from './AIToolbar/components/Markdown';
|
|
19
20
|
export * from './Markdown';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAChF,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAChF,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as PageLoading}from'./components/PageLoading/index.js';export{ApplicationErrorHandler}from'./components/ErrorHandlers/ApplicationErrorHandler.js';export{ErrorBoundary}from'./components/ErrorHandlers/ErrorBoundary.js';export{LayoutErrorBoundary}from'./components/ErrorHandlers/LayoutErrorBoundary.js';export{RemixErrorBoundary}from'./components/ErrorHandlers/RemixErrorBoundary.js';export{SPAErrorBoundary}from'./components/ErrorHandlers/SPAErrorBoundary.js';export{ReactTable}from'./components/ReactTable/Table.js';export{DefaultColumnFilter,SelectColumnFilter}from'./components/ReactTable/TableFilters.js';export{Error404}from'./components/ErrorPages/404.js';export{Error500}from'./components/ErrorPages/500.js';export{Error403}from'./components/ErrorPages/403.js';export{PageContainer}from'./components/PageContainer/PageContainer.js';export{Spin}from'./components/Spin/index.js';export{OTPInput}from'./components/OTP/OTPInput.js';export{SingleInput}from'./components/OTP/SingleInput.js';export{useOTPInput}from'./components/OTP/hooks.js';export{OTPVerification}from'./components/OTP/OTPVerification.js';export{SearchInput}from'./components/Search/SearchInput.js';export{Select,SelectContent,SelectItem,SelectSearch,SelectTrigger,SelectValue}from'./components/Select/Select.js';export{DatePicker}from'./components/DatePicker/DatePicker.js';export{Dialog}from'./components/Dialog/Dialog.js';export{TailwindUiButton}from'./components/Button/Button.js';export{TailwindThemeProvider,ThemeContext,themes}from'./components/ThemeProvider/ThemeProvider.js';export{ThemeToggle}from'./components/ThemeProvider/ThemeToggle.js';export{LanguageMenuDropdown}from'./components/LanguageMenuDropdown/LanguageMenuDropdown.js';export{InputToolBar}from'./components/InputToolBar/InputToolBar.js';export{getDefaultLeftItems,getDefaultRightItems}from'./components/InputToolBar/defaults.js';export{AIToolbar,AIToolbarInputSurface,AIToolbarLeading,AIToolbarMain,AIToolbarStatusDot,AIToolbarTrailing}from'./components/AIToolbar/components/AIToolbarPrimitives.js';export{Completion}from'./components/AIToolbar/components/completion/index.js';export{SystemAudio}from'./components/AIToolbar/components/speech/index.js';export{AudioVisualizer}from'./components/AIToolbar/components/speech/audio-visualizer.js';export{StatusIndicator}from'./components/AIToolbar/components/speech/StatusIndicator.js';export{AIToolBar}from'./components/AIToolbar/components/AIToolBar.js';export{CustomCursor}from'./components/AIToolbar/components/CustomCursor.js';export{MessageHistory}from'./components/AIToolbar/components/completion/MessageHistory.js';export{Screenshot}from'./components/AIToolbar/components/completion/Screenshot.js';export{Header}from'./components/AIToolbar/components/speech/Header.js';export{ModeSwitcher}from'./components/AIToolbar/components/speech/ModeSwitcher.js';export{PermissionFlow}from'./components/AIToolbar/components/speech/PermissionFlow.js';export{setMarketplaceCharacters,useActiveCharacter,useCharacterPicker}from'./components/AIToolbar/hooks/useActiveCharacter.js';export{YantraIcon}from'./components/YantraIcon.js';export{Markdown as AIToolbarMarkdown}from'./components/AIToolbar/components/Markdown/index.js';export{MarkdownBreadcrumbs}from'./components/Markdown/MarkdownBreadcrumbs.js';export{MarkdownCopyButton}from'./components/Markdown/MarkdownCopyButton.js';export{MarkdownHeader}from'./components/Markdown/MarkdownHeader.js';export{MarkdownNavigation}from'./components/Markdown/MarkdownNavigation.js';export{MarkdownPage}from'./components/Markdown/MarkdownPage.js';export{MarkdownTableOfContents}from'./components/Markdown/MarkdownTableOfContents.js';export{
|
|
1
|
+
export{default as PageLoading}from'./components/PageLoading/index.js';export{ApplicationErrorHandler}from'./components/ErrorHandlers/ApplicationErrorHandler.js';export{ErrorBoundary}from'./components/ErrorHandlers/ErrorBoundary.js';export{LayoutErrorBoundary}from'./components/ErrorHandlers/LayoutErrorBoundary.js';export{RemixErrorBoundary}from'./components/ErrorHandlers/RemixErrorBoundary.js';export{SPAErrorBoundary}from'./components/ErrorHandlers/SPAErrorBoundary.js';export{ReactTable}from'./components/ReactTable/Table.js';export{DefaultColumnFilter,SelectColumnFilter}from'./components/ReactTable/TableFilters.js';export{Error404}from'./components/ErrorPages/404.js';export{Error500}from'./components/ErrorPages/500.js';export{Error403}from'./components/ErrorPages/403.js';export{PageContainer}from'./components/PageContainer/PageContainer.js';export{Spin}from'./components/Spin/index.js';export{OTPInput}from'./components/OTP/OTPInput.js';export{SingleInput}from'./components/OTP/SingleInput.js';export{useOTPInput}from'./components/OTP/hooks.js';export{OTPVerification}from'./components/OTP/OTPVerification.js';export{SearchInput}from'./components/Search/SearchInput.js';export{Select,SelectContent,SelectItem,SelectSearch,SelectTrigger,SelectValue}from'./components/Select/Select.js';export{DatePicker}from'./components/DatePicker/DatePicker.js';export{Dialog}from'./components/Dialog/Dialog.js';export{TailwindUiButton}from'./components/Button/Button.js';export{TailwindThemeProvider,ThemeContext,themes}from'./components/ThemeProvider/ThemeProvider.js';export{ThemeToggle}from'./components/ThemeProvider/ThemeToggle.js';export{LanguageMenuDropdown}from'./components/LanguageMenuDropdown/LanguageMenuDropdown.js';export{InputToolBar}from'./components/InputToolBar/InputToolBar.js';export{getDefaultLeftItems,getDefaultRightItems}from'./components/InputToolBar/defaults.js';export{AIToolbar,AIToolbarInputSurface,AIToolbarLeading,AIToolbarMain,AIToolbarStatusDot,AIToolbarTrailing}from'./components/AIToolbar/components/AIToolbarPrimitives.js';export{Completion}from'./components/AIToolbar/components/completion/index.js';export{SystemAudio}from'./components/AIToolbar/components/speech/index.js';export{AudioVisualizer}from'./components/AIToolbar/components/speech/audio-visualizer.js';export{StatusIndicator}from'./components/AIToolbar/components/speech/StatusIndicator.js';export{AIToolBar}from'./components/AIToolbar/components/AIToolBar.js';export{CustomCursor}from'./components/AIToolbar/components/CustomCursor.js';export{MessageHistory}from'./components/AIToolbar/components/completion/MessageHistory.js';export{Screenshot}from'./components/AIToolbar/components/completion/Screenshot.js';export{Header}from'./components/AIToolbar/components/speech/Header.js';export{ModeSwitcher}from'./components/AIToolbar/components/speech/ModeSwitcher.js';export{PermissionFlow}from'./components/AIToolbar/components/speech/PermissionFlow.js';export{setMarketplaceCharacters,useActiveCharacter,useCharacterPicker}from'./components/AIToolbar/hooks/useActiveCharacter.js';export{ACTIVE_CHARACTER_CHANGE_EVENT,ACTIVE_CHARACTER_FILE_NAME_STORAGE_KEY,readPreferredActiveCharacterFileName,resolveActiveCharacterFromList,setPreferredActiveCharacterFileName}from'./hooks/activeCharacterPreference.js';export{default as ChannelBar}from'./components/Inbox/Channels/ChannelBar.js';export{default as ChannelConnectModal}from'./components/Inbox/Channels/ChannelConnectModal.js';export{CHANNELS}from'./components/Inbox/Channels/channelsMeta.js';export{YantraIcon}from'./components/YantraIcon.js';export{Markdown as AIToolbarMarkdown}from'./components/AIToolbar/components/Markdown/index.js';export{MarkdownBreadcrumbs}from'./components/Markdown/MarkdownBreadcrumbs.js';export{MarkdownCopyButton}from'./components/Markdown/MarkdownCopyButton.js';export{MarkdownHeader}from'./components/Markdown/MarkdownHeader.js';export{MarkdownNavigation}from'./components/Markdown/MarkdownNavigation.js';export{MarkdownPage}from'./components/Markdown/MarkdownPage.js';export{MarkdownTableOfContents}from'./components/Markdown/MarkdownTableOfContents.js';export{useTheme}from'./hooks/useTheme.js';export{useWindowSize}from'./hooks/useWindowSize.js';export{ToastContainer,useToast,useToastCloseAll}from'./hooks/useToast.js';export{useMediaQuery}from'./hooks/useMediaQuery.js';export{cn}from'./utils/util.js';export{AssistantMessageActions}from'./components/AIToolbar/components/completion/AssistantMessageActions.js';export{DragButton}from'./components/AIToolbar/components/DragButton.js';//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/tailwind-ui",
|
|
3
|
-
"version": "12.2.4-alpha.
|
|
3
|
+
"version": "12.2.4-alpha.63",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"typescript": {
|
|
97
97
|
"definition": "lib/index.d.ts"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "16effa4889e33aabfcc119a7bbcad67c5d14df42"
|
|
100
100
|
}
|