tfy-web-components 0.0.18 → 0.0.20
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/README.md +80 -0
- package/dist/..d.ts +46 -0
- package/dist/Accordion.d.ts +8 -9
- package/dist/Alert.d.ts +73 -0
- package/dist/AudioPlayer.d.ts +10 -0
- package/dist/Avatar.d.ts +19 -0
- package/dist/Badge.d.ts +2 -1
- package/dist/Button.d.ts +2 -2
- package/dist/CopyField.d.ts +3 -2
- package/dist/CustomDrawer.d.ts +8 -1
- package/dist/DropdownMenu.d.ts +25 -0
- package/dist/IconButton.d.ts +4 -2
- package/dist/ImagesPreview.d.ts +12 -0
- package/dist/Input-CnGhA18d.js +74283 -0
- package/dist/Input-CnGhA18d.js.map +1 -0
- package/dist/Markdown.d.ts +103 -0
- package/dist/Modal.d.ts +12 -0
- package/dist/MonacoEditorCore-xfpJ6z-E.js +113 -0
- package/dist/MonacoEditorCore-xfpJ6z-E.js.map +1 -0
- package/dist/OpenUiFenceBlock-CsVY6kwA.js +20 -0
- package/dist/OpenUiFenceBlock-CsVY6kwA.js.map +1 -0
- package/dist/OutlinedRadio.d.ts +9 -0
- package/dist/RootFontSizeContext-7vgn7Y_k.js +22 -0
- package/dist/RootFontSizeContext-7vgn7Y_k.js.map +1 -0
- package/dist/SimpleCodeEditor.d.ts +63 -0
- package/dist/Skeleton.d.ts +7 -0
- package/dist/ThumbsFeedback.d.ts +18 -0
- package/dist/ToggleButton.d.ts +42 -0
- package/dist/Tooltip.d.ts +9 -5
- package/dist/UserMessage.d.ts +15 -0
- package/dist/UserMessageEdit.d.ts +16 -0
- package/dist/_commonjsHelpers-DWwsNxpa.js +9 -0
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +1 -0
- package/dist/agent-chat.d.ts +222 -0
- package/dist/classNames-Dy-RXSjS.js +9 -0
- package/dist/{classNames-CC5emYUV.js.map → classNames-Dy-RXSjS.js.map} +1 -1
- package/dist/components/atoms/Accordion.d.ts +5 -6
- package/dist/components/atoms/Accordion.es.js +9 -7
- package/dist/components/atoms/Accordion.es.js.map +1 -1
- package/dist/components/atoms/AudioPlayer.d.ts +6 -0
- package/dist/components/atoms/AudioPlayer.es.js +1424 -0
- package/dist/components/atoms/AudioPlayer.es.js.map +1 -0
- package/dist/components/atoms/Avatar.d.ts +10 -0
- package/dist/components/atoms/Avatar.es.js +62 -0
- package/dist/components/atoms/Avatar.es.js.map +1 -0
- package/dist/components/atoms/Badge.d.ts +2 -1
- package/dist/components/atoms/Badge.es.js +9 -1
- package/dist/components/atoms/Badge.es.js.map +1 -1
- package/dist/components/atoms/Button.d.ts +2 -5
- package/dist/components/atoms/Button.es.js +2 -2
- package/dist/components/atoms/Button.es.js.map +1 -1
- package/dist/components/atoms/IconButton.d.ts +4 -2
- package/dist/components/atoms/IconButton.es.js +23 -7
- package/dist/components/atoms/IconButton.es.js.map +1 -1
- package/dist/components/atoms/IconProvider.es.js +28 -2
- package/dist/components/atoms/IconProvider.es.js.map +1 -1
- package/dist/components/atoms/Modal.d.ts +8 -0
- package/dist/components/atoms/Modal.es.js +19 -0
- package/dist/components/atoms/Modal.es.js.map +1 -0
- package/dist/components/atoms/OutlinedRadio.d.ts +5 -0
- package/dist/components/atoms/OutlinedRadio.es.js +29 -0
- package/dist/components/atoms/OutlinedRadio.es.js.map +1 -0
- package/dist/components/atoms/Skeleton.d.ts +4 -0
- package/dist/components/atoms/Skeleton.es.js +9 -0
- package/dist/components/atoms/Skeleton.es.js.map +1 -0
- package/dist/components/atoms/Spinner.es.js +1 -1
- package/dist/components/atoms/Switch.es.js +1 -18
- package/dist/components/atoms/Switch.es.js.map +1 -1
- package/dist/components/atoms/TabButton.es.js +1 -1
- package/dist/components/atoms/TabPanel.es.js +1 -1
- package/dist/components/atoms/Tooltip.d.ts +8 -5
- package/dist/components/atoms/Tooltip.es.js +1 -1
- package/dist/components/atoms/Tooltip.es.js.map +1 -1
- package/dist/components/molecules/Alert.d.ts +26 -0
- package/dist/components/molecules/Alert.es.js +135 -0
- package/dist/components/molecules/Alert.es.js.map +1 -0
- package/dist/components/molecules/CopyField.d.ts +1 -0
- package/dist/components/molecules/CopyField.es.js +12 -74192
- package/dist/components/molecules/CopyField.es.js.map +1 -1
- package/dist/components/molecules/CustomDrawer.d.ts +8 -1
- package/dist/components/molecules/CustomDrawer.es.js +118 -48
- package/dist/components/molecules/CustomDrawer.es.js.map +1 -1
- package/dist/components/molecules/Dialog.es.js +2570 -1519
- package/dist/components/molecules/Dialog.es.js.map +1 -1
- package/dist/components/molecules/DropdownMenu.d.ts +18 -0
- package/dist/components/molecules/DropdownMenu.es.js +104 -0
- package/dist/components/molecules/DropdownMenu.es.js.map +1 -0
- package/dist/components/molecules/ImagesPreview.d.ts +8 -0
- package/dist/components/molecules/ImagesPreview.es.js +186 -0
- package/dist/components/molecules/ImagesPreview.es.js.map +1 -0
- package/dist/components/molecules/Input.es.js +2 -2
- package/dist/components/molecules/Markdown.d.ts +1 -0
- package/dist/components/molecules/Markdown.es.js +345 -0
- package/dist/components/molecules/Markdown.es.js.map +1 -0
- package/dist/components/molecules/Notify.es.js +6 -1023
- package/dist/components/molecules/Notify.es.js.map +1 -1
- package/dist/components/molecules/SimpleCodeEditor.d.ts +56 -0
- package/dist/components/molecules/SimpleCodeEditor.es.js +784 -0
- package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -0
- package/dist/components/molecules/ThumbsFeedback.d.ts +13 -0
- package/dist/components/molecules/ThumbsFeedback.es.js +98 -0
- package/dist/components/molecules/ThumbsFeedback.es.js.map +1 -0
- package/dist/components/molecules/ToggleButton.d.ts +37 -0
- package/dist/components/molecules/ToggleButton.es.js +72 -0
- package/dist/components/molecules/ToggleButton.es.js.map +1 -0
- package/dist/components/molecules/agent-chat/UserMessage.d.ts +11 -0
- package/dist/components/molecules/agent-chat/UserMessage.es.js +40 -0
- package/dist/components/molecules/agent-chat/UserMessage.es.js.map +1 -0
- package/dist/components/molecules/agent-chat/UserMessageEdit.d.ts +12 -0
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js +33 -0
- package/dist/components/molecules/agent-chat/UserMessageEdit.es.js.map +1 -0
- package/dist/components/molecules/agent-chat.d.ts +1 -0
- package/dist/components/molecules/agent-chat.es.js +935 -0
- package/dist/components/molecules/agent-chat.es.js.map +1 -0
- package/dist/components/theme/index.d.ts +1 -0
- package/dist/components/theme/index.es.js +3 -1
- package/dist/components/theme/index.es.js.map +1 -1
- package/dist/components/theme/theme.d.ts +1 -0
- package/dist/components/theme/theme.es.js +12 -1
- package/dist/components/theme/theme.es.js.map +1 -1
- package/dist/components/theme/useTheme.d.ts +7 -0
- package/dist/components/theme/useTheme.es.js +35 -20
- package/dist/components/theme/useTheme.es.js.map +1 -1
- package/dist/components/theme/utils.es.js +1 -1
- package/dist/index.es.js +12 -4
- package/dist/index.es.js.map +1 -1
- package/dist/{isTypedArray-CoDTnA8U.js → isTypedArray-CLAk7Q1f.js} +30 -30
- package/dist/isTypedArray-CLAk7Q1f.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tailwindPreset.d.ts +140 -0
- package/dist/tailwindPreset.es.js +100 -0
- package/dist/tailwindPreset.es.js.map +1 -0
- package/dist/theme.css +163 -0
- package/dist/theme.d.ts +2 -0
- package/dist/useTheme.d.ts +7 -0
- package/package.json +49 -3
- package/dist/_commonjsHelpers-CcAunmGO.js +0 -34
- package/dist/_commonjsHelpers-CcAunmGO.js.map +0 -1
- package/dist/classNames-CC5emYUV.js +0 -9
- package/dist/isTypedArray-CoDTnA8U.js.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
import ReactMarkdown from 'react-markdown';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Registers a fenced-code renderer for a language id. `content` and `darkTheme` are always
|
|
6
|
+
* supplied by the markdown layer; `componentProps` are merged first so the fence wins for those keys.
|
|
7
|
+
*/
|
|
8
|
+
export declare type CodeFenceBlockDefinition = {
|
|
9
|
+
Component: React_2.ComponentType<FencedCodeBlockProps>;
|
|
10
|
+
componentProps?: Partial<Omit<FencedCodeBlockProps, 'content' | 'darkTheme'>>;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** Maps language ids (e.g. `openui` from `language-openui`) to a block definition. */
|
|
14
|
+
export declare type CodeFencingConfig = Partial<Record<string, CodeFenceBlockDefinition>>;
|
|
15
|
+
|
|
16
|
+
export declare type FencedCodeBlockProps = {
|
|
17
|
+
isStreaming?: boolean;
|
|
18
|
+
/** Optional base URL for fenced blocks that expose downloads (e.g. sandbox artifacts). */
|
|
19
|
+
fileDownloadBaseUrl?: string;
|
|
20
|
+
/** When true, download actions inside fenced blocks are hidden/disabled. */
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
/** Custom download handler that receives the original sandbox artifact path. */
|
|
23
|
+
onDownloadArtifact?: (path: string, filename: string) => Promise<void>;
|
|
24
|
+
/** Custom download handler for fenced blocks that expose file downloads. */
|
|
25
|
+
onDownloadFile?: (url: string, filename: string) => Promise<void>;
|
|
26
|
+
content: string;
|
|
27
|
+
darkTheme?: boolean;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare enum InfoType {
|
|
31
|
+
SUCCESS = "success",
|
|
32
|
+
ERROR = "error",
|
|
33
|
+
WARNING = "warning",
|
|
34
|
+
DEFAULT = "default",
|
|
35
|
+
DESCRIPTION = "description"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare type MarkdownProps = Omit<React_2.ComponentProps<typeof ReactMarkdown>, 'components'> & {
|
|
39
|
+
className?: string;
|
|
40
|
+
type?: InfoType;
|
|
41
|
+
codeFileName?: string;
|
|
42
|
+
darkTheme?: boolean;
|
|
43
|
+
bodyClass?: string;
|
|
44
|
+
skipLanguageMatch?: boolean;
|
|
45
|
+
isReadme?: boolean;
|
|
46
|
+
isMathPluginEnabled?: boolean;
|
|
47
|
+
codeStyle?: React_2.CSSProperties;
|
|
48
|
+
showCopyLabel?: boolean;
|
|
49
|
+
showCopyOutside?: boolean;
|
|
50
|
+
customStyles?: Record<string, any>;
|
|
51
|
+
enableCopy?: boolean;
|
|
52
|
+
codeFencingConfig?: CodeFencingConfig;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Markdown with optional OpenUI fenced blocks (` ```openui `).
|
|
57
|
+
* OpenUI dependencies load only when the markdown string contains such a fence, or when
|
|
58
|
+
* {@link preloadMarkdownOpenUI} has been called earlier.
|
|
59
|
+
*/
|
|
60
|
+
export declare const MarkdownWithOpenUI: React_2.FC<MarkdownWithOpenUIProps>;
|
|
61
|
+
|
|
62
|
+
export declare type MarkdownWithOpenUIProps = Omit<MarkdownProps, 'codeFencingConfig'> & {
|
|
63
|
+
/** Forwarded into the OpenUI fence block (e.g. streaming assistant output). */
|
|
64
|
+
isStreaming?: boolean;
|
|
65
|
+
/** Base URL for resolving sandbox artifact download paths (e.g. gateway file endpoint). */
|
|
66
|
+
fileDownloadBaseUrl?: string;
|
|
67
|
+
/** When true, download actions in sandbox artifact blocks are hidden/disabled. */
|
|
68
|
+
readOnly?: boolean;
|
|
69
|
+
/** Custom download handler that receives the original sandbox artifact path. */
|
|
70
|
+
onDownloadArtifact?: (path: string, filename: string) => Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Custom download handler forwarded to sandbox artifact blocks.
|
|
73
|
+
* Receives the resolved URL and suggested filename.
|
|
74
|
+
*/
|
|
75
|
+
onDownloadFile?: (url: string, filename: string) => Promise<void>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Parses a `sandbox_artifacts` fence body into an ordered list of `{ name, path }` files.
|
|
80
|
+
*
|
|
81
|
+
* Expected lines look like `[add.py](/tmp/add.py)`; multiple entries may be separated by newlines.
|
|
82
|
+
* The optional leading `sandbox_artifacts` literal is stripped before pair extraction for
|
|
83
|
+
* backwards compatibility with inline `sandbox_artifacts[...](...)...` bodies.
|
|
84
|
+
*
|
|
85
|
+
* Pairs with empty `name` or empty `path` are dropped, which also ignores incomplete trailing
|
|
86
|
+
* tokens like `[a]` without a following `(...)`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function parseSandboxArtifacts(content: string): SandboxArtifactFile[];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Same module as the lazy OpenUI fence block; call to preload OpenUI (react-lang, react-ui, CSS)
|
|
92
|
+
* before markdown is known to contain ```openui fences — e.g. when opening the playground chat.
|
|
93
|
+
*/
|
|
94
|
+
export declare const preloadMarkdownOpenUI: () => Promise<{
|
|
95
|
+
default: React_2.ComponentType<any>;
|
|
96
|
+
}>;
|
|
97
|
+
|
|
98
|
+
export declare type SandboxArtifactFile = {
|
|
99
|
+
name: string;
|
|
100
|
+
path: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export { }
|
package/dist/Modal.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import MuiModal from '@mui/material/Modal';
|
|
2
|
+
import { default as React_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const Modal: React_2.FC<ModalProps>;
|
|
5
|
+
export default Modal;
|
|
6
|
+
|
|
7
|
+
export declare interface ModalProps extends React_2.ComponentProps<typeof MuiModal> {
|
|
8
|
+
children: JSX.Element;
|
|
9
|
+
disableEnforceFocus?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { }
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState, useLayoutEffect } from "react";
|
|
3
|
+
import * as monaco from "monaco-editor";
|
|
4
|
+
function useFontReady(spec) {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
if (document.fonts.check(spec)) {
|
|
7
|
+
monaco.editor.remeasureFonts();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
document.fonts.load(spec).then(() => monaco.editor.remeasureFonts()).catch(() => {
|
|
11
|
+
return;
|
|
12
|
+
});
|
|
13
|
+
}, [spec]);
|
|
14
|
+
}
|
|
15
|
+
function MonacoEditorCore({
|
|
16
|
+
defaultLanguage,
|
|
17
|
+
defaultValue,
|
|
18
|
+
value,
|
|
19
|
+
className,
|
|
20
|
+
onChange,
|
|
21
|
+
onMount,
|
|
22
|
+
beforeMount,
|
|
23
|
+
theme,
|
|
24
|
+
options,
|
|
25
|
+
onValidate
|
|
26
|
+
}) {
|
|
27
|
+
const containerRef = useRef(null);
|
|
28
|
+
const editorRef = useRef(null);
|
|
29
|
+
const onChangeRef = useRef(onChange);
|
|
30
|
+
const onValidateRef = useRef(onValidate);
|
|
31
|
+
const beforeMountRef = useRef(beforeMount);
|
|
32
|
+
const onMountRef = useRef(onMount);
|
|
33
|
+
const optionsRef = useRef(options);
|
|
34
|
+
const preventTriggerChangeEventRef = useRef(false);
|
|
35
|
+
const [initError, setInitError] = useState(null);
|
|
36
|
+
useFontReady(`${options == null ? void 0 : options.fontWeight} ${(options == null ? void 0 : options.fontSize) || 14}px "${options == null ? void 0 : options.fontFamily}"`);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
onChangeRef.current = onChange;
|
|
39
|
+
onValidateRef.current = onValidate;
|
|
40
|
+
beforeMountRef.current = beforeMount;
|
|
41
|
+
onMountRef.current = onMount;
|
|
42
|
+
optionsRef.current = options;
|
|
43
|
+
});
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
var _a;
|
|
46
|
+
if (!containerRef.current) return;
|
|
47
|
+
setInitError(null);
|
|
48
|
+
let disposeValidate;
|
|
49
|
+
try {
|
|
50
|
+
window.monaco = monaco;
|
|
51
|
+
beforeMountRef.current(monaco);
|
|
52
|
+
const initialValue = value !== void 0 ? value : defaultValue !== void 0 ? defaultValue : "";
|
|
53
|
+
editorRef.current = monaco.editor.create(containerRef.current, {
|
|
54
|
+
...optionsRef.current,
|
|
55
|
+
value: initialValue,
|
|
56
|
+
language: defaultLanguage,
|
|
57
|
+
theme
|
|
58
|
+
});
|
|
59
|
+
(_a = editorRef.current) == null ? void 0 : _a.onDidChangeModelContent(() => {
|
|
60
|
+
var _a2, _b, _c;
|
|
61
|
+
if (preventTriggerChangeEventRef.current) return;
|
|
62
|
+
(_c = onChangeRef.current) == null ? void 0 : _c.call(onChangeRef, (_b = (_a2 = editorRef.current) == null ? void 0 : _a2.getModel()) == null ? void 0 : _b.getValue());
|
|
63
|
+
});
|
|
64
|
+
if (onValidateRef.current) {
|
|
65
|
+
const disposable = monaco.editor.onDidChangeMarkers((uris) => {
|
|
66
|
+
var _a2, _b;
|
|
67
|
+
const model = (_a2 = editorRef.current) == null ? void 0 : _a2.getModel();
|
|
68
|
+
if (model && uris.includes(model.uri)) {
|
|
69
|
+
const markers = monaco.editor.getModelMarkers({
|
|
70
|
+
resource: model.uri
|
|
71
|
+
});
|
|
72
|
+
(_b = onValidateRef.current) == null ? void 0 : _b.call(onValidateRef, markers);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
disposeValidate = () => disposable.dispose();
|
|
76
|
+
}
|
|
77
|
+
onMountRef.current(editorRef.current, monaco);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
setInitError(err instanceof Error ? err : new Error(String(err)));
|
|
80
|
+
}
|
|
81
|
+
return () => {
|
|
82
|
+
var _a2;
|
|
83
|
+
disposeValidate == null ? void 0 : disposeValidate();
|
|
84
|
+
(_a2 = editorRef.current) == null ? void 0 : _a2.dispose();
|
|
85
|
+
editorRef.current = null;
|
|
86
|
+
};
|
|
87
|
+
}, [defaultLanguage, theme]);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
var _a;
|
|
90
|
+
if (value === void 0) return;
|
|
91
|
+
const model = (_a = editorRef.current) == null ? void 0 : _a.getModel();
|
|
92
|
+
if (model && model.getValue() !== value) {
|
|
93
|
+
preventTriggerChangeEventRef.current = true;
|
|
94
|
+
model.setValue(value);
|
|
95
|
+
preventTriggerChangeEventRef.current = false;
|
|
96
|
+
}
|
|
97
|
+
}, [value]);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
var _a;
|
|
100
|
+
(_a = editorRef.current) == null ? void 0 : _a.updateOptions(options);
|
|
101
|
+
}, [options]);
|
|
102
|
+
if (initError) {
|
|
103
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex h-full w-full items-center justify-center text-xs text-gray-500 ${className ?? ""}`, children: [
|
|
104
|
+
"Failed to load editor: ",
|
|
105
|
+
initError.message
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
return /* @__PURE__ */ jsx("div", { ref: containerRef, className: `h-full w-full ${className ?? ""}` });
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
MonacoEditorCore as default
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=MonacoEditorCore-xfpJ6z-E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonacoEditorCore-xfpJ6z-E.js","sources":["../src/components/molecules/monacoEditorCore/useFontReady.ts","../src/components/molecules/monacoEditorCore/MonacoEditorCore.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport * as monaco from 'monaco-editor'\n\nexport function useFontReady(spec: string): void {\n useEffect(() => {\n if (document.fonts.check(spec)) {\n monaco.editor.remeasureFonts()\n return\n }\n document.fonts\n .load(spec)\n .then(() => monaco.editor.remeasureFonts())\n .catch(() => {\n return\n })\n }, [spec])\n}\n","import { useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport * as monaco from 'monaco-editor'\n\nimport { useFontReady } from './useFontReady'\n\ntype MonacoWindow = Window & { monaco?: typeof monaco }\n\nexport interface MonacoEditorCoreProps {\n defaultLanguage: string\n defaultValue?: string\n value?: string\n className?: string\n onChange?: (value: string | undefined) => void\n onMount: (editor: monaco.editor.IStandaloneCodeEditor, monacoInstance: typeof monaco) => void\n beforeMount: (monacoInstance: typeof monaco) => void // must be synchronous\n theme: string\n options: monaco.editor.IStandaloneEditorConstructionOptions\n onValidate?: (errors: unknown) => void\n}\n\nexport default function MonacoEditorCore({\n defaultLanguage,\n defaultValue,\n value,\n className,\n onChange,\n onMount,\n beforeMount,\n theme,\n options,\n onValidate,\n}: MonacoEditorCoreProps) {\n const containerRef = useRef<HTMLDivElement>(null)\n const editorRef = useRef<monaco.editor.IStandaloneCodeEditor | null>(null)\n const onChangeRef = useRef(onChange)\n const onValidateRef = useRef(onValidate)\n const beforeMountRef = useRef(beforeMount)\n const onMountRef = useRef(onMount)\n const optionsRef = useRef(options)\n const preventTriggerChangeEventRef = useRef(false)\n const [initError, setInitError] = useState<Error | null>(null)\n\n useFontReady(`${options?.fontWeight} ${options?.fontSize || 14}px \"${options?.fontFamily}\"`)\n\n // Keep refs in sync with the latest props without triggering re-renders.\n useLayoutEffect(() => {\n onChangeRef.current = onChange\n onValidateRef.current = onValidate\n beforeMountRef.current = beforeMount\n onMountRef.current = onMount\n optionsRef.current = options\n })\n\n useEffect(() => {\n if (!containerRef.current) return\n setInitError(null)\n\n let disposeValidate: (() => void) | undefined\n\n try {\n ;(window as MonacoWindow).monaco = monaco\n beforeMountRef.current(monaco)\n\n const initialValue = value !== undefined ? value : defaultValue !== undefined ? defaultValue : ''\n\n editorRef.current = monaco.editor.create(containerRef.current, {\n ...optionsRef.current,\n value: initialValue,\n language: defaultLanguage,\n theme,\n })\n\n editorRef.current?.onDidChangeModelContent(() => {\n if (preventTriggerChangeEventRef.current) return\n onChangeRef.current?.(editorRef.current?.getModel()?.getValue())\n })\n\n if (onValidateRef.current) {\n const disposable = monaco.editor.onDidChangeMarkers((uris: readonly monaco.Uri[]) => {\n const model = editorRef.current?.getModel()\n if (model && uris.includes(model.uri)) {\n const markers = monaco.editor.getModelMarkers({\n resource: model.uri,\n })\n onValidateRef.current?.(markers)\n }\n })\n disposeValidate = () => disposable.dispose()\n }\n\n onMountRef.current(editorRef.current, monaco)\n } catch (err) {\n setInitError(err instanceof Error ? err : new Error(String(err)))\n }\n\n return () => {\n disposeValidate?.()\n editorRef.current?.dispose()\n editorRef.current = null\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- Intentionally only recreate when language or theme changes.\n }, [defaultLanguage, theme])\n\n // Controlled value sync – suppress onChange when we set value programmatically\n useEffect(() => {\n if (value === undefined) return\n const model = editorRef.current?.getModel()\n if (model && model.getValue() !== value) {\n preventTriggerChangeEventRef.current = true\n model.setValue(value)\n preventTriggerChangeEventRef.current = false\n }\n }, [value])\n\n // Apply options updates to the live editor without recreating it\n useEffect(() => {\n editorRef.current?.updateOptions(options)\n }, [options])\n\n if (initError) {\n return (\n <div className={`flex h-full w-full items-center justify-center text-xs text-gray-500 ${className ?? ''}`}>\n Failed to load editor: {initError.message}\n </div>\n )\n }\n\n return <div ref={containerRef} className={`h-full w-full ${className ?? ''}`} />\n}\n"],"names":["_a"],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Renderer } from "@openuidev/react-lang";
|
|
3
|
+
import { ThemeProvider, openuiLibrary } from "@openuidev/react-ui";
|
|
4
|
+
import { c as classNames } from "./classNames-Dy-RXSjS.js";
|
|
5
|
+
const OpenUiFenceBlock = ({ isStreaming = false, content, darkTheme = true }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
className: classNames(
|
|
10
|
+
"mb-2 min-h-32 w-full min-w-0 rounded-md border p-2",
|
|
11
|
+
darkTheme ? "border-gray-600/50 bg-gray-900/40" : "border-gray-200 bg-white shadow-sm"
|
|
12
|
+
),
|
|
13
|
+
children: /* @__PURE__ */ jsx(ThemeProvider, { mode: darkTheme ? "dark" : "light", cssSelector: ".markdown-openui-scope", children: /* @__PURE__ */ jsx("div", { className: "markdown-openui-scope min-w-0", children: /* @__PURE__ */ jsx(Renderer, { response: content, library: openuiLibrary, isStreaming }) }) })
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
OpenUiFenceBlock as default
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=OpenUiFenceBlock-CsVY6kwA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenUiFenceBlock-CsVY6kwA.js","sources":["../src/components/molecules/Markdown/OpenUiFenceBlock.tsx"],"sourcesContent":["import React from 'react'\nimport { Renderer } from '@openuidev/react-lang'\nimport { openuiLibrary, ThemeProvider } from '@openuidev/react-ui'\n\nimport classNames from '@/utils/classNames'\n\nimport type { FencedCodeBlockProps } from './codeFencing'\n\nimport '@openuidev/react-ui/defaults.css'\nimport '@openuidev/react-ui/components.css'\n\n/**\n * Renders ```openui … ``` using the official OpenUI component library and theme.\n * Loaded only via dynamic import (see MarkdownWithOpenUI).\n * @see https://www.openui.com/docs/openui-lang\n */\nconst OpenUiFenceBlock: React.FC<FencedCodeBlockProps> = ({ isStreaming = false, content, darkTheme = true }) => {\n return (\n <div\n className={classNames(\n 'mb-2 min-h-32 w-full min-w-0 rounded-md border p-2',\n darkTheme ? 'border-gray-600/50 bg-gray-900/40' : 'border-gray-200 bg-white shadow-sm',\n )}\n >\n <ThemeProvider mode={darkTheme ? 'dark' : 'light'} cssSelector=\".markdown-openui-scope\">\n <div className=\"markdown-openui-scope min-w-0\">\n <Renderer response={content} library={openuiLibrary} isStreaming={isStreaming} />\n </div>\n </ThemeProvider>\n </div>\n )\n}\n\nexport default OpenUiFenceBlock\n"],"names":[],"mappings":";;;;AAgBA,MAAM,mBAAmD,CAAC,EAAE,cAAc,OAAO,SAAS,YAAY,WAAW;AAC/G,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,YAAY,sCAAsC;AAAA,MAAA;AAAA,MAGpD,UAAA,oBAAC,iBAAc,MAAM,YAAY,SAAS,SAAS,aAAY,0BAC7D,UAAA,oBAAC,OAAA,EAAI,WAAU,iCACb,UAAA,oBAAC,YAAS,UAAU,SAAS,SAAS,eAAe,YAAA,CAA0B,GACjF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RadioProps } from '@mui/material/Radio';
|
|
2
|
+
import { default as React_2 } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const OutlinedRadio: React_2.FC<OutlinedRadioProps>;
|
|
5
|
+
export default OutlinedRadio;
|
|
6
|
+
|
|
7
|
+
export declare type OutlinedRadioProps = Omit<RadioProps, 'icon' | 'checkedIcon'>;
|
|
8
|
+
|
|
9
|
+
export { }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useContext, createContext } from "react";
|
|
2
|
+
const getRootFontSize = () => {
|
|
3
|
+
const width = window.innerWidth;
|
|
4
|
+
switch (true) {
|
|
5
|
+
case width >= 3840:
|
|
6
|
+
return 32;
|
|
7
|
+
case width >= 2880:
|
|
8
|
+
return 24;
|
|
9
|
+
case width >= 2400:
|
|
10
|
+
return 20;
|
|
11
|
+
default:
|
|
12
|
+
return 16;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const RootFontSizeContext = createContext({
|
|
16
|
+
rootFontSize: getRootFontSize()
|
|
17
|
+
});
|
|
18
|
+
const useRootFontSize = () => useContext(RootFontSizeContext);
|
|
19
|
+
export {
|
|
20
|
+
useRootFontSize as u
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=RootFontSizeContext-7vgn7Y_k.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RootFontSizeContext-7vgn7Y_k.js","sources":["../src/utils/getRootFontSize.ts","../src/contexts/RootFontSizeContext.tsx"],"sourcesContent":["const getRootFontSize = (): number => {\n const width = window.innerWidth\n switch (true) {\n case width >= 3840:\n return 32\n case width >= 2880:\n return 24\n case width >= 2400:\n return 20\n default:\n return 16\n }\n}\n\nexport default getRootFontSize\n","import React, { createContext, useContext, useEffect, useState } from 'react'\nimport _throttle from 'lodash-es/throttle'\n\nimport getRootFontSize from '@/utils/getRootFontSize'\n\ninterface RootFontSizeContextType {\n rootFontSize: number\n}\n\nconst RootFontSizeContext = createContext<RootFontSizeContextType>({\n rootFontSize: getRootFontSize(),\n})\n\nexport const useRootFontSize = () => useContext(RootFontSizeContext)\n\nexport const RootFontSizeProvider: React.FC<React.PropsWithChildren> = ({ children }) => {\n const [fontSize, setFontSize] = useState(getRootFontSize())\n\n useEffect(() => {\n const handleResize = () => {\n const newFontSize = getRootFontSize()\n // Only when a breakpoint is crossed, call setState\n if (newFontSize !== fontSize) {\n setFontSize(newFontSize)\n }\n }\n const throttledHandleResize = _throttle(handleResize, 1000)\n\n window.addEventListener('resize', throttledHandleResize)\n return () => window.removeEventListener('resize', throttledHandleResize)\n }, [fontSize])\n\n return <RootFontSizeContext.Provider value={{ rootFontSize: fontSize }}>{children}</RootFontSizeContext.Provider>\n}\n"],"names":[],"mappings":";AAAA,MAAM,kBAAkB,MAAc;AACpC,QAAM,QAAQ,OAAO;AACrB,UAAQ,MAAA;AAAA,IACN,KAAK,SAAS;AACZ,aAAO;AAAA,IACT,KAAK,SAAS;AACZ,aAAO;AAAA,IACT,KAAK,SAAS;AACZ,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;ACHA,MAAM,sBAAsB,cAAuC;AAAA,EACjE,cAAc,gBAAA;AAChB,CAAC;AAEM,MAAM,kBAAkB,MAAM,WAAW,mBAAmB;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const importEditor: () => Promise<{
|
|
4
|
+
default: React_2.ComponentType<any>;
|
|
5
|
+
}>;
|
|
6
|
+
|
|
7
|
+
declare function SimpleCodeEditor({ defaultValue, value, language, readOnly, className, expandDataTestId, height, maxHeight, enableCopy, enableDownload, downloadName, hideLineNumbers, isFoldingEnabled, enableExpand, fullHeight, autoLayout, fontSize, tabSize, showToolsOnHover, onChange, alwaysConsumeMouseWheel, enableWordWrap, initialLinesCount, placeholder, placeholderClassName, autoFocus, onlyCopyIcon, openAsFullscreen, dataTestPrefix, renderIndentGuides, enableLineCopy, onMinimise, disableEditorResize, codeToCopy, extraButtons, onValidate, showExpandOverlay, softMaxHeight, darkModeBgColor, showExpandOnlyInFullscreen, hideHorizontalScrollbar, onPaste, enableLineNumbersForText, enableLineHighlight, onEditorReady, isPrivate, }: SimpleCodeEditorProps): React_2.JSX.Element;
|
|
8
|
+
export default SimpleCodeEditor;
|
|
9
|
+
|
|
10
|
+
export declare interface SimpleCodeEditorProps {
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
language: string;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
height?: string | number;
|
|
17
|
+
maxHeight?: number;
|
|
18
|
+
enableCopy?: boolean;
|
|
19
|
+
enableDownload?: boolean;
|
|
20
|
+
expandDataTestId?: string;
|
|
21
|
+
downloadName?: string;
|
|
22
|
+
hideLineNumbers?: boolean;
|
|
23
|
+
isFoldingEnabled?: boolean;
|
|
24
|
+
enableExpand?: boolean;
|
|
25
|
+
fullHeight?: boolean;
|
|
26
|
+
autoLayout?: boolean;
|
|
27
|
+
fontSize?: number;
|
|
28
|
+
tabSize?: number;
|
|
29
|
+
showToolsOnHover?: boolean;
|
|
30
|
+
onChange?: (value?: string) => void;
|
|
31
|
+
alwaysConsumeMouseWheel?: boolean;
|
|
32
|
+
enableWordWrap?: boolean;
|
|
33
|
+
initialLinesCount?: number;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
placeholderClassName?: string;
|
|
36
|
+
autoFocus?: boolean;
|
|
37
|
+
onlyCopyIcon?: boolean;
|
|
38
|
+
openAsFullscreen?: boolean;
|
|
39
|
+
dataTestPrefix?: string;
|
|
40
|
+
renderIndentGuides?: boolean;
|
|
41
|
+
enableLineCopy?: boolean;
|
|
42
|
+
onMinimise?: () => void;
|
|
43
|
+
disableEditorResize?: boolean;
|
|
44
|
+
codeToCopy?: string;
|
|
45
|
+
extraButtons?: React_2.ReactNode | null;
|
|
46
|
+
onValidate?: (errors: any) => void;
|
|
47
|
+
showExpandOverlay?: boolean;
|
|
48
|
+
softMaxHeight?: number | null;
|
|
49
|
+
darkModeBgColor?: string;
|
|
50
|
+
showExpandOnlyInFullscreen?: boolean;
|
|
51
|
+
hideHorizontalScrollbar?: boolean;
|
|
52
|
+
enableLineNumbersForText?: boolean;
|
|
53
|
+
enableLineHighlight?: boolean;
|
|
54
|
+
onPaste?: (value: string) => void;
|
|
55
|
+
onEditorReady?: (editor: {
|
|
56
|
+
focus: () => void;
|
|
57
|
+
}) => void;
|
|
58
|
+
isPrivate?: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare const usePreloadEditor: () => null;
|
|
62
|
+
|
|
63
|
+
export { }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const ThumbsFeedback: React_2.FC<ThumbsFeedbackProps>;
|
|
4
|
+
export default ThumbsFeedback;
|
|
5
|
+
|
|
6
|
+
export declare interface ThumbsFeedbackProps {
|
|
7
|
+
value: ThumbsFeedbackValue;
|
|
8
|
+
onChange: (value: ThumbsFeedbackValue) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** If true, clicking the active thumb clears the selection. Defaults to true. */
|
|
12
|
+
allowClear?: boolean;
|
|
13
|
+
size?: 'sm' | 'md';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare type ThumbsFeedbackValue = 'up' | 'down' | null;
|
|
17
|
+
|
|
18
|
+
export { }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare type ListButtonProps = {
|
|
4
|
+
text: string;
|
|
5
|
+
value: string;
|
|
6
|
+
dataTestId?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
tooltip?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
activeClassName?: string;
|
|
11
|
+
unactiveClassName?: string;
|
|
12
|
+
options?: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
declare function ToggleButton({ buttonList, value, onChange, className, size, renderDropdown }: ToggleButtonProps): React_2.JSX.Element;
|
|
19
|
+
export default ToggleButton;
|
|
20
|
+
|
|
21
|
+
export declare type ToggleButtonProps = {
|
|
22
|
+
buttonList: ListButtonProps[];
|
|
23
|
+
value: string;
|
|
24
|
+
onChange: (value: string, ev: React_2.MouseEvent<HTMLButtonElement>) => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
size?: 'small' | 'medium';
|
|
27
|
+
/**
|
|
28
|
+
* Render prop for dropdown buttons (when `options` is set on a list item).
|
|
29
|
+
* The consumer provides their own Menu/popover implementation.
|
|
30
|
+
* If not provided, dropdown items are rendered as plain buttons.
|
|
31
|
+
*/
|
|
32
|
+
renderDropdown?: (props: {
|
|
33
|
+
button: ListButtonProps;
|
|
34
|
+
isActive: boolean;
|
|
35
|
+
activeClassName: string;
|
|
36
|
+
inactiveClassName: string;
|
|
37
|
+
buttonClassName: string;
|
|
38
|
+
onChange: (value: string, ev: React_2.MouseEvent<HTMLButtonElement>) => void;
|
|
39
|
+
}) => React_2.ReactNode;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { }
|
package/dist/Tooltip.d.ts
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import { MUIStyledCommonProps } from '@mui/system';
|
|
2
2
|
import * as React_2 from 'react';
|
|
3
3
|
import { Theme } from '@mui/material';
|
|
4
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
+
import { TooltipProps as TooltipProps_2 } from '@mui/material/Tooltip';
|
|
5
5
|
|
|
6
|
-
export declare type CustomTooltipProps =
|
|
6
|
+
export declare type CustomTooltipProps = TooltipProps_2 & {
|
|
7
7
|
size?: Sizes;
|
|
8
8
|
border?: boolean;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export declare const DarkTooltip: React_2.NamedExoticComponent<
|
|
11
|
+
export declare const DarkTooltip: React_2.NamedExoticComponent<TooltipProps_2 & {
|
|
12
12
|
size?: Sizes | undefined;
|
|
13
13
|
border?: boolean | undefined;
|
|
14
14
|
} & MUIStyledCommonProps<Theme>>;
|
|
15
15
|
|
|
16
|
-
export declare const LightTooltip: React_2.NamedExoticComponent<
|
|
16
|
+
export declare const LightTooltip: React_2.NamedExoticComponent<TooltipProps_2 & {
|
|
17
17
|
size?: Sizes | undefined;
|
|
18
18
|
border?: boolean | undefined;
|
|
19
19
|
} & MUIStyledCommonProps<Theme>>;
|
|
20
20
|
|
|
21
21
|
export declare type Sizes = 'large' | 'variable' | 'medium' | 'fit';
|
|
22
22
|
|
|
23
|
-
export declare
|
|
23
|
+
export declare type TooltipProps = Partial<Pick<CustomTooltipProps, 'title' | 'placement' | 'size'>> & {
|
|
24
|
+
disabledTitle?: React_2.ReactNode;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export declare const UnstyledTooltip: React_2.NamedExoticComponent<TooltipProps_2 & {
|
|
24
28
|
size?: Sizes | undefined;
|
|
25
29
|
border?: boolean | undefined;
|
|
26
30
|
} & MUIStyledCommonProps<Theme>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const UserMessage: React_2.FC<UserMessageProps>;
|
|
4
|
+
export default UserMessage;
|
|
5
|
+
|
|
6
|
+
export declare interface UserMessageProps {
|
|
7
|
+
text: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Edit button — glue passes ActionBarPrimitive.Edit or a styled button */
|
|
10
|
+
editAction?: React_2.ReactNode;
|
|
11
|
+
/** When true, action row stays visible instead of hover-reveal. */
|
|
12
|
+
actionsAlwaysVisible?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React_2 } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const UserMessageEdit: React_2.ForwardRefExoticComponent<UserMessageEditProps & React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export default UserMessageEdit;
|
|
5
|
+
|
|
6
|
+
export declare interface UserMessageEditProps {
|
|
7
|
+
/** Timestamp node rendered beside the "User" label (e.g. MessageTimestamp from the host app). */
|
|
8
|
+
timestamp?: React_2.ReactNode;
|
|
9
|
+
/** Read-only attachments shown above the input while editing. */
|
|
10
|
+
attachments?: React_2.ReactNode;
|
|
11
|
+
input: React_2.ReactNode;
|
|
12
|
+
footer: React_2.ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { }
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2
|
+
function getDefaultExportFromCjs(x) {
|
|
3
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
commonjsGlobal as c,
|
|
7
|
+
getDefaultExportFromCjs as g
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=_commonjsHelpers-DWwsNxpa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers-DWwsNxpa.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|