@opencx/widget 2.6.2 → 3.0.0
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 +34083 -34125
- 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 → 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/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 +56 -143
- package/dist/src/headless/core/context/contact.d.ts +25 -0
- package/dist/src/headless/core/context/message.d.ts +40 -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 +7 -0
- package/dist/{core → src/headless/core}/sdk/index.d.ts +5 -4
- 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/useUploadFiles.d.ts +1 -1
- package/dist/{react-web/core-integration → src/headless/react}/hooks/useVote.d.ts +2 -2
- package/dist/src/headless/react/index.d.ts +11 -0
- package/dist/src/headless/react/types/components.d.ts +15 -0
- package/dist/style.css +1 -1
- package/dist/useUploadFiles-BZa0DENN.cjs +18 -0
- package/dist/useUploadFiles-BZa0DENN.cjs.map +1 -0
- package/dist/useUploadFiles-BaCcqTwX.js +1336 -0
- package/dist/useUploadFiles-BaCcqTwX.js.map +1 -0
- package/dist/widget-BlvH6dre.cjs +2 -0
- package/dist/widget-BlvH6dre.cjs.map +1 -0
- package/dist/widget-DbgWez1r.js +514 -0
- package/dist/widget-DbgWez1r.js.map +1 -0
- package/dist-embed/script.js +127 -142
- package/dist-embed/script.js.map +1 -1
- package/package.json +12 -8
- package/dist/api-BEtFfKMB.cjs +0 -2
- package/dist/api-BEtFfKMB.cjs.map +0 -1
- package/dist/api-Cez5T-se.js +0 -1393
- package/dist/api-Cez5T-se.js.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-BzidnDPX.cjs +0 -18
- package/dist/index-BzidnDPX.cjs.map +0 -1
- package/dist/index-DUlnC30_.js +0 -1219
- package/dist/index-DUlnC30_.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/components.d.ts +0 -13
- 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}/keyboard.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}/button.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/dialog.d.ts +0 -0
- /package/dist/src/{components → designs/react/components/lib}/dropdown-menu.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/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 → 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-BlvH6dre.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-DbgWez1r.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-BZa0DENN.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-BaCcqTwX.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-BaCcqTwX.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 'src/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 '
|
|
1
|
+
import { AgentMessageType, BotMessageType, MessageType, UserMessageType } from 'src/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,4 +1,4 @@
|
|
|
1
|
-
import { AgentMessageType, BotMessageType } from '
|
|
1
|
+
import { AgentMessageType, BotMessageType } from 'src/headless/core';
|
|
2
2
|
import { default as React } from 'react';
|
|
3
3
|
interface BotMessageProps<W extends React.ElementType> {
|
|
4
4
|
message: BotMessageType | AgentMessageType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AgentMessageType,
|
|
1
|
+
import { AgentMessageType, AgentOrBotType, BotMessageType } from 'src/headless/core';
|
|
2
2
|
import { default as React } from 'react';
|
|
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 'src/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 {
|
|
1
|
+
import { MessageAttachmentType } from 'src/headless/core';
|
|
2
2
|
import { default as React } from 'react';
|
|
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 {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DefaultTextComponentProps } from '
|
|
2
|
+
import { DefaultTextComponentProps } from 'src/headless/react/types/components';
|
|
3
3
|
export declare function BotOrAgentTextResponse({ data, id, type, attachments, }: DefaultTextComponentProps): 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 {};
|
|
@@ -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 'src/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
|
+
};
|