@uipath/apollo-wind 2.67.1 → 2.69.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/components/forms/metadata-form.cjs +40 -44
- package/dist/components/forms/metadata-form.js +40 -44
- package/dist/components/ui/code-block.cjs +375 -0
- package/dist/components/ui/code-block.d.ts +38 -0
- package/dist/components/ui/code-block.js +307 -0
- package/dist/components/ui/index.cjs +268 -191
- package/dist/components/ui/index.d.ts +7 -0
- package/dist/components/ui/index.js +7 -0
- package/dist/components/ui/json-tree-view/JsonTree.cjs +2 -2
- package/dist/components/ui/json-tree-view/JsonTree.js +1 -1
- package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +26 -0
- package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +13 -10
- package/dist/components/ui/json-tree-view/JsonTreeRow.js +14 -11
- package/dist/components/ui/json-tree-view/JsonTreeToolbar.cjs +22 -11
- package/dist/components/ui/json-tree-view/JsonTreeToolbar.d.ts +6 -1
- package/dist/components/ui/json-tree-view/JsonTreeToolbar.js +22 -11
- package/dist/components/ui/json-tree-view/NodeKey.cjs +4 -0
- package/dist/components/ui/json-tree-view/NodeKey.js +4 -0
- package/dist/components/ui/json-tree-view/RowActions.cjs +23 -17
- package/dist/components/ui/json-tree-view/RowActions.d.ts +4 -1
- package/dist/components/ui/json-tree-view/RowActions.js +23 -17
- package/dist/components/ui/json-tree-view/buildJsonTree.cjs +99 -44
- package/dist/components/ui/json-tree-view/buildJsonTree.d.ts +15 -2
- package/dist/components/ui/json-tree-view/buildJsonTree.js +97 -45
- package/dist/components/ui/json-tree-view/index.cjs +26 -23
- package/dist/components/ui/json-tree-view/index.d.ts +2 -2
- package/dist/components/ui/json-tree-view/index.js +2 -2
- package/dist/components/ui/live-region.cjs +106 -0
- package/dist/components/ui/live-region.d.ts +31 -0
- package/dist/components/ui/live-region.js +72 -0
- package/dist/components/ui/loading-dots.cjs +95 -0
- package/dist/components/ui/loading-dots.d.ts +21 -0
- package/dist/components/ui/loading-dots.js +55 -0
- package/dist/components/ui/markdown.cjs +428 -0
- package/dist/components/ui/markdown.d.ts +55 -0
- package/dist/components/ui/markdown.js +378 -0
- package/dist/components/ui/panel-tabs.cjs +99 -0
- package/dist/components/ui/panel-tabs.d.ts +34 -0
- package/dist/components/ui/panel-tabs.js +53 -0
- package/dist/components/ui/thinking-indicator.cjs +146 -0
- package/dist/components/ui/thinking-indicator.d.ts +38 -0
- package/dist/components/ui/thinking-indicator.js +106 -0
- package/dist/components/ui/tool-call.cjs +359 -0
- package/dist/components/ui/tool-call.d.ts +75 -0
- package/dist/components/ui/tool-call.js +301 -0
- package/dist/index.cjs +334 -246
- package/dist/index.d.ts +15 -1
- package/dist/index.js +9 -2
- package/dist/styles.css +239 -0
- package/dist/tailwind.utilities.css +21 -0
- package/package.json +7 -1
- /package/dist/{components/ui/json-tree-view → lib}/clipboard.cjs +0 -0
- /package/dist/{components/ui/json-tree-view → lib}/clipboard.d.ts +0 -0
- /package/dist/{components/ui/json-tree-view → lib}/clipboard.js +0 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, forwardRef, useContext, useId, useMemo } from "react";
|
|
3
|
+
import react_markdown from "react-markdown";
|
|
4
|
+
import rehype_katex from "rehype-katex";
|
|
5
|
+
import remark_gfm from "remark-gfm";
|
|
6
|
+
import remark_math from "remark-math";
|
|
7
|
+
import { CodeBlock, DEFAULT_CODE_BLOCK_STRINGS } from "./code-block.js";
|
|
8
|
+
import { cn } from "../../lib/index.js";
|
|
9
|
+
function hastText(node) {
|
|
10
|
+
if ('text' === node.type) return node.value ?? '';
|
|
11
|
+
return (node.children ?? []).map(hastText).join('');
|
|
12
|
+
}
|
|
13
|
+
function languageOf(node) {
|
|
14
|
+
const className = node.properties?.className;
|
|
15
|
+
const classes = Array.isArray(className) ? className.map(String) : [];
|
|
16
|
+
return classes.find((name)=>name.startsWith('language-'))?.slice('language-'.length);
|
|
17
|
+
}
|
|
18
|
+
const opensInNewTab = (href)=>!!href && !/^(#|mailto:|tel:)/i.test(href);
|
|
19
|
+
const BR_TAG = /^<br\s*\/?>$/i;
|
|
20
|
+
function remarkHtmlBreaks() {
|
|
21
|
+
const visit = (node)=>{
|
|
22
|
+
if (!node.children) return;
|
|
23
|
+
node.children = node.children.map((child)=>'html' === child.type && BR_TAG.test(child.value?.trim() ?? '') ? {
|
|
24
|
+
type: 'break'
|
|
25
|
+
} : child);
|
|
26
|
+
node.children.forEach(visit);
|
|
27
|
+
};
|
|
28
|
+
return (tree)=>visit(tree);
|
|
29
|
+
}
|
|
30
|
+
const CURSOR_CONTAINERS = new Set([
|
|
31
|
+
'ul',
|
|
32
|
+
'ol',
|
|
33
|
+
'li',
|
|
34
|
+
'blockquote',
|
|
35
|
+
'table',
|
|
36
|
+
'thead',
|
|
37
|
+
'tbody',
|
|
38
|
+
'tr'
|
|
39
|
+
]);
|
|
40
|
+
const CURSOR_TEXT_BLOCKS = new Set([
|
|
41
|
+
'p',
|
|
42
|
+
'h1',
|
|
43
|
+
'h2',
|
|
44
|
+
'h3',
|
|
45
|
+
'h4',
|
|
46
|
+
'h5',
|
|
47
|
+
'h6',
|
|
48
|
+
'td',
|
|
49
|
+
'th'
|
|
50
|
+
]);
|
|
51
|
+
const CURSOR_CLASS = 'ml-0.5 inline-block h-[1.1em] w-[0.45em] translate-y-[0.2em] rounded-[1px] bg-foreground animate-pulse motion-reduce:animate-none';
|
|
52
|
+
function lastContent(node) {
|
|
53
|
+
const children = node.children ?? [];
|
|
54
|
+
for(let i = children.length - 1; i >= 0; i--){
|
|
55
|
+
const child = children[i];
|
|
56
|
+
if ('element' === child.type) return child;
|
|
57
|
+
if ('text' === child.type && child.value?.trim()) return child;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function findCursorHost(root) {
|
|
61
|
+
let node = root;
|
|
62
|
+
for(;;){
|
|
63
|
+
const last = lastContent(node);
|
|
64
|
+
if (last?.type !== 'element' || !last.tagName) return node;
|
|
65
|
+
if (CURSOR_TEXT_BLOCKS.has(last.tagName)) return last;
|
|
66
|
+
if (!CURSOR_CONTAINERS.has(last.tagName)) return node;
|
|
67
|
+
node = last;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function rehypeStreamingCursor() {
|
|
71
|
+
return (tree)=>{
|
|
72
|
+
const host = findCursorHost(tree);
|
|
73
|
+
host.children = [
|
|
74
|
+
...host.children ?? [],
|
|
75
|
+
{
|
|
76
|
+
type: 'element',
|
|
77
|
+
tagName: 'span',
|
|
78
|
+
properties: {
|
|
79
|
+
dataSlot: 'markdown-cursor',
|
|
80
|
+
ariaHidden: 'true',
|
|
81
|
+
className: [
|
|
82
|
+
CURSOR_CLASS
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
children: []
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function rehypeScopeFootnoteLabel(options) {
|
|
91
|
+
const LABEL = 'footnote-label';
|
|
92
|
+
const scoped = `${options.prefix}${LABEL}`;
|
|
93
|
+
const visit = (node)=>{
|
|
94
|
+
const properties = node.properties;
|
|
95
|
+
if (properties?.id === LABEL) properties.id = scoped;
|
|
96
|
+
if (properties && Array.isArray(properties.ariaDescribedBy)) properties.ariaDescribedBy = properties.ariaDescribedBy.map((ref)=>ref === LABEL ? scoped : ref);
|
|
97
|
+
node.children?.forEach(visit);
|
|
98
|
+
};
|
|
99
|
+
return (tree)=>visit(tree);
|
|
100
|
+
}
|
|
101
|
+
const DEFAULT_MARKDOWN_STRINGS = {
|
|
102
|
+
...DEFAULT_CODE_BLOCK_STRINGS,
|
|
103
|
+
footnotes: 'Footnotes',
|
|
104
|
+
footnoteBack: 'Back to content',
|
|
105
|
+
taskDone: 'Done',
|
|
106
|
+
taskOpen: 'Not done'
|
|
107
|
+
};
|
|
108
|
+
function isAllowedImageSrc(src, policy) {
|
|
109
|
+
if ('none' === policy) return false;
|
|
110
|
+
if ('all' === policy) return true;
|
|
111
|
+
if ('function' == typeof policy) return policy(src);
|
|
112
|
+
try {
|
|
113
|
+
const base = "u" < typeof window ? 'https://relative.invalid' : window.location.href;
|
|
114
|
+
return new URL(src, base).origin === new URL(base).origin;
|
|
115
|
+
} catch {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const MarkdownContext = /*#__PURE__*/ createContext({
|
|
120
|
+
strings: DEFAULT_MARKDOWN_STRINGS,
|
|
121
|
+
images: 'none',
|
|
122
|
+
codeWrap: false
|
|
123
|
+
});
|
|
124
|
+
const InsideLinkContext = /*#__PURE__*/ createContext(false);
|
|
125
|
+
const LINK_CLASS = 'font-medium text-foreground-link underline underline-offset-2 hover:no-underline';
|
|
126
|
+
function MarkdownLink({ node: _node, className, href, children, ...rest }) {
|
|
127
|
+
return /*#__PURE__*/ jsx("a", {
|
|
128
|
+
href: href,
|
|
129
|
+
className: cn(LINK_CLASS, className),
|
|
130
|
+
...opensInNewTab(href) ? {
|
|
131
|
+
target: '_blank',
|
|
132
|
+
rel: 'noreferrer'
|
|
133
|
+
} : {},
|
|
134
|
+
...rest,
|
|
135
|
+
children: /*#__PURE__*/ jsx(InsideLinkContext.Provider, {
|
|
136
|
+
value: true,
|
|
137
|
+
children: children
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function MarkdownImage({ node: _node, className, alt, src, ...rest }) {
|
|
142
|
+
const { images } = useContext(MarkdownContext);
|
|
143
|
+
const insideLink = useContext(InsideLinkContext);
|
|
144
|
+
const source = 'string' == typeof src ? src : '';
|
|
145
|
+
if (source && isAllowedImageSrc(source, images)) return /*#__PURE__*/ jsx("img", {
|
|
146
|
+
alt: alt ?? '',
|
|
147
|
+
src: source,
|
|
148
|
+
loading: "lazy",
|
|
149
|
+
referrerPolicy: "no-referrer",
|
|
150
|
+
className: cn('h-auto max-w-full rounded-md', className),
|
|
151
|
+
...rest
|
|
152
|
+
});
|
|
153
|
+
const label = alt || source;
|
|
154
|
+
if (insideLink || !source) return /*#__PURE__*/ jsx("span", {
|
|
155
|
+
"data-slot": "markdown-image-text",
|
|
156
|
+
children: label
|
|
157
|
+
});
|
|
158
|
+
return /*#__PURE__*/ jsx("a", {
|
|
159
|
+
"data-slot": "markdown-image-link",
|
|
160
|
+
href: source,
|
|
161
|
+
target: "_blank",
|
|
162
|
+
rel: "noreferrer",
|
|
163
|
+
className: LINK_CLASS,
|
|
164
|
+
children: label
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function MarkdownInput({ node: _node, className, type, checked, ...rest }) {
|
|
168
|
+
const { strings } = useContext(MarkdownContext);
|
|
169
|
+
if ('checkbox' !== type) return /*#__PURE__*/ jsx("input", {
|
|
170
|
+
type: type,
|
|
171
|
+
className: className,
|
|
172
|
+
...rest
|
|
173
|
+
});
|
|
174
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
175
|
+
children: [
|
|
176
|
+
/*#__PURE__*/ jsx("input", {
|
|
177
|
+
type: "checkbox",
|
|
178
|
+
checked: checked,
|
|
179
|
+
"aria-hidden": "true",
|
|
180
|
+
tabIndex: -1,
|
|
181
|
+
className: cn('mr-2 size-3.5 translate-y-0.5 accent-primary', className),
|
|
182
|
+
...rest
|
|
183
|
+
}),
|
|
184
|
+
/*#__PURE__*/ jsxs("span", {
|
|
185
|
+
"data-slot": "markdown-task-state",
|
|
186
|
+
className: "sr-only",
|
|
187
|
+
children: [
|
|
188
|
+
checked ? strings.taskDone : strings.taskOpen,
|
|
189
|
+
' '
|
|
190
|
+
]
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function MarkdownPre({ node, children, ...rest }) {
|
|
196
|
+
const { strings, codeWrap, renderCodeActions } = useContext(MarkdownContext);
|
|
197
|
+
const codeNode = node?.children?.find((child)=>'element' === child.type && 'code' === child.tagName);
|
|
198
|
+
if (!codeNode) return /*#__PURE__*/ jsx("pre", {
|
|
199
|
+
...rest,
|
|
200
|
+
children: children
|
|
201
|
+
});
|
|
202
|
+
const block = {
|
|
203
|
+
code: hastText(codeNode).replace(/\n$/, ''),
|
|
204
|
+
language: languageOf(codeNode)
|
|
205
|
+
};
|
|
206
|
+
return /*#__PURE__*/ jsx(CodeBlock, {
|
|
207
|
+
code: block.code,
|
|
208
|
+
language: block.language,
|
|
209
|
+
wrap: codeWrap,
|
|
210
|
+
actions: renderCodeActions?.(block),
|
|
211
|
+
strings: strings
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
const BUILT_IN_COMPONENTS = {
|
|
215
|
+
h1: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("h1", {
|
|
216
|
+
className: cn('text-xl font-semibold tracking-tight', className),
|
|
217
|
+
...rest
|
|
218
|
+
}),
|
|
219
|
+
h2: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("h2", {
|
|
220
|
+
className: cn('text-lg font-semibold tracking-tight', className),
|
|
221
|
+
...rest
|
|
222
|
+
}),
|
|
223
|
+
h3: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("h3", {
|
|
224
|
+
className: cn('text-base font-semibold', className),
|
|
225
|
+
...rest
|
|
226
|
+
}),
|
|
227
|
+
h4: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("h4", {
|
|
228
|
+
className: cn('text-sm font-semibold', className),
|
|
229
|
+
...rest
|
|
230
|
+
}),
|
|
231
|
+
h5: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("h5", {
|
|
232
|
+
className: cn('text-sm font-semibold', className),
|
|
233
|
+
...rest
|
|
234
|
+
}),
|
|
235
|
+
h6: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("h6", {
|
|
236
|
+
className: cn('text-sm font-semibold text-muted-foreground', className),
|
|
237
|
+
...rest
|
|
238
|
+
}),
|
|
239
|
+
p: ({ node: _node, ...rest })=>/*#__PURE__*/ jsx("p", {
|
|
240
|
+
...rest
|
|
241
|
+
}),
|
|
242
|
+
a: MarkdownLink,
|
|
243
|
+
ul: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("ul", {
|
|
244
|
+
className: cn('flex flex-col gap-1 pl-6', className?.includes('contains-task-list') ? 'list-none pl-1' : 'list-disc', 'marker:text-muted-foreground', className),
|
|
245
|
+
...rest
|
|
246
|
+
}),
|
|
247
|
+
ol: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("ol", {
|
|
248
|
+
className: cn('flex list-decimal flex-col gap-1 pl-6 marker:text-muted-foreground', className),
|
|
249
|
+
...rest
|
|
250
|
+
}),
|
|
251
|
+
li: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("li", {
|
|
252
|
+
className: cn('pl-1 [&>ol]:mt-1 [&>p+p]:mt-2 [&>ul]:mt-1 [&>ul.contains-task-list]:pl-6', className),
|
|
253
|
+
...rest
|
|
254
|
+
}),
|
|
255
|
+
input: MarkdownInput,
|
|
256
|
+
blockquote: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("blockquote", {
|
|
257
|
+
className: cn('flex flex-col gap-2 border-l-2 border-border pl-4 text-muted-foreground', className),
|
|
258
|
+
...rest
|
|
259
|
+
}),
|
|
260
|
+
hr: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("hr", {
|
|
261
|
+
className: cn('border-border-subtle', className),
|
|
262
|
+
...rest
|
|
263
|
+
}),
|
|
264
|
+
img: MarkdownImage,
|
|
265
|
+
table: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("div", {
|
|
266
|
+
"data-slot": "markdown-table",
|
|
267
|
+
tabIndex: 0,
|
|
268
|
+
className: "max-w-full overflow-x-auto rounded-lg border border-border-subtle outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
269
|
+
children: /*#__PURE__*/ jsx("table", {
|
|
270
|
+
className: cn('w-full border-collapse text-left [&_tr:last-child>td]:border-b-0', className),
|
|
271
|
+
...rest
|
|
272
|
+
})
|
|
273
|
+
}),
|
|
274
|
+
th: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("th", {
|
|
275
|
+
className: cn('border-b border-border-subtle bg-surface-overlay px-3 py-2 font-semibold', className),
|
|
276
|
+
...rest
|
|
277
|
+
}),
|
|
278
|
+
td: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("td", {
|
|
279
|
+
className: cn('border-b border-border-subtle px-3 py-2 align-top', className),
|
|
280
|
+
...rest
|
|
281
|
+
}),
|
|
282
|
+
code: ({ node: _node, className, ...rest })=>/*#__PURE__*/ jsx("code", {
|
|
283
|
+
className: cn('rounded-md bg-surface-overlay px-1.5 py-0.5 font-mono text-[0.875em]', className),
|
|
284
|
+
...rest
|
|
285
|
+
}),
|
|
286
|
+
pre: MarkdownPre
|
|
287
|
+
};
|
|
288
|
+
const Markdown = /*#__PURE__*/ forwardRef(({ children, components, remarkPlugins, rehypePlugins, streaming = false, images = 'none', codeWrap = false, renderCodeActions, strings, className, ...props }, ref)=>{
|
|
289
|
+
const context = useMemo(()=>({
|
|
290
|
+
strings: {
|
|
291
|
+
...DEFAULT_MARKDOWN_STRINGS,
|
|
292
|
+
...strings
|
|
293
|
+
},
|
|
294
|
+
images,
|
|
295
|
+
codeWrap,
|
|
296
|
+
renderCodeActions
|
|
297
|
+
}), [
|
|
298
|
+
strings,
|
|
299
|
+
images,
|
|
300
|
+
codeWrap,
|
|
301
|
+
renderCodeActions
|
|
302
|
+
]);
|
|
303
|
+
const { footnotes, footnoteBack } = context.strings;
|
|
304
|
+
const footnotePrefix = `markdown${useId().replace(/[^\w-]/g, '')}-`;
|
|
305
|
+
const mergedComponents = useMemo(()=>components ? {
|
|
306
|
+
...BUILT_IN_COMPONENTS,
|
|
307
|
+
...components
|
|
308
|
+
} : BUILT_IN_COMPONENTS, [
|
|
309
|
+
components
|
|
310
|
+
]);
|
|
311
|
+
const mergedRemarkPlugins = useMemo(()=>[
|
|
312
|
+
remark_gfm,
|
|
313
|
+
[
|
|
314
|
+
remark_math,
|
|
315
|
+
{
|
|
316
|
+
singleDollarTextMath: false
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
remarkHtmlBreaks,
|
|
320
|
+
...remarkPlugins ?? []
|
|
321
|
+
], [
|
|
322
|
+
remarkPlugins
|
|
323
|
+
]);
|
|
324
|
+
const mergedRehypePlugins = useMemo(()=>[
|
|
325
|
+
[
|
|
326
|
+
rehypeScopeFootnoteLabel,
|
|
327
|
+
{
|
|
328
|
+
prefix: footnotePrefix
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
[
|
|
332
|
+
rehype_katex,
|
|
333
|
+
{
|
|
334
|
+
output: 'mathml',
|
|
335
|
+
throwOnError: false,
|
|
336
|
+
trust: false,
|
|
337
|
+
strict: 'ignore'
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
...rehypePlugins ?? [],
|
|
341
|
+
...streaming ? [
|
|
342
|
+
rehypeStreamingCursor
|
|
343
|
+
] : []
|
|
344
|
+
], [
|
|
345
|
+
rehypePlugins,
|
|
346
|
+
streaming,
|
|
347
|
+
footnotePrefix
|
|
348
|
+
]);
|
|
349
|
+
const remarkRehypeOptions = useMemo(()=>({
|
|
350
|
+
clobberPrefix: footnotePrefix,
|
|
351
|
+
footnoteLabel: footnotes,
|
|
352
|
+
footnoteBackLabel: footnoteBack
|
|
353
|
+
}), [
|
|
354
|
+
footnotePrefix,
|
|
355
|
+
footnotes,
|
|
356
|
+
footnoteBack
|
|
357
|
+
]);
|
|
358
|
+
return /*#__PURE__*/ jsx("div", {
|
|
359
|
+
ref: ref,
|
|
360
|
+
"data-slot": "markdown",
|
|
361
|
+
"data-streaming": streaming || void 0,
|
|
362
|
+
"aria-busy": streaming || void 0,
|
|
363
|
+
className: cn('flex min-w-0 flex-col gap-3 text-sm leading-relaxed break-words text-foreground [&_math]:text-[1.15em] [&>.katex]:overflow-x-auto [&>.katex]:py-1', className),
|
|
364
|
+
...props,
|
|
365
|
+
children: /*#__PURE__*/ jsx(MarkdownContext.Provider, {
|
|
366
|
+
value: context,
|
|
367
|
+
children: /*#__PURE__*/ jsx(react_markdown, {
|
|
368
|
+
components: mergedComponents,
|
|
369
|
+
remarkPlugins: mergedRemarkPlugins,
|
|
370
|
+
rehypePlugins: mergedRehypePlugins,
|
|
371
|
+
remarkRehypeOptions: remarkRehypeOptions,
|
|
372
|
+
children: children
|
|
373
|
+
})
|
|
374
|
+
})
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
Markdown.displayName = 'Markdown';
|
|
378
|
+
export { DEFAULT_MARKDOWN_STRINGS, Markdown };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
PanelTabsList: ()=>PanelTabsList,
|
|
28
|
+
PanelTabsStrip: ()=>PanelTabsStrip,
|
|
29
|
+
PanelTabs: ()=>PanelTabs,
|
|
30
|
+
PanelTabsTrigger: ()=>PanelTabsTrigger,
|
|
31
|
+
PanelTabsContent: ()=>PanelTabsContent
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const external_react_namespaceObject = require("react");
|
|
35
|
+
const index_cjs_namespaceObject = require("../../lib/index.cjs");
|
|
36
|
+
const external_tabs_cjs_namespaceObject = require("./tabs.cjs");
|
|
37
|
+
const PanelTabs = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tabs_cjs_namespaceObject.Tabs, {
|
|
38
|
+
ref: ref,
|
|
39
|
+
"data-slot": "panel-tabs",
|
|
40
|
+
className: (0, index_cjs_namespaceObject.cn)('flex min-h-0 flex-1 flex-col gap-1', className),
|
|
41
|
+
...props
|
|
42
|
+
}));
|
|
43
|
+
PanelTabs.displayName = 'PanelTabs';
|
|
44
|
+
const PanelTabsStrip = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, containerClassName, scrollButtonClassName, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tabs_cjs_namespaceObject.ScrollableTabsList, {
|
|
45
|
+
ref: ref,
|
|
46
|
+
"data-slot": "panel-tabs-strip",
|
|
47
|
+
containerClassName: (0, index_cjs_namespaceObject.cn)('w-auto', containerClassName),
|
|
48
|
+
className: (0, index_cjs_namespaceObject.cn)('h-auto justify-start gap-0.5 rounded-lg bg-transparent p-0 text-muted-foreground', className),
|
|
49
|
+
scrollButtonClassName: (0, index_cjs_namespaceObject.cn)('size-6 hover:bg-surface-overlay', scrollButtonClassName),
|
|
50
|
+
...props
|
|
51
|
+
}));
|
|
52
|
+
PanelTabsStrip.displayName = 'PanelTabsStrip';
|
|
53
|
+
const PanelTabsList = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ trailing, rowClassName, className, containerClassName, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
54
|
+
"data-slot": "panel-tabs-list",
|
|
55
|
+
className: (0, index_cjs_namespaceObject.cn)('flex shrink-0 items-center gap-2 pt-3 pb-0.5 [padding-inline:var(--mf-content-inset,0px)]', rowClassName),
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(PanelTabsStrip, {
|
|
58
|
+
ref: ref,
|
|
59
|
+
className: className,
|
|
60
|
+
containerClassName: (0, index_cjs_namespaceObject.cn)('flex-1', containerClassName),
|
|
61
|
+
...props
|
|
62
|
+
}),
|
|
63
|
+
trailing
|
|
64
|
+
]
|
|
65
|
+
}));
|
|
66
|
+
PanelTabsList.displayName = 'PanelTabsList';
|
|
67
|
+
const PanelTabsTrigger = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tabs_cjs_namespaceObject.TabsTrigger, {
|
|
68
|
+
ref: ref,
|
|
69
|
+
"data-slot": "panel-tabs-trigger",
|
|
70
|
+
className: (0, index_cjs_namespaceObject.cn)('inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2.5 text-xs font-medium text-muted-foreground shadow-none transition-colors hover:text-foreground data-[state=active]:bg-surface-overlay data-[state=active]:text-foreground data-[state=active]:shadow-sm', className),
|
|
71
|
+
...props
|
|
72
|
+
}));
|
|
73
|
+
PanelTabsTrigger.displayName = 'PanelTabsTrigger';
|
|
74
|
+
const PanelTabsContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ padded = true, innerClassName, className, children, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tabs_cjs_namespaceObject.TabsContent, {
|
|
75
|
+
ref: ref,
|
|
76
|
+
"data-slot": "panel-tabs-content",
|
|
77
|
+
className: (0, index_cjs_namespaceObject.cn)('mt-0 min-h-0 flex-1 overflow-auto', className),
|
|
78
|
+
...props,
|
|
79
|
+
children: padded ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
80
|
+
className: (0, index_cjs_namespaceObject.cn)('pt-1.5 pb-6 [padding-inline:var(--mf-content-inset,0px)]', innerClassName),
|
|
81
|
+
children: children
|
|
82
|
+
}) : children
|
|
83
|
+
}));
|
|
84
|
+
PanelTabsContent.displayName = 'PanelTabsContent';
|
|
85
|
+
exports.PanelTabs = __webpack_exports__.PanelTabs;
|
|
86
|
+
exports.PanelTabsContent = __webpack_exports__.PanelTabsContent;
|
|
87
|
+
exports.PanelTabsList = __webpack_exports__.PanelTabsList;
|
|
88
|
+
exports.PanelTabsStrip = __webpack_exports__.PanelTabsStrip;
|
|
89
|
+
exports.PanelTabsTrigger = __webpack_exports__.PanelTabsTrigger;
|
|
90
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
91
|
+
"PanelTabs",
|
|
92
|
+
"PanelTabsContent",
|
|
93
|
+
"PanelTabsList",
|
|
94
|
+
"PanelTabsStrip",
|
|
95
|
+
"PanelTabsTrigger"
|
|
96
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
97
|
+
Object.defineProperty(exports, '__esModule', {
|
|
98
|
+
value: true
|
|
99
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ScrollableTabsListProps, TabsContent } from './tabs';
|
|
3
|
+
/** Root: a column whose content area fills the remaining height. */
|
|
4
|
+
declare const PanelTabs: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-tabs").TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
/**
|
|
6
|
+
* The tab strip alone, for a row that also holds other controls (e.g. a tree
|
|
7
|
+
* toolbar). In a narrow panel it reveals prev/next chevrons and keeps the active
|
|
8
|
+
* tab in view; in a wide one it reads as a plain strip.
|
|
9
|
+
*/
|
|
10
|
+
declare const PanelTabsStrip: React.ForwardRefExoticComponent<ScrollableTabsListProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
interface PanelTabsListProps extends ScrollableTabsListProps {
|
|
12
|
+
/** Content after the tabs, at the end of the row (e.g. a notes toggle). */
|
|
13
|
+
trailing?: React.ReactNode;
|
|
14
|
+
/** Classes for the row around the strip. */
|
|
15
|
+
rowClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The pinned tab row: the strip, inset like the content, 12px below what sits above it. */
|
|
18
|
+
declare const PanelTabsList: React.ForwardRefExoticComponent<PanelTabsListProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
/** A segmented pill tab. */
|
|
20
|
+
declare const PanelTabsTrigger: React.ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-tabs").TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
interface PanelTabsContentProps extends React.ComponentPropsWithoutRef<typeof TabsContent> {
|
|
22
|
+
/**
|
|
23
|
+
* Wraps the children in the standard padding: the content inset, pt-1.5 (12px
|
|
24
|
+
* below the tabs), and pb-6. Default true. Turn it off for content that pads
|
|
25
|
+
* itself (its first block must then start with the same 6px).
|
|
26
|
+
*/
|
|
27
|
+
padded?: boolean;
|
|
28
|
+
/** Classes for the padded wrapper (e.g. its own vertical rhythm). */
|
|
29
|
+
innerClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
/** The active tab's content. It is the scroll container, so the tab row stays pinned. */
|
|
32
|
+
declare const PanelTabsContent: React.ForwardRefExoticComponent<PanelTabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export { PanelTabs, PanelTabsContent, PanelTabsList, PanelTabsStrip, PanelTabsTrigger };
|
|
34
|
+
export type { PanelTabsContentProps, PanelTabsListProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../../lib/index.js";
|
|
4
|
+
import { ScrollableTabsList, Tabs, TabsContent, TabsTrigger } from "./tabs.js";
|
|
5
|
+
const PanelTabs = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Tabs, {
|
|
6
|
+
ref: ref,
|
|
7
|
+
"data-slot": "panel-tabs",
|
|
8
|
+
className: cn('flex min-h-0 flex-1 flex-col gap-1', className),
|
|
9
|
+
...props
|
|
10
|
+
}));
|
|
11
|
+
PanelTabs.displayName = 'PanelTabs';
|
|
12
|
+
const PanelTabsStrip = /*#__PURE__*/ forwardRef(({ className, containerClassName, scrollButtonClassName, ...props }, ref)=>/*#__PURE__*/ jsx(ScrollableTabsList, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
"data-slot": "panel-tabs-strip",
|
|
15
|
+
containerClassName: cn('w-auto', containerClassName),
|
|
16
|
+
className: cn('h-auto justify-start gap-0.5 rounded-lg bg-transparent p-0 text-muted-foreground', className),
|
|
17
|
+
scrollButtonClassName: cn('size-6 hover:bg-surface-overlay', scrollButtonClassName),
|
|
18
|
+
...props
|
|
19
|
+
}));
|
|
20
|
+
PanelTabsStrip.displayName = 'PanelTabsStrip';
|
|
21
|
+
const PanelTabsList = /*#__PURE__*/ forwardRef(({ trailing, rowClassName, className, containerClassName, ...props }, ref)=>/*#__PURE__*/ jsxs("div", {
|
|
22
|
+
"data-slot": "panel-tabs-list",
|
|
23
|
+
className: cn('flex shrink-0 items-center gap-2 pt-3 pb-0.5 [padding-inline:var(--mf-content-inset,0px)]', rowClassName),
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ jsx(PanelTabsStrip, {
|
|
26
|
+
ref: ref,
|
|
27
|
+
className: className,
|
|
28
|
+
containerClassName: cn('flex-1', containerClassName),
|
|
29
|
+
...props
|
|
30
|
+
}),
|
|
31
|
+
trailing
|
|
32
|
+
]
|
|
33
|
+
}));
|
|
34
|
+
PanelTabsList.displayName = 'PanelTabsList';
|
|
35
|
+
const PanelTabsTrigger = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(TabsTrigger, {
|
|
36
|
+
ref: ref,
|
|
37
|
+
"data-slot": "panel-tabs-trigger",
|
|
38
|
+
className: cn('inline-flex h-6 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-2.5 text-xs font-medium text-muted-foreground shadow-none transition-colors hover:text-foreground data-[state=active]:bg-surface-overlay data-[state=active]:text-foreground data-[state=active]:shadow-sm', className),
|
|
39
|
+
...props
|
|
40
|
+
}));
|
|
41
|
+
PanelTabsTrigger.displayName = 'PanelTabsTrigger';
|
|
42
|
+
const PanelTabsContent = /*#__PURE__*/ forwardRef(({ padded = true, innerClassName, className, children, ...props }, ref)=>/*#__PURE__*/ jsx(TabsContent, {
|
|
43
|
+
ref: ref,
|
|
44
|
+
"data-slot": "panel-tabs-content",
|
|
45
|
+
className: cn('mt-0 min-h-0 flex-1 overflow-auto', className),
|
|
46
|
+
...props,
|
|
47
|
+
children: padded ? /*#__PURE__*/ jsx("div", {
|
|
48
|
+
className: cn('pt-1.5 pb-6 [padding-inline:var(--mf-content-inset,0px)]', innerClassName),
|
|
49
|
+
children: children
|
|
50
|
+
}) : children
|
|
51
|
+
}));
|
|
52
|
+
PanelTabsContent.displayName = 'PanelTabsContent';
|
|
53
|
+
export { PanelTabs, PanelTabsContent, PanelTabsList, PanelTabsStrip, PanelTabsTrigger };
|