@yuntijs/ui 1.0.0-beta.56 → 1.0.0-beta.57

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.
@@ -20,7 +20,6 @@ import { textToEditorState } from "./utils";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
22
  export var Mentions = function Mentions(_ref) {
23
- var _cx2;
24
23
  var className = _ref.className,
25
24
  wrapperClassname = _ref.wrapperClassname,
26
25
  placeholder = _ref.placeholder,
@@ -87,11 +86,10 @@ export var Mentions = function Mentions(_ref) {
87
86
  }, {});
88
87
  }, [options]);
89
88
  if (!isBrowser) {
90
- var _cx;
91
89
  return /*#__PURE__*/_jsxs("div", {
92
90
  className: cx(styles.wrapper, wrapperClassname),
93
91
  children: [/*#__PURE__*/_jsx("div", {
94
- className: cx((_cx = {}, _defineProperty(_cx, styles.root, true), _defineProperty(_cx, styles.filled, variant === 'filled'), _defineProperty(_cx, styles.borderless, variant === 'borderless'), _defineProperty(_cx, styles.disabled, disabled), _cx), className),
92
+ className: cx(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.root, true), styles.filled, variant === 'filled'), styles.borderless, variant === 'borderless'), styles.disabled, disabled), className),
95
93
  style: style || {}
96
94
  }), /*#__PURE__*/_jsx("div", {
97
95
  className: styles.placeholder,
@@ -112,7 +110,7 @@ export var Mentions = function Mentions(_ref) {
112
110
  children: [/*#__PURE__*/_jsx(RichTextPlugin, {
113
111
  ErrorBoundary: LexicalErrorBoundary,
114
112
  contentEditable: /*#__PURE__*/_jsx(ContentEditable, {
115
- className: cx((_cx2 = {}, _defineProperty(_cx2, styles.root, true), _defineProperty(_cx2, styles.filled, variant === 'filled'), _defineProperty(_cx2, styles.borderless, variant === 'borderless'), _defineProperty(_cx2, styles.disabled, disabled), _cx2), className),
113
+ className: cx(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, styles.root, true), styles.filled, variant === 'filled'), styles.borderless, variant === 'borderless'), styles.disabled, disabled), className),
116
114
  style: style || {}
117
115
  }),
118
116
  placeholder: /*#__PURE__*/_jsx("div", {
@@ -1,8 +1,10 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
3
3
  import { createStyles } from 'antd-style';
4
+ var inputHeight = 32;
5
+ var lineHeight = 22;
4
6
  var calculateHeight = function calculateHeight(rows) {
5
- return 32 + Math.max(rows - 1, 0) * 22;
7
+ return inputHeight + Math.max(rows - 1, 0) * lineHeight;
6
8
  };
7
9
  export var useStyles = createStyles(function (_ref, _ref2) {
8
10
  var css = _ref.css,
@@ -11,8 +13,8 @@ export var useStyles = createStyles(function (_ref, _ref2) {
11
13
  var autoSize = _ref2.autoSize;
12
14
  return {
13
15
  wrapper: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n width: 100%;\n min-width: 0;\n "]))),
14
- placeholder: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pointer-events: none;\n user-select: none;\n\n position: absolute;\n top: 4px;\n left: 11px;\n\n color: ", ";\n "])), token.colorTextPlaceholder),
15
- root: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n outline: none;\n border: 1px solid ", ";\n border-radius: ", "px;\n\n margin: 0;\n padding: 4px 11px;\n\n color: ", ";\n font-size: ", "px;\n font-family: ", ";\n\n display: inline-block;\n\n width: 100%;\n min-width: 0;\n\n ", "\n ", "\n overflow: auto;\n\n transition: all ", ";\n &:focus {\n border-color: ", ";\n }\n p {\n margin-bottom: 0;\n margin-block: 0 0;\n }\n "])), token.colorBorder, token.borderRadius, token.colorText, token.fontSize, token.fontFamily, (autoSize === null || autoSize === void 0 ? void 0 : autoSize.minRows) && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), calculateHeight(autoSize.minRows)), (autoSize === null || autoSize === void 0 ? void 0 : autoSize.maxRows) && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), calculateHeight(autoSize.maxRows)), token.motionDurationMid, token.colorPrimaryBorder),
16
+ placeholder: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pointer-events: none;\n user-select: none;\n\n position: absolute;\n top: 0;\n left: 13px;\n\n height: ", "px;\n\n font-size: ", "px;\n line-height: ", "px;\n color: ", ";\n "])), inputHeight, token.fontSize, inputHeight, token.colorTextPlaceholder),
17
+ root: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n outline: none;\n border: 1px solid ", ";\n border-radius: ", "px;\n\n margin: 0;\n padding: 4px 11px;\n\n color: ", ";\n font-size: ", "px;\n font-family: ", ";\n\n display: inline-block;\n\n width: 100%;\n min-width: 0;\n\n ", "\n ", "\n overflow: auto;\n\n transition: all ", ";\n &:focus {\n border-color: ", ";\n }\n p {\n margin-bottom: 0;\n margin-block: 0 0;\n line-height: ", "px;\n }\n "])), token.colorBorder, token.borderRadius, token.colorText, token.fontSize, token.fontFamily, (autoSize === null || autoSize === void 0 ? void 0 : autoSize.minRows) && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n min-height: ", "px;\n "])), calculateHeight(autoSize.minRows)), (autoSize === null || autoSize === void 0 ? void 0 : autoSize.maxRows) && css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-height: ", "px;\n "])), calculateHeight(autoSize.maxRows)), token.motionDurationMid, token.colorPrimaryBorder, lineHeight),
16
18
  filled: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n background: ", ";\n border-color: transparent;\n &:hover {\n background: ", ";\n }\n &:focus {\n background: ", ";\n }\n "])), token.colorFillTertiary, token.colorFillSecondary, token.colorBgBase),
17
19
  borderless: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n "]))),
18
20
  disabled: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n color: ", ";\n background: ", ";\n "])), token.colorTextDisabled, token.colorBgContainerDisabled)
@@ -12,6 +12,7 @@ import { getMonaco } from "./monaco";
12
12
  /**
13
13
  * @see https://microsoft.github.io/monaco-editor/api/index.html
14
14
  */
15
+
15
16
  var CURRENT_LANGUAGE = isBrowser ? (window.locale || window.localStorage.getItem('vdev-locale') || '').replace(/_/, '-') || 'zh-CN' : 'zh-CN';
16
17
  export var WORD_EDITOR_INITIALIZING = CURRENT_LANGUAGE === 'en-US' ? 'Initializing Editor' : '编辑器初始化中';
17
18
  export var INITIAL_OPTIONS = {
@@ -1,13 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import { capitalize } from 'lodash-es';
3
3
  export var generateColorPalette = function generateColorPalette(_ref) {
4
- var _ref2;
5
4
  var type = _ref.type,
6
5
  scale = _ref.scale,
7
6
  appearance = _ref.appearance;
8
7
  var name = capitalize(type);
9
8
  var isDarkMode = appearance === 'dark';
10
- return _ref2 = {}, _defineProperty(_ref2, "color".concat(name, "Bg"), scale[appearance][1]), _defineProperty(_ref2, "color".concat(name, "BgHover"), scale[appearance][2]), _defineProperty(_ref2, "color".concat(name, "Border"), scale[appearance][4]), _defineProperty(_ref2, "color".concat(name, "BorderHover"), scale[appearance][isDarkMode ? 5 : 3]), _defineProperty(_ref2, "color".concat(name, "Hover"), scale[appearance][isDarkMode ? 10 : 8]), _defineProperty(_ref2, "color".concat(name), scale[appearance][9]), _defineProperty(_ref2, "color".concat(name, "Active"), scale[appearance][isDarkMode ? 7 : 10]), _defineProperty(_ref2, "color".concat(name, "TextHover"), scale[appearance][isDarkMode ? 10 : 8]), _defineProperty(_ref2, "color".concat(name, "Text"), scale[appearance][9]), _defineProperty(_ref2, "color".concat(name, "TextActive"), scale[appearance][isDarkMode ? 7 : 10]), _ref2;
9
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "color".concat(name, "Bg"), scale[appearance][1]), "color".concat(name, "BgHover"), scale[appearance][2]), "color".concat(name, "Border"), scale[appearance][4]), "color".concat(name, "BorderHover"), scale[appearance][isDarkMode ? 5 : 3]), "color".concat(name, "Hover"), scale[appearance][isDarkMode ? 10 : 8]), "color".concat(name), scale[appearance][9]), "color".concat(name, "Active"), scale[appearance][isDarkMode ? 7 : 10]), "color".concat(name, "TextHover"), scale[appearance][isDarkMode ? 10 : 8]), "color".concat(name, "Text"), scale[appearance][9]), "color".concat(name, "TextActive"), scale[appearance][isDarkMode ? 7 : 10]);
11
10
  };
12
11
  export var generateColorNeutralPalette = function generateColorNeutralPalette(_ref3) {
13
12
  var scale = _ref3.scale,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuntijs/ui",
3
- "version": "1.0.0-beta.56",
3
+ "version": "1.0.0-beta.57",
4
4
  "description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
5
5
  "keywords": [
6
6
  "yuntijs",
@@ -115,7 +115,7 @@
115
115
  "babel-plugin-antd-style": "latest",
116
116
  "commitlint": "^18",
117
117
  "dayjs": "^1.11.10",
118
- "dumi": "^2.4.6",
118
+ "dumi": "^2.4.7",
119
119
  "dumi-theme-yunti": "^1.1.7",
120
120
  "eslint": "^8.56.0",
121
121
  "father": "^4.3.8",