@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,185 +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.PortalRenderer = exports.PortalProviderAPI = exports.PortalProvider = void 0;
9
-
10
- var React = _interopRequireWildcard(require("react"));
11
-
12
- var _reactDom = require("react-dom");
13
-
14
- var _event = require("../utils/event");
15
-
16
- 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); }
17
-
18
- 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; }
19
-
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
-
22
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
-
24
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
25
-
26
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
27
-
28
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
29
-
30
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
-
32
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
- 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); } }
35
-
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
- 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); }
39
-
40
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
- 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); }; }
43
-
44
- 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); }
45
-
46
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
- 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; } }
49
-
50
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
- var PortalProviderAPI = /*#__PURE__*/function (_EventDispatcher) {
53
- _inherits(PortalProviderAPI, _EventDispatcher);
54
-
55
- var _super = _createSuper(PortalProviderAPI);
56
-
57
- function PortalProviderAPI() {
58
- var _this;
59
-
60
- _classCallCheck(this, PortalProviderAPI);
61
-
62
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
63
- args[_key] = arguments[_key];
64
- }
65
-
66
- return _possibleConstructorReturn(_this, (_this = _super.call.apply(_super, [this].concat(args)), _this.portals = new Map(), _this.setContext = function (context) {
67
- _this.context = context;
68
- }, _assertThisInitialized(_this)));
69
- }
70
-
71
- _createClass(PortalProviderAPI, [{
72
- key: "render",
73
- value: function render(children, container) {
74
- var hasReactContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
75
- this.portals.set(container, {
76
- children: children,
77
- hasReactContext: hasReactContext
78
- });
79
- (0, _reactDom.unstable_renderSubtreeIntoContainer)(this.context, children(), container);
80
- } // TODO: until https://product-fabric.atlassian.net/browse/ED-5013
81
- // we (unfortunately) need to re-render to pass down any updated context.
82
- // selectively do this for nodeviews that opt-in via `hasReactContext`
83
-
84
- }, {
85
- key: "forceUpdate",
86
- value: function forceUpdate() {
87
- var _this2 = this;
88
-
89
- this.portals.forEach(function (portal, container) {
90
- if (!portal.hasReactContext) {
91
- return;
92
- }
93
-
94
- (0, _reactDom.unstable_renderSubtreeIntoContainer)(_this2.context, portal.children(), container);
95
- });
96
- }
97
- }, {
98
- key: "remove",
99
- value: function remove(container) {
100
- this.portals["delete"](container);
101
- (0, _reactDom.unmountComponentAtNode)(container);
102
- }
103
- }]);
104
-
105
- return PortalProviderAPI;
106
- }(_event.EventDispatcher);
107
-
108
- exports.PortalProviderAPI = PortalProviderAPI;
109
-
110
- var PortalProvider = /*#__PURE__*/function (_React$Component) {
111
- _inherits(PortalProvider, _React$Component);
112
-
113
- var _super2 = _createSuper(PortalProvider);
114
-
115
- function PortalProvider(props) {
116
- var _this3;
117
-
118
- _classCallCheck(this, PortalProvider);
119
-
120
- _this3 = _super2.call(this, props);
121
- _this3.portalProviderAPI = new PortalProviderAPI();
122
- return _this3;
123
- }
124
-
125
- _createClass(PortalProvider, [{
126
- key: "render",
127
- value: function render() {
128
- return this.props.render(this.portalProviderAPI);
129
- }
130
- }, {
131
- key: "componentDidUpdate",
132
- value: function componentDidUpdate() {
133
- this.portalProviderAPI.forceUpdate();
134
- }
135
- }]);
136
-
137
- return PortalProvider;
138
- }(React.Component);
139
-
140
- exports.PortalProvider = PortalProvider;
141
-
142
- var PortalRenderer = /*#__PURE__*/function (_React$Component2) {
143
- _inherits(PortalRenderer, _React$Component2);
144
-
145
- var _super3 = _createSuper(PortalRenderer);
146
-
147
- function PortalRenderer(props) {
148
- var _this4;
149
-
150
- _classCallCheck(this, PortalRenderer);
151
-
152
- _this4 = _super3.call(this, props);
153
-
154
- _this4.handleUpdate = function (portals) {
155
- return _this4.setState({
156
- portals: portals
157
- });
158
- };
159
-
160
- props.portalProviderAPI.setContext(_assertThisInitialized(_this4));
161
- props.portalProviderAPI.on('update', _this4.handleUpdate);
162
- _this4.state = {
163
- portals: new Map()
164
- };
165
- return _this4;
166
- }
167
-
168
- _createClass(PortalRenderer, [{
169
- key: "render",
170
- value: function render() {
171
- var portals = this.state.portals;
172
- return /*#__PURE__*/React.createElement(React.Fragment, null, Array.from(portals.entries()).map(function (_ref) {
173
- var _ref2 = _slicedToArray(_ref, 2),
174
- container = _ref2[0],
175
- children = _ref2[1];
176
-
177
- return /*#__PURE__*/(0, _reactDom.createPortal)(children, container);
178
- }));
179
- }
180
- }]);
181
-
182
- return PortalRenderer;
183
- }(React.Component);
184
-
185
- exports.PortalRenderer = PortalRenderer;
@@ -1,309 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.schema = exports.nodes = exports.marks = void 0;
7
-
8
- var _prosemirrorModel = require("prosemirror-model");
9
-
10
- var blockquoteDOM = ["blockquote", 0];
11
- var hrDOM = ["hr"];
12
- var preDOM = ["pre", ["code", 0]];
13
- var brDOM = ["br"]; // :: Object
14
- // [Specs](#model.NodeSpec) for the nodes defined in this schema.
15
-
16
- var nodes = {
17
- // :: NodeSpec The top level document node.
18
- doc: {
19
- content: "block+"
20
- },
21
- // :: NodeSpec A plain paragraph textblock. Represented in the DOM
22
- // as a `<p>` element.
23
- paragraph: {
24
- content: "inline*",
25
- attrs: {
26
- textAlign: {
27
- "default": 'left'
28
- }
29
- },
30
- group: "block",
31
- parseDOM: [{
32
- tag: "p"
33
- }],
34
- toDOM: function toDOM(node) {
35
- return ["p", {
36
- style: "text-align:".concat(node.attrs["textAlign"])
37
- }, 0];
38
- }
39
- },
40
- // :: NodeSpec A blockquote (`<blockquote>`) wrapping one or more blocks.
41
- blockquote: {
42
- content: "block+",
43
- group: "block",
44
- defining: true,
45
- parseDOM: [{
46
- tag: "blockquote"
47
- }],
48
- toDOM: function toDOM() {
49
- return blockquoteDOM;
50
- }
51
- },
52
- // :: NodeSpec A horizontal rule (`<hr>`).
53
- horizontal_rule: {
54
- group: "block",
55
- parseDOM: [{
56
- tag: "hr"
57
- }],
58
- toDOM: function toDOM() {
59
- return hrDOM;
60
- }
61
- },
62
- // :: NodeSpec A heading textblock, with a `level` attribute that
63
- // should hold the number 1 to 6. Parsed and serialized as `<h1>` to
64
- // `<h6>` elements.
65
- heading: {
66
- attrs: {
67
- level: {
68
- "default": 1
69
- },
70
- textAlign: {
71
- "default": 'left'
72
- }
73
- },
74
- content: "inline*",
75
- group: "block",
76
- defining: true,
77
- parseDOM: [{
78
- tag: "h1",
79
- attrs: {
80
- level: 1
81
- }
82
- }, {
83
- tag: "h2",
84
- attrs: {
85
- level: 2
86
- }
87
- }, {
88
- tag: "h3",
89
- attrs: {
90
- level: 3
91
- }
92
- }, {
93
- tag: "h4",
94
- attrs: {
95
- level: 4
96
- }
97
- }, {
98
- tag: "h5",
99
- attrs: {
100
- level: 5
101
- }
102
- }, {
103
- tag: "h6",
104
- attrs: {
105
- level: 6
106
- }
107
- }],
108
- toDOM: function toDOM(node) {
109
- return ["h".concat(node.attrs.level), {
110
- style: "text-align:".concat(node.attrs["textAlign"])
111
- }, 0];
112
- }
113
- },
114
- // :: NodeSpec A code listing. Disallows marks or non-text inline
115
- // nodes by default. Represented as a `<pre>` element with a
116
- // `<code>` element inside of it.
117
- code_block: {
118
- content: "text*",
119
- marks: "",
120
- group: "block",
121
- code: true,
122
- defining: true,
123
- parseDOM: [{
124
- tag: "pre",
125
- preserveWhitespace: "full"
126
- }],
127
- toDOM: function toDOM() {
128
- return preDOM;
129
- }
130
- },
131
- // :: NodeSpec The text node.
132
- text: {
133
- group: "inline"
134
- },
135
- // :: NodeSpec An inline image (`<img>`) node. Supports `src`,
136
- // `alt`, and `href` attributes. The latter two default to the empty
137
- // string.
138
- image: {
139
- inline: true,
140
- attrs: {
141
- src: {},
142
- alt: {
143
- "default": null
144
- },
145
- title: {
146
- "default": null
147
- }
148
- },
149
- group: "inline",
150
- draggable: true,
151
- parseDOM: [{
152
- tag: "img[src]",
153
- getAttrs: function getAttrs(dom) {
154
- return {
155
- src: dom.getAttribute("src"),
156
- title: dom.getAttribute("title"),
157
- alt: dom.getAttribute("alt")
158
- };
159
- }
160
- }],
161
- toDOM: function toDOM(node) {
162
- var _node$attrs = node.attrs,
163
- src = _node$attrs.src,
164
- alt = _node$attrs.alt,
165
- title = _node$attrs.title;
166
- return ["img", {
167
- src: src,
168
- alt: alt,
169
- title: title
170
- }];
171
- }
172
- },
173
- // :: NodeSpec A hard line break, represented in the DOM as `<br>`.
174
- hard_break: {
175
- inline: true,
176
- group: "inline",
177
- selectable: false,
178
- parseDOM: [{
179
- tag: "br"
180
- }],
181
- toDOM: function toDOM() {
182
- return brDOM;
183
- }
184
- }
185
- };
186
- exports.nodes = nodes;
187
- var emDOM = ["em", 0];
188
- var strongDOM = ["strong", 0];
189
- var codeDOM = ["code", 0]; // :: Object [Specs](#model.MarkSpec) for the marks in the schema.
190
-
191
- var marks = {
192
- // :: MarkSpec A link. Has `href` and `title` attributes. `title`
193
- // defaults to the empty string. Rendered and parsed as an `<a>`
194
- // element.
195
- link: {
196
- attrs: {
197
- href: {},
198
- title: {
199
- "default": null
200
- }
201
- },
202
- inclusive: false,
203
- parseDOM: [{
204
- tag: "a[href]",
205
- getAttrs: function getAttrs(dom) {
206
- return {
207
- href: dom.getAttribute("href"),
208
- title: dom.getAttribute("title")
209
- };
210
- }
211
- }],
212
- toDOM: function toDOM(node) {
213
- var _node$attrs2 = node.attrs,
214
- href = _node$attrs2.href,
215
- title = _node$attrs2.title;
216
- return ["a", {
217
- href: href,
218
- title: title
219
- }, 0];
220
- }
221
- },
222
- // :: MarkSpec An emphasis mark. Rendered as an `<em>` element.
223
- // Has parse rules that also match `<i>` and `font-style: italic`.
224
- em: {
225
- parseDOM: [{
226
- tag: "i"
227
- }, {
228
- tag: "em"
229
- }, {
230
- style: "font-style=italic"
231
- }],
232
- toDOM: function toDOM() {
233
- return emDOM;
234
- }
235
- },
236
- // :: MarkSpec A strong mark. Rendered as `<strong>`, parse rules
237
- // also match `<b>` and `font-weight: bold`.
238
- strong: {
239
- parseDOM: [{
240
- tag: "strong"
241
- }, // This works around a Google Docs misbehavior where
242
- // pasted content will be inexplicably wrapped in `<b>`
243
- // tags with a font-weight normal.
244
- {
245
- tag: "b",
246
- getAttrs: function getAttrs(node) {
247
- return node.style.fontWeight !== "normal" && null;
248
- }
249
- }, {
250
- style: "font-weight",
251
- getAttrs: function getAttrs(value) {
252
- return /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null;
253
- }
254
- }],
255
- toDOM: function toDOM() {
256
- return strongDOM;
257
- }
258
- },
259
- // :: MarkSpec Code font mark. Represented as a `<code>` element.
260
- code: {
261
- parseDOM: [{
262
- tag: "code"
263
- }],
264
- toDOM: function toDOM() {
265
- return codeDOM;
266
- }
267
- },
268
- underLine: {
269
- parseDOM: [{
270
- tag: "span",
271
- getAttrs: function getAttrs(node) {
272
- return node.style.textDecoration == "underline" && null;
273
- }
274
- }],
275
- toDOM: function toDOM() {
276
- return ["span", {
277
- style: 'text-decoration:underline;'
278
- }, 0];
279
- }
280
- },
281
- deleteLine: {
282
- parseDOM: [{
283
- tag: "span",
284
- getAttrs: function getAttrs(node) {
285
- return node.style.textDecoration == "ine-through" && null;
286
- }
287
- }],
288
- toDOM: function toDOM() {
289
- return ["span", {
290
- style: 'text-decoration:line-through;'
291
- }, 0];
292
- }
293
- }
294
- }; // :: Schema
295
- // This schema roughly corresponds to the document schema used by
296
- // [CommonMark](http://commonmark.org/), minus the list elements,
297
- // which are defined in the [`prosemirror-schema-list`](#schema-list)
298
- // module.
299
- //
300
- // To reuse elements from this schema, extend or read from its
301
- // `spec.nodes` and `spec.marks` [properties](#model.Schema.spec).
302
- // @ts-ignore
303
-
304
- exports.marks = marks;
305
- var schema = new _prosemirrorModel.Schema({
306
- nodes: nodes,
307
- marks: marks
308
- });
309
- exports.schema = schema;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _prosemirrorModel = require("prosemirror-model");
9
-
10
- var _basic = require("./basic");
11
-
12
- var _list = require("./list");
13
-
14
- var _default = new _prosemirrorModel.Schema({
15
- nodes: (0, _list.addListNodes)(_basic.schema.spec.nodes, "paragraph block*", "block"),
16
- marks: _basic.schema.spec.marks
17
- });
18
-
19
- exports["default"] = _default;