@iyulab/chat-components 0.1.1 → 0.3.0
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/CHANGELOG.md +31 -1
- package/dist/components/blocks/UCodeBlock.component.d.ts +7 -8
- package/dist/components/blocks/UCodeBlock.component.js +32 -21
- package/dist/components/blocks/UCodeBlock.styles.js +7 -6
- package/dist/components/{json-viewer/UJsonViewer.component.d.ts → blocks/UJsonBlock.component.d.ts} +5 -4
- package/dist/components/{json-viewer/UJsonViewer.component.js → blocks/UJsonBlock.component.js} +20 -17
- package/dist/components/blocks/UJsonBlock.d.ts +7 -0
- package/dist/components/blocks/UJsonBlock.js +5 -0
- package/dist/components/blocks/UMarkedBlock.component.d.ts +30 -9
- package/dist/components/blocks/UMarkedBlock.component.js +75 -26
- package/dist/components/blocks/UMarkedBlock.styles.js +288 -949
- package/dist/components/blocks/URefBlock.component.d.ts +17 -0
- package/dist/components/blocks/URefBlock.component.js +74 -0
- package/dist/components/blocks/URefBlock.d.ts +7 -0
- package/dist/components/blocks/URefBlock.js +5 -0
- package/dist/components/blocks/URefBlock.styles.js +75 -0
- package/dist/components/blocks/UThinkBlock.component.d.ts +3 -8
- package/dist/components/blocks/UThinkBlock.component.js +28 -22
- package/dist/components/blocks/UThinkBlock.styles.js +35 -54
- package/dist/components/blocks/UToolBlock.component.d.ts +13 -9
- package/dist/components/blocks/UToolBlock.component.js +30 -76
- package/dist/components/blocks/UToolBlock.styles.js +21 -62
- package/dist/components/buttons/UAttachButton.component.d.ts +3 -5
- package/dist/components/buttons/UAttachButton.component.js +30 -19
- package/dist/components/buttons/UAttachButton.styles.js +5 -12
- package/dist/components/buttons/UCopyButton.component.d.ts +3 -8
- package/dist/components/buttons/UCopyButton.component.js +29 -53
- package/dist/components/buttons/UCopyButton.styles.js +8 -37
- package/dist/components/buttons/UReportButton.component.d.ts +9 -0
- package/dist/components/buttons/UReportButton.component.js +36 -0
- package/dist/components/buttons/UReportButton.d.ts +7 -0
- package/dist/components/buttons/UReportButton.js +5 -0
- package/dist/components/buttons/UReportButton.styles.js +14 -0
- package/dist/components/buttons/URetryButton.component.d.ts +11 -0
- package/dist/components/buttons/{USendButton.component.js → URetryButton.component.js} +21 -14
- package/dist/components/buttons/URetryButton.d.ts +7 -0
- package/dist/components/buttons/URetryButton.js +5 -0
- package/dist/components/buttons/URetryButton.styles.d.ts +1 -0
- package/dist/components/buttons/URetryButton.styles.js +26 -0
- package/dist/components/buttons/UShareButton.component.d.ts +9 -0
- package/dist/components/buttons/UShareButton.component.js +36 -0
- package/dist/components/buttons/UShareButton.d.ts +7 -0
- package/dist/components/buttons/UShareButton.js +5 -0
- package/dist/components/buttons/UShareButton.styles.d.ts +1 -0
- package/dist/components/buttons/UShareButton.styles.js +14 -0
- package/dist/components/buttons/UVoteButton.component.d.ts +15 -0
- package/dist/components/buttons/UVoteButton.component.js +70 -0
- package/dist/components/buttons/UVoteButton.d.ts +8 -0
- package/dist/components/buttons/UVoteButton.js +5 -0
- package/dist/components/buttons/UVoteButton.styles.d.ts +1 -0
- package/dist/components/buttons/UVoteButton.styles.js +19 -0
- package/dist/components/loaders/UDotLoader.component.d.ts +9 -0
- package/dist/components/loaders/UDotLoader.component.js +23 -0
- package/dist/components/loaders/UDotLoader.d.ts +7 -0
- package/dist/components/loaders/UDotLoader.js +5 -0
- package/dist/components/loaders/UDotLoader.styles.d.ts +1 -0
- package/dist/components/loaders/UDotLoader.styles.js +50 -0
- package/dist/components/message/UMessage.component.d.ts +12 -6
- package/dist/components/message/UMessage.component.js +45 -59
- package/dist/components/message/UMessage.d.ts +0 -1
- package/dist/components/message/UMessage.styles.js +30 -49
- package/dist/components/prompt/UPrompt.component.d.ts +25 -0
- package/dist/components/prompt/UPrompt.component.js +113 -0
- package/dist/components/prompt/UPrompt.d.ts +7 -0
- package/dist/components/prompt/UPrompt.js +5 -0
- package/dist/components/prompt/UPrompt.styles.d.ts +1 -0
- package/dist/components/prompt/UPrompt.styles.js +42 -0
- package/dist/components/references/URefCard.component.d.ts +24 -0
- package/dist/components/references/URefCard.component.js +105 -0
- package/dist/components/references/URefCard.d.ts +7 -0
- package/dist/components/references/URefCard.js +5 -0
- package/dist/components/references/URefCard.styles.d.ts +1 -0
- package/dist/components/references/URefCard.styles.js +103 -0
- package/dist/components/references/URefCardGroup.component.d.ts +25 -0
- package/dist/components/references/URefCardGroup.component.js +88 -0
- package/dist/components/references/URefCardGroup.d.ts +7 -0
- package/dist/components/references/URefCardGroup.js +5 -0
- package/dist/components/references/URefCardGroup.styles.d.ts +1 -0
- package/dist/components/references/URefCardGroup.styles.js +69 -0
- package/dist/components/references/URefTag.component.d.ts +13 -0
- package/dist/components/references/URefTag.component.js +54 -0
- package/dist/components/references/URefTag.d.ts +7 -0
- package/dist/components/references/URefTag.js +5 -0
- package/dist/components/references/URefTag.styles.d.ts +1 -0
- package/dist/components/references/URefTag.styles.js +51 -0
- package/dist/events/UCancelEvent.d.ts +6 -0
- package/dist/index.d.ts +16 -5
- package/dist/index.js +25 -9
- package/dist/types/BlockItem.d.ts +42 -0
- package/dist/types/JsonNode.d.ts +20 -0
- package/dist/types/References.d.ts +28 -0
- package/dist/utilities/converters.d.ts +9 -0
- package/dist/utilities/converters.js +19 -0
- package/package.json +10 -11
- package/dist/components/buttons/USendButton.component.d.ts +0 -13
- package/dist/components/buttons/USendButton.d.ts +0 -7
- package/dist/components/buttons/USendButton.js +0 -5
- package/dist/components/buttons/USendButton.styles.js +0 -23
- package/dist/components/buttons/UThinkButton.component.d.ts +0 -19
- package/dist/components/buttons/UThinkButton.component.js +0 -73
- package/dist/components/buttons/UThinkButton.d.ts +0 -7
- package/dist/components/buttons/UThinkButton.js +0 -5
- package/dist/components/buttons/UThinkButton.styles.js +0 -72
- package/dist/components/json-viewer/UJsonViewer.d.ts +0 -7
- package/dist/components/json-viewer/UJsonViewer.js +0 -5
- package/dist/components/json-viewer/UJsonViewer.lib.d.ts +0 -16
- package/dist/components/json-viewer/UJsonViewer.lib.js +0 -28
- package/dist/components/message/UMessage.types.d.ts +0 -21
- package/dist/events/UStopEvent.d.ts +0 -6
- package/dist/internals/date-helpers.d.ts +0 -8
- package/dist/internals/date-helpers.js +0 -27
- /package/dist/components/{buttons/USendButton.styles.d.ts → blocks/UJsonBlock.styles.d.ts} +0 -0
- /package/dist/components/{json-viewer/UJsonViewer.styles.js → blocks/UJsonBlock.styles.js} +0 -0
- /package/dist/components/{buttons/UThinkButton.styles.d.ts → blocks/URefBlock.styles.d.ts} +0 -0
- /package/dist/components/{json-viewer/UJsonViewer.styles.d.ts → buttons/UReportButton.styles.d.ts} +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const jsonConverter = {
|
|
2
|
-
fromAttribute: (value) => {
|
|
3
|
-
if (!value || !value.trim()) return {};
|
|
4
|
-
try {
|
|
5
|
-
return JSON.parse(value);
|
|
6
|
-
} catch {
|
|
7
|
-
return {};
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
toAttribute: (value) => {
|
|
11
|
-
try {
|
|
12
|
-
return JSON.stringify(value);
|
|
13
|
-
} catch {
|
|
14
|
-
return "{}";
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const isValueType = (value) => {
|
|
19
|
-
return value !== Object(value);
|
|
20
|
-
};
|
|
21
|
-
const getNodeName = (value) => {
|
|
22
|
-
if (value === null) return "null";
|
|
23
|
-
if (Array.isArray(value)) return "array";
|
|
24
|
-
if (typeof value === "object") return "object";
|
|
25
|
-
return typeof value;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { getNodeName, isValueType, jsonConverter };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface TextBlockItem {
|
|
2
|
-
type: "text";
|
|
3
|
-
value?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface MarkdownBlockItem {
|
|
6
|
-
type: "markdown";
|
|
7
|
-
value?: string;
|
|
8
|
-
}
|
|
9
|
-
export interface ThinkingBlockItem {
|
|
10
|
-
type: "thinking";
|
|
11
|
-
value?: string;
|
|
12
|
-
}
|
|
13
|
-
export type ToolBlockStatus = ("pending" | "paused" | "inProgress" | "success" | "failure");
|
|
14
|
-
export interface ToolBlockItem {
|
|
15
|
-
type: "tool";
|
|
16
|
-
status: ToolBlockStatus;
|
|
17
|
-
name?: string;
|
|
18
|
-
input?: string;
|
|
19
|
-
output?: string;
|
|
20
|
-
}
|
|
21
|
-
export type BlockItem = (TextBlockItem | MarkdownBlockItem | ThinkingBlockItem | ToolBlockItem);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const format = (value, options) => {
|
|
2
|
-
if (!value) return "";
|
|
3
|
-
const today = /* @__PURE__ */ new Date();
|
|
4
|
-
const locale = navigator.language;
|
|
5
|
-
const defaultOptions = {
|
|
6
|
-
year: "numeric",
|
|
7
|
-
month: "2-digit",
|
|
8
|
-
day: "2-digit",
|
|
9
|
-
hour: "2-digit",
|
|
10
|
-
minute: "2-digit"
|
|
11
|
-
};
|
|
12
|
-
let date = new Date(value);
|
|
13
|
-
const offset = value.endsWith("Z") ? 0 : date.getTimezoneOffset() * 60 * 1e3;
|
|
14
|
-
date = new Date(date.getTime() - offset);
|
|
15
|
-
if (date.getFullYear() === today.getFullYear() && date.getMonth() === today.getMonth() && date.getDate() === today.getDate()) {
|
|
16
|
-
const timeFormatter = new Intl.DateTimeFormat(locale, {
|
|
17
|
-
hour: "2-digit",
|
|
18
|
-
minute: "2-digit"
|
|
19
|
-
});
|
|
20
|
-
return timeFormatter.format(date);
|
|
21
|
-
} else {
|
|
22
|
-
const formatter = new Intl.DateTimeFormat(locale, { ...defaultOptions, ...options });
|
|
23
|
-
return formatter.format(date);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { format };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/components/{json-viewer/UJsonViewer.styles.d.ts → buttons/UReportButton.styles.d.ts}
RENAMED
|
File without changes
|