@gravity-ui/markdown-editor 13.16.0 → 13.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/build/cjs/extensions/behavior/Resizable/Resizable.css +38 -0
  2. package/build/cjs/extensions/behavior/Resizable/Resizable.d.ts +9 -0
  3. package/build/cjs/extensions/behavior/Resizable/Resizable.js +14 -0
  4. package/build/cjs/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +19 -9
  5. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.css +6 -0
  6. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.d.ts +6 -1
  7. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.js +21 -37
  8. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.d.ts +1 -1
  9. package/build/cjs/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.js +62 -4
  10. package/build/cjs/extensions/yfm/Mermaid/MermaidNodeView/MermaidView.js +8 -7
  11. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.js +31 -9
  12. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.d.ts +1 -1
  13. package/build/cjs/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.js +2 -2
  14. package/build/cjs/extensions/yfm/YfmHtmlBlock/index.d.ts +1 -1
  15. package/build/cjs/i18n/yfm-table/en.json +10 -1
  16. package/build/cjs/i18n/yfm-table/index.d.ts +10 -1
  17. package/build/cjs/i18n/yfm-table/ru.json +10 -1
  18. package/build/cjs/react-utils/useNodeEditing.d.ts +3 -2
  19. package/build/cjs/react-utils/useNodeEditing.js +1 -1
  20. package/build/cjs/react-utils/useNodeResizing.d.ts +22 -0
  21. package/build/cjs/react-utils/useNodeResizing.js +82 -0
  22. package/build/cjs/version.js +1 -1
  23. package/build/cjs/view/hocs/withYfmHtml/index.js +2 -2
  24. package/build/esm/extensions/behavior/Resizable/Resizable.css +38 -0
  25. package/build/esm/extensions/behavior/Resizable/Resizable.d.ts +10 -0
  26. package/build/esm/extensions/behavior/Resizable/Resizable.js +10 -0
  27. package/build/esm/extensions/markdown/Table/plugins/TableCellContextPlugin/index.js +19 -9
  28. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.css +6 -0
  29. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.d.ts +7 -1
  30. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/ImgSettingsButton.js +23 -38
  31. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.d.ts +1 -1
  32. package/build/esm/extensions/yfm/ImgSize/plugins/ImgSizeNodeView/NodeView.js +63 -5
  33. package/build/esm/extensions/yfm/Mermaid/MermaidNodeView/MermaidView.js +5 -4
  34. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockNodeView/YfmHtmlBlockView.js +31 -9
  35. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.d.ts +1 -1
  36. package/build/esm/extensions/yfm/YfmHtmlBlock/YfmHtmlBlockSpecs/index.js +2 -2
  37. package/build/esm/extensions/yfm/YfmHtmlBlock/index.d.ts +1 -1
  38. package/build/esm/i18n/yfm-table/en.json +10 -1
  39. package/build/esm/i18n/yfm-table/index.d.ts +10 -1
  40. package/build/esm/i18n/yfm-table/ru.json +10 -1
  41. package/build/esm/react-utils/useNodeEditing.d.ts +3 -2
  42. package/build/esm/react-utils/useNodeEditing.js +1 -1
  43. package/build/esm/react-utils/useNodeResizing.d.ts +22 -0
  44. package/build/esm/react-utils/useNodeResizing.js +77 -0
  45. package/build/esm/version.js +1 -1
  46. package/build/esm/view/hocs/withYfmHtml/index.js +3 -3
  47. package/build/styles.css +44 -0
  48. package/package.json +4 -4
@@ -1,17 +1,17 @@
1
1
  import React, { forwardRef, useEffect } from 'react';
2
- import { useDiplodocHtml } from '@diplodoc/html-extension/react';
2
+ import { useDiplodocEmbeddedContentController } from '@diplodoc/html-extension/react';
3
3
  import { useYfmHtmlBlockRuntime } from './useYfmHtmlBlockRuntime';
4
4
  export function withYfmHtmlBlock(opts) {
5
5
  return (Component) => forwardRef(function WithYfmHtml(props, ref) {
6
6
  const { meta, html, yfmHtmlBlockConfig } = props;
7
7
  useYfmHtmlBlockRuntime(meta, opts.runtime);
8
- const yfmHtmlBlock = useDiplodocHtml();
8
+ const yfmHtmlBlock = useDiplodocEmbeddedContentController();
9
9
  useEffect(() => {
10
10
  if (yfmHtmlBlock) {
11
11
  if (yfmHtmlBlockConfig) {
12
12
  yfmHtmlBlock.setConfig(yfmHtmlBlockConfig);
13
13
  }
14
- yfmHtmlBlock.reinitialize();
14
+ yfmHtmlBlock.initialize();
15
15
  }
16
16
  }, [yfmHtmlBlock, html, yfmHtmlBlockConfig]);
17
17
  return React.createElement(Component, Object.assign({}, props, { ref: ref }));
package/build/styles.css CHANGED
@@ -823,6 +823,44 @@ img.ProseMirror-separator {
823
823
  animation: placeholder_blink 1s;
824
824
  animation-iteration-count: infinite;
825
825
  }
826
+ body :has(.g-md-resizable_resizing) {
827
+ cursor: col-resize;
828
+ }
829
+
830
+ .g-md-resizable {
831
+ position: relative;
832
+ }
833
+ .g-md-resizable_resizing .g-md-resizable__resizer-wrapper, .g-md-resizable_hover .g-md-resizable__resizer-wrapper {
834
+ position: absolute;
835
+ z-index: 1;
836
+ top: 0;
837
+ display: flex;
838
+ justify-content: center;
839
+ align-items: center;
840
+ width: 20px;
841
+ height: 100%;
842
+ cursor: col-resize;
843
+ pointer-events: auto;
844
+ }
845
+ .g-md-resizable_resizing .g-md-resizable__resizer-wrapper_left, .g-md-resizable_hover .g-md-resizable__resizer-wrapper_left {
846
+ left: 0;
847
+ }
848
+ .g-md-resizable_resizing .g-md-resizable__resizer-wrapper_right, .g-md-resizable_hover .g-md-resizable__resizer-wrapper_right {
849
+ right: 0;
850
+ }
851
+ .g-md-resizable__resizer {
852
+ opacity: 0;
853
+ }
854
+ .g-md-resizable_resizing .g-md-resizable__resizer, .g-md-resizable_hover .g-md-resizable__resizer {
855
+ box-sizing: content-box;
856
+ width: 4px;
857
+ height: 50px;
858
+ max-height: 50%;
859
+ opacity: 1;
860
+ border-radius: 6px;
861
+ background: rgba(127, 127, 127, 0.8);
862
+ transition: opacity 300ms ease-in 0s;
863
+ }
826
864
  .g-md-editor.ProseMirror-focused .pm-node-selected {
827
865
  box-shadow: var(--g-color-text-info) 0 0 0 1px;
828
866
  }
@@ -1391,6 +1429,12 @@ img.ProseMirror-separator {
1391
1429
  position: relative;
1392
1430
  display: inline-block;
1393
1431
  }
1432
+ .g-md-img-settings-button {
1433
+ position: absolute;
1434
+ z-index: 2;
1435
+ top: 3px;
1436
+ right: 3px;
1437
+ }
1394
1438
  .yfm .yfm-note {
1395
1439
  max-width: 1296px;
1396
1440
  margin: 20px 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/markdown-editor",
3
- "version": "13.16.0",
3
+ "version": "13.17.1",
4
4
  "description": "Markdown wysiwyg and markup editor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -200,7 +200,7 @@
200
200
  },
201
201
  "devDependencies": {
202
202
  "@diplodoc/folding-headings-extension": "0.1.0",
203
- "@diplodoc/html-extension": "1.5.0",
203
+ "@diplodoc/html-extension": "2.1.0",
204
204
  "@diplodoc/latex-extension": "1.0.3",
205
205
  "@diplodoc/mermaid-extension": "1.2.1",
206
206
  "@diplodoc/transform": "4.22.0",
@@ -275,10 +275,10 @@
275
275
  },
276
276
  "peerDependencies": {
277
277
  "@diplodoc/folding-headings-extension": "^0.1.0",
278
- "@diplodoc/html-extension": "^1.2.7",
278
+ "@diplodoc/html-extension": "2.1.0",
279
279
  "@diplodoc/latex-extension": "^1.0.3",
280
280
  "@diplodoc/mermaid-extension": "^1.0.0",
281
- "@diplodoc/transform": "^4.5.0",
281
+ "@diplodoc/transform": ">=4.5.0 <4.19.0",
282
282
  "@gravity-ui/components": "^3.0.0",
283
283
  "@gravity-ui/uikit": "^6.11.0",
284
284
  "highlight.js": "^11.8.0",