@yuntijs/ui 1.0.0-beta.99 → 1.1.0-beta.1
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/es/ChatItem/index.js +6 -2
- package/es/ChatItem/type.d.ts +1 -0
- package/es/ChatMarkdown/MarkdownElements/AntThinking/Component.js +6 -6
- package/es/ChatMarkdown/MarkdownElements/AntThinking/remarkPlugin.js +1 -1
- package/es/ChatMarkdown/utils.js +8 -3
- package/es/CodeEditor/index.d.ts +52 -0
- package/es/CodeEditor/index.js +418 -0
- package/es/CodeEditor/style.d.ts +9 -0
- package/es/CodeEditor/style.js +19 -0
- package/es/CollapseGroup/index.js +20 -4
- package/es/CollapseGroup/style.d.ts +3 -1
- package/es/CollapseGroup/style.js +3 -2
- package/es/Form/collapse-list/FieldsWatcher.d.ts +7 -0
- package/es/Form/collapse-list/FieldsWatcher.js +19 -0
- package/es/Form/collapse-list/hooks.d.ts +20 -0
- package/es/Form/collapse-list/hooks.js +158 -0
- package/es/Form/collapse-list/index.d.ts +19 -6
- package/es/Form/collapse-list/index.js +163 -59
- package/es/Form/collapse-list/style.d.ts +1 -0
- package/es/Form/collapse-list/style.js +4 -3
- package/es/Form/collapse-list/utils.d.ts +10 -0
- package/es/Form/collapse-list/utils.js +4 -0
- package/es/JsonViewer/index.d.ts +1 -0
- package/es/JsonViewer/index.js +1 -0
- package/es/Mentions/index.d.ts +2 -0
- package/es/Mentions/index.js +17 -2
- package/es/Mentions/plugins/mention-node/component.js +1 -1
- package/es/Mentions/plugins/mention-picker/hooks.js +1 -0
- package/es/Mentions/plugins/mention-picker/index.d.ts +4 -0
- package/es/Mentions/plugins/mention-picker/index.js +49 -12
- package/es/Mentions/plugins/mention-picker/menu-item.js +19 -3
- package/es/Mentions/plugins/mention-picker/style.js +1 -1
- package/es/Mentions/plugins/mention-picker/utils.d.ts +3 -1
- package/es/Mentions/plugins/mention-picker/utils.js +3 -0
- package/es/Mentions/style.d.ts +1 -0
- package/es/Mentions/style.js +4 -4
- package/es/MonacoEditor/base/helper.d.ts +4 -0
- package/es/MonacoEditor/base/helper.js +8 -3
- package/es/MonacoEditor/base/index.d.ts +2 -2
- package/es/MonacoEditor/base/index.js +33 -10
- package/es/MonacoEditor/base/style.js +1 -1
- package/es/MonacoEditor/index.js +1 -1
- package/es/hooks/useHighlight.js +13 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/utils/platform.d.ts +1 -0
- package/es/utils/platform.js +1 -0
- package/package.json +5 -5
- package/umd/index.min.js +1 -1
- package/umd/index.min.js.map +1 -1
package/es/hooks/useHighlight.js
CHANGED
|
@@ -28,7 +28,7 @@ var initHighlighter = /*#__PURE__*/function () {
|
|
|
28
28
|
_context.next = 7;
|
|
29
29
|
return createHighlighter({
|
|
30
30
|
langs: FALLBACK_LANGS,
|
|
31
|
-
themes: [themeConfig(true), themeConfig(false)]
|
|
31
|
+
themes: [themeConfig(true), themeConfig(false), 'catppuccin-latte', 'catppuccin-mocha']
|
|
32
32
|
});
|
|
33
33
|
case 7:
|
|
34
34
|
highlighter = _context.sent;
|
|
@@ -46,31 +46,35 @@ var initHighlighter = /*#__PURE__*/function () {
|
|
|
46
46
|
}();
|
|
47
47
|
export var useHighlight = function useHighlight(text, lang, isDarkMode) {
|
|
48
48
|
return useSWR([lang === null || lang === void 0 ? void 0 : lang.toLowerCase(), isDarkMode ? 'dark' : 'light', text].join('-'), /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
49
|
-
var language, highlighter, html;
|
|
49
|
+
var language, theme, highlighter, html;
|
|
50
50
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
51
51
|
while (1) switch (_context2.prev = _context2.next) {
|
|
52
52
|
case 0:
|
|
53
53
|
_context2.prev = 0;
|
|
54
54
|
language = lang.toLowerCase();
|
|
55
|
-
|
|
55
|
+
theme = isDarkMode ? 'dark' : 'light';
|
|
56
|
+
if (language === 'md') {
|
|
57
|
+
theme = isDarkMode ? 'catppuccin-mocha' : 'catppuccin-latte';
|
|
58
|
+
}
|
|
59
|
+
_context2.next = 6;
|
|
56
60
|
return initHighlighter(language);
|
|
57
|
-
case
|
|
61
|
+
case 6:
|
|
58
62
|
highlighter = _context2.sent;
|
|
59
63
|
html = highlighter === null || highlighter === void 0 ? void 0 : highlighter.codeToHtml(text, {
|
|
60
64
|
lang: languageMap.includes(language) ? language : FALLBACK_LANG,
|
|
61
|
-
theme:
|
|
65
|
+
theme: theme,
|
|
62
66
|
transformers: [transformerNotationDiff(), transformerNotationHighlight(), transformerNotationWordHighlight(), transformerNotationFocus(), transformerNotationErrorLevel()]
|
|
63
67
|
});
|
|
64
68
|
return _context2.abrupt("return", html);
|
|
65
|
-
case
|
|
66
|
-
_context2.prev =
|
|
69
|
+
case 11:
|
|
70
|
+
_context2.prev = 11;
|
|
67
71
|
_context2.t0 = _context2["catch"](0);
|
|
68
72
|
return _context2.abrupt("return", '');
|
|
69
|
-
case
|
|
73
|
+
case 14:
|
|
70
74
|
case "end":
|
|
71
75
|
return _context2.stop();
|
|
72
76
|
}
|
|
73
|
-
}, _callee2, null, [[0,
|
|
77
|
+
}, _callee2, null, [[0, 11]]);
|
|
74
78
|
})), {
|
|
75
79
|
revalidateOnFocus: false
|
|
76
80
|
});
|
package/es/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from './Typography';
|
|
|
30
30
|
export * from './ChatInputArea';
|
|
31
31
|
export * from './ChatItem';
|
|
32
32
|
export * from './ChatMarkdown';
|
|
33
|
+
export * from './CodeEditor';
|
|
33
34
|
export * from './EditableMessage';
|
|
34
35
|
export * from './Highlighter';
|
|
35
36
|
export * from './styles';
|
package/es/index.js
CHANGED
|
@@ -34,6 +34,7 @@ export * from "./Typography";
|
|
|
34
34
|
export * from "./ChatInputArea";
|
|
35
35
|
export * from "./ChatItem";
|
|
36
36
|
export * from "./ChatMarkdown";
|
|
37
|
+
export * from "./CodeEditor";
|
|
37
38
|
export * from "./EditableMessage";
|
|
38
39
|
export * from "./Highlighter";
|
|
39
40
|
export * from "./styles";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isMacLike: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var isMacLike = typeof window !== 'undefined' && 'navigator' in window && /(mac|iphone|ipod|ipad)/i.test(navigator.platform);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuntijs/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0-beta.1",
|
|
4
4
|
"description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yuntijs",
|
|
@@ -116,13 +116,13 @@
|
|
|
116
116
|
"@types/unist": "^3.0.3",
|
|
117
117
|
"@vitest/coverage-v8": "latest",
|
|
118
118
|
"@yuntijs/lint": "^1.7.0",
|
|
119
|
-
"antd": "^5.23.
|
|
119
|
+
"antd": "^5.23.4",
|
|
120
120
|
"antd-style": "^3.7.1",
|
|
121
121
|
"babel-plugin-antd-style": "latest",
|
|
122
122
|
"commitlint": "^18",
|
|
123
123
|
"dayjs": "^1.11.10",
|
|
124
|
-
"dumi": "^2.4.
|
|
125
|
-
"dumi-theme-yunti": "^1.7.
|
|
124
|
+
"dumi": "^2.4.17",
|
|
125
|
+
"dumi-theme-yunti": "^1.7.3",
|
|
126
126
|
"eslint": "^8.56.0",
|
|
127
127
|
"father": "^4.3.8",
|
|
128
128
|
"husky": "^8",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"jsdom": "^22",
|
|
131
131
|
"lint-staged": "^15",
|
|
132
132
|
"mdast-util-to-markdown": "^2.1.2",
|
|
133
|
-
"monaco-editor": "^0.
|
|
133
|
+
"monaco-editor": "^0.52.2",
|
|
134
134
|
"prettier": "^3",
|
|
135
135
|
"react": "^18",
|
|
136
136
|
"react-dom": "^18",
|