@titaui/pc 1.10.40 → 1.10.44-beta.1

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 (107) hide show
  1. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +18 -3
  2. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +5 -1
  3. package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/index.css +19 -1
  4. package/lib/components/superset-charts/utils/axios.js +2 -2
  5. package/lib/components/upload/index.js +2 -4
  6. package/lib/index.js +0 -8
  7. package/package.json +2 -20
  8. package/lib/components/rich-editor/basic/schema.js +0 -47
  9. package/lib/components/rich-editor/consts/events.js +0 -12
  10. package/lib/components/rich-editor/enums.js +0 -42
  11. package/lib/components/rich-editor/index.js +0 -58
  12. package/lib/components/rich-editor/keymap.js +0 -119
  13. package/lib/components/rich-editor/keymaps/index.js +0 -241
  14. package/lib/components/rich-editor/models/controller.js +0 -18
  15. package/lib/components/rich-editor/models/editor.js +0 -47
  16. package/lib/components/rich-editor/models/plugin.js +0 -20
  17. package/lib/components/rich-editor/models/schema.js +0 -121
  18. package/lib/components/rich-editor/plugins/block/block-quote/commond.js +0 -27
  19. package/lib/components/rich-editor/plugins/block/block-quote/index.js +0 -126
  20. package/lib/components/rich-editor/plugins/block/heading/commonds.js +0 -31
  21. package/lib/components/rich-editor/plugins/block/heading/index.js +0 -188
  22. package/lib/components/rich-editor/plugins/block/index.js +0 -57
  23. package/lib/components/rich-editor/plugins/block/lists/actions/conversions.js +0 -172
  24. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list-items-selected.js +0 -163
  25. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list.js +0 -59
  26. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-forward.js +0 -74
  27. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/index.js +0 -45
  28. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -104
  29. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -92
  30. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -89
  31. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -48
  32. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -61
  33. package/lib/components/rich-editor/plugins/block/lists/actions/merge-lists.js +0 -34
  34. package/lib/components/rich-editor/plugins/block/lists/actions/outdent-list-items-selected.js +0 -289
  35. package/lib/components/rich-editor/plugins/block/lists/actions/wrap-and-join-lists.js +0 -180
  36. package/lib/components/rich-editor/plugins/block/lists/baseCommand.js +0 -328
  37. package/lib/components/rich-editor/plugins/block/lists/commond/indent-list.js +0 -60
  38. package/lib/components/rich-editor/plugins/block/lists/commond/index.js +0 -398
  39. package/lib/components/rich-editor/plugins/block/lists/commond/join-list-item-forward.js +0 -45
  40. package/lib/components/rich-editor/plugins/block/lists/commond/listBackspace.js +0 -302
  41. package/lib/components/rich-editor/plugins/block/lists/commond/outdent-list.js +0 -43
  42. package/lib/components/rich-editor/plugins/block/lists/index.js +0 -222
  43. package/lib/components/rich-editor/plugins/block/lists/messages.js +0 -38
  44. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/input-rule.js +0 -152
  45. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/keymap.js +0 -33
  46. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/main.js +0 -94
  47. package/lib/components/rich-editor/plugins/block/lists/styles.js +0 -15
  48. package/lib/components/rich-editor/plugins/block/lists/transforms.js +0 -347
  49. package/lib/components/rich-editor/plugins/block/lists/utils/analytics.js +0 -48
  50. package/lib/components/rich-editor/plugins/block/lists/utils/find.js +0 -126
  51. package/lib/components/rich-editor/plugins/block/lists/utils/indentation.js +0 -87
  52. package/lib/components/rich-editor/plugins/block/lists/utils/node.js +0 -144
  53. package/lib/components/rich-editor/plugins/block/lists/utils/replace-content.js +0 -31
  54. package/lib/components/rich-editor/plugins/block/lists/utils/selection.js +0 -201
  55. package/lib/components/rich-editor/plugins/block/lists/utils.js +0 -52
  56. package/lib/components/rich-editor/plugins/block/paragraph/index.js +0 -91
  57. package/lib/components/rich-editor/plugins/core/index.js +0 -90
  58. package/lib/components/rich-editor/plugins/core/pm-plugins/focus-handler.js +0 -67
  59. package/lib/components/rich-editor/plugins/core/pm-plugins/keymap.js +0 -29
  60. package/lib/components/rich-editor/plugins/core/pm-plugins/reactNodeView.js +0 -80
  61. package/lib/components/rich-editor/plugins/extension/alignment/commond.js +0 -24
  62. package/lib/components/rich-editor/plugins/extension/alignment/index.js +0 -111
  63. package/lib/components/rich-editor/plugins/extension/alignment/utils.js +0 -19
  64. package/lib/components/rich-editor/plugins/extension/index.js +0 -18
  65. package/lib/components/rich-editor/plugins/index.js +0 -44
  66. package/lib/components/rich-editor/plugins/inline/color/commond.js +0 -128
  67. package/lib/components/rich-editor/plugins/inline/color/consts.js +0 -43
  68. package/lib/components/rich-editor/plugins/inline/color/index.css +0 -61
  69. package/lib/components/rich-editor/plugins/inline/color/index.js +0 -209
  70. package/lib/components/rich-editor/plugins/inline/color/selector.js +0 -250
  71. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +0 -147
  72. package/lib/components/rich-editor/plugins/inline/em/index.js +0 -93
  73. package/lib/components/rich-editor/plugins/inline/index.js +0 -83
  74. package/lib/components/rich-editor/plugins/inline/link/commands.js +0 -256
  75. package/lib/components/rich-editor/plugins/inline/link/index.js +0 -149
  76. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/fake-cursor-for-toolbar.js +0 -77
  77. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/main.js +0 -293
  78. package/lib/components/rich-editor/plugins/inline/link/ui/index.css +0 -79
  79. package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +0 -148
  80. package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +0 -88
  81. package/lib/components/rich-editor/plugins/inline/link/ui/toolbarBtn.js +0 -117
  82. package/lib/components/rich-editor/plugins/inline/link/utils.js +0 -33
  83. package/lib/components/rich-editor/plugins/inline/strong/index.js +0 -137
  84. package/lib/components/rich-editor/plugins/inline/under-line/index.js +0 -145
  85. package/lib/components/rich-editor/plugins/util.js +0 -281
  86. package/lib/components/rich-editor/react/reactNodeView.js +0 -383
  87. package/lib/components/rich-editor/react/uiProvider.js +0 -185
  88. package/lib/components/rich-editor/schemas/basic.js +0 -309
  89. package/lib/components/rich-editor/schemas/index.js +0 -19
  90. package/lib/components/rich-editor/schemas/list.js +0 -342
  91. package/lib/components/rich-editor/types/commond.js +0 -5
  92. package/lib/components/rich-editor/types/index.js +0 -18
  93. package/lib/components/rich-editor/ui/Popup/index.js +0 -247
  94. package/lib/components/rich-editor/ui/Popup/utils.js +0 -399
  95. package/lib/components/rich-editor/ui/editor/index.css +0 -144
  96. package/lib/components/rich-editor/ui/editor/index.js +0 -143
  97. package/lib/components/rich-editor/ui/normal-toolbar/index.css +0 -29
  98. package/lib/components/rich-editor/ui/normal-toolbar/index.js +0 -109
  99. package/lib/components/rich-editor/utils/browser.js +0 -35
  100. package/lib/components/rich-editor/utils/commands.js +0 -266
  101. package/lib/components/rich-editor/utils/document.js +0 -160
  102. package/lib/components/rich-editor/utils/event.js +0 -79
  103. package/lib/components/rich-editor/utils/helpers.js +0 -16
  104. package/lib/components/rich-editor/utils/mark.js +0 -168
  105. package/lib/components/rich-editor/utils/slice.js +0 -85
  106. package/lib/components/rich-editor/utils/toolbar.js +0 -228
  107. package/yarn-error.log +0 -22184
@@ -1,241 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.backspace = exports.altPaste = exports.addRowBefore = exports.addRowAfter = exports.addLink = exports.addColumnBefore = exports.addColumnAfter = exports.addAltText = exports.UP = exports.RIGHT = exports.LEFT = exports.KEY_6 = exports.KEY_5 = exports.KEY_4 = exports.KEY_3 = exports.KEY_2 = exports.KEY_1 = exports.KEY_0 = exports.HEADING_KEYS = exports.DOWN = void 0;
7
- exports.bindKeymapWithCommand = bindKeymapWithCommand;
8
- exports.escape = exports.enter = exports.deleteKey = exports.cut = exports.copy = exports.clearFormatting = void 0;
9
- exports.findKeyMapForBrowser = findKeyMapForBrowser;
10
- exports.findKeymapByDescription = findKeymapByDescription;
11
- exports.findShortcutByDescription = findShortcutByDescription;
12
- exports.findShortcutByKeymap = findShortcutByKeymap;
13
- exports.undo = exports.toggleUnderline = exports.toggleTable = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.shiftBackspace = exports.setNormalText = exports.redoBarred = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.moveUp = exports.moveRight = exports.moveLeft = exports.moveDown = exports.insertRule = exports.insertNewLine = exports.indentList = exports.indent = void 0;
14
-
15
- var _browser = _interopRequireDefault(require("../utils/browser"));
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
-
19
- var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
20
- exports.addAltText = addAltText;
21
- var toggleBold = makeKeyMapWithCommon('Bold', 'Mod-b');
22
- exports.toggleBold = toggleBold;
23
- var toggleItalic = makeKeyMapWithCommon('Italic', 'Mod-i');
24
- exports.toggleItalic = toggleItalic;
25
- var toggleUnderline = makeKeyMapWithCommon('Underline', 'Mod-u');
26
- exports.toggleUnderline = toggleUnderline;
27
- var toggleStrikethrough = makeKeyMapWithCommon('Strikethrough', 'Mod-Shift-s');
28
- exports.toggleStrikethrough = toggleStrikethrough;
29
- var toggleCode = makeKeyMapWithCommon('Code', 'Mod-Shift-m');
30
- exports.toggleCode = toggleCode;
31
- var pastePlainText = makeKeyMapWithCommon('Paste Plain Text', 'Mod-Shift-v');
32
- exports.pastePlainText = pastePlainText;
33
- var clearFormatting = makeKeyMapWithCommon('Clear formatting', 'Mod-\\');
34
- exports.clearFormatting = clearFormatting;
35
- var setNormalText = makeKeyMapWithCommon('Normal text', 'Mod-Alt-0');
36
- exports.setNormalText = setNormalText;
37
- var toggleHeading1 = makeKeyMapWithCommon('Heading 1', 'Mod-Alt-1');
38
- exports.toggleHeading1 = toggleHeading1;
39
- var toggleHeading2 = makeKeyMapWithCommon('Heading 2', 'Mod-Alt-2');
40
- exports.toggleHeading2 = toggleHeading2;
41
- var toggleHeading3 = makeKeyMapWithCommon('Heading 3', 'Mod-Alt-3');
42
- exports.toggleHeading3 = toggleHeading3;
43
- var toggleHeading4 = makeKeyMapWithCommon('Heading 4', 'Mod-Alt-4');
44
- exports.toggleHeading4 = toggleHeading4;
45
- var toggleHeading5 = makeKeyMapWithCommon('Heading 5', 'Mod-Alt-5');
46
- exports.toggleHeading5 = toggleHeading5;
47
- var toggleHeading6 = makeKeyMapWithCommon('Heading 6', 'Mod-Alt-6');
48
- exports.toggleHeading6 = toggleHeading6;
49
- var toggleOrderedList = makeKeyMapWithCommon('Numbered list', 'Mod-Shift-7');
50
- exports.toggleOrderedList = toggleOrderedList;
51
- var toggleBulletList = makeKeyMapWithCommon('Bullet list', 'Mod-Shift-8');
52
- exports.toggleBulletList = toggleBulletList;
53
- var toggleBlockQuote = makeKeymap('Quote', '', 'Cmd-Alt-9');
54
- exports.toggleBlockQuote = toggleBlockQuote;
55
- var insertNewLine = makeKeyMapWithCommon('Insert new line', 'Shift-Enter');
56
- exports.insertNewLine = insertNewLine;
57
- var shiftBackspace = makeKeyMapWithCommon('Shift Backspace', 'Shift-Backspace');
58
- exports.shiftBackspace = shiftBackspace;
59
- var splitCodeBlock = makeKeyMapWithCommon('Split code block', 'Enter');
60
- exports.splitCodeBlock = splitCodeBlock;
61
- var splitListItem = makeKeyMapWithCommon('Split list item', 'Enter');
62
- exports.splitListItem = splitListItem;
63
- var insertRule = makeKeyMapWithCommon('Insert horizontal rule', 'Mod-Shift--');
64
- exports.insertRule = insertRule;
65
- var undo = makeKeyMapWithCommon('Undo', 'Mod-z');
66
- exports.undo = undo;
67
- var moveUp = makeKeyMapWithCommon('Move up', 'ArrowUp');
68
- exports.moveUp = moveUp;
69
- var moveDown = makeKeyMapWithCommon('Move down', 'ArrowDown');
70
- exports.moveDown = moveDown;
71
- var moveLeft = makeKeyMapWithCommon('Move left', 'ArrowLeft');
72
- exports.moveLeft = moveLeft;
73
- var moveRight = makeKeyMapWithCommon('Move right', 'ArrowRight');
74
- exports.moveRight = moveRight;
75
- var indentList = makeKeyMapWithCommon('Indent List', 'Tab');
76
- exports.indentList = indentList;
77
- var outdentList = makeKeyMapWithCommon('Outdent List', 'Shift-Tab');
78
- exports.outdentList = outdentList;
79
- var redo = makeKeymap('Redo', 'Ctrl-y', 'Cmd-Shift-z');
80
- exports.redo = redo;
81
- var redoBarred = makeKeymap('Redo Barred', 'Ctrl-Shift-z', 'Cmd-y');
82
- exports.redoBarred = redoBarred;
83
- var openHelp = makeKeyMapWithCommon('Open Help', 'Mod-/');
84
- exports.openHelp = openHelp;
85
- var addLink = makeKeyMapWithCommon('Link', 'Mod-k');
86
- exports.addLink = addLink;
87
- var submit = makeKeyMapWithCommon('Submit Content', 'Mod-Enter');
88
- exports.submit = submit;
89
- var enter = makeKeyMapWithCommon('Enter', 'Enter');
90
- exports.enter = enter;
91
- var tab = makeKeyMapWithCommon('Tab', 'Tab');
92
- exports.tab = tab;
93
- var indent = makeKeyMapWithCommon('Indent', 'Tab');
94
- exports.indent = indent;
95
- var outdent = makeKeyMapWithCommon('Outdent', 'Shift-Tab');
96
- exports.outdent = outdent;
97
- var backspace = makeKeyMapWithCommon('Backspace', 'Backspace');
98
- exports.backspace = backspace;
99
- var deleteKey = makeKeyMapWithCommon('Delete', 'Delete');
100
- exports.deleteKey = deleteKey;
101
- var space = makeKeyMapWithCommon('Space', 'Space');
102
- exports.space = space;
103
- var escape = makeKeyMapWithCommon('Escape', 'Escape');
104
- exports.escape = escape;
105
- var nextCell = makeKeyMapWithCommon('Next cell', 'Tab');
106
- exports.nextCell = nextCell;
107
- var previousCell = makeKeyMapWithCommon('Previous cell', 'Shift-Tab');
108
- exports.previousCell = previousCell;
109
- var toggleTable = makeKeyMapWithCommon('Table', 'Shift-Alt-t');
110
- exports.toggleTable = toggleTable;
111
- var addRowBefore = makeKeyMapWithCommon('Add Row Above', 'Ctrl-Alt-ArrowUp');
112
- exports.addRowBefore = addRowBefore;
113
- var addRowAfter = makeKeyMapWithCommon('Add Row Below', 'Ctrl-Alt-ArrowDown');
114
- exports.addRowAfter = addRowAfter;
115
- var addColumnAfter = makeKeyMapWithCommon('Add Column After', 'Ctrl-Alt-ArrowRight');
116
- exports.addColumnAfter = addColumnAfter;
117
- var addColumnBefore = makeKeyMapWithCommon('Add Column Before', 'Ctrl-Alt-ArrowLeft');
118
- exports.addColumnBefore = addColumnBefore;
119
- var cut = makeKeyMapWithCommon('Cut', 'Mod-x');
120
- exports.cut = cut;
121
- var copy = makeKeyMapWithCommon('Copy', 'Mod-c');
122
- exports.copy = copy;
123
- var paste = makeKeyMapWithCommon('Paste', 'Mod-v');
124
- exports.paste = paste;
125
- var altPaste = makeKeyMapWithCommon('Paste', 'Mod-Shift-v');
126
- exports.altPaste = altPaste;
127
- var arrowKeysMap = {
128
- // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
129
- ARROWLEFT: "\u2190",
130
- ARROWRIGHT: "\u2192",
131
- ARROWUP: "\u2191",
132
- ARROWDOWN: "\u2193"
133
- };
134
-
135
- function formatShortcut(keymap) {
136
- var shortcut;
137
-
138
- if (_browser["default"].mac) {
139
- // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
140
- shortcut = keymap.mac.replace(/Cmd/i, "\u2318").replace(/Shift/i, "\u21E7").replace(/Ctrl/i, "\u2303").replace(/Alt/i, "\u2325").replace(/Backspace/i, "\u232B");
141
- } else {
142
- shortcut = keymap.windows.replace(/Backspace/i, "\u232B");
143
- }
144
-
145
- var keys = shortcut.split('-');
146
- var lastKey = keys[keys.length - 1].toUpperCase();
147
- keys[keys.length - 1] = arrowKeysMap[lastKey] || lastKey;
148
- return keys.join(_browser["default"].mac ? '' : '+');
149
- }
150
-
151
- function findKeymapByDescription(description) {
152
- var matches = ALL.filter(function (keymap) {
153
- return keymap.description.toUpperCase() === description.toUpperCase();
154
- });
155
- return matches[0];
156
- }
157
-
158
- function findShortcutByDescription(description) {
159
- var keymap = findKeymapByDescription(description);
160
-
161
- if (keymap) {
162
- return findShortcutByKeymap(keymap);
163
- }
164
-
165
- return;
166
- }
167
-
168
- function findShortcutByKeymap(keymap) {
169
- if (_browser["default"].mac) {
170
- return keymap.mac;
171
- }
172
-
173
- return keymap.windows;
174
- }
175
-
176
- var ALL = [toggleOrderedList, toggleBulletList, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleCode, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleBlockQuote, insertNewLine, insertRule, splitCodeBlock, splitListItem, redo, undo];
177
-
178
- function makeKeymap(description, windows, mac, common) {
179
- return {
180
- description: description,
181
- windows: windows,
182
- mac: mac,
183
- common: common
184
- };
185
- }
186
-
187
- function makeKeyMapWithCommon(description, common) {
188
- var windows = common.replace(/Mod/i, 'Ctrl');
189
- var mac = common.replace(/Mod/i, 'Cmd');
190
- return makeKeymap(description, windows, mac, common);
191
- }
192
-
193
- function bindKeymapWithCommand(shortcut, cmd, keymap) {
194
- var oldCmd = keymap[shortcut];
195
- var newCmd = cmd;
196
-
197
- if (keymap[shortcut]) {
198
- newCmd = function newCmd(state, dispatch, editorView) {
199
- return oldCmd(state, dispatch) || cmd(state, dispatch, editorView);
200
- };
201
- }
202
-
203
- keymap[shortcut] = newCmd;
204
- }
205
-
206
- function findKeyMapForBrowser(keyMap) {
207
- if (keyMap) {
208
- if (_browser["default"].mac) {
209
- return keyMap.mac;
210
- }
211
-
212
- return keyMap.windows;
213
- }
214
-
215
- return;
216
- }
217
-
218
- var LEFT = 37;
219
- exports.LEFT = LEFT;
220
- var RIGHT = 39;
221
- exports.RIGHT = RIGHT;
222
- var UP = 38;
223
- exports.UP = UP;
224
- var DOWN = 40;
225
- exports.DOWN = DOWN;
226
- var KEY_0 = 48;
227
- exports.KEY_0 = KEY_0;
228
- var KEY_1 = 49;
229
- exports.KEY_1 = KEY_1;
230
- var KEY_2 = 50;
231
- exports.KEY_2 = KEY_2;
232
- var KEY_3 = 51;
233
- exports.KEY_3 = KEY_3;
234
- var KEY_4 = 52;
235
- exports.KEY_4 = KEY_4;
236
- var KEY_5 = 53;
237
- exports.KEY_5 = KEY_5;
238
- var KEY_6 = 54;
239
- exports.KEY_6 = KEY_6;
240
- var HEADING_KEYS = [KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6];
241
- exports.HEADING_KEYS = HEADING_KEYS;
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- 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); } }
9
-
10
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
-
12
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
-
14
- var BaseController = /*#__PURE__*/_createClass(function BaseController() {
15
- _classCallCheck(this, BaseController);
16
- });
17
-
18
- exports["default"] = BaseController;
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
-
10
- 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); } }
11
-
12
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
-
14
- var TitaRichEditor = /*#__PURE__*/function () {
15
- function TitaRichEditor(_ref) {
16
- var view = _ref.view,
17
- controllers = _ref.controllers,
18
- dispatcher = _ref.dispatcher;
19
-
20
- _classCallCheck(this, TitaRichEditor);
21
-
22
- this.view = view;
23
- this.controllers = controllers;
24
- this.eventDispatcher = dispatcher;
25
- this.on = dispatcher.on.bind(dispatcher);
26
- this.off = dispatcher.off.bind(dispatcher);
27
- this.emit = dispatcher.emit.bind(dispatcher);
28
- }
29
-
30
- _createClass(TitaRichEditor, [{
31
- key: "state",
32
- get: function get() {
33
- return this.view.state;
34
- }
35
- }, {
36
- key: "destroy",
37
- value: function destroy() {
38
- this.eventDispatcher.destroy();
39
- this.view.destroy();
40
- this.controllers = [];
41
- }
42
- }]);
43
-
44
- return TitaRichEditor;
45
- }();
46
-
47
- exports["default"] = TitaRichEditor;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- 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); } }
9
-
10
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
-
12
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
-
14
- var BasePlugin = /*#__PURE__*/_createClass(function BasePlugin() {
15
- _classCallCheck(this, BasePlugin);
16
-
17
- this.name = '';
18
- });
19
-
20
- exports["default"] = BasePlugin;
@@ -1,121 +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.InlineSchema = exports.BlockSchema = exports.BaseSchema = exports.AtomSchema = void 0;
9
-
10
- 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); }
11
-
12
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
13
-
14
- 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); }; }
15
-
16
- 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); }
17
-
18
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
-
20
- 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; } }
21
-
22
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
-
30
- // const createWrapperDOM = (tagName: string, attrs = {}, hasContent = false): DOMOutputSpec => {
31
- // const pDOM: DOMOutputSpecArray = [tagName, attrs];
32
- // if (hasContent) pDOM[2] = 0;
33
- // return pDOM;
34
- // };
35
- var BaseSchema = /*#__PURE__*/_createClass(function BaseSchema() {
36
- _classCallCheck(this, BaseSchema);
37
-
38
- this.priority = 50;
39
- });
40
-
41
- exports.BaseSchema = BaseSchema;
42
-
43
- var BlockSchema = /*#__PURE__*/function (_BaseSchema) {
44
- _inherits(BlockSchema, _BaseSchema);
45
-
46
- var _super = _createSuper(BlockSchema);
47
-
48
- function BlockSchema() {
49
- var _this;
50
-
51
- _classCallCheck(this, BlockSchema);
52
-
53
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
54
- args[_key] = arguments[_key];
55
- }
56
-
57
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.group = 'block', _this.content = 'inline*', _this.inline = false, _this.defining = true, _this.draggable = false, _this.selectable = false, _assertThisInitialized(_this)));
58
- }
59
-
60
- _createClass(BlockSchema, [{
61
- key: "tagName",
62
- value: function tagName() {
63
- return 'div';
64
- }
65
- }]);
66
-
67
- return BlockSchema;
68
- }(BaseSchema);
69
-
70
- exports.BlockSchema = BlockSchema;
71
-
72
- var InlineSchema = /*#__PURE__*/function (_BaseSchema2) {
73
- _inherits(InlineSchema, _BaseSchema2);
74
-
75
- var _super2 = _createSuper(InlineSchema);
76
-
77
- function InlineSchema() {
78
- var _this2;
79
-
80
- _classCallCheck(this, InlineSchema);
81
-
82
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
83
- args[_key2] = arguments[_key2];
84
- }
85
-
86
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.group = 'inline', _this2.inclusive = true, _assertThisInitialized(_this2)));
87
- }
88
-
89
- _createClass(InlineSchema, [{
90
- key: "tagName",
91
- value: function tagName() {
92
- return 'span';
93
- }
94
- }]);
95
-
96
- return InlineSchema;
97
- }(BaseSchema);
98
-
99
- exports.InlineSchema = InlineSchema;
100
-
101
- var AtomSchema = /*#__PURE__*/function (_BaseSchema3) {
102
- _inherits(AtomSchema, _BaseSchema3);
103
-
104
- var _super3 = _createSuper(AtomSchema);
105
-
106
- function AtomSchema() {
107
- var _this3;
108
-
109
- _classCallCheck(this, AtomSchema);
110
-
111
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
112
- args[_key3] = arguments[_key3];
113
- }
114
-
115
- return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.isLeaf = true, _this3.draggable = true, _assertThisInitialized(_this3)));
116
- }
117
-
118
- return _createClass(AtomSchema);
119
- }(BaseSchema);
120
-
121
- exports.AtomSchema = AtomSchema;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.wrapInBlockquote = wrapInBlockquote;
7
-
8
- var _commands = require("../../../utils/commands");
9
-
10
- var _prosemirrorCommands = require("prosemirror-commands");
11
-
12
- function wrapInBlockquote(editor) {
13
- var state = editor.state;
14
- var schema = editor.state.schema;
15
- var $from = state.selection.$from;
16
- var parent = $from.node($from.depth - 1);
17
-
18
- if (parent.type === schema.nodes.blockquote) {
19
- (0, _commands.clearNodes)()(state, editor.view.dispatch);
20
- editor.view.focus();
21
- return;
22
- }
23
-
24
- (0, _commands.chainTransactions)((0, _commands.clearNodes)(), (0, _prosemirrorCommands.wrapIn)(schema.nodes.blockquote))(state, editor.view.dispatch);
25
- editor.view.focus();
26
- return;
27
- }
@@ -1,126 +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.BlockquoteSchema = exports.BlockquotePlugin = exports.BlockquoteController = 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 _util = require("../../util");
17
-
18
- var _commond = require("./commond");
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 = 'blockquote';
43
-
44
- var BlockquoteSchema = /*#__PURE__*/function (_BlockSchema) {
45
- _inherits(BlockquoteSchema, _BlockSchema);
46
-
47
- var _super = _createSuper(BlockquoteSchema);
48
-
49
- function BlockquoteSchema() {
50
- var _this;
51
-
52
- _classCallCheck(this, BlockquoteSchema);
53
-
54
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
- args[_key] = arguments[_key];
56
- }
57
-
58
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.name = PLUGIN_NAME, _this.content = "block+", _this.parseDOM = [{
59
- tag: "blockquote"
60
- }], _assertThisInitialized(_this)));
61
- }
62
-
63
- _createClass(BlockquoteSchema, [{
64
- key: "toDOM",
65
- value: function toDOM() {
66
- return ["blockquote", 0];
67
- }
68
- }]);
69
-
70
- return BlockquoteSchema;
71
- }(_schema.BlockSchema);
72
-
73
- exports.BlockquoteSchema = BlockquoteSchema;
74
-
75
- var BlockquoteController = /*#__PURE__*/function (_BaseController) {
76
- _inherits(BlockquoteController, _BaseController);
77
-
78
- var _super2 = _createSuper(BlockquoteController);
79
-
80
- function BlockquoteController() {
81
- var _this2;
82
-
83
- _classCallCheck(this, BlockquoteController);
84
-
85
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
86
- args[_key2] = arguments[_key2];
87
- }
88
-
89
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.toolbar = {
90
- title: '引用',
91
- icon: 'tu-icon-text-quotel',
92
- handler: function handler(editor) {
93
- (0, _commond.wrapInBlockquote)(editor);
94
- },
95
- active: function active(state) {
96
- return (0, _util.isBlockActive)(state, PLUGIN_NAME);
97
- }
98
- }, _assertThisInitialized(_this2)));
99
- }
100
-
101
- return _createClass(BlockquoteController);
102
- }(_controller["default"]);
103
-
104
- exports.BlockquoteController = BlockquoteController;
105
-
106
- var BlockquotePlugin = /*#__PURE__*/function (_BasePlugin) {
107
- _inherits(BlockquotePlugin, _BasePlugin);
108
-
109
- var _super3 = _createSuper(BlockquotePlugin);
110
-
111
- function BlockquotePlugin() {
112
- var _this3;
113
-
114
- _classCallCheck(this, BlockquotePlugin);
115
-
116
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
117
- args[_key3] = arguments[_key3];
118
- }
119
-
120
- return _possibleConstructorReturn(_this3, (_this3 = _super3.call.apply(_super3, [this].concat(args)), _this3.name = PLUGIN_NAME, _this3.schema = BlockquoteSchema, _this3.controller = BlockquoteController, _assertThisInitialized(_this3)));
121
- }
122
-
123
- return _createClass(BlockquotePlugin);
124
- }(_plugin["default"]);
125
-
126
- exports.BlockquotePlugin = BlockquotePlugin;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setHeadLine = setHeadLine;
7
-
8
- var _commands = require("../../../utils/commands");
9
-
10
- var _prosemirrorCommands = require("prosemirror-commands");
11
-
12
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
-
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
- function setHeadLine(editor, level) {
19
- var state = editor.state;
20
- var schema = editor.state.schema;
21
- var $from = state.selection.$from;
22
- var node = $from.node();
23
-
24
- if (node.type === schema.nodes.heading && level === node.attrs.level) {
25
- return (0, _prosemirrorCommands.setBlockType)(schema.nodes.paragraph, node.attrs)(state, editor.view.dispatch);
26
- }
27
-
28
- return (0, _commands.chainTransactions)((0, _commands.clearNodes)(), (0, _prosemirrorCommands.setBlockType)(schema.nodes.heading, _objectSpread(_objectSpread({}, node.attrs), {}, {
29
- level: level
30
- })))(state, editor.view.dispatch);
31
- }