@titaui/pc 1.10.40 → 1.10.44

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 (105) hide show
  1. package/lib/components/dynamic/dynamic-item/dynamic-chart/index.js +18 -3
  2. package/lib/components/superset-charts/utils/axios.js +2 -2
  3. package/lib/components/upload/index.js +2 -4
  4. package/lib/index.js +0 -8
  5. package/package.json +2 -20
  6. package/lib/components/rich-editor/basic/schema.js +0 -47
  7. package/lib/components/rich-editor/consts/events.js +0 -12
  8. package/lib/components/rich-editor/enums.js +0 -42
  9. package/lib/components/rich-editor/index.js +0 -58
  10. package/lib/components/rich-editor/keymap.js +0 -119
  11. package/lib/components/rich-editor/keymaps/index.js +0 -241
  12. package/lib/components/rich-editor/models/controller.js +0 -18
  13. package/lib/components/rich-editor/models/editor.js +0 -47
  14. package/lib/components/rich-editor/models/plugin.js +0 -20
  15. package/lib/components/rich-editor/models/schema.js +0 -121
  16. package/lib/components/rich-editor/plugins/block/block-quote/commond.js +0 -27
  17. package/lib/components/rich-editor/plugins/block/block-quote/index.js +0 -126
  18. package/lib/components/rich-editor/plugins/block/heading/commonds.js +0 -31
  19. package/lib/components/rich-editor/plugins/block/heading/index.js +0 -188
  20. package/lib/components/rich-editor/plugins/block/index.js +0 -57
  21. package/lib/components/rich-editor/plugins/block/lists/actions/conversions.js +0 -172
  22. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list-items-selected.js +0 -163
  23. package/lib/components/rich-editor/plugins/block/lists/actions/indent-list.js +0 -59
  24. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-forward.js +0 -74
  25. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/index.js +0 -45
  26. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-paragraph.js +0 -104
  27. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-list-item-with-parent-nested-list.js +0 -92
  28. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-nested-list-with-parent-list-item.js +0 -89
  29. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-paragraph-with-list.js +0 -48
  30. package/lib/components/rich-editor/plugins/block/lists/actions/join-list-items-scenarios/join-sibling-list-items.js +0 -61
  31. package/lib/components/rich-editor/plugins/block/lists/actions/merge-lists.js +0 -34
  32. package/lib/components/rich-editor/plugins/block/lists/actions/outdent-list-items-selected.js +0 -289
  33. package/lib/components/rich-editor/plugins/block/lists/actions/wrap-and-join-lists.js +0 -180
  34. package/lib/components/rich-editor/plugins/block/lists/baseCommand.js +0 -328
  35. package/lib/components/rich-editor/plugins/block/lists/commond/indent-list.js +0 -60
  36. package/lib/components/rich-editor/plugins/block/lists/commond/index.js +0 -398
  37. package/lib/components/rich-editor/plugins/block/lists/commond/join-list-item-forward.js +0 -45
  38. package/lib/components/rich-editor/plugins/block/lists/commond/listBackspace.js +0 -302
  39. package/lib/components/rich-editor/plugins/block/lists/commond/outdent-list.js +0 -43
  40. package/lib/components/rich-editor/plugins/block/lists/index.js +0 -222
  41. package/lib/components/rich-editor/plugins/block/lists/messages.js +0 -38
  42. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/input-rule.js +0 -152
  43. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/keymap.js +0 -33
  44. package/lib/components/rich-editor/plugins/block/lists/pm-plugins/main.js +0 -94
  45. package/lib/components/rich-editor/plugins/block/lists/styles.js +0 -15
  46. package/lib/components/rich-editor/plugins/block/lists/transforms.js +0 -347
  47. package/lib/components/rich-editor/plugins/block/lists/utils/analytics.js +0 -48
  48. package/lib/components/rich-editor/plugins/block/lists/utils/find.js +0 -126
  49. package/lib/components/rich-editor/plugins/block/lists/utils/indentation.js +0 -87
  50. package/lib/components/rich-editor/plugins/block/lists/utils/node.js +0 -144
  51. package/lib/components/rich-editor/plugins/block/lists/utils/replace-content.js +0 -31
  52. package/lib/components/rich-editor/plugins/block/lists/utils/selection.js +0 -201
  53. package/lib/components/rich-editor/plugins/block/lists/utils.js +0 -52
  54. package/lib/components/rich-editor/plugins/block/paragraph/index.js +0 -91
  55. package/lib/components/rich-editor/plugins/core/index.js +0 -90
  56. package/lib/components/rich-editor/plugins/core/pm-plugins/focus-handler.js +0 -67
  57. package/lib/components/rich-editor/plugins/core/pm-plugins/keymap.js +0 -29
  58. package/lib/components/rich-editor/plugins/core/pm-plugins/reactNodeView.js +0 -80
  59. package/lib/components/rich-editor/plugins/extension/alignment/commond.js +0 -24
  60. package/lib/components/rich-editor/plugins/extension/alignment/index.js +0 -111
  61. package/lib/components/rich-editor/plugins/extension/alignment/utils.js +0 -19
  62. package/lib/components/rich-editor/plugins/extension/index.js +0 -18
  63. package/lib/components/rich-editor/plugins/index.js +0 -44
  64. package/lib/components/rich-editor/plugins/inline/color/commond.js +0 -128
  65. package/lib/components/rich-editor/plugins/inline/color/consts.js +0 -43
  66. package/lib/components/rich-editor/plugins/inline/color/index.css +0 -61
  67. package/lib/components/rich-editor/plugins/inline/color/index.js +0 -209
  68. package/lib/components/rich-editor/plugins/inline/color/selector.js +0 -250
  69. package/lib/components/rich-editor/plugins/inline/delete-line/index.js +0 -147
  70. package/lib/components/rich-editor/plugins/inline/em/index.js +0 -93
  71. package/lib/components/rich-editor/plugins/inline/index.js +0 -83
  72. package/lib/components/rich-editor/plugins/inline/link/commands.js +0 -256
  73. package/lib/components/rich-editor/plugins/inline/link/index.js +0 -149
  74. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/fake-cursor-for-toolbar.js +0 -77
  75. package/lib/components/rich-editor/plugins/inline/link/pm-plugins/main.js +0 -293
  76. package/lib/components/rich-editor/plugins/inline/link/ui/index.css +0 -79
  77. package/lib/components/rich-editor/plugins/inline/link/ui/linkEditor.js +0 -148
  78. package/lib/components/rich-editor/plugins/inline/link/ui/linkToolbar.js +0 -88
  79. package/lib/components/rich-editor/plugins/inline/link/ui/toolbarBtn.js +0 -117
  80. package/lib/components/rich-editor/plugins/inline/link/utils.js +0 -33
  81. package/lib/components/rich-editor/plugins/inline/strong/index.js +0 -137
  82. package/lib/components/rich-editor/plugins/inline/under-line/index.js +0 -145
  83. package/lib/components/rich-editor/plugins/util.js +0 -281
  84. package/lib/components/rich-editor/react/reactNodeView.js +0 -383
  85. package/lib/components/rich-editor/react/uiProvider.js +0 -185
  86. package/lib/components/rich-editor/schemas/basic.js +0 -309
  87. package/lib/components/rich-editor/schemas/index.js +0 -19
  88. package/lib/components/rich-editor/schemas/list.js +0 -342
  89. package/lib/components/rich-editor/types/commond.js +0 -5
  90. package/lib/components/rich-editor/types/index.js +0 -18
  91. package/lib/components/rich-editor/ui/Popup/index.js +0 -247
  92. package/lib/components/rich-editor/ui/Popup/utils.js +0 -399
  93. package/lib/components/rich-editor/ui/editor/index.css +0 -144
  94. package/lib/components/rich-editor/ui/editor/index.js +0 -143
  95. package/lib/components/rich-editor/ui/normal-toolbar/index.css +0 -29
  96. package/lib/components/rich-editor/ui/normal-toolbar/index.js +0 -109
  97. package/lib/components/rich-editor/utils/browser.js +0 -35
  98. package/lib/components/rich-editor/utils/commands.js +0 -266
  99. package/lib/components/rich-editor/utils/document.js +0 -160
  100. package/lib/components/rich-editor/utils/event.js +0 -79
  101. package/lib/components/rich-editor/utils/helpers.js +0 -16
  102. package/lib/components/rich-editor/utils/mark.js +0 -168
  103. package/lib/components/rich-editor/utils/slice.js +0 -85
  104. package/lib/components/rich-editor/utils/toolbar.js +0 -228
  105. package/yarn-error.log +0 -22184
@@ -1,91 +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.ParagraphSchema = exports.ParagraphPlugin = 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 = 'paragraph';
37
-
38
- var ParagraphSchema = /*#__PURE__*/function (_BlockSchema) {
39
- _inherits(ParagraphSchema, _BlockSchema);
40
-
41
- var _super = _createSuper(ParagraphSchema);
42
-
43
- function ParagraphSchema() {
44
- var _this;
45
-
46
- _classCallCheck(this, ParagraphSchema);
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.content = "inline*", _this.parseDOM = [{
53
- tag: "p"
54
- }], _assertThisInitialized(_this)));
55
- }
56
-
57
- _createClass(ParagraphSchema, [{
58
- key: "toDOM",
59
- value: function toDOM(node) {
60
- return ["p", {
61
- style: "text-align:".concat(node.attrs["textAlign"])
62
- }, 0];
63
- }
64
- }]);
65
-
66
- return ParagraphSchema;
67
- }(_schema.BlockSchema);
68
-
69
- exports.ParagraphSchema = ParagraphSchema;
70
-
71
- var ParagraphPlugin = /*#__PURE__*/function (_BasePlugin) {
72
- _inherits(ParagraphPlugin, _BasePlugin);
73
-
74
- var _super2 = _createSuper(ParagraphPlugin);
75
-
76
- function ParagraphPlugin() {
77
- var _this2;
78
-
79
- _classCallCheck(this, ParagraphPlugin);
80
-
81
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
82
- args[_key2] = arguments[_key2];
83
- }
84
-
85
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = PLUGIN_NAME, _this2.schema = ParagraphSchema, _assertThisInitialized(_this2)));
86
- }
87
-
88
- return _createClass(ParagraphPlugin);
89
- }(_plugin["default"]);
90
-
91
- exports.ParagraphPlugin = ParagraphPlugin;
@@ -1,90 +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.CorePluginController = exports.CorePlugin = void 0;
9
-
10
- var _prosemirrorHistory = require("prosemirror-history");
11
-
12
- var _prosemirrorCommands = require("prosemirror-commands");
13
-
14
- var _prosemirrorKeymap = require("prosemirror-keymap");
15
-
16
- var _controller = _interopRequireDefault(require("../../models/controller"));
17
-
18
- var _plugin = _interopRequireDefault(require("../../models/plugin"));
19
-
20
- var _focusHandler = _interopRequireDefault(require("./pm-plugins/focus-handler"));
21
-
22
- var _keymap = _interopRequireDefault(require("./pm-plugins/keymap"));
23
-
24
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
-
26
- 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); } }
27
-
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
-
30
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
-
32
- 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); }
33
-
34
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
-
36
- 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); }; }
37
-
38
- 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); }
39
-
40
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
-
42
- 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; } }
43
-
44
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
-
46
- var PLUGIN_NAME = 'base';
47
-
48
- var CorePluginController = /*#__PURE__*/function (_BaseController) {
49
- _inherits(CorePluginController, _BaseController);
50
-
51
- var _super = _createSuper(CorePluginController);
52
-
53
- function CorePluginController() {
54
- var _this;
55
-
56
- _classCallCheck(this, CorePluginController);
57
-
58
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
59
- args[_key] = arguments[_key];
60
- }
61
-
62
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.pmPlugins = [_focusHandler["default"], (0, _prosemirrorHistory.history)(), (0, _keymap["default"])(), (0, _prosemirrorKeymap.keymap)(_prosemirrorCommands.baseKeymap)], _assertThisInitialized(_this)));
63
- }
64
-
65
- return _createClass(CorePluginController);
66
- }(_controller["default"]);
67
-
68
- exports.CorePluginController = CorePluginController;
69
-
70
- var CorePlugin = /*#__PURE__*/function (_BasePlugin) {
71
- _inherits(CorePlugin, _BasePlugin);
72
-
73
- var _super2 = _createSuper(CorePlugin);
74
-
75
- function CorePlugin() {
76
- var _this2;
77
-
78
- _classCallCheck(this, CorePlugin);
79
-
80
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
81
- args[_key2] = arguments[_key2];
82
- }
83
-
84
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = PLUGIN_NAME, _this2.controller = CorePluginController, _assertThisInitialized(_this2)));
85
- }
86
-
87
- return _createClass(CorePlugin);
88
- }(_plugin["default"]);
89
-
90
- exports.CorePlugin = CorePlugin;
@@ -1,67 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.focusStateKey = exports["default"] = void 0;
7
-
8
- var _prosemirrorState = require("prosemirror-state");
9
-
10
- var focusStateKey = new _prosemirrorState.PluginKey('focusStatePlugin');
11
- exports.focusStateKey = focusStateKey;
12
-
13
- var _default = function _default(dispatch) {
14
- return new _prosemirrorState.Plugin({
15
- key: focusStateKey,
16
- state: {
17
- init: function init() {
18
- return false;
19
- },
20
- apply: function apply(tr, wasEditorFocused) {
21
- var meta = tr.getMeta(focusStateKey);
22
-
23
- if (typeof meta === 'boolean') {
24
- if (meta !== wasEditorFocused) {
25
- dispatch(focusStateKey, meta);
26
- return meta;
27
- }
28
- }
29
-
30
- return wasEditorFocused;
31
- }
32
- },
33
- props: {
34
- handleDOMEvents: {
35
- click: function click(view) {
36
- var isEditorFocused = focusStateKey.getState(view.state);
37
-
38
- if (!isEditorFocused) {
39
- view.dispatch(view.state.tr.setMeta(focusStateKey, view.hasFocus()));
40
- }
41
-
42
- return false;
43
- },
44
- focus: function focus(view) {
45
- var isEditorFocused = focusStateKey.getState(view.state);
46
-
47
- if (!isEditorFocused) {
48
- view.dispatch(view.state.tr.setMeta(focusStateKey, true));
49
- }
50
-
51
- return false;
52
- },
53
- blur: function blur(view) {
54
- var isEditorFocused = focusStateKey.getState(view.state);
55
-
56
- if (isEditorFocused) {
57
- view.dispatch(view.state.tr.setMeta(focusStateKey, false));
58
- }
59
-
60
- return false;
61
- }
62
- }
63
- }
64
- });
65
- };
66
-
67
- exports["default"] = _default;
@@ -1,29 +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
- exports.keymapPlugin = keymapPlugin;
10
-
11
- var _prosemirrorKeymap = require("prosemirror-keymap");
12
-
13
- var _prosemirrorHistory = require("prosemirror-history");
14
-
15
- var keymaps = _interopRequireWildcard(require("../../../keymaps"));
16
-
17
- 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); }
18
-
19
- 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; }
20
-
21
- function keymapPlugin() {
22
- var list = {};
23
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.undo), _prosemirrorHistory.undo, list);
24
- keymaps.bindKeymapWithCommand(keymaps.findShortcutByKeymap(keymaps.redo), _prosemirrorHistory.redo, list);
25
- return (0, _prosemirrorKeymap.keymap)(list);
26
- }
27
-
28
- var _default = keymapPlugin;
29
- exports["default"] = _default;
@@ -1,80 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.stateKey = exports.plugin = exports["default"] = exports.ReactNodeViewState = void 0;
7
-
8
- var _prosemirrorState = require("prosemirror-state");
9
-
10
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
-
12
- 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); } }
13
-
14
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
-
16
- var ReactNodeViewState = /*#__PURE__*/function () {
17
- function ReactNodeViewState() {
18
- _classCallCheck(this, ReactNodeViewState);
19
-
20
- this.changeHandlers = [];
21
- this.changeHandlers = [];
22
- }
23
-
24
- _createClass(ReactNodeViewState, [{
25
- key: "subscribe",
26
- value: function subscribe(cb) {
27
- this.changeHandlers.push(cb);
28
- }
29
- }, {
30
- key: "unsubscribe",
31
- value: function unsubscribe(cb) {
32
- this.changeHandlers = this.changeHandlers.filter(function (ch) {
33
- return ch !== cb;
34
- });
35
- }
36
- }, {
37
- key: "notifyNewSelection",
38
- value: function notifyNewSelection(fromPos, toPos) {
39
- this.changeHandlers.forEach(function (cb) {
40
- return cb(fromPos, toPos);
41
- });
42
- }
43
- }]);
44
-
45
- return ReactNodeViewState;
46
- }();
47
-
48
- exports.ReactNodeViewState = ReactNodeViewState;
49
- var stateKey = new _prosemirrorState.PluginKey('reactNodeView');
50
- exports.stateKey = stateKey;
51
- var plugin = new _prosemirrorState.Plugin({
52
- state: {
53
- init: function init() {
54
- return new ReactNodeViewState();
55
- },
56
- apply: function apply(_tr, pluginState) {
57
- return pluginState;
58
- }
59
- },
60
- key: stateKey,
61
- view: function view(_view) {
62
- var pluginState = stateKey.getState(_view.state);
63
- return {
64
- update: function update(view) {
65
- var _view$state$selection = view.state.selection,
66
- from = _view$state$selection.from,
67
- to = _view$state$selection.to;
68
- pluginState.notifyNewSelection(from, to);
69
- }
70
- };
71
- }
72
- });
73
- exports.plugin = plugin;
74
-
75
- var plugins = function plugins() {
76
- return [plugin];
77
- };
78
-
79
- var _default = plugins;
80
- exports["default"] = _default;
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setAlignment = setAlignment;
7
-
8
- var _prosemirrorCommands = require("prosemirror-commands");
9
-
10
- 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; }
11
-
12
- 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; }
13
-
14
- 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; }
15
-
16
- function setAlignment(editor, alignment) {
17
- var state = editor.state;
18
- var $from = state.selection.$from;
19
- var node = $from.node();
20
- (0, _prosemirrorCommands.setBlockType)(node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
21
- textAlign: alignment
22
- }))(state, editor.view.dispatch);
23
- editor.view.focus();
24
- }
@@ -1,111 +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.AlignmentPlugin = exports.AlignmentController = void 0;
9
-
10
- var _plugin = _interopRequireDefault(require("../../../models/plugin"));
11
-
12
- var _controller = _interopRequireDefault(require("../../../models/controller"));
13
-
14
- var _commond = require("./commond");
15
-
16
- var _utils = require("./utils");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
-
20
- 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); } }
21
-
22
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
-
24
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- 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); }
27
-
28
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
-
30
- 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); }; }
31
-
32
- 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); }
33
-
34
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
-
36
- 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; } }
37
-
38
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
-
40
- var PLUGIN_NAME = 'alignment';
41
-
42
- var AlignmentController = /*#__PURE__*/function (_BaseController) {
43
- _inherits(AlignmentController, _BaseController);
44
-
45
- var _super = _createSuper(AlignmentController);
46
-
47
- function AlignmentController() {
48
- var _this;
49
-
50
- _classCallCheck(this, AlignmentController);
51
-
52
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
53
- args[_key] = arguments[_key];
54
- }
55
-
56
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.toolbar = [{
57
- title: '左对齐',
58
- icon: 'tu-icon-text-left',
59
- handler: function handler(editor) {
60
- (0, _commond.setAlignment)(editor, 'left');
61
- },
62
- active: function active(state) {
63
- return (0, _utils.hasAlignment)(state, 'left');
64
- }
65
- }, {
66
- title: '居中对齐',
67
- icon: 'tu-icon-text-center',
68
- handler: function handler(editor) {
69
- (0, _commond.setAlignment)(editor, 'center');
70
- },
71
- active: function active(state) {
72
- return (0, _utils.hasAlignment)(state, 'center');
73
- }
74
- }, {
75
- title: '右对齐',
76
- icon: 'tu-icon-text-right',
77
- handler: function handler(editor) {
78
- (0, _commond.setAlignment)(editor, 'right');
79
- },
80
- active: function active(state) {
81
- return (0, _utils.hasAlignment)(state, 'right');
82
- }
83
- }], _assertThisInitialized(_this)));
84
- }
85
-
86
- return _createClass(AlignmentController);
87
- }(_controller["default"]);
88
-
89
- exports.AlignmentController = AlignmentController;
90
-
91
- var AlignmentPlugin = /*#__PURE__*/function (_BasePlugin) {
92
- _inherits(AlignmentPlugin, _BasePlugin);
93
-
94
- var _super2 = _createSuper(AlignmentPlugin);
95
-
96
- function AlignmentPlugin() {
97
- var _this2;
98
-
99
- _classCallCheck(this, AlignmentPlugin);
100
-
101
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
102
- args[_key2] = arguments[_key2];
103
- }
104
-
105
- return _possibleConstructorReturn(_this2, (_this2 = _super2.call.apply(_super2, [this].concat(args)), _this2.name = PLUGIN_NAME, _this2.controller = AlignmentController, _assertThisInitialized(_this2)));
106
- }
107
-
108
- return _createClass(AlignmentPlugin);
109
- }(_plugin["default"]);
110
-
111
- exports.AlignmentPlugin = AlignmentPlugin;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.hasAlignment = hasAlignment;
7
-
8
- function hasAlignment(state, alignment) {
9
- var _state$selection = state.selection,
10
- from = _state$selection.from,
11
- to = _state$selection.to;
12
- var has = false;
13
- state.doc.nodesBetween(from, to, function (node) {
14
- if (has) return false;
15
- if (node.attrs.textAlign === alignment) has = true;
16
- return !has;
17
- });
18
- return has;
19
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _alignment = require("./alignment");
8
-
9
- Object.keys(_alignment).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _alignment[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _alignment[key];
16
- }
17
- });
18
- });
@@ -1,44 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _block = require("./block");
8
-
9
- Object.keys(_block).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _block[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _block[key];
16
- }
17
- });
18
- });
19
-
20
- var _inline = require("./inline");
21
-
22
- Object.keys(_inline).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _inline[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function get() {
28
- return _inline[key];
29
- }
30
- });
31
- });
32
-
33
- var _extension = require("./extension");
34
-
35
- Object.keys(_extension).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _extension[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function get() {
41
- return _extension[key];
42
- }
43
- });
44
- });