@pagelines/sdk 1.0.148
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/README.md +542 -0
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang-BGCgpGEW.js +42 -0
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang-BGCgpGEW.js.map +1 -0
- package/dist/AgentWidgetInline-pTCUPNqY.js +35 -0
- package/dist/AgentWidgetInline-pTCUPNqY.js.map +1 -0
- package/dist/AgentWidgetModal-BA74AH8E.js +66 -0
- package/dist/AgentWidgetModal-BA74AH8E.js.map +1 -0
- package/dist/AgentWidgetPopup-pe5CmJfa.js +117 -0
- package/dist/AgentWidgetPopup-pe5CmJfa.js.map +1 -0
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang-Bvik7Wdb.js +5139 -0
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang-Bvik7Wdb.js.map +1 -0
- package/dist/FModal.vue_vue_type_script_setup_true_lang-cL0BFEkZ.js +172 -0
- package/dist/FModal.vue_vue_type_script_setup_true_lang-cL0BFEkZ.js.map +1 -0
- package/dist/agent/AgentController.d.ts +81 -0
- package/dist/agent/ClientAudio.d.ts +102 -0
- package/dist/agent/constants.d.ts +16 -0
- package/dist/agent/index.d.ts +10 -0
- package/dist/agent/schema.d.ts +46 -0
- package/dist/agent/test/AgentController.test.d.ts +1 -0
- package/dist/agent/test/utils.test.d.ts +1 -0
- package/dist/agent/ui/AgentChat.vue.d.ts +27 -0
- package/dist/agent/ui/AgentInputEmail.vue.d.ts +9 -0
- package/dist/agent/ui/AgentInputOneTimeCode.vue.d.ts +13 -0
- package/dist/agent/ui/AgentModal.vue.d.ts +16 -0
- package/dist/agent/ui/AgentProvider.vue.d.ts +22 -0
- package/dist/agent/ui/AgentSidebarClose.vue.d.ts +6 -0
- package/dist/agent/ui/AgentWidget.vue.d.ts +17 -0
- package/dist/agent/ui/AgentWrap.vue.d.ts +128 -0
- package/dist/agent/ui/ElAgentAbout.vue.d.ts +6 -0
- package/dist/agent/ui/ElAgentButton.vue.d.ts +26 -0
- package/dist/agent/ui/ElAgentChat.vue.d.ts +11 -0
- package/dist/agent/ui/ElAgentHeader.vue.d.ts +6 -0
- package/dist/agent/ui/ElAgentModeSidebar.vue.d.ts +11 -0
- package/dist/agent/ui/ElAgentSidebar.vue.d.ts +14 -0
- package/dist/agent/ui/ElAuthGate.vue.d.ts +6 -0
- package/dist/agent/ui/ElModeHeader.vue.d.ts +9 -0
- package/dist/agent/ui/ElSidebar.vue.d.ts +30 -0
- package/dist/agent/utils.d.ts +34 -0
- package/dist/agent.js +162 -0
- package/dist/agent.js.map +1 -0
- package/dist/api.d.ts +23 -0
- package/dist/constants/socialPlatforms.d.ts +10 -0
- package/dist/demo/index.d.ts +105 -0
- package/dist/demo.js +264 -0
- package/dist/demo.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/sdk.css +1 -0
- package/dist/sdk.js +9 -0
- package/dist/sdk.js.map +1 -0
- package/dist/sdkClient-BmWhfelO.js +939 -0
- package/dist/sdkClient-BmWhfelO.js.map +1 -0
- package/dist/sdkClient.d.ts +762 -0
- package/dist/sdkStorage.d.ts +39 -0
- package/dist/socialPlatforms-Ck-b3SnQ.js +82 -0
- package/dist/socialPlatforms-Ck-b3SnQ.js.map +1 -0
- package/dist/test/api.test.d.ts +1 -0
- package/dist/test/build.test.d.ts +1 -0
- package/dist/types/SDKAppType.stub.d.ts +6 -0
- package/dist/vite-env.d.ts +13 -0
- package/dist/vite.config.sdk.d.ts +2 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/widget/PLWidget.d.ts +55 -0
- package/dist/widget/composables/usePLWidget.d.ts +57 -0
- package/dist/widget/index.d.ts +4 -0
- package/dist/widget/ui/AgentWidgetInline.vue.d.ts +17 -0
- package/dist/widget/ui/AgentWidgetModal.vue.d.ts +22 -0
- package/dist/widget/ui/AgentWidgetPopup.vue.d.ts +24 -0
- package/dist/widget.js +188 -0
- package/dist/widget.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { EnrichedUser } from '@pagelines/types';
|
|
3
|
+
/**
|
|
4
|
+
* SDKStorage - Handles all storage, sync, and persistence for PageLinesSDK
|
|
5
|
+
*
|
|
6
|
+
* Extracted from PageLinesSDK to keep the main class focused on public API methods.
|
|
7
|
+
* Manages localStorage, cookies, and nanostor synchronization for state persistence.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SDKStorage {
|
|
10
|
+
private logger;
|
|
11
|
+
/**
|
|
12
|
+
* Check if localStorage is fully functional (some test environments provide partial mocks)
|
|
13
|
+
*/
|
|
14
|
+
private isLocalStorageFunctional;
|
|
15
|
+
/**
|
|
16
|
+
* Sync Vue reactive refs with global nanostores for cross-page persistence
|
|
17
|
+
*/
|
|
18
|
+
syncWithGlobalStores(activeUser: Ref<EnrichedUser | undefined>, token: Ref<string | null>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Load user and token from browser storage on initialization
|
|
21
|
+
*/
|
|
22
|
+
loadFromStorage(activeUser: Ref<EnrichedUser | undefined>, token: Ref<string | null>): void;
|
|
23
|
+
/**
|
|
24
|
+
* Save current user and token to browser storage
|
|
25
|
+
*/
|
|
26
|
+
saveToStorage(activeUser: Ref<EnrichedUser | undefined>, token: Ref<string | null>): void;
|
|
27
|
+
/**
|
|
28
|
+
* Clear all stored user data and tokens
|
|
29
|
+
*/
|
|
30
|
+
clearStorage(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Generic localStorage getter
|
|
33
|
+
*/
|
|
34
|
+
getItem(key: string): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Generic localStorage setter
|
|
37
|
+
*/
|
|
38
|
+
setItem(key: string, value: string): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var l = (e, t) => o(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
const a = {
|
|
4
|
+
linkedin: {
|
|
5
|
+
label: "LinkedIn",
|
|
6
|
+
icon: "i-simple-icons-linkedin",
|
|
7
|
+
placeholder: "john-smith",
|
|
8
|
+
getUrl: /* @__PURE__ */ l((e) => `https://linkedin.com/in/${e}`, "getUrl")
|
|
9
|
+
},
|
|
10
|
+
x: {
|
|
11
|
+
label: "X",
|
|
12
|
+
icon: "i-simple-icons-x",
|
|
13
|
+
placeholder: "johnsmith",
|
|
14
|
+
getUrl: /* @__PURE__ */ l((e) => `https://x.com/${e}`, "getUrl")
|
|
15
|
+
},
|
|
16
|
+
facebook: {
|
|
17
|
+
label: "Facebook",
|
|
18
|
+
icon: "i-simple-icons-facebook",
|
|
19
|
+
placeholder: "johnsmith",
|
|
20
|
+
getUrl: /* @__PURE__ */ l((e) => `https://facebook.com/${e}`, "getUrl")
|
|
21
|
+
},
|
|
22
|
+
tiktok: {
|
|
23
|
+
label: "TikTok",
|
|
24
|
+
icon: "i-simple-icons-tiktok",
|
|
25
|
+
placeholder: "johnsmith",
|
|
26
|
+
getUrl: /* @__PURE__ */ l((e) => `https://tiktok.com/@${e}`, "getUrl")
|
|
27
|
+
},
|
|
28
|
+
youtube: {
|
|
29
|
+
label: "YouTube",
|
|
30
|
+
icon: "i-tabler-brand-youtube",
|
|
31
|
+
placeholder: "johnsmith",
|
|
32
|
+
getUrl: /* @__PURE__ */ l((e) => `https://youtube.com/@${e}`, "getUrl")
|
|
33
|
+
},
|
|
34
|
+
github: {
|
|
35
|
+
label: "GitHub",
|
|
36
|
+
icon: "i-tabler-brand-github",
|
|
37
|
+
placeholder: "johnsmith",
|
|
38
|
+
getUrl: /* @__PURE__ */ l((e) => `https://github.com/${e}`, "getUrl")
|
|
39
|
+
},
|
|
40
|
+
instagram: {
|
|
41
|
+
label: "Instagram",
|
|
42
|
+
icon: "i-simple-icons-instagram",
|
|
43
|
+
placeholder: "johnsmith",
|
|
44
|
+
getUrl: /* @__PURE__ */ l((e) => `https://instagram.com/${e}`, "getUrl")
|
|
45
|
+
},
|
|
46
|
+
threads: {
|
|
47
|
+
label: "Threads",
|
|
48
|
+
icon: "i-simple-icons-threads",
|
|
49
|
+
placeholder: "johnsmith",
|
|
50
|
+
getUrl: /* @__PURE__ */ l((e) => `https://threads.net/@${e}`, "getUrl")
|
|
51
|
+
},
|
|
52
|
+
email: {
|
|
53
|
+
label: "Email",
|
|
54
|
+
icon: "i-tabler-mail",
|
|
55
|
+
placeholder: "hello@example.com",
|
|
56
|
+
getUrl: /* @__PURE__ */ l((e) => `mailto:${e}`, "getUrl")
|
|
57
|
+
},
|
|
58
|
+
phone: {
|
|
59
|
+
label: "Phone",
|
|
60
|
+
icon: "i-tabler-phone",
|
|
61
|
+
placeholder: "+1-555-123-4567",
|
|
62
|
+
getUrl: /* @__PURE__ */ l((e) => `tel:${e.replace(/[^0-9+]/g, "")}`, "getUrl")
|
|
63
|
+
},
|
|
64
|
+
website: {
|
|
65
|
+
label: "Website",
|
|
66
|
+
icon: "i-tabler-world",
|
|
67
|
+
placeholder: "https://example.com",
|
|
68
|
+
getUrl: /* @__PURE__ */ l((e) => e, "getUrl")
|
|
69
|
+
// handle IS the URL
|
|
70
|
+
},
|
|
71
|
+
calendar: {
|
|
72
|
+
label: "Calendar",
|
|
73
|
+
icon: "i-tabler-calendar",
|
|
74
|
+
placeholder: "https://cal.com/username",
|
|
75
|
+
getUrl: /* @__PURE__ */ l((e) => e, "getUrl")
|
|
76
|
+
// handle IS the URL (e.g., Cal.com link)
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
a as S
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=socialPlatforms-Ck-b3SnQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"socialPlatforms-Ck-b3SnQ.js","sources":["../constants/socialPlatforms.ts"],"sourcesContent":["import type { SocialAccount } from '@pagelines/types'\n\n// Extract platform type from schema to ensure type safety\ntype Platform = SocialAccount['platform']\n\n// Platform metadata for URL generation and display\n// TypeScript enforces completeness - must include all platforms from schema\nexport const SOCIAL_PLATFORMS: Record<Platform, {\n label: string\n icon: string\n placeholder: string\n getUrl: (handle: string) => string\n}> = {\n linkedin: {\n label: 'LinkedIn',\n icon: 'i-simple-icons-linkedin',\n placeholder: 'john-smith',\n getUrl: (handle: string) => `https://linkedin.com/in/${handle}`,\n },\n x: {\n label: 'X',\n icon: 'i-simple-icons-x',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://x.com/${handle}`,\n },\n facebook: {\n label: 'Facebook',\n icon: 'i-simple-icons-facebook',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://facebook.com/${handle}`,\n },\n tiktok: {\n label: 'TikTok',\n icon: 'i-simple-icons-tiktok',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://tiktok.com/@${handle}`,\n },\n youtube: {\n label: 'YouTube',\n icon: 'i-tabler-brand-youtube',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://youtube.com/@${handle}`,\n },\n github: {\n label: 'GitHub',\n icon: 'i-tabler-brand-github',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://github.com/${handle}`,\n },\n instagram: {\n label: 'Instagram',\n icon: 'i-simple-icons-instagram',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://instagram.com/${handle}`,\n },\n threads: {\n label: 'Threads',\n icon: 'i-simple-icons-threads',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://threads.net/@${handle}`,\n },\n email: {\n label: 'Email',\n icon: 'i-tabler-mail',\n placeholder: 'hello@example.com',\n getUrl: (handle: string) => `mailto:${handle}`,\n },\n phone: {\n label: 'Phone',\n icon: 'i-tabler-phone',\n placeholder: '+1-555-123-4567',\n getUrl: (handle: string) => `tel:${handle.replace(/[^0-9+]/g, '')}`,\n },\n website: {\n label: 'Website',\n icon: 'i-tabler-world',\n placeholder: 'https://example.com',\n getUrl: (handle: string) => handle, // handle IS the URL\n },\n calendar: {\n label: 'Calendar',\n icon: 'i-tabler-calendar',\n placeholder: 'https://cal.com/username',\n getUrl: (handle: string) => handle, // handle IS the URL (e.g., Cal.com link)\n },\n} as const\n\nexport type SocialPlatform = keyof typeof SOCIAL_PLATFORMS\n"],"names":["SOCIAL_PLATFORMS","__name","handle"],"mappings":";;AAOO,MAAMA,IAKR;AAAA,EACH,UAAU;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAC,EAAA,CAACC,MAAmB,2BAA2BA,CAAM,IAArD;AAAA,EAAqD;AAAA,EAE/D,GAAG;AAAA,IACD,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,iBAAiBA,CAAM,IAA3C;AAAA,EAA2C;AAAA,EAErD,UAAU;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,wBAAwBA,CAAM,IAAlD;AAAA,EAAkD;AAAA,EAE5D,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,uBAAuBA,CAAM,IAAjD;AAAA,EAAiD;AAAA,EAE3D,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,wBAAwBA,CAAM,IAAlD;AAAA,EAAkD;AAAA,EAE5D,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,sBAAsBA,CAAM,IAAhD;AAAA,EAAgD;AAAA,EAE1D,WAAW;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,yBAAyBA,CAAM,IAAnD;AAAA,EAAmD;AAAA,EAE7D,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,wBAAwBA,CAAM,IAAlD;AAAA,EAAkD;AAAA,EAE5D,OAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,UAAUA,CAAM,IAApC;AAAA,EAAoC;AAAA,EAE9C,OAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmB,OAAOA,EAAO,QAAQ,YAAY,EAAE,CAAC,IAAzD;AAAA,EAAyD;AAAA,EAEnE,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmBA,GAApB;AAAA;AAAA,EAAoB;AAAA,EAE9B,UAAU;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,QAAQ,gBAAAD,EAAA,CAACC,MAAmBA,GAApB;AAAA;AAAA,EAAoB;AAEhC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
// Declare CSS modules as valid imports
|
|
4
|
+
declare module '*.css' {
|
|
5
|
+
const content: string
|
|
6
|
+
export default content
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module '*.vue' {
|
|
10
|
+
import type { DefineComponent } from 'vue'
|
|
11
|
+
const component: DefineComponent<{}, {}, any>
|
|
12
|
+
export default component
|
|
13
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Agent } from '@pagelines/types';
|
|
2
|
+
export type WidgetMode = 'inline' | 'button' | 'popup' | 'modal';
|
|
3
|
+
export type ButtonIconPreset = 'phone' | 'calendar' | 'question' | 'message' | 'sparkles';
|
|
4
|
+
export interface WidgetConfig {
|
|
5
|
+
el?: HTMLElement;
|
|
6
|
+
mode: WidgetMode;
|
|
7
|
+
handle?: string;
|
|
8
|
+
agent?: Agent;
|
|
9
|
+
context?: string;
|
|
10
|
+
firstMessage?: string;
|
|
11
|
+
buttonText?: string;
|
|
12
|
+
buttonIcon?: ButtonIconPreset;
|
|
13
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
14
|
+
apiBase?: string;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export interface WidgetUpdate {
|
|
18
|
+
agent?: Agent;
|
|
19
|
+
context?: string;
|
|
20
|
+
firstMessage?: string;
|
|
21
|
+
buttonText?: string;
|
|
22
|
+
buttonIcon?: ButtonIconPreset;
|
|
23
|
+
}
|
|
24
|
+
export declare class PLWidget {
|
|
25
|
+
private app;
|
|
26
|
+
private shadowRoot;
|
|
27
|
+
private widgetInstance;
|
|
28
|
+
private config;
|
|
29
|
+
private sdk;
|
|
30
|
+
private container;
|
|
31
|
+
private static modalInstances;
|
|
32
|
+
constructor(config: WidgetConfig);
|
|
33
|
+
private init;
|
|
34
|
+
private mountMode;
|
|
35
|
+
/**
|
|
36
|
+
* Update widget with new configuration without re-mounting
|
|
37
|
+
*/
|
|
38
|
+
update(updates: WidgetUpdate): void;
|
|
39
|
+
/**
|
|
40
|
+
* Toggle widget visibility (popup mode only)
|
|
41
|
+
*/
|
|
42
|
+
toggle(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Open widget (popup mode only)
|
|
45
|
+
*/
|
|
46
|
+
open(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Close widget (popup mode only)
|
|
49
|
+
*/
|
|
50
|
+
close(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Destroy widget and cleanup
|
|
53
|
+
*/
|
|
54
|
+
destroy(): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MaybeRef } from 'vue';
|
|
2
|
+
import { Agent } from '@pagelines/types';
|
|
3
|
+
import { WidgetConfig, WidgetUpdate, PLWidget } from '../PLWidget';
|
|
4
|
+
export interface UsePLWidgetConfig {
|
|
5
|
+
mode: WidgetConfig['mode'];
|
|
6
|
+
handle?: MaybeRef<string | undefined>;
|
|
7
|
+
agent?: MaybeRef<Agent | null | undefined>;
|
|
8
|
+
context?: MaybeRef<string | undefined>;
|
|
9
|
+
firstMessage?: MaybeRef<string | undefined>;
|
|
10
|
+
apiBase?: string;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Composable for managing PLWidget lifecycle with automatic initialization,
|
|
15
|
+
* reactive updates, and cleanup.
|
|
16
|
+
*
|
|
17
|
+
* Benefits:
|
|
18
|
+
* - Eliminates manual DOM timing coordination (watch + nextTick)
|
|
19
|
+
* - Automatic cleanup on unmount
|
|
20
|
+
* - Reactive prop updates via widget.update()
|
|
21
|
+
* - Prevents double initialization
|
|
22
|
+
* - Clear loading/error states
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```vue
|
|
26
|
+
* <script setup>
|
|
27
|
+
* const agentRef = ref<Agent | null>(null)
|
|
28
|
+
* const { containerRef, loading, error } = usePLWidget({
|
|
29
|
+
* mode: 'inline',
|
|
30
|
+
* agent: agentRef,
|
|
31
|
+
* context: 'welcome'
|
|
32
|
+
* })
|
|
33
|
+
* </script>
|
|
34
|
+
*
|
|
35
|
+
* <template>
|
|
36
|
+
* <div ref="containerRef" class="w-full h-full" />
|
|
37
|
+
* </template>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function usePLWidget(config: UsePLWidgetConfig): {
|
|
41
|
+
containerRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
42
|
+
widget: import('vue').Ref<{
|
|
43
|
+
update: (updates: WidgetUpdate) => void;
|
|
44
|
+
toggle: () => void;
|
|
45
|
+
open: () => void;
|
|
46
|
+
close: () => void;
|
|
47
|
+
destroy: () => void;
|
|
48
|
+
} | null, PLWidget | {
|
|
49
|
+
update: (updates: WidgetUpdate) => void;
|
|
50
|
+
toggle: () => void;
|
|
51
|
+
open: () => void;
|
|
52
|
+
close: () => void;
|
|
53
|
+
destroy: () => void;
|
|
54
|
+
} | null>;
|
|
55
|
+
loading: import('vue').Ref<boolean, boolean>;
|
|
56
|
+
error: import('vue').Ref<string | null, string | null>;
|
|
57
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PageLinesSDK } from '../../sdkClient';
|
|
2
|
+
import { Agent } from '@pagelines/types';
|
|
3
|
+
import { ButtonIconPreset, WidgetUpdate } from '../PLWidget';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
sdk?: PageLinesSDK;
|
|
6
|
+
handle?: string;
|
|
7
|
+
agent?: Agent;
|
|
8
|
+
context?: string;
|
|
9
|
+
firstMessage?: string;
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
buttonIcon?: ButtonIconPreset;
|
|
12
|
+
};
|
|
13
|
+
declare function update(updates: WidgetUpdate): void;
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
15
|
+
update: typeof update;
|
|
16
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PageLinesSDK } from '../../sdkClient';
|
|
2
|
+
import { Agent } from '@pagelines/types';
|
|
3
|
+
import { ButtonIconPreset, WidgetUpdate } from '../PLWidget';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
sdk?: PageLinesSDK;
|
|
6
|
+
handle?: string;
|
|
7
|
+
agent?: Agent;
|
|
8
|
+
context?: string;
|
|
9
|
+
firstMessage?: string;
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
buttonIcon?: ButtonIconPreset;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
};
|
|
14
|
+
declare function update(updates: WidgetUpdate): void;
|
|
15
|
+
declare function close(): void;
|
|
16
|
+
declare function open(): void;
|
|
17
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
18
|
+
update: typeof update;
|
|
19
|
+
close: typeof close;
|
|
20
|
+
open: typeof open;
|
|
21
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PageLinesSDK } from '../../sdkClient';
|
|
2
|
+
import { Agent } from '@pagelines/types';
|
|
3
|
+
import { ButtonIconPreset, WidgetUpdate } from '../PLWidget';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
sdk?: PageLinesSDK;
|
|
6
|
+
handle?: string;
|
|
7
|
+
agent?: Agent;
|
|
8
|
+
context?: string;
|
|
9
|
+
firstMessage?: string;
|
|
10
|
+
buttonText?: string;
|
|
11
|
+
buttonIcon?: ButtonIconPreset;
|
|
12
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
13
|
+
};
|
|
14
|
+
declare function toggle(): void;
|
|
15
|
+
declare function open(): void;
|
|
16
|
+
declare function close(): void;
|
|
17
|
+
declare function update(updates: WidgetUpdate): void;
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
19
|
+
toggle: typeof toggle;
|
|
20
|
+
open: typeof open;
|
|
21
|
+
close: typeof close;
|
|
22
|
+
update: typeof update;
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
24
|
+
export default _default;
|