@smartspace/chat-ui 1.13.1-pr.250.fae775f → 1.13.1-pr.252.acadb9f
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/index.d.ts +2 -23
- package/dist/index.js +8 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1019,23 +1019,6 @@ declare function unmarkDraftThreadId(threadId: string): void;
|
|
|
1019
1019
|
declare function isDraftThreadId(threadId?: string | null): boolean;
|
|
1020
1020
|
declare function createDraftThreadId(): string;
|
|
1021
1021
|
|
|
1022
|
-
/**
|
|
1023
|
-
* Treat an API date string as UTC even when it lacks a trailing "Z".
|
|
1024
|
-
* If already a Date, returns it as-is (Date stores UTC internally).
|
|
1025
|
-
*/
|
|
1026
|
-
declare function utcDate(value: string | Date): Date;
|
|
1027
|
-
/**
|
|
1028
|
-
* Zod schema that coerces a Date, ISO string, or numeric timestamp
|
|
1029
|
-
* from the API into a Date object, ensuring timezone-less strings
|
|
1030
|
-
* are treated as UTC.
|
|
1031
|
-
*/
|
|
1032
|
-
declare const DateFromApi: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodCoercedDate<unknown>>;
|
|
1033
|
-
|
|
1034
|
-
declare function parseDateTime(date: Date | string, customFormat?: string): string;
|
|
1035
|
-
declare function parseDateTimeHuman(date: Date | string): string;
|
|
1036
|
-
|
|
1037
|
-
declare function getUserPhotoUrl(userId: string | null | undefined): string | undefined;
|
|
1038
|
-
|
|
1039
1022
|
declare const messagesKeys: {
|
|
1040
1023
|
all: readonly ["messages"];
|
|
1041
1024
|
lists: () => readonly ["messages", "list"];
|
|
@@ -1164,11 +1147,7 @@ declare const messagesListOptions: (service: ChatService, threadId: string, opts
|
|
|
1164
1147
|
[dataTagErrorSymbol]: Error;
|
|
1165
1148
|
};
|
|
1166
1149
|
};
|
|
1167
|
-
declare function useMessages(threadId: string,
|
|
1168
|
-
take?: number;
|
|
1169
|
-
skip?: number;
|
|
1170
|
-
skipWhenNewThread?: boolean;
|
|
1171
|
-
}): _tanstack_react_query.UseQueryResult<Message[], Error>;
|
|
1150
|
+
declare function useMessages(threadId: string): _tanstack_react_query.UseQueryResult<Message[], Error>;
|
|
1172
1151
|
|
|
1173
1152
|
declare const useFileMutations: (scope: FileScope) => {
|
|
1174
1153
|
uploadFilesMutation: _tanstack_react_query.UseMutationResult<FileInfo$1[], Error, File[], unknown>;
|
|
@@ -1322,4 +1301,4 @@ declare function useModels({ search, take, skip, }?: {
|
|
|
1322
1301
|
total: number;
|
|
1323
1302
|
}, Error>;
|
|
1324
1303
|
|
|
1325
|
-
export { type ChatContextIds, type ChatIdentity, ChatProvider, type ChatProviderProps, type ChatService, ChatVariablesForm, DRAFT_THREAD_PREFIX,
|
|
1304
|
+
export { type ChatContextIds, type ChatIdentity, ChatProvider, type ChatProviderProps, type ChatService, ChatVariablesForm, DRAFT_THREAD_PREFIX, type FileInfo$1 as FileInfo, type FileScope, type FlowRunVariables, MarkdownEditor, type MarkdownEditorHandle, type MentionUser, type Message, MessageComposer, type MessageComposerProps, type MessageContentItem, type MessageError, MessageList, type MessageListProps, MessageListSkeleton, MessageMarkdown, type MessageThread, type MessageValue, MessageValueType, type Model, type ModelProperty, NEW_THREAD_ID, THREAD_LIST_PAGE_SIZE, type ThreadsResponse, type Variables, type Workspace, applyDeltaToMessage, applyThreadToCache, createDraftThreadId, createThreadId, downloadFileBlobOptions, filesKeys, flowRunsKeys, getModelIcon, getThreadPlaceholderFromListCache, invalidateWorkspaceThreadLists, isDraftThreadId, mapFileInfoDtoToModel, mapMentionUserDtoToModel, mapMessageDtoToModel, mapMessageErrorDtoToModel, mapMessageValueDtoToModel, mapMessagesDtoToModels, mapSignalRThreadSummaryToModel, mapThreadDtoToModel, mapThreadsResponseDtoToModel, mapWorkspaceDtoToModel, mapWorkspacesDtoToModels, markDraftThreadId, messagesKeys, messagesListOptions, messagesMutationsKeys, modelsKeys, setThreadOptimisticRunning, setThreadRunningInLists, taggableUsersOptions, threadDetailOptions, threadsKeys, unmarkDraftThreadId, useAddInputToMessage, useChatContext, useChatIdentity, useChatService, useDownloadFileBlobQuery, useFileMutations, useFlowRunVariables, useMessages, useModels, useSendMessage, useTaggableWorkspaceUsers, useThread, useThreadIsRunning, useUpdateFlowRunVariable, useWorkspace, workspaceDetailOptions, workspaceKeys };
|
package/dist/index.js
CHANGED
|
@@ -3310,7 +3310,7 @@ function utcDate(value) {
|
|
|
3310
3310
|
}
|
|
3311
3311
|
return new Date(value);
|
|
3312
3312
|
}
|
|
3313
|
-
|
|
3313
|
+
z.preprocess((val) => {
|
|
3314
3314
|
if (typeof val === "string" && !hasTimezone(val)) {
|
|
3315
3315
|
return val + "Z";
|
|
3316
3316
|
}
|
|
@@ -4242,15 +4242,13 @@ var messagesListOptions = (service, threadId, opts) => queryOptions({
|
|
|
4242
4242
|
// Avoid re-fetching the entire thread on every small navigation.
|
|
4243
4243
|
staleTime: 3e4
|
|
4244
4244
|
});
|
|
4245
|
-
function useMessages(threadId
|
|
4245
|
+
function useMessages(threadId) {
|
|
4246
4246
|
const service = useChatService();
|
|
4247
4247
|
const isDraft = isDraftThreadId(threadId);
|
|
4248
|
-
const skipFetch = opts?.skipWhenNewThread || !threadId || isDraft;
|
|
4249
|
-
const listOpts = opts?.take != null || opts?.skip != null ? { take: opts.take, skip: opts.skip } : void 0;
|
|
4250
4248
|
return useQuery({
|
|
4251
|
-
...messagesListOptions(service, threadId
|
|
4252
|
-
enabled:
|
|
4253
|
-
initialData:
|
|
4249
|
+
...messagesListOptions(service, threadId),
|
|
4250
|
+
enabled: !!threadId && !isDraft,
|
|
4251
|
+
initialData: !threadId || isDraft ? [] : void 0
|
|
4254
4252
|
});
|
|
4255
4253
|
}
|
|
4256
4254
|
|
|
@@ -19083,20 +19081,14 @@ dayjs.extend(relativeTime);
|
|
|
19083
19081
|
dayjs.extend(advancedFormat);
|
|
19084
19082
|
function parseDateTime(date, customFormat) {
|
|
19085
19083
|
const d = dayjs.utc(date).local();
|
|
19086
|
-
|
|
19087
|
-
if (customFormat === "x") return d.valueOf().toString();
|
|
19088
|
-
return d.format(customFormat ?? "YYYY-MM-DD HH:mm:ss");
|
|
19089
|
-
}
|
|
19090
|
-
function parseDateTimeHuman(date) {
|
|
19091
|
-
return dayjs.utc(date).local().fromNow();
|
|
19084
|
+
return d.format(customFormat);
|
|
19092
19085
|
}
|
|
19093
19086
|
|
|
19094
19087
|
// src/shared/utils/userPhoto.ts
|
|
19095
19088
|
function getChatApiBaseUrl() {
|
|
19096
19089
|
try {
|
|
19097
19090
|
const w = window;
|
|
19098
|
-
const
|
|
19099
|
-
const cfg = w?.ssconfig?.Chat_Api_Uri ?? env2?.VITE_CHAT_API_URI;
|
|
19091
|
+
const cfg = w?.ssconfig?.Chat_Api_Uri ?? import.meta.env.VITE_CHAT_API_URI;
|
|
19100
19092
|
return typeof cfg === "string" && cfg.trim() ? cfg.trim() : "";
|
|
19101
19093
|
} catch {
|
|
19102
19094
|
return "";
|
|
@@ -20149,6 +20141,6 @@ function mapWorkspaceDtoToModel(dto) {
|
|
|
20149
20141
|
}
|
|
20150
20142
|
var mapWorkspacesDtoToModels = (arr) => arr.map(mapWorkspaceDtoToModel);
|
|
20151
20143
|
|
|
20152
|
-
export { ChatProvider, ChatVariablesForm, DRAFT_THREAD_PREFIX,
|
|
20144
|
+
export { ChatProvider, ChatVariablesForm, DRAFT_THREAD_PREFIX, MarkdownEditor, MessageComposer, MessageList, MessageListSkeleton, MessageMarkdown, MessageValueType, NEW_THREAD_ID, THREAD_LIST_PAGE_SIZE, applyDeltaToMessage, applyThreadToCache, createDraftThreadId, createThreadId, downloadFileBlobOptions, filesKeys, flowRunsKeys, getModelIcon, getThreadPlaceholderFromListCache, invalidateWorkspaceThreadLists, isDraftThreadId, mapFileInfoDtoToModel, mapMentionUserDtoToModel, mapMessageDtoToModel, mapMessageErrorDtoToModel, mapMessageValueDtoToModel, mapMessagesDtoToModels, mapSignalRThreadSummaryToModel, mapThreadDtoToModel, mapThreadsResponseDtoToModel, mapWorkspaceDtoToModel, mapWorkspacesDtoToModels, markDraftThreadId, messagesKeys, messagesListOptions, messagesMutationsKeys, modelsKeys, setThreadOptimisticRunning, setThreadRunningInLists, taggableUsersOptions, threadDetailOptions, threadsKeys, unmarkDraftThreadId, useAddInputToMessage, useChatContext, useChatIdentity, useChatService, useDownloadFileBlobQuery, useFileMutations, useFlowRunVariables, useMessages, useModels, useSendMessage, useTaggableWorkspaceUsers, useThread, useThreadIsRunning, useUpdateFlowRunVariable, useWorkspace, workspaceDetailOptions, workspaceKeys };
|
|
20153
20145
|
//# sourceMappingURL=index.js.map
|
|
20154
20146
|
//# sourceMappingURL=index.js.map
|