@lilaquadrat/chat 0.1.5 → 0.1.8

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.
@@ -1 +0,0 @@
1
-
@@ -1 +1 @@
1
- !function(n){"function"==typeof define&&define.amd?define(n):n()}(function(){});
1
+ !function(n){"function"==typeof define&&define.amd&&define([],n)}(function(){});
@@ -1,12 +1,18 @@
1
1
  import { type Ref } from 'vue';
2
2
  /**
3
3
  * tracks whether the chat is actually visible to the user:
4
- * - the element must intersect the viewport (catches display:none / collapsed hosts)
4
+ * - the element must intersect the viewport (catches display:none, collapsed hosts, and a
5
+ * host that parks the widget off screen — the supported way to hide an embedded instance)
5
6
  * - the tab must be in the foreground
6
7
  * - in compact mode no left panel may overlay the chat (occlusion is not detectable
7
8
  * cross-browser, so our own overlay state is checked explicitly)
9
+ *
10
+ * Purely visual hiding — `opacity: 0` — is deliberately NOT detected: no observer reports it
11
+ * and probing for it means walking every ancestor's computed style on each check. Hosts hide
12
+ * the widget by moving it out of the viewport (or `display: none`) instead.
8
13
  */
9
14
  export declare function useChatVisibility(element: Ref<HTMLElement | undefined>): {
10
15
  chatVisible: import("vue").ComputedRef<boolean>;
16
+ isVisibleNow: () => boolean;
11
17
  };
12
18
  export default useChatVisibility;
@@ -44,6 +44,14 @@ export interface ChatModuleConfig {
44
44
  }) => void;
45
45
  /** called when the close button in the header is clicked */
46
46
  close?: () => void;
47
+ /**
48
+ * notification sounds. On at full volume by default; `false` silences them.
49
+ * A sound is only played for remote events the user cannot currently see.
50
+ */
51
+ sound?: boolean | {
52
+ enabled?: boolean;
53
+ volume?: number;
54
+ };
47
55
  /** the host's auth token (Auth0 JWT). Identity is derived from its `sub`; sent as Bearer + WS auth. */
48
56
  token?: string;
49
57
  /**
@@ -11,11 +11,15 @@ export interface ParticipantUser {
11
11
  email?: string;
12
12
  /** host-provided contact name (see @/config/users ChatUser) */
13
13
  name?: string;
14
+ /** presence: last proof of life as an ISO string; absent for a user who never connected */
15
+ lastSeen?: string;
16
+ /** presence: derived server-side from lastSeen freshness, pushed live via user:presence */
17
+ online?: boolean;
14
18
  }
15
19
  export type Participant = string | ParticipantUser;
16
20
  /** the user id of a participant, whether it's a bare id or an object */
17
21
  export declare function participantId(participant: Participant): string;
18
22
  /** map a participant list to its ids (e.g. before sending to the backend) */
19
23
  export declare function participantIds(participants?: Participant[]): string[];
20
- /** human-readable name: prename+lastname, else host name, else the raw id */
24
+ /** human-readable name: "lastname, prename", else host name, else the raw id */
21
25
  export declare function participantName(participant: Participant): string;
@@ -0,0 +1,19 @@
1
+ export interface ConversationRightsSource {
2
+ isNew?: boolean;
3
+ participant?: {
4
+ state?: string;
5
+ rights?: string[];
6
+ };
7
+ }
8
+ type Conversation = ConversationRightsSource | null | undefined;
9
+ /**
10
+ * still a member? drafts count, every non-active backend state does not — the server
11
+ * knows 'active' | 'left' | 'removed' | 'blocked' | 'deleted' and keeps only 'active'
12
+ * participants in `conversation.participants` (see participants.service).
13
+ * A missing state means the payload does not track it — treated as a member, the
14
+ * rights check below still applies.
15
+ */
16
+ export declare function isActiveParticipant(conversation: Conversation): boolean;
17
+ /** membership plus the named right ('read' | 'write' | 'rename' | 'participants' | 'block') */
18
+ export declare function can(conversation: Conversation, right: string): boolean;
19
+ export default can;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Options for a StudioSDK instance: a currently-valid token plus the configured endpoints.
3
+ *
4
+ * The token is re-resolved through the host's `getToken` on every call rather than read once at
5
+ * boot. The WS session already re-authenticates with a fresh token on every (re)connect (see
6
+ * libs/chatSession.ts); without this, HTTP kept sending the boot-time token and started to 401
7
+ * once it expired — harmless in a host app that reloads often, fatal for a standalone tab left
8
+ * open. Hosts that pass only a static `token` are unaffected: resolveToken() returns undefined
9
+ * and the stored token is used.
10
+ */
11
+ export default function sdkOptions(): Promise<{
12
+ authToken: string;
13
+ customEndpoints: {
14
+ api: string;
15
+ media: string;
16
+ };
17
+ }>;
@@ -0,0 +1,8 @@
1
+ export type SoundName = 'new-message' | 'new-conversation';
2
+ /**
3
+ * Play a notification sound. Never throws and never rejects: browsers refuse audio until
4
+ * the page has seen a user gesture, and a machine without an output device rejects too —
5
+ * neither is worth surfacing for something purely decorative.
6
+ */
7
+ export declare function playSound(name: SoundName, volume?: number): void;
8
+ export default playSound;
@@ -78,6 +78,11 @@ export default class StudioSDK {
78
78
  static handleCall<T, D = any>(call: AxiosRequestConfig<D>, options?: SDKCallOptions): Promise<SDKResponse<T>>;
79
79
  static cache<T>(url: string, response?: AxiosResponse<T>, options?: SDKCallOptions): SDKResponse<any> & SDKCache;
80
80
  static flushCache(group?: string, action?: string): void;
81
+ /**
82
+ * one id can hold several entries (one per query string, e.g. every `beforeId` page of a
83
+ * conversation), so flushing has to drop all of them — otherwise a new message would only
84
+ * invalidate the page whose url happened to match.
85
+ */
81
86
  static flushId(id: string): void;
82
87
  conversations: {
83
88
  list: () => Promise<SDKResponse<any>>;
@@ -88,6 +93,11 @@ export default class StudioSDK {
88
93
  rename: (conversationId: string, name: string) => Promise<SDKResponse<any>>;
89
94
  participants: (conversationId: string, add: string[], remove: string[]) => Promise<SDKResponse<any>>;
90
95
  leave: (conversationId: string) => Promise<SDKResponse<any>>;
96
+ /**
97
+ * POST, not DELETE: this removes the conversation for the CALLER only (their participant
98
+ * state goes to 'deleted' server-side), it does not delete the resource for everyone.
99
+ */
100
+ delete: (conversationId: string) => Promise<SDKResponse<any>>;
91
101
  listParticipants: (conversationId: string) => Promise<SDKResponse<any>>;
92
102
  rights: (conversationId: string, user: string, rights: string[]) => Promise<SDKResponse<any>>;
93
103
  block: (conversationId: string, user: string, block: boolean) => Promise<SDKResponse<any>>;
@@ -3,38 +3,72 @@ declare const _default: {
3
3
  connected: string;
4
4
  disconnected: string;
5
5
  };
6
- actions: {
7
- retry: string;
8
- };
6
+ retry: string;
9
7
  'new chat': string;
10
8
  conversations: string;
11
9
  'contact support': string;
12
10
  support: string;
13
11
  options: string;
12
+ actions: string;
14
13
  mute: string;
15
14
  delete: string;
16
15
  leave: string;
17
16
  'leave now': string;
17
+ 'delete now': string;
18
18
  'select contacts': string;
19
19
  'conversation options': string;
20
20
  'save edits': string;
21
21
  'cancel edits': string;
22
- 'participant rights': string;
22
+ abandon: string;
23
+ close: string;
24
+ rights: string;
25
+ members: string;
26
+ 'update members': string;
23
27
  read: string;
24
28
  write: string;
25
29
  rename: string;
30
+ save: string;
31
+ 'conversation name': string;
32
+ 'you left this conversation': string;
26
33
  participants: string;
27
- members: string;
34
+ 'filter members': string;
35
+ 'filter contacts': string;
36
+ 'member count': string;
37
+ 'created at': string;
38
+ 'last activity': string;
39
+ messages: string;
40
+ accept: string;
41
+ decline: string;
42
+ 'confirm action': string;
28
43
  block: string;
29
44
  unblock: string;
45
+ dismiss: string;
46
+ errors: {
47
+ unknown: string;
48
+ RATE_LIMIT_EXCEEDED: string;
49
+ NOT_ALLOWED: string;
50
+ ACTION_NOT_ALLOWED: string;
51
+ NOT_A_CONTACT: string;
52
+ CONVERSATION_NOT_FOUND: string;
53
+ CONVERSATION_ALREADY_EXISTS: string;
54
+ MIN_PARTICIPANTS: string;
55
+ CONTACT_NOT_FOUND: string;
56
+ CANNOT_BLOCK_SELF: string;
57
+ UNKNOWN_MESSAGE_TYPE: string;
58
+ INVALID_LAST_READ_ID: string;
59
+ INTERNAL_ERROR: string;
60
+ };
30
61
  system: {
31
62
  renamed: string;
32
63
  created: string;
33
64
  left: string;
65
+ blocked: string;
66
+ unblocked: string;
34
67
  participants: {
35
68
  addedAndRemoved: string;
36
69
  added: string;
37
70
  removed: string;
71
+ updated: string;
38
72
  };
39
73
  };
40
74
  };
@@ -3,38 +3,72 @@ declare const _default: {
3
3
  connected: string;
4
4
  disconnected: string;
5
5
  };
6
- actions: {
7
- retry: string;
8
- };
6
+ retry: string;
9
7
  'new chat': string;
10
8
  conversations: string;
11
9
  'contact support': string;
12
10
  support: string;
13
11
  options: string;
12
+ actions: string;
14
13
  mute: string;
15
14
  delete: string;
16
15
  leave: string;
17
16
  'leave now': string;
17
+ 'delete now': string;
18
18
  'select contacts': string;
19
19
  'conversation options': string;
20
20
  'save edits': string;
21
21
  'cancel edits': string;
22
- 'participant rights': string;
22
+ abandon: string;
23
+ close: string;
24
+ rights: string;
25
+ members: string;
26
+ 'update members': string;
23
27
  read: string;
24
28
  write: string;
25
29
  rename: string;
30
+ save: string;
31
+ 'conversation name': string;
32
+ 'you left this conversation': string;
26
33
  participants: string;
27
- members: string;
34
+ 'filter members': string;
35
+ 'filter contacts': string;
36
+ 'member count': string;
37
+ 'created at': string;
38
+ 'last activity': string;
39
+ messages: string;
40
+ accept: string;
41
+ decline: string;
42
+ 'confirm action': string;
28
43
  block: string;
29
44
  unblock: string;
45
+ dismiss: string;
46
+ errors: {
47
+ unknown: string;
48
+ RATE_LIMIT_EXCEEDED: string;
49
+ NOT_ALLOWED: string;
50
+ ACTION_NOT_ALLOWED: string;
51
+ NOT_A_CONTACT: string;
52
+ CONVERSATION_NOT_FOUND: string;
53
+ CONVERSATION_ALREADY_EXISTS: string;
54
+ MIN_PARTICIPANTS: string;
55
+ CONTACT_NOT_FOUND: string;
56
+ CANNOT_BLOCK_SELF: string;
57
+ UNKNOWN_MESSAGE_TYPE: string;
58
+ INVALID_LAST_READ_ID: string;
59
+ INTERNAL_ERROR: string;
60
+ };
30
61
  system: {
31
62
  renamed: string;
32
63
  created: string;
33
64
  left: string;
65
+ blocked: string;
66
+ unblocked: string;
34
67
  participants: {
35
68
  addedAndRemoved: string;
36
69
  added: string;
37
70
  removed: string;
71
+ updated: string;
38
72
  };
39
73
  };
40
74
  };
@@ -7,38 +7,72 @@ declare const i18n: import("vue-i18n").I18n<{
7
7
  connected: string;
8
8
  disconnected: string;
9
9
  };
10
- actions: {
11
- retry: string;
12
- };
10
+ retry: string;
13
11
  'new chat': string;
14
12
  conversations: string;
15
13
  'contact support': string;
16
14
  support: string;
17
15
  options: string;
16
+ actions: string;
18
17
  mute: string;
19
18
  delete: string;
20
19
  leave: string;
21
20
  'leave now': string;
21
+ 'delete now': string;
22
22
  'select contacts': string;
23
23
  'conversation options': string;
24
24
  'save edits': string;
25
25
  'cancel edits': string;
26
- 'participant rights': string;
26
+ abandon: string;
27
+ close: string;
28
+ rights: string;
29
+ members: string;
30
+ 'update members': string;
27
31
  read: string;
28
32
  write: string;
29
33
  rename: string;
34
+ save: string;
35
+ 'conversation name': string;
36
+ 'you left this conversation': string;
30
37
  participants: string;
31
- members: string;
38
+ 'filter members': string;
39
+ 'filter contacts': string;
40
+ 'member count': string;
41
+ 'created at': string;
42
+ 'last activity': string;
43
+ messages: string;
44
+ accept: string;
45
+ decline: string;
46
+ 'confirm action': string;
32
47
  block: string;
33
48
  unblock: string;
49
+ dismiss: string;
50
+ errors: {
51
+ unknown: string;
52
+ RATE_LIMIT_EXCEEDED: string;
53
+ NOT_ALLOWED: string;
54
+ ACTION_NOT_ALLOWED: string;
55
+ NOT_A_CONTACT: string;
56
+ CONVERSATION_NOT_FOUND: string;
57
+ CONVERSATION_ALREADY_EXISTS: string;
58
+ MIN_PARTICIPANTS: string;
59
+ CONTACT_NOT_FOUND: string;
60
+ CANNOT_BLOCK_SELF: string;
61
+ UNKNOWN_MESSAGE_TYPE: string;
62
+ INVALID_LAST_READ_ID: string;
63
+ INTERNAL_ERROR: string;
64
+ };
34
65
  system: {
35
66
  renamed: string;
36
67
  created: string;
37
68
  left: string;
69
+ blocked: string;
70
+ unblocked: string;
38
71
  participants: {
39
72
  addedAndRemoved: string;
40
73
  added: string;
41
74
  removed: string;
75
+ updated: string;
42
76
  };
43
77
  };
44
78
  };
@@ -0,0 +1,39 @@
1
+ import type { ParticipantUser } from '@/helpers/participants';
2
+ import type { StandaloneSettings } from './settings';
3
+ export declare class StandaloneAuth {
4
+ private client?;
5
+ private dev;
6
+ private devToken?;
7
+ private profile?;
8
+ private get origin();
9
+ /** the Auth0 client, guaranteed to exist. Every caller runs after a non-dev init(). */
10
+ private get auth0();
11
+ /**
12
+ * Bring the page into an authenticated state.
13
+ *
14
+ * Handles the redirect callback, then either resolves (authenticated) or navigates away to
15
+ * Auth0 (not authenticated). Resolves `false` when the browser is being redirected, so the
16
+ * caller knows not to mount anything.
17
+ */
18
+ init(settings: StandaloneSettings): Promise<boolean>;
19
+ /**
20
+ * Complete the Auth0 redirect: exchange the code, then rewrite the URL back to wherever the
21
+ * user came from. A single pathname check replaces a router — the shell has no other routes.
22
+ */
23
+ private handleCallback;
24
+ /**
25
+ * A currently-valid access token. Handed to the chat as `getToken`, so every WS (re)auth and
26
+ * every HTTP call resolves a fresh one; auth0-spa-js owns the cache and the refresh.
27
+ */
28
+ getToken(): Promise<string>;
29
+ /**
30
+ * The current user's own profile. The backend enriches other participants but not the
31
+ * requesting user, so the chat needs this to render our own name. Taken from the id-token
32
+ * claims — no /me endpoint required.
33
+ */
34
+ getProfile(): ParticipantUser | undefined;
35
+ private loadProfile;
36
+ logout(): void;
37
+ }
38
+ declare const _default: StandaloneAuth;
39
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ import type { Feature } from '@/stores/main.store';
2
+ /** Auth0 SPA client settings. Mirrors the `auth0` key of studio-app's settings.json. */
3
+ export interface StandaloneAuth0Settings {
4
+ domain: string;
5
+ clientId: string;
6
+ audience?: string;
7
+ }
8
+ /**
9
+ * Runtime configuration of a standalone deployment, served as a plain file next to the
10
+ * bundle (`/settings/settings.json`) rather than baked in at build time — one artifact,
11
+ * configured per domain. Same file path and shape as studio-app so ops handling is identical.
12
+ */
13
+ export interface StandaloneSettings {
14
+ /** dev bypass: skip Auth0 entirely and use `devToken`. Mirrors studio-app's `settings.dev`. */
15
+ dev?: boolean;
16
+ /** the token handed to the chat when `dev` is set. Pair with the backend's ENV=dev / DEV_USER. */
17
+ devToken?: string;
18
+ /** Auth0 client. Omitted → the built-in lilaquadrat defaults are used. */
19
+ auth0?: StandaloneAuth0Settings;
20
+ /** passed straight into the chat element's config */
21
+ chat: {
22
+ features?: Feature[];
23
+ wsUrl?: string;
24
+ apiUrl?: string;
25
+ mediaUrl?: string;
26
+ support?: {
27
+ participants: string[];
28
+ };
29
+ sound?: boolean | {
30
+ enabled?: boolean;
31
+ volume?: number;
32
+ };
33
+ };
34
+ /** document title of the deployment */
35
+ title?: string;
36
+ }
37
+ export declare const SETTINGS_URL = "/settings/settings.json";
38
+ /**
39
+ * Load the deployment settings. Always uncached — the file is edited in place on the
40
+ * server and a stale copy would point the app at the wrong backend or Auth0 client.
41
+ */
42
+ export default function loadSettings(): Promise<StandaloneSettings>;
@@ -48,7 +48,11 @@ export declare const useConversationsStore: import("pinia").StoreDefinition<"con
48
48
  executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
49
49
  updateConversationParticipant: (conversation: string, state: string) => void;
50
50
  leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
51
- }, "conversations" | "typing" | "activeConversation">, Pick<{
51
+ deleteConversation: (conversation: string) => Promise<void>;
52
+ lastActiveConversation: import("vue").Ref<any, any>;
53
+ activateLastConversation: () => void;
54
+ readLastActiveConversation: () => void;
55
+ }, "conversations" | "typing" | "activeConversation" | "lastActiveConversation">, Pick<{
52
56
  getAllConversations: () => Promise<void>;
53
57
  refreshConversations: () => Promise<void>;
54
58
  handleReconnect: () => Promise<void>;
@@ -94,6 +98,10 @@ export declare const useConversationsStore: import("pinia").StoreDefinition<"con
94
98
  executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
95
99
  updateConversationParticipant: (conversation: string, state: string) => void;
96
100
  leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
101
+ deleteConversation: (conversation: string) => Promise<void>;
102
+ lastActiveConversation: import("vue").Ref<any, any>;
103
+ activateLastConversation: () => void;
104
+ readLastActiveConversation: () => void;
97
105
  }, "unreadConversations" | "totalUnreadCount" | "totalUnreadConversations">, Pick<{
98
106
  getAllConversations: () => Promise<void>;
99
107
  refreshConversations: () => Promise<void>;
@@ -140,5 +148,9 @@ export declare const useConversationsStore: import("pinia").StoreDefinition<"con
140
148
  executeParticipantsEdit: (conversation: string, add: string[], remove: string[]) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
141
149
  updateConversationParticipant: (conversation: string, state: string) => void;
142
150
  leave: (conversation: string) => Promise<import("@/libs/StudioSDK").SDKResponse<any>>;
143
- }, "leave" | "rename" | "getAllConversations" | "refreshConversations" | "handleReconnect" | "setTyping" | "loadParticipants" | "setRights" | "blockUser" | "updateParticipantRights" | "create" | "createNew" | "startSupport" | "activateConversation" | "convertTempToConversation" | "getMessagesFromApi" | "addMessagesToConversation" | "getMessagesForConversation" | "updateLastMessage" | "updateUnread" | "updateAllUnread" | "increaseMessageCount" | "increaseMessageCountSystem" | "setLastReadId" | "getConversation" | "addParticipant" | "removeParticipant" | "setParticipants" | "toggleParticipant" | "getConversationViaParticipantsAndName" | "cleanConversations" | "abandonConversation" | "inactivateConversation" | "conversationRenamed" | "executeParticipantsEdit" | "updateConversationParticipant">>;
151
+ deleteConversation: (conversation: string) => Promise<void>;
152
+ lastActiveConversation: import("vue").Ref<any, any>;
153
+ activateLastConversation: () => void;
154
+ readLastActiveConversation: () => void;
155
+ }, "leave" | "rename" | "getAllConversations" | "refreshConversations" | "handleReconnect" | "setTyping" | "loadParticipants" | "setRights" | "blockUser" | "updateParticipantRights" | "create" | "createNew" | "startSupport" | "activateConversation" | "convertTempToConversation" | "getMessagesFromApi" | "addMessagesToConversation" | "getMessagesForConversation" | "updateLastMessage" | "updateUnread" | "updateAllUnread" | "increaseMessageCount" | "increaseMessageCountSystem" | "setLastReadId" | "getConversation" | "addParticipant" | "removeParticipant" | "setParticipants" | "toggleParticipant" | "getConversationViaParticipantsAndName" | "cleanConversations" | "abandonConversation" | "inactivateConversation" | "conversationRenamed" | "executeParticipantsEdit" | "updateConversationParticipant" | "deleteConversation" | "activateLastConversation" | "readLastActiveConversation">>;
144
156
  export default useConversationsStore;
@@ -1,17 +1,18 @@
1
1
  export type Feature = 'chat' | 'support';
2
- export type LeftTarget = 'conversations' | 'contacts-new' | 'contacts-edit';
2
+ export type LeftTarget = 'conversations' | 'contacts-new' | 'contacts-edit' | 'contacts-rights' | 'rename';
3
3
  export type MainTarget = 'chat';
4
4
  export declare const useMainStore: import("pinia").StoreDefinition<"main", Pick<{
5
- leftTarget: import("vue").Ref<LeftTarget, LeftTarget>;
6
- mainTarget: import("vue").Ref<"chat", "chat">;
7
5
  state: import("vue").Ref<"connected" | "disconnected", "connected" | "disconnected">;
8
6
  fullscreen: import("vue").Ref<boolean, boolean>;
9
7
  features: import("vue").Ref<Feature[], Feature[]>;
10
8
  hasChat: import("vue").ComputedRef<boolean>;
11
9
  hasSupport: import("vue").ComputedRef<boolean>;
12
10
  isSupportOnly: import("vue").ComputedRef<boolean>;
13
- viewMode: import("vue").Ref<"full" | "compact", "full" | "compact">;
14
- setViewMode: (newViewMode: "compact" | "full") => void;
11
+ viewMode: import("vue").Ref<"mobile" | "tablet" | "desktop", "mobile" | "tablet" | "desktop">;
12
+ setViewMode: (newViewMode: "mobile" | "tablet" | "desktop") => void;
13
+ chatVisible: import("vue").Ref<boolean, boolean>;
14
+ soundEnabled: import("vue").Ref<boolean, boolean>;
15
+ soundVolume: import("vue").Ref<number, number>;
15
16
  supportParticipants: import("vue").Ref<string[], string[]>;
16
17
  wsUrl: import("vue").Ref<string, string>;
17
18
  apiUrl: import("vue").Ref<string, string>;
@@ -25,21 +26,42 @@ export declare const useMainStore: import("pinia").StoreDefinition<"main", Pick<
25
26
  unreadConversations: number;
26
27
  }) => void>;
27
28
  closeCallback: import("vue").Ref<() => void, () => void>;
28
- showConversations: () => void;
29
- showNewChat: () => void;
30
- showEditChat: () => void;
31
- hideLeft: () => void;
32
- }, "state" | "leftTarget" | "mainTarget" | "fullscreen" | "features" | "viewMode" | "supportParticipants" | "wsUrl" | "apiUrl" | "mediaUrl" | "authToken" | "unreadCallback" | "closeCallback">, Pick<{
33
- leftTarget: import("vue").Ref<LeftTarget, LeftTarget>;
34
- mainTarget: import("vue").Ref<"chat", "chat">;
29
+ setContent: (type: string, target: "left" | "main" | "right") => void;
30
+ unsetContent: (target: "left" | "main" | "right") => void;
31
+ content: import("vue").Ref<{
32
+ left: string | undefined;
33
+ main: string | undefined;
34
+ right: string | undefined;
35
+ }, {
36
+ left: string | undefined;
37
+ main: string | undefined;
38
+ right: string | undefined;
39
+ } | {
40
+ left: string | undefined;
41
+ main: string | undefined;
42
+ right: string | undefined;
43
+ }>;
44
+ lastError: import("vue").Ref<{
45
+ error: string;
46
+ messageType?: string;
47
+ }, {
48
+ error: string;
49
+ messageType?: string;
50
+ }>;
51
+ setError: (error: string, messageType?: string) => void;
52
+ clearError: () => void;
53
+ }, "state" | "fullscreen" | "features" | "viewMode" | "chatVisible" | "soundEnabled" | "soundVolume" | "supportParticipants" | "wsUrl" | "apiUrl" | "mediaUrl" | "authToken" | "unreadCallback" | "closeCallback" | "content" | "lastError">, Pick<{
35
54
  state: import("vue").Ref<"connected" | "disconnected", "connected" | "disconnected">;
36
55
  fullscreen: import("vue").Ref<boolean, boolean>;
37
56
  features: import("vue").Ref<Feature[], Feature[]>;
38
57
  hasChat: import("vue").ComputedRef<boolean>;
39
58
  hasSupport: import("vue").ComputedRef<boolean>;
40
59
  isSupportOnly: import("vue").ComputedRef<boolean>;
41
- viewMode: import("vue").Ref<"full" | "compact", "full" | "compact">;
42
- setViewMode: (newViewMode: "compact" | "full") => void;
60
+ viewMode: import("vue").Ref<"mobile" | "tablet" | "desktop", "mobile" | "tablet" | "desktop">;
61
+ setViewMode: (newViewMode: "mobile" | "tablet" | "desktop") => void;
62
+ chatVisible: import("vue").Ref<boolean, boolean>;
63
+ soundEnabled: import("vue").Ref<boolean, boolean>;
64
+ soundVolume: import("vue").Ref<number, number>;
43
65
  supportParticipants: import("vue").Ref<string[], string[]>;
44
66
  wsUrl: import("vue").Ref<string, string>;
45
67
  apiUrl: import("vue").Ref<string, string>;
@@ -53,21 +75,42 @@ export declare const useMainStore: import("pinia").StoreDefinition<"main", Pick<
53
75
  unreadConversations: number;
54
76
  }) => void>;
55
77
  closeCallback: import("vue").Ref<() => void, () => void>;
56
- showConversations: () => void;
57
- showNewChat: () => void;
58
- showEditChat: () => void;
59
- hideLeft: () => void;
78
+ setContent: (type: string, target: "left" | "main" | "right") => void;
79
+ unsetContent: (target: "left" | "main" | "right") => void;
80
+ content: import("vue").Ref<{
81
+ left: string | undefined;
82
+ main: string | undefined;
83
+ right: string | undefined;
84
+ }, {
85
+ left: string | undefined;
86
+ main: string | undefined;
87
+ right: string | undefined;
88
+ } | {
89
+ left: string | undefined;
90
+ main: string | undefined;
91
+ right: string | undefined;
92
+ }>;
93
+ lastError: import("vue").Ref<{
94
+ error: string;
95
+ messageType?: string;
96
+ }, {
97
+ error: string;
98
+ messageType?: string;
99
+ }>;
100
+ setError: (error: string, messageType?: string) => void;
101
+ clearError: () => void;
60
102
  }, "hasChat" | "hasSupport" | "isSupportOnly">, Pick<{
61
- leftTarget: import("vue").Ref<LeftTarget, LeftTarget>;
62
- mainTarget: import("vue").Ref<"chat", "chat">;
63
103
  state: import("vue").Ref<"connected" | "disconnected", "connected" | "disconnected">;
64
104
  fullscreen: import("vue").Ref<boolean, boolean>;
65
105
  features: import("vue").Ref<Feature[], Feature[]>;
66
106
  hasChat: import("vue").ComputedRef<boolean>;
67
107
  hasSupport: import("vue").ComputedRef<boolean>;
68
108
  isSupportOnly: import("vue").ComputedRef<boolean>;
69
- viewMode: import("vue").Ref<"full" | "compact", "full" | "compact">;
70
- setViewMode: (newViewMode: "compact" | "full") => void;
109
+ viewMode: import("vue").Ref<"mobile" | "tablet" | "desktop", "mobile" | "tablet" | "desktop">;
110
+ setViewMode: (newViewMode: "mobile" | "tablet" | "desktop") => void;
111
+ chatVisible: import("vue").Ref<boolean, boolean>;
112
+ soundEnabled: import("vue").Ref<boolean, boolean>;
113
+ soundVolume: import("vue").Ref<number, number>;
71
114
  supportParticipants: import("vue").Ref<string[], string[]>;
72
115
  wsUrl: import("vue").Ref<string, string>;
73
116
  apiUrl: import("vue").Ref<string, string>;
@@ -81,9 +124,29 @@ export declare const useMainStore: import("pinia").StoreDefinition<"main", Pick<
81
124
  unreadConversations: number;
82
125
  }) => void>;
83
126
  closeCallback: import("vue").Ref<() => void, () => void>;
84
- showConversations: () => void;
85
- showNewChat: () => void;
86
- showEditChat: () => void;
87
- hideLeft: () => void;
88
- }, "setViewMode" | "showConversations" | "showNewChat" | "showEditChat" | "hideLeft">>;
127
+ setContent: (type: string, target: "left" | "main" | "right") => void;
128
+ unsetContent: (target: "left" | "main" | "right") => void;
129
+ content: import("vue").Ref<{
130
+ left: string | undefined;
131
+ main: string | undefined;
132
+ right: string | undefined;
133
+ }, {
134
+ left: string | undefined;
135
+ main: string | undefined;
136
+ right: string | undefined;
137
+ } | {
138
+ left: string | undefined;
139
+ main: string | undefined;
140
+ right: string | undefined;
141
+ }>;
142
+ lastError: import("vue").Ref<{
143
+ error: string;
144
+ messageType?: string;
145
+ }, {
146
+ error: string;
147
+ messageType?: string;
148
+ }>;
149
+ setError: (error: string, messageType?: string) => void;
150
+ clearError: () => void;
151
+ }, "setViewMode" | "setContent" | "unsetContent" | "setError" | "clearError">>;
89
152
  export default useMainStore;