@gravity-ui/markdown-editor 14.10.5 → 14.11.1
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/MarkdownEditorView.d.ts +1 -1
- package/build/cjs/bundle/MarkupEditorView.d.ts +2 -2
- package/build/cjs/bundle/WysiwygEditorView.d.ts +2 -2
- package/build/cjs/bundle/config/action-names.d.ts +1 -1
- package/build/cjs/bundle/config/markup.d.ts +3 -13
- package/build/cjs/bundle/config/markup.js +1 -1
- package/build/cjs/bundle/config/w-heading-config.d.ts +9 -0
- package/build/cjs/bundle/config/w-heading-config.js +85 -0
- package/build/cjs/bundle/config/wysiwyg.d.ts +3 -24
- package/build/cjs/bundle/config/wysiwyg.js +110 -183
- package/build/cjs/bundle/index.d.ts +1 -0
- package/build/cjs/bundle/index.js +2 -0
- package/build/cjs/bundle/toolbar/ToolbarSelect.d.ts +2 -3
- package/build/cjs/bundle/toolbar/markup/MToolbarColors.d.ts +2 -2
- package/build/cjs/bundle/toolbar/markup/MToolbarImagePopup.d.ts +1 -1
- package/build/cjs/bundle/toolbar/types.d.ts +21 -0
- package/build/cjs/bundle/toolbar/types.js +4 -0
- package/build/cjs/bundle/toolbar/utils/flattenPreset.d.ts +2 -2
- package/build/cjs/bundle/toolbar/utils/flattenPreset.js +1 -1
- package/build/cjs/bundle/toolbar/utils/toolbarsConfigs.d.ts +5 -5
- package/build/cjs/bundle/toolbar/utils/toolbarsConfigs.js +3 -3
- package/build/cjs/bundle/toolbar/wysiwyg/WToolbarColors.d.ts +2 -2
- package/build/cjs/bundle/toolbar/wysiwyg/WToolbarTextSelect.d.ts +2 -2
- package/build/cjs/bundle/toolbar/wysiwyg/WToolbarTextSelect.js +2 -2
- package/build/cjs/extensions/additional/GPT/MarkupGpt/toolbar.d.ts +1 -1
- package/build/cjs/extensions/additional/GPT/MarkupGpt/toolbar.js +2 -2
- package/build/cjs/extensions/additional/GPT/wGptItemData.d.ts +1 -1
- package/build/cjs/extensions/additional/GPT/wGptItemData.js +2 -2
- package/build/cjs/extensions/additional/Mermaid/MermaidSpecs/index.js +3 -2
- package/build/cjs/extensions/base/BaseSchema/BaseSchemaSpecs/index.js +13 -1
- package/build/cjs/extensions/behavior/SelectionContext/tooltip.d.ts +5 -5
- package/build/cjs/extensions/markdown/Image/index.d.ts +1 -1
- package/build/cjs/extensions/markdown/Link/LinkSpecs/index.js +1 -1
- package/build/cjs/extensions/markdown/Link/PlaceholderWidget/descriptor.d.ts +3 -3
- package/build/cjs/extensions/markdown/Link/PlaceholderWidget/descriptor.js +4 -3
- package/build/cjs/extensions/markdown/Link/actions/linkEnhanceActions.d.ts +2 -2
- package/build/cjs/extensions/markdown/Link/actions/linkEnhanceActions.js +10 -8
- package/build/cjs/extensions/markdown/Link/commands.js +2 -2
- package/build/cjs/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
- package/build/cjs/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +3 -3
- package/build/cjs/extensions/yfm/ImgSize/index.d.ts +3 -3
- package/build/cjs/extensions/yfm/YfmCut/YfmCutSpecs/index.d.ts +2 -10
- package/build/cjs/extensions/yfm/YfmCut/YfmCutSpecs/schema.d.ts +11 -2
- package/build/cjs/extensions/yfm/YfmTable/YfmTableSpecs/index.d.ts +2 -7
- package/build/cjs/extensions/yfm/YfmTable/YfmTableSpecs/schema.d.ts +7 -2
- package/build/cjs/extensions/yfm/YfmTabs/YfmTabsSpecs/index.d.ts +2 -6
- package/build/cjs/extensions/yfm/YfmTabs/YfmTabsSpecs/schema.d.ts +8 -3
- package/build/cjs/extensions/yfm/YfmTabs/actions.js +7 -9
- package/build/cjs/extensions/yfm/YfmTabs/const.d.ts +5 -2
- package/build/cjs/extensions/yfm/YfmTabs/const.js +7 -4
- package/build/cjs/extensions/yfm/YfmTabs/plugins.d.ts +2 -2
- package/build/cjs/extensions/yfm/YfmTabs/plugins.js +15 -96
- package/build/cjs/extensions/yfm/YfmTabs/utils.d.ts +4 -1
- package/build/cjs/extensions/yfm/YfmTabs/utils.js +23 -3
- package/build/cjs/extensions/yfm/YfmTabs/views.d.ts +1 -1
- package/build/cjs/extensions/yfm/YfmTabs/views.js +26 -6
- package/build/cjs/i18n/menubar/index.d.ts +1 -1
- package/build/cjs/i18n/placeholder/index.d.ts +1 -1
- package/build/cjs/i18n/yfm-note/index.d.ts +1 -1
- package/build/cjs/markup/codemirror/html-to-markdown/handlers.d.ts +1 -1
- package/build/cjs/markup/codemirror/search-plugin/plugin.d.ts +6 -16
- package/build/cjs/markup/codemirror/search-plugin/plugin.js +7 -8
- package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.d.ts +6 -10
- package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.js +13 -13
- package/build/cjs/markup/codemirror/yfm.d.ts +1 -1
- package/build/cjs/markup/editor.d.ts +1 -1
- package/build/cjs/react-utils/react-node-view.d.ts +2 -2
- package/build/cjs/react-utils/react-node-view.js +2 -2
- package/build/cjs/table-utils/commands/appendColumn.js +2 -2
- package/build/cjs/table-utils/commands/appendRow.js +2 -2
- package/build/cjs/table-utils/commands/removeRow.js +2 -2
- package/build/cjs/toolbar/FlexToolbar.d.ts +2 -2
- package/build/cjs/toolbar/Toolbar.d.ts +2 -3
- package/build/cjs/toolbar/ToolbarGroup.d.ts +2 -2
- package/build/cjs/toolbar/ToolbarListButton.d.ts +2 -9
- package/build/cjs/toolbar/flexible.d.ts +1 -2
- package/build/cjs/toolbar/index.d.ts +0 -1
- package/build/cjs/toolbar/index.js +0 -1
- package/build/cjs/toolbar/types.d.ts +10 -1
- package/build/cjs/version.js +1 -1
- package/build/esm/bundle/MarkdownEditorView.d.ts +1 -1
- package/build/esm/bundle/MarkupEditorView.d.ts +2 -2
- package/build/esm/bundle/WysiwygEditorView.d.ts +2 -2
- package/build/esm/bundle/config/action-names.d.ts +1 -1
- package/build/esm/bundle/config/markup.d.ts +3 -13
- package/build/esm/bundle/config/markup.js +1 -1
- package/build/esm/bundle/config/w-heading-config.d.ts +9 -0
- package/build/esm/bundle/config/w-heading-config.js +82 -0
- package/build/esm/bundle/config/wysiwyg.d.ts +3 -24
- package/build/esm/bundle/config/wysiwyg.js +6 -79
- package/build/esm/bundle/index.d.ts +1 -0
- package/build/esm/bundle/index.js +2 -0
- package/build/esm/bundle/toolbar/ToolbarSelect.d.ts +2 -3
- package/build/esm/bundle/toolbar/markup/MToolbarColors.d.ts +2 -2
- package/build/esm/bundle/toolbar/markup/MToolbarImagePopup.d.ts +1 -1
- package/build/esm/bundle/toolbar/types.d.ts +21 -0
- package/build/esm/bundle/toolbar/types.js +1 -0
- package/build/esm/bundle/toolbar/utils/flattenPreset.d.ts +2 -2
- package/build/esm/bundle/toolbar/utils/flattenPreset.js +1 -1
- package/build/esm/bundle/toolbar/utils/toolbarsConfigs.d.ts +5 -5
- package/build/esm/bundle/toolbar/utils/toolbarsConfigs.js +1 -1
- package/build/esm/bundle/toolbar/wysiwyg/WToolbarColors.d.ts +2 -2
- package/build/esm/bundle/toolbar/wysiwyg/WToolbarTextSelect.d.ts +2 -2
- package/build/esm/bundle/toolbar/wysiwyg/WToolbarTextSelect.js +1 -1
- package/build/esm/extensions/additional/GPT/MarkupGpt/toolbar.d.ts +1 -1
- package/build/esm/extensions/additional/GPT/MarkupGpt/toolbar.js +1 -1
- package/build/esm/extensions/additional/GPT/wGptItemData.d.ts +1 -1
- package/build/esm/extensions/additional/GPT/wGptItemData.js +1 -1
- package/build/esm/extensions/additional/Mermaid/MermaidSpecs/index.js +4 -3
- package/build/esm/extensions/base/BaseSchema/BaseSchemaSpecs/index.js +13 -1
- package/build/esm/extensions/behavior/SelectionContext/tooltip.d.ts +5 -5
- package/build/esm/extensions/behavior/SelectionContext/tooltip.js +1 -1
- package/build/esm/extensions/markdown/Image/index.d.ts +1 -1
- package/build/esm/extensions/markdown/Link/LinkSpecs/index.js +1 -1
- package/build/esm/extensions/markdown/Link/PlaceholderWidget/descriptor.d.ts +3 -3
- package/build/esm/extensions/markdown/Link/PlaceholderWidget/descriptor.js +2 -1
- package/build/esm/extensions/markdown/Link/actions/linkEnhanceActions.d.ts +2 -2
- package/build/esm/extensions/markdown/Link/actions/linkEnhanceActions.js +3 -1
- package/build/esm/extensions/markdown/Link/commands.js +1 -1
- package/build/esm/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
- package/build/esm/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +1 -1
- package/build/esm/extensions/yfm/ImgSize/index.d.ts +3 -3
- package/build/esm/extensions/yfm/YfmCut/YfmCutSpecs/index.d.ts +2 -10
- package/build/esm/extensions/yfm/YfmCut/YfmCutSpecs/schema.d.ts +11 -2
- package/build/esm/extensions/yfm/YfmTable/YfmTableSpecs/index.d.ts +2 -7
- package/build/esm/extensions/yfm/YfmTable/YfmTableSpecs/schema.d.ts +7 -2
- package/build/esm/extensions/yfm/YfmTabs/YfmTabsSpecs/index.d.ts +2 -6
- package/build/esm/extensions/yfm/YfmTabs/YfmTabsSpecs/schema.d.ts +8 -3
- package/build/esm/extensions/yfm/YfmTabs/actions.js +1 -3
- package/build/esm/extensions/yfm/YfmTabs/const.d.ts +5 -2
- package/build/esm/extensions/yfm/YfmTabs/const.js +6 -3
- package/build/esm/extensions/yfm/YfmTabs/plugins.d.ts +2 -2
- package/build/esm/extensions/yfm/YfmTabs/plugins.js +17 -98
- package/build/esm/extensions/yfm/YfmTabs/utils.d.ts +4 -1
- package/build/esm/extensions/yfm/YfmTabs/utils.js +18 -1
- package/build/esm/extensions/yfm/YfmTabs/views.d.ts +1 -1
- package/build/esm/extensions/yfm/YfmTabs/views.js +24 -4
- package/build/esm/i18n/menubar/index.d.ts +1 -1
- package/build/esm/i18n/placeholder/index.d.ts +1 -1
- package/build/esm/i18n/yfm-note/index.d.ts +1 -1
- package/build/esm/markup/codemirror/html-to-markdown/handlers.d.ts +1 -1
- package/build/esm/markup/codemirror/search-plugin/plugin.d.ts +6 -16
- package/build/esm/markup/codemirror/search-plugin/plugin.js +8 -9
- package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.d.ts +6 -10
- package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.js +13 -13
- package/build/esm/markup/codemirror/yfm.d.ts +1 -1
- package/build/esm/markup/editor.d.ts +1 -1
- package/build/esm/react-utils/react-node-view.d.ts +2 -2
- package/build/esm/react-utils/react-node-view.js +1 -1
- package/build/esm/table-utils/commands/appendColumn.js +1 -1
- package/build/esm/table-utils/commands/appendRow.js +1 -1
- package/build/esm/table-utils/commands/removeRow.js +1 -1
- package/build/esm/toolbar/FlexToolbar.d.ts +2 -2
- package/build/esm/toolbar/Toolbar.d.ts +2 -3
- package/build/esm/toolbar/ToolbarGroup.d.ts +2 -2
- package/build/esm/toolbar/ToolbarListButton.d.ts +2 -9
- package/build/esm/toolbar/flexible.d.ts +1 -2
- package/build/esm/toolbar/index.d.ts +0 -1
- package/build/esm/toolbar/index.js +0 -1
- package/build/esm/toolbar/types.d.ts +10 -1
- package/build/esm/version.js +1 -1
- package/package.json +3 -1
|
@@ -1,17 +1,10 @@
|
|
|
1
|
+
import { SearchQuery } from '@codemirror/search';
|
|
1
2
|
import { EditorView, ViewPlugin, ViewUpdate } from '@codemirror/view';
|
|
2
3
|
import type { MarkdownEditorMode } from '../../../bundle';
|
|
3
4
|
import type { EventMap } from '../../../bundle/Editor';
|
|
4
5
|
import type { RendererItem } from '../../../extensions';
|
|
5
6
|
import { Receiver } from '../../../utils';
|
|
6
|
-
|
|
7
|
-
search: string;
|
|
8
|
-
caseSensitive?: boolean;
|
|
9
|
-
literal?: boolean;
|
|
10
|
-
regexp?: boolean;
|
|
11
|
-
replace?: string;
|
|
12
|
-
valid?: boolean;
|
|
13
|
-
wholeWord?: boolean;
|
|
14
|
-
}
|
|
7
|
+
declare type SearchQueryConfig = ConstructorParameters<typeof SearchQuery>[0];
|
|
15
8
|
export interface SearchPanelPluginParams {
|
|
16
9
|
anchorSelector: string;
|
|
17
10
|
inputDelay?: number;
|
|
@@ -22,12 +15,12 @@ export declare const SearchPanelPlugin: (params: SearchPanelPluginParams) => Vie
|
|
|
22
15
|
readonly params: SearchPanelPluginParams;
|
|
23
16
|
anchor: HTMLElement | null;
|
|
24
17
|
renderer: RendererItem | null;
|
|
25
|
-
|
|
18
|
+
searchConfig: SearchQueryConfig;
|
|
26
19
|
receiver: Receiver<EventMap> | undefined;
|
|
27
|
-
setViewSearchWithDelay: (config: Partial<
|
|
20
|
+
setViewSearchWithDelay: (config: Partial<SearchQueryConfig>) => void;
|
|
28
21
|
update(update: ViewUpdate): void;
|
|
29
22
|
destroy(): void;
|
|
30
|
-
setViewSearch(config: Partial<
|
|
23
|
+
setViewSearch(config: Partial<SearchQueryConfig>): void;
|
|
31
24
|
handleEditorModeChange({ mode }: {
|
|
32
25
|
mode: MarkdownEditorMode;
|
|
33
26
|
}): void;
|
|
@@ -35,9 +28,6 @@ export declare const SearchPanelPlugin: (params: SearchPanelPluginParams) => Vie
|
|
|
35
28
|
handleClose(): void;
|
|
36
29
|
handleSearchNext(): void;
|
|
37
30
|
handleSearchPrev(): void;
|
|
38
|
-
handleSearchConfigChange(
|
|
39
|
-
isCaseSensitive?: boolean | undefined;
|
|
40
|
-
isWholeWord?: boolean | undefined;
|
|
41
|
-
}): void;
|
|
31
|
+
handleSearchConfigChange(config: Partial<SearchQueryConfig>): void;
|
|
42
32
|
}>;
|
|
43
33
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchQuery, closeSearchPanel, findNext, findPrevious, search, searchKeymap, searchPanelOpen, setSearchQuery, } from '@codemirror/search';
|
|
1
|
+
import { SearchQuery, closeSearchPanel, findNext, findPrevious, getSearchQuery, search, searchKeymap, searchPanelOpen, setSearchQuery, } from '@codemirror/search';
|
|
2
2
|
import { ViewPlugin, keymap } from '@codemirror/view';
|
|
3
3
|
import { debounce } from '../../../lodash';
|
|
4
4
|
import { ReactRendererFacet } from '../react-facet';
|
|
@@ -7,7 +7,7 @@ const INPUT_DELAY = 200;
|
|
|
7
7
|
export const SearchPanelPlugin = (params) => ViewPlugin.fromClass(class {
|
|
8
8
|
constructor(view) {
|
|
9
9
|
var _a, _b;
|
|
10
|
-
this.
|
|
10
|
+
this.searchConfig = {
|
|
11
11
|
search: '',
|
|
12
12
|
caseSensitive: false,
|
|
13
13
|
wholeWord: false,
|
|
@@ -30,10 +30,12 @@ export const SearchPanelPlugin = (params) => ViewPlugin.fromClass(class {
|
|
|
30
30
|
var _a;
|
|
31
31
|
const isPanelOpen = searchPanelOpen(update.state);
|
|
32
32
|
if (isPanelOpen && !this.renderer) {
|
|
33
|
+
const initial = getSearchQuery(update.state);
|
|
33
34
|
this.anchor = document.querySelector(this.params.anchorSelector);
|
|
34
35
|
this.renderer = this.view.state
|
|
35
36
|
.facet(ReactRendererFacet)
|
|
36
37
|
.createItem('cm-search', () => renderSearchPopup({
|
|
38
|
+
initial,
|
|
37
39
|
open: true,
|
|
38
40
|
anchor: this.anchor,
|
|
39
41
|
onChange: this.handleChange,
|
|
@@ -55,8 +57,8 @@ export const SearchPanelPlugin = (params) => ViewPlugin.fromClass(class {
|
|
|
55
57
|
(_b = this.receiver) === null || _b === void 0 ? void 0 : _b.off('change-editor-mode', this.handleEditorModeChange);
|
|
56
58
|
}
|
|
57
59
|
setViewSearch(config) {
|
|
58
|
-
this.
|
|
59
|
-
const searchQuery = new SearchQuery(Object.assign({}, this.
|
|
60
|
+
this.searchConfig = Object.assign(Object.assign({}, this.searchConfig), config);
|
|
61
|
+
const searchQuery = new SearchQuery(Object.assign({}, this.searchConfig));
|
|
60
62
|
this.view.dispatch({ effects: setSearchQuery.of(searchQuery) });
|
|
61
63
|
}
|
|
62
64
|
handleEditorModeChange({ mode }) {
|
|
@@ -77,11 +79,8 @@ export const SearchPanelPlugin = (params) => ViewPlugin.fromClass(class {
|
|
|
77
79
|
handleSearchPrev() {
|
|
78
80
|
findPrevious(this.view);
|
|
79
81
|
}
|
|
80
|
-
handleSearchConfigChange(
|
|
81
|
-
this.setViewSearch(
|
|
82
|
-
caseSensitive: isCaseSensitive,
|
|
83
|
-
wholeWord: isWholeWord,
|
|
84
|
-
});
|
|
82
|
+
handleSearchConfigChange(config) {
|
|
83
|
+
this.setViewSearch(config);
|
|
85
84
|
}
|
|
86
85
|
}, {
|
|
87
86
|
provide: () => [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { SearchQuery } from '@codemirror/search';
|
|
2
3
|
import './SearchPopup.css';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
isWholeWord: boolean;
|
|
6
|
-
}
|
|
4
|
+
declare type SearchInitial = Pick<SearchQuery, 'search' | 'caseSensitive' | 'wholeWord'>;
|
|
5
|
+
declare type SearchConfig = Pick<SearchInitial, 'caseSensitive' | 'wholeWord'>;
|
|
7
6
|
interface SearchCardProps {
|
|
7
|
+
initial: SearchInitial;
|
|
8
8
|
onSearchKeyDown?: (query: string) => void;
|
|
9
9
|
onChange?: (query: string) => void;
|
|
10
10
|
onClose?: (query: string) => void;
|
|
@@ -13,14 +13,10 @@ interface SearchCardProps {
|
|
|
13
13
|
onConfigChange?: (config: SearchConfig) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const SearchCard: React.FC<SearchCardProps>;
|
|
16
|
-
export interface SearchPopupProps {
|
|
16
|
+
export interface SearchPopupProps extends SearchCardProps {
|
|
17
|
+
open: boolean;
|
|
17
18
|
anchor: HTMLElement;
|
|
18
|
-
onChange: (query: string) => void;
|
|
19
19
|
onClose: () => void;
|
|
20
|
-
onSearchNext: () => void;
|
|
21
|
-
onSearchPrev: () => void;
|
|
22
|
-
onConfigChange: (config: SearchConfig) => void;
|
|
23
|
-
open: boolean;
|
|
24
20
|
}
|
|
25
21
|
export declare const SearchPopup: React.FC<SearchPopupProps>;
|
|
26
22
|
interface SearchPopupWithRefProps extends Omit<SearchPopupProps, 'anchor'> {
|
|
@@ -8,17 +8,17 @@ import { enterKeyHandler } from '../../../../utils/handlers';
|
|
|
8
8
|
import './SearchPopup.css';
|
|
9
9
|
const b = cn('search-card');
|
|
10
10
|
const noop = () => { };
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const [
|
|
14
|
-
const [
|
|
11
|
+
const inverse = (val) => !val;
|
|
12
|
+
export const SearchCard = ({ initial, onChange = noop, onClose = noop, onSearchPrev = noop, onSearchNext = noop, onConfigChange = noop, }) => {
|
|
13
|
+
const [query, setQuery] = useState(initial.search);
|
|
14
|
+
const [isCaseSensitive, setIsCaseSensitive] = useState(initial.caseSensitive);
|
|
15
|
+
const [isWholeWord, setIsWholeWord] = useState(initial.wholeWord);
|
|
15
16
|
const textInputRef = useRef(null);
|
|
16
17
|
const setInputFocus = () => {
|
|
17
18
|
var _a;
|
|
18
19
|
(_a = textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
19
20
|
};
|
|
20
|
-
const handleInputChange = (
|
|
21
|
-
const { target: { value }, } = event;
|
|
21
|
+
const handleInputChange = (value) => {
|
|
22
22
|
setQuery(value);
|
|
23
23
|
onChange(value);
|
|
24
24
|
};
|
|
@@ -37,18 +37,18 @@ export const SearchCard = ({ onChange = noop, onClose = noop, onSearchPrev = noo
|
|
|
37
37
|
};
|
|
38
38
|
const handleIsCaseSensitive = () => {
|
|
39
39
|
onConfigChange({
|
|
40
|
-
|
|
41
|
-
isWholeWord,
|
|
40
|
+
caseSensitive: !isCaseSensitive,
|
|
41
|
+
wholeWord: isWholeWord,
|
|
42
42
|
});
|
|
43
|
-
setIsCaseSensitive(
|
|
43
|
+
setIsCaseSensitive(inverse);
|
|
44
44
|
setInputFocus();
|
|
45
45
|
};
|
|
46
46
|
const handleIsWholeWord = () => {
|
|
47
47
|
onConfigChange({
|
|
48
|
-
isCaseSensitive,
|
|
49
|
-
|
|
48
|
+
caseSensitive: isCaseSensitive,
|
|
49
|
+
wholeWord: !isWholeWord,
|
|
50
50
|
});
|
|
51
|
-
setIsWholeWord(
|
|
51
|
+
setIsWholeWord(inverse);
|
|
52
52
|
setInputFocus();
|
|
53
53
|
};
|
|
54
54
|
const handleSearchKeyPress = enterKeyHandler(handleNext);
|
|
@@ -59,7 +59,7 @@ export const SearchCard = ({ onChange = noop, onClose = noop, onSearchPrev = noo
|
|
|
59
59
|
i18n('title')),
|
|
60
60
|
React.createElement(Button, { onClick: handleClose, size: "s", view: "flat" },
|
|
61
61
|
React.createElement(Icon, { data: Xmark, size: 14 }))),
|
|
62
|
-
React.createElement(TextInput, { controlRef: textInputRef, className: sp({ mb: 2 }), size: "s", autoFocus: true, onKeyPress: handleSearchKeyPress,
|
|
62
|
+
React.createElement(TextInput, { controlRef: textInputRef, className: sp({ mb: 2 }), size: "s", autoFocus: true, onKeyPress: handleSearchKeyPress, onUpdate: handleInputChange, value: query, endContent: React.createElement(React.Fragment, null,
|
|
63
63
|
React.createElement(Button, { onClick: handlePrev },
|
|
64
64
|
React.createElement(Icon, { data: ChevronUp, size: 12 })),
|
|
65
65
|
React.createElement(Button, { onClick: handleNext },
|
|
@@ -8,7 +8,7 @@ export declare const customTags: {
|
|
|
8
8
|
};
|
|
9
9
|
export declare type YfmNoteType = 'info' | 'tip' | 'warning' | 'alert';
|
|
10
10
|
export declare const yfmNoteTypes: readonly YfmNoteType[];
|
|
11
|
-
export declare const yfmNoteSnippetTemplate: (type: YfmNoteType) => "{% note info %}\n\n#{}\n\n{% endnote %}\n\n" | "{% note
|
|
11
|
+
export declare const yfmNoteSnippetTemplate: (type: YfmNoteType) => "{% note info %}\n\n#{}\n\n{% endnote %}\n\n" | "{% note alert %}\n\n#{}\n\n{% endnote %}\n\n" | "{% note tip %}\n\n#{}\n\n{% endnote %}\n\n" | "{% note warning %}\n\n#{}\n\n{% endnote %}\n\n";
|
|
12
12
|
export declare const yfmNoteSnippets: Record<YfmNoteType, ReturnType<typeof snippet>>;
|
|
13
13
|
export declare const yfmCutSnippetTemplate = "{% cut \"#{title}\" %}\n\n#{}\n\n{% endcut %}\n\n";
|
|
14
14
|
export declare const yfmCutSnippet: (editor: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Mark, Node } from 'prosemirror-model';
|
|
3
3
|
import type { EditorView, NodeView, NodeViewConstructor } from 'prosemirror-view';
|
|
4
|
-
import { ExtensionDeps, Serializer } from '../core';
|
|
4
|
+
import type { ExtensionDeps, Serializer } from '../core';
|
|
5
5
|
declare type ReactNodeViewOptions<T> = {
|
|
6
6
|
isInline?: boolean;
|
|
7
7
|
reactNodeWrapperCn?: string;
|
|
@@ -22,7 +22,7 @@ export declare class ReactNodeView<T extends object = {}> implements NodeView {
|
|
|
22
22
|
node: Node;
|
|
23
23
|
readonly view: EditorView;
|
|
24
24
|
readonly serializer: Serializer;
|
|
25
|
-
readonly renderItem: import("../extensions").RendererItem;
|
|
25
|
+
readonly renderItem: import("../extensions/behavior/ReactRenderer").RendererItem;
|
|
26
26
|
readonly getPos: () => number | undefined;
|
|
27
27
|
constructor(Component: React.FC<ReactNodeViewProps<T>>, opts: {
|
|
28
28
|
node: Node;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
|
-
import { getReactRendererFromState } from '../extensions';
|
|
3
|
+
import { getReactRendererFromState } from '../extensions/behavior/ReactRenderer';
|
|
4
4
|
export const ReactNodeStopEventCn = 'prosemirror-stop-event';
|
|
5
5
|
export class ReactNodeView {
|
|
6
6
|
constructor(Component, opts) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
2
|
-
import { isTableNode } from '..';
|
|
3
2
|
import { TableDesc } from '../table-desc';
|
|
3
|
+
import { isTableNode } from '../utils';
|
|
4
4
|
export const appendColumn = (state, dispatch, _, attrs) => {
|
|
5
5
|
if (!attrs)
|
|
6
6
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
2
|
-
import { isTableNode } from '..';
|
|
3
2
|
import { TableDesc } from '../table-desc';
|
|
3
|
+
import { isTableNode } from '../utils';
|
|
4
4
|
export const appendRow = (state, dispatch, _, attrs) => {
|
|
5
5
|
if (!attrs)
|
|
6
6
|
return false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment } from 'prosemirror-model';
|
|
2
2
|
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
3
|
-
import { isTableNode } from '..';
|
|
4
3
|
import { trackTransactionMetrics } from '../../core';
|
|
5
4
|
import { TableDesc } from '../table-desc';
|
|
5
|
+
import { isTableNode } from '../utils';
|
|
6
6
|
export const removeRow = (state, dispatch, _, attrs = {}) => {
|
|
7
7
|
var _a;
|
|
8
8
|
const { tablePos, rowNumber } = attrs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ToolbarProps } from './Toolbar';
|
|
3
|
-
import { ToolbarItemData } from './types';
|
|
2
|
+
import { type ToolbarProps } from './Toolbar';
|
|
3
|
+
import { type ToolbarItemData } from './types';
|
|
4
4
|
import './FlexToolbar.css';
|
|
5
5
|
export declare type FlexToolbarProps<E> = ToolbarProps<E> & {
|
|
6
6
|
dotsTitle: string | (() => string);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { ToolbarBaseProps } from './types';
|
|
2
|
+
import type { ToolbarBaseProps, ToolbarData } from './types';
|
|
4
3
|
import './Toolbar.css';
|
|
5
|
-
export
|
|
4
|
+
export type { ToolbarData };
|
|
6
5
|
export declare type ToolbarProps<E> = ToolbarBaseProps<E> & {
|
|
7
6
|
data: ToolbarData<E>;
|
|
8
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ToolbarBaseProps,
|
|
2
|
+
import { type ToolbarBaseProps, type ToolbarGroupData } from './types';
|
|
3
3
|
import './ToolbarGroup.css';
|
|
4
|
-
export
|
|
4
|
+
export type { ToolbarGroupData };
|
|
5
5
|
export declare type ToolbarGroupProps<E> = ToolbarBaseProps<E> & {
|
|
6
6
|
data: ToolbarGroupData<E>;
|
|
7
7
|
};
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ToolbarBaseProps,
|
|
2
|
+
import type { ToolbarBaseProps, ToolbarListButtonData } from './types';
|
|
3
3
|
import './ToolbarListButton.css';
|
|
4
|
-
export
|
|
5
|
-
icon: ToolbarIconData;
|
|
6
|
-
title: string | (() => string);
|
|
7
|
-
withArrow?: boolean;
|
|
8
|
-
data: ToolbarListButtonItemData<E>[];
|
|
9
|
-
alwaysActive?: boolean;
|
|
10
|
-
hideDisabled?: boolean;
|
|
11
|
-
};
|
|
4
|
+
export type { ToolbarListButtonData };
|
|
12
5
|
export declare type ToolbarListButtonProps<E> = ToolbarBaseProps<E> & ToolbarListButtonData<E>;
|
|
13
6
|
export declare function ToolbarListButton<E>({ className, editor, focus, onClick, icon, title, withArrow, data, alwaysActive, }: ToolbarListButtonProps<E>): JSX.Element | null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
import type { HotkeyProps, IconProps } from '@gravity-ui/uikit';
|
|
3
3
|
import type { ClassNameProps } from '../classname';
|
|
4
|
-
import type { ToolbarListButtonData } from './ToolbarListButton';
|
|
5
4
|
export declare type ToolbarBaseProps<E> = ClassNameProps & {
|
|
6
5
|
editor: E;
|
|
7
6
|
focus(): void;
|
|
@@ -10,6 +9,8 @@ export declare type ToolbarBaseProps<E> = ClassNameProps & {
|
|
|
10
9
|
}): void;
|
|
11
10
|
};
|
|
12
11
|
export declare type ToolbarIconData = Pick<IconProps, 'data' | 'size'>;
|
|
12
|
+
export declare type ToolbarGroupData<E> = Array<ToolbarGroupItemData<E>>;
|
|
13
|
+
export declare type ToolbarData<E> = ToolbarGroupData<E>[];
|
|
13
14
|
export declare type ToolbarItemData<E> = {
|
|
14
15
|
id: string;
|
|
15
16
|
icon: ToolbarIconData;
|
|
@@ -75,6 +76,14 @@ export declare type ToolbarButtonPopupData<E> = ToolbarItemData<E> & {
|
|
|
75
76
|
export declare type ToolbarListButtonItemData<E> = ToolbarItemData<E> & {
|
|
76
77
|
doNotActivateList?: boolean;
|
|
77
78
|
};
|
|
79
|
+
export declare type ToolbarListButtonData<E> = {
|
|
80
|
+
icon: ToolbarIconData;
|
|
81
|
+
title: string | (() => string);
|
|
82
|
+
withArrow?: boolean;
|
|
83
|
+
data: ToolbarListButtonItemData<E>[];
|
|
84
|
+
alwaysActive?: boolean;
|
|
85
|
+
hideDisabled?: boolean;
|
|
86
|
+
};
|
|
78
87
|
/**
|
|
79
88
|
* @deprecated Use ReactComponent type instead
|
|
80
89
|
* */
|
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.
|
|
2
|
+
export const VERSION = typeof '14.11.1' !== 'undefined' ? '14.11.1' : 'unknown';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/markdown-editor",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.11.1",
|
|
4
4
|
"description": "Markdown wysiwyg and markup editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"lint:js": "eslint \"{src,demo}/**/*.{js,jsx,ts,tsx}\"",
|
|
26
26
|
"lint:styles": "stylelint \"{src,demo}/**/*.{css,scss}\"",
|
|
27
27
|
"lint:prettier": "prettier --check \"{src,demo}/**/*.{js,jsx,ts,tsx,css,scss}\"",
|
|
28
|
+
"check-circular-deps": "node scripts/check-circular-deps.js 48",
|
|
28
29
|
"test": "jest",
|
|
29
30
|
"test:cov": "jest --coverage",
|
|
30
31
|
"test:watch": "jest --watchAll",
|
|
@@ -235,6 +236,7 @@
|
|
|
235
236
|
"@types/rimraf": "3.0.2",
|
|
236
237
|
"@types/sanitize-html": "2.11.0",
|
|
237
238
|
"bem-cn-lite": "4.1.0",
|
|
239
|
+
"dpdm": "3.14.0",
|
|
238
240
|
"esbuild-sass-plugin": "2.15.0",
|
|
239
241
|
"eslint": "8.56.0",
|
|
240
242
|
"eslint-plugin-lodash": "7.4.0",
|