@titaui/pc 1.10.45 → 1.10.46

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.
@@ -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"], {
@@ -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;
@@ -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,8 @@ var _prosemirrorCommands = require("prosemirror-commands");
17
17
 
18
18
  var _selector = _interopRequireDefault(require("./selector"));
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"); } }
@@ -171,7 +173,7 @@ var ColorController = /*#__PURE__*/function (_BaseController) {
171
173
  }
172
174
 
173
175
  return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.toolbar = {
174
- title: '文字颜色',
176
+ title: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Textcolor'),
175
177
  icon: 'tu-icon-text-color',
176
178
  handler: function handler(editor) {
177
179
  (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
  }
@@ -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);
@@ -23,6 +23,8 @@ require("./index.css");
23
23
 
24
24
  var _main = require("../pm-plugins/main");
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); }
@@ -111,10 +113,10 @@ function LinkEditor(_ref) {
111
113
  }
112
114
  }, /*#__PURE__*/_react["default"].createElement(_input["default"], {
113
115
  className: preCls + '__input',
114
- label: "\u6587\u672C",
116
+ label: (0, _getLocale.getLocale)('Rtx_Text'),
115
117
  name: "text",
116
118
  layout: "row",
117
- placeholder: "\u8BF7\u8F93\u5165\u6587\u672C",
119
+ placeholder: (0, _getLocale.getLocale)('Rtx_Pleaseentetext'),
118
120
  onChange: function onChange(text) {
119
121
  return setContent(_objectSpread(_objectSpread({}, content), {}, {
120
122
  text: text
@@ -123,10 +125,10 @@ function LinkEditor(_ref) {
123
125
  value: content.text
124
126
  }), /*#__PURE__*/_react["default"].createElement(_input["default"], {
125
127
  className: preCls + '__input',
126
- label: "\u94FE\u63A5",
128
+ label: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Link'),
127
129
  name: "href",
128
130
  layout: "row",
129
- placeholder: "\u6DFB\u52A0\u94FE\u63A5\u5730\u5740",
131
+ placeholder: (0, _getLocale.getLocale)('Rtx_Addlinkaddress'),
130
132
  onChange: function onChange(href) {
131
133
  return setContent(_objectSpread(_objectSpread({}, content), {}, {
132
134
  href: href
@@ -141,7 +143,7 @@ function LinkEditor(_ref) {
141
143
  width: 90
142
144
  },
143
145
  onClick: handleSubmit
144
- }, "\u5E94\u7528"))));
146
+ }, (0, _getLocale.getLocale)('Rtx_Application')))));
145
147
  }
146
148
 
147
149
  var _default = LinkEditor;
@@ -13,12 +13,16 @@ var _prosemirrorUtils = require("prosemirror-utils");
13
13
 
14
14
  var _Popup = _interopRequireDefault(require("../../../../ui/Popup"));
15
15
 
16
+ var _tooltip = _interopRequireDefault(require("../../../../../tooltip"));
17
+
16
18
  var _classnames = _interopRequireDefault(require("classnames"));
17
19
 
18
20
  require("./index.css");
19
21
 
20
22
  var _commands = require("../commands");
21
23
 
24
+ var _getLocale = require("../../../../../../utils/getLocale");
25
+
22
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
27
 
24
28
  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); }
@@ -72,16 +76,25 @@ function LinkToolBar(_ref) {
72
76
  }
73
77
  }, /*#__PURE__*/_react["default"].createElement("div", {
74
78
  className: preCls + '__text'
75
- }, href), /*#__PURE__*/_react["default"].createElement("div", {
79
+ }, href), /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
80
+ overlay: (0, _getLocale.getLocale)('Rtx_Visit'),
81
+ placement: "top"
82
+ }, /*#__PURE__*/_react["default"].createElement("div", {
76
83
  className: (0, _classnames["default"])('tu-icon-visit', preCls + '__btn'),
77
84
  onClick: handleOpenLink
78
- }), /*#__PURE__*/_react["default"].createElement("div", {
85
+ })), /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
86
+ overlay: (0, _getLocale.getLocale)('Mod_Editor'),
87
+ placement: "top"
88
+ }, /*#__PURE__*/_react["default"].createElement("div", {
79
89
  className: (0, _classnames["default"])('tu-icon-bianji3', preCls + '__btn'),
80
90
  onClick: handleEdit
81
- }), /*#__PURE__*/_react["default"].createElement("div", {
91
+ })), /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
92
+ overlay: (0, _getLocale.getLocale)('Tasks_Tab_MyS_Cancellink'),
93
+ placement: "top"
94
+ }, /*#__PURE__*/_react["default"].createElement("div", {
82
95
  className: (0, _classnames["default"])('tu-icon-quxiaoguanlian', preCls + '__btn'),
83
96
  onClick: handleRemoveLink
84
- })));
97
+ }))));
85
98
  }
86
99
 
87
100
  var _default = LinkToolBar;
@@ -17,6 +17,8 @@ var _plugin = _interopRequireDefault(require("../../../models/plugin"));
17
17
 
18
18
  var _schema = require("../../../models/schema");
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"); } }
@@ -97,7 +99,7 @@ var StrongController = /*#__PURE__*/function (_BaseController) {
97
99
  }
98
100
 
99
101
  return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = {
100
- title: '加粗',
102
+ title: (0, _getLocale.getLocale)('Rtx_Bold'),
101
103
  icon: 'tu-icon-text-blod',
102
104
  handler: function handler(editor) {
103
105
  (0, _prosemirrorCommands.toggleMark)(editor.state.schema.marks[PLUGIN_NAME])(editor.state, editor.view.dispatch);
@@ -17,6 +17,8 @@ var _plugin = _interopRequireDefault(require("../../../models/plugin"));
17
17
 
18
18
  var _schema = require("../../../models/schema");
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"); } }
@@ -105,7 +107,7 @@ var UnderLineController = /*#__PURE__*/function (_BaseController) {
105
107
  }
106
108
 
107
109
  return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = {
108
- title: '下划线',
110
+ title: (0, _getLocale.getLocale)('Rtx_Underline'),
109
111
  icon: 'tu-icon-text-underline',
110
112
  handler: function handler(editor) {
111
113
  (0, _prosemirrorCommands.toggleMark)(editor.state.schema.marks[PLUGIN_NAME])(editor.state, editor.view.dispatch);
@@ -48,7 +48,8 @@ function RichEditor(_ref, ref) {
48
48
  onInit = _ref.onInit,
49
49
  _ref$editable = _ref.editable,
50
50
  _editable = _ref$editable === void 0 ? true : _ref$editable,
51
- defaultState = _ref.defaultState;
51
+ defaultState = _ref.defaultState,
52
+ onChange = _ref.onChange;
52
53
 
53
54
  var container = (0, _react.useRef)();
54
55
  var dataRef = (0, _react.useRef)({});
@@ -93,6 +94,10 @@ function RichEditor(_ref, ref) {
93
94
 
94
95
  this.updateState(state);
95
96
  dispatcher.emit(_events.EDITOR_STATE_CHANGE, state);
97
+
98
+ if (tr.docChanged) {
99
+ onChange === null || onChange === void 0 ? void 0 : onChange(state);
100
+ }
96
101
  }
97
102
  });
98
103
  dataRef.current.editor = new _editor["default"]({
@@ -4,8 +4,8 @@
4
4
  }
5
5
 
6
6
  .tita-rich-editor-normal-toolbar-item {
7
- width: 24px;
8
- height: 24px;
7
+ width: 32px;
8
+ height: 32px;
9
9
  margin: 0 2px;
10
10
  font-size: 16px;
11
11
  display: flex;
@@ -24,6 +24,10 @@
24
24
  background: #f0f4fa;
25
25
  }
26
26
 
27
+ .tita-rich-editor-normal-toolbar-item--disabled {
28
+ color: #bfc7d5;
29
+ }
30
+
27
31
  .tita-rich-editor-normal-toolbar-item--disabled:hover {
28
32
  cursor: not-allowed;
29
33
  }
@@ -61,8 +61,8 @@ var beforeResponse = function beforeResponse(res) {
61
61
  config.retry = 3;
62
62
  config.retryCount = config.retryCount || 0;
63
63
 
64
- if (res.data.code === 203) {
65
- // 203错误表示未登录授权或者token失效
64
+ if (res.data.code === 401) {
65
+ // 401错误表示未登录授权或者token失效
66
66
  clearToken();
67
67
 
68
68
  if (config.retryCount <= config.retry) {
@@ -132,11 +132,7 @@ var Toast = /*#__PURE__*/function () {
132
132
  while (1) {
133
133
  switch (_context2.prev = _context2.next) {
134
134
  case 0:
135
- options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {
136
- style: {
137
- position: "fixed"
138
- }
139
- };
135
+ options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
140
136
  key = (0, _uuid["default"])();
141
137
  _context2.next = 4;
142
138
  return getInstance();
@@ -177,11 +173,7 @@ var Toast = /*#__PURE__*/function () {
177
173
  while (1) {
178
174
  switch (_context3.prev = _context3.next) {
179
175
  case 0:
180
- options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {
181
- style: {
182
- position: "fixed"
183
- }
184
- };
176
+ options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {};
185
177
  key = (0, _uuid["default"])();
186
178
  _context3.next = 4;
187
179
  return getInstance();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.45",
3
+ "version": "1.10.46",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",