@gravity-ui/markdown-editor 14.10.2 → 14.10.3
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.
- package/build/cjs/markup/commands/inline.d.ts +1 -0
- package/build/cjs/markup/commands/inline.js +2 -0
- package/build/cjs/modules/toolbars/constants.d.ts +2 -1
- package/build/cjs/modules/toolbars/constants.js +2 -1
- package/build/cjs/utils/nodes.js +2 -1
- package/build/cjs/version.js +1 -1
- package/build/esm/markup/commands/inline.d.ts +1 -0
- package/build/esm/markup/commands/inline.js +2 -0
- package/build/esm/modules/toolbars/constants.d.ts +2 -1
- package/build/esm/modules/toolbars/constants.js +2 -1
- package/build/esm/utils/nodes.js +2 -1
- package/build/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -13,7 +13,9 @@ const insertLink = ({ state, dispatch }) => {
|
|
|
13
13
|
return true;
|
|
14
14
|
};
|
|
15
15
|
exports.insertLink = insertLink;
|
|
16
|
+
// [major] TODO: remove insertAnchor
|
|
16
17
|
const defaultAnchorSnippet = (0, autocomplete_1.snippet)(`#[#{2:text}](#{1:anchor} "#{3:title}")`);
|
|
18
|
+
/** @deprecated */
|
|
17
19
|
const insertAnchor = ({ state, dispatch }) => {
|
|
18
20
|
const { from, to, empty } = state.selection.main;
|
|
19
21
|
const anchorSnippet = empty
|
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ToolbarName = exports.ListName = void 0;
|
|
4
4
|
var ListName;
|
|
5
5
|
(function (ListName) {
|
|
6
|
+
ListName["code"] = "code";
|
|
6
7
|
ListName["heading"] = "heading";
|
|
7
8
|
ListName["lists"] = "lists";
|
|
8
|
-
ListName["
|
|
9
|
+
ListName["math"] = "math";
|
|
9
10
|
})(ListName = exports.ListName || (exports.ListName = {}));
|
|
10
11
|
var ToolbarName;
|
|
11
12
|
(function (ToolbarName) {
|
package/build/cjs/utils/nodes.js
CHANGED
|
@@ -21,7 +21,8 @@ function findFirstTextblockChild(parent) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.findFirstTextblockChild = findFirstTextblockChild;
|
|
23
23
|
const isNodeEmpty = (node) => {
|
|
24
|
-
const emptyChildren = (0, prosemirror_utils_1.findChildren)(node, (n) => (!n.isText && !n.isAtom && n.content.size === 0
|
|
24
|
+
const emptyChildren = (0, prosemirror_utils_1.findChildren)(node, (n) => (!n.isText && !n.isAtom && n.content.size === 0 && n.type.name === 'paragraph') ||
|
|
25
|
+
(n.isText && !n.textContent), true);
|
|
25
26
|
let descendantsCount = 0;
|
|
26
27
|
node.descendants(() => {
|
|
27
28
|
descendantsCount++;
|
package/build/cjs/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
/** During build process, the current version will be injected here */
|
|
5
|
-
exports.VERSION = typeof '14.10.
|
|
5
|
+
exports.VERSION = typeof '14.10.3' !== 'undefined' ? '14.10.3' : 'unknown';
|
|
@@ -9,7 +9,9 @@ export const insertLink = ({ state, dispatch }) => {
|
|
|
9
9
|
linkSnippet({ state, dispatch }, null, from, to);
|
|
10
10
|
return true;
|
|
11
11
|
};
|
|
12
|
+
// [major] TODO: remove insertAnchor
|
|
12
13
|
const defaultAnchorSnippet = snippet(`#[#{2:text}](#{1:anchor} "#{3:title}")`);
|
|
14
|
+
/** @deprecated */
|
|
13
15
|
export const insertAnchor = ({ state, dispatch }) => {
|
|
14
16
|
const { from, to, empty } = state.selection.main;
|
|
15
17
|
const anchorSnippet = empty
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export var ListName;
|
|
2
2
|
(function (ListName) {
|
|
3
|
+
ListName["code"] = "code";
|
|
3
4
|
ListName["heading"] = "heading";
|
|
4
5
|
ListName["lists"] = "lists";
|
|
5
|
-
ListName["
|
|
6
|
+
ListName["math"] = "math";
|
|
6
7
|
})(ListName || (ListName = {}));
|
|
7
8
|
export var ToolbarName;
|
|
8
9
|
(function (ToolbarName) {
|
package/build/esm/utils/nodes.js
CHANGED
|
@@ -17,7 +17,8 @@ export function findFirstTextblockChild(parent) {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
export const isNodeEmpty = (node) => {
|
|
20
|
-
const emptyChildren = findChildren(node, (n) => (!n.isText && !n.isAtom && n.content.size === 0
|
|
20
|
+
const emptyChildren = findChildren(node, (n) => (!n.isText && !n.isAtom && n.content.size === 0 && n.type.name === 'paragraph') ||
|
|
21
|
+
(n.isText && !n.textContent), true);
|
|
21
22
|
let descendantsCount = 0;
|
|
22
23
|
node.descendants(() => {
|
|
23
24
|
descendantsCount++;
|
package/build/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** During build process, the current version will be injected here */
|
|
2
|
-
export const VERSION = typeof '14.10.
|
|
2
|
+
export const VERSION = typeof '14.10.3' !== 'undefined' ? '14.10.3' : 'unknown';
|