@lobehub/ui 1.72.0 → 1.72.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.
|
@@ -3,7 +3,6 @@ import { useThemeMode } from 'antd-style';
|
|
|
3
3
|
import { Loader2 } from 'lucide-react';
|
|
4
4
|
import { memo, useEffect } from 'react';
|
|
5
5
|
import { Center } from 'react-layout-kit';
|
|
6
|
-
import { shallow } from 'zustand/shallow';
|
|
7
6
|
import Icon from "../../Icon";
|
|
8
7
|
import { useHighlight } from "../../hooks/useHighlight";
|
|
9
8
|
import { useStyles } from "./style";
|
|
@@ -20,7 +19,7 @@ var SyntaxHighlighter = /*#__PURE__*/memo(function (_ref) {
|
|
|
20
19
|
isDarkMode = _useThemeMode.isDarkMode;
|
|
21
20
|
var _useHighlight = useHighlight(function (s) {
|
|
22
21
|
return [s.codeToHtml, !s.highlighter];
|
|
23
|
-
}
|
|
22
|
+
}),
|
|
24
23
|
_useHighlight2 = _slicedToArray(_useHighlight, 2),
|
|
25
24
|
codeToHtml = _useHighlight2[0],
|
|
26
25
|
isLoading = _useHighlight2[1];
|
|
@@ -22,5 +22,5 @@ interface Store {
|
|
|
22
22
|
*/
|
|
23
23
|
initHighlighter: (options?: HighlighterOptions) => Promise<void>;
|
|
24
24
|
}
|
|
25
|
-
export declare const useHighlight: import("zustand").
|
|
25
|
+
export declare const useHighlight: import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand/vanilla").StoreApi<Store>>;
|
|
26
26
|
export {};
|
package/es/hooks/useHighlight.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { getHighlighter } from 'shiki-es';
|
|
4
|
-
import {
|
|
4
|
+
import { shallow } from 'zustand/shallow';
|
|
5
|
+
import { createWithEqualityFn } from 'zustand/traditional';
|
|
5
6
|
import { themeConfig } from "../Highlighter/theme";
|
|
6
7
|
export var languageMap = ['javascript', 'js', 'jsx', 'json', 'markdown', 'md', 'less', 'css', 'typescript', 'ts', 'tsx', 'diff', 'bash'];
|
|
7
8
|
|
|
@@ -9,7 +10,7 @@ export var languageMap = ['javascript', 'js', 'jsx', 'json', 'markdown', 'md', '
|
|
|
9
10
|
* @title 代码高亮的存储对象
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
|
-
export var useHighlight =
|
|
13
|
+
export var useHighlight = createWithEqualityFn(function (set, get) {
|
|
13
14
|
return {
|
|
14
15
|
codeToHtml: function codeToHtml(text, language, isDarkMode) {
|
|
15
16
|
var _get = get(),
|
|
@@ -57,4 +58,4 @@ export var useHighlight = create(function (set, get) {
|
|
|
57
58
|
return initHighlighter;
|
|
58
59
|
}()
|
|
59
60
|
};
|
|
60
|
-
});
|
|
61
|
+
}, shallow);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/ui",
|
|
3
|
-
"version": "1.72.
|
|
3
|
+
"version": "1.72.1",
|
|
4
4
|
"description": "Lobe UI is an open-source UI component library for building AIGC web apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"three": "^0.150",
|
|
106
106
|
"ts-md5": "^1",
|
|
107
107
|
"use-merge-value": "^1",
|
|
108
|
-
"zustand": "^4",
|
|
109
|
-
"zustand-utils": "^1"
|
|
108
|
+
"zustand": "^4.4.1",
|
|
109
|
+
"zustand-utils": "^1.3.1"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@commitlint/cli": "^17",
|