@gravity-ui/markdown-editor 14.10.1 → 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/bundle/Editor.d.ts +1 -1
- package/build/cjs/bundle/config/wysiwyg.d.ts +1 -1
- package/build/cjs/extensions/additional/GPT/actions.d.ts +1 -1
- package/build/cjs/extensions/additional/GPT/gptExtension/view.d.ts +1 -1
- package/build/cjs/markup/codemirror/autocomplete/emptyRow.js +1 -1
- 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/bundle/Editor.d.ts +1 -1
- package/build/esm/bundle/config/wysiwyg.d.ts +1 -1
- package/build/esm/extensions/additional/GPT/actions.d.ts +1 -1
- package/build/esm/extensions/additional/GPT/gptExtension/view.d.ts +1 -1
- package/build/esm/markup/codemirror/autocomplete/emptyRow.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonEditor } from '../common';
|
|
2
|
-
import { TransformFn } from '../core/markdown/ProseMirrorTransformer';
|
|
2
|
+
import type { TransformFn } from '../core/markdown/ProseMirrorTransformer';
|
|
3
3
|
import { ReactRenderStorage } from '../extensions';
|
|
4
4
|
import { type Receiver } from '../utils';
|
|
5
5
|
import type { DirectiveSyntaxContext } from '../utils/directive';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @deprecated This file is deprecated. Use ToolbarsPreset instead.
|
|
3
3
|
*/
|
|
4
|
-
import { ActionStorage } from '
|
|
4
|
+
import type { ActionStorage } from '../../core';
|
|
5
5
|
import type { SelectionContextConfig, SelectionContextItemData } from '../../extensions/behavior/SelectionContext';
|
|
6
6
|
import { ToolbarGroupItemData, ToolbarItemData, ToolbarListButtonItemData, ToolbarListItemData, ToolbarSingleItemData } from '../../toolbar';
|
|
7
7
|
import { ToolbarData } from '../../toolbar/Toolbar';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ActionSpec, ExtensionDeps } from '
|
|
1
|
+
import type { ActionSpec, ExtensionDeps } from '../../../core';
|
|
2
2
|
export declare const showGptWidget: (deps: ExtensionDeps) => ActionSpec;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PopupProps } from '@gravity-ui/uikit';
|
|
2
2
|
import type { EditorState, PluginView } from 'prosemirror-state';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import { Parser, Serializer } from '
|
|
4
|
+
import type { Parser, Serializer } from '../../../../core';
|
|
5
5
|
import type { CommonAnswer } from '../ErrorScreen/types';
|
|
6
6
|
import type { GptDialogProps } from '../GptDialog/GptDialog';
|
|
7
7
|
export declare const cnGptPopup: import("@bem-react/classname").ClassNameFormatter;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.emptyRowAutocomplete = exports.emptyRowSnippet = exports.emptyRowSnippetTemplate = void 0;
|
|
4
4
|
const autocomplete_1 = require("@codemirror/autocomplete");
|
|
5
|
-
const empty_row_1 = require("
|
|
5
|
+
const empty_row_1 = require("../../../i18n/empty-row");
|
|
6
6
|
exports.emptyRowSnippetTemplate = ' \n\n';
|
|
7
7
|
exports.emptyRowSnippet = (0, autocomplete_1.snippet)(exports.emptyRowSnippetTemplate);
|
|
8
8
|
exports.emptyRowAutocomplete = {
|
|
@@ -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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommonEditor } from '../common';
|
|
2
|
-
import { TransformFn } from '../core/markdown/ProseMirrorTransformer';
|
|
2
|
+
import type { TransformFn } from '../core/markdown/ProseMirrorTransformer';
|
|
3
3
|
import { ReactRenderStorage } from '../extensions';
|
|
4
4
|
import { type Receiver } from '../utils';
|
|
5
5
|
import type { DirectiveSyntaxContext } from '../utils/directive';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @deprecated This file is deprecated. Use ToolbarsPreset instead.
|
|
3
3
|
*/
|
|
4
|
-
import { ActionStorage } from '
|
|
4
|
+
import type { ActionStorage } from '../../core';
|
|
5
5
|
import type { SelectionContextConfig, SelectionContextItemData } from '../../extensions/behavior/SelectionContext';
|
|
6
6
|
import { ToolbarGroupItemData, ToolbarItemData, ToolbarListButtonItemData, ToolbarListItemData, ToolbarSingleItemData } from '../../toolbar';
|
|
7
7
|
import { ToolbarData } from '../../toolbar/Toolbar';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ActionSpec, ExtensionDeps } from '
|
|
1
|
+
import type { ActionSpec, ExtensionDeps } from '../../../core';
|
|
2
2
|
export declare const showGptWidget: (deps: ExtensionDeps) => ActionSpec;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PopupProps } from '@gravity-ui/uikit';
|
|
2
2
|
import type { EditorState, PluginView } from 'prosemirror-state';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import { Parser, Serializer } from '
|
|
4
|
+
import type { Parser, Serializer } from '../../../../core';
|
|
5
5
|
import type { CommonAnswer } from '../ErrorScreen/types';
|
|
6
6
|
import type { GptDialogProps } from '../GptDialog/GptDialog';
|
|
7
7
|
import './view.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { snippet } from '@codemirror/autocomplete';
|
|
2
|
-
import { i18n } from '
|
|
2
|
+
import { i18n } from '../../../i18n/empty-row';
|
|
3
3
|
export const emptyRowSnippetTemplate = ' \n\n';
|
|
4
4
|
export const emptyRowSnippet = snippet(emptyRowSnippetTemplate);
|
|
5
5
|
export const emptyRowAutocomplete = {
|
|
@@ -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';
|