@yuntijs/ui 1.0.0-beta.80 → 1.0.0-beta.82

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.
Files changed (38) hide show
  1. package/es/ChatInputArea/desktop/ChatInputArea.d.ts +1 -1
  2. package/es/CollapseGroup/style.js +1 -1
  3. package/es/Form/collapse-list/index.d.ts +1 -1
  4. package/es/Mentions/index.d.ts +4 -0
  5. package/es/Mentions/index.js +23 -9
  6. package/es/Mentions/plugins/mention-node/component.js +1 -1
  7. package/es/Mentions/plugins/mention-node/node.d.ts +1 -2
  8. package/es/Mentions/plugins/mention-node/node.js +5 -2
  9. package/es/Mentions/plugins/mention-picker/hooks.js +17 -10
  10. package/es/Mentions/plugins/mention-picker/index.d.ts +3 -0
  11. package/es/Mentions/plugins/mention-picker/index.js +57 -8
  12. package/es/Mentions/plugins/mention-picker/menu-item.d.ts +3 -3
  13. package/es/Mentions/plugins/mention-picker/menu-item.js +2 -2
  14. package/es/Mentions/plugins/mention-picker/menu.d.ts +5 -4
  15. package/es/Mentions/plugins/mention-picker/menu.js +2 -1
  16. package/es/Mentions/plugins/mention-picker/style.js +3 -3
  17. package/es/Mentions/plugins/mention-picker/utils.d.ts +16 -9
  18. package/es/Mentions/plugins/mention-picker/utils.js +29 -8
  19. package/es/Mentions/plugins/on-blur-or-focus-block.js +1 -1
  20. package/es/Mentions/types.d.ts +5 -10
  21. package/es/MonacoEditor/base/index.d.ts +6 -2
  22. package/es/MonacoEditor/base/index.js +4 -2
  23. package/es/MonacoEditor/base/style.d.ts +1 -0
  24. package/es/MonacoEditor/base/style.js +23 -6
  25. package/es/MonacoEditor/index.d.ts +3 -0
  26. package/es/Page/Page.d.ts +1 -1
  27. package/es/Radio/index.js +1 -2
  28. package/es/Table/collapse/index.d.ts +3 -2
  29. package/es/Table/index.d.ts +1 -1
  30. package/es/Typography/index.d.ts +1 -1
  31. package/es/index.d.ts +1 -1
  32. package/es/index.js +1 -1
  33. package/es/styles/colors/generateColorPalette.d.ts +1 -1
  34. package/package.json +6 -6
  35. package/umd/index.min.js +1 -1
  36. package/umd/index.min.js.map +1 -1
  37. package/es/MonacoEditor/style.d.ts +0 -10
  38. package/es/MonacoEditor/style.js +0 -25
@@ -1,7 +1,6 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
3
3
  import { createStyles, keyframes } from 'antd-style';
4
-
5
4
  /**
6
5
  * styles from https://github.com/alibaba/lowcode-plugins/blob/main/packages/base-monaco-editor/src/index.scss
7
6
  */
@@ -14,12 +13,30 @@ export var useStyles = createStyles(function (_ref, _ref2) {
14
13
  _ref2$isFullScreen = _ref2.isFullScreen,
15
14
  isFullScreen = _ref2$isFullScreen === void 0 ? false : _ref2$isFullScreen,
16
15
  _ref2$diff = _ref2.diff,
17
- diff = _ref2$diff === void 0 ? false : _ref2$diff;
16
+ diff = _ref2$diff === void 0 ? false : _ref2$diff,
17
+ _ref2$variant = _ref2.variant,
18
+ variant = _ref2$variant === void 0 ? 'outlined' : _ref2$variant;
18
19
  var dots = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% { content: '.'; }\n 20% { content: '..'; }\n 40% { content: '...'; }\n 60% { content: '....'; }\n 80% { content: '.....'; }\n "])));
20
+ var getBgColor = function getBgColor() {
21
+ switch (variant) {
22
+ case 'outlined':
23
+ {
24
+ return token.colorBgBase;
25
+ }
26
+ case 'filled':
27
+ {
28
+ return token.colorFillTertiary;
29
+ }
30
+ default:
31
+ {
32
+ return 'transparent';
33
+ }
34
+ }
35
+ };
19
36
  return {
20
- base: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n box-sizing: content-box;\n min-height: 100px;\n\n border: 1px solid transparent;\n border-radius: 3px;\n &:hover {\n border-color: var(--color-field-border-hover, rgba(31, 56, 88, 0.1));\n }\n\n &.ve-focused {\n border-color: var(--color-field-border-active, rgba(31, 56, 88, 0.15));\n }\n\n &.ve-outline {\n border: 1px solid var(--color-field-border, rgba(31, 56, 88, 0.05)) !important;\n }\n\n & > .react-monaco-editor-container {\n width: 100%;\n height: 100%;\n min-height: 100px;\n background: transparent;\n\n ", "\n\n & > .monaco-editor {\n border-radius: ", "px;\n .overflow-guard,\n .margin {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n .monaco-scrollable-element {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n .monaco-diff-editor {\n border-radius: ", "px;\n & > .original > .monaco-editor {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n .overflow-guard,\n .margin {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n }\n .diffViewport {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n\n ..syntaxTips {\n position: absolute;\n bottom: 0;\n left: 0;\n\n box-sizing: border-box;\n width: 100%;\n max-height: 0;\n margin: 0;\n padding: 10px 30px;\n\n color: red;\n\n background: rgba(255, 234, 234, 0.8);\n\n transition: 0.2s ease max-height;\n }\n\n .syntaxTips:hover {\n overflow: auto;\n max-height: 50%;\n }\n\n .syntaxTips .infoIcon {\n position: absolute;\n top: 2px;\n right: 5px;\n transform: rotateY(180deg);\n\n width: 20px;\n height: 16px;\n }\n "])), isFullScreen && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: fixed;\n z-index: 9998;\n inset: 0;\n\n width: auto !important;\n height: auto !important;\n "]))), token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius - 1, token.borderRadius - 1),
21
- fullScreenBtn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n &.", "-btn {\n position: absolute;\n color: ", ";\n top: 20px;\n transition: none;\n ", "\n }\n "])), prefixCls, token.colorTextSecondary, isFullScreen ? css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n z-index: 9999;\n right: ", "px;\n "])), diff ? 64 : 138) : css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n right: ", "px;\n "])), minimapEnabled || diff ? 64 : 20)),
22
- loading: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n inset: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n font-size: ", "px;\n color: ", ";\n\n background-color: transparent;\n\n &::after {\n content: '';\n /* width: 20px; */\n display: inline;\n animation: ", " steps(3) 1s infinite;\n }\n "])), token.fontSizeSM, token.colorTextTertiary, dots)
37
+ base: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n box-sizing: content-box;\n min-height: 100px;\n\n background-color: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n &:hover {\n border-color: ", ";\n ", "\n }\n\n &.ve-focused {\n ", "\n ", "\n }\n\n &.ve-outline {\n border: 1px solid var(--color-field-border, rgba(31, 56, 88, 0.05)) !important;\n }\n\n & > .react-monaco-editor-container {\n width: 100%;\n height: 100%;\n min-height: 100px;\n background: transparent;\n\n ", "\n\n .monaco-editor,\n .monaco-editor-background,\n .monaco-editor .inputarea.ime-input,\n .monaco-editor .margin {\n background-color: transparent;\n }\n\n & > .monaco-editor {\n border-radius: ", "px;\n .overflow-guard,\n .margin {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n .monaco-scrollable-element {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n .monaco-diff-editor {\n border-radius: ", "px;\n & > .original > .monaco-editor {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n .overflow-guard,\n .margin {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n }\n .diffViewport {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n\n .syntaxTips {\n position: absolute;\n bottom: 0;\n left: 0;\n\n box-sizing: border-box;\n width: 100%;\n max-height: 0;\n margin: 0;\n padding: 10px 30px;\n\n color: red;\n\n background: rgba(255, 234, 234, 0.8);\n\n transition: 0.2s ease max-height;\n }\n\n .syntaxTips:hover {\n overflow: auto;\n max-height: 50%;\n }\n\n .syntaxTips .infoIcon {\n position: absolute;\n top: 2px;\n right: 5px;\n transform: rotateY(180deg);\n\n width: 20px;\n height: 16px;\n }\n "])), getBgColor(), variant === 'outlined' ? token.colorBorder : 'transparent', token.borderRadius, variant === 'outlined' ? token.colorPrimaryHover : 'transparent', variant === 'filled' && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), token.colorFillSecondary), variant === 'filled' && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), token.colorBgBase), variant !== 'borderless' && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border-color: ", ";\n "])), token.colorPrimaryActive), isFullScreen && css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: fixed;\n z-index: 9998;\n inset: 0;\n\n width: auto !important;\n height: auto !important;\n "]))), token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius - 1, token.borderRadius - 1),
38
+ fullScreenBtn: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n &.", "-btn {\n position: absolute;\n top: 20px;\n color: ", ";\n transition: none;\n ", "\n }\n "])), prefixCls, token.colorTextSecondary, isFullScreen ? css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n z-index: 9999;\n right: ", "px;\n "])), diff ? 64 : 138) : css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n right: ", "px;\n "])), minimapEnabled || diff ? 64 : 20)),
39
+ loading: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: absolute;\n inset: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n font-size: ", "px;\n color: ", ";\n\n background-color: transparent;\n\n &::after {\n content: '';\n width: 16px;\n /* display: inline; */\n animation: ", " steps(3) 1s infinite;\n }\n "])), token.fontSizeSM, token.colorTextTertiary, dots)
23
40
  };
24
41
  }, {
25
42
  hashPriority: 'low'
@@ -1,3 +1,4 @@
1
+ import type { Variant } from 'antd/es/config-provider';
1
2
  import React from 'react';
2
3
  import type { IDiffMonacoEditorProps, IGeneralManacoEditorProps, ISingleMonacoEditorProps } from './base/helper';
3
4
  export { type EditorMeta, Controller as MonacoController } from './base/controller';
@@ -16,6 +17,8 @@ export interface BaseMonacoEditorProps extends IGeneralManacoEditorProps {
16
17
  version?: string;
17
18
  /** An event emitted when the content of the current model has changed. */
18
19
  onChange?: (input: string, event: any) => void;
20
+ /** Variants of Editor, Defaults to outlined. */
21
+ variant?: Variant;
19
22
  }
20
23
  export declare const BaseMonacoEditor: React.FC<BaseMonacoEditorProps & {
21
24
  /** Only for BaseMonacoEditor. */
package/es/Page/Page.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { FlexProps } from 'antd/lib';
1
+ import { type FlexProps } from 'antd';
2
2
  import React from 'react';
3
3
  import { PageContextValue } from './PageContext';
4
4
  export interface PageProps extends React.HTMLAttributes<HTMLDivElement>, Pick<FlexProps, 'gap'> {
package/es/Radio/index.js CHANGED
@@ -4,7 +4,6 @@ var _excluded = ["className"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import { Radio as AntdRadio } from 'antd';
7
- import AntdGroup from 'antd/es/radio/group';
8
7
  import React from 'react';
9
8
  import { useStyles } from "./style";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -18,7 +17,7 @@ var Group = function Group(props) {
18
17
  var _useStyles = useStyles(otherProps),
19
18
  styles = _useStyles.styles,
20
19
  cx = _useStyles.cx;
21
- return /*#__PURE__*/_jsx(AntdGroup, _objectSpread(_objectSpread({}, otherProps), {}, {
20
+ return /*#__PURE__*/_jsx(AntdRadio.Group, _objectSpread(_objectSpread({}, otherProps), {}, {
22
21
  className: cx(styles.custom, className)
23
22
  }));
24
23
  };
@@ -1,8 +1,9 @@
1
1
  import type { TableProps } from 'antd';
2
+ import type { AnyObject } from 'antd/es/_util/type';
2
3
  import React from 'react';
3
4
  import { CollapseGroupProps } from '../../CollapseGroup';
4
- export interface CollapseTableProps extends Omit<TableProps, 'title'>, Pick<CollapseGroupProps, 'icon' | 'title' | 'variant' | 'defaultActive' | 'extra'> {
5
+ export interface CollapseTableProps<RecordType = AnyObject> extends Omit<TableProps<RecordType>, 'title'>, Pick<CollapseGroupProps, 'icon' | 'title' | 'variant' | 'defaultActive' | 'extra'> {
5
6
  rootStyle?: React.CSSProperties;
6
7
  rootClassName?: string;
7
8
  }
8
- export declare const CollapseTable: React.FC<CollapseTableProps>;
9
+ export declare const CollapseTable: <RecordType extends AnyObject = AnyObject>({ rootStyle, rootClassName, icon, title, variant, defaultActive, extra, className, ...tableProps }: CollapseTableProps<RecordType>) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { Table as AntdTable, TableProps } from 'antd';
2
- import { AnyObject } from 'antd/es/_util/type';
2
+ import type { AnyObject } from 'antd/es/_util/type';
3
3
  import React from 'react';
4
4
  import { CollapseTable } from './collapse';
5
5
  export * from './collapse';
@@ -1,6 +1,6 @@
1
1
  import { Typography as AntdTypography } from 'antd';
2
+ import type { TooltipPropsWithTitle } from 'antd/es/tooltip';
2
3
  import type { TextProps } from 'antd/es/typography/Text';
3
- import type { TooltipPropsWithTitle } from 'antd/lib/tooltip';
4
4
  import React from 'react';
5
5
  export declare const Typography: TypographyProps;
6
6
  interface TimeProps extends TextProps {
package/es/index.d.ts CHANGED
@@ -38,7 +38,7 @@ export { Affix, type AffixProps, Anchor, type AnchorProps, type MentionProps as
38
38
  type BadgeProps, Button, // @todo dependence unifiedLink. link type, hover primary color, back button
39
39
  type ButtonProps, Calendar, type CalendarProps, Carousel, type CarouselProps, Cascader, type CascaderProps, Checkbox, type CheckboxProps, Col, Collapse, type CollapseProps, ColorPicker, type ColorPickerProps, type ColProps, // @todo center style
40
40
  type CountdownProps, DatePicker, type DatePickerProps, Empty, type EmptyProps, Flex, type FlexProps, FloatButton, type GlobalToken, Grid, Image, type ImageProps, Input, InputNumber, type InputNumberProps, type InputProps, type InputRef, Layout, type LayoutProps, List, type ListProps, type MappingAlgorithm, Menu, type MenuItemProps, type MenuProps, type MenuRef, type MenuTheme, message, type MessageArgsProps, Pagination, type PaginationProps, Popconfirm, type PopconfirmProps, Popover, type PopoverProps, Progress, type ProgressProps, QRCode, type QRCodeProps, type QRPropsCanvas, type QRPropsSvg, Rate, type RateProps, type RefSelectProps, Result, type ResultProps, Row, type RowProps, Segmented, type SegmentedProps, Select, type SelectProps, Skeleton, type SkeletonProps, Slider, type SliderSingleProps, Space, type SpaceProps, Spin, type SpinProps, Statistic, type StatisticProps, type StepProps, Steps, type StepsProps, type SubMenuProps, Switch, type SwitchProps, type TabPaneProps, Tabs, type TabsProps, Tag, type TagProps, type TagType, theme, Timeline, type TimelineItemProps, type TimelineProps, TimePicker, type TimePickerProps, type TimeRangePickerProps, Tooltip, type TooltipProps, Tour, type TourProps, type TourStepProps, Transfer, type TransferProps, Tree, type TreeDataNode, type TreeNodeProps, type TreeProps, TreeSelect, type TreeSelectProps, Upload, type UploadFile, type UploadProps, version, Watermark, type WatermarkProps, } from 'antd';
41
- export { Markdown, type MarkdownProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from '@lobehub/ui';
41
+ export { CopyButton, type CopyButtonProps, Markdown, type MarkdownProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from '@lobehub/ui';
42
42
  export { SpeechSynthesisTTS } from '@lobehub/tts';
43
43
  export { AudioPlayer, useAudioPlayer, useSpeechRecognition } from '@lobehub/tts/react';
44
44
  export { useResponsive, useTheme, useThemeMode } from 'antd-style';
package/es/index.js CHANGED
@@ -50,7 +50,7 @@ export { Affix, Anchor, Mentions as AntdMentions, AutoComplete, Avatar, BackTop,
50
50
  , DatePicker, Empty, Flex, FloatButton, Grid, Image, Input, InputNumber, Layout, List, Menu, message, Pagination, Popconfirm, Popover, Progress, QRCode, Rate, Result, Row, Segmented, Select, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Tabs, Tag, theme, Timeline, TimePicker, Tooltip, Tour, Transfer, Tree, TreeSelect, Upload, version, Watermark } from 'antd';
51
51
 
52
52
  // ~ @lobehub/ui
53
- export { Markdown, SyntaxHighlighter } from '@lobehub/ui';
53
+ export { CopyButton, Markdown, SyntaxHighlighter } from '@lobehub/ui';
54
54
 
55
55
  // @lobehub/tts
56
56
  export { SpeechSynthesisTTS } from '@lobehub/tts';
@@ -1,4 +1,4 @@
1
- import { AliasToken } from 'antd/es/theme/interface';
1
+ import type { AliasToken } from 'antd/es/theme/interface';
2
2
  import { ColorScaleItem } from "./colors";
3
3
  export declare const generateColorPalette: ({ type, scale, appearance, }: {
4
4
  appearance: 'light' | 'dark';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuntijs/ui",
3
- "version": "1.0.0-beta.80",
3
+ "version": "1.0.0-beta.82",
4
4
  "description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
5
5
  "keywords": [
6
6
  "yuntijs",
@@ -83,17 +83,17 @@
83
83
  "@alilc/lowcode-plugin-base-monaco-editor": "^1.1.2",
84
84
  "@ant-design/icons": "^5",
85
85
  "@babel/runtime": "^7",
86
- "@lexical/react": "^0.16.1",
87
- "@lexical/selection": "^0.16.1",
88
- "@lexical/text": "^0.16.1",
89
- "@lexical/utils": "^0.16.1",
86
+ "@lexical/react": "^0.23.1",
87
+ "@lexical/selection": "^0.23.1",
88
+ "@lexical/text": "^0.23.1",
89
+ "@lexical/utils": "^0.23.1",
90
90
  "@lobehub/tts": "^1.25.1",
91
91
  "@lobehub/ui": "^1.164.2",
92
92
  "@melloware/react-logviewer": "^5.2.0",
93
93
  "@monaco-editor/loader": "^1.4.0",
94
94
  "@shikijs/transformers": "^1.10.3",
95
95
  "leva": "^0",
96
- "lexical": "^0.16.1",
96
+ "lexical": "^0.23.1",
97
97
  "lodash-es": "^4",
98
98
  "lucide-react": "latest",
99
99
  "query-string": "^8",