@opencx/widget 2.5.1 → 2.6.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/api-BwKgAJ6p.cjs +2 -0
- package/dist/api-BwKgAJ6p.cjs.map +1 -0
- package/dist/api-DRZ9vPwy.js +1360 -0
- package/dist/api-DRZ9vPwy.js.map +1 -0
- package/dist/basic.cjs +85 -85
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.js +13350 -12831
- package/dist/basic.js.map +1 -1
- package/dist/core/client/api.d.ts +368 -40
- package/dist/core/client/chat.d.ts +55 -12
- package/dist/core/client/config.d.ts +13 -3
- package/dist/core/client/contact.d.ts +3 -13
- package/dist/core/errors/index.d.ts +6 -0
- package/dist/core/platform/audio.d.ts +38 -0
- package/dist/core/platform/index.d.ts +6 -2
- package/dist/core/platform/storage.d.ts +8 -2
- package/dist/core/sdk/index.d.ts +11 -0
- package/dist/core/tests/platform/logger.test.d.ts +1 -0
- package/dist/core/tests/platform/storage.test.d.ts +1 -0
- package/dist/core/tests/test-utils.d.ts +2 -0
- package/dist/core/tests/types/pub-sub.test.d.ts +1 -0
- package/dist/core/types/helpers.d.ts +5 -2
- package/dist/core/types/index.d.ts +6 -6
- package/dist/core/types/messages.d.ts +20 -9
- package/dist/core/types/pub-sub.d.ts +1 -0
- package/dist/core/types/schemas-v2.d.ts +10 -710
- package/dist/index-B5YLfjom.cjs +18 -0
- package/dist/index-B5YLfjom.cjs.map +1 -0
- package/dist/index-EZN9_jan.js +1219 -0
- package/dist/index-EZN9_jan.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -874
- package/dist/index.js.map +1 -1
- package/dist/react-web/core-integration/ChatProvider.d.ts +101 -0
- package/dist/react-web/core-integration/components.d.ts +11 -0
- package/dist/react-web/core-integration/hooks/useChatMessages.d.ts +64 -0
- package/dist/react-web/core-integration/hooks/useChatSession.d.ts +77 -0
- package/dist/react-web/core-integration/hooks/useConfig.d.ts +1 -0
- package/dist/react-web/core-integration/hooks/useContact.d.ts +11 -0
- package/dist/react-web/core-integration/hooks/useLocale.d.ts +4 -0
- package/dist/react-web/core-integration/hooks/usePreludeData.d.ts +36 -0
- package/dist/react-web/core-integration/hooks/usePubsub.d.ts +2 -0
- package/dist/react-web/{hooks → core-integration/hooks}/useUploadFiles.d.ts +2 -2
- package/dist/react-web/{hooks → core-integration/hooks}/useVote.d.ts +2 -2
- package/dist/react-web/core-integration/hooks.d.ts +9 -0
- package/dist/react-web/core-integration/index.d.ts +2 -0
- package/dist/react-web/index.d.ts +4 -10
- package/dist/react-web/types/components.d.ts +6 -3
- package/dist/react-web/types/index.d.ts +3 -2
- package/dist/react-web/types/options.d.ts +4 -30
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +10 -46
- package/dist/react.js.map +1 -1
- package/dist/src/@components/BotOrAgentMessageGroup.d.ts +1 -2
- package/dist/src/@components/BotOrAgentMessageWrapper.d.ts +2 -2
- package/dist/src/@components/ChatEvent.component.d.ts +3 -3
- package/dist/src/@components/Text.component.d.ts +1 -1
- package/dist/src/components/button.d.ts +1 -1
- package/dist/src/components/dialog.d.ts +9 -9
- package/dist/src/designs/basic/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist-embed/script.js +119 -124
- package/dist-embed/script.js.map +1 -1
- package/package.json +8 -4
- package/dist/core/types/schemas.d.ts +0 -543
- package/dist/core/utils/create-fetch.d.ts +0 -24
- package/dist/core/utils/genId.d.ts +0 -2
- package/dist/core/utils/history-to-widget-messages.d.ts +0 -4
- package/dist/genUuid-BkZtn1k9.cjs +0 -2
- package/dist/genUuid-BkZtn1k9.cjs.map +0 -1
- package/dist/genUuid-CDpI3ugS.js +0 -136
- package/dist/genUuid-CDpI3ugS.js.map +0 -1
- package/dist/index-1bY4_hBw.cjs +0 -18
- package/dist/index-1bY4_hBw.cjs.map +0 -1
- package/dist/index-D84Xc70r.js +0 -2609
- package/dist/index-D84Xc70r.js.map +0 -1
- package/dist/package.json.d.ts +0 -157
- package/dist/react-web/Root.d.ts +0 -6
- package/dist/react-web/hooks/index.d.ts +0 -6
- package/dist/react-web/hooks/use-sound.d.ts +0 -13
- package/dist/react-web/hooks/useAbstractChat.d.ts +0 -157
- package/dist/react-web/hooks/useAxiosInstance.d.ts +0 -190
- package/dist/react-web/hooks/useSyncState.d.ts +0 -4
- package/dist/react-web/hooks/useTimeoutState.d.ts +0 -3
- package/dist/react-web/providers/ChatProvider.d.ts +0 -143
- package/dist/react-web/providers/ConfigDataProvider.d.ts +0 -62
- package/dist/react-web/providers/ContactProvider.d.ts +0 -58
- package/dist/react-web/providers/LocalesProvider.d.ts +0 -11
- package/dist/react-web/providers/componentRegistry.d.ts +0 -13
- package/dist/react-web/providers/use-widget-sfx.d.ts +0 -7
- package/dist/react-web/providers/usePreludeData.d.ts +0 -2
- package/dist/react-web/utils/debug.d.ts +0 -2
- package/dist/react-web/utils/getters.d.ts +0 -24
- package/dist/react-web/utils/index.d.ts +0 -1
- package/dist/src/hooks/useShouldCollectData.d.ts +0 -3
- /package/dist/core/{utils/genId.test.d.ts → tests/client/integration-perisitance.test.d.ts} +0 -0
- /package/dist/{react-web/hooks/use-sound.test.d.ts → core/tests/client/integration.test.d.ts} +0 -0
- /package/dist/{react-web/hooks/use-sync-state.test.d.ts → core/tests/platform/audio.test.d.ts} +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/ar.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/de.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/en.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/fr.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/helper.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/index.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/nl.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/pt.locale.d.ts +0 -0
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { WidgetOptions, WidgetThemeOptions } from '../types';
|
|
3
|
-
import { useAxiosInstance } from '../hooks';
|
|
4
|
-
import { ComponentRegistry } from './componentRegistry';
|
|
5
|
-
declare function useNormalizeOptions(data: WidgetOptions): {
|
|
6
|
-
bot: {
|
|
7
|
-
id: string | null;
|
|
8
|
-
name: string;
|
|
9
|
-
is_ai: boolean;
|
|
10
|
-
profile_picture?: string | null | undefined;
|
|
11
|
-
};
|
|
12
|
-
apiUrl: string;
|
|
13
|
-
socketUrl: string;
|
|
14
|
-
language: "en" | "ar" | "nl" | "fr" | "de" | "pt";
|
|
15
|
-
botToken: string;
|
|
16
|
-
headers: Record<string, string>;
|
|
17
|
-
pathParams: Record<string, string>;
|
|
18
|
-
queryParams: Record<string, string>;
|
|
19
|
-
user: import('../types').UserObject;
|
|
20
|
-
theme: WidgetThemeOptions & Partial<WidgetThemeOptions>;
|
|
21
|
-
soundEffectFiles: {
|
|
22
|
-
messageArrived: string;
|
|
23
|
-
};
|
|
24
|
-
collectUserData: boolean;
|
|
25
|
-
defaultSettings: {
|
|
26
|
-
persistSession: boolean;
|
|
27
|
-
useSoundEffects: boolean;
|
|
28
|
-
};
|
|
29
|
-
token: string;
|
|
30
|
-
initialMessages: string[];
|
|
31
|
-
settings?: {
|
|
32
|
-
persistSession?: boolean;
|
|
33
|
-
useSoundEffects?: boolean;
|
|
34
|
-
};
|
|
35
|
-
debug?: boolean;
|
|
36
|
-
assets?: {
|
|
37
|
-
organizationLogo?: string;
|
|
38
|
-
};
|
|
39
|
-
components?: import('../types').ComponentType[];
|
|
40
|
-
};
|
|
41
|
-
export type NormalizedWidgetOptions = ReturnType<typeof useNormalizeOptions>;
|
|
42
|
-
type WidgetSettings = {
|
|
43
|
-
persistSession: boolean;
|
|
44
|
-
useSoundEffects: boolean;
|
|
45
|
-
};
|
|
46
|
-
interface ConfigData extends ReturnType<typeof useNormalizeOptions> {
|
|
47
|
-
http: ReturnType<typeof useAxiosInstance>;
|
|
48
|
-
botToken: string;
|
|
49
|
-
componentStore: ComponentRegistry;
|
|
50
|
-
widgetSettings: WidgetSettings | null;
|
|
51
|
-
setSettings: (settings: Partial<WidgetSettings>) => void;
|
|
52
|
-
defaultSettings: WidgetSettings;
|
|
53
|
-
soundEffectFiles: {
|
|
54
|
-
messageArrived: string;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
declare const useConfigData: () => ConfigData;
|
|
58
|
-
export declare function ConfigDataProvider({ children, data, }: {
|
|
59
|
-
data: WidgetOptions;
|
|
60
|
-
children: ReactNode;
|
|
61
|
-
}): React.JSX.Element;
|
|
62
|
-
export { useConfigData };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { UserObject } from '../types';
|
|
3
|
-
declare const useContact: () => {
|
|
4
|
-
creatingContactState: {
|
|
5
|
-
loading: boolean;
|
|
6
|
-
error?: undefined;
|
|
7
|
-
value?: undefined;
|
|
8
|
-
} | {
|
|
9
|
-
loading: false;
|
|
10
|
-
error: Error;
|
|
11
|
-
value?: undefined;
|
|
12
|
-
} | {
|
|
13
|
-
loading: true;
|
|
14
|
-
error?: Error | undefined;
|
|
15
|
-
value?: {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string | null;
|
|
18
|
-
email: string | null;
|
|
19
|
-
avatar_url: string | null;
|
|
20
|
-
created_at: string;
|
|
21
|
-
} | null | undefined;
|
|
22
|
-
} | {
|
|
23
|
-
loading: false;
|
|
24
|
-
error?: undefined;
|
|
25
|
-
value: {
|
|
26
|
-
id: string;
|
|
27
|
-
name: string | null;
|
|
28
|
-
email: string | null;
|
|
29
|
-
avatar_url: string | null;
|
|
30
|
-
created_at: string;
|
|
31
|
-
} | null;
|
|
32
|
-
};
|
|
33
|
-
createContactAsync: (user: UserObject) => Promise<{
|
|
34
|
-
id: string;
|
|
35
|
-
name: string | null;
|
|
36
|
-
email: string | null;
|
|
37
|
-
avatar_url: string | null;
|
|
38
|
-
created_at: string;
|
|
39
|
-
} | null>;
|
|
40
|
-
contact: {
|
|
41
|
-
id: string;
|
|
42
|
-
name: string | null;
|
|
43
|
-
email: string | null;
|
|
44
|
-
avatar_url: string | null;
|
|
45
|
-
created_at: string;
|
|
46
|
-
} | null;
|
|
47
|
-
shouldCollectData: {
|
|
48
|
-
should: boolean;
|
|
49
|
-
reason: string;
|
|
50
|
-
} | {
|
|
51
|
-
should: boolean;
|
|
52
|
-
reason?: undefined;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
declare function ContactProvider({ children }: {
|
|
56
|
-
children: ReactNode;
|
|
57
|
-
}): React.JSX.Element;
|
|
58
|
-
export { ContactProvider, useContact };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LangType } from '../locales';
|
|
2
|
-
import { TranslationKeysType } from '@react/locales/en.locale';
|
|
3
|
-
import { default as React } from 'react';
|
|
4
|
-
declare const useLocale: () => {
|
|
5
|
-
get: (key: TranslationKeysType, pfx?: string) => string;
|
|
6
|
-
lang: LangType;
|
|
7
|
-
};
|
|
8
|
-
declare function LocaleProvider({ children }: {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}): React.JSX.Element;
|
|
11
|
-
export { LocaleProvider, useLocale };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ComponentType, OptionsType } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* this a singleton class helps me to easily control the components present/available in the widget.
|
|
4
|
-
* it also manages the various types of components to be added along the way.
|
|
5
|
-
*/
|
|
6
|
-
export declare class ComponentRegistry {
|
|
7
|
-
components: ComponentType[];
|
|
8
|
-
constructor(opts: OptionsType);
|
|
9
|
-
register(com: ComponentType): this;
|
|
10
|
-
private get;
|
|
11
|
-
private getOrFallback;
|
|
12
|
-
getComponent(key: string, getFallback?: boolean): import('react').ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ChatHistoryMessageType } from '@core/types/schemas';
|
|
2
|
-
interface DayOfficeHours {
|
|
3
|
-
from: string;
|
|
4
|
-
to: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const workingDays: readonly ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "WeekDays", "Everyday"];
|
|
7
|
-
export type PreludeData = {
|
|
8
|
-
initial_questions: string[];
|
|
9
|
-
ai_enabled: boolean;
|
|
10
|
-
office_hours: WorkingHours;
|
|
11
|
-
office_hours_timezone: string;
|
|
12
|
-
organization_name: string;
|
|
13
|
-
};
|
|
14
|
-
type Day = (typeof workingDays)[number];
|
|
15
|
-
export type WorkingHours = {
|
|
16
|
-
[K in Day]: DayOfficeHours;
|
|
17
|
-
};
|
|
18
|
-
export type InitialData = {
|
|
19
|
-
logo: string;
|
|
20
|
-
faq: [];
|
|
21
|
-
initial_questions: string[];
|
|
22
|
-
history: ChatHistoryMessageType[];
|
|
23
|
-
};
|
|
24
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './getters';
|
|
File without changes
|
/package/dist/{react-web/hooks/use-sound.test.d.ts → core/tests/client/integration.test.d.ts}
RENAMED
|
File without changes
|
/package/dist/{react-web/hooks/use-sync-state.test.d.ts → core/tests/platform/audio.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|