@green-on-grey/ui-kit 1.3.0 → 1.4.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/dist/chat/Attachments.d.ts +12 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat.js +263 -165
- package/dist/chat.js.map +1 -1
- package/dist/components/TopBar.d.ts +10 -2
- package/dist/index.js +24 -20
- package/dist/index.js.map +1 -1
- package/dist/locales/index.d.ts +10 -0
- package/dist/locales.js +15 -5
- package/dist/locales.js.map +1 -1
- package/dist/manifest.json +5 -1
- package/dist/styles.css +39 -4
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type IconName } from "../components/Icon";
|
|
1
2
|
import type { ChatAttachment } from "./types";
|
|
2
|
-
export type PreviewKind = "image" | "pdf" | "markdown" | "table" | "text";
|
|
3
|
+
export type PreviewKind = "image" | "pdf" | "markdown" | "table" | "html" | "text";
|
|
3
4
|
/** Loads the content of an attachment: the product fetches it with its session. */
|
|
4
5
|
export type LoadAttachment = (a: ChatAttachment) => Promise<Blob>;
|
|
5
6
|
/** Text, tables and Markdown larger than this are downloaded, not drawn. */
|
|
@@ -8,8 +9,18 @@ export declare const TEXT_PREVIEW_MAX: number;
|
|
|
8
9
|
export declare const TABLE_ROWS = 500;
|
|
9
10
|
/** How an attachment is previewed, or null when it is only downloaded. */
|
|
10
11
|
export declare function previewKind(a: Pick<ChatAttachment, "fileName" | "mimeType">): PreviewKind | null;
|
|
12
|
+
/** The icon of a kind of preview: the tiles of the chat and the products' own lists of files show it. */
|
|
13
|
+
export declare const previewIcon: (kind: PreviewKind) => IconName;
|
|
11
14
|
/** The size of a file in the units of the language. */
|
|
12
15
|
export declare function fileSize(bytes: number, language: string): string;
|
|
16
|
+
/** The document of a previewed HTML page. In a browser the page is parsed inert (a DOMParser loads nothing) and
|
|
17
|
+
* cleaned of everything that would load or lead anywhere: scripts, frames, plug-ins, links of the head, its own
|
|
18
|
+
* `http-equiv` (a refresh), and every address that is not `data:`, `blob:` or an anchor — a relative one would go to
|
|
19
|
+
* the site with the session. The policy is put first into the head, after the doctype of the file, so the page keeps
|
|
20
|
+
* its mode. The policy alone is not enough: a browser may fetch a picture before it applies a policy of a meta. */
|
|
21
|
+
export declare function htmlDocument(text: string): string;
|
|
22
|
+
/** The type a preview draws a file with: its own, else the one of its extension. */
|
|
23
|
+
export declare function previewType(a: Pick<ChatAttachment, "fileName" | "mimeType">): string | undefined;
|
|
13
24
|
/** The rows of CSV (quotes by RFC 4180) or TSV. */
|
|
14
25
|
export declare function parseTable(text: string, tab: boolean): string[][];
|
|
15
26
|
/** The files of a message: thumbnails of images and tiles; without `load` every file downloads. */
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Chat, VoiceButton } from "./Chat";
|
|
2
2
|
export { ChatLayout, ConversationList, NewTopicModal } from "./ConversationList";
|
|
3
|
-
export { AttachmentList, AttachmentPreview, fileSize, parseTable, previewKind, type LoadAttachment, type PreviewKind } from "./Attachments";
|
|
3
|
+
export { AttachmentList, AttachmentPreview, fileSize, parseTable, previewIcon, previewKind, type LoadAttachment, type PreviewKind } from "./Attachments";
|
|
4
4
|
export { AgentButton, AgentMenu, type AgentModelOption, type AgentModels, type AgentOption } from "./AgentMenu";
|
|
5
5
|
export { CommandPalette } from "./CommandPalette";
|
|
6
6
|
export { ContextMeter, tokens } from "./ContextMeter";
|