@titaui/pc 1.10.45 → 1.10.48

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/lib/components/checkbox/index.css +1 -0
  2. package/lib/components/dialog/index.css +4 -1
  3. package/lib/components/dialog/index.js +1 -1
  4. package/lib/components/drawer-manager/index.js +6 -1
  5. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +10 -47
  6. package/lib/components/dynamic/dynamic-item/dynamic-chart/utils.js +61 -0
  7. package/lib/components/mblog/index.js +14 -5
  8. package/lib/components/nav-top/components/menu/index.css +4 -2
  9. package/lib/components/nav-top/components/user-message/index.css +2 -2
  10. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +8 -1
  11. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +19 -1
  12. package/lib/components/okr-share/common-painter/openDataPainter.js +34 -27
  13. package/lib/components/open-data-painter/index.js +5 -1
  14. package/lib/components/rich-editor/plugins/block/block-quote/index.js +3 -1
  15. package/lib/components/rich-editor/plugins/block/heading/index.js +5 -3
  16. package/lib/components/rich-editor/plugins/block/lists/index.js +4 -2
  17. package/lib/components/rich-editor/plugins/extension/alignment/index.js +5 -3
  18. package/lib/components/rich-editor/plugins/inline/color/index.js +13 -5
  19. package/lib/components/rich-editor/plugins/inline/color/selector.js +4 -2
  20. package/lib/components/rich-editor/plugins/inline/color/util.js +25 -0
  21. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +3 -1
  22. package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +7 -5
  23. package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +17 -4
  24. package/lib/components/rich-editor/plugins/inline/strong/index.js +3 -1
  25. package/lib/components/rich-editor/plugins/inline/under-line/index.js +3 -1
  26. package/lib/components/rich-editor/ui/editor/index.js +6 -1
  27. package/lib/components/rich-editor/ui/normal-toolbar/index.css +7 -2
  28. package/lib/components/superset-charts/components/chart/index.js +12 -22
  29. package/lib/components/superset-charts/{init/insert-assets.js → fetch-assets-and-append/append-assets.js} +29 -24
  30. package/lib/components/superset-charts/{init/use-get-assets.js → fetch-assets-and-append/get-assets-with-cache.js} +26 -20
  31. package/lib/components/superset-charts/fetch-assets-and-append/index.js +79 -0
  32. package/lib/components/superset-charts/utils/axios.js +8 -4
  33. package/lib/components/toast/index.js +2 -10
  34. package/lib/components/weekly-report/common-painter/openDataPainter.js +5 -1
  35. package/lib/pages/new-okr-list/index.js +3 -3
  36. package/package.json +2 -1
  37. package/lib/components/superset-charts/init/index.js +0 -61
  38. package/yarn-error.log +0 -22184
@@ -11,6 +11,7 @@
11
11
 
12
12
  .titaui-checkbox--checked {
13
13
  background: url(./checked.svg) transparent no-repeat 50% 50%;
14
+ border: none;
14
15
  }
15
16
 
16
17
  .titaui-checkbox--disabled {
@@ -28,7 +28,10 @@
28
28
  }
29
29
 
30
30
  .titaui-dialog .rc-dialog-close {
31
- top: 16px;
31
+ padding: 0;
32
+ font-size: 20px;
33
+ right: 30px;
34
+ top: 20px;
32
35
  cursor: pointer;
33
36
  opacity: 1 !important;
34
37
  z-index: 2;
@@ -108,7 +108,7 @@ function _default(props) {
108
108
  visible: visible,
109
109
  className: (0, _classnames["default"])(preCls, _toConsumableArray(extraClass), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(preCls, "-no-head-line"), noHeadLine), _defineProperty(_classNames2, "".concat(preCls, "-no-footer-line"), noFooterLine), _defineProperty(_classNames2, "".concat(preCls, "-no-close"), noCloseIcon), _defineProperty(_classNames2, "".concat(preCls, "-no-footer"), noFooter), _classNames2)),
110
110
  closeIcon: /*#__PURE__*/_react["default"].createElement("span", {
111
- className: "tu-icon-close"
111
+ className: "tu-icon-canceled"
112
112
  }),
113
113
  animation: "slide-fade",
114
114
  maskAnimation: "fade",
@@ -159,7 +159,12 @@ var DrawerManager = /*#__PURE__*/function () {
159
159
  saveProps: function saveProps() {
160
160
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
161
161
  var current = _this2.history[_this2.history.length - 1];
162
- current.props = _objectSpread(_objectSpread({}, current.props), props);
162
+
163
+ if (current) {
164
+ current.props = _objectSpread(_objectSpread({}, current.props), props);
165
+ } else {
166
+ current.props = _objectSpread({}, props);
167
+ }
163
168
  }
164
169
  }
165
170
  }, /*#__PURE__*/_react["default"].createElement(_drawerWrapper["default"], {
@@ -25,6 +25,8 @@ var _tools = require("../../../../utils/tools");
25
25
 
26
26
  var _header = _interopRequireDefault(require("../components/header"));
27
27
 
28
+ var _utils = require("./utils");
29
+
28
30
  require("./index.css");
29
31
 
30
32
  var _excluded = ["data"];
@@ -41,47 +43,6 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
41
43
 
42
44
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
43
45
 
44
- var getChartProps = function getChartProps(chartPropsStr) {
45
- var chartQuery = JSON.parse(chartPropsStr);
46
-
47
- if (typeof chartQuery === "number") {
48
- return {
49
- chartId: String(chartQuery)
50
- };
51
- }
52
-
53
- return {
54
- chartId: chartQuery.id,
55
- timeRange: chartQuery.timeRange
56
- };
57
- };
58
-
59
- var systemPublisher = {
60
- avatar: {
61
- big: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_b.png",
62
- color: "#f0c75a",
63
- hasAvatar: true,
64
- large: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_l.png",
65
- medium: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_m.png",
66
- normal: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_n.png",
67
- original: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_o.png",
68
- small: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_s.png"
69
- },
70
- blessingType: 0,
71
- decorationType: 0,
72
- departmentId: 0,
73
- departmentName: null,
74
- jobState: 0,
75
- medalPosition: null,
76
- medalUrl: null,
77
- name: "Tita小助手",
78
- postition: null,
79
- praiseType: 0,
80
- tag: null,
81
- userId: 100000,
82
- userMark: null,
83
- userType: 0
84
- };
85
46
  var prefixCls = "titaui-dynamic-chart";
86
47
 
87
48
  var DynamicChart = function DynamicChart(_ref) {
@@ -93,7 +54,9 @@ var DynamicChart = function DynamicChart(_ref) {
93
54
  var _useContext = (0, _react.useContext)(_context.SearchKeyContext),
94
55
  searchKeyWord = _useContext.searchKeyWord;
95
56
 
96
- var chartQuery = getChartProps(data.biId);
57
+ var chartQuery = (0, _utils.getChartProps)(data.biId); // const chartQuery = getChartProps('{"type":"diaryFeedChart","id":"43","timeRange":"2022/03/01T00:00:00 : 2022/03/05T00:00:00"}');
58
+ // console.log(chartQuery);
59
+
97
60
  (0, _react.useEffect)(function () {
98
61
  (0, _tools.highLightWord)({
99
62
  parentDom: contentRef.current,
@@ -105,7 +68,7 @@ var DynamicChart = function DynamicChart(_ref) {
105
68
  }, /*#__PURE__*/_react["default"].createElement(_header["default"], _extends({
106
69
  data: data
107
70
  }, restProps, {
108
- user: systemPublisher,
71
+ user: _utils.systemPublisher,
109
72
  desc: /*#__PURE__*/_react["default"].createElement("div", {
110
73
  style: {
111
74
  marginLeft: "4px",
@@ -128,11 +91,11 @@ var DynamicChart = function DynamicChart(_ref) {
128
91
  alt: "right"
129
92
  }))), /*#__PURE__*/_react["default"].createElement("div", {
130
93
  className: "".concat(prefixCls, "__charts")
131
- }, /*#__PURE__*/_react["default"].createElement(_supersetCharts["default"], _extends({}, chartQuery, {
132
- layout: "feed-card",
94
+ }, /*#__PURE__*/_react["default"].createElement(_supersetCharts["default"], _extends({
133
95
  width: 800,
134
- height: 400
135
- }))));
96
+ height: 400,
97
+ layout: "feed-card"
98
+ }, chartQuery))));
136
99
  };
137
100
 
138
101
  var _default = DynamicChart;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.systemPublisher = exports.safeParse = exports.getChartProps = void 0;
7
+ var systemPublisher = {
8
+ avatar: {
9
+ big: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_b.png",
10
+ color: "#f0c75a",
11
+ hasAvatar: true,
12
+ large: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_l.png",
13
+ medium: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_m.png",
14
+ normal: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_n.png",
15
+ original: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_o.png",
16
+ small: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_s.png"
17
+ },
18
+ blessingType: 0,
19
+ decorationType: 0,
20
+ departmentId: 0,
21
+ departmentName: null,
22
+ jobState: 0,
23
+ medalPosition: null,
24
+ medalUrl: null,
25
+ name: "Tita小助手",
26
+ postition: null,
27
+ praiseType: 0,
28
+ tag: null,
29
+ userId: 100000,
30
+ userMark: null,
31
+ userType: 0
32
+ };
33
+ exports.systemPublisher = systemPublisher;
34
+
35
+ var safeParse = function safeParse(json) {
36
+ var parsed = {};
37
+
38
+ try {
39
+ parsed = JSON.parse(json);
40
+ } catch (e) {
41
+ throw new Error(e);
42
+ }
43
+
44
+ return parsed;
45
+ };
46
+
47
+ exports.safeParse = safeParse;
48
+
49
+ var getChartProps = function getChartProps(json) {
50
+ var parsed = safeParse(json);
51
+
52
+ if (typeof parsed === "number") {
53
+ return {
54
+ id: parsed
55
+ };
56
+ }
57
+
58
+ return parsed;
59
+ };
60
+
61
+ exports.getChartProps = getChartProps;
@@ -169,17 +169,23 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
169
169
  };
170
170
 
171
171
  _this.handlerDealAttachemntData = function (uploadSuccessFilesPath) {
172
+ var _this$refs$textEditor2;
173
+
172
174
  var successFilesPath = uploadSuccessFilesPath.filter(function (item) {
173
175
  return item !== "";
174
176
  });
175
177
  var successFilesPathLen = successFilesPath.length; // @ts-ignore
176
178
 
177
- var textareaInput = _this.refs.textEditor.refs.textareaInput;
179
+ var _this$refs$textEditor = (_this$refs$textEditor2 = _this.refs.textEditor) === null || _this$refs$textEditor2 === void 0 ? void 0 : _this$refs$textEditor2.refs,
180
+ textareaInput = _this$refs$textEditor.textareaInput;
181
+
178
182
  var textareaValue = _this.state.textareaValue; // textareaValue = dealWithLoadedFileTips(textareaValue, successFilesPathLen); // 更新输入框内容
179
183
 
180
184
  localStorage.setItem(_this.state.localStroageKey, textareaValue); // 将输入框内容进行本地缓存
181
185
 
182
- textareaInput.focus();
186
+ if (textareaInput) {
187
+ textareaInput.focus();
188
+ }
183
189
 
184
190
  _this.setState({
185
191
  textareaValue: textareaValue,
@@ -192,9 +198,12 @@ var MBlog = /*#__PURE__*/function (_PureComponent) {
192
198
  _this.focus = function () {
193
199
  // @ts-ignore
194
200
  var textareaInput = _this.refs.textEditor.refs.textareaInput;
195
- setTimeout(function () {
196
- textareaInput.focus();
197
- }, 300);
201
+
202
+ if (textareaInput) {
203
+ setTimeout(function () {
204
+ textareaInput.focus();
205
+ }, 300);
206
+ }
198
207
  };
199
208
 
200
209
  _this.allowSubmit = function (content) {
@@ -49,8 +49,10 @@
49
49
  font-size: 12px;
50
50
  color: #ffffff;
51
51
  line-height: 18px;
52
- padding: 1px 5px;
53
- text-align: center;
52
+ padding: 0 4px;
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: center;
54
56
  min-width: 8px;
55
57
  font-weight: 400;
56
58
  }
@@ -30,8 +30,8 @@
30
30
  border-radius: 18px;
31
31
  font-size: 12px;
32
32
  color: #ffffff;
33
- line-height: 18px;
34
- padding: 1px 5px;
33
+ line-height: 16px;
34
+ padding: 0 4px;
35
35
  top: -4px;
36
36
  left: 12px;
37
37
  text-align: center;
@@ -120,6 +120,9 @@ function _default(props) {
120
120
  window.open(window.location.href.replace(location.hash, "#work?iTalentNavCode=tita-work&work_id=".concat(data.id)));
121
121
  };
122
122
 
123
+ var workApplyType = data.workApplyType,
124
+ workApplyStatus = data.workApplyStatus;
125
+ var isCreate = (workApplyStatus === 1 || workApplyStatus === 3 || workApplyStatus === 4) && workApplyType === 48;
123
126
  return /*#__PURE__*/_react["default"].createElement("div", {
124
127
  key: index,
125
128
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node"))
@@ -130,10 +133,14 @@ function _default(props) {
130
133
  })), /*#__PURE__*/_react["default"].createElement("span", {
131
134
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-title ")),
132
135
  onClick: openProjectDetail
136
+ }, /*#__PURE__*/_react["default"].createElement("span", {
137
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-title-name "))
133
138
  }, /*#__PURE__*/_react["default"].createElement(_tooltipText["default"], {
134
139
  text: (0, _helpers.escapeHtml)(title),
135
140
  isPercent: true
136
- })), /*#__PURE__*/_react["default"].createElement("div", {
141
+ })), isCreate && /*#__PURE__*/_react["default"].createElement("span", {
142
+ className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-title-approvaling"))
143
+ }, "\u7ACB\u9879\u4E2D")), /*#__PURE__*/_react["default"].createElement("div", {
137
144
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions"))
138
145
  }, /*#__PURE__*/_react["default"].createElement("span", {
139
146
  className: (0, _classnames["default"])("".concat(_precls["default"], "__e-project-node-actions-user"))
@@ -147,7 +147,7 @@
147
147
  }
148
148
 
149
149
  .tita-okrdt-tree__e-project-node-title {
150
- display: inline-block;
150
+ display: inline-flex;
151
151
  font-size: 14px;
152
152
  font-family: -apple-system, Arial, Verdana, Helvetica Neue, Helvetica, sans-serif, PingFang SC, Microsoft YaHei;
153
153
  color: #3f4755;
@@ -158,6 +158,24 @@
158
158
  flex: 1;
159
159
  }
160
160
 
161
+ .tita-okrdt-tree__e-project-node-title-name {
162
+ overflow: hidden;
163
+ }
164
+
165
+ .tita-okrdt-tree__e-project-node-title-approvaling {
166
+ display: inline-flex;
167
+ align-items: center;
168
+ justify-content: center;
169
+ min-width: 48px;
170
+ height: 20px;
171
+ font-size: 12px;
172
+ font-weight: 400;
173
+ color: #F05E5E;
174
+ background: rgba(240, 94, 94, 0.1);
175
+ border-radius: 10px;
176
+ margin-left: 8px;
177
+ }
178
+
161
179
  .tita-okrdt-tree__e-project-node-gray {
162
180
  color: #BFC7D5 !important;
163
181
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = _default;
6
+ exports["default"] = void 0;
7
7
 
8
8
  var _openData = require("../../../utils/open-data");
9
9
 
@@ -13,12 +13,38 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
13
13
 
14
14
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
15
15
 
16
- function _default(_x, _x2, _x3) {
17
- return _ref.apply(this, arguments);
16
+ var getOpenData = function getOpenData(_ref) {
17
+ var id = _ref.id,
18
+ name = _ref.name,
19
+ type = _ref.type;
20
+ var openId = (0, _openData.getOpenId)(id, type);
21
+ if (!window.WWOpenData || !openId) return Promise.resolve(name);
22
+ return new Promise(function (resolve, reject) {
23
+ window.WWOpenData.prefetch({
24
+ items: [{
25
+ id: openId,
26
+ type: type
27
+ }]
28
+ }, function (err, data) {
29
+ if (err) {
30
+ return reject(err);
31
+ }
32
+
33
+ if (data && data.items[0]) {
34
+ resolve(data.items[0].data);
35
+ } else {
36
+ resolve(name);
37
+ }
38
+ });
39
+ });
40
+ };
41
+
42
+ function openDataPainter(_x, _x2, _x3) {
43
+ return _openDataPainter.apply(this, arguments);
18
44
  }
19
45
 
20
- function _ref() {
21
- _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, openDataParams, lineHeight) {
46
+ function _openDataPainter() {
47
+ _openDataPainter = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ctx, openDataParams, lineHeight) {
22
48
  var maxWidth,
23
49
  name,
24
50
  _ctx$measureText,
@@ -69,27 +95,8 @@ function _ref() {
69
95
  }
70
96
  }, _callee);
71
97
  }));
72
- return _ref.apply(this, arguments);
98
+ return _openDataPainter.apply(this, arguments);
73
99
  }
74
100
 
75
- var getOpenData = function getOpenData(_ref2) {
76
- var id = _ref2.id,
77
- name = _ref2.name,
78
- type = _ref2.type;
79
- var openId = (0, _openData.getOpenId)(id, type);
80
- if (!window.WWOpenData || !openId) return Promise.resolve(name);
81
- return new Promise(function (resolve, reject) {
82
- window.WWOpenData.prefetch({
83
- items: [{
84
- id: openId,
85
- type: type
86
- }]
87
- }, function (err, data) {
88
- if (err) {
89
- return reject(err);
90
- }
91
-
92
- resolve(data.items[0].data);
93
- });
94
- });
95
- };
101
+ var _default = openDataPainter;
102
+ exports["default"] = _default;
@@ -90,7 +90,11 @@ var getOpenData = function getOpenData(_ref2) {
90
90
  return reject(err);
91
91
  }
92
92
 
93
- resolve(data.items[0].data);
93
+ if (data && data.items[0]) {
94
+ resolve(data.items[0].data);
95
+ } else {
96
+ resolve(name);
97
+ }
94
98
  });
95
99
  });
96
100
  };
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.BlockquoteSchema = exports.BlockquotePlugin = exports.BlockquoteController = void 0;
9
9
 
10
+ var _getLocale = require("../../../../../utils/getLocale");
11
+
10
12
  var _controller = _interopRequireDefault(require("../../../models/controller"));
11
13
 
12
14
  var _plugin = _interopRequireDefault(require("../../../models/plugin"));
@@ -87,7 +89,7 @@ var BlockquoteController = /*#__PURE__*/function (_BaseController) {
87
89
  }
88
90
 
89
91
  return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = {
90
- title: '引用',
92
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Quote'),
91
93
  icon: 'tu-icon-text-quotel',
92
94
  handler: function handler(editor) {
93
95
  (0, _commond.wrapInBlockquote)(editor);
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.HeadingSchema = exports.HeadingPlugin = void 0;
9
9
 
10
+ var _getLocale = require("../../../../../utils/getLocale");
11
+
10
12
  var _controller = _interopRequireDefault(require("../../../models/controller"));
11
13
 
12
14
  var _plugin = _interopRequireDefault(require("../../../models/plugin"));
@@ -124,7 +126,7 @@ var HeadingController = /*#__PURE__*/function (_BaseController) {
124
126
  }
125
127
 
126
128
  return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = [{
127
- title: '一级标题',
129
+ title: (0, _getLocale.getLocale)('Rtx_HeadingONE'),
128
130
  icon: 'tu-icon-text-H1',
129
131
  handler: function handler(editor) {
130
132
  (0, _commonds.setHeadLine)(editor, 1);
@@ -136,7 +138,7 @@ var HeadingController = /*#__PURE__*/function (_BaseController) {
136
138
  });
137
139
  }
138
140
  }, {
139
- title: '二级标题',
141
+ title: (0, _getLocale.getLocale)('Rtx_HeadingTWO'),
140
142
  icon: 'tu-icon-text-H2',
141
143
  handler: function handler(editor) {
142
144
  (0, _commonds.setHeadLine)(editor, 2);
@@ -148,7 +150,7 @@ var HeadingController = /*#__PURE__*/function (_BaseController) {
148
150
  });
149
151
  }
150
152
  }, {
151
- title: '三级标题',
153
+ title: (0, _getLocale.getLocale)('Rtx_HeadingTHR'),
152
154
  icon: 'tu-icon-text-H3',
153
155
  handler: function handler(editor) {
154
156
  (0, _commonds.setHeadLine)(editor, 3);
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.OrderedListSchema = exports.ListPlugin = exports.ListItemSchema = exports.ListController = exports.BulletListSchema = void 0;
9
9
 
10
+ var _getLocale = require("../../../../../utils/getLocale");
11
+
10
12
  var _controller = _interopRequireDefault(require("../../../models/controller"));
11
13
 
12
14
  var _plugin = _interopRequireDefault(require("../../../models/plugin"));
@@ -166,7 +168,7 @@ var ListController = /*#__PURE__*/function (_BaseController) {
166
168
  }
167
169
 
168
170
  return _possibleConstructorReturn(_this4, (_this4 = _super4.call.apply(_super4, [this].concat(args)), _this4.toolbar = [{
169
- title: '无序列表',
171
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Numberedlist'),
170
172
  icon: 'tu-icon-text-bullet-list',
171
173
  handler: function handler(editor) {
172
174
  (0, _commond.toggleBulletList)(editor.view);
@@ -179,7 +181,7 @@ var ListController = /*#__PURE__*/function (_BaseController) {
179
181
  return _main.pluginKey.getState(state).bulletListDisabled;
180
182
  }
181
183
  }, {
182
- title: '有序列表',
184
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Bulletedlist'),
183
185
  icon: 'tu-icon-text-number-list',
184
186
  handler: function handler(editor) {
185
187
  (0, _commond.toggleOrderedList)(editor.view);
@@ -15,6 +15,8 @@ var _commond = require("./commond");
15
15
 
16
16
  var _utils = require("./utils");
17
17
 
18
+ var _getLocale = require("../../../../../utils/getLocale");
19
+
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
21
 
20
22
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -54,7 +56,7 @@ var AlignmentController = /*#__PURE__*/function (_BaseController) {
54
56
  }
55
57
 
56
58
  return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.toolbar = [{
57
- title: '左对齐',
59
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Alignleft'),
58
60
  icon: 'tu-icon-text-left',
59
61
  handler: function handler(editor) {
60
62
  (0, _commond.setAlignment)(editor, 'left');
@@ -63,7 +65,7 @@ var AlignmentController = /*#__PURE__*/function (_BaseController) {
63
65
  return (0, _utils.hasAlignment)(state, 'left');
64
66
  }
65
67
  }, {
66
- title: '居中对齐',
68
+ title: (0, _getLocale.getLocale)('Rtx_Aligncenter'),
67
69
  icon: 'tu-icon-text-center',
68
70
  handler: function handler(editor) {
69
71
  (0, _commond.setAlignment)(editor, 'center');
@@ -72,7 +74,7 @@ var AlignmentController = /*#__PURE__*/function (_BaseController) {
72
74
  return (0, _utils.hasAlignment)(state, 'center');
73
75
  }
74
76
  }, {
75
- title: '右对齐',
77
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Alignright'),
76
78
  icon: 'tu-icon-text-right',
77
79
  handler: function handler(editor) {
78
80
  (0, _commond.setAlignment)(editor, 'right');
@@ -17,6 +17,12 @@ var _prosemirrorCommands = require("prosemirror-commands");
17
17
 
18
18
  var _selector = _interopRequireDefault(require("./selector"));
19
19
 
20
+ var _getLocale = require("../../../../../utils/getLocale");
21
+
22
+ var _util = require("./util");
23
+
24
+ var _consts = require("./consts");
25
+
20
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
27
 
22
28
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -48,10 +54,11 @@ var colorReg = /^\s*(rgba\([^)]+\)|rgb\([^)]+\)|#[\d|a-f]{3,6})|\w*/i;
48
54
 
49
55
  var getColorAttrs = function getColorAttrs(style) {
50
56
  var color = style;
57
+ var key = (0, _util.findColor)(color, _consts.FontColor);
51
58
 
52
- if (color) {
59
+ if (key) {
53
60
  return {
54
- color: color
61
+ color: _consts.FontColor[key]
55
62
  };
56
63
  }
57
64
 
@@ -105,10 +112,11 @@ var getBgAttrs = function getBgAttrs(style) {
105
112
  var colorMatch = style.match(colorReg);
106
113
  if (!colorMatch) return false;
107
114
  var background = colorMatch[0];
115
+ var key = (0, _util.findColor)(background, _consts.BackgroundColor);
108
116
 
109
- if (background) {
117
+ if (key) {
110
118
  return {
111
- color: background
119
+ color: _consts.BackgroundColor[key]
112
120
  };
113
121
  }
114
122
 
@@ -171,7 +179,7 @@ var ColorController = /*#__PURE__*/function (_BaseController) {
171
179
  }
172
180
 
173
181
  return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.toolbar = {
174
- title: '文字颜色',
182
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Textcolor'),
175
183
  icon: 'tu-icon-text-color',
176
184
  handler: function handler(editor) {
177
185
  (0, _prosemirrorCommands.toggleMark)(editor.state.schema.marks[PLUGIN_NAME])(editor.state, editor.view.dispatch);
@@ -23,6 +23,8 @@ var _index2 = require("./index");
23
23
 
24
24
  var _events = require("../../../consts/events");
25
25
 
26
+ var _getLocale = require("../../../../../utils/getLocale");
27
+
26
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
29
 
28
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -113,14 +115,14 @@ function ColorSelector(_ref) {
113
115
  }
114
116
  }, /*#__PURE__*/_react["default"].createElement("div", {
115
117
  className: preCls + '__title'
116
- }, "\u6587\u5B57\u989C\u8272"), /*#__PURE__*/_react["default"].createElement("div", {
118
+ }, (0, _getLocale.getLocale)('Tasks_Tab_MyS_Textcolor')), /*#__PURE__*/_react["default"].createElement("div", {
117
119
  className: preCls + '__color-box',
118
120
  style: {
119
121
  marginBottom: 10
120
122
  }
121
123
  }, fontColors), /*#__PURE__*/_react["default"].createElement("div", {
122
124
  className: preCls + '__title'
123
- }, "\u80CC\u666F\u989C\u8272"), /*#__PURE__*/_react["default"].createElement("div", {
125
+ }, (0, _getLocale.getLocale)('Rtx_Backgroundcolors')), /*#__PURE__*/_react["default"].createElement("div", {
124
126
  className: preCls + '__color-box'
125
127
  }, backgroundColors));
126
128
  }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.findColor = findColor;
7
+ exports.isColorEqual = isColorEqual;
8
+
9
+ var _color = _interopRequireDefault(require("color"));
10
+
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
+
13
+ function findColor(color, colorEnum) {
14
+ for (var key in colorEnum) {
15
+ if (isColorEqual(colorEnum[key], color)) {
16
+ return key;
17
+ }
18
+ }
19
+
20
+ return null;
21
+ }
22
+
23
+ function isColorEqual(a, b) {
24
+ return new _color["default"](a).contrast(new _color["default"](b)) === 1;
25
+ }
@@ -17,6 +17,8 @@ var _prosemirrorCommands = require("prosemirror-commands");
17
17
 
18
18
  var _mark = require("../../../utils/mark");
19
19
 
20
+ var _getLocale = require("../../../../../utils/getLocale");
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -107,7 +109,7 @@ var DeleteLineController = /*#__PURE__*/function (_BaseController) {
107
109
  }
108
110
 
109
111
  return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = {
110
- title: '删除线',
112
+ title: (0, _getLocale.getLocale)('Rtx_Striketjrough'),
111
113
  icon: 'tu-icon-text-delline',
112
114
  handler: function handler(editor) {
113
115
  (0, _prosemirrorCommands.toggleMark)(editor.state.schema.marks[PLUGIN_NAME])(editor.state, editor.view.dispatch);