@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,302 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.listBackspace = exports.calcJoinListScenario = void 0;
7
-
8
- var _commands = require("../../../../utils/commands");
9
-
10
- var _node = require("../utils/node");
11
-
12
- var _selection = require("../utils/selection");
13
-
14
- var _BACKSPACE_COMMANDS;
15
-
16
- 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; }
17
-
18
- //Cases below refer to the cases found in this document: https://product-fabric.atlassian.net/wiki/spaces/E/pages/1146954996/List+Backspace+and+Delete+Behaviour
19
- //Case for two adjacent list items of the same indentation
20
- var listBackspaceCase2 = function listBackspaceCase2(tr, dispatch, $prev, $head) {
21
- /* CASE 2
22
- * Initial Structure:
23
- *
24
- * List A {
25
- * ListItem B {
26
- * ...Children C
27
- * Paragraph D { text1 |textInsertPos| } //Cant have children since that would be Case 4
28
- * |$prev||childrenGInsertPos| }
29
- * ListItem E {
30
- * Paragraph F { |$head| text2 }
31
- * ...Children G
32
- * }
33
- * }
34
- *
35
- * Converts to:
36
- *
37
- * List A {
38
- * ListItem B {
39
- * ...Children C
40
- * Paragraph C { text1text2 }
41
- * ...Children G
42
- * }
43
- * }
44
- *
45
- */
46
- var listItemE = $head.node(-1); //Head is inside listItem E so it must have a first and last child
47
-
48
- if (!listItemE.firstChild) {
49
- return false;
50
- }
51
-
52
- var beforeListItemE = $head.before(-1);
53
- var afterListItemE = $head.after(-1);
54
- var textInsertPos = $prev.pos - 1; //Paragraph D must be directly behind $prev otherwise it would be case 4
55
-
56
- var childrenGInsertPos = $prev.pos;
57
- var textContent = $head.parent.content;
58
- var childrenGContent = listItemE.content.cut(listItemE.firstChild.nodeSize);
59
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
60
- return tr.doc.resolve(textInsertPos);
61
- }, [[textContent, textInsertPos], [childrenGContent, childrenGInsertPos]], [[beforeListItemE, afterListItemE]]);
62
-
63
- if (dispatch) {
64
- dispatch(tr);
65
- }
66
-
67
- return true;
68
- }; //Case for two adjacent list items with the first being of lower indentation
69
-
70
-
71
- var listBackspaceCase3 = function listBackspaceCase3(tr, dispatch, $prev, $head) {
72
- /* CASE 3
73
- * Initial Structure:
74
- *
75
- * List A {
76
- * ListItem B {
77
- * ...Children C
78
- * Paragraph D { text1 |$prev||textInsertPos| } |childrenHInsertPos|
79
- * List E { |childrenJInsertPos|
80
- * ListItem F {
81
- * Paragraph G { |$head| text2 }
82
- * ...Children H
83
- * List? I {
84
- * ...Children J
85
- * }
86
- * }
87
- * ...Children K
88
- * }
89
- * }
90
- * }
91
- *
92
- * Converts to:
93
- *
94
- * List A {
95
- * ListItem B {
96
- * ...Children C
97
- * Paragraph D { text1text2 }
98
- * ...Children H
99
- * List E {
100
- * ...Children J
101
- * ...Children K
102
- * }
103
- * }
104
- * }
105
- *
106
- */
107
- var listE = $head.node(-2);
108
- var listItemF = $head.node(-1); //Head is inside listItem F so it must have a first and last child
109
-
110
- if (!listItemF.firstChild || !listItemF.lastChild) {
111
- return false;
112
- }
113
-
114
- var beforeListE = $head.before(-2);
115
- var beforeListItemF = $head.before(-1);
116
- var afterParagraphD = $prev.after();
117
- var afterListE = $head.after(-2);
118
- var afterListItemF = $head.after(-1);
119
- var startListE = $head.start(-2);
120
- var containsChildrenJ = (0, _node.isListNode)(listItemF.lastChild);
121
- var shouldRemoveListE = listE.childCount === 1 && !containsChildrenJ; //Assures no Children J and K
122
-
123
- var textInsertPos = $prev.pos;
124
- var childrenHInsertPos = afterParagraphD;
125
- var childrenJInsertPos = startListE;
126
- var textContent = $head.parent.content;
127
- var childrenHContent = containsChildrenJ ? listItemF.content.cut(listItemF.firstChild.nodeSize, listItemF.nodeSize - listItemF.lastChild.nodeSize - 2) : listItemF.content.cut(listItemF.firstChild.nodeSize); //If Children J doesn't exist then Children H will include the last node
128
-
129
- var childrenJContent = listItemF.lastChild.content; //Will be invalid if there are no Children J but it will be unused
130
-
131
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
132
- return tr.doc.resolve(textInsertPos);
133
- }, containsChildrenJ ? [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos], [childrenJContent, childrenJInsertPos]] : [[textContent, textInsertPos], [childrenHContent, childrenHInsertPos]], [shouldRemoveListE ? [beforeListE, afterListE] : [beforeListItemF, afterListItemF]]);
134
-
135
- if (dispatch) {
136
- dispatch(tr);
137
- }
138
-
139
- return true;
140
- }; //Case for two adjacent list items with the first being of greater indentation
141
-
142
-
143
- var listBackspaceCase4 = function listBackspaceCase4(tr, dispatch, $prev, $head, $last) {
144
- /* CASE 4
145
- * Initial Structure:
146
- *
147
- * List A {
148
- * ListItem B {
149
- * Paragraph C { text1 }
150
- * ...Children D
151
- * List E {
152
- * ...
153
- * List F { //May be multiple levels of lists
154
- * ...Children G
155
- * ListItem H { //Last node of the block
156
- * ...Children I
157
- * Paragraph J { text2 |$last||textInsertPos| } |childrenMInsertPos| //Cant have children since this ListItem is the last of the block
158
- * }
159
- * }
160
- * ...
161
- * |childrenOInsertPosition| }
162
- * |$prev| }
163
- * ListItem K {
164
- * Paragraph L { |$head| text3 }
165
- * ...Children M
166
- * List? N {
167
- * ...Children O
168
- * }
169
- * }
170
- * }
171
- *
172
- * Converts to:
173
- *
174
- * List A {
175
- * ListItem B {
176
- * Paragraph C { text1 }
177
- * ...Children D
178
- * List E {
179
- * ...
180
- * List F {
181
- * ...Children G
182
- * ListItem H {
183
- * ...Children I
184
- * Paragraph J { text2text3 }
185
- * ...Children M
186
- * }
187
- * }
188
- * ...
189
- * ...Children O
190
- * }
191
- * }
192
- * }
193
- *
194
- */
195
- if (!$last) {
196
- //Exit if an invalid last was given as a parameter
197
- return false;
198
- }
199
-
200
- var listItemK = $head.node(-1); //Head is inside listItem K so it must have a first and last child
201
-
202
- if (!listItemK.firstChild || !listItemK.lastChild) {
203
- return false;
204
- }
205
-
206
- var paragraphL = $head.parent;
207
- var beforeListItemK = $head.before(-1);
208
- var afterParagraphJ = $last.after();
209
- var afterListItemK = $head.after(-1);
210
- var containsChildrenO = (0, _node.isListNode)(listItemK.lastChild);
211
- var textInsertPos = $last.pos;
212
- var childrenMInsertPos = afterParagraphJ;
213
- var childrenOInsertPos = $prev.pos - 1; //Last item of listItem B must be a list therefore we can simply decrement $prev to get there
214
-
215
- var textContent = paragraphL.content;
216
- var childrenMContent = containsChildrenO ? listItemK.content.cut(listItemK.firstChild.nodeSize, listItemK.nodeSize - listItemK.lastChild.nodeSize - 2) : listItemK.content.cut(listItemK.firstChild.nodeSize);
217
- var childrenOContent = listItemK.lastChild.content;
218
- (0, _commands.insertContentDeleteRange)(tr, function (tr) {
219
- return tr.doc.resolve(textInsertPos);
220
- }, containsChildrenO ? [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos], [childrenOContent, childrenOInsertPos]] : [[textContent, textInsertPos], [childrenMContent, childrenMInsertPos]], [[beforeListItemK, afterListItemK]]);
221
-
222
- if (dispatch) {
223
- dispatch(tr);
224
- }
225
-
226
- return true;
227
- };
228
-
229
- var ScenariosAllowed;
230
-
231
- (function (ScenariosAllowed) {
232
- ScenariosAllowed[ScenariosAllowed["JOIN_SIBLINGS"] = 0] = "JOIN_SIBLINGS";
233
- ScenariosAllowed[ScenariosAllowed["JOIN_DESCENDANT_TO_PARENT"] = 1] = "JOIN_DESCENDANT_TO_PARENT";
234
- ScenariosAllowed[ScenariosAllowed["JOIN_TO_SIBLING_DESCENDANT"] = 2] = "JOIN_TO_SIBLING_DESCENDANT";
235
- })(ScenariosAllowed || (ScenariosAllowed = {}));
236
-
237
- var BACKSPACE_COMMANDS = (_BACKSPACE_COMMANDS = {}, _defineProperty(_BACKSPACE_COMMANDS, ScenariosAllowed.JOIN_SIBLINGS, listBackspaceCase2), _defineProperty(_BACKSPACE_COMMANDS, ScenariosAllowed.JOIN_DESCENDANT_TO_PARENT, listBackspaceCase3), _defineProperty(_BACKSPACE_COMMANDS, ScenariosAllowed.JOIN_TO_SIBLING_DESCENDANT, listBackspaceCase4), _BACKSPACE_COMMANDS);
238
-
239
- var calcJoinListScenario = function calcJoinListScenario(walkNode, $head, tr) {
240
- var $prev = walkNode.$pos,
241
- prevFoundNode = walkNode.foundNode;
242
- var prevInList = (0, _selection.isPosInsideList)($prev);
243
- var headInParagraph = (0, _selection.isPosInsideParagraph)($head);
244
- var headInFirstChild = $head.index(-1) === 0;
245
- var headInList = (0, _selection.isPosInsideList)($head); //Must be at the start of the selection of the first child in the listItem
246
-
247
- if (!prevFoundNode || !prevInList || !headInParagraph || !headInFirstChild || !headInList) {
248
- return false;
249
- }
250
-
251
- var prevInParagraph = (0, _selection.isPosInsideParagraph)($prev);
252
-
253
- if (prevInParagraph) {
254
- return [ScenariosAllowed.JOIN_DESCENDANT_TO_PARENT, null];
255
- }
256
-
257
- var prevParentLastChildIsList = $prev.parent.lastChild && (0, _node.isListNode)($prev.parent.lastChild);
258
- var prevParentLastChildIsParagraph = (0, _node.isParagraphNode)($prev.parent.lastChild); // Will search for the possible last node for case 4 (where the list could be indented multiple times)
259
- // $last is required to determine whether we are in case 2 or 4
260
-
261
- var $last = tr.doc.resolve($prev.pos);
262
- var lastFoundNode;
263
-
264
- do {
265
- var _walkNode = (0, _commands.walkPrevNode)($last);
266
-
267
- $last = _walkNode.$pos;
268
- lastFoundNode = _walkNode.foundNode;
269
- } while (lastFoundNode && !$last.parent.isTextblock);
270
-
271
- var lastInParagraph = (0, _selection.isPosInsideParagraph)($last);
272
-
273
- if (lastFoundNode && prevParentLastChildIsList && lastInParagraph) {
274
- return [ScenariosAllowed.JOIN_TO_SIBLING_DESCENDANT, $last];
275
- } else if (prevParentLastChildIsParagraph) {
276
- return [ScenariosAllowed.JOIN_SIBLINGS, null];
277
- }
278
-
279
- return false;
280
- };
281
-
282
- exports.calcJoinListScenario = calcJoinListScenario;
283
-
284
- var listBackspace = function listBackspace(state, dispatch) {
285
- var tr = state.tr,
286
- $head = state.selection.$head;
287
- var walkNode = (0, _commands.walkPrevNode)($head);
288
-
289
- if (!(0, _commands.isEmptySelectionAtStart)(state)) {
290
- return false;
291
- }
292
-
293
- var scenario = calcJoinListScenario(walkNode, $head, tr);
294
-
295
- if (!scenario) {
296
- return false;
297
- }
298
-
299
- return BACKSPACE_COMMANDS[scenario[0]](tr, dispatch, walkNode.$pos, $head, scenario[1]);
300
- };
301
-
302
- exports.listBackspace = listBackspace;
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.outdentList = outdentList;
7
-
8
- var _selection = require("../utils/selection");
9
-
10
- var _find = require("../utils/find");
11
-
12
- var _outdentListItemsSelected = require("../actions/outdent-list-items-selected");
13
-
14
- function outdentList() {
15
- return function (state, dispatch) {
16
- if (!(0, _selection.isInsideListItem)(state)) {
17
- return false;
18
- }
19
-
20
- var $from = state.selection.$from;
21
- var parentListNode = (0, _find.findFirstParentListNode)($from);
22
-
23
- if (!parentListNode) {
24
- // Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
25
- return true;
26
- }
27
-
28
- var customTr = state.tr;
29
- (0, _outdentListItemsSelected.outdentListItemsSelected)(customTr);
30
-
31
- if (!customTr || !customTr.docChanged) {
32
- // Even though this is a non-operation, we don't want to send this event to the browser. Because if we return false, the browser will move the focus to another place
33
- // If inside table cell and can't outdent list, then let it handle by table keymap
34
- return !(0, _selection.isInsideTableCell)(state);
35
- }
36
-
37
- if (dispatch) {
38
- dispatch(customTr);
39
- }
40
-
41
- return true;
42
- };
43
- }
@@ -1,222 +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.OrderedListSchema = exports.ListPlugin = exports.ListItemSchema = exports.ListController = exports.BulletListSchema = void 0;
9
-
10
- var _controller = _interopRequireDefault(require("../../../models/controller"));
11
-
12
- var _plugin = _interopRequireDefault(require("../../../models/plugin"));
13
-
14
- var _schema = require("../../../models/schema");
15
-
16
- var _commond = require("./commond");
17
-
18
- var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
19
-
20
- var _main = _interopRequireWildcard(require("./pm-plugins/main"));
21
-
22
- 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); }
23
-
24
- 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; }
25
-
26
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
-
28
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
-
30
- 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); } }
31
-
32
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
33
-
34
- 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); }
35
-
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
37
-
38
- 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); }; }
39
-
40
- 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); }
41
-
42
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
43
-
44
- 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; } }
45
-
46
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
47
-
48
- var PLUGIN_NAME = 'list';
49
- var preCls = 'tita-rich-editor';
50
-
51
- var BulletListSchema = /*#__PURE__*/function (_BlockSchema) {
52
- _inherits(BulletListSchema, _BlockSchema);
53
-
54
- var _super = _createSuper(BulletListSchema);
55
-
56
- function BulletListSchema() {
57
- var _this;
58
-
59
- _classCallCheck(this, BulletListSchema);
60
-
61
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
62
- args[_key] = arguments[_key];
63
- }
64
-
65
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.name = 'bulletList', _this.content = 'listItem+', _this.parseDOM = [{
66
- tag: "ul"
67
- }], _assertThisInitialized(_this)));
68
- }
69
-
70
- _createClass(BulletListSchema, [{
71
- key: "toDOM",
72
- value: function toDOM(node) {
73
- return ["ul", {
74
- "class": preCls + '-ul'
75
- }, 0];
76
- }
77
- }]);
78
-
79
- return BulletListSchema;
80
- }(_schema.BlockSchema);
81
-
82
- exports.BulletListSchema = BulletListSchema;
83
-
84
- var OrderedListSchema = /*#__PURE__*/function (_BlockSchema2) {
85
- _inherits(OrderedListSchema, _BlockSchema2);
86
-
87
- var _super2 = _createSuper(OrderedListSchema);
88
-
89
- function OrderedListSchema() {
90
- var _this2;
91
-
92
- _classCallCheck(this, OrderedListSchema);
93
-
94
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
95
- args[_key2] = arguments[_key2];
96
- }
97
-
98
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = 'orderedList', _this2.content = 'listItem+', _this2.attrs = {
99
- order: {
100
- "default": 1
101
- }
102
- }, _this2.parseDOM = [{
103
- tag: "ol",
104
- getAttrs: function getAttrs(dom) {
105
- return {
106
- order: dom.hasAttribute("start") ? +dom.getAttribute("start") : 1
107
- };
108
- }
109
- }], _this2.toDOM = function (node) {
110
- return node.attrs.order == 1 ? ["ol", 0] : ["ol", {
111
- start: node.attrs.order
112
- }, 0];
113
- }, _assertThisInitialized(_this2)));
114
- }
115
-
116
- return _createClass(OrderedListSchema);
117
- }(_schema.BlockSchema);
118
-
119
- exports.OrderedListSchema = OrderedListSchema;
120
-
121
- var ListItemSchema = /*#__PURE__*/function (_BlockSchema3) {
122
- _inherits(ListItemSchema, _BlockSchema3);
123
-
124
- var _super3 = _createSuper(ListItemSchema);
125
-
126
- function ListItemSchema() {
127
- var _this3;
128
-
129
- _classCallCheck(this, ListItemSchema);
130
-
131
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
132
- args[_key3] = arguments[_key3];
133
- }
134
-
135
- return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.name = 'listItem', _this3.group = 'listItem', _this3.content = 'paragraph block*', _this3.parseDOM = [{
136
- tag: "li"
137
- }], _assertThisInitialized(_this3)));
138
- }
139
-
140
- _createClass(ListItemSchema, [{
141
- key: "toDOM",
142
- value: function toDOM(node) {
143
- return ["li", {
144
- "class": preCls + '-li'
145
- }, 0];
146
- }
147
- }]);
148
-
149
- return ListItemSchema;
150
- }(_schema.BlockSchema);
151
-
152
- exports.ListItemSchema = ListItemSchema;
153
-
154
- var ListController = /*#__PURE__*/function (_BaseController) {
155
- _inherits(ListController, _BaseController);
156
-
157
- var _super4 = _createSuper(ListController);
158
-
159
- function ListController() {
160
- var _this4;
161
-
162
- _classCallCheck(this, ListController);
163
-
164
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
165
- args[_key4] = arguments[_key4];
166
- }
167
-
168
- return _possibleConstructorReturn(_this4, (_this4 = _super4.call.apply(_super4, [this].concat(args)), _this4.toolbar = [{
169
- title: '无序列表',
170
- icon: 'tu-icon-text-bullet-list',
171
- handler: function handler(editor) {
172
- (0, _commond.toggleBulletList)(editor.view);
173
- editor.view.focus();
174
- },
175
- active: function active(state) {
176
- return _main.pluginKey.getState(state).bulletListActive;
177
- },
178
- disabled: function disabled(state) {
179
- return _main.pluginKey.getState(state).bulletListDisabled;
180
- }
181
- }, {
182
- title: '有序列表',
183
- icon: 'tu-icon-text-number-list',
184
- handler: function handler(editor) {
185
- (0, _commond.toggleOrderedList)(editor.view);
186
- editor.view.focus();
187
- },
188
- active: function active(state) {
189
- return _main.pluginKey.getState(state).orderedListActive;
190
- },
191
- disabled: function disabled(state) {
192
- return _main.pluginKey.getState(state).orderedListDisabled;
193
- }
194
- }], _this4.pmPlugins = [_main["default"], _keymap["default"]], _assertThisInitialized(_this4)));
195
- }
196
-
197
- return _createClass(ListController);
198
- }(_controller["default"]);
199
-
200
- exports.ListController = ListController;
201
-
202
- var ListPlugin = /*#__PURE__*/function (_BasePlugin) {
203
- _inherits(ListPlugin, _BasePlugin);
204
-
205
- var _super5 = _createSuper(ListPlugin);
206
-
207
- function ListPlugin() {
208
- var _this5;
209
-
210
- _classCallCheck(this, ListPlugin);
211
-
212
- for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
213
- args[_key5] = arguments[_key5];
214
- }
215
-
216
- return _possibleConstructorReturn(_this5, (_this5 = _super5.call.apply(_super5, [this].concat(args)), _this5.name = PLUGIN_NAME, _this5.schema = [BulletListSchema, OrderedListSchema, ListItemSchema], _this5.controller = ListController, _assertThisInitialized(_this5)));
217
- }
218
-
219
- return _createClass(ListPlugin);
220
- }(_plugin["default"]);
221
-
222
- exports.ListPlugin = ListPlugin;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.messages = void 0;
7
-
8
- var _reactIntl = require("react-intl");
9
-
10
- // Common Translations will live here
11
- var messages = (0, _reactIntl.defineMessages)({
12
- unorderedList: {
13
- id: 'fabric.editor.unorderedList',
14
- defaultMessage: 'Bullet list',
15
- description: 'A list with bullets. Also known as an “unordered” list'
16
- },
17
- unorderedListDescription: {
18
- id: 'fabric.editor.unorderedList.description',
19
- defaultMessage: 'Create an unordered list',
20
- description: ''
21
- },
22
- orderedList: {
23
- id: 'fabric.editor.orderedList',
24
- defaultMessage: 'Numbered list',
25
- description: 'A list with ordered items 1… 2… 3…'
26
- },
27
- orderedListDescription: {
28
- id: 'fabric.editor.orderedList.description',
29
- defaultMessage: 'Create an ordered list',
30
- description: ''
31
- },
32
- lists: {
33
- id: 'fabric.editor.lists',
34
- defaultMessage: 'Lists',
35
- description: 'Menu shows ordered/bullet list and unordered/numbered lists'
36
- }
37
- });
38
- exports.messages = messages;