@fiction/sdk 1.0.28 → 1.0.30
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/FModal.vue_vue_type_script_setup_true_lang-DaI-YWPp.js +146 -0
- package/dist/FModal.vue_vue_type_script_setup_true_lang-DaI-YWPp.js.map +1 -0
- package/dist/SelfProvider.vue_vue_type_script_setup_true_lang-hdOg9n4q.js +38 -0
- package/dist/SelfProvider.vue_vue_type_script_setup_true_lang-hdOg9n4q.js.map +1 -0
- package/dist/SelfWidgetInline-4qXty8nA.js +39 -0
- package/dist/SelfWidgetInline-4qXty8nA.js.map +1 -0
- package/dist/SelfWidgetModal-DWA5AU4S.js +62 -0
- package/dist/SelfWidgetModal-DWA5AU4S.js.map +1 -0
- package/dist/SelfWidgetPopup-BJ3q8ryL.js +117 -0
- package/dist/SelfWidgetPopup-BJ3q8ryL.js.map +1 -0
- package/dist/SelfWrap.vue_vue_type_script_setup_true_lang-DN-erii6.js +5426 -0
- package/dist/SelfWrap.vue_vue_type_script_setup_true_lang-DN-erii6.js.map +1 -0
- package/dist/sdk.css +1 -1
- package/dist/self/ui/SelfWidgetModal.vue.d.ts +23 -0
- package/dist/self.js +83 -5646
- package/dist/self.js.map +1 -1
- package/dist/widget/FictionWidget.d.ts +49 -0
- package/dist/widget/index.d.ts +2 -0
- package/dist/widget/ui/SelfWidgetInline.vue.d.ts +19 -0
- package/dist/widget/ui/SelfWidgetPopup.vue.d.ts +26 -0
- package/dist/widget.js +117 -0
- package/dist/widget.js.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Self } from '@fiction/types';
|
|
2
|
+
type WidgetMode = 'inline' | 'popup' | 'modal';
|
|
3
|
+
export interface WidgetConfig {
|
|
4
|
+
el?: HTMLElement;
|
|
5
|
+
mode: WidgetMode;
|
|
6
|
+
handle?: string;
|
|
7
|
+
self?: Self;
|
|
8
|
+
context?: string;
|
|
9
|
+
firstMessage?: string;
|
|
10
|
+
apiBase?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface WidgetUpdate {
|
|
13
|
+
self?: Self;
|
|
14
|
+
context?: string;
|
|
15
|
+
firstMessage?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class FictionWidget {
|
|
18
|
+
private app;
|
|
19
|
+
private shadowRoot;
|
|
20
|
+
private widgetInstance;
|
|
21
|
+
private config;
|
|
22
|
+
private sdk;
|
|
23
|
+
private container;
|
|
24
|
+
private static modalInstances;
|
|
25
|
+
constructor(config: WidgetConfig);
|
|
26
|
+
private init;
|
|
27
|
+
private mountMode;
|
|
28
|
+
/**
|
|
29
|
+
* Update widget with new configuration without re-mounting
|
|
30
|
+
*/
|
|
31
|
+
update(updates: WidgetUpdate): void;
|
|
32
|
+
/**
|
|
33
|
+
* Toggle widget visibility (popup mode only)
|
|
34
|
+
*/
|
|
35
|
+
toggle(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Open widget (popup mode only)
|
|
38
|
+
*/
|
|
39
|
+
open(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Close widget (popup mode only)
|
|
42
|
+
*/
|
|
43
|
+
close(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Destroy widget and cleanup
|
|
46
|
+
*/
|
|
47
|
+
destroy(): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FictionSDK } from '../../sdkClient';
|
|
2
|
+
import { Self } from '@fiction/types';
|
|
3
|
+
export interface Props {
|
|
4
|
+
sdk?: FictionSDK;
|
|
5
|
+
handle?: string;
|
|
6
|
+
self?: Self;
|
|
7
|
+
context?: string;
|
|
8
|
+
firstMessage?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface WidgetUpdate {
|
|
11
|
+
self?: Self;
|
|
12
|
+
context?: string;
|
|
13
|
+
firstMessage?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function update(updates: WidgetUpdate): void;
|
|
16
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
17
|
+
update: typeof update;
|
|
18
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FictionSDK } from '../../sdkClient';
|
|
2
|
+
import { Self } from '@fiction/types';
|
|
3
|
+
interface Props {
|
|
4
|
+
sdk?: FictionSDK;
|
|
5
|
+
handle?: string;
|
|
6
|
+
self?: Self;
|
|
7
|
+
context?: string;
|
|
8
|
+
firstMessage?: string;
|
|
9
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
10
|
+
}
|
|
11
|
+
export interface WidgetUpdate {
|
|
12
|
+
self?: Self;
|
|
13
|
+
context?: string;
|
|
14
|
+
firstMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function toggle(): void;
|
|
17
|
+
declare function open(): void;
|
|
18
|
+
declare function close(): void;
|
|
19
|
+
declare function update(updates: WidgetUpdate): void;
|
|
20
|
+
declare const _default: import('vue').DefineComponent<Props, {
|
|
21
|
+
toggle: typeof toggle;
|
|
22
|
+
open: typeof open;
|
|
23
|
+
close: typeof close;
|
|
24
|
+
update: typeof update;
|
|
25
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
26
|
+
export default _default;
|