@titaui/pc 1.10.39 → 1.10.43

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 (104) hide show
  1. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +18 -3
  2. package/lib/components/upload/index.js +2 -4
  3. package/lib/index.js +0 -8
  4. package/package.json +2 -20
  5. package/lib/components/rich-editor/basic/schema.js +0 -47
  6. package/lib/components/rich-editor/consts/events.js +0 -12
  7. package/lib/components/rich-editor/enums.js +0 -42
  8. package/lib/components/rich-editor/index.js +0 -58
  9. package/lib/components/rich-editor/keymap.js +0 -119
  10. package/lib/components/rich-editor/keymaps/index.js +0 -241
  11. package/lib/components/rich-editor/models/controller.js +0 -18
  12. package/lib/components/rich-editor/models/editor.js +0 -47
  13. package/lib/components/rich-editor/models/plugin.js +0 -20
  14. package/lib/components/rich-editor/models/schema.js +0 -121
  15. package/lib/components/rich-editor/plugins/block/block-quote/commond.js +0 -27
  16. package/lib/components/rich-editor/plugins/block/block-quote/index.js +0 -126
  17. package/lib/components/rich-editor/plugins/block/heading/commonds.js +0 -31
  18. package/lib/components/rich-editor/plugins/block/heading/index.js +0 -188
  19. package/lib/components/rich-editor/plugins/block/index.js +0 -57
  20. package/lib/components/rich-editor/plugins/block/lists/actions/conversions.js +0 -172
  21. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list-items-selected.js +0 -163
  22. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list.js +0 -59
  23. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-forward.js +0 -74
  24. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/index.js +0 -45
  25. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -104
  26. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -92
  27. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -89
  28. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -48
  29. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -61
  30. package/lib/components/rich-editor/plugins/block/lists/actions/merge-lists.js +0 -34
  31. package/lib/components/rich-editor/plugins/block/lists/actions/outdent-list-items-selected.js +0 -289
  32. package/lib/components/rich-editor/plugins/block/lists/actions/wrap-and-join-lists.js +0 -180
  33. package/lib/components/rich-editor/plugins/block/lists/baseCommand.js +0 -328
  34. package/lib/components/rich-editor/plugins/block/lists/commond/indent-list.js +0 -60
  35. package/lib/components/rich-editor/plugins/block/lists/commond/index.js +0 -398
  36. package/lib/components/rich-editor/plugins/block/lists/commond/join-list-item-forward.js +0 -45
  37. package/lib/components/rich-editor/plugins/block/lists/commond/listBackspace.js +0 -302
  38. package/lib/components/rich-editor/plugins/block/lists/commond/outdent-list.js +0 -43
  39. package/lib/components/rich-editor/plugins/block/lists/index.js +0 -222
  40. package/lib/components/rich-editor/plugins/block/lists/messages.js +0 -38
  41. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/input-rule.js +0 -152
  42. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/keymap.js +0 -33
  43. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/main.js +0 -94
  44. package/lib/components/rich-editor/plugins/block/lists/styles.js +0 -15
  45. package/lib/components/rich-editor/plugins/block/lists/transforms.js +0 -347
  46. package/lib/components/rich-editor/plugins/block/lists/utils/analytics.js +0 -48
  47. package/lib/components/rich-editor/plugins/block/lists/utils/find.js +0 -126
  48. package/lib/components/rich-editor/plugins/block/lists/utils/indentation.js +0 -87
  49. package/lib/components/rich-editor/plugins/block/lists/utils/node.js +0 -144
  50. package/lib/components/rich-editor/plugins/block/lists/utils/replace-content.js +0 -31
  51. package/lib/components/rich-editor/plugins/block/lists/utils/selection.js +0 -201
  52. package/lib/components/rich-editor/plugins/block/lists/utils.js +0 -52
  53. package/lib/components/rich-editor/plugins/block/paragraph/index.js +0 -91
  54. package/lib/components/rich-editor/plugins/core/index.js +0 -90
  55. package/lib/components/rich-editor/plugins/core/pm-plugins/focus-handler.js +0 -67
  56. package/lib/components/rich-editor/plugins/core/pm-plugins/keymap.js +0 -29
  57. package/lib/components/rich-editor/plugins/core/pm-plugins/reactNodeView.js +0 -80
  58. package/lib/components/rich-editor/plugins/extension/alignment/commond.js +0 -24
  59. package/lib/components/rich-editor/plugins/extension/alignment/index.js +0 -111
  60. package/lib/components/rich-editor/plugins/extension/alignment/utils.js +0 -19
  61. package/lib/components/rich-editor/plugins/extension/index.js +0 -18
  62. package/lib/components/rich-editor/plugins/index.js +0 -44
  63. package/lib/components/rich-editor/plugins/inline/color/commond.js +0 -128
  64. package/lib/components/rich-editor/plugins/inline/color/consts.js +0 -43
  65. package/lib/components/rich-editor/plugins/inline/color/index.css +0 -61
  66. package/lib/components/rich-editor/plugins/inline/color/index.js +0 -209
  67. package/lib/components/rich-editor/plugins/inline/color/selector.js +0 -252
  68. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +0 -147
  69. package/lib/components/rich-editor/plugins/inline/em/index.js +0 -93
  70. package/lib/components/rich-editor/plugins/inline/index.js +0 -83
  71. package/lib/components/rich-editor/plugins/inline/link/commands.js +0 -256
  72. package/lib/components/rich-editor/plugins/inline/link/index.js +0 -149
  73. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/fake-cursor-for-toolbar.js +0 -77
  74. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/main.js +0 -293
  75. package/lib/components/rich-editor/plugins/inline/link/ui/index.css +0 -79
  76. package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +0 -148
  77. package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +0 -88
  78. package/lib/components/rich-editor/plugins/inline/link/ui/toolbarBtn.js +0 -117
  79. package/lib/components/rich-editor/plugins/inline/link/utils.js +0 -33
  80. package/lib/components/rich-editor/plugins/inline/strong/index.js +0 -137
  81. package/lib/components/rich-editor/plugins/inline/under-line/index.js +0 -145
  82. package/lib/components/rich-editor/plugins/util.js +0 -281
  83. package/lib/components/rich-editor/react/reactNodeView.js +0 -383
  84. package/lib/components/rich-editor/react/uiProvider.js +0 -185
  85. package/lib/components/rich-editor/schemas/basic.js +0 -309
  86. package/lib/components/rich-editor/schemas/index.js +0 -19
  87. package/lib/components/rich-editor/schemas/list.js +0 -342
  88. package/lib/components/rich-editor/types/commond.js +0 -5
  89. package/lib/components/rich-editor/types/index.js +0 -18
  90. package/lib/components/rich-editor/ui/Popup/index.js +0 -247
  91. package/lib/components/rich-editor/ui/Popup/utils.js +0 -399
  92. package/lib/components/rich-editor/ui/editor/index.css +0 -141
  93. package/lib/components/rich-editor/ui/editor/index.js +0 -130
  94. package/lib/components/rich-editor/ui/normal-toolbar/index.css +0 -28
  95. package/lib/components/rich-editor/ui/normal-toolbar/index.js +0 -109
  96. package/lib/components/rich-editor/utils/browser.js +0 -35
  97. package/lib/components/rich-editor/utils/commands.js +0 -266
  98. package/lib/components/rich-editor/utils/document.js +0 -160
  99. package/lib/components/rich-editor/utils/event.js +0 -79
  100. package/lib/components/rich-editor/utils/helpers.js +0 -16
  101. package/lib/components/rich-editor/utils/mark.js +0 -168
  102. package/lib/components/rich-editor/utils/slice.js +0 -85
  103. package/lib/components/rich-editor/utils/toolbar.js +0 -228
  104. package/yarn-error.log +0 -22184
@@ -1,252 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
-
10
- var _react = _interopRequireWildcard(require("react"));
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _popup = _interopRequireDefault(require("../../../../popup"));
15
-
16
- require("./index.css");
17
-
18
- var _consts = require("./consts");
19
-
20
- var _commond = require("./commond");
21
-
22
- var _index2 = require("./index");
23
-
24
- var _events = require("../../../consts/events");
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
-
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); }
29
-
30
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
32
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
-
34
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
35
-
36
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
37
-
38
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
39
-
40
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
41
-
42
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
-
44
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
45
-
46
- var preCls = 'tita-rich-editor-color-selector';
47
-
48
- function ColorSelector(_ref) {
49
- var editor = _ref.editor,
50
- config = _ref.config,
51
- color = _ref.color,
52
- background = _ref.background,
53
- onClickItem = _ref.onClickItem;
54
- var fontColors = (0, _react.useMemo)(function () {
55
- var colors = [];
56
-
57
- var _loop = function _loop(key) {
58
- if (key == 'default') return "continue";
59
- var c = _consts.FontColor[key];
60
- var cls = (0, _classnames["default"])("".concat(preCls, "__item"), config.icon, _defineProperty({}, "".concat(preCls, "__item--active"), color == c));
61
- colors.push( /*#__PURE__*/_react["default"].createElement("div", {
62
- key: c,
63
- className: cls,
64
- style: {
65
- color: c
66
- },
67
- onClick: function onClick() {
68
- onClickItem(editor.state.schema.marks[_index2.FONT_COLOR_SCHEMA_NAME], c);
69
- }
70
- }));
71
- };
72
-
73
- for (var key in _consts.FontColor) {
74
- var _ret = _loop(key);
75
-
76
- if (_ret === "continue") continue;
77
- }
78
-
79
- return colors;
80
- }, [color]);
81
- var backgroundColors = (0, _react.useMemo)(function () {
82
- var colors = [];
83
-
84
- var _loop2 = function _loop2(key) {
85
- if (key == 'default') return "continue";
86
- var color = _consts.BackgroundColor[key];
87
- var cls = (0, _classnames["default"])("".concat(preCls, "__item"), config.icon, _defineProperty({}, "".concat(preCls, "__item--active"), background == color));
88
- colors.push( /*#__PURE__*/_react["default"].createElement("div", {
89
- key: color,
90
- className: cls,
91
- style: {
92
- backgroundColor: color
93
- },
94
- onClick: function onClick() {
95
- onClickItem(editor.state.schema.marks[_index2.BACKGROUND_COLOR_SCHEMA_NAME], color);
96
- }
97
- }));
98
- };
99
-
100
- for (var key in _consts.BackgroundColor) {
101
- var _ret2 = _loop2(key);
102
-
103
- if (_ret2 === "continue") continue;
104
- }
105
-
106
- return colors;
107
- }, [background]);
108
- return /*#__PURE__*/_react["default"].createElement("div", {
109
- className: preCls
110
- }, /*#__PURE__*/_react["default"].createElement("div", {
111
- className: preCls + '__title'
112
- }, "\u6587\u5B57\u989C\u8272"), /*#__PURE__*/_react["default"].createElement("div", {
113
- className: preCls + '__color-box',
114
- style: {
115
- marginBottom: 10
116
- }
117
- }, fontColors), /*#__PURE__*/_react["default"].createElement("div", {
118
- className: preCls + '__title'
119
- }, "\u80CC\u666F\u989C\u8272"), /*#__PURE__*/_react["default"].createElement("div", {
120
- className: preCls + '__color-box'
121
- }, backgroundColors));
122
- }
123
-
124
- function ColorSelectorPop(_ref2) {
125
- var editor = _ref2.editor,
126
- config = _ref2.config;
127
-
128
- var _useState = (0, _react.useState)(),
129
- _useState2 = _slicedToArray(_useState, 2),
130
- activeColor = _useState2[0],
131
- setActiveColor = _useState2[1];
132
-
133
- var _useState3 = (0, _react.useState)(),
134
- _useState4 = _slicedToArray(_useState3, 2),
135
- activeBackground = _useState4[0],
136
- setActiveBackground = _useState4[1];
137
-
138
- var storedColor = (0, _react.useRef)({
139
- color: undefined,
140
- background: undefined
141
- });
142
- var handleClickItem = (0, _react.useCallback)(function (type, color) {
143
- var currentColor = type.name == _index2.FONT_COLOR_SCHEMA_NAME ? activeColor : activeBackground;
144
- var c = color === currentColor ? undefined : color;
145
-
146
- if (type.name == _index2.FONT_COLOR_SCHEMA_NAME) {
147
- storedColor.current.color = c;
148
- setActiveColor(c);
149
- } else {
150
- storedColor.current.background = c;
151
- setActiveBackground(c);
152
- }
153
-
154
- (0, _commond.setColor)(editor, type, color);
155
- editor.view.focus();
156
- }, [activeColor, activeBackground]);
157
- (0, _react.useEffect)(function () {
158
- editor.on(_events.EDITOR_STATE_CHANGE, function (state) {
159
- var _state$selection = state.selection,
160
- from = _state$selection.from,
161
- to = _state$selection.to,
162
- $from = _state$selection.$from;
163
- var fontColor = '';
164
- var backgroundColor = '';
165
-
166
- if (from == to) {
167
- var marks = state.storedMarks || $from.marks();
168
- marks.forEach(function (mark) {
169
- if (mark.type.name == _index2.FONT_COLOR_SCHEMA_NAME) {
170
- if (fontColor && fontColor != mark.attrs.color) fontColor = _consts.FontColor["default"];
171
- if (!fontColor) fontColor = mark.attrs.color;
172
- }
173
-
174
- if (mark.type.name == _index2.BACKGROUND_COLOR_SCHEMA_NAME) {
175
- if (backgroundColor && backgroundColor != mark.attrs.color) backgroundColor = _consts.BackgroundColor["default"];
176
- if (!backgroundColor) backgroundColor = mark.attrs.color;
177
- }
178
- });
179
- } else {
180
- state.doc.nodesBetween(from, to, function (node) {
181
- node.marks.forEach(function (mark) {
182
- if (mark.type.name == _index2.FONT_COLOR_SCHEMA_NAME) {
183
- if (fontColor && fontColor != mark.attrs.color) fontColor = _consts.FontColor["default"];
184
- if (!fontColor) fontColor = mark.attrs.color;
185
- }
186
-
187
- if (mark.type.name == _index2.BACKGROUND_COLOR_SCHEMA_NAME) {
188
- if (backgroundColor && backgroundColor != mark.attrs.color) backgroundColor = _consts.BackgroundColor["default"];
189
- if (!backgroundColor) backgroundColor = mark.attrs.color;
190
- }
191
- });
192
- });
193
- }
194
-
195
- if (fontColor && !backgroundColor) {
196
- backgroundColor = _consts.BackgroundColor["default"];
197
- }
198
-
199
- if (backgroundColor && !fontColor) {
200
- fontColor = _consts.FontColor["default"];
201
- }
202
-
203
- if (!fontColor && !backgroundColor) {
204
- fontColor = storedColor.current.color || _consts.FontColor["default"];
205
- backgroundColor = storedColor.current.background || _consts.BackgroundColor["default"];
206
- }
207
-
208
- fontColor && setActiveColor(fontColor);
209
- backgroundColor && setActiveBackground(backgroundColor);
210
- });
211
- }, []);
212
- var handleClickMenu = (0, _react.useCallback)(function () {
213
- (0, _commond.setColor)(editor, editor.state.schema.marks[_index2.FONT_COLOR_SCHEMA_NAME], activeColor);
214
- (0, _commond.setColor)(editor, editor.state.schema.marks[_index2.BACKGROUND_COLOR_SCHEMA_NAME], activeBackground);
215
- editor.view.focus();
216
- }, [activeColor, activeBackground]);
217
- return /*#__PURE__*/_react["default"].createElement("div", {
218
- className: preCls + '__icon',
219
- onMouseOver: function onMouseOver(e) {
220
- return e.stopPropagation();
221
- },
222
- onMouseEnter: function onMouseEnter(e) {
223
- return e.stopPropagation();
224
- },
225
- style: {
226
- backgroundColor: activeBackground || _consts.BackgroundColor["default"],
227
- color: activeColor || _consts.FontColor["default"]
228
- },
229
- onClick: handleClickMenu
230
- }, /*#__PURE__*/_react["default"].createElement(_popup["default"], {
231
- action: ["hover"],
232
- popupPlacement: "top",
233
- popup: /*#__PURE__*/_react["default"].createElement(ColorSelector, {
234
- editor: editor,
235
- config: config,
236
- color: activeColor,
237
- background: activeBackground,
238
- onClickItem: handleClickItem
239
- })
240
- }, /*#__PURE__*/_react["default"].createElement("span", {
241
- className: config.icon
242
- })));
243
- }
244
-
245
- var _default = function _default(editor, config) {
246
- return /*#__PURE__*/_react["default"].createElement(ColorSelectorPop, {
247
- editor: editor,
248
- config: config
249
- });
250
- };
251
-
252
- exports["default"] = _default;
@@ -1,147 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.DeleteLineSchema = exports.DeleteLinePlugin = exports.DeleteLineController = void 0;
9
-
10
- var _plugin = _interopRequireDefault(require("../../../models/plugin"));
11
-
12
- var _schema = require("../../../models/schema");
13
-
14
- var _controller = _interopRequireDefault(require("../../../models/controller"));
15
-
16
- var _prosemirrorCommands = require("prosemirror-commands");
17
-
18
- var _mark = require("../../../utils/mark");
19
-
20
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
-
22
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
-
24
- 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); } }
25
-
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
-
28
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
-
30
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
-
32
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
33
-
34
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
35
-
36
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
-
38
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
-
40
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
-
42
- var PLUGIN_NAME = 'deleteLine';
43
-
44
- var getAttrs = function getAttrs(value) {
45
- if (/line-through/i.test(value)) {
46
- return true;
47
- }
48
-
49
- return false;
50
- };
51
-
52
- var DeleteLineSchema = /*#__PURE__*/function (_InlineSchema) {
53
- _inherits(DeleteLineSchema, _InlineSchema);
54
-
55
- var _super = _createSuper(DeleteLineSchema);
56
-
57
- function DeleteLineSchema() {
58
- var _this;
59
-
60
- _classCallCheck(this, DeleteLineSchema);
61
-
62
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
63
- args[_key] = arguments[_key];
64
- }
65
-
66
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.name = PLUGIN_NAME, _this.parseDOM = [{
67
- tag: 's',
68
- priority: 25
69
- }, {
70
- tag: 'strike',
71
- priority: 25
72
- }, {
73
- tag: 'del',
74
- priority: 25
75
- }, {
76
- style: 'text-decoration-line',
77
- getAttrs: getAttrs
78
- }], _assertThisInitialized(_this)));
79
- }
80
-
81
- _createClass(DeleteLineSchema, [{
82
- key: "toDOM",
83
- value: function toDOM() {
84
- return ["s", {
85
- style: 'text-decoration:line-through;'
86
- }, 0];
87
- }
88
- }]);
89
-
90
- return DeleteLineSchema;
91
- }(_schema.InlineSchema);
92
-
93
- exports.DeleteLineSchema = DeleteLineSchema;
94
-
95
- var DeleteLineController = /*#__PURE__*/function (_BaseController) {
96
- _inherits(DeleteLineController, _BaseController);
97
-
98
- var _super2 = _createSuper(DeleteLineController);
99
-
100
- function DeleteLineController() {
101
- var _this2;
102
-
103
- _classCallCheck(this, DeleteLineController);
104
-
105
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
106
- args[_key2] = arguments[_key2];
107
- }
108
-
109
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = {
110
- title: '删除线',
111
- icon: 'tu-icon-text-delline',
112
- handler: function handler(editor) {
113
- (0, _prosemirrorCommands.toggleMark)(editor.state.schema.marks[PLUGIN_NAME])(editor.state, editor.view.dispatch);
114
- editor.view.focus();
115
- },
116
- active: function active(state) {
117
- return (0, _mark.selectionContainsMark)(state, PLUGIN_NAME);
118
- }
119
- }, _assertThisInitialized(_this2)));
120
- }
121
-
122
- return _createClass(DeleteLineController);
123
- }(_controller["default"]);
124
-
125
- exports.DeleteLineController = DeleteLineController;
126
-
127
- var DeleteLinePlugin = /*#__PURE__*/function (_BasePlugin) {
128
- _inherits(DeleteLinePlugin, _BasePlugin);
129
-
130
- var _super3 = _createSuper(DeleteLinePlugin);
131
-
132
- function DeleteLinePlugin() {
133
- var _this3;
134
-
135
- _classCallCheck(this, DeleteLinePlugin);
136
-
137
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
138
- args[_key3] = arguments[_key3];
139
- }
140
-
141
- return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.name = PLUGIN_NAME, _this3.schema = DeleteLineSchema, _this3.controller = DeleteLineController, _assertThisInitialized(_this3)));
142
- }
143
-
144
- return _createClass(DeleteLinePlugin);
145
- }(_plugin["default"]);
146
-
147
- exports.DeleteLinePlugin = DeleteLinePlugin;
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.EmSchema = exports.EmPlugin = void 0;
9
-
10
- var _plugin = _interopRequireDefault(require("../../../models/plugin"));
11
-
12
- var _schema = require("../../../models/schema");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
-
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
-
18
- 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); } }
19
-
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
-
22
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
23
-
24
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
-
26
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
27
-
28
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
29
-
30
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
31
-
32
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
33
-
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
-
36
- var PLUGIN_NAME = 'em';
37
-
38
- var EmSchema = /*#__PURE__*/function (_InlineSchema) {
39
- _inherits(EmSchema, _InlineSchema);
40
-
41
- var _super = _createSuper(EmSchema);
42
-
43
- function EmSchema() {
44
- var _this;
45
-
46
- _classCallCheck(this, EmSchema);
47
-
48
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
- args[_key] = arguments[_key];
50
- }
51
-
52
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.name = PLUGIN_NAME, _this.parseDOM = [{
53
- tag: "i"
54
- }, {
55
- tag: "em"
56
- }, {
57
- style: "font-style=italic"
58
- }], _assertThisInitialized(_this)));
59
- }
60
-
61
- _createClass(EmSchema, [{
62
- key: "toDOM",
63
- value: function toDOM() {
64
- return ["em", 0];
65
- }
66
- }]);
67
-
68
- return EmSchema;
69
- }(_schema.InlineSchema);
70
-
71
- exports.EmSchema = EmSchema;
72
-
73
- var EmPlugin = /*#__PURE__*/function (_BasePlugin) {
74
- _inherits(EmPlugin, _BasePlugin);
75
-
76
- var _super2 = _createSuper(EmPlugin);
77
-
78
- function EmPlugin() {
79
- var _this2;
80
-
81
- _classCallCheck(this, EmPlugin);
82
-
83
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
84
- args[_key2] = arguments[_key2];
85
- }
86
-
87
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = PLUGIN_NAME, _this2.schema = EmSchema, _assertThisInitialized(_this2)));
88
- }
89
-
90
- return _createClass(EmPlugin);
91
- }(_plugin["default"]);
92
-
93
- exports.EmPlugin = EmPlugin;
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _deleteLine = require("./delete-line");
8
-
9
- Object.keys(_deleteLine).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _deleteLine[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _deleteLine[key];
16
- }
17
- });
18
- });
19
-
20
- var _em = require("./em");
21
-
22
- Object.keys(_em).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _em[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function get() {
28
- return _em[key];
29
- }
30
- });
31
- });
32
-
33
- var _strong = require("./strong");
34
-
35
- Object.keys(_strong).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _strong[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function get() {
41
- return _strong[key];
42
- }
43
- });
44
- });
45
-
46
- var _underLine = require("./under-line");
47
-
48
- Object.keys(_underLine).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (key in exports && exports[key] === _underLine[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function get() {
54
- return _underLine[key];
55
- }
56
- });
57
- });
58
-
59
- var _color = require("./color");
60
-
61
- Object.keys(_color).forEach(function (key) {
62
- if (key === "default" || key === "__esModule") return;
63
- if (key in exports && exports[key] === _color[key]) return;
64
- Object.defineProperty(exports, key, {
65
- enumerable: true,
66
- get: function get() {
67
- return _color[key];
68
- }
69
- });
70
- });
71
-
72
- var _link = require("./link");
73
-
74
- Object.keys(_link).forEach(function (key) {
75
- if (key === "default" || key === "__esModule") return;
76
- if (key in exports && exports[key] === _link[key]) return;
77
- Object.defineProperty(exports, key, {
78
- enumerable: true,
79
- get: function get() {
80
- return _link[key];
81
- }
82
- });
83
- });