@gravity-ui/markdown-editor 13.3.0 → 13.4.0
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/HorizontalDrag.d.ts +1 -0
- package/build/cjs/bundle/HorizontalDrag.js +2 -1
- package/build/cjs/bundle/config/action-names.d.ts +1 -1
- package/build/cjs/bundle/config/action-names.js +1 -0
- package/build/cjs/bundle/config/icons.d.ts +1 -1
- package/build/cjs/bundle/config/icons.js +1 -0
- package/build/cjs/bundle/config/markup.d.ts +1 -0
- package/build/cjs/bundle/config/markup.js +10 -1
- package/build/cjs/bundle/config/wysiwyg.d.ts +1 -0
- package/build/cjs/bundle/config/wysiwyg.js +12 -1
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.d.ts +23 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.js +57 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlock.css +66 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.d.ts +17 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.js +178 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.d.ts +1 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.js +4 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.d.ts +15 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.js +20 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.d.ts +10 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.js +43 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/actions.d.ts +2 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/actions.js +15 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/const.d.ts +2 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/const.js +6 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/index.d.ts +14 -0
- package/build/cjs/extensions/yfm/YfmHtmlBlock/index.js +17 -0
- package/build/cjs/extensions/yfm/index.d.ts +1 -1
- package/build/cjs/extensions/yfm/index.js +1 -1
- package/build/cjs/i18n/common/en.json +6 -2
- package/build/cjs/i18n/common/index.d.ts +7 -3
- package/build/cjs/i18n/common/ru.json +6 -2
- package/build/cjs/i18n/menubar/en.json +37 -36
- package/build/cjs/i18n/menubar/index.d.ts +38 -37
- package/build/cjs/i18n/menubar/ru.json +37 -36
- package/build/cjs/icons/index.d.ts +1 -1
- package/build/cjs/icons/index.js +2 -1
- package/build/cjs/markup/commands/blocks.d.ts +1 -0
- package/build/cjs/markup/commands/blocks.js +12 -1
- package/build/cjs/version.js +1 -1
- package/build/cjs/view/components/YfmHtml/{YfmHtml.d.ts → YfmStaticView.d.ts} +2 -2
- package/build/cjs/view/components/YfmHtml/{YfmHtml.js → YfmStaticView.js} +2 -2
- package/build/cjs/view/components/YfmHtml/index.d.ts +12 -1
- package/build/cjs/view/components/YfmHtml/index.js +4 -2
- package/build/cjs/view/hocs/withYfmHtml/index.d.ts +13 -0
- package/build/cjs/view/hocs/withYfmHtml/index.js +24 -0
- package/build/cjs/view/hocs/withYfmHtml/types.d.ts +3 -0
- package/build/cjs/view/hocs/withYfmHtml/types.js +2 -0
- package/build/cjs/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.d.ts +1 -0
- package/build/cjs/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.js +34 -0
- package/build/cjs/view/hocs/withYfmHtml/utils.d.ts +16 -0
- package/build/cjs/view/hocs/withYfmHtml/utils.js +26 -0
- package/build/esm/bundle/HorizontalDrag.d.ts +1 -0
- package/build/esm/bundle/HorizontalDrag.js +2 -1
- package/build/esm/bundle/config/action-names.d.ts +1 -1
- package/build/esm/bundle/config/action-names.js +1 -0
- package/build/esm/bundle/config/icons.d.ts +1 -1
- package/build/esm/bundle/config/icons.js +2 -1
- package/build/esm/bundle/config/markup.d.ts +1 -0
- package/build/esm/bundle/config/markup.js +10 -1
- package/build/esm/bundle/config/wysiwyg.d.ts +1 -0
- package/build/esm/bundle/config/wysiwyg.js +11 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.d.ts +23 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.js +52 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlock.css +66 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.d.ts +18 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.js +173 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.d.ts +1 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.js +1 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.d.ts +15 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.js +17 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.d.ts +10 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.js +39 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/actions.d.ts +2 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/actions.js +12 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/const.d.ts +2 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/const.js +2 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/index.d.ts +14 -0
- package/build/esm/extensions/yfm/YfmHtmlBlock/index.js +13 -0
- package/build/esm/extensions/yfm/index.d.ts +1 -1
- package/build/esm/extensions/yfm/index.js +1 -1
- package/build/esm/i18n/common/en.json +6 -2
- package/build/esm/i18n/common/index.d.ts +7 -3
- package/build/esm/i18n/common/ru.json +6 -2
- package/build/esm/i18n/menubar/en.json +37 -36
- package/build/esm/i18n/menubar/index.d.ts +38 -37
- package/build/esm/i18n/menubar/ru.json +37 -36
- package/build/esm/icons/index.d.ts +1 -1
- package/build/esm/icons/index.js +1 -1
- package/build/esm/markup/commands/blocks.d.ts +1 -0
- package/build/esm/markup/commands/blocks.js +10 -0
- package/build/esm/version.js +1 -1
- package/build/esm/view/components/YfmHtml/{YfmHtml.d.ts → YfmStaticView.d.ts} +2 -2
- package/build/esm/view/components/YfmHtml/{YfmHtml.js → YfmStaticView.js} +1 -1
- package/build/esm/view/components/YfmHtml/index.d.ts +12 -1
- package/build/esm/view/components/YfmHtml/index.js +6 -1
- package/build/esm/view/hocs/withYfmHtml/index.d.ts +13 -0
- package/build/esm/view/hocs/withYfmHtml/index.js +19 -0
- package/build/esm/view/hocs/withYfmHtml/types.d.ts +3 -0
- package/build/esm/view/hocs/withYfmHtml/types.js +1 -0
- package/build/esm/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.d.ts +1 -0
- package/build/esm/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.js +7 -0
- package/build/esm/view/hocs/withYfmHtml/utils.d.ts +16 -0
- package/build/esm/view/hocs/withYfmHtml/utils.js +22 -0
- package/build/styles.css +66 -0
- package/package.json +6 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.YfmHtmlBlock = void 0;
|
|
4
|
+
const YfmHtmlBlockNodeView_1 = require("./YfmHtmlBlockNodeView");
|
|
5
|
+
const YfmHtmlBlockSpecs_1 = require("./YfmHtmlBlockSpecs");
|
|
6
|
+
const const_1 = require("./YfmHtmlBlockSpecs/const");
|
|
7
|
+
const actions_1 = require("./actions");
|
|
8
|
+
const YfmHtmlBlock = (builder, options) => {
|
|
9
|
+
builder.use(YfmHtmlBlockSpecs_1.YfmHtmlBlockSpecs, {
|
|
10
|
+
nodeView: YfmHtmlBlockNodeViewFactory(options),
|
|
11
|
+
});
|
|
12
|
+
builder.addAction(const_1.YfmHtmlBlockAction, () => actions_1.addYfmHtmlBlock);
|
|
13
|
+
};
|
|
14
|
+
exports.YfmHtmlBlock = YfmHtmlBlock;
|
|
15
|
+
const YfmHtmlBlockNodeViewFactory = (options) => () => (node, view, getPos) => {
|
|
16
|
+
return new YfmHtmlBlockNodeView_1.WYfmHtmlBlockNodeView({ node, view, getPos, options });
|
|
17
|
+
};
|
|
@@ -4,8 +4,8 @@ export * from './Emoji';
|
|
|
4
4
|
export * from './ImgSize';
|
|
5
5
|
export * from './Monospace';
|
|
6
6
|
export * from './Video';
|
|
7
|
-
export * from './YfmCut';
|
|
8
7
|
export * from './YfmConfigs';
|
|
8
|
+
export * from './YfmCut';
|
|
9
9
|
export * from './YfmFile';
|
|
10
10
|
export * from './YfmHeading';
|
|
11
11
|
export * from './YfmNote';
|
|
@@ -7,8 +7,8 @@ tslib_1.__exportStar(require("./Emoji"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./ImgSize"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./Monospace"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./Video"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./YfmCut"), exports);
|
|
11
10
|
tslib_1.__exportStar(require("./YfmConfigs"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./YfmCut"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./YfmFile"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./YfmHeading"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./YfmNote"), exports);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"cancel": "Cancel",
|
|
3
|
+
"delete": "Delete",
|
|
3
4
|
"edit": "Edit",
|
|
4
|
-
"
|
|
5
|
+
"preview": "Preview",
|
|
6
|
+
"remove": "Remove",
|
|
7
|
+
"save": "Save",
|
|
8
|
+
"toolbar_action_disabled": "Incompatible markup element"
|
|
5
9
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export declare const i18n: <G extends "
|
|
1
|
+
export declare const i18n: <G extends "remove" | "cancel" | "delete" | "edit" | "preview" | "save" | "toolbar_action_disabled", S extends string>(key: G | (string extends S ? S : never), params?: {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
} | undefined) => S extends G ? {
|
|
4
|
-
|
|
5
|
-
edit: string;
|
|
4
|
+
cancel: string;
|
|
6
5
|
delete: string;
|
|
6
|
+
edit: string;
|
|
7
|
+
preview: string;
|
|
8
|
+
remove: string;
|
|
9
|
+
save: string;
|
|
10
|
+
toolbar_action_disabled: string;
|
|
7
11
|
}[G] : string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"cancel": "Отмена",
|
|
3
|
+
"delete": "Удалить",
|
|
3
4
|
"edit": "Редактировать",
|
|
4
|
-
"
|
|
5
|
+
"preview": "Предпросмотр",
|
|
6
|
+
"remove": "Удалить",
|
|
7
|
+
"save": "Сохранить",
|
|
8
|
+
"toolbar_action_disabled": "Несовместимый элемент разметки"
|
|
5
9
|
}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"undo": "Undo",
|
|
3
|
-
"redo": "Redo",
|
|
4
2
|
"bold": "Bold",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
3
|
+
"checkbox": "Checkbox",
|
|
4
|
+
"code": "Code",
|
|
5
|
+
"code_inline": "Inline code",
|
|
6
|
+
"codeblock": "Code block",
|
|
7
|
+
"colorify": "Text color",
|
|
8
|
+
"colorify__color_blue": "Blue",
|
|
9
|
+
"colorify__color_default": "Default",
|
|
10
|
+
"colorify__color_gray": "Gray",
|
|
11
|
+
"colorify__color_green": "Green",
|
|
12
|
+
"colorify__color_orange": "Orange",
|
|
13
|
+
"colorify__color_red": "Red",
|
|
14
|
+
"colorify__color_violet": "Violet",
|
|
15
|
+
"colorify__color_yellow": "Yellow",
|
|
16
|
+
"colorify__group_text": "Text",
|
|
17
|
+
"cut": "Cut",
|
|
18
|
+
"emoji": "Emoji",
|
|
19
|
+
"file": "File",
|
|
11
20
|
"heading": "Heading",
|
|
12
21
|
"heading1": "Heading 1",
|
|
13
22
|
"heading2": "Heading 2",
|
|
@@ -15,39 +24,31 @@
|
|
|
15
24
|
"heading4": "Heading 4",
|
|
16
25
|
"heading5": "Heading 5",
|
|
17
26
|
"heading6": "Heading 6",
|
|
27
|
+
"hrule": "Separator",
|
|
28
|
+
"html": "HTML",
|
|
29
|
+
"image": "Image",
|
|
30
|
+
"italic": "Italic",
|
|
31
|
+
"link": "Link",
|
|
18
32
|
"list": "List",
|
|
19
|
-
"ulist": "Bullet list",
|
|
20
|
-
"olist": "Ordered list",
|
|
21
|
-
"list__action_sink": "Sink item",
|
|
22
33
|
"list__action_lift": "Lift item",
|
|
34
|
+
"list__action_sink": "Sink item",
|
|
23
35
|
"list_action_disabled": "Contradicts the logic of the list",
|
|
24
|
-
"
|
|
25
|
-
"quote": "Quote",
|
|
26
|
-
"cut": "Cut",
|
|
27
|
-
"note": "Note",
|
|
28
|
-
"table": "Table",
|
|
29
|
-
"link": "Link",
|
|
30
|
-
"code": "Code",
|
|
31
|
-
"code_inline": "Inline code",
|
|
32
|
-
"codeblock": "Code block",
|
|
33
|
-
"image": "Image",
|
|
34
|
-
"hrule": "Separator",
|
|
35
|
-
"emoji": "Emoji",
|
|
36
|
-
"file": "File",
|
|
36
|
+
"mark": "Marked",
|
|
37
37
|
"math": "Math",
|
|
38
|
-
"math_inline": "Inline math",
|
|
39
38
|
"math_block": "Math block",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"colorify__color_gray": "Gray",
|
|
44
|
-
"colorify__color_yellow": "Yellow",
|
|
45
|
-
"colorify__color_orange": "Orange",
|
|
46
|
-
"colorify__color_red": "Red",
|
|
47
|
-
"colorify__color_green": "Green",
|
|
48
|
-
"colorify__color_blue": "Blue",
|
|
49
|
-
"colorify__color_violet": "Violet",
|
|
39
|
+
"math_inline": "Inline math",
|
|
40
|
+
"mermaid": "Mermaid",
|
|
41
|
+
"mono": "Monospace",
|
|
50
42
|
"more_action": "More action",
|
|
43
|
+
"note": "Note",
|
|
44
|
+
"olist": "Ordered list",
|
|
45
|
+
"quote": "Quote",
|
|
46
|
+
"redo": "Redo",
|
|
47
|
+
"strike": "Strikethrough",
|
|
48
|
+
"table": "Table",
|
|
51
49
|
"tabs": "Tabs",
|
|
52
|
-
"
|
|
50
|
+
"text": "Text",
|
|
51
|
+
"ulist": "Bullet list",
|
|
52
|
+
"underline": "Underline",
|
|
53
|
+
"undo": "Undo"
|
|
53
54
|
}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "strike" | "underline" | "mark" | "quote" | "colorify" | "mono" | "text" | "cut" | "table" | "image" | "code_inline" | "heading" | "note" | "file" | "codeblock" | "checkbox" | "emoji" | "list" | "tabs" | "math" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "undo" | "redo" | "math_inline" | "math_block" | "
|
|
1
|
+
export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "strike" | "underline" | "mark" | "quote" | "colorify" | "mono" | "text" | "html" | "cut" | "table" | "image" | "code_inline" | "heading" | "note" | "file" | "codeblock" | "checkbox" | "emoji" | "list" | "tabs" | "math" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "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" | "hrule" | "list__action_lift" | "list__action_sink" | "list_action_disabled" | "mermaid" | "more_action" | "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
|
-
undo: string;
|
|
5
|
-
redo: string;
|
|
6
4
|
bold: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
checkbox: string;
|
|
6
|
+
code: string;
|
|
7
|
+
code_inline: string;
|
|
8
|
+
codeblock: string;
|
|
9
|
+
colorify: string;
|
|
10
|
+
colorify__color_blue: string;
|
|
11
|
+
colorify__color_default: string;
|
|
12
|
+
colorify__color_gray: string;
|
|
13
|
+
colorify__color_green: string;
|
|
14
|
+
colorify__color_orange: string;
|
|
15
|
+
colorify__color_red: string;
|
|
16
|
+
colorify__color_violet: string;
|
|
17
|
+
colorify__color_yellow: string;
|
|
18
|
+
colorify__group_text: string;
|
|
19
|
+
cut: string;
|
|
20
|
+
emoji: string;
|
|
21
|
+
file: string;
|
|
13
22
|
heading: string;
|
|
14
23
|
heading1: string;
|
|
15
24
|
heading2: string;
|
|
@@ -17,39 +26,31 @@ export declare const i18n: <G extends "bold" | "code" | "link" | "italic" | "str
|
|
|
17
26
|
heading4: string;
|
|
18
27
|
heading5: string;
|
|
19
28
|
heading6: string;
|
|
29
|
+
hrule: string;
|
|
30
|
+
html: string;
|
|
31
|
+
image: string;
|
|
32
|
+
italic: string;
|
|
33
|
+
link: string;
|
|
20
34
|
list: string;
|
|
21
|
-
ulist: string;
|
|
22
|
-
olist: string;
|
|
23
|
-
list__action_sink: string;
|
|
24
35
|
list__action_lift: string;
|
|
36
|
+
list__action_sink: string;
|
|
25
37
|
list_action_disabled: string;
|
|
26
|
-
|
|
27
|
-
quote: string;
|
|
28
|
-
cut: string;
|
|
29
|
-
note: string;
|
|
30
|
-
table: string;
|
|
31
|
-
link: string;
|
|
32
|
-
code: string;
|
|
33
|
-
code_inline: string;
|
|
34
|
-
codeblock: string;
|
|
35
|
-
image: string;
|
|
36
|
-
hrule: string;
|
|
37
|
-
emoji: string;
|
|
38
|
-
file: string;
|
|
38
|
+
mark: string;
|
|
39
39
|
math: string;
|
|
40
|
-
math_inline: string;
|
|
41
40
|
math_block: string;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
colorify__color_gray: string;
|
|
46
|
-
colorify__color_yellow: string;
|
|
47
|
-
colorify__color_orange: string;
|
|
48
|
-
colorify__color_red: string;
|
|
49
|
-
colorify__color_green: string;
|
|
50
|
-
colorify__color_blue: string;
|
|
51
|
-
colorify__color_violet: string;
|
|
41
|
+
math_inline: string;
|
|
42
|
+
mermaid: string;
|
|
43
|
+
mono: string;
|
|
52
44
|
more_action: string;
|
|
45
|
+
note: string;
|
|
46
|
+
olist: string;
|
|
47
|
+
quote: string;
|
|
48
|
+
redo: string;
|
|
49
|
+
strike: string;
|
|
50
|
+
table: string;
|
|
53
51
|
tabs: string;
|
|
54
|
-
|
|
52
|
+
text: string;
|
|
53
|
+
ulist: string;
|
|
54
|
+
underline: string;
|
|
55
|
+
undo: string;
|
|
55
56
|
}[G] : string;
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"undo": "Отменить",
|
|
3
|
-
"redo": "Повторить",
|
|
4
2
|
"bold": "Жирный",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
3
|
+
"checkbox": "Контрольный список",
|
|
4
|
+
"code": "Код",
|
|
5
|
+
"code_inline": "Код в тексте",
|
|
6
|
+
"codeblock": "Блок кода",
|
|
7
|
+
"colorify": "Цвет текста",
|
|
8
|
+
"colorify__color_blue": "Синий",
|
|
9
|
+
"colorify__color_default": "Стандартный",
|
|
10
|
+
"colorify__color_gray": "Серый",
|
|
11
|
+
"colorify__color_green": "Зелёный",
|
|
12
|
+
"colorify__color_orange": "Оранжевый",
|
|
13
|
+
"colorify__color_red": "Красный",
|
|
14
|
+
"colorify__color_violet": "Фиолетовый",
|
|
15
|
+
"colorify__color_yellow": "Жёлтый",
|
|
16
|
+
"colorify__group_text": "Текст",
|
|
17
|
+
"cut": "Кат",
|
|
18
|
+
"emoji": "Эмодзи",
|
|
19
|
+
"file": "Файл",
|
|
11
20
|
"heading": "Заголовок",
|
|
12
21
|
"heading1": "Заголовок 1",
|
|
13
22
|
"heading2": "Заголовок 2",
|
|
@@ -15,39 +24,31 @@
|
|
|
15
24
|
"heading4": "Заголовок 4",
|
|
16
25
|
"heading5": "Заголовок 5",
|
|
17
26
|
"heading6": "Заголовок 6",
|
|
27
|
+
"hrule": "Разделитель",
|
|
28
|
+
"html": "HTML",
|
|
29
|
+
"image": "Изображение",
|
|
30
|
+
"italic": "Курсив",
|
|
31
|
+
"link": "Ссылка",
|
|
18
32
|
"list": "Список",
|
|
19
|
-
"ulist": "Маркированный список",
|
|
20
|
-
"olist": "Нумерованный список",
|
|
21
|
-
"list__action_sink": "Увеличить отступ",
|
|
22
33
|
"list__action_lift": "Уменьшить отступ",
|
|
34
|
+
"list__action_sink": "Увеличить отступ",
|
|
23
35
|
"list_action_disabled": "Противоречит логике списка",
|
|
24
|
-
"
|
|
25
|
-
"quote": "Цитата",
|
|
26
|
-
"cut": "Кат",
|
|
27
|
-
"note": "Примечание",
|
|
28
|
-
"table": "Таблица",
|
|
29
|
-
"link": "Ссылка",
|
|
30
|
-
"code": "Код",
|
|
31
|
-
"code_inline": "Код в тексте",
|
|
32
|
-
"codeblock": "Блок кода",
|
|
33
|
-
"image": "Изображение",
|
|
34
|
-
"hrule": "Разделитель",
|
|
35
|
-
"emoji": "Эмодзи",
|
|
36
|
-
"file": "Файл",
|
|
36
|
+
"mark": "Выделенный",
|
|
37
37
|
"math": "Формула",
|
|
38
|
-
"math_inline": "Формула в тексте",
|
|
39
38
|
"math_block": "Блок с формулой",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"colorify__color_gray": "Серый",
|
|
44
|
-
"colorify__color_yellow": "Жёлтый",
|
|
45
|
-
"colorify__color_orange": "Оранжевый",
|
|
46
|
-
"colorify__color_red": "Красный",
|
|
47
|
-
"colorify__color_green": "Зелёный",
|
|
48
|
-
"colorify__color_blue": "Синий",
|
|
49
|
-
"colorify__color_violet": "Фиолетовый",
|
|
39
|
+
"math_inline": "Формула в тексте",
|
|
40
|
+
"mermaid": "Mermaid",
|
|
41
|
+
"mono": "Моноширинный",
|
|
50
42
|
"more_action": "Другие действия",
|
|
43
|
+
"note": "Примечание",
|
|
44
|
+
"olist": "Нумерованный список",
|
|
45
|
+
"quote": "Цитата",
|
|
46
|
+
"redo": "Повторить",
|
|
47
|
+
"strike": "Зачеркивание",
|
|
48
|
+
"table": "Таблица",
|
|
51
49
|
"tabs": "Табы",
|
|
52
|
-
"
|
|
50
|
+
"text": "Текст",
|
|
51
|
+
"ulist": "Маркированный список",
|
|
52
|
+
"underline": "Подчеркивание",
|
|
53
|
+
"undo": "Отменить"
|
|
53
54
|
}
|
|
@@ -2,4 +2,4 @@ import MermaidIcon from './Mermaid';
|
|
|
2
2
|
import MonoIcon from './Mono';
|
|
3
3
|
import TabsIcon from './Tabs';
|
|
4
4
|
export { MermaidIcon, MonoIcon, TabsIcon };
|
|
5
|
-
export { ArrowUturnCcwLeft as UndoIcon, ArrowUturnCwRight as RedoIcon, Bold as BoldIcon, Italic as ItalicIcon, Underline as UnderlineIcon, Strikethrough as StrikethroughIcon, FontCursor as MarkIcon, Text as TextIcon, Heading as HeadingIcon, Heading1 as Heading1Icon, Heading2 as Heading2Icon, Heading3 as Heading3Icon, Heading4 as Heading4Icon, Heading5 as Heading5Icon, Heading6 as Heading6Icon, ListUl as ListBlIcon, ListOl as ListOlIcon, TextOutdent as LiftIcon, TextIndent as SinkIcon, Font as TextColorIcon, Link as LinkIcon, QuoteClose as QuoteIcon, Scissors as CutIcon, Sticker as NoteIcon, Paperclip as FileIcon, Minus as HRuleIcon, LayoutList as TableIcon, ChevronsExpandHorizontal as IframeIcon, SquareCheck as CheckListIcon, Picture as ImageIcon, Person as UserIcon, FaceSmile as EmojiIcon, Code as CodeInlineIcon, FileCode as CodeBlockIcon, Function as FunctionInlineIcon, CurlyBracketsFunction as FunctionBlockIcon, Hashtag as AnchorIcon, SquareDashedText as BlockIcon, LayoutColumns3 as LayoutIcon, Pencil as DrawIoIcon, } from '@gravity-ui/icons';
|
|
5
|
+
export { ArrowUturnCcwLeft as UndoIcon, ArrowUturnCwRight as RedoIcon, Bold as BoldIcon, Italic as ItalicIcon, Underline as UnderlineIcon, Strikethrough as StrikethroughIcon, FontCursor as MarkIcon, Text as TextIcon, Heading as HeadingIcon, Heading1 as Heading1Icon, Heading2 as Heading2Icon, Heading3 as Heading3Icon, Heading4 as Heading4Icon, Heading5 as Heading5Icon, Heading6 as Heading6Icon, ListUl as ListBlIcon, ListOl as ListOlIcon, TextOutdent as LiftIcon, TextIndent as SinkIcon, Font as TextColorIcon, Link as LinkIcon, QuoteClose as QuoteIcon, Scissors as CutIcon, Sticker as NoteIcon, Paperclip as FileIcon, Minus as HRuleIcon, LayoutList as TableIcon, ChevronsExpandHorizontal as IframeIcon, SquareCheck as CheckListIcon, Picture as ImageIcon, Person as UserIcon, FaceSmile as EmojiIcon, Code as CodeInlineIcon, FileCode as CodeBlockIcon, Function as FunctionInlineIcon, CurlyBracketsFunction as FunctionBlockIcon, Hashtag as AnchorIcon, SquareDashedText as BlockIcon, LayoutColumns3 as LayoutIcon, Pencil as DrawIoIcon, FolderCode as HtmlBlockIcon, } from '@gravity-ui/icons';
|
package/build/cjs/icons/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DrawIoIcon = exports.LayoutIcon = exports.BlockIcon = exports.AnchorIcon = exports.FunctionBlockIcon = exports.FunctionInlineIcon = exports.CodeBlockIcon = exports.CodeInlineIcon = exports.EmojiIcon = exports.UserIcon = exports.ImageIcon = exports.CheckListIcon = exports.IframeIcon = exports.TableIcon = exports.HRuleIcon = exports.FileIcon = exports.NoteIcon = exports.CutIcon = exports.QuoteIcon = exports.LinkIcon = exports.TextColorIcon = exports.SinkIcon = exports.LiftIcon = exports.ListOlIcon = exports.ListBlIcon = exports.Heading6Icon = exports.Heading5Icon = exports.Heading4Icon = exports.Heading3Icon = exports.Heading2Icon = exports.Heading1Icon = exports.HeadingIcon = exports.TextIcon = exports.MarkIcon = exports.StrikethroughIcon = exports.UnderlineIcon = exports.ItalicIcon = exports.BoldIcon = exports.RedoIcon = exports.UndoIcon = exports.TabsIcon = exports.MonoIcon = exports.MermaidIcon = void 0;
|
|
3
|
+
exports.HtmlBlockIcon = exports.DrawIoIcon = exports.LayoutIcon = exports.BlockIcon = exports.AnchorIcon = exports.FunctionBlockIcon = exports.FunctionInlineIcon = exports.CodeBlockIcon = exports.CodeInlineIcon = exports.EmojiIcon = exports.UserIcon = exports.ImageIcon = exports.CheckListIcon = exports.IframeIcon = exports.TableIcon = exports.HRuleIcon = exports.FileIcon = exports.NoteIcon = exports.CutIcon = exports.QuoteIcon = exports.LinkIcon = exports.TextColorIcon = exports.SinkIcon = exports.LiftIcon = exports.ListOlIcon = exports.ListBlIcon = exports.Heading6Icon = exports.Heading5Icon = exports.Heading4Icon = exports.Heading3Icon = exports.Heading2Icon = exports.Heading1Icon = exports.HeadingIcon = exports.TextIcon = exports.MarkIcon = exports.StrikethroughIcon = exports.UnderlineIcon = exports.ItalicIcon = exports.BoldIcon = exports.RedoIcon = exports.UndoIcon = exports.TabsIcon = exports.MonoIcon = exports.MermaidIcon = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Mermaid_1 = tslib_1.__importDefault(require("./Mermaid"));
|
|
6
6
|
exports.MermaidIcon = Mermaid_1.default;
|
|
@@ -61,3 +61,4 @@ Object.defineProperty(exports, "BlockIcon", { enumerable: true, get: function ()
|
|
|
61
61
|
Object.defineProperty(exports, "LayoutIcon", { enumerable: true, get: function () { return icons_1.LayoutColumns3; } });
|
|
62
62
|
//
|
|
63
63
|
Object.defineProperty(exports, "DrawIoIcon", { enumerable: true, get: function () { return icons_1.Pencil; } });
|
|
64
|
+
Object.defineProperty(exports, "HtmlBlockIcon", { enumerable: true, get: function () { return icons_1.FolderCode; } });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.insertMermaidDiagram = exports.insertHRule = exports.wrapToCheckbox = exports.wrapToBlockquote = void 0;
|
|
3
|
+
exports.insertYfmHtmlBlock = exports.insertMermaidDiagram = exports.insertHRule = exports.wrapToCheckbox = exports.wrapToBlockquote = void 0;
|
|
4
4
|
const helpers_1 = require("./helpers");
|
|
5
5
|
exports.wrapToBlockquote = (0, helpers_1.wrapPerLine)({ beforeText: '> ', skipEmptyLine: false });
|
|
6
6
|
exports.wrapToCheckbox = (0, helpers_1.wrapPerLine)({ beforeText: '[ ] ' });
|
|
@@ -22,3 +22,14 @@ sequenceDiagram
|
|
|
22
22
|
return true;
|
|
23
23
|
};
|
|
24
24
|
exports.insertMermaidDiagram = insertMermaidDiagram;
|
|
25
|
+
const insertYfmHtmlBlock = ({ state, dispatch }) => {
|
|
26
|
+
const markup = `::: html
|
|
27
|
+
|
|
28
|
+
<div>Add HTML code here</div>
|
|
29
|
+
|
|
30
|
+
:::`;
|
|
31
|
+
const tr = (0, helpers_1.replaceOrInsertAfter)(state, markup);
|
|
32
|
+
dispatch(state.update(tr));
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
exports.insertYfmHtmlBlock = insertYfmHtmlBlock;
|
package/build/cjs/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
4
|
/** During build process, the current version will be injected here */
|
|
5
|
-
exports.VERSION = typeof '13.
|
|
5
|
+
exports.VERSION = typeof '13.4.0' !== 'undefined' ? '13.4.0' : 'unknown';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ClassNameProps } from '../../../classname';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type YfmStaticViewProps = ClassNameProps & {
|
|
4
4
|
html: string;
|
|
5
5
|
linksVisited?: boolean;
|
|
6
6
|
noListReset?: boolean;
|
|
7
7
|
qa?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const YfmStaticView: React.ForwardRefExoticComponent<ClassNameProps & {
|
|
10
10
|
html: string;
|
|
11
11
|
linksVisited?: boolean | undefined;
|
|
12
12
|
noListReset?: boolean | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.YfmStaticView = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
const classnames_1 = require("@bem-react/classnames");
|
|
7
|
-
exports.
|
|
7
|
+
exports.YfmStaticView = (0, react_1.forwardRef)(function YFMStaticView(props, ref) {
|
|
8
8
|
const { html, linksVisited, noListReset, className, qa } = props;
|
|
9
9
|
return (react_1.default.createElement("div", { ref: ref, dangerouslySetInnerHTML: { __html: html }, className: (0, classnames_1.classnames)('yfm', linksVisited ? 'yfm_links-visited' : undefined, noListReset ? 'yfm_no-list-reset' : undefined, className), "data-qa": qa }));
|
|
10
10
|
});
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import type { YfmStaticViewProps as OriginalYfmStaticViewProps } from './YfmStaticView';
|
|
2
|
+
import { YfmStaticView as OriginalYfmStaticView } from './YfmStaticView';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated use type `YFMStaticViewProps` instead
|
|
5
|
+
*/
|
|
6
|
+
export declare type YfmHtmlProps = OriginalYfmStaticViewProps;
|
|
7
|
+
export declare type YFMStaticViewProps = OriginalYfmStaticViewProps;
|
|
8
|
+
export { OriginalYfmStaticView as YfmStaticView };
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use component `YfmStaticView` instead
|
|
11
|
+
*/
|
|
12
|
+
export { OriginalYfmStaticView as YfmHtml };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
exports.YfmHtml = exports.YfmStaticView = void 0;
|
|
4
|
+
const YfmStaticView_1 = require("./YfmStaticView");
|
|
5
|
+
Object.defineProperty(exports, "YfmStaticView", { enumerable: true, get: function () { return YfmStaticView_1.YfmStaticView; } });
|
|
6
|
+
Object.defineProperty(exports, "YfmHtml", { enumerable: true, get: function () { return YfmStaticView_1.YfmStaticView; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ComponentType, RefAttributes } from 'react';
|
|
2
|
+
import { IHTMLIFrameElementConfig } from '@diplodoc/html-extension/runtime';
|
|
3
|
+
import type { PluginRuntime, TransformMeta } from '../withMermaid/types';
|
|
4
|
+
export declare type WithYfmHtmlBlockOptions = {
|
|
5
|
+
runtime: PluginRuntime;
|
|
6
|
+
};
|
|
7
|
+
export declare type WithYfmHtmlBlockProps = {
|
|
8
|
+
meta: TransformMeta;
|
|
9
|
+
yfmHtmlBlockConfig?: IHTMLIFrameElementConfig;
|
|
10
|
+
};
|
|
11
|
+
export declare function withYfmHtmlBlock(opts: WithYfmHtmlBlockOptions): <T extends {
|
|
12
|
+
html: string;
|
|
13
|
+
}>(Component: React.ComponentType<T & React.RefAttributes<HTMLDivElement>>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<T & WithYfmHtmlBlockProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withYfmHtmlBlock = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_2 = require("@diplodoc/html-extension/react");
|
|
7
|
+
const useYfmHtmlBlockRuntime_1 = require("./useYfmHtmlBlockRuntime");
|
|
8
|
+
function withYfmHtmlBlock(opts) {
|
|
9
|
+
return (Component) => (0, react_1.forwardRef)(function WithYfmHtml(props, ref) {
|
|
10
|
+
const { meta, html, yfmHtmlBlockConfig } = props;
|
|
11
|
+
(0, useYfmHtmlBlockRuntime_1.useYfmHtmlBlockRuntime)(meta, opts.runtime);
|
|
12
|
+
const yfmHtmlBlock = (0, react_2.useDiplodocHtml)();
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
if (yfmHtmlBlock) {
|
|
15
|
+
if (yfmHtmlBlockConfig) {
|
|
16
|
+
yfmHtmlBlock.setConfig(yfmHtmlBlockConfig);
|
|
17
|
+
}
|
|
18
|
+
yfmHtmlBlock.reinitialize();
|
|
19
|
+
}
|
|
20
|
+
}, [yfmHtmlBlock, html, yfmHtmlBlockConfig]);
|
|
21
|
+
return react_1.default.createElement(Component, Object.assign({}, props, { ref: ref }));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.withYfmHtmlBlock = withYfmHtmlBlock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useYfmHtmlBlockRuntime = void 0;
|
|
27
|
+
/** @internal */
|
|
28
|
+
function useYfmHtmlBlockRuntime(meta, runtime = '_assets/html-extension.js') {
|
|
29
|
+
var _a;
|
|
30
|
+
if ((_a = meta === null || meta === void 0 ? void 0 : meta.script) === null || _a === void 0 ? void 0 : _a.includes(runtime)) {
|
|
31
|
+
Promise.resolve().then(() => __importStar(require(/* webpackChunkName: "yfm-html-runtime" */ '@diplodoc/html-extension/runtime')));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.useYfmHtmlBlockRuntime = useYfmHtmlBlockRuntime;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const YfmHtmlBlockStyles: {
|
|
2
|
+
colorTextPrimary: string;
|
|
3
|
+
colorTextSecondary: string;
|
|
4
|
+
colorBackground: string;
|
|
5
|
+
colorBackgroundSecondary: string;
|
|
6
|
+
colorLink: string;
|
|
7
|
+
colorLinkHover: string;
|
|
8
|
+
colorLinkVisited: string;
|
|
9
|
+
font: string;
|
|
10
|
+
fontSize: string;
|
|
11
|
+
fontFamily: string;
|
|
12
|
+
lineHeight: string;
|
|
13
|
+
};
|
|
14
|
+
declare type Styles = Partial<Record<keyof typeof YfmHtmlBlockStyles, string>>;
|
|
15
|
+
export declare const getYfmHtmlBlockCssVariables: (styles: Styles) => Record<string, string>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getYfmHtmlBlockCssVariables = void 0;
|
|
4
|
+
const YfmHtmlBlockStyles = {
|
|
5
|
+
colorTextPrimary: '--yfm-html-color-text-primary',
|
|
6
|
+
colorTextSecondary: '--yfm-html-color-text-secondary',
|
|
7
|
+
colorBackground: '--yfm-html-color-background',
|
|
8
|
+
colorBackgroundSecondary: '--yfm-html-color-background-secondary',
|
|
9
|
+
colorLink: '--yfm-html-color-link',
|
|
10
|
+
colorLinkHover: '--yfm-html-color-link-hover',
|
|
11
|
+
colorLinkVisited: '--yfm-html-color-link-visited',
|
|
12
|
+
font: '--yfm-html-font',
|
|
13
|
+
fontSize: '--yfm-html-font-size',
|
|
14
|
+
fontFamily: '--yfm-html-font-family',
|
|
15
|
+
lineHeight: '--yfm-html-line-height', // Line height of the text
|
|
16
|
+
};
|
|
17
|
+
const getYfmHtmlBlockCssVariables = (styles) => {
|
|
18
|
+
const obj = {};
|
|
19
|
+
for (const key of Object.keys(styles)) {
|
|
20
|
+
if (YfmHtmlBlockStyles[key]) {
|
|
21
|
+
obj[YfmHtmlBlockStyles[key]] = styles[key];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return obj;
|
|
25
|
+
};
|
|
26
|
+
exports.getYfmHtmlBlockCssVariables = getYfmHtmlBlockCssVariables;
|
|
@@ -6,6 +6,7 @@ export declare type HorizontalDragProps = {
|
|
|
6
6
|
rightElRef: React.RefObject<HTMLDivElement>;
|
|
7
7
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
8
8
|
editor: EditorInt;
|
|
9
|
+
onEndMove?: (right: HTMLDivElement | null, left: HTMLDivElement | null) => any;
|
|
9
10
|
};
|
|
10
11
|
declare const HorizontalDragWrapper: React.FC<HorizontalDragProps & {
|
|
11
12
|
isMounted: boolean;
|
|
@@ -44,7 +44,7 @@ const useColResize = ({ onStart, onMove, onEnd }) => {
|
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
-
const HorizontalDrag = ({ leftElRef, rightElRef, wrapperRef, editor, }) => {
|
|
47
|
+
const HorizontalDrag = ({ leftElRef, rightElRef, wrapperRef, editor, onEndMove, }) => {
|
|
48
48
|
var _a, _b, _c, _d;
|
|
49
49
|
const cm = editor.cm;
|
|
50
50
|
const [lCardWidth, lSetCardWidth] = useState(((_b = (_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0) / 2);
|
|
@@ -96,6 +96,7 @@ const HorizontalDrag = ({ leftElRef, rightElRef, wrapperRef, editor, }) => {
|
|
|
96
96
|
cm.requestMeasure();
|
|
97
97
|
(_b = rightElRef.current) === null || _b === void 0 ? void 0 : _b.classList.remove(IN_RESIZE_CLASSNAME);
|
|
98
98
|
(_c = leftElRef.current) === null || _c === void 0 ? void 0 : _c.classList.remove(IN_RESIZE_CLASSNAME);
|
|
99
|
+
onEndMove === null || onEndMove === void 0 ? void 0 : onEndMove(rightElRef.current, leftElRef.current);
|
|
99
100
|
}, [calculateWidth, cm, leftElRef, rightElRef, updateWidth, wrapperRef]);
|
|
100
101
|
const { listeners } = useColResize({ onStart, onMove, onEnd });
|
|
101
102
|
return (React.createElement("div", Object.assign({ className: cnEditorComponent('resizer', { horizontal: true }) }, listeners),
|