@gravity-ui/markdown-editor 14.10.2 → 14.10.4
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/modules/toolbars/presets.js +3 -3
- 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/modules/toolbars/presets.js +4 -4
- 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) {
|
|
@@ -289,9 +289,9 @@ exports.yfm = {
|
|
|
289
289
|
wysiwyg: items_1.checkboxItemWysiwyg,
|
|
290
290
|
markup: items_1.checkboxItemMarkup,
|
|
291
291
|
}, [action_names_1.ActionName.tabs]: {
|
|
292
|
-
view: items_1.
|
|
293
|
-
wysiwyg: items_1.
|
|
294
|
-
markup: items_1.
|
|
292
|
+
view: items_1.tabsItemView,
|
|
293
|
+
wysiwyg: items_1.tabsItemWysiwyg,
|
|
294
|
+
markup: items_1.tabsItemMarkup,
|
|
295
295
|
} }),
|
|
296
296
|
orders: {
|
|
297
297
|
[constants_1.ToolbarName.wysiwygMain]: [
|
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.4' !== 'undefined' ? '14.10.4' : '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) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActionName as Action } from '../../bundle/config/action-names';
|
|
2
2
|
import { ListName as List, ToolbarName as Toolbar } from './constants';
|
|
3
|
-
import { boldItemMarkup, boldItemView, boldItemWysiwyg, bulletListItemMarkup, bulletListItemView, bulletListItemWysiwyg, checkboxItemMarkup, checkboxItemView, checkboxItemWysiwyg, codeBlockItemMarkup, codeBlockItemView, codeBlockItemWysiwyg, codeBlocksListItemView, codeItemMarkup, codeItemView, codeItemWysiwyg, colorifyItemMarkup, colorifyItemView, colorifyItemWysiwyg, cutItemMarkup, cutItemView, cutItemWysiwyg, emojiItemMarkup, emojiItemView, emojiItemWysiwyg, fileItemMarkup, fileItemView, fileItemWysiwyg, filePopupItemView, heading1ItemMarkup, heading1ItemView, heading1ItemWysiwyg, heading2ItemMarkup, heading2ItemView, heading2ItemWysiwyg, heading3ItemMarkup, heading3ItemView, heading3ItemWysiwyg, heading4ItemMarkup, heading4ItemView, heading4ItemWysiwyg, heading5ItemMarkup, heading5ItemView, heading5ItemWysiwyg, heading6ItemMarkup, heading6ItemView, heading6ItemWysiwyg, headingListItemView, hruleItemMarkup, hruleItemView, hruleItemWysiwyg, imageItemMarkup, imageItemView, imageItemWysiwyg, imagePopupItemView, italicItemMarkup, italicItemView, italicItemWysiwyg, liftListItemMarkup, liftListItemView, liftListItemWysiwyg, linkItemMarkup, linkItemView, linkItemWysiwyg, listsListItemView, markedItemMarkup, markedItemView, markedItemWysiwyg, monospaceItemMarkup, monospaceItemView, monospaceItemWysiwyg, noteItemMarkup, noteItemView, noteItemWysiwyg, orderedListItemMarkup, orderedListItemView, orderedListItemWysiwyg, paragraphItemMarkup, paragraphItemView, paragraphItemWisywig, quoteItemMarkup, quoteItemView, quoteItemWysiwyg, redoItemMarkup, redoItemView, redoItemWysiwyg, sinkListItemMarkup, sinkListItemView, sinkListItemWysiwyg, strikethroughItemMarkup, strikethroughItemView, tableItemMarkup, tableItemView, tableItemWysiwyg, underlineItemMarkup, underlineItemView, underlineItemWysiwyg, undoItemMarkup, undoItemView, undoItemWysiwyg, } from './items';
|
|
3
|
+
import { boldItemMarkup, boldItemView, boldItemWysiwyg, bulletListItemMarkup, bulletListItemView, bulletListItemWysiwyg, checkboxItemMarkup, checkboxItemView, checkboxItemWysiwyg, codeBlockItemMarkup, codeBlockItemView, codeBlockItemWysiwyg, codeBlocksListItemView, codeItemMarkup, codeItemView, codeItemWysiwyg, colorifyItemMarkup, colorifyItemView, colorifyItemWysiwyg, cutItemMarkup, cutItemView, cutItemWysiwyg, emojiItemMarkup, emojiItemView, emojiItemWysiwyg, fileItemMarkup, fileItemView, fileItemWysiwyg, filePopupItemView, heading1ItemMarkup, heading1ItemView, heading1ItemWysiwyg, heading2ItemMarkup, heading2ItemView, heading2ItemWysiwyg, heading3ItemMarkup, heading3ItemView, heading3ItemWysiwyg, heading4ItemMarkup, heading4ItemView, heading4ItemWysiwyg, heading5ItemMarkup, heading5ItemView, heading5ItemWysiwyg, heading6ItemMarkup, heading6ItemView, heading6ItemWysiwyg, headingListItemView, hruleItemMarkup, hruleItemView, hruleItemWysiwyg, imageItemMarkup, imageItemView, imageItemWysiwyg, imagePopupItemView, italicItemMarkup, italicItemView, italicItemWysiwyg, liftListItemMarkup, liftListItemView, liftListItemWysiwyg, linkItemMarkup, linkItemView, linkItemWysiwyg, listsListItemView, markedItemMarkup, markedItemView, markedItemWysiwyg, monospaceItemMarkup, monospaceItemView, monospaceItemWysiwyg, noteItemMarkup, noteItemView, noteItemWysiwyg, orderedListItemMarkup, orderedListItemView, orderedListItemWysiwyg, paragraphItemMarkup, paragraphItemView, paragraphItemWisywig, quoteItemMarkup, quoteItemView, quoteItemWysiwyg, redoItemMarkup, redoItemView, redoItemWysiwyg, sinkListItemMarkup, sinkListItemView, sinkListItemWysiwyg, strikethroughItemMarkup, strikethroughItemView, tableItemMarkup, tableItemView, tableItemWysiwyg, tabsItemMarkup, tabsItemView, tabsItemWysiwyg, underlineItemMarkup, underlineItemView, underlineItemWysiwyg, undoItemMarkup, undoItemView, undoItemWysiwyg, } from './items';
|
|
4
4
|
// presets
|
|
5
5
|
export const zero = {
|
|
6
6
|
items: {
|
|
@@ -286,9 +286,9 @@ export const yfm = {
|
|
|
286
286
|
wysiwyg: checkboxItemWysiwyg,
|
|
287
287
|
markup: checkboxItemMarkup,
|
|
288
288
|
}, [Action.tabs]: {
|
|
289
|
-
view:
|
|
290
|
-
wysiwyg:
|
|
291
|
-
markup:
|
|
289
|
+
view: tabsItemView,
|
|
290
|
+
wysiwyg: tabsItemWysiwyg,
|
|
291
|
+
markup: tabsItemMarkup,
|
|
292
292
|
} }),
|
|
293
293
|
orders: {
|
|
294
294
|
[Toolbar.wysiwygMain]: [
|
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.4' !== 'undefined' ? '14.10.4' : 'unknown';
|