@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.
@@ -72,6 +72,7 @@ export var Highlighter = /*#__PURE__*/memo(function (_ref) {
72
72
  className: styles.select,
73
73
  onSelect: setLang,
74
74
  options: options,
75
+ showSearch: true,
75
76
  size: 'small',
76
77
  suffixIcon: false,
77
78
  value: lang.toLowerCase()
@@ -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: readonly ["javascript", "js", "jsx", "json", "markdown", "md", "less", "css", "python", "py", "typescript", "ts", "tsx", "diff", "bash"];
2
+ export declare const languageMap: string[];
3
3
  /**
4
4
  * @title 代码高亮的存储对象
5
5
  */
@@ -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 = ['javascript', 'js', 'jsx', 'json', 'markdown', 'md', 'less', 'css', 'python', 'py', 'typescript', 'ts', 'tsx', 'diff', 'bash'];
7
+ export var languageMap = Object.keys(bundledLanguages);
8
8
 
9
9
  /**
10
10
  * @title 代码高亮的存储对象
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.93.0",
3
+ "version": "1.94.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export interface PrismProps {
3
- children: string;
4
- isDarkMode: boolean;
5
- language: string;
6
- }
7
- export declare const Prism: import("react").NamedExoticComponent<PrismProps>;
@@ -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
- });