@gravity-ui/markdown-editor 14.11.0 → 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.
Files changed (144) hide show
  1. package/build/cjs/bundle/MarkdownEditorView.d.ts +1 -1
  2. package/build/cjs/bundle/MarkupEditorView.d.ts +2 -2
  3. package/build/cjs/bundle/WysiwygEditorView.d.ts +2 -2
  4. package/build/cjs/bundle/config/action-names.d.ts +1 -1
  5. package/build/cjs/bundle/config/markup.d.ts +3 -13
  6. package/build/cjs/bundle/config/markup.js +1 -1
  7. package/build/cjs/bundle/config/w-heading-config.d.ts +9 -0
  8. package/build/cjs/bundle/config/w-heading-config.js +85 -0
  9. package/build/cjs/bundle/config/wysiwyg.d.ts +3 -24
  10. package/build/cjs/bundle/config/wysiwyg.js +110 -183
  11. package/build/cjs/bundle/index.d.ts +1 -0
  12. package/build/cjs/bundle/index.js +2 -0
  13. package/build/cjs/bundle/toolbar/ToolbarSelect.d.ts +2 -3
  14. package/build/cjs/bundle/toolbar/markup/MToolbarColors.d.ts +2 -2
  15. package/build/cjs/bundle/toolbar/markup/MToolbarImagePopup.d.ts +1 -1
  16. package/build/cjs/bundle/toolbar/types.d.ts +21 -0
  17. package/build/cjs/bundle/toolbar/types.js +4 -0
  18. package/build/cjs/bundle/toolbar/utils/flattenPreset.d.ts +2 -2
  19. package/build/cjs/bundle/toolbar/utils/flattenPreset.js +1 -1
  20. package/build/cjs/bundle/toolbar/utils/toolbarsConfigs.d.ts +5 -5
  21. package/build/cjs/bundle/toolbar/utils/toolbarsConfigs.js +3 -3
  22. package/build/cjs/bundle/toolbar/wysiwyg/WToolbarColors.d.ts +2 -2
  23. package/build/cjs/bundle/toolbar/wysiwyg/WToolbarTextSelect.d.ts +2 -2
  24. package/build/cjs/bundle/toolbar/wysiwyg/WToolbarTextSelect.js +2 -2
  25. package/build/cjs/extensions/additional/GPT/MarkupGpt/toolbar.d.ts +1 -1
  26. package/build/cjs/extensions/additional/GPT/MarkupGpt/toolbar.js +2 -2
  27. package/build/cjs/extensions/additional/GPT/wGptItemData.d.ts +1 -1
  28. package/build/cjs/extensions/additional/GPT/wGptItemData.js +2 -2
  29. package/build/cjs/extensions/additional/Mermaid/MermaidSpecs/index.js +3 -2
  30. package/build/cjs/extensions/base/BaseSchema/BaseSchemaSpecs/index.js +13 -1
  31. package/build/cjs/extensions/behavior/SelectionContext/tooltip.d.ts +5 -5
  32. package/build/cjs/extensions/markdown/Image/index.d.ts +1 -1
  33. package/build/cjs/extensions/markdown/Link/LinkSpecs/index.js +1 -1
  34. package/build/cjs/extensions/markdown/Link/PlaceholderWidget/descriptor.d.ts +3 -3
  35. package/build/cjs/extensions/markdown/Link/PlaceholderWidget/descriptor.js +4 -3
  36. package/build/cjs/extensions/markdown/Link/actions/linkEnhanceActions.d.ts +2 -2
  37. package/build/cjs/extensions/markdown/Link/actions/linkEnhanceActions.js +10 -8
  38. package/build/cjs/extensions/markdown/Link/commands.js +2 -2
  39. package/build/cjs/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
  40. package/build/cjs/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +3 -3
  41. package/build/cjs/extensions/yfm/ImgSize/index.d.ts +3 -3
  42. package/build/cjs/extensions/yfm/YfmCut/YfmCutSpecs/index.d.ts +2 -10
  43. package/build/cjs/extensions/yfm/YfmCut/YfmCutSpecs/schema.d.ts +11 -2
  44. package/build/cjs/extensions/yfm/YfmTable/YfmTableSpecs/index.d.ts +2 -7
  45. package/build/cjs/extensions/yfm/YfmTable/YfmTableSpecs/schema.d.ts +7 -2
  46. package/build/cjs/extensions/yfm/YfmTabs/YfmTabsSpecs/index.d.ts +2 -6
  47. package/build/cjs/extensions/yfm/YfmTabs/YfmTabsSpecs/schema.d.ts +8 -3
  48. package/build/cjs/i18n/menubar/index.d.ts +1 -1
  49. package/build/cjs/i18n/placeholder/index.d.ts +1 -1
  50. package/build/cjs/i18n/yfm-note/index.d.ts +1 -1
  51. package/build/cjs/markup/codemirror/html-to-markdown/handlers.d.ts +1 -1
  52. package/build/cjs/markup/codemirror/search-plugin/plugin.d.ts +6 -16
  53. package/build/cjs/markup/codemirror/search-plugin/plugin.js +7 -8
  54. package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.d.ts +6 -10
  55. package/build/cjs/markup/codemirror/search-plugin/view/SearchPopup.js +13 -13
  56. package/build/cjs/markup/codemirror/yfm.d.ts +1 -1
  57. package/build/cjs/markup/editor.d.ts +1 -1
  58. package/build/cjs/react-utils/react-node-view.d.ts +2 -2
  59. package/build/cjs/react-utils/react-node-view.js +2 -2
  60. package/build/cjs/table-utils/commands/appendColumn.js +2 -2
  61. package/build/cjs/table-utils/commands/appendRow.js +2 -2
  62. package/build/cjs/table-utils/commands/removeRow.js +2 -2
  63. package/build/cjs/toolbar/FlexToolbar.d.ts +2 -2
  64. package/build/cjs/toolbar/Toolbar.d.ts +2 -3
  65. package/build/cjs/toolbar/ToolbarGroup.d.ts +2 -2
  66. package/build/cjs/toolbar/ToolbarListButton.d.ts +2 -9
  67. package/build/cjs/toolbar/flexible.d.ts +1 -2
  68. package/build/cjs/toolbar/index.d.ts +0 -1
  69. package/build/cjs/toolbar/index.js +0 -1
  70. package/build/cjs/toolbar/types.d.ts +10 -1
  71. package/build/cjs/version.js +1 -1
  72. package/build/esm/bundle/MarkdownEditorView.d.ts +1 -1
  73. package/build/esm/bundle/MarkupEditorView.d.ts +2 -2
  74. package/build/esm/bundle/WysiwygEditorView.d.ts +2 -2
  75. package/build/esm/bundle/config/action-names.d.ts +1 -1
  76. package/build/esm/bundle/config/markup.d.ts +3 -13
  77. package/build/esm/bundle/config/markup.js +1 -1
  78. package/build/esm/bundle/config/w-heading-config.d.ts +9 -0
  79. package/build/esm/bundle/config/w-heading-config.js +82 -0
  80. package/build/esm/bundle/config/wysiwyg.d.ts +3 -24
  81. package/build/esm/bundle/config/wysiwyg.js +6 -79
  82. package/build/esm/bundle/index.d.ts +1 -0
  83. package/build/esm/bundle/index.js +2 -0
  84. package/build/esm/bundle/toolbar/ToolbarSelect.d.ts +2 -3
  85. package/build/esm/bundle/toolbar/markup/MToolbarColors.d.ts +2 -2
  86. package/build/esm/bundle/toolbar/markup/MToolbarImagePopup.d.ts +1 -1
  87. package/build/esm/bundle/toolbar/types.d.ts +21 -0
  88. package/build/esm/bundle/toolbar/types.js +1 -0
  89. package/build/esm/bundle/toolbar/utils/flattenPreset.d.ts +2 -2
  90. package/build/esm/bundle/toolbar/utils/flattenPreset.js +1 -1
  91. package/build/esm/bundle/toolbar/utils/toolbarsConfigs.d.ts +5 -5
  92. package/build/esm/bundle/toolbar/utils/toolbarsConfigs.js +1 -1
  93. package/build/esm/bundle/toolbar/wysiwyg/WToolbarColors.d.ts +2 -2
  94. package/build/esm/bundle/toolbar/wysiwyg/WToolbarTextSelect.d.ts +2 -2
  95. package/build/esm/bundle/toolbar/wysiwyg/WToolbarTextSelect.js +1 -1
  96. package/build/esm/extensions/additional/GPT/MarkupGpt/toolbar.d.ts +1 -1
  97. package/build/esm/extensions/additional/GPT/MarkupGpt/toolbar.js +1 -1
  98. package/build/esm/extensions/additional/GPT/wGptItemData.d.ts +1 -1
  99. package/build/esm/extensions/additional/GPT/wGptItemData.js +1 -1
  100. package/build/esm/extensions/additional/Mermaid/MermaidSpecs/index.js +4 -3
  101. package/build/esm/extensions/base/BaseSchema/BaseSchemaSpecs/index.js +13 -1
  102. package/build/esm/extensions/behavior/SelectionContext/tooltip.d.ts +5 -5
  103. package/build/esm/extensions/behavior/SelectionContext/tooltip.js +1 -1
  104. package/build/esm/extensions/markdown/Image/index.d.ts +1 -1
  105. package/build/esm/extensions/markdown/Link/LinkSpecs/index.js +1 -1
  106. package/build/esm/extensions/markdown/Link/PlaceholderWidget/descriptor.d.ts +3 -3
  107. package/build/esm/extensions/markdown/Link/PlaceholderWidget/descriptor.js +2 -1
  108. package/build/esm/extensions/markdown/Link/actions/linkEnhanceActions.d.ts +2 -2
  109. package/build/esm/extensions/markdown/Link/actions/linkEnhanceActions.js +3 -1
  110. package/build/esm/extensions/markdown/Link/commands.js +1 -1
  111. package/build/esm/extensions/markdown/Table/actions/innerActions.d.ts +1 -1
  112. package/build/esm/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +1 -1
  113. package/build/esm/extensions/yfm/ImgSize/index.d.ts +3 -3
  114. package/build/esm/extensions/yfm/YfmCut/YfmCutSpecs/index.d.ts +2 -10
  115. package/build/esm/extensions/yfm/YfmCut/YfmCutSpecs/schema.d.ts +11 -2
  116. package/build/esm/extensions/yfm/YfmTable/YfmTableSpecs/index.d.ts +2 -7
  117. package/build/esm/extensions/yfm/YfmTable/YfmTableSpecs/schema.d.ts +7 -2
  118. package/build/esm/extensions/yfm/YfmTabs/YfmTabsSpecs/index.d.ts +2 -6
  119. package/build/esm/extensions/yfm/YfmTabs/YfmTabsSpecs/schema.d.ts +8 -3
  120. package/build/esm/i18n/menubar/index.d.ts +1 -1
  121. package/build/esm/i18n/placeholder/index.d.ts +1 -1
  122. package/build/esm/i18n/yfm-note/index.d.ts +1 -1
  123. package/build/esm/markup/codemirror/html-to-markdown/handlers.d.ts +1 -1
  124. package/build/esm/markup/codemirror/search-plugin/plugin.d.ts +6 -16
  125. package/build/esm/markup/codemirror/search-plugin/plugin.js +8 -9
  126. package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.d.ts +6 -10
  127. package/build/esm/markup/codemirror/search-plugin/view/SearchPopup.js +13 -13
  128. package/build/esm/markup/codemirror/yfm.d.ts +1 -1
  129. package/build/esm/markup/editor.d.ts +1 -1
  130. package/build/esm/react-utils/react-node-view.d.ts +2 -2
  131. package/build/esm/react-utils/react-node-view.js +1 -1
  132. package/build/esm/table-utils/commands/appendColumn.js +1 -1
  133. package/build/esm/table-utils/commands/appendRow.js +1 -1
  134. package/build/esm/table-utils/commands/removeRow.js +1 -1
  135. package/build/esm/toolbar/FlexToolbar.d.ts +2 -2
  136. package/build/esm/toolbar/Toolbar.d.ts +2 -3
  137. package/build/esm/toolbar/ToolbarGroup.d.ts +2 -2
  138. package/build/esm/toolbar/ToolbarListButton.d.ts +2 -9
  139. package/build/esm/toolbar/flexible.d.ts +1 -2
  140. package/build/esm/toolbar/index.d.ts +0 -1
  141. package/build/esm/toolbar/index.js +0 -1
  142. package/build/esm/toolbar/types.d.ts +10 -1
  143. package/build/esm/version.js +1 -1
  144. 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
- interface SearchQueryParams {
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
- searchQuery: SearchQueryParams;
18
+ searchConfig: SearchQueryConfig;
26
19
  receiver: Receiver<EventMap> | undefined;
27
- setViewSearchWithDelay: (config: Partial<SearchQueryParams>) => void;
20
+ setViewSearchWithDelay: (config: Partial<SearchQueryConfig>) => void;
28
21
  update(update: ViewUpdate): void;
29
22
  destroy(): void;
30
- setViewSearch(config: Partial<SearchQueryParams>): void;
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({ isCaseSensitive, isWholeWord, }: {
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.searchQuery = {
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.searchQuery = Object.assign(Object.assign({}, this.searchQuery), config);
59
- const searchQuery = new SearchQuery(Object.assign({}, this.searchQuery));
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({ isCaseSensitive, isWholeWord, }) {
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
- interface SearchConfig {
4
- isCaseSensitive: boolean;
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
- export const SearchCard = ({ onChange = noop, onClose = noop, onSearchPrev = noop, onSearchNext = noop, onConfigChange = noop, }) => {
12
- const [query, setQuery] = useState('');
13
- const [isCaseSensitive, setIsCaseSensitive] = useState(false);
14
- const [isWholeWord, setIsWholeWord] = useState(false);
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 = (event) => {
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
- isCaseSensitive: !isCaseSensitive,
41
- isWholeWord,
40
+ caseSensitive: !isCaseSensitive,
41
+ wholeWord: isWholeWord,
42
42
  });
43
- setIsCaseSensitive((isCaseSensitive) => !isCaseSensitive);
43
+ setIsCaseSensitive(inverse);
44
44
  setInputFocus();
45
45
  };
46
46
  const handleIsWholeWord = () => {
47
47
  onConfigChange({
48
- isCaseSensitive,
49
- isWholeWord: !isWholeWord,
48
+ caseSensitive: isCaseSensitive,
49
+ wholeWord: !isWholeWord,
50
50
  });
51
- setIsWholeWord((isWholeWord) => !isWholeWord);
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, onChange: handleInputChange, value: query, endContent: React.createElement(React.Fragment, null,
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 tip %}\n\n#{}\n\n{% endnote %}\n\n" | "{% note warning %}\n\n#{}\n\n{% endnote %}\n\n" | "{% note alert %}\n\n#{}\n\n{% endnote %}\n\n";
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,5 +1,5 @@
1
1
  import type { EditorView } from '@codemirror/view';
2
- import { CommonEditor, MarkupString } from '../common';
2
+ import type { CommonEditor, MarkupString } from '../common';
3
3
  export interface CodeEditor {
4
4
  readonly cm: EditorView;
5
5
  }
@@ -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 { ToolbarGroupData } from './ToolbarGroup';
3
- import { ToolbarBaseProps } from './types';
2
+ import type { ToolbarBaseProps, ToolbarData } from './types';
4
3
  import './Toolbar.css';
5
- export declare type ToolbarData<E> = ToolbarGroupData<E>[];
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, ToolbarGroupItemData } from './types';
2
+ import { type ToolbarBaseProps, type ToolbarGroupData } from './types';
3
3
  import './ToolbarGroup.css';
4
- export declare type ToolbarGroupData<E> = ToolbarGroupItemData<E>[];
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, ToolbarIconData, ToolbarListButtonItemData } from './types';
2
+ import type { ToolbarBaseProps, ToolbarListButtonData } from './types';
3
3
  import './ToolbarListButton.css';
4
- export declare type ToolbarListButtonData<E> = {
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,5 +1,4 @@
1
- import type { ToolbarData } from './Toolbar';
2
- import { ToolbarItemData } from './types';
1
+ import type { ToolbarData, ToolbarItemData } from './types';
3
2
  export declare type ShrinkToolbarDataParams<E> = {
4
3
  data: ToolbarData<E>;
5
4
  availableWidth: number;
@@ -5,4 +5,3 @@ export * from './ToolbarButton';
5
5
  export * from './ToolbarGroup';
6
6
  export * from './ToolbarListButton';
7
7
  export * from './FlexToolbar';
8
- export * from '../bundle/config';
@@ -5,4 +5,3 @@ export * from './ToolbarButton';
5
5
  export * from './ToolbarGroup';
6
6
  export * from './ToolbarListButton';
7
7
  export * from './FlexToolbar';
8
- export * from '../bundle/config';
@@ -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
  * */
@@ -1,2 +1,2 @@
1
1
  /** During build process, the current version will be injected here */
2
- export const VERSION = typeof '14.11.0' !== 'undefined' ? '14.11.0' : 'unknown';
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.11.0",
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",