@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.
- 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/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/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,12 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated This file is deprecated. Use ToolbarsPreset instead.
|
|
3
|
+
*/
|
|
1
4
|
import { headingType, pType } from '../../extensions';
|
|
2
5
|
import { i18n as i18nHint } from '../../i18n/hints';
|
|
3
6
|
import { i18n } from '../../i18n/menubar';
|
|
4
7
|
import { Action as A, formatter as f } from '../../shortcuts';
|
|
5
|
-
import { ToolbarDataType
|
|
8
|
+
import { ToolbarDataType } from '../toolbar/types';
|
|
6
9
|
import { WToolbarColors } from '../toolbar/wysiwyg/WToolbarColors';
|
|
7
10
|
import { WToolbarTextSelect } from '../toolbar/wysiwyg/WToolbarTextSelect';
|
|
8
11
|
import { ActionName } from './action-names';
|
|
9
12
|
import { icons } from './icons';
|
|
13
|
+
import { wHeading1ItemData, wHeading2ItemData, wHeading3ItemData, wHeading4ItemData, wHeading5ItemData, wHeading6ItemData, wTextItemData, } from './w-heading-config';
|
|
14
|
+
export * from './w-heading-config';
|
|
10
15
|
export const wUndoItemData = {
|
|
11
16
|
id: ActionName.undo,
|
|
12
17
|
type: ToolbarDataType.SingleButton,
|
|
@@ -278,70 +283,6 @@ export const wMathListItem = {
|
|
|
278
283
|
title: i18n.bind(null, 'math'),
|
|
279
284
|
data: [wMathInlineItemData, wMathBlockItemData],
|
|
280
285
|
};
|
|
281
|
-
export const wTextItemData = {
|
|
282
|
-
id: ActionName.paragraph,
|
|
283
|
-
title: i18n.bind(null, 'text'),
|
|
284
|
-
icon: icons.text,
|
|
285
|
-
hotkey: f.toView(A.Text),
|
|
286
|
-
exec: (e) => e.actions.toParagraph.run(),
|
|
287
|
-
isActive: (e) => e.actions.toParagraph.isActive(),
|
|
288
|
-
isEnable: (e) => e.actions.toParagraph.isEnable(),
|
|
289
|
-
doNotActivateList: true,
|
|
290
|
-
};
|
|
291
|
-
export const wHeading1ItemData = {
|
|
292
|
-
id: ActionName.heading1,
|
|
293
|
-
title: i18n.bind(null, 'heading1'),
|
|
294
|
-
icon: icons.h1,
|
|
295
|
-
hotkey: f.toView(A.Heading1),
|
|
296
|
-
exec: (e) => e.actions.toH1.run(),
|
|
297
|
-
isActive: (e) => e.actions.toH1.isActive(),
|
|
298
|
-
isEnable: (e) => e.actions.toH1.isEnable(),
|
|
299
|
-
};
|
|
300
|
-
export const wHeading2ItemData = {
|
|
301
|
-
id: ActionName.heading2,
|
|
302
|
-
title: i18n.bind(null, 'heading2'),
|
|
303
|
-
icon: icons.h2,
|
|
304
|
-
hotkey: f.toView(A.Heading2),
|
|
305
|
-
exec: (e) => e.actions.toH2.run(),
|
|
306
|
-
isActive: (e) => e.actions.toH2.isActive(),
|
|
307
|
-
isEnable: (e) => e.actions.toH2.isEnable(),
|
|
308
|
-
};
|
|
309
|
-
export const wHeading3ItemData = {
|
|
310
|
-
id: ActionName.heading3,
|
|
311
|
-
title: i18n.bind(null, 'heading3'),
|
|
312
|
-
icon: icons.h3,
|
|
313
|
-
hotkey: f.toView(A.Heading3),
|
|
314
|
-
exec: (e) => e.actions.toH3.run(),
|
|
315
|
-
isActive: (e) => e.actions.toH3.isActive(),
|
|
316
|
-
isEnable: (e) => e.actions.toH3.isEnable(),
|
|
317
|
-
};
|
|
318
|
-
export const wHeading4ItemData = {
|
|
319
|
-
id: ActionName.heading4,
|
|
320
|
-
title: i18n.bind(null, 'heading4'),
|
|
321
|
-
icon: icons.h4,
|
|
322
|
-
hotkey: f.toView(A.Heading4),
|
|
323
|
-
exec: (e) => e.actions.toH4.run(),
|
|
324
|
-
isActive: (e) => e.actions.toH4.isActive(),
|
|
325
|
-
isEnable: (e) => e.actions.toH4.isEnable(),
|
|
326
|
-
};
|
|
327
|
-
export const wHeading5ItemData = {
|
|
328
|
-
id: ActionName.heading5,
|
|
329
|
-
title: i18n.bind(null, 'heading5'),
|
|
330
|
-
icon: icons.h5,
|
|
331
|
-
hotkey: f.toView(A.Heading5),
|
|
332
|
-
exec: (e) => e.actions.toH5.run(),
|
|
333
|
-
isActive: (e) => e.actions.toH5.isActive(),
|
|
334
|
-
isEnable: (e) => e.actions.toH5.isEnable(),
|
|
335
|
-
};
|
|
336
|
-
export const wHeading6ItemData = {
|
|
337
|
-
id: ActionName.heading6,
|
|
338
|
-
title: i18n.bind(null, 'heading6'),
|
|
339
|
-
icon: icons.h6,
|
|
340
|
-
hotkey: f.toView(A.Heading6),
|
|
341
|
-
exec: (e) => e.actions.toH6.run(),
|
|
342
|
-
isActive: (e) => e.actions.toH6.isActive(),
|
|
343
|
-
isEnable: (e) => e.actions.toH6.isEnable(),
|
|
344
|
-
};
|
|
345
286
|
export const wBulletListItemData = {
|
|
346
287
|
id: ActionName.bulletList,
|
|
347
288
|
title: i18n.bind(null, 'ulist'),
|
|
@@ -380,20 +321,6 @@ export const wLiftListItemData = {
|
|
|
380
321
|
isActive: (e) => e.actions.liftListItem.isActive(),
|
|
381
322
|
isEnable: (e) => e.actions.liftListItem.isEnable(),
|
|
382
323
|
};
|
|
383
|
-
export const wHeadingListConfig = {
|
|
384
|
-
icon: icons.headline,
|
|
385
|
-
withArrow: true,
|
|
386
|
-
title: i18n.bind(null, 'heading'),
|
|
387
|
-
data: [
|
|
388
|
-
wTextItemData,
|
|
389
|
-
wHeading1ItemData,
|
|
390
|
-
wHeading2ItemData,
|
|
391
|
-
wHeading3ItemData,
|
|
392
|
-
wHeading4ItemData,
|
|
393
|
-
wHeading5ItemData,
|
|
394
|
-
wHeading6ItemData,
|
|
395
|
-
],
|
|
396
|
-
};
|
|
397
324
|
export const wListsListConfig = {
|
|
398
325
|
icon: icons.bulletList,
|
|
399
326
|
withArrow: true,
|
|
@@ -6,3 +6,5 @@ export { MarkdownEditorView } from './MarkdownEditorView';
|
|
|
6
6
|
import * as markupToolbarConfigs from './config/markup';
|
|
7
7
|
import * as wysiwygToolbarConfigs from './config/wysiwyg';
|
|
8
8
|
export { markupToolbarConfigs, wysiwygToolbarConfigs };
|
|
9
|
+
// TODO: remove in next major
|
|
10
|
+
export * from './config';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActionStorage } from '../../core';
|
|
3
|
-
import { ToolbarBaseProps } from '
|
|
4
|
-
import type { WToolbarItemData } from '../config/wysiwyg';
|
|
2
|
+
import type { ActionStorage } from '../../core';
|
|
3
|
+
import type { ToolbarBaseProps, WToolbarItemData } from './types';
|
|
5
4
|
import './ToolbarSelect.css';
|
|
6
5
|
export declare type ToolbarSelectProps = ToolbarBaseProps<ActionStorage> & {
|
|
7
6
|
items: WToolbarItemData[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CodeEditor } from '../../../markup';
|
|
3
|
-
import { ToolbarBaseProps } from '
|
|
2
|
+
import type { CodeEditor } from '../../../markup/editor';
|
|
3
|
+
import type { ToolbarBaseProps } from '../types';
|
|
4
4
|
export declare type MToolbarColorsProps = ToolbarBaseProps<CodeEditor>;
|
|
5
5
|
export declare const MToolbarColors: React.FC<MToolbarColorsProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import type { CodeEditor } from '../../../markup';
|
|
2
|
+
import type { CodeEditor } from '../../../markup/editor';
|
|
3
3
|
import type { ToolbarBaseProps } from '../../../toolbar';
|
|
4
4
|
export declare type MToolbarImagePopupProps = ToolbarBaseProps<CodeEditor> & {
|
|
5
5
|
hide: () => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ActionStorage } from '../../core';
|
|
2
|
+
import type { CodeEditor } from '../../markup';
|
|
3
|
+
import type { ToolbarListButtonData } from '../../toolbar';
|
|
4
|
+
import type { ToolbarButtonPopupData, ToolbarData, ToolbarGroupData, ToolbarGroupItemData, ToolbarItemData, ToolbarListButtonItemData, ToolbarListItemData, ToolbarReactComponentData, ToolbarSingleItemData } from '../../toolbar/types';
|
|
5
|
+
export * from '../../toolbar/types';
|
|
6
|
+
export declare type WToolbarData = ToolbarData<ActionStorage>;
|
|
7
|
+
export declare type WToolbarItemData = ToolbarItemData<ActionStorage>;
|
|
8
|
+
export declare type WToolbarSingleItemData = ToolbarSingleItemData<ActionStorage>;
|
|
9
|
+
export declare type WToolbarGroupData = ToolbarGroupData<ActionStorage>;
|
|
10
|
+
export declare type WToolbarGroupItemData = ToolbarGroupItemData<ActionStorage>;
|
|
11
|
+
export declare type WToolbarListButtonData = ToolbarListButtonData<ActionStorage>;
|
|
12
|
+
export declare type WToolbarListItemData = ToolbarListItemData<ActionStorage>;
|
|
13
|
+
export declare type WToolbarListButtonItemData = ToolbarListButtonItemData<ActionStorage>;
|
|
14
|
+
export declare type MToolbarData = ToolbarData<CodeEditor>;
|
|
15
|
+
export declare type MToolbarItemData = ToolbarItemData<CodeEditor>;
|
|
16
|
+
export declare type MToolbarSingleItemData = ToolbarSingleItemData<CodeEditor>;
|
|
17
|
+
export declare type MToolbarGroupData = ToolbarGroupData<CodeEditor>;
|
|
18
|
+
export declare type MToolbarReactComponentData = ToolbarReactComponentData<CodeEditor>;
|
|
19
|
+
export declare type MToolbarListButtonData = ToolbarListButtonData<CodeEditor>;
|
|
20
|
+
export declare type MToolbarListItemData = ToolbarListItemData<CodeEditor>;
|
|
21
|
+
export declare type MToolbarButtonPopupData = ToolbarButtonPopupData<CodeEditor>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../toolbar/types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { MToolbarData, MToolbarItemData, WToolbarData, WToolbarItemData } from '
|
|
2
|
-
export declare const flattenPreset: <T extends
|
|
1
|
+
import type { MToolbarData, MToolbarItemData, WToolbarData, WToolbarItemData } from '../types';
|
|
2
|
+
export declare const flattenPreset: <T extends WToolbarData | MToolbarData>(config: T) => T extends WToolbarData ? WToolbarItemData[] : MToolbarItemData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolbarDataType } from '
|
|
1
|
+
import { ToolbarDataType } from '../types';
|
|
2
2
|
export const flattenPreset = (config) => {
|
|
3
3
|
return config.flat().reduce((acc, item) => {
|
|
4
4
|
if (item.type === ToolbarDataType.ListButton && Array.isArray(item.data)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ToolbarsPreset } from '../../../modules/toolbars/types';
|
|
2
|
-
import type { MToolbarData, WToolbarData } from '../../../toolbar';
|
|
3
2
|
import type { MarkdownEditorViewProps } from '../../MarkdownEditorView';
|
|
4
|
-
import { MarkdownEditorPreset } from '../../types';
|
|
5
|
-
|
|
3
|
+
import type { MarkdownEditorPreset } from '../../types';
|
|
4
|
+
import type { MToolbarData, WToolbarData } from '../types';
|
|
5
|
+
export declare const createToolbarConfig: <T extends WToolbarData | MToolbarData>(editorType: 'wysiwyg' | 'markup', toolbarPreset: ToolbarsPreset | MarkdownEditorPreset, toolbarName: string) => T;
|
|
6
6
|
interface GetToolbarsConfigsArgs {
|
|
7
7
|
toolbarsPreset?: ToolbarsPreset;
|
|
8
8
|
props: Pick<MarkdownEditorViewProps, 'markupToolbarConfig' | 'wysiwygToolbarConfig' | 'wysiwygHiddenActionsConfig' | 'markupHiddenActionsConfig'>;
|
|
@@ -11,7 +11,7 @@ interface GetToolbarsConfigsArgs {
|
|
|
11
11
|
export declare const getToolbarsConfigs: ({ toolbarsPreset, props, preset }: GetToolbarsConfigsArgs) => {
|
|
12
12
|
wysiwygToolbarConfig: WToolbarData;
|
|
13
13
|
markupToolbarConfig: MToolbarData;
|
|
14
|
-
wysiwygHiddenActionsConfig: import("
|
|
15
|
-
markupHiddenActionsConfig: import("
|
|
14
|
+
wysiwygHiddenActionsConfig: import("../types").WToolbarItemData[];
|
|
15
|
+
markupHiddenActionsConfig: import("../types").MToolbarItemData[];
|
|
16
16
|
};
|
|
17
17
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolbarName } from '../../../modules/toolbars/constants';
|
|
2
2
|
import { commonmark, defaultPreset, full, yfm, zero } from '../../../modules/toolbars/presets';
|
|
3
|
-
import { ToolbarDataType } from '
|
|
3
|
+
import { ToolbarDataType } from '../types';
|
|
4
4
|
import { flattenPreset } from './flattenPreset';
|
|
5
5
|
const defaultPresets = {
|
|
6
6
|
zero,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActionStorage } from '../../../core';
|
|
3
|
-
import { ToolbarBaseProps } from '
|
|
2
|
+
import type { ActionStorage } from '../../../core';
|
|
3
|
+
import type { ToolbarBaseProps } from '../types';
|
|
4
4
|
export declare type WToolbarColorsProps = ToolbarBaseProps<ActionStorage>;
|
|
5
5
|
export declare const WToolbarColors: React.FC<WToolbarColorsProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActionStorage } from '../../../core';
|
|
3
|
-
import { ToolbarBaseProps } from '../../../toolbar';
|
|
2
|
+
import type { ActionStorage } from '../../../core';
|
|
3
|
+
import type { ToolbarBaseProps } from '../../../toolbar/types';
|
|
4
4
|
export declare type WToolbarTextSelectProps = ToolbarBaseProps<ActionStorage> & {};
|
|
5
5
|
export declare const WToolbarTextSelect: React.FC<WToolbarTextSelectProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { wHeadingListConfig } from '../../config/
|
|
2
|
+
import { wHeadingListConfig } from '../../config/w-heading-config';
|
|
3
3
|
import { ToolbarSelect } from '../ToolbarSelect';
|
|
4
4
|
export const WToolbarTextSelect = ({ focus, onClick, editor, className, }) => {
|
|
5
5
|
const items = React.useMemo(() => wHeadingListConfig.data, []);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MToolbarSingleItemData } from '../../../../bundle/
|
|
1
|
+
import { type MToolbarSingleItemData } from '../../../../bundle/toolbar/types';
|
|
2
2
|
export declare const mGptToolbarItem: MToolbarSingleItemData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ToolbarDataType } from '../../../../bundle/toolbar/types';
|
|
1
2
|
import { i18n } from '../../../../i18n/gpt/extension';
|
|
2
3
|
import { GPTIcon } from '../../../../icons';
|
|
3
|
-
import { ToolbarDataType } from '../../../../toolbar';
|
|
4
4
|
import { gptHotKeys } from '../constants';
|
|
5
5
|
import { showMarkupGpt } from './commands';
|
|
6
6
|
export const mGptToolbarItem = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WToolbarSingleItemData } from '../../../bundle/toolbar/types';
|
|
2
2
|
export declare const cnGptButton: import("@bem-react/classname").ClassNameFormatter;
|
|
3
3
|
export declare const wGptItemData: WToolbarSingleItemData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from '@bem-react/classname';
|
|
2
2
|
import { i18n } from '../../../i18n/gpt/extension';
|
|
3
3
|
import gptIcon from '../../../icons/GPT';
|
|
4
|
-
import { ToolbarDataType } from '../../../toolbar';
|
|
4
|
+
import { ToolbarDataType } from '../../../toolbar/types';
|
|
5
5
|
import { gptHotKeys } from './constants';
|
|
6
6
|
export const cnGptButton = cn('gpt-button');
|
|
7
7
|
export const wGptItemData = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
import { transform } from '@diplodoc/mermaid-extension';
|
|
3
|
-
import { MermaidConsts, mermaidNodeName
|
|
3
|
+
import { MermaidConsts, mermaidNodeName } from './const';
|
|
4
4
|
export { mermaidNodeName } from './const';
|
|
5
5
|
const MermaidSpecsExtension = (builder, { nodeView }) => {
|
|
6
6
|
builder
|
|
@@ -29,9 +29,10 @@ const MermaidSpecsExtension = (builder, { nodeView }) => {
|
|
|
29
29
|
dnd: { props: { offset: [8, 1] } },
|
|
30
30
|
},
|
|
31
31
|
toMd: (state, node) => {
|
|
32
|
-
|
|
32
|
+
const content = node.attrs[MermaidConsts.NodeAttrs.content] || '';
|
|
33
|
+
state.write('```mermaid');
|
|
33
34
|
state.ensureNewLine();
|
|
34
|
-
state.
|
|
35
|
+
state.text(content.trim(), false);
|
|
35
36
|
state.ensureNewLine();
|
|
36
37
|
state.write('```');
|
|
37
38
|
state.ensureNewLine();
|
|
@@ -56,7 +56,7 @@ export const BaseSchemaSpecs = (builder, opts) => {
|
|
|
56
56
|
An empty line is added only if there is some content in the parent element.
|
|
57
57
|
This is necessary in order to prevent an empty document with empty lines
|
|
58
58
|
*/
|
|
59
|
-
if (opts.preserveEmptyRows &&
|
|
59
|
+
if (opts.preserveEmptyRows && isEmptyString(node)) {
|
|
60
60
|
let isParentEmpty = true;
|
|
61
61
|
for (let index = 0; index < parent.content.childCount; index++) {
|
|
62
62
|
const parentChild = parent.content.child(index);
|
|
@@ -76,3 +76,15 @@ export const BaseSchemaSpecs = (builder, opts) => {
|
|
|
76
76
|
},
|
|
77
77
|
}));
|
|
78
78
|
};
|
|
79
|
+
const isEmptyString = (node) => {
|
|
80
|
+
var _a;
|
|
81
|
+
if (!node.content.size) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
if (node.childCount === 1 &&
|
|
85
|
+
node.child(0).type.name === 'text' &&
|
|
86
|
+
((_a = node.child(0).text) === null || _a === void 0 ? void 0 : _a.trim()) === '') {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PopupProps } from '@gravity-ui/uikit';
|
|
2
|
-
import { EditorState } from 'prosemirror-state';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import { ActionStorage } from '../../../core';
|
|
5
|
-
import { ToolbarButtonPopupData, ToolbarGroupItemData, ToolbarSingleItemData } from '../../../toolbar';
|
|
1
|
+
import { type PopupProps } from '@gravity-ui/uikit';
|
|
2
|
+
import type { EditorState } from 'prosemirror-state';
|
|
3
|
+
import type { EditorView } from 'prosemirror-view';
|
|
4
|
+
import type { ActionStorage } from '../../../core';
|
|
5
|
+
import type { ToolbarButtonPopupData, ToolbarGroupItemData, ToolbarSingleItemData } from '../../../toolbar';
|
|
6
6
|
export declare type ContextGroupItemData = (ToolbarGroupItemData<ActionStorage> & {
|
|
7
7
|
condition?: (state: EditorState) => void;
|
|
8
8
|
}) | ((ToolbarSingleItemData<ActionStorage> | ToolbarButtonPopupData<ActionStorage>) & {
|
|
@@ -5,7 +5,7 @@ import { Popup } from '@gravity-ui/uikit';
|
|
|
5
5
|
import { isFunction } from '../../../lodash';
|
|
6
6
|
import { logger } from '../../../logger';
|
|
7
7
|
import { ErrorLoggerBoundary } from '../../../react-utils/ErrorBoundary';
|
|
8
|
-
import { Toolbar
|
|
8
|
+
import { Toolbar } from '../../../toolbar';
|
|
9
9
|
import { getReactRendererFromState } from '../ReactRenderer';
|
|
10
10
|
const SelectionTooltip = (_a) => {
|
|
11
11
|
var { show, poppupProps } = _a, toolbarProps = __rest(_a, ["show", "poppupProps"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Action, ExtensionAuto } from '../../../core';
|
|
2
2
|
import { AddImageAttrs } from './actions';
|
|
3
3
|
import { addImageAction } from './const';
|
|
4
|
-
import { ImageUrlPasteOptions } from './imageUrlPaste';
|
|
4
|
+
import { type ImageUrlPasteOptions } from './imageUrlPaste';
|
|
5
5
|
export { imageNodeName, imageType, ImageAttr } from './ImageSpecs';
|
|
6
6
|
/** @deprecated Use `imageType` instead */
|
|
7
7
|
export declare const imgType: (schema: import("prosemirror-model").Schema<any, any>) => import("prosemirror-model").NodeType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Transaction } from 'prosemirror-state';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import { ExtensionDeps } from '../../../../core';
|
|
2
|
+
import type { Transaction } from 'prosemirror-state';
|
|
3
|
+
import type { EditorView } from 'prosemirror-view';
|
|
4
|
+
import type { ExtensionDeps } from '../../../../core';
|
|
5
5
|
import { ReactWidgetDescriptor } from '../../../behavior/WidgetDecoration/ReactWidgetDescriptor';
|
|
6
6
|
import { LinkPlaceholderWidgetProps } from './widget';
|
|
7
7
|
export declare const addPlaceholder: (tr: Transaction, deps: ExtensionDeps) => Transaction;
|
|
@@ -3,7 +3,8 @@ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { removeDecoration } from '../../../behavior/WidgetDecoration';
|
|
5
5
|
import { ReactWidgetDescriptor } from '../../../behavior/WidgetDecoration/ReactWidgetDescriptor';
|
|
6
|
-
import { LinkAttr, linkType
|
|
6
|
+
import { LinkAttr, linkType } from '../LinkSpecs';
|
|
7
|
+
import { normalizeUrlFactory } from '../utils';
|
|
7
8
|
import { LinkPlaceholderWidget } from './widget';
|
|
8
9
|
export const addPlaceholder = (tr, deps) => {
|
|
9
10
|
return new LinkWidgetDescriptor(tr.selection.from, deps).applyTo(tr);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Command } from 'prosemirror-state';
|
|
2
|
-
import { ActionSpec, ExtensionDeps } from '../../../../core';
|
|
1
|
+
import { type Command } from 'prosemirror-state';
|
|
2
|
+
import type { ActionSpec, ExtensionDeps } from '../../../../core';
|
|
3
3
|
export declare const addEmptyLink: Command;
|
|
4
4
|
export declare const addLinkCmd2: (deps: ExtensionDeps) => Command;
|
|
5
5
|
export declare const linkActionSpec2: (deps: ExtensionDeps) => ActionSpec;
|
|
@@ -3,8 +3,10 @@ import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
|
3
3
|
import { isNodeSelection } from 'prosemirror-utils';
|
|
4
4
|
import { isMarkActive } from '../../../../utils/marks';
|
|
5
5
|
import { imageRendererKey } from '../../../yfm/ImgSize/const';
|
|
6
|
-
import {
|
|
6
|
+
import { imageType } from '../../Image/ImageSpecs';
|
|
7
|
+
import { LinkAttr, linkType } from '../LinkSpecs';
|
|
7
8
|
import { addLinkPlaceholder } from '../PlaceholderWidget/commands';
|
|
9
|
+
import { removeLink } from '../commands';
|
|
8
10
|
export const addEmptyLink = (state, dispatch) => {
|
|
9
11
|
const linkMarkType = linkType(state.schema);
|
|
10
12
|
const { selection } = state;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toggleMark } from 'prosemirror-commands';
|
|
2
2
|
import { isMarkActive } from '../../../utils/marks';
|
|
3
|
-
import { linkType } from '
|
|
3
|
+
import { linkType } from './LinkSpecs';
|
|
4
4
|
export const removeLink = (state, dispatch) => {
|
|
5
5
|
const linkMarkType = linkType(state.schema);
|
|
6
6
|
if (isMarkActive(state, linkMarkType))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ActionSpec } from '../../../../core';
|
|
2
|
-
export declare const innerActions: Record<"
|
|
2
|
+
export declare const innerActions: Record<"setCellLeftAlign" | "setCellCenterAlign" | "setCellRightAlign" | "addRow" | "deleteRow" | "addColumn" | "deleteColumn", ActionSpec>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
2
|
import { bindActions } from '../../../../../core';
|
|
3
3
|
import { i18n } from '../../../../../i18n/yfm-table';
|
|
4
|
-
import { convertToYfmTable } from '../../../../yfm';
|
|
4
|
+
import { convertToYfmTable } from '../../../../yfm/YfmTable/commands/convert-table';
|
|
5
5
|
import { TableNode } from '../../TableSpecs';
|
|
6
6
|
import { innerActions } from '../../actions/innerActions';
|
|
7
7
|
import { deleteTableAction } from '../../actions/tableActions';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Action, ExtensionAuto } from '../../../core';
|
|
2
|
-
import { ImagePasteOptions } from './ImagePaste';
|
|
3
|
-
import { ImgSizeSpecsOptions } from './ImgSizeSpecs';
|
|
4
|
-
import { AddImageAttrs } from './actions';
|
|
2
|
+
import { type ImagePasteOptions } from './ImagePaste';
|
|
3
|
+
import { type ImgSizeSpecsOptions } from './ImgSizeSpecs';
|
|
4
|
+
import { type AddImageAttrs } from './actions';
|
|
5
5
|
import { addImageAction } from './const';
|
|
6
6
|
export declare type ImgSizeOptions = ImgSizeSpecsOptions & {
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NodeSpec } from 'prosemirror-model';
|
|
2
1
|
import type { ExtensionAuto, ExtensionNodeSpec } from '../../../../core';
|
|
2
|
+
import { type YfmCutSchemaOptions } from './schema';
|
|
3
3
|
export { CutAttr, CutNode, cutType, cutTitleType, cutContentType } from './const';
|
|
4
4
|
declare global {
|
|
5
5
|
namespace MarkdownEditor {
|
|
@@ -8,17 +8,9 @@ declare global {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
export declare type YfmCutSpecsOptions = {
|
|
11
|
+
export declare type YfmCutSpecsOptions = YfmCutSchemaOptions & {
|
|
12
12
|
cutView?: ExtensionNodeSpec['view'];
|
|
13
13
|
cutTitleView?: ExtensionNodeSpec['view'];
|
|
14
14
|
cutContentView?: ExtensionNodeSpec['view'];
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
17
|
-
*/
|
|
18
|
-
yfmCutTitlePlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
21
|
-
*/
|
|
22
|
-
yfmCutContentPlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
23
15
|
};
|
|
24
16
|
export declare const YfmCutSpecs: ExtensionAuto<YfmCutSpecsOptions>;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { NodeSpec } from 'prosemirror-model';
|
|
2
2
|
import type { PlaceholderOptions } from '../../../../utils/placeholder';
|
|
3
3
|
import { CutNode } from './const';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export declare type YfmCutSchemaOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
7
|
+
*/
|
|
8
|
+
yfmCutTitlePlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
11
|
+
*/
|
|
12
|
+
yfmCutContentPlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
13
|
+
};
|
|
14
|
+
export declare const getSchemaSpecs: (opts?: YfmCutSchemaOptions, placeholder?: PlaceholderOptions) => Record<CutNode, NodeSpec>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type { NodeSpec } from 'prosemirror-model';
|
|
2
1
|
import type { ExtensionWithOptions } from '../../../../core';
|
|
2
|
+
import { type YfmTableSchemaOptions } from './schema';
|
|
3
3
|
export { YfmTableNode } from './const';
|
|
4
4
|
export { yfmTableType, yfmTableBodyType, yfmTableRowType, yfmTableCellType } from './utils';
|
|
5
|
-
export declare type YfmTableSpecsOptions = {
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
8
|
-
*/
|
|
9
|
-
yfmTableCellPlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
10
|
-
};
|
|
5
|
+
export declare type YfmTableSpecsOptions = YfmTableSchemaOptions & {};
|
|
11
6
|
export declare const YfmTableSpecs: ExtensionWithOptions<YfmTableSpecsOptions>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { NodeSpec } from 'prosemirror-model';
|
|
2
2
|
import { PlaceholderOptions } from '../../../../utils/placeholder';
|
|
3
3
|
import { YfmTableNode } from './const';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export declare type YfmTableSchemaOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
7
|
+
*/
|
|
8
|
+
yfmTableCellPlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
9
|
+
};
|
|
10
|
+
export declare const getSchemaSpecs: (opts?: YfmTableSchemaOptions, placeholder?: PlaceholderOptions) => Record<YfmTableNode, NodeSpec>;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { NodeSpec } from 'prosemirror-model';
|
|
2
1
|
import type { ExtensionAuto, ExtensionNodeSpec } from '../../../../core';
|
|
2
|
+
import { type YfmTabsSchemaOptions } from './schema';
|
|
3
3
|
export { TabsNode } from './const';
|
|
4
4
|
export declare const tabPanelType: (schema: import("prosemirror-model").Schema<any, any>) => import("prosemirror-model").NodeType;
|
|
5
5
|
export declare const tabType: (schema: import("prosemirror-model").Schema<any, any>) => import("prosemirror-model").NodeType;
|
|
6
6
|
export declare const tabsType: (schema: import("prosemirror-model").Schema<any, any>) => import("prosemirror-model").NodeType;
|
|
7
7
|
export declare const tabsListType: (schema: import("prosemirror-model").Schema<any, any>) => import("prosemirror-model").NodeType;
|
|
8
|
-
export declare type YfmTabsSpecsOptions = {
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
11
|
-
*/
|
|
12
|
-
tabPlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
8
|
+
export declare type YfmTabsSpecsOptions = YfmTabsSchemaOptions & {
|
|
13
9
|
tabView?: ExtensionNodeSpec['view'];
|
|
14
10
|
tabsListView?: ExtensionNodeSpec['view'];
|
|
15
11
|
tabPanelView?: ExtensionNodeSpec['view'];
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { NodeSpec } from 'prosemirror-model';
|
|
2
|
-
import { PlaceholderOptions } from '../../../../utils/placeholder';
|
|
2
|
+
import type { PlaceholderOptions } from '../../../../utils/placeholder';
|
|
3
3
|
import { TabsNode } from './const';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export declare type YfmTabsSchemaOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated: use placeholder option in BehaviorPreset instead.
|
|
7
|
+
*/
|
|
8
|
+
tabPlaceholder?: NonNullable<NodeSpec['placeholder']>['content'];
|
|
9
|
+
};
|
|
10
|
+
export declare const getSchemaSpecs: (opts: YfmTabsSchemaOptions, placeholder?: PlaceholderOptions) => Record<TabsNode, NodeSpec>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const i18n: <G extends "bold" | "code" | "
|
|
1
|
+
export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "strike" | "underline" | "mark" | "quote" | "colorify" | "mono" | "text" | "html" | "cut" | "table" | "image" | "code_inline" | "list" | "heading" | "note" | "file" | "codeblock" | "checkbox" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "emoji" | "tabs" | "math" | "gpt" | "undo" | "redo" | "math_inline" | "math_block" | "colorify__color_blue" | "colorify__color_default" | "colorify__color_gray" | "colorify__color_green" | "colorify__color_orange" | "colorify__color_red" | "colorify__color_violet" | "colorify__color_yellow" | "colorify__group_text" | "emoji__hint" | "folding-heading" | "folding-heading__hint" | "hrule" | "list__action_lift" | "list__action_sink" | "list_action_disabled" | "mermaid" | "more_action" | "move_list" | "olist" | "ulist", S extends string>(key: G | (string extends S ? S : never), params?: {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
} | undefined) => S extends G ? {
|
|
4
4
|
bold: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const i18n: <G extends "block" | "heading" | "
|
|
1
|
+
export declare const i18n: <G extends "block" | "heading" | "codeblock" | "doc_empty" | "checkbox" | "deflist_term" | "deflist_desc" | "cut_title" | "cut_content" | "note_title" | "note_content" | "layout_cell" | "table_cell" | "select_filter", S extends string>(key: G | (string extends S ? S : never), params?: {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
} | undefined) => S extends G ? {
|
|
4
4
|
doc_empty: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const i18n: <G extends "remove" | "info" | "
|
|
1
|
+
export declare const i18n: <G extends "remove" | "info" | "alert" | "tip" | "warning", S extends string>(key: G | (string extends S ? S : never), params?: {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
} | undefined) => S extends G ? {
|
|
4
4
|
info: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLNodeVisitor } from './converters';
|
|
1
|
+
import type { HTMLNodeVisitor } from './converters';
|
|
2
2
|
/**
|
|
3
3
|
* Base handler class implementing the Chain of Responsibility pattern for HTML node processing.
|
|
4
4
|
* Each concrete handler decides whether it can process a node or should pass it to the next handler.
|