@lobehub/ui 1.93.0 → 1.94.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/es/Highlighter/FullFeatured.js +1 -0
- package/es/Highlighter/style.js +1 -1
- package/es/hooks/useHighlight.d.ts +1 -1
- package/es/hooks/useHighlight.js +2 -2
- package/package.json +1 -1
- package/es/Highlighter/SyntaxHighlighter/Prism.d.ts +0 -7
- package/es/Highlighter/SyntaxHighlighter/Prism.js +0 -40
package/es/Highlighter/style.js
CHANGED
|
@@ -16,6 +16,6 @@ export var useStyles = createStyles(function (_ref, type) {
|
|
|
16
16
|
container: cx(prefix, type !== 'pure' && typeStylish, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n overflow: auto;\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n\n &:hover {\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding: ", " !important;\n background: none !important;\n }\n\n code {\n background: transparent !important;\n }\n "])), token.borderRadius, token.motionEaseOut, buttonHoverCls, langHoverCls, type === 'pure' ? 0 : "16px 24px")),
|
|
17
17
|
header: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 4px 8px;\n background: ", ";\n "])), token.colorFillQuaternary),
|
|
18
18
|
lang: cx(langHoverCls, stylish.blur, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 2;\n right: 0;\n bottom: 8px;\n\n font-family: ", ";\n color: ", ";\n\n opacity: 0;\n\n transition: opacity 0.1s;\n "])), token.fontFamilyCode, token.colorTextSecondary)),
|
|
19
|
-
select: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .ant-select-selection-item {\n min-width: 100px;\n padding-inline-end: 0 !important;\n color: ", ";\n text-align: center;\n }\n "])), token.colorTextDescription)
|
|
19
|
+
select: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .ant-select-selection-item {\n min-width: 100px;\n padding-inline-end: 0 !important;\n color: ", ";\n text-align: center;\n }\n\n input {\n text-align: center;\n }\n "])), token.colorTextDescription)
|
|
20
20
|
};
|
|
21
21
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Highlighter, type HighlighterCoreOptions } from 'shikiji';
|
|
2
|
-
export declare const languageMap:
|
|
2
|
+
export declare const languageMap: string[];
|
|
3
3
|
/**
|
|
4
4
|
* @title 代码高亮的存储对象
|
|
5
5
|
*/
|
package/es/hooks/useHighlight.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { getHighlighter } from 'shikiji';
|
|
3
|
+
import { bundledLanguages, getHighlighter } from 'shikiji';
|
|
4
4
|
import { shallow } from 'zustand/shallow';
|
|
5
5
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
6
6
|
import { themeConfig } from "../Highlighter/theme";
|
|
7
|
-
export var languageMap =
|
|
7
|
+
export var languageMap = Object.keys(bundledLanguages);
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @title 代码高亮的存储对象
|
package/package.json
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
import { Highlight, themes } from 'prism-react-renderer';
|
|
5
|
-
import { memo } from 'react';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export var Prism = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
-
var children = _ref.children,
|
|
9
|
-
language = _ref.language,
|
|
10
|
-
isDarkMode = _ref.isDarkMode;
|
|
11
|
-
return /*#__PURE__*/_jsx(Highlight, {
|
|
12
|
-
code: children,
|
|
13
|
-
language: language,
|
|
14
|
-
theme: isDarkMode ? themes.jettwaveDark : themes.jettwaveLight,
|
|
15
|
-
children: function children(_ref2) {
|
|
16
|
-
var className = _ref2.className,
|
|
17
|
-
style = _ref2.style,
|
|
18
|
-
tokens = _ref2.tokens,
|
|
19
|
-
getLineProps = _ref2.getLineProps,
|
|
20
|
-
getTokenProps = _ref2.getTokenProps;
|
|
21
|
-
return /*#__PURE__*/_jsx("pre", {
|
|
22
|
-
className: className,
|
|
23
|
-
style: style,
|
|
24
|
-
children: tokens.map(function (line, index) {
|
|
25
|
-
return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, getLineProps({
|
|
26
|
-
key: index,
|
|
27
|
-
line: line
|
|
28
|
-
})), {}, {
|
|
29
|
-
children: line.map(function (token, key) {
|
|
30
|
-
return /*#__PURE__*/_jsx("span", _objectSpread({}, getTokenProps({
|
|
31
|
-
key: key,
|
|
32
|
-
token: token
|
|
33
|
-
})), index);
|
|
34
|
-
})
|
|
35
|
-
}), index);
|
|
36
|
-
})
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|