@docyrus/ui-pro-ai-assistant 0.4.6 → 0.4.7

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.
@@ -14,4 +14,5 @@ export declare function useApiClient(): {
14
14
  put: (endpoint: string, body?: unknown) => Promise<ApiResponse>;
15
15
  patch: (endpoint: string, body?: unknown) => Promise<ApiResponse>;
16
16
  delete: (endpoint: string) => Promise<ApiResponse>;
17
+ deleteWithBody: (endpoint: string, body?: unknown) => Promise<ApiResponse>;
17
18
  };
@@ -1,11 +1,12 @@
1
1
  import { type ProjectState } from '../hooks/use-project-state';
2
2
  import { type SessionState } from '../hooks/use-session-state';
3
- import { type AssistantSession, type Project, type Work } from '../types';
3
+ import { type AssistantSession, type Principal, type PrincipalType, type Project, type ShareItem, type Work } from '../types';
4
4
  type ApiClient = {
5
5
  get: (url: string, params?: any) => Promise<any>;
6
6
  post: (url: string, data?: any) => Promise<any>;
7
7
  patch: (url: string, data?: any) => Promise<any>;
8
8
  delete: (url: string) => Promise<any>;
9
+ deleteWithBody?: (url: string, body?: unknown) => Promise<any>;
9
10
  };
10
11
  type TranslationFn = (key: string) => string;
11
12
  export declare function fetchAgentThreads(apiClient: ApiClient, tenantAiAgentId: string, onSuccess: (threads: AssistantSession[]) => void, userId?: string | null, deploymentId?: string | null): Promise<void>;
@@ -54,4 +55,12 @@ export declare function createProject(apiClient: ApiClient, data: {
54
55
  description?: string;
55
56
  tenantAiAgentId: string;
56
57
  }, onSuccess: (project: any) => void, onComplete: () => void): Promise<void>;
58
+ export declare function fetchRecordShares(apiClient: ApiClient, dataSourceId: string, recordId: string): Promise<ShareItem[]>;
59
+ export declare function fetchPrincipals(apiClient: ApiClient): Promise<Principal[]>;
60
+ export declare function addRecordShares(apiClient: ApiClient, dataSourceId: string, recordId: string, items: {
61
+ principalType: PrincipalType;
62
+ principalId: string | null;
63
+ }[]): Promise<boolean>;
64
+ export declare function updateRecordSharePermission(apiClient: ApiClient, dataSourceId: string, recordId: string, share: ShareItem, permissions: number): Promise<boolean>;
65
+ export declare function removeRecordShare(apiClient: ApiClient, dataSourceId: string, recordId: string, share: ShareItem): Promise<boolean>;
57
66
  export {};
package/dist/styles.css CHANGED
@@ -82,8 +82,10 @@
82
82
  --color-indigo-950: oklch(25.7% 0.09 281.288);
83
83
  --color-violet-100: oklch(94.3% 0.029 294.588);
84
84
  --color-violet-200: oklch(89.4% 0.057 293.283);
85
+ --color-violet-300: oklch(81.1% 0.111 293.571);
85
86
  --color-violet-600: oklch(54.1% 0.281 293.009);
86
87
  --color-violet-700: oklch(49.1% 0.27 292.581);
88
+ --color-violet-900: oklch(38% 0.189 293.745);
87
89
  --color-purple-600: oklch(55.8% 0.288 302.321);
88
90
  --color-purple-700: oklch(49.6% 0.265 301.924);
89
91
  --color-rose-50: oklch(96.9% 0.015 12.422);
@@ -526,6 +528,9 @@
526
528
  .z-\[10000\] {
527
529
  z-index: 10000;
528
530
  }
531
+ .z-\[10001\] {
532
+ z-index: 10001;
533
+ }
529
534
  .order-first {
530
535
  order: -9999;
531
536
  }
@@ -1227,6 +1232,9 @@
1227
1232
  .max-h-\[300px\] {
1228
1233
  max-height: 300px;
1229
1234
  }
1235
+ .max-h-\[400px\] {
1236
+ max-height: 400px;
1237
+ }
1230
1238
  .max-h-\[500px\] {
1231
1239
  max-height: 500px;
1232
1240
  }
@@ -9868,6 +9876,14 @@
9868
9876
  }
9869
9877
  }
9870
9878
  }
9879
+ .dark\:bg-amber-900\/40 {
9880
+ @media (prefers-color-scheme: dark) {
9881
+ background-color: color-mix(in srgb, oklch(41.4% 0.112 45.904) 40%, transparent);
9882
+ @supports (color: color-mix(in lab, red, red)) {
9883
+ background-color: color-mix(in oklab, var(--color-amber-900) 40%, transparent);
9884
+ }
9885
+ }
9886
+ }
9871
9887
  .dark\:bg-background {
9872
9888
  @media (prefers-color-scheme: dark) {
9873
9889
  background-color: var(--background);
@@ -9881,6 +9897,14 @@
9881
9897
  }
9882
9898
  }
9883
9899
  }
9900
+ .dark\:bg-blue-900\/40 {
9901
+ @media (prefers-color-scheme: dark) {
9902
+ background-color: color-mix(in srgb, oklch(37.9% 0.146 265.522) 40%, transparent);
9903
+ @supports (color: color-mix(in lab, red, red)) {
9904
+ background-color: color-mix(in oklab, var(--color-blue-900) 40%, transparent);
9905
+ }
9906
+ }
9907
+ }
9884
9908
  .dark\:bg-blue-950\/30 {
9885
9909
  @media (prefers-color-scheme: dark) {
9886
9910
  background-color: color-mix(in srgb, oklch(28.2% 0.091 267.935) 30%, transparent);
@@ -9923,6 +9947,14 @@
9923
9947
  }
9924
9948
  }
9925
9949
  }
9950
+ .dark\:bg-green-900\/40 {
9951
+ @media (prefers-color-scheme: dark) {
9952
+ background-color: color-mix(in srgb, oklch(39.3% 0.095 152.535) 40%, transparent);
9953
+ @supports (color: color-mix(in lab, red, red)) {
9954
+ background-color: color-mix(in oklab, var(--color-green-900) 40%, transparent);
9955
+ }
9956
+ }
9957
+ }
9926
9958
  .dark\:bg-indigo-950 {
9927
9959
  @media (prefers-color-scheme: dark) {
9928
9960
  background-color: var(--color-indigo-950);
@@ -10018,6 +10050,14 @@
10018
10050
  background-color: transparent;
10019
10051
  }
10020
10052
  }
10053
+ .dark\:bg-violet-900\/40 {
10054
+ @media (prefers-color-scheme: dark) {
10055
+ background-color: color-mix(in srgb, oklch(38% 0.189 293.745) 40%, transparent);
10056
+ @supports (color: color-mix(in lab, red, red)) {
10057
+ background-color: color-mix(in oklab, var(--color-violet-900) 40%, transparent);
10058
+ }
10059
+ }
10060
+ }
10021
10061
  .dark\:bg-yellow-900\/30 {
10022
10062
  @media (prefers-color-scheme: dark) {
10023
10063
  background-color: color-mix(in srgb, oklch(42.1% 0.095 57.708) 30%, transparent);
@@ -10119,6 +10159,11 @@
10119
10159
  color: var(--color-slate-300);
10120
10160
  }
10121
10161
  }
10162
+ .dark\:text-violet-300 {
10163
+ @media (prefers-color-scheme: dark) {
10164
+ color: var(--color-violet-300);
10165
+ }
10166
+ }
10122
10167
  .dark\:text-yellow-400 {
10123
10168
  @media (prefers-color-scheme: dark) {
10124
10169
  color: var(--color-yellow-400);
@@ -191,6 +191,56 @@ export interface InitialFeatureFlags {
191
191
  documentSearch?: boolean;
192
192
  workCanvas?: boolean;
193
193
  }
194
+ export declare const BASE_DATA_SOURCE_ID: {
195
+ readonly thread: "f42b3daa-ca43-11ed-be9d-6fe3a1a7b37c";
196
+ readonly message: "010e9ce2-ca44-11ed-bda6-6b0c6905cf5e";
197
+ };
198
+ export type PrincipalType = 'user' | 'team' | 'role' | 'tenant' | 'public';
199
+ export interface Principal {
200
+ id: string;
201
+ name: string;
202
+ email?: string | null;
203
+ photo?: string | null;
204
+ icon?: string | null;
205
+ principalType: PrincipalType;
206
+ principalId: string;
207
+ status?: number;
208
+ }
209
+ export interface ShareItem {
210
+ id: string;
211
+ aclId?: string;
212
+ name: string;
213
+ email?: string | null;
214
+ photo?: string | null;
215
+ icon?: string | null;
216
+ principalType: PrincipalType;
217
+ principalId: string | null;
218
+ permissions: number;
219
+ expiresAt?: string | null;
220
+ }
221
+ export declare const SHARE_PERMISSIONS: {
222
+ readonly READ: 1;
223
+ readonly WRITE: 2;
224
+ readonly COMMENT: 4;
225
+ readonly SHARE: 8;
226
+ readonly DELETE: 16;
227
+ };
228
+ export declare const SHARE_PERMISSION_LEVELS: readonly [{
229
+ readonly value: 1;
230
+ readonly label: "Can view";
231
+ }, {
232
+ readonly value: 3;
233
+ readonly label: "Can edit";
234
+ }, {
235
+ readonly value: 7;
236
+ readonly label: "Can comment";
237
+ }, {
238
+ readonly value: 11;
239
+ readonly label: "Can share";
240
+ }, {
241
+ readonly value: 31;
242
+ readonly label: "Full access";
243
+ }];
194
244
  export interface DocyAssistantProps {
195
245
  isOpen?: boolean;
196
246
  onClose?: () => void;
@@ -240,6 +290,16 @@ export interface DocyAssistantProps {
240
290
  baseAgentSelectorUrl?: string;
241
291
  /** Called after agent selection is persisted internally, for external notification only */
242
292
  onAgentChange?: (agentId: string, agentType: 'base' | 'deployment') => void;
293
+ /** Show the share button on threads. Defaults to `false`. */
294
+ enableSharing?: boolean;
295
+ /**
296
+ * Callback when user taps the share button on a thread.
297
+ * When provided, the host handles sharing UI. When omitted, the built-in sharing editor is used.
298
+ */
299
+ onShare?: (payload: {
300
+ dataSourceId: string;
301
+ recordId: string;
302
+ }) => void;
243
303
  /** Initial prompt to auto-send when the assistant opens */
244
304
  initialPrompt?: string;
245
305
  /** Initial model ID to use when auto-sending the initial prompt */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docyrus/ui-pro-ai-assistant",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Docyrus AI Assistant component — full-featured chat UI with canvas, projects, and i18n support.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",