@opencx/widget 2.6.3 → 3.0.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/dist/basic.cjs +89 -89
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.d.ts +1 -1
- package/dist/basic.js +34088 -34127
- package/dist/basic.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -22
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +20 -10
- package/dist/react.js.map +1 -1
- package/dist/src/designs/react/basic/index.d.ts +10 -0
- package/dist/src/designs/{basic → react/basic}/utils/group-messages-by-type.d.ts +1 -1
- package/dist/src/{@components → designs/react/components}/BotOrAgentMessage.d.ts +1 -1
- package/dist/src/{@components → designs/react/components}/BotOrAgentMessageGroup.d.ts +2 -2
- package/dist/src/designs/react/components/BotOrAgentMessageWrapper.d.ts +7 -0
- package/dist/src/{@components → designs/react/components}/Fallback.component.d.ts +2 -2
- package/dist/src/{components → designs/react/components}/RenderFile.d.ts +2 -2
- package/dist/src/{components/keyboard.d.ts → designs/react/components/SuggestedReplies.d.ts} +2 -2
- package/dist/src/{@components → designs/react/components}/Text.component.d.ts +1 -1
- package/dist/src/{components → designs/react/components}/UserMessageGroup.d.ts +1 -1
- package/dist/src/{components → designs/react/components}/VoteButtons.d.ts +1 -1
- package/dist/src/{components → designs/react/components/lib}/button.d.ts +1 -1
- package/dist/src/{components → designs/react/components/lib}/dialog.d.ts +7 -7
- package/dist/src/{components → designs/react/components/lib}/dropdown-menu.d.ts +2 -2
- package/dist/src/designs/{constants.d.ts → react/constants.d.ts} +2 -4
- package/dist/src/designs/react/hooks/useLocale.d.ts +6 -0
- package/dist/src/{index.d.ts → designs/react/index.d.ts} +2 -2
- package/dist/src/designs/translation/ar.locale.d.ts +2 -0
- package/dist/src/designs/translation/de.locale.d.ts +2 -0
- package/dist/src/designs/translation/en.locale.d.ts +2 -0
- package/dist/src/designs/translation/fr.locale.d.ts +2 -0
- package/dist/src/designs/translation/index.d.ts +14 -0
- package/dist/src/designs/translation/nl.locale.d.ts +2 -0
- package/dist/src/designs/translation/pt.locale.d.ts +2 -0
- package/dist/src/designs/translation/translation.types.d.ts +4 -0
- package/dist/{core/client → src/headless/core}/api.d.ts +49 -103
- package/dist/src/headless/core/context/contact.d.ts +24 -0
- package/dist/src/headless/core/context/message.d.ts +42 -0
- package/dist/src/headless/core/context/session.d.ts +74 -0
- package/dist/src/headless/core/context/widget.d.ts +16 -0
- package/dist/src/headless/core/index.d.ts +10 -0
- package/dist/src/headless/core/types/WidgetConfig.d.ts +34 -0
- package/dist/src/headless/core/types/agent-or-bot.d.ts +6 -0
- package/dist/src/headless/core/types/helpers.d.ts +4 -0
- package/dist/{core → src/headless/core}/types/messages.d.ts +11 -31
- package/dist/src/headless/core/types/schemas.d.ts +9 -0
- package/dist/src/headless/core/utils/Poller.d.ts +12 -0
- package/dist/{core/types/pub-sub.d.ts → src/headless/core/utils/PubSub.d.ts} +6 -9
- package/dist/{react-web/core-integration/components.d.ts → src/headless/react/ComponentRegistry.d.ts} +1 -1
- package/dist/src/headless/react/WidgetProvider.d.ts +17 -0
- package/dist/src/headless/react/hooks/useConfig.d.ts +1 -0
- package/dist/src/headless/react/hooks/useContact.d.ts +10 -0
- package/dist/src/headless/react/hooks/useIsAwaitingBotReply.d.ts +3 -0
- package/dist/src/headless/react/hooks/useMessages.d.ts +8 -0
- package/dist/{react-web/core-integration → src/headless/react}/hooks/usePreludeData.d.ts +2 -2
- package/dist/{react-web/core-integration → src/headless/react}/hooks/usePubsub.d.ts +1 -1
- package/dist/src/headless/react/hooks/useSession.d.ts +6 -0
- package/dist/{react-web/core-integration → src/headless/react}/hooks/useVote.d.ts +2 -2
- package/dist/src/headless/react/index.d.ts +10 -0
- package/dist/{react-web → src/headless/react}/types/components.d.ts +6 -5
- package/dist/style.css +1 -1
- package/dist/useUploadFiles-CEd5c5iE.js +1336 -0
- package/dist/useUploadFiles-CEd5c5iE.js.map +1 -0
- package/dist/useUploadFiles-CNkahO3s.cjs +18 -0
- package/dist/useUploadFiles-CNkahO3s.cjs.map +1 -0
- package/dist/widget-BeNOCqB5.js +517 -0
- package/dist/widget-BeNOCqB5.js.map +1 -0
- package/dist/widget-DlAUwHzU.cjs +2 -0
- package/dist/widget-DlAUwHzU.cjs.map +1 -0
- package/dist-embed/script.js +137 -157
- package/dist-embed/script.js.map +1 -1
- package/package.json +9 -4
- package/dist/api-CAm3rFZk.js +0 -1070
- package/dist/api-CAm3rFZk.js.map +0 -1
- package/dist/api-oIDR-KZx.cjs +0 -2
- package/dist/api-oIDR-KZx.cjs.map +0 -1
- package/dist/core/client/chat.d.ts +0 -101
- package/dist/core/client/config.d.ts +0 -43
- package/dist/core/client/contact.d.ts +0 -29
- package/dist/core/client/index.d.ts +0 -4
- package/dist/core/errors/index.d.ts +0 -27
- package/dist/core/index.d.ts +0 -9
- package/dist/core/platform/audio.d.ts +0 -38
- package/dist/core/platform/index.d.ts +0 -15
- package/dist/core/platform/logger.d.ts +0 -14
- package/dist/core/platform/storage.d.ts +0 -52
- package/dist/core/tests/platform/logger.test.d.ts +0 -1
- package/dist/core/tests/platform/storage.test.d.ts +0 -1
- package/dist/core/tests/test-utils.d.ts +0 -2
- package/dist/core/tests/types/pub-sub.test.d.ts +0 -1
- package/dist/core/types/contact.d.ts +0 -2
- package/dist/core/types/helpers.d.ts +0 -20
- package/dist/core/types/index.d.ts +0 -52
- package/dist/core/types/prelude.d.ts +0 -14
- package/dist/core/types/schemas-v2.d.ts +0 -10
- package/dist/index-CSptf_Dw.cjs +0 -18
- package/dist/index-CSptf_Dw.cjs.map +0 -1
- package/dist/index-cUkS-tdv.js +0 -1232
- package/dist/index-cUkS-tdv.js.map +0 -1
- package/dist/react-web/core-integration/ChatProvider.d.ts +0 -107
- package/dist/react-web/core-integration/hooks/useChatMessages.d.ts +0 -70
- package/dist/react-web/core-integration/hooks/useChatSession.d.ts +0 -83
- package/dist/react-web/core-integration/hooks/useConfig.d.ts +0 -1
- package/dist/react-web/core-integration/hooks/useContact.d.ts +0 -17
- package/dist/react-web/core-integration/hooks/useLocale.d.ts +0 -4
- package/dist/react-web/core-integration/hooks.d.ts +0 -9
- package/dist/react-web/core-integration/index.d.ts +0 -2
- package/dist/react-web/core-integration/locales/ar.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/de.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/en.locale.d.ts +0 -55
- package/dist/react-web/core-integration/locales/fr.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/helper.d.ts +0 -65
- package/dist/react-web/core-integration/locales/index.d.ts +0 -3
- package/dist/react-web/core-integration/locales/nl.locale.d.ts +0 -2
- package/dist/react-web/core-integration/locales/pt.locale.d.ts +0 -2
- package/dist/react-web/hooks/useScrollTo.d.ts +0 -2
- package/dist/react-web/index.d.ts +0 -4
- package/dist/react-web/types/index.d.ts +0 -8
- package/dist/react-web/types/options.d.ts +0 -17
- package/dist/src/@components/BotOrAgentMessageWrapper.d.ts +0 -9
- package/dist/src/@components/ChatEvent.component.d.ts +0 -9
- package/dist/src/@components/index.d.ts +0 -6
- package/dist/src/designs/basic/index.d.ts +0 -8
- /package/dist/src/designs/{basic → react/basic}/WidgetPopoverTrigger.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatFooter.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatHeader.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatMain.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/chat-screen/ChatScreen.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/root-screen.d.ts +0 -0
- /package/dist/src/designs/{basic → react/basic}/screens/welcome-screen/WelcomeScreen.d.ts +0 -0
- /package/dist/{core/tests/client/integration-perisitance.test.d.ts → src/designs/react/basic/widget-interaction-tests/widget.test.d.ts} +0 -0
- /package/dist/src/{@components → designs/react/components}/Loading.component.d.ts +0 -0
- /package/dist/src/{@components → designs/react/components}/OpenLogoSvg.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/MotionDiv.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/avatar.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/input.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/popover.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/skeleton.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/switch.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/tooltip.d.ts +0 -0
- /package/dist/src/{utils.d.ts → designs/react/components/lib/utils/cn.d.ts} +0 -0
- /package/dist/src/{components → designs/react/components/lib}/wobble.d.ts +0 -0
- /package/dist/src/{@components → designs/react/components}/markdown.d.ts +0 -0
- /package/dist/{react-web → src/designs/react}/hooks/useWidgetContentHeight.d.ts +0 -0
- /package/dist/src/{render.d.ts → designs/react/render.d.ts} +0 -0
- /package/dist/{core → src/headless/core}/sdk/index.d.ts +0 -0
- /package/dist/{core/tests/client/integration.test.d.ts → src/headless/core/utils/PubSub.test.d.ts} +0 -0
- /package/dist/{core/utils/genUuid.d.ts → src/headless/core/utils/uuid.d.ts} +0 -0
- /package/dist/{react-web/core-integration → src/headless/react}/hooks/useUploadFiles.d.ts +0 -0
- /package/dist/{react-web → src/headless/react}/utils/create-safe-context.d.ts +0 -0
- /package/dist/{core/tests/platform/audio.test.d.ts → vitest/setup.d.ts} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./widget-DlAUwHzU.cjs");exports.PubSub=e.PubSub;exports.WidgetCtx=e.WidgetCtx;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './core/index'
|
|
1
|
+
export * from './src/headless/core/index'
|
|
2
2
|
export {}
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { P as b, W as e } from "./widget-BeNOCqB5.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
s as ConnectionError,
|
|
6
|
-
t as ExternalIdNotDefinedError,
|
|
7
|
-
i as FileUploadError,
|
|
8
|
-
n as LifecycleEvent,
|
|
9
|
-
l as OpenCXError,
|
|
10
|
-
E as PubSub,
|
|
11
|
-
c as SessionError,
|
|
12
|
-
b as SessionNotDefinedError,
|
|
13
|
-
d as StorageNotAvailableError,
|
|
14
|
-
f as TransportError,
|
|
15
|
-
A as createChat,
|
|
16
|
-
S as createConfig,
|
|
17
|
-
g as createContactHandler,
|
|
18
|
-
p as createLogger,
|
|
19
|
-
u as createPubSub,
|
|
20
|
-
C as isAudioAvailable,
|
|
21
|
-
v as isStorageAvailable,
|
|
22
|
-
O as safeAudioOperation,
|
|
23
|
-
h as safeStorageOperation
|
|
3
|
+
b as PubSub,
|
|
4
|
+
e as WidgetCtx
|
|
24
5
|
};
|
|
25
6
|
//# sourceMappingURL=index.js.map
|
package/dist/react.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-CNkahO3s.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>o==="up"?i.vote({action:"upvote",messagePublicId:t,sessionId:s}).then(u):i.vote({action:"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePubsub=e.usePubsub;exports.useSession=e.useSession;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useVote=a;
|
|
2
2
|
//# sourceMappingURL=react.cjs.map
|
package/dist/react.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"react.cjs","sources":["../src/headless/react/hooks/useVote.ts"],"sourcesContent":["import useAsyncFn from \"react-use/lib/useAsyncFn\";\nimport { useWidget } from \"../WidgetProvider\";\n\n/**\n * @param id\n * @param onSuccess\n * @returns\n */\nexport function useVote(id: string, sessionId: string, onSuccess?: () => void) {\n const { widgetCtx: { api } } = useWidget();\n return useAsyncFn(\n async (action: \"up\" | \"down\") => {\n if (action === \"up\") {\n return api\n .vote({ action: \"upvote\", messagePublicId: id, sessionId })\n .then(onSuccess);\n } else {\n return api\n .vote({ action: \"downvote\", messagePublicId: id, sessionId })\n .then(onSuccess);\n }\n },\n [api, id, sessionId, onSuccess],\n );\n}\n\n/**\n * @param id\n * @param onSuccess\n * @deprecated use useVote instead\n */\nexport function useUpvote(\n id: string,\n sessionId: string,\n onSuccess?: () => void,\n) {\n const { widgetCtx: { api } } = useWidget();\n return useAsyncFn(\n async () =>\n api\n .vote({ action: \"upvote\", messagePublicId: id, sessionId })\n .then(onSuccess),\n [api, id, sessionId, onSuccess],\n );\n}\n\n/**\n * @param id\n * @param onSuccess\n * @deprecated use useVote instead\n */\nexport function useDownvote(\n id: string,\n sessionId: string,\n onSuccess?: () => void,\n) {\n const { widgetCtx: { api } } = useWidget();\n return useAsyncFn(\n async () =>\n api\n .vote({ action: \"downvote\", messagePublicId: id, sessionId })\n .then(onSuccess),\n [api, id, sessionId, onSuccess],\n );\n}\n"],"names":["useVote","id","sessionId","onSuccess","api","useWidget","useAsyncFn","action"],"mappings":"iIAQgB,SAAAA,EAAQC,EAAYC,EAAmBC,EAAwB,CAC7E,KAAM,CAAE,UAAW,CAAE,IAAAC,CAAI,GAAMC,EAAU,UAAA,EAClC,OAAAC,EAAA,SACL,MAAOC,GACDA,IAAW,KACNH,EACJ,KAAK,CAAE,OAAQ,SAAU,gBAAiBH,EAAI,UAAAC,CAAW,CAAA,EACzD,KAAKC,CAAS,EAEVC,EACJ,KAAK,CAAE,OAAQ,WAAY,gBAAiBH,EAAI,UAAAC,CAAW,CAAA,EAC3D,KAAKC,CAAS,EAGrB,CAACC,EAAKH,EAAIC,EAAWC,CAAS,CAAA,CAElC"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './react
|
|
1
|
+
export * from './src/headless/react/index'
|
|
2
2
|
export {}
|
package/dist/react.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as o, _ as r } from "./useUploadFiles-CEd5c5iE.js";
|
|
2
|
+
import { W as p, a as d, b as f, c as b, d as c, e as m, f as v, g as P, h } from "./useUploadFiles-CEd5c5iE.js";
|
|
3
|
+
function n(e, t, s) {
|
|
4
|
+
const { widgetCtx: { api: a } } = o();
|
|
5
|
+
return r(
|
|
6
|
+
async (u) => u === "up" ? a.vote({ action: "upvote", messagePublicId: e, sessionId: t }).then(s) : a.vote({ action: "downvote", messagePublicId: e, sessionId: t }).then(s),
|
|
7
|
+
[a, e, t, s]
|
|
8
|
+
);
|
|
9
|
+
}
|
|
2
10
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
p as WidgetProvider,
|
|
12
|
+
d as useConfig,
|
|
13
|
+
f as useContact,
|
|
14
|
+
b as useIsAwaitingBotReply,
|
|
15
|
+
c as useMessages,
|
|
16
|
+
m as usePreludeData,
|
|
17
|
+
v as usePubsub,
|
|
18
|
+
P as useSession,
|
|
19
|
+
h as useUploadFiles,
|
|
20
|
+
n as useVote,
|
|
21
|
+
o as useWidget
|
|
12
22
|
};
|
|
13
23
|
//# sourceMappingURL=react.js.map
|
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../src/headless/react/hooks/useVote.ts"],"sourcesContent":["import useAsyncFn from \"react-use/lib/useAsyncFn\";\nimport { useWidget } from \"../WidgetProvider\";\n\n/**\n * @param id\n * @param onSuccess\n * @returns\n */\nexport function useVote(id: string, sessionId: string, onSuccess?: () => void) {\n const { widgetCtx: { api } } = useWidget();\n return useAsyncFn(\n async (action: \"up\" | \"down\") => {\n if (action === \"up\") {\n return api\n .vote({ action: \"upvote\", messagePublicId: id, sessionId })\n .then(onSuccess);\n } else {\n return api\n .vote({ action: \"downvote\", messagePublicId: id, sessionId })\n .then(onSuccess);\n }\n },\n [api, id, sessionId, onSuccess],\n );\n}\n\n/**\n * @param id\n * @param onSuccess\n * @deprecated use useVote instead\n */\nexport function useUpvote(\n id: string,\n sessionId: string,\n onSuccess?: () => void,\n) {\n const { widgetCtx: { api } } = useWidget();\n return useAsyncFn(\n async () =>\n api\n .vote({ action: \"upvote\", messagePublicId: id, sessionId })\n .then(onSuccess),\n [api, id, sessionId, onSuccess],\n );\n}\n\n/**\n * @param id\n * @param onSuccess\n * @deprecated use useVote instead\n */\nexport function useDownvote(\n id: string,\n sessionId: string,\n onSuccess?: () => void,\n) {\n const { widgetCtx: { api } } = useWidget();\n return useAsyncFn(\n async () =>\n api\n .vote({ action: \"downvote\", messagePublicId: id, sessionId })\n .then(onSuccess),\n [api, id, sessionId, onSuccess],\n );\n}\n"],"names":["useVote","id","sessionId","onSuccess","api","useWidget","useAsyncFn","action"],"mappings":";;AAQgB,SAAAA,EAAQC,GAAYC,GAAmBC,GAAwB;AAC7E,QAAM,EAAE,WAAW,EAAE,KAAAC,EAAI,MAAMC,EAAU;AAClC,SAAAC;AAAAA,IACL,OAAOC,MACDA,MAAW,OACNH,EACJ,KAAK,EAAE,QAAQ,UAAU,iBAAiBH,GAAI,WAAAC,EAAW,CAAA,EACzD,KAAKC,CAAS,IAEVC,EACJ,KAAK,EAAE,QAAQ,YAAY,iBAAiBH,GAAI,WAAAC,EAAW,CAAA,EAC3D,KAAKC,CAAS;AAAA,IAGrB,CAACC,GAAKH,GAAIC,GAAWC,CAAS;AAAA,EAAA;AAElC;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
import { WidgetConfig } from '../../../headless/core';
|
|
3
|
+
declare function Widget({ className, opened, ...props }: ComponentPropsWithoutRef<"div"> & {
|
|
4
|
+
opened?: boolean;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function WidgetRoot({ options, children, }: {
|
|
7
|
+
options: WidgetConfig;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { WidgetRoot, Widget };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentMessageType, BotMessageType, MessageType, UserMessageType } from '../../../../core
|
|
1
|
+
import { AgentMessageType, BotMessageType, MessageType, UserMessageType } from '../../../../headless/core';
|
|
2
2
|
export declare function groupMessagesByType(messages: MessageType[]): MessageType[][];
|
|
3
3
|
export declare function isUserMessageGroup(messages: MessageType[]): messages is UserMessageType[];
|
|
4
4
|
export declare function isBotMessageGroup(messages: MessageType[]): messages is BotMessageType[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AgentMessageType, BotMessageType } from '../../core/types';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { AgentMessageType, BotMessageType } from '../../../headless/core';
|
|
3
3
|
interface BotMessageProps<W extends React.ElementType> {
|
|
4
4
|
message: BotMessageType | AgentMessageType;
|
|
5
5
|
Wrapper?: W;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AgentMessageType, AgentType, BotMessageType } from '../../core/types';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { AgentMessageType, AgentOrBotType, BotMessageType } from '../../../headless/core';
|
|
3
3
|
export declare function BotOrAgentMessageGroup({ messages, agent, }: {
|
|
4
4
|
messages: BotMessageType[] | AgentMessageType[];
|
|
5
|
-
agent:
|
|
5
|
+
agent: AgentOrBotType | undefined;
|
|
6
6
|
}): React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentProps } from '../../react-web/types';
|
|
2
1
|
import { default as React } from 'react';
|
|
3
|
-
|
|
2
|
+
import { WidgetComponentProps } from '../../../headless/react/types/components';
|
|
3
|
+
type Props = WidgetComponentProps<unknown>;
|
|
4
4
|
/**
|
|
5
5
|
* The Basic Fallback component (Rendered when Debug is True and the component key is not found)
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ChatAttachmentType } from '../../core/types';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { MessageAttachmentType } from '../../../headless/core';
|
|
3
3
|
type Props = {
|
|
4
|
-
attachment:
|
|
4
|
+
attachment: MessageAttachmentType;
|
|
5
5
|
};
|
|
6
6
|
export declare function RenderAttachment({ attachment }: Props): React.JSX.Element;
|
|
7
7
|
export {};
|
package/dist/src/{components/keyboard.d.ts → designs/react/components/SuggestedReplies.d.ts}
RENAMED
|
@@ -3,5 +3,5 @@ type Props = {
|
|
|
3
3
|
options: string[];
|
|
4
4
|
onKeyboardClick: (option: string) => void;
|
|
5
5
|
};
|
|
6
|
-
declare function
|
|
7
|
-
export {
|
|
6
|
+
export declare function SuggestedReplies({ options, onKeyboardClick }: Props): React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DefaultTextComponentProps } from '
|
|
2
|
+
import { DefaultTextComponentProps } from '../../../headless/react/types/components';
|
|
3
3
|
export declare function BotOrAgentTextResponse({ data, id, type, attachments, }: DefaultTextComponentProps): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UserMessageType } from '../../core/types';
|
|
2
1
|
import { default as React } from 'react';
|
|
2
|
+
import { UserMessageType } from '../../../headless/core';
|
|
3
3
|
export declare function UserMessageGroup({ messages, }: {
|
|
4
4
|
messages: UserMessageType[];
|
|
5
5
|
}): React.JSX.Element;
|
|
@@ -4,5 +4,5 @@ interface VoteButtonsProps {
|
|
|
4
4
|
sessionId: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function VoteButtons({ messageId, sessionId, className }: VoteButtonsProps): React.JSX.Element;
|
|
7
|
+
export declare function VoteButtons({ messageId, sessionId, className, }: VoteButtonsProps): React.JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | "fit" | null | undefined;
|
|
6
|
-
} & import('class-variance-authority/
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
}
|
|
@@ -11,6 +11,9 @@ declare function Dialog({ defaultOpen, onOpenChange, open, children, isAlert, }:
|
|
|
11
11
|
}): React.JSX.Element;
|
|
12
12
|
declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
14
|
+
onError?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
15
|
+
content?: string | undefined;
|
|
16
|
+
id?: string | undefined;
|
|
14
17
|
slot?: string | undefined;
|
|
15
18
|
title?: string | undefined;
|
|
16
19
|
defaultChecked?: boolean | undefined;
|
|
@@ -18,7 +21,7 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
|
18
21
|
suppressContentEditableWarning?: boolean | undefined;
|
|
19
22
|
suppressHydrationWarning?: boolean | undefined;
|
|
20
23
|
accessKey?: string | undefined;
|
|
21
|
-
autoCapitalize?: "
|
|
24
|
+
autoCapitalize?: (string & {}) | "none" | "off" | "on" | "sentences" | "words" | "characters" | undefined;
|
|
22
25
|
autoFocus?: boolean | undefined;
|
|
23
26
|
className?: string | undefined;
|
|
24
27
|
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
@@ -27,7 +30,6 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
|
27
30
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
28
31
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
29
32
|
hidden?: boolean | undefined;
|
|
30
|
-
id?: string | undefined;
|
|
31
33
|
lang?: string | undefined;
|
|
32
34
|
nonce?: string | undefined;
|
|
33
35
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
@@ -36,7 +38,6 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
|
36
38
|
radioGroup?: string | undefined;
|
|
37
39
|
role?: React.AriaRole | undefined;
|
|
38
40
|
about?: string | undefined;
|
|
39
|
-
content?: string | undefined;
|
|
40
41
|
datatype?: string | undefined;
|
|
41
42
|
inlist?: any;
|
|
42
43
|
prefix?: string | undefined;
|
|
@@ -57,11 +58,11 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
|
57
58
|
results?: number | undefined;
|
|
58
59
|
security?: string | undefined;
|
|
59
60
|
unselectable?: "off" | "on" | undefined;
|
|
60
|
-
inputMode?: "
|
|
61
|
+
inputMode?: "url" | "text" | "none" | "search" | "tel" | "email" | "numeric" | "decimal" | undefined;
|
|
61
62
|
is?: string | undefined;
|
|
62
63
|
"aria-activedescendant"?: string | undefined;
|
|
63
64
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
64
|
-
"aria-autocomplete"?: "
|
|
65
|
+
"aria-autocomplete"?: "none" | "list" | "inline" | "both" | undefined;
|
|
65
66
|
"aria-braillelabel"?: string | undefined;
|
|
66
67
|
"aria-brailleroledescription"?: string | undefined;
|
|
67
68
|
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
@@ -145,7 +146,6 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
|
145
146
|
onInvalidCapture?: React.FormEventHandler<HTMLDivElement> | undefined;
|
|
146
147
|
onLoad?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
147
148
|
onLoadCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
148
|
-
onError?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
149
149
|
onErrorCapture?: React.ReactEventHandler<HTMLDivElement> | undefined;
|
|
150
150
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
151
151
|
onKeyDownCapture?: React.KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
@@ -273,4 +273,4 @@ declare const DialogContent: React.ForwardRefExoticComponent<Omit<{
|
|
|
273
273
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
274
274
|
} & import('framer-motion').MotionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
275
275
|
declare const DialogClose: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
276
|
-
export {
|
|
276
|
+
export { Dialog, DialogClose, DialogContent, DialogTrigger };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
4
|
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
5
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -24,4 +24,4 @@ declare const DropdownMenuShortcut: {
|
|
|
24
24
|
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
25
25
|
displayName: string;
|
|
26
26
|
};
|
|
27
|
-
export { DropdownMenu,
|
|
27
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|
|
@@ -7,9 +7,7 @@ export declare const DEFAULT_STYLES: {
|
|
|
7
7
|
readonly widgetHeight: "h-[600px]";
|
|
8
8
|
};
|
|
9
9
|
interface Colors {
|
|
10
|
-
primary
|
|
10
|
+
primary?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const cssVars: (
|
|
13
|
-
triggerOffset: string;
|
|
14
|
-
}) => CSSProperties;
|
|
12
|
+
export declare const cssVars: ({ primary }: Colors) => CSSProperties;
|
|
15
13
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WidgetConfig } from '../../headless/core';
|
|
2
2
|
declare global {
|
|
3
3
|
interface Window {
|
|
4
4
|
initOpenScript: typeof initOpenScript;
|
|
5
5
|
openCXWidgetVersion: string;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
declare function initOpenScript(options:
|
|
8
|
+
declare function initOpenScript(options: WidgetConfig): void;
|
|
9
9
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TranslationKeysU } from './translation.types';
|
|
2
|
+
declare const locales: {
|
|
3
|
+
readonly en: import('./translation.types').TranslationInterface;
|
|
4
|
+
readonly ar: import('./translation.types').TranslationInterface;
|
|
5
|
+
readonly nl: import('./translation.types').TranslationInterface;
|
|
6
|
+
readonly fr: import('./translation.types').TranslationInterface;
|
|
7
|
+
readonly de: import('./translation.types').TranslationInterface;
|
|
8
|
+
readonly pt: import('./translation.types').TranslationInterface;
|
|
9
|
+
};
|
|
10
|
+
export declare const LOCALES: (keyof typeof locales)[];
|
|
11
|
+
export type Locale = (typeof LOCALES)[number];
|
|
12
|
+
export declare const isSupportedLocale: (lang: string | null | undefined) => lang is Locale;
|
|
13
|
+
export declare function getTranslation(key: TranslationKeysU, lang: Locale): string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type TranslationKeysU = "ok" | "yes" | "no" | "agree" | "cancel" | "yes-exit" | "yes-reset" | "no-cancel" | "are-you-sure" | "recording" | "thank-you" | "sorry-try-again" | "error-occurred" | "please-try-again" | "write-a-message" | "send-message" | "connected" | "connecting" | "reconnecting" | "reconnected" | "disconnecting" | "disconnected" | "error" | "persist-session" | "settings" | "close" | "help" | "chat" | "send" | "copy" | "copied" | "sound-effects" | "language" | "select" | "agent" | "user" | "bot" | "reset-conversation-confirm" | "close-widget" | "got-any-questions" | "typical-response-time" | "session-closed-lead" | "create-new-ticket" | "exit" | "reset-conversation" | "welcome-title" | "welcome-description" | "your-name" | "your-email" | "start-chat" | "starting-chat" | "hello-greeting";
|
|
2
|
+
export type TranslationInterface = {
|
|
3
|
+
[K in TranslationKeysU]: string;
|
|
4
|
+
};
|