@mieweb/ui 0.10.0-dev.11 → 0.10.0-dev.13
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/Input-yN516s5_.d.cts +3 -0
- package/dist/Input-yN516s5_.d.ts +3 -0
- package/dist/ag-grid.d.cts +142 -1
- package/dist/ag-grid.d.ts +142 -1
- package/dist/{chunk-3M7TAXNR.js → chunk-3YFJBUX4.js} +3 -3
- package/dist/{chunk-3M7TAXNR.js.map → chunk-3YFJBUX4.js.map} +1 -1
- package/dist/{chunk-ACCAXVOG.js → chunk-4CXGT3P7.js} +61 -41
- package/dist/chunk-4CXGT3P7.js.map +1 -0
- package/dist/{chunk-OD47TTAW.cjs → chunk-V43ZFGCE.cjs} +9 -9
- package/dist/{chunk-OD47TTAW.cjs.map → chunk-V43ZFGCE.cjs.map} +1 -1
- package/dist/{chunk-X4XPNTCZ.cjs → chunk-YQ2NQV5C.cjs} +61 -41
- package/dist/chunk-YQ2NQV5C.cjs.map +1 -0
- package/dist/components/Alert/index.d.cts +1 -1
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/AlertDialog/index.d.cts +28 -3
- package/dist/components/AlertDialog/index.d.ts +28 -3
- package/dist/components/AudioRecorder/index.d.cts +2 -2
- package/dist/components/AudioRecorder/index.d.ts +2 -2
- package/dist/components/Autocomplete/index.d.cts +8 -2
- package/dist/components/Autocomplete/index.d.ts +8 -2
- package/dist/components/Avatar/index.d.cts +1 -1
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/BoardView/index.d.cts +91 -4
- package/dist/components/BoardView/index.d.ts +91 -4
- package/dist/components/Button/index.d.cts +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/CalendarView/index.d.cts +1 -2
- package/dist/components/CalendarView/index.d.ts +1 -2
- package/dist/components/Card/index.d.cts +3 -3
- package/dist/components/Card/index.d.ts +3 -3
- package/dist/components/Dropdown/index.d.cts +2 -1
- package/dist/components/Dropdown/index.d.ts +2 -1
- package/dist/components/GanttView/index.d.cts +1 -2
- package/dist/components/GanttView/index.d.ts +1 -2
- package/dist/components/ListView/index.d.cts +2 -3
- package/dist/components/ListView/index.d.ts +2 -3
- package/dist/components/MediaEditor/index.d.cts +91 -2
- package/dist/components/MediaEditor/index.d.ts +91 -2
- package/dist/components/MediaPlayer/index.d.cts +1 -1
- package/dist/components/MediaPlayer/index.d.ts +1 -1
- package/dist/components/Pagination/index.d.cts +1 -1
- package/dist/components/Pagination/index.d.ts +1 -1
- package/dist/components/PhoneInput/index.d.cts +36 -3
- package/dist/components/PhoneInput/index.d.ts +36 -3
- package/dist/components/Progress/index.d.cts +1 -1
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/Q/index.d.cts +2 -2
- package/dist/components/Q/index.d.ts +2 -2
- package/dist/components/QuickAction/index.d.cts +1 -1
- package/dist/components/QuickAction/index.d.ts +1 -1
- package/dist/components/RecordButton/index.d.cts +1 -1
- package/dist/components/RecordButton/index.d.ts +1 -1
- package/dist/components/RichTextEditor/index.d.cts +7 -2
- package/dist/components/RichTextEditor/index.d.ts +7 -2
- package/dist/components/ScrollArea/index.d.cts +1 -1
- package/dist/components/ScrollArea/index.d.ts +1 -1
- package/dist/components/Select/index.d.cts +1 -2
- package/dist/components/Select/index.d.ts +1 -2
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Slider/index.d.cts +2 -2
- package/dist/components/Slider/index.d.ts +2 -2
- package/dist/components/Spinner/index.d.cts +2 -2
- package/dist/components/Spinner/index.d.ts +2 -2
- package/dist/components/SuperChat/index.cjs +3 -3
- package/dist/components/SuperChat/index.d.cts +2 -4
- package/dist/components/SuperChat/index.d.ts +2 -4
- package/dist/components/SuperChat/index.js +1 -1
- package/dist/components/SuperChat/plugins/index.cjs +3 -3
- package/dist/components/SuperChat/plugins/index.d.cts +2 -3
- package/dist/components/SuperChat/plugins/index.d.ts +2 -3
- package/dist/components/SuperChat/plugins/index.js +2 -2
- package/dist/components/Text/index.d.cts +3 -3
- package/dist/components/Text/index.d.ts +3 -3
- package/dist/components/Textarea/index.d.cts +1 -2
- package/dist/components/Textarea/index.d.ts +1 -2
- package/dist/components/ThemeProvider/index.d.cts +3 -1
- package/dist/components/ThemeProvider/index.d.ts +3 -1
- package/dist/components/TranscriptView/index.d.cts +85 -4
- package/dist/components/TranscriptView/index.d.ts +85 -4
- package/dist/components/ViewSet/index.d.cts +120 -9
- package/dist/components/ViewSet/index.d.ts +120 -9
- package/dist/components/ViewSwitcher/index.d.cts +4 -40
- package/dist/components/ViewSwitcher/index.d.ts +4 -40
- package/dist/datavis.d.cts +167 -13
- package/dist/datavis.d.ts +167 -13
- package/dist/esheet.d.cts +183 -1
- package/dist/esheet.d.ts +183 -1
- package/dist/hooks/index.d.cts +383 -31
- package/dist/hooks/index.d.ts +383 -31
- package/dist/index-DoYYWsNc.d.cts +127 -0
- package/dist/index-DoYYWsNc.d.ts +127 -0
- package/dist/index.cjs +47 -47
- package/dist/index.d.cts +7600 -414
- package/dist/index.d.ts +7600 -414
- package/dist/index.js +4 -4
- package/dist/motion.d.cts +186 -2
- package/dist/motion.d.ts +186 -2
- package/dist/q.d.cts +25 -3
- package/dist/q.d.ts +25 -3
- package/dist/styles.css +1 -1
- package/dist/{types-B97JNRNQ.d.cts → types-DOxdTwmq.d.cts} +170 -2
- package/dist/{types-gZXrfLj6.d.ts → types-DOxdTwmq.d.ts} +170 -2
- package/dist/{types-CbWXIKbe.d.cts → types-DsdZvEI1.d.cts} +1 -28
- package/dist/{types-CbWXIKbe.d.ts → types-DsdZvEI1.d.ts} +1 -28
- package/dist/utils/index.d.cts +13 -2
- package/dist/utils/index.d.ts +13 -2
- package/package.json +3 -2
- package/dist/Animated-XmH6k8pZ.d.cts +0 -188
- package/dist/Animated-XmH6k8pZ.d.ts +0 -188
- package/dist/MedicationEditor-Bp4NLy7y.d.cts +0 -352
- package/dist/MedicationEditor-Bp4NLy7y.d.ts +0 -352
- package/dist/chunk-ACCAXVOG.js.map +0 -1
- package/dist/chunk-X4XPNTCZ.cjs.map +0 -1
- package/dist/html-MdxqSzjD.d.cts +0 -13
- package/dist/html-MdxqSzjD.d.ts +0 -13
- package/dist/orderRows-BUJYgSc7.d.cts +0 -221
- package/dist/orderRows-BUJYgSc7.d.ts +0 -221
- package/dist/transcript-Cg7uSW-C.d.cts +0 -84
- package/dist/transcript-Cg7uSW-C.d.ts +0 -84
- package/dist/types-CnPEwzlp.d.cts +0 -254
- package/dist/types-CnPEwzlp.d.ts +0 -254
- package/dist/useAnchoredPosition-CKwLSQW8.d.cts +0 -76
- package/dist/useAnchoredPosition-CKwLSQW8.d.ts +0 -76
- package/dist/useTheme-B9SWu6ui.d.cts +0 -24
- package/dist/useTheme-B9SWu6ui.d.ts +0 -24
- package/dist/useTranscriptEdits-CGzlemHT.d.cts +0 -182
- package/dist/useTranscriptEdits-D32bLs0l.d.ts +0 -182
|
@@ -1,5 +1,173 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Component Types
|
|
5
|
+
*
|
|
6
|
+
* Type definitions for AI-related components including MCP (Model Context Protocol)
|
|
7
|
+
* interactions, tool calls, and chat messages.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Status of an MCP tool invocation
|
|
12
|
+
*/
|
|
13
|
+
type MCPToolStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
|
|
14
|
+
/**
|
|
15
|
+
* MCP Tool parameter definition
|
|
16
|
+
*/
|
|
17
|
+
interface MCPToolParameter {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
value: unknown;
|
|
21
|
+
description?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MCP Tool invocation
|
|
25
|
+
*/
|
|
26
|
+
interface MCPToolCall {
|
|
27
|
+
/** Unique identifier for this tool call */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Name of the tool being invoked */
|
|
30
|
+
toolName: string;
|
|
31
|
+
/** Human-readable description of what the tool does */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Parameters passed to the tool */
|
|
34
|
+
parameters: MCPToolParameter[];
|
|
35
|
+
/** Current status of the tool execution */
|
|
36
|
+
status: MCPToolStatus;
|
|
37
|
+
/** Timestamp when tool was invoked */
|
|
38
|
+
startedAt: Date | string;
|
|
39
|
+
/** Timestamp when tool completed */
|
|
40
|
+
completedAt?: Date | string;
|
|
41
|
+
/** Duration in milliseconds */
|
|
42
|
+
duration?: number;
|
|
43
|
+
/** Result data if successful */
|
|
44
|
+
result?: MCPToolResult;
|
|
45
|
+
/** Error message if failed */
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Result from an MCP tool execution
|
|
50
|
+
*/
|
|
51
|
+
interface MCPToolResult {
|
|
52
|
+
/** Type of result data */
|
|
53
|
+
type: 'text' | 'json' | 'link' | 'resource' | 'error';
|
|
54
|
+
/** The result data */
|
|
55
|
+
data: unknown;
|
|
56
|
+
/** Human-readable summary of the result */
|
|
57
|
+
summary?: string;
|
|
58
|
+
/** Link to a resource (for link type) */
|
|
59
|
+
link?: MCPResourceLink;
|
|
60
|
+
/** Resources created or modified */
|
|
61
|
+
resources?: MCPResource[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Link to a resource
|
|
65
|
+
*/
|
|
66
|
+
interface MCPResourceLink {
|
|
67
|
+
/** URL or path to the resource */
|
|
68
|
+
href: string;
|
|
69
|
+
/** Display text for the link */
|
|
70
|
+
label: string;
|
|
71
|
+
/** Type of resource */
|
|
72
|
+
type?: 'patient' | 'document' | 'appointment' | 'order' | 'provider' | 'external' | 'internal';
|
|
73
|
+
/** Icon name or component */
|
|
74
|
+
icon?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* MCP Resource definition
|
|
78
|
+
*/
|
|
79
|
+
interface MCPResource {
|
|
80
|
+
/** Unique identifier */
|
|
81
|
+
id: string;
|
|
82
|
+
/** Resource type (e.g., 'patient', 'appointment', 'document') */
|
|
83
|
+
type: string;
|
|
84
|
+
/** Display name */
|
|
85
|
+
name: string;
|
|
86
|
+
/** URL to access the resource */
|
|
87
|
+
uri?: string;
|
|
88
|
+
/** Brief description */
|
|
89
|
+
description?: string;
|
|
90
|
+
/** Additional metadata */
|
|
91
|
+
metadata?: Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Role of the message sender
|
|
95
|
+
*/
|
|
96
|
+
type AIMessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
97
|
+
/**
|
|
98
|
+
* Status of an AI message
|
|
99
|
+
*/
|
|
100
|
+
type AIMessageStatus = 'pending' | 'streaming' | 'complete' | 'error';
|
|
101
|
+
/**
|
|
102
|
+
* Content block within a message
|
|
103
|
+
*/
|
|
104
|
+
interface AIMessageContent {
|
|
105
|
+
/** Type of content */
|
|
106
|
+
type: 'text' | 'tool_use' | 'tool_result' | 'thinking' | 'code' | 'image' | 'file' | 'audio' | 'video';
|
|
107
|
+
/** Text content (also used as the label for `audio` and `video` blocks) */
|
|
108
|
+
text?: string;
|
|
109
|
+
/** Tool call reference */
|
|
110
|
+
toolCall?: MCPToolCall;
|
|
111
|
+
/** Language for code blocks */
|
|
112
|
+
language?: string;
|
|
113
|
+
/** Whether this content is collapsed by default */
|
|
114
|
+
collapsed?: boolean;
|
|
115
|
+
/** Image source URL (for `image` blocks) */
|
|
116
|
+
imageUrl?: string;
|
|
117
|
+
/** Alt text / file name (for `image` and `file` blocks) */
|
|
118
|
+
name?: string;
|
|
119
|
+
/** File size in bytes (for `file` blocks) */
|
|
120
|
+
fileSize?: number;
|
|
121
|
+
/** MIME type (for `file`, `audio`, and `video` blocks) */
|
|
122
|
+
mimeType?: string;
|
|
123
|
+
/** Download/open URL (for `file` blocks) */
|
|
124
|
+
fileUrl?: string;
|
|
125
|
+
/** Source URL for `audio` blocks */
|
|
126
|
+
audioUrl?: string;
|
|
127
|
+
/** Source URL for `video` blocks */
|
|
128
|
+
videoUrl?: string;
|
|
129
|
+
/** Duration in seconds for `audio` blocks */
|
|
130
|
+
duration?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* AI Chat Message
|
|
134
|
+
*/
|
|
135
|
+
interface AIMessage {
|
|
136
|
+
/** Unique identifier */
|
|
137
|
+
id: string;
|
|
138
|
+
/** Role of sender */
|
|
139
|
+
role: AIMessageRole;
|
|
140
|
+
/** Message content blocks */
|
|
141
|
+
content: AIMessageContent[];
|
|
142
|
+
/** Timestamp */
|
|
143
|
+
timestamp: Date | string;
|
|
144
|
+
/** Current status */
|
|
145
|
+
status: AIMessageStatus;
|
|
146
|
+
/** Model used (for assistant messages) */
|
|
147
|
+
model?: string;
|
|
148
|
+
/** Token usage info */
|
|
149
|
+
usage?: {
|
|
150
|
+
promptTokens?: number;
|
|
151
|
+
completionTokens?: number;
|
|
152
|
+
totalTokens?: number;
|
|
153
|
+
};
|
|
154
|
+
/** Custom metadata */
|
|
155
|
+
metadata?: Record<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
/** Context passed to a custom text content renderer. */
|
|
158
|
+
interface AITextRenderContext {
|
|
159
|
+
/** id of the parent message (useful as a render cache key) */
|
|
160
|
+
messageId: string;
|
|
161
|
+
/** true while the message is still streaming */
|
|
162
|
+
streaming: boolean;
|
|
163
|
+
/** role of the parent message */
|
|
164
|
+
role: AIMessage['role'];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Render-prop for customizing `text` content blocks. Host is responsible
|
|
168
|
+
* for sanitizing untrusted input.
|
|
169
|
+
*/
|
|
170
|
+
type AIRenderTextContent = (text: string, ctx: AITextRenderContext) => React.ReactNode;
|
|
3
171
|
|
|
4
172
|
/**
|
|
5
173
|
* SuperChat Types
|
|
@@ -248,4 +416,4 @@ interface GenUIBlockPayload {
|
|
|
248
416
|
props?: unknown;
|
|
249
417
|
}
|
|
250
418
|
|
|
251
|
-
export type {
|
|
419
|
+
export type { AIRenderTextContent as A, ComposerAttachment as C, GenUIBlockPayload as G, MCPResourceLink as M, Participant as P, SuperChatConversation as S, SuperChatRenderPlugin as a, AttachmentKind as b, SuperChatLinkBuilder as c, SuperChatCopyFormat as d, SuperChatRef as e, AIMessageContent as f, AIMessageStatus as g, AITextRenderContext as h, GenUIPrefetchPolicy as i, GenUIRegistry as j, GenUIWidgetEntry as k, GenUIWidgetProps as l, ParticipantKind as m, ParticipantStatus as n, StandardSchemaV1 as o, SuperChatChannel as p, SuperChatItemType as q, SuperChatMessage as r, SuperChatPluggable as s, SuperChatPluggableList as t };
|
|
@@ -1,5 +1,173 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Component Types
|
|
5
|
+
*
|
|
6
|
+
* Type definitions for AI-related components including MCP (Model Context Protocol)
|
|
7
|
+
* interactions, tool calls, and chat messages.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Status of an MCP tool invocation
|
|
12
|
+
*/
|
|
13
|
+
type MCPToolStatus = 'pending' | 'running' | 'success' | 'error' | 'cancelled';
|
|
14
|
+
/**
|
|
15
|
+
* MCP Tool parameter definition
|
|
16
|
+
*/
|
|
17
|
+
interface MCPToolParameter {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
value: unknown;
|
|
21
|
+
description?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* MCP Tool invocation
|
|
25
|
+
*/
|
|
26
|
+
interface MCPToolCall {
|
|
27
|
+
/** Unique identifier for this tool call */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Name of the tool being invoked */
|
|
30
|
+
toolName: string;
|
|
31
|
+
/** Human-readable description of what the tool does */
|
|
32
|
+
description?: string;
|
|
33
|
+
/** Parameters passed to the tool */
|
|
34
|
+
parameters: MCPToolParameter[];
|
|
35
|
+
/** Current status of the tool execution */
|
|
36
|
+
status: MCPToolStatus;
|
|
37
|
+
/** Timestamp when tool was invoked */
|
|
38
|
+
startedAt: Date | string;
|
|
39
|
+
/** Timestamp when tool completed */
|
|
40
|
+
completedAt?: Date | string;
|
|
41
|
+
/** Duration in milliseconds */
|
|
42
|
+
duration?: number;
|
|
43
|
+
/** Result data if successful */
|
|
44
|
+
result?: MCPToolResult;
|
|
45
|
+
/** Error message if failed */
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Result from an MCP tool execution
|
|
50
|
+
*/
|
|
51
|
+
interface MCPToolResult {
|
|
52
|
+
/** Type of result data */
|
|
53
|
+
type: 'text' | 'json' | 'link' | 'resource' | 'error';
|
|
54
|
+
/** The result data */
|
|
55
|
+
data: unknown;
|
|
56
|
+
/** Human-readable summary of the result */
|
|
57
|
+
summary?: string;
|
|
58
|
+
/** Link to a resource (for link type) */
|
|
59
|
+
link?: MCPResourceLink;
|
|
60
|
+
/** Resources created or modified */
|
|
61
|
+
resources?: MCPResource[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Link to a resource
|
|
65
|
+
*/
|
|
66
|
+
interface MCPResourceLink {
|
|
67
|
+
/** URL or path to the resource */
|
|
68
|
+
href: string;
|
|
69
|
+
/** Display text for the link */
|
|
70
|
+
label: string;
|
|
71
|
+
/** Type of resource */
|
|
72
|
+
type?: 'patient' | 'document' | 'appointment' | 'order' | 'provider' | 'external' | 'internal';
|
|
73
|
+
/** Icon name or component */
|
|
74
|
+
icon?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* MCP Resource definition
|
|
78
|
+
*/
|
|
79
|
+
interface MCPResource {
|
|
80
|
+
/** Unique identifier */
|
|
81
|
+
id: string;
|
|
82
|
+
/** Resource type (e.g., 'patient', 'appointment', 'document') */
|
|
83
|
+
type: string;
|
|
84
|
+
/** Display name */
|
|
85
|
+
name: string;
|
|
86
|
+
/** URL to access the resource */
|
|
87
|
+
uri?: string;
|
|
88
|
+
/** Brief description */
|
|
89
|
+
description?: string;
|
|
90
|
+
/** Additional metadata */
|
|
91
|
+
metadata?: Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Role of the message sender
|
|
95
|
+
*/
|
|
96
|
+
type AIMessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
97
|
+
/**
|
|
98
|
+
* Status of an AI message
|
|
99
|
+
*/
|
|
100
|
+
type AIMessageStatus = 'pending' | 'streaming' | 'complete' | 'error';
|
|
101
|
+
/**
|
|
102
|
+
* Content block within a message
|
|
103
|
+
*/
|
|
104
|
+
interface AIMessageContent {
|
|
105
|
+
/** Type of content */
|
|
106
|
+
type: 'text' | 'tool_use' | 'tool_result' | 'thinking' | 'code' | 'image' | 'file' | 'audio' | 'video';
|
|
107
|
+
/** Text content (also used as the label for `audio` and `video` blocks) */
|
|
108
|
+
text?: string;
|
|
109
|
+
/** Tool call reference */
|
|
110
|
+
toolCall?: MCPToolCall;
|
|
111
|
+
/** Language for code blocks */
|
|
112
|
+
language?: string;
|
|
113
|
+
/** Whether this content is collapsed by default */
|
|
114
|
+
collapsed?: boolean;
|
|
115
|
+
/** Image source URL (for `image` blocks) */
|
|
116
|
+
imageUrl?: string;
|
|
117
|
+
/** Alt text / file name (for `image` and `file` blocks) */
|
|
118
|
+
name?: string;
|
|
119
|
+
/** File size in bytes (for `file` blocks) */
|
|
120
|
+
fileSize?: number;
|
|
121
|
+
/** MIME type (for `file`, `audio`, and `video` blocks) */
|
|
122
|
+
mimeType?: string;
|
|
123
|
+
/** Download/open URL (for `file` blocks) */
|
|
124
|
+
fileUrl?: string;
|
|
125
|
+
/** Source URL for `audio` blocks */
|
|
126
|
+
audioUrl?: string;
|
|
127
|
+
/** Source URL for `video` blocks */
|
|
128
|
+
videoUrl?: string;
|
|
129
|
+
/** Duration in seconds for `audio` blocks */
|
|
130
|
+
duration?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* AI Chat Message
|
|
134
|
+
*/
|
|
135
|
+
interface AIMessage {
|
|
136
|
+
/** Unique identifier */
|
|
137
|
+
id: string;
|
|
138
|
+
/** Role of sender */
|
|
139
|
+
role: AIMessageRole;
|
|
140
|
+
/** Message content blocks */
|
|
141
|
+
content: AIMessageContent[];
|
|
142
|
+
/** Timestamp */
|
|
143
|
+
timestamp: Date | string;
|
|
144
|
+
/** Current status */
|
|
145
|
+
status: AIMessageStatus;
|
|
146
|
+
/** Model used (for assistant messages) */
|
|
147
|
+
model?: string;
|
|
148
|
+
/** Token usage info */
|
|
149
|
+
usage?: {
|
|
150
|
+
promptTokens?: number;
|
|
151
|
+
completionTokens?: number;
|
|
152
|
+
totalTokens?: number;
|
|
153
|
+
};
|
|
154
|
+
/** Custom metadata */
|
|
155
|
+
metadata?: Record<string, unknown>;
|
|
156
|
+
}
|
|
157
|
+
/** Context passed to a custom text content renderer. */
|
|
158
|
+
interface AITextRenderContext {
|
|
159
|
+
/** id of the parent message (useful as a render cache key) */
|
|
160
|
+
messageId: string;
|
|
161
|
+
/** true while the message is still streaming */
|
|
162
|
+
streaming: boolean;
|
|
163
|
+
/** role of the parent message */
|
|
164
|
+
role: AIMessage['role'];
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Render-prop for customizing `text` content blocks. Host is responsible
|
|
168
|
+
* for sanitizing untrusted input.
|
|
169
|
+
*/
|
|
170
|
+
type AIRenderTextContent = (text: string, ctx: AITextRenderContext) => React.ReactNode;
|
|
3
171
|
|
|
4
172
|
/**
|
|
5
173
|
* SuperChat Types
|
|
@@ -248,4 +416,4 @@ interface GenUIBlockPayload {
|
|
|
248
416
|
props?: unknown;
|
|
249
417
|
}
|
|
250
418
|
|
|
251
|
-
export type {
|
|
419
|
+
export type { AIRenderTextContent as A, ComposerAttachment as C, GenUIBlockPayload as G, MCPResourceLink as M, Participant as P, SuperChatConversation as S, SuperChatRenderPlugin as a, AttachmentKind as b, SuperChatLinkBuilder as c, SuperChatCopyFormat as d, SuperChatRef as e, AIMessageContent as f, AIMessageStatus as g, AITextRenderContext as h, GenUIPrefetchPolicy as i, GenUIRegistry as j, GenUIWidgetEntry as k, GenUIWidgetProps as l, ParticipantKind as m, ParticipantStatus as n, StandardSchemaV1 as o, SuperChatChannel as p, SuperChatItemType as q, SuperChatMessage as r, SuperChatPluggable as s, SuperChatPluggableList as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateTime } from 'luxon';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* The contract every component in the `Modules/Views` family reads through.
|
|
@@ -64,7 +63,6 @@ interface ViewLabels {
|
|
|
64
63
|
/** Heading for the group a record with no status or group falls into. */
|
|
65
64
|
ungrouped: string;
|
|
66
65
|
}
|
|
67
|
-
declare const defaultViewLabels: ViewLabels;
|
|
68
66
|
/**
|
|
69
67
|
* Props every view accepts. Views are controlled: selection, the active view and
|
|
70
68
|
* filter state live in the page, and every change is handed back.
|
|
@@ -90,30 +88,5 @@ interface ViewBaseProps<T> {
|
|
|
90
88
|
now?: Date;
|
|
91
89
|
className?: string;
|
|
92
90
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Reads an accessor's date in the view's zone.
|
|
95
|
-
*
|
|
96
|
-
* `DateTime.fromISO` is what makes this correct for both shapes an accessor may
|
|
97
|
-
* return. A date-only string is a wall date — `2026-03-10` means that calendar
|
|
98
|
-
* day where the collection lives, not UTC midnight, which is the 9th in the
|
|
99
|
-
* Americas — while a full timestamp is an instant and gets converted. Going via
|
|
100
|
-
* `new Date()` would collapse the first case into the second and shift the item
|
|
101
|
-
* onto the previous day in every zone behind UTC.
|
|
102
|
-
*/
|
|
103
|
-
declare function toDateTime(value: Date | string | null | undefined, zone: string): DateTime | null;
|
|
104
|
-
/**
|
|
105
|
-
* Tailwind classes per accent, so every view tints the same way.
|
|
106
|
-
*
|
|
107
|
-
* There is deliberately no text colour here. `--mieweb-success` and friends are
|
|
108
|
-
* fill tokens: as ink on a surface — even their own 10% wash — they fail WCAG AA
|
|
109
|
-
* contrast, which axe catches as a serious violation. So an accent is carried by
|
|
110
|
-
* a wash, a border and a solid marker, and label text always uses a foreground
|
|
111
|
-
* token. That also means colour is never the only signal.
|
|
112
|
-
*/
|
|
113
|
-
declare const accentClasses: Record<Accent, {
|
|
114
|
-
tint: string;
|
|
115
|
-
border: string;
|
|
116
|
-
marker: string;
|
|
117
|
-
}>;
|
|
118
91
|
|
|
119
|
-
export
|
|
92
|
+
export type { Stage as S, ViewLabels as V, ViewBaseProps as a };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DateTime } from 'luxon';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* The contract every component in the `Modules/Views` family reads through.
|
|
@@ -64,7 +63,6 @@ interface ViewLabels {
|
|
|
64
63
|
/** Heading for the group a record with no status or group falls into. */
|
|
65
64
|
ungrouped: string;
|
|
66
65
|
}
|
|
67
|
-
declare const defaultViewLabels: ViewLabels;
|
|
68
66
|
/**
|
|
69
67
|
* Props every view accepts. Views are controlled: selection, the active view and
|
|
70
68
|
* filter state live in the page, and every change is handed back.
|
|
@@ -90,30 +88,5 @@ interface ViewBaseProps<T> {
|
|
|
90
88
|
now?: Date;
|
|
91
89
|
className?: string;
|
|
92
90
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Reads an accessor's date in the view's zone.
|
|
95
|
-
*
|
|
96
|
-
* `DateTime.fromISO` is what makes this correct for both shapes an accessor may
|
|
97
|
-
* return. A date-only string is a wall date — `2026-03-10` means that calendar
|
|
98
|
-
* day where the collection lives, not UTC midnight, which is the 9th in the
|
|
99
|
-
* Americas — while a full timestamp is an instant and gets converted. Going via
|
|
100
|
-
* `new Date()` would collapse the first case into the second and shift the item
|
|
101
|
-
* onto the previous day in every zone behind UTC.
|
|
102
|
-
*/
|
|
103
|
-
declare function toDateTime(value: Date | string | null | undefined, zone: string): DateTime | null;
|
|
104
|
-
/**
|
|
105
|
-
* Tailwind classes per accent, so every view tints the same way.
|
|
106
|
-
*
|
|
107
|
-
* There is deliberately no text colour here. `--mieweb-success` and friends are
|
|
108
|
-
* fill tokens: as ink on a surface — even their own 10% wash — they fail WCAG AA
|
|
109
|
-
* contrast, which axe catches as a serious violation. So an accent is carried by
|
|
110
|
-
* a wash, a border and a solid marker, and label text always uses a foreground
|
|
111
|
-
* token. That also means colour is never the only signal.
|
|
112
|
-
*/
|
|
113
|
-
declare const accentClasses: Record<Accent, {
|
|
114
|
-
tint: string;
|
|
115
|
-
border: string;
|
|
116
|
-
marker: string;
|
|
117
|
-
}>;
|
|
118
91
|
|
|
119
|
-
export
|
|
92
|
+
export type { Stage as S, ViewLabels as V, ViewBaseProps as a };
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
-
export { i as isHtmlEmpty, s as stripHtmlTags } from '../html-MdxqSzjD.cjs';
|
|
3
2
|
|
|
4
3
|
declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
5
4
|
/**
|
|
@@ -18,6 +17,18 @@ declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
|
18
17
|
*/
|
|
19
18
|
declare function cn(...inputs: ClassValue[]): string;
|
|
20
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Extracts visible text from an HTML string without using regex.
|
|
22
|
+
* Uses a simple character-by-character state machine to skip tags.
|
|
23
|
+
* This avoids CodeQL false-positives associated with regex-based tag stripping.
|
|
24
|
+
*/
|
|
25
|
+
declare function stripHtmlTags(html: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true when an HTML string has no visible text content.
|
|
28
|
+
* This is a visibility check, not a sanitizer — do NOT use for XSS prevention.
|
|
29
|
+
*/
|
|
30
|
+
declare function isHtmlEmpty(html: string): boolean;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Phone number formatting utilities
|
|
23
34
|
*/
|
|
@@ -106,4 +117,4 @@ declare function displayFormatToDateString(value: string): string;
|
|
|
106
117
|
*/
|
|
107
118
|
declare function isStorybookDocsMode(): boolean;
|
|
108
119
|
|
|
109
|
-
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, unformatPhoneNumber };
|
|
120
|
+
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isHtmlEmpty, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, stripHtmlTags, unformatPhoneNumber };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
-
export { i as isHtmlEmpty, s as stripHtmlTags } from '../html-MdxqSzjD.js';
|
|
3
2
|
|
|
4
3
|
declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
5
4
|
/**
|
|
@@ -18,6 +17,18 @@ declare const miewebUITwMergeConflicts: Record<string, string[]>;
|
|
|
18
17
|
*/
|
|
19
18
|
declare function cn(...inputs: ClassValue[]): string;
|
|
20
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Extracts visible text from an HTML string without using regex.
|
|
22
|
+
* Uses a simple character-by-character state machine to skip tags.
|
|
23
|
+
* This avoids CodeQL false-positives associated with regex-based tag stripping.
|
|
24
|
+
*/
|
|
25
|
+
declare function stripHtmlTags(html: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true when an HTML string has no visible text content.
|
|
28
|
+
* This is a visibility check, not a sanitizer — do NOT use for XSS prevention.
|
|
29
|
+
*/
|
|
30
|
+
declare function isHtmlEmpty(html: string): boolean;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Phone number formatting utilities
|
|
23
34
|
*/
|
|
@@ -106,4 +117,4 @@ declare function displayFormatToDateString(value: string): string;
|
|
|
106
117
|
*/
|
|
107
118
|
declare function isStorybookDocsMode(): boolean;
|
|
108
119
|
|
|
109
|
-
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, unformatPhoneNumber };
|
|
120
|
+
export { calculateAge, cn, dateToDisplayFormat, displayFormatToDateString, formatDateValue, formatPhoneNumber, isDateEmpty, isDateInFuture, isDateInPast, isHtmlEmpty, isPhoneNumberEmpty, isStorybookDocsMode, isValidDate, isValidDrivingAge, isValidPhoneNumber, miewebUITwMergeConflicts, parseDateValue, stripHtmlTags, unformatPhoneNumber };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mieweb/ui",
|
|
3
|
-
"version": "0.10.0-dev.
|
|
3
|
+
"version": "0.10.0-dev.13",
|
|
4
4
|
"description": "A themeable, accessible React component library built with Tailwind CSS",
|
|
5
5
|
"author": "Medical Informatics Engineering, Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -241,7 +241,8 @@
|
|
|
241
241
|
"prepare": "npm run build:datavis && npm run build:css && npm run copy:brand-css && npm run copy:style-css && npm run copy:markdown-css && npm run copy:kerebron-css",
|
|
242
242
|
"dev": "tsup --watch",
|
|
243
243
|
"prebuild": "npm run build:esheet && npm run build:datavis",
|
|
244
|
-
"build": "node --max-old-space-size=8192 ./node_modules/tsup/dist/cli-default.js && npm run build:css && npm run copy:brand-css && npm run copy:style-css && npm run copy:markdown-css && npm run copy:kerebron-css",
|
|
244
|
+
"build": "node --max-old-space-size=8192 ./node_modules/tsup/dist/cli-default.js && npm run build:dts && npm run build:css && npm run copy:brand-css && npm run copy:style-css && npm run copy:markdown-css && npm run copy:kerebron-css",
|
|
245
|
+
"build:dts": "node scripts/build-dts.mjs",
|
|
245
246
|
"build:esheet": "if [ ! -f packages/esheet/packages/core/dist/index.d.ts ] || [ ! -f packages/esheet/packages/renderer/src/index.output.css ] || [ ! -f packages/esheet/packages/builder/src/index.output.css ]; then cd packages/esheet && pnpm install --frozen-lockfile && pnpm --filter '@esheet/builder...' --filter '@esheet/renderer...' build; fi",
|
|
246
247
|
"build:datavis": "node scripts/build-datavis.mjs",
|
|
247
248
|
"build:css": "mkdir -p dist && npx @tailwindcss/cli -i ./src/styles/base.css -o ./dist/styles.css --minify",
|