@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.
Files changed (106) hide show
  1. package/build/cjs/bundle/HorizontalDrag.d.ts +1 -0
  2. package/build/cjs/bundle/HorizontalDrag.js +2 -1
  3. package/build/cjs/bundle/config/action-names.d.ts +1 -1
  4. package/build/cjs/bundle/config/action-names.js +1 -0
  5. package/build/cjs/bundle/config/icons.d.ts +1 -1
  6. package/build/cjs/bundle/config/icons.js +1 -0
  7. package/build/cjs/bundle/config/markup.d.ts +1 -0
  8. package/build/cjs/bundle/config/markup.js +10 -1
  9. package/build/cjs/bundle/config/wysiwyg.d.ts +1 -0
  10. package/build/cjs/bundle/config/wysiwyg.js +12 -1
  11. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.d.ts +23 -0
  12. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.js +57 -0
  13. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlock.css +66 -0
  14. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.d.ts +17 -0
  15. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.js +178 -0
  16. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.d.ts +1 -0
  17. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.js +4 -0
  18. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.d.ts +15 -0
  19. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.js +20 -0
  20. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.d.ts +10 -0
  21. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.js +43 -0
  22. package/build/cjs/extensions/yfm/YfmHtmlBlock/actions.d.ts +2 -0
  23. package/build/cjs/extensions/yfm/YfmHtmlBlock/actions.js +15 -0
  24. package/build/cjs/extensions/yfm/YfmHtmlBlock/const.d.ts +2 -0
  25. package/build/cjs/extensions/yfm/YfmHtmlBlock/const.js +6 -0
  26. package/build/cjs/extensions/yfm/YfmHtmlBlock/index.d.ts +14 -0
  27. package/build/cjs/extensions/yfm/YfmHtmlBlock/index.js +17 -0
  28. package/build/cjs/extensions/yfm/index.d.ts +1 -1
  29. package/build/cjs/extensions/yfm/index.js +1 -1
  30. package/build/cjs/i18n/common/en.json +6 -2
  31. package/build/cjs/i18n/common/index.d.ts +7 -3
  32. package/build/cjs/i18n/common/ru.json +6 -2
  33. package/build/cjs/i18n/menubar/en.json +37 -36
  34. package/build/cjs/i18n/menubar/index.d.ts +38 -37
  35. package/build/cjs/i18n/menubar/ru.json +37 -36
  36. package/build/cjs/icons/index.d.ts +1 -1
  37. package/build/cjs/icons/index.js +2 -1
  38. package/build/cjs/markup/commands/blocks.d.ts +1 -0
  39. package/build/cjs/markup/commands/blocks.js +12 -1
  40. package/build/cjs/version.js +1 -1
  41. package/build/cjs/view/components/YfmHtml/{YfmHtml.d.ts → YfmStaticView.d.ts} +2 -2
  42. package/build/cjs/view/components/YfmHtml/{YfmHtml.js → YfmStaticView.js} +2 -2
  43. package/build/cjs/view/components/YfmHtml/index.d.ts +12 -1
  44. package/build/cjs/view/components/YfmHtml/index.js +4 -2
  45. package/build/cjs/view/hocs/withYfmHtml/index.d.ts +13 -0
  46. package/build/cjs/view/hocs/withYfmHtml/index.js +24 -0
  47. package/build/cjs/view/hocs/withYfmHtml/types.d.ts +3 -0
  48. package/build/cjs/view/hocs/withYfmHtml/types.js +2 -0
  49. package/build/cjs/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.d.ts +1 -0
  50. package/build/cjs/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.js +34 -0
  51. package/build/cjs/view/hocs/withYfmHtml/utils.d.ts +16 -0
  52. package/build/cjs/view/hocs/withYfmHtml/utils.js +26 -0
  53. package/build/esm/bundle/HorizontalDrag.d.ts +1 -0
  54. package/build/esm/bundle/HorizontalDrag.js +2 -1
  55. package/build/esm/bundle/config/action-names.d.ts +1 -1
  56. package/build/esm/bundle/config/action-names.js +1 -0
  57. package/build/esm/bundle/config/icons.d.ts +1 -1
  58. package/build/esm/bundle/config/icons.js +2 -1
  59. package/build/esm/bundle/config/markup.d.ts +1 -0
  60. package/build/esm/bundle/config/markup.js +10 -1
  61. package/build/esm/bundle/config/wysiwyg.d.ts +1 -0
  62. package/build/esm/bundle/config/wysiwyg.js +11 -0
  63. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.d.ts +23 -0
  64. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/NodeView.js +52 -0
  65. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlock.css +66 -0
  66. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.d.ts +18 -0
  67. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.js +173 -0
  68. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.d.ts +1 -0
  69. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/index.js +1 -0
  70. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.d.ts +15 -0
  71. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/const.js +17 -0
  72. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.d.ts +10 -0
  73. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.js +39 -0
  74. package/build/esm/extensions/yfm/YfmHtmlBlock/actions.d.ts +2 -0
  75. package/build/esm/extensions/yfm/YfmHtmlBlock/actions.js +12 -0
  76. package/build/esm/extensions/yfm/YfmHtmlBlock/const.d.ts +2 -0
  77. package/build/esm/extensions/yfm/YfmHtmlBlock/const.js +2 -0
  78. package/build/esm/extensions/yfm/YfmHtmlBlock/index.d.ts +14 -0
  79. package/build/esm/extensions/yfm/YfmHtmlBlock/index.js +13 -0
  80. package/build/esm/extensions/yfm/index.d.ts +1 -1
  81. package/build/esm/extensions/yfm/index.js +1 -1
  82. package/build/esm/i18n/common/en.json +6 -2
  83. package/build/esm/i18n/common/index.d.ts +7 -3
  84. package/build/esm/i18n/common/ru.json +6 -2
  85. package/build/esm/i18n/menubar/en.json +37 -36
  86. package/build/esm/i18n/menubar/index.d.ts +38 -37
  87. package/build/esm/i18n/menubar/ru.json +37 -36
  88. package/build/esm/icons/index.d.ts +1 -1
  89. package/build/esm/icons/index.js +1 -1
  90. package/build/esm/markup/commands/blocks.d.ts +1 -0
  91. package/build/esm/markup/commands/blocks.js +10 -0
  92. package/build/esm/version.js +1 -1
  93. package/build/esm/view/components/YfmHtml/{YfmHtml.d.ts → YfmStaticView.d.ts} +2 -2
  94. package/build/esm/view/components/YfmHtml/{YfmHtml.js → YfmStaticView.js} +1 -1
  95. package/build/esm/view/components/YfmHtml/index.d.ts +12 -1
  96. package/build/esm/view/components/YfmHtml/index.js +6 -1
  97. package/build/esm/view/hocs/withYfmHtml/index.d.ts +13 -0
  98. package/build/esm/view/hocs/withYfmHtml/index.js +19 -0
  99. package/build/esm/view/hocs/withYfmHtml/types.d.ts +3 -0
  100. package/build/esm/view/hocs/withYfmHtml/types.js +1 -0
  101. package/build/esm/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.d.ts +1 -0
  102. package/build/esm/view/hocs/withYfmHtml/useYfmHtmlBlockRuntime.js +7 -0
  103. package/build/esm/view/hocs/withYfmHtml/utils.d.ts +16 -0
  104. package/build/esm/view/hocs/withYfmHtml/utils.js +22 -0
  105. package/build/styles.css +66 -0
  106. package/package.json +6 -1
@@ -1,7 +1,11 @@
1
- export declare const i18n: <G extends "toolbar_action_disabled" | "edit" | "delete", S extends string>(key: G | (string extends S ? S : never), params?: {
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
- toolbar_action_disabled: string;
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
- "toolbar_action_disabled": "Несовместимый элемент разметки",
2
+ "cancel": "Отмена",
3
+ "delete": "Удалить",
3
4
  "edit": "Редактировать",
4
- "delete": "Удалить"
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
- "italic": "Italic",
6
- "underline": "Underline",
7
- "strike": "Strikethrough",
8
- "mono": "Monospace",
9
- "mark": "Marked",
10
- "text": "Text",
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
- "checkbox": "Checkbox",
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
- "colorify": "Text color",
41
- "colorify__group_text": "Text",
42
- "colorify__color_default": "Default",
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
- "mermaid": "Mermaid"
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" | "ulist" | "olist" | "list__action_sink" | "list__action_lift" | "list_action_disabled" | "hrule" | "colorify__group_text" | "colorify__color_default" | "colorify__color_gray" | "colorify__color_yellow" | "colorify__color_orange" | "colorify__color_red" | "colorify__color_green" | "colorify__color_blue" | "colorify__color_violet" | "more_action" | "mermaid", S extends string>(key: G | (string extends S ? S : never), params?: {
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
- italic: string;
8
- underline: string;
9
- strike: string;
10
- mono: string;
11
- mark: string;
12
- text: string;
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
- checkbox: string;
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
- colorify: string;
43
- colorify__group_text: string;
44
- colorify__color_default: string;
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
- mermaid: string;
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
- "italic": "Курсив",
6
- "mono": "Моноширинный",
7
- "mark": "Выделенный",
8
- "underline": "Подчеркивание",
9
- "strike": "Зачеркивание",
10
- "text": "Текст",
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
- "checkbox": "Контрольный список",
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
- "colorify": "Цвет текста",
41
- "colorify__group_text": "Текст",
42
- "colorify__color_default": "Стандартный",
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
- "mermaid": "Mermaid"
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';
@@ -26,4 +26,4 @@ Function as FunctionInlineIcon, CurlyBracketsFunction as FunctionBlockIcon,
26
26
  //
27
27
  Hashtag as AnchorIcon, SquareDashedText as BlockIcon, LayoutColumns3 as LayoutIcon,
28
28
  //
29
- Pencil as DrawIoIcon, } from '@gravity-ui/icons';
29
+ Pencil as DrawIoIcon, FolderCode as HtmlBlockIcon, } from '@gravity-ui/icons';
@@ -3,3 +3,4 @@ export declare const wrapToBlockquote: StateCommand;
3
3
  export declare const wrapToCheckbox: StateCommand;
4
4
  export declare const insertHRule: StateCommand;
5
5
  export declare const insertMermaidDiagram: StateCommand;
6
+ export declare const insertYfmHtmlBlock: StateCommand;
@@ -17,3 +17,13 @@ sequenceDiagram
17
17
  dispatch(state.update(tr));
18
18
  return true;
19
19
  };
20
+ export const insertYfmHtmlBlock = ({ state, dispatch }) => {
21
+ const markup = `::: html
22
+
23
+ <div>Add HTML code here</div>
24
+
25
+ :::`;
26
+ const tr = replaceOrInsertAfter(state, markup);
27
+ dispatch(state.update(tr));
28
+ return true;
29
+ };
@@ -1,2 +1,2 @@
1
1
  /** During build process, the current version will be injected here */
2
- export const VERSION = typeof '13.3.0' !== 'undefined' ? '13.3.0' : 'unknown';
2
+ export const 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 YfmHtmlProps = ClassNameProps & {
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 YfmHtml: React.ForwardRefExoticComponent<ClassNameProps & {
9
+ export declare const YfmStaticView: React.ForwardRefExoticComponent<ClassNameProps & {
10
10
  html: string;
11
11
  linksVisited?: boolean | undefined;
12
12
  noListReset?: boolean | undefined;
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { classnames } from '@bem-react/classnames';
3
- export const YfmHtml = forwardRef(function YfmHtml(props, ref) {
3
+ export const YfmStaticView = forwardRef(function YFMStaticView(props, ref) {
4
4
  const { html, linksVisited, noListReset, className, qa } = props;
5
5
  return (React.createElement("div", { ref: ref, dangerouslySetInnerHTML: { __html: html }, className: classnames('yfm', linksVisited ? 'yfm_links-visited' : undefined, noListReset ? 'yfm_no-list-reset' : undefined, className), "data-qa": qa }));
6
6
  });
@@ -1 +1,12 @@
1
- export * from './YfmHtml';
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 +1,6 @@
1
- export * from './YfmHtml';
1
+ import { YfmStaticView as OriginalYfmStaticView } from './YfmStaticView';
2
+ export { OriginalYfmStaticView as YfmStaticView };
3
+ /**
4
+ * @deprecated use component `YfmStaticView` instead
5
+ */
6
+ export { OriginalYfmStaticView as YfmHtml };
@@ -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,19 @@
1
+ import React, { forwardRef, useEffect } from 'react';
2
+ import { useDiplodocHtml } from '@diplodoc/html-extension/react';
3
+ import { useYfmHtmlBlockRuntime } from './useYfmHtmlBlockRuntime';
4
+ export function withYfmHtmlBlock(opts) {
5
+ return (Component) => forwardRef(function WithYfmHtml(props, ref) {
6
+ const { meta, html, yfmHtmlBlockConfig } = props;
7
+ useYfmHtmlBlockRuntime(meta, opts.runtime);
8
+ const yfmHtmlBlock = useDiplodocHtml();
9
+ useEffect(() => {
10
+ if (yfmHtmlBlock) {
11
+ if (yfmHtmlBlockConfig) {
12
+ yfmHtmlBlock.setConfig(yfmHtmlBlockConfig);
13
+ }
14
+ yfmHtmlBlock.reinitialize();
15
+ }
16
+ }, [yfmHtmlBlock, html, yfmHtmlBlockConfig]);
17
+ return React.createElement(Component, Object.assign({}, props, { ref: ref }));
18
+ });
19
+ }
@@ -0,0 +1,3 @@
1
+ import type { PluginOptions } from '@diplodoc/html-extension/plugin/transform';
2
+ export type { TransformMeta } from '../../types';
3
+ export declare type PluginRuntime = PluginOptions['runtimeJsPath'];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ /** @internal */
2
+ export function useYfmHtmlBlockRuntime(meta, runtime = '_assets/html-extension.js') {
3
+ var _a;
4
+ if ((_a = meta === null || meta === void 0 ? void 0 : meta.script) === null || _a === void 0 ? void 0 : _a.includes(runtime)) {
5
+ import(/* webpackChunkName: "yfm-html-runtime" */ '@diplodoc/html-extension/runtime');
6
+ }
7
+ }
@@ -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,22 @@
1
+ const YfmHtmlBlockStyles = {
2
+ colorTextPrimary: '--yfm-html-color-text-primary',
3
+ colorTextSecondary: '--yfm-html-color-text-secondary',
4
+ colorBackground: '--yfm-html-color-background',
5
+ colorBackgroundSecondary: '--yfm-html-color-background-secondary',
6
+ colorLink: '--yfm-html-color-link',
7
+ colorLinkHover: '--yfm-html-color-link-hover',
8
+ colorLinkVisited: '--yfm-html-color-link-visited',
9
+ font: '--yfm-html-font',
10
+ fontSize: '--yfm-html-font-size',
11
+ fontFamily: '--yfm-html-font-family',
12
+ lineHeight: '--yfm-html-line-height', // Line height of the text
13
+ };
14
+ export const getYfmHtmlBlockCssVariables = (styles) => {
15
+ const obj = {};
16
+ for (const key of Object.keys(styles)) {
17
+ if (YfmHtmlBlockStyles[key]) {
18
+ obj[YfmHtmlBlockStyles[key]] = styles[key];
19
+ }
20
+ }
21
+ return obj;
22
+ };
package/build/styles.css CHANGED
@@ -1224,6 +1224,72 @@ img.ProseMirror-separator {
1224
1224
  .g-md-file-placeholder .yfm-file__icon {
1225
1225
  margin-right: 8px;
1226
1226
  }
1227
+ .g-md-yfm-html-block {
1228
+ position: relative;
1229
+ display: flex;
1230
+ justify-content: space-between;
1231
+ margin-bottom: 15px;
1232
+ padding-top: 28px;
1233
+ border: 1px solid var(--g-color-line-generic);
1234
+ border-radius: var(--g-border-radius-m);
1235
+ }
1236
+ .g-md-yfm-html-block_editing {
1237
+ display: flex;
1238
+ padding-top: 0;
1239
+ border: 0;
1240
+ }
1241
+ .g-md-yfm-html-block__label {
1242
+ position: absolute;
1243
+ top: 8px;
1244
+ left: 8px;
1245
+ }
1246
+ .g-md-yfm-html-block__menu {
1247
+ position: absolute;
1248
+ top: 0;
1249
+ right: 0;
1250
+ }
1251
+ .g-md-yfm-html-block__preview {
1252
+ flex: 1;
1253
+ }
1254
+ .g-md-yfm-html-block__error {
1255
+ flex: 1;
1256
+ font-family: var(--g-font-family-monospace);
1257
+ color: var(--g-color-text-danger);
1258
+ }
1259
+ .g-md-yfm-html-block__editor {
1260
+ flex: 1;
1261
+ width: 50%;
1262
+ white-space: nowrap;
1263
+ caret-color: auto;
1264
+ }
1265
+ .g-md-yfm-html-block__editor .g-text-area__content {
1266
+ font-size: 1em;
1267
+ color: var(--yfm-color-hljs-subst);
1268
+ border: 0;
1269
+ border-radius: var(--g-border-radius-m);
1270
+ background: var(--yfm-color-hljs-background);
1271
+ font-feature-settings: normal;
1272
+ }
1273
+ .g-md-yfm-html-block__editor .g-text-area__control.g-md-YfmHtmlBlockHelper {
1274
+ font-family: var(--yfm-font-family-monospace);
1275
+ }
1276
+ .g-md-yfm-html-block__editor-popover {
1277
+ z-index: 1;
1278
+ float: right;
1279
+ }
1280
+ .g-md-yfm-html-block__controls {
1281
+ display: flex;
1282
+ justify-content: end;
1283
+ margin-top: 5px;
1284
+ }
1285
+ .g-md-yfm-html-block__content {
1286
+ flex-grow: 1;
1287
+ }
1288
+
1289
+ .g-root_theme_dark-hc .g-md-yfm-html-block_editing .g-text-area__content,
1290
+ .g-root_theme_dark .g-md-yfm-html-block_editing .g-text-area__content {
1291
+ color: var(--g-color-text-primary);
1292
+ }
1227
1293
  .g-md-code-block-toolbar {
1228
1294
  margin: 2px 8px;
1229
1295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/markdown-editor",
3
- "version": "13.3.0",
3
+ "version": "13.4.0",
4
4
  "description": "Markdown wysiwyg and markup editor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -200,6 +200,7 @@
200
200
  "devDependencies": {
201
201
  "@diplodoc/latex-extension": "1.0.3",
202
202
  "@diplodoc/mermaid-extension": "1.2.1",
203
+ "@diplodoc/html-extension": "1.2.7",
203
204
  "@diplodoc/transform": "4.5.0",
204
205
  "@gravity-ui/components": "3.0.0",
205
206
  "@gravity-ui/eslint-config": "3.1.1",
@@ -256,6 +257,9 @@
256
257
  "@diplodoc/mermaid-extension": {
257
258
  "optional": true
258
259
  },
260
+ "@diplodoc/html-extension": {
261
+ "optional": true
262
+ },
259
263
  "highlight.js": {
260
264
  "optional": true
261
265
  },
@@ -266,6 +270,7 @@
266
270
  "peerDependencies": {
267
271
  "@diplodoc/latex-extension": "^1.0.3",
268
272
  "@diplodoc/mermaid-extension": "^1.0.0",
273
+ "@diplodoc/html-extension": "^1.2.7",
269
274
  "@diplodoc/transform": "^4.5.0",
270
275
  "@gravity-ui/components": "^3.0.0",
271
276
  "@gravity-ui/uikit": "^6.11.0",