@cloud-ru/ds-markdown 1.0.2-preview-ad4a761f.0 → 1.0.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.0.2 (2026-08-20)
7
+
8
+ **Note:** Version bump only for package @ds/markdown
9
+
6
10
  ## 1.0.1 (2026-08-18)
7
11
 
8
12
  **Note:** Version bump only for package @ds/markdown
@@ -172,5 +172,5 @@ function MarkdownEditor({ value, defaultValue, onChange, preview, defaultPreview
172
172
  }
173
173
  }, [previewMode, editor]);
174
174
  const toolbarNode = toolbarItems && toolbarApi ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.toolbarSlot, children: (0, jsx_runtime_1.jsx)(Toolbar_1.Toolbar, { api: toolbarApi, items: toolbarItems }) })) : undefined;
175
- return ((0, jsx_runtime_1.jsxs)("div", { ...supportProps, className: (0, classnames_1.default)(styles_module_scss_1.default.root, syntax_module_scss_1.default.syntax, className), "data-test-id": dataTestId, "data-preview": previewMode || undefined, children: [showHeader && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, "data-test-id": constants_1.TEST_IDS.editorHeader, children: [(0, jsx_runtime_1.jsxs)("label", { className: styles_module_scss_1.default.previewToggle, children: [(0, jsx_runtime_1.jsx)(toggles_1.Switch, { size: 's', checked: previewMode, onChange: setPreview, "data-test-id": constants_1.TEST_IDS.editorPreviewToggle }), (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.previewToggleLabel, children: previewLabel })] }), label && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.label, "data-test-id": constants_1.TEST_IDS.editorLabel, children: label }))] })), (0, jsx_runtime_1.jsx)(fields_1.FieldShell, { "data-test-id": constants_1.TEST_IDS.editorField, header: toolbarNode, focusVisible: previewFocusVisible, hover: previewHover, onMouseEnter: () => setPreviewHover(true), onMouseLeave: () => setPreviewHover(false), children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.contentArea, onClick: handleContentClick, onFocus: handlePreviewFocus, onBlur: handlePreviewBlur, children: [(0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.resizeBox, size: 's', resize: resizable ? 'vertical' : 'none', overflow: { x: 'hidden' }, children: previewMode ? ((0, jsx_runtime_1.jsx)(react_1.EditorContent, { ref: editorContentRef, editor: editor, className: styles_module_scss_1.default.content, "data-test-id": constants_1.TEST_IDS.editorContent, spellCheck: spellCheck })) : ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.rawInputWrapper, children: (0, jsx_runtime_1.jsx)(react_textarea_autosize_1.default, { ref: textareaRef, className: styles_module_scss_1.default.rawInput, "data-test-id": constants_1.TEST_IDS.editorRawInput, value: currentValue ?? '', onChange: handleRawValueChange, placeholder: placeholder, spellCheck: spellCheck }) })) }), hasValue && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.postfix, children: (0, jsx_runtime_1.jsx)(button_1.Button, { view: 'function', appearance: 'neutral', size: 'm', icon: (0, jsx_runtime_1.jsx)(system_1.CrossSVG, {}), "data-test-id": constants_1.TEST_IDS.editorClear, "aria-label": t('clear'), onClick: handleClearButtonClick }) }))] }) })] }));
175
+ return ((0, jsx_runtime_1.jsxs)("div", { ...supportProps, className: (0, classnames_1.default)(styles_module_scss_1.default.root, syntax_module_scss_1.default.syntax, className), "data-test-id": dataTestId, "data-preview": previewMode || undefined, children: [showHeader && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, "data-test-id": constants_1.TEST_IDS.editorHeader, children: [(0, jsx_runtime_1.jsxs)("label", { className: styles_module_scss_1.default.previewToggle, children: [(0, jsx_runtime_1.jsx)(toggles_1.Switch, { size: 's', checked: previewMode, onChange: setPreview, "data-test-id": constants_1.TEST_IDS.editorPreviewToggle }), (0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.previewToggleLabel, children: previewLabel })] }), label && ((0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.label, "data-test-id": constants_1.TEST_IDS.editorLabel, children: label }))] })), (0, jsx_runtime_1.jsx)(fields_1.FieldShell, { "data-test-id": constants_1.TEST_IDS.editorField, header: toolbarNode, focusVisible: previewFocusVisible, hover: previewHover, onMouseEnter: () => setPreviewHover(true), onMouseLeave: () => setPreviewHover(false), children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.contentArea, onClick: handleContentClick, onFocus: handlePreviewFocus, onBlur: handlePreviewBlur, children: [(0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.resizeBox, size: 's', resize: resizable ? 'vertical' : 'none', overflow: { x: 'hidden' }, children: previewMode ? ((0, jsx_runtime_1.jsx)(react_1.EditorContent, { ref: editorContentRef, editor: editor, className: styles_module_scss_1.default.content, "data-test-id": constants_1.TEST_IDS.editorContent, spellCheck: spellCheck })) : ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.rawInputWrapper, children: (0, jsx_runtime_1.jsx)(react_textarea_autosize_1.default, { ref: textareaRef, className: styles_module_scss_1.default.rawInput, "data-test-id": constants_1.TEST_IDS.editorRawInput, value: currentValue ?? '', onChange: handleRawValueChange, placeholder: placeholder, spellCheck: spellCheck }) })) }), hasValue && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.postfix, children: (0, jsx_runtime_1.jsx)(button_1.Button, { view: 'function', appearance: 'neutral', size: 'm', icon: (0, jsx_runtime_1.jsx)(system_1.CrossCircleSVG, {}), "data-test-id": constants_1.TEST_IDS.editorClear, "aria-label": t('clear'), onClick: handleClearButtonClick }) }))] }) })] }));
176
176
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from '@cloud-ru/ds-button';
3
3
  import { FieldShell } from '@cloud-ru/ds-fields';
4
- import { CrossSVG } from '@cloud-ru/ds-icons/interface/system';
4
+ import { CrossCircleSVG } from '@cloud-ru/ds-icons/interface/system';
5
5
  import { Scroll } from '@cloud-ru/ds-scroll';
6
6
  import { Switch } from '@cloud-ru/ds-toggles';
7
7
  import { extractSupportProps, isBrowser, useDebounce, useValueControl } from '@cloud-ru/ds-utils';
@@ -166,5 +166,5 @@ export function MarkdownEditor({ value, defaultValue, onChange, preview, default
166
166
  }
167
167
  }, [previewMode, editor]);
168
168
  const toolbarNode = toolbarItems && toolbarApi ? (_jsx("div", { className: styles.toolbarSlot, children: _jsx(Toolbar, { api: toolbarApi, items: toolbarItems }) })) : undefined;
169
- return (_jsxs("div", { ...supportProps, className: cn(styles.root, syntaxStyles.syntax, className), "data-test-id": dataTestId, "data-preview": previewMode || undefined, children: [showHeader && (_jsxs("div", { className: styles.header, "data-test-id": TEST_IDS.editorHeader, children: [_jsxs("label", { className: styles.previewToggle, children: [_jsx(Switch, { size: 's', checked: previewMode, onChange: setPreview, "data-test-id": TEST_IDS.editorPreviewToggle }), _jsx("span", { className: styles.previewToggleLabel, children: previewLabel })] }), label && (_jsx("span", { className: styles.label, "data-test-id": TEST_IDS.editorLabel, children: label }))] })), _jsx(FieldShell, { "data-test-id": TEST_IDS.editorField, header: toolbarNode, focusVisible: previewFocusVisible, hover: previewHover, onMouseEnter: () => setPreviewHover(true), onMouseLeave: () => setPreviewHover(false), children: _jsxs("div", { className: styles.contentArea, onClick: handleContentClick, onFocus: handlePreviewFocus, onBlur: handlePreviewBlur, children: [_jsx(Scroll, { className: styles.resizeBox, size: 's', resize: resizable ? 'vertical' : 'none', overflow: { x: 'hidden' }, children: previewMode ? (_jsx(EditorContent, { ref: editorContentRef, editor: editor, className: styles.content, "data-test-id": TEST_IDS.editorContent, spellCheck: spellCheck })) : (_jsx("div", { className: styles.rawInputWrapper, children: _jsx(TextareaAutosize, { ref: textareaRef, className: styles.rawInput, "data-test-id": TEST_IDS.editorRawInput, value: currentValue ?? '', onChange: handleRawValueChange, placeholder: placeholder, spellCheck: spellCheck }) })) }), hasValue && (_jsx("div", { className: styles.postfix, children: _jsx(Button, { view: 'function', appearance: 'neutral', size: 'm', icon: _jsx(CrossSVG, {}), "data-test-id": TEST_IDS.editorClear, "aria-label": t('clear'), onClick: handleClearButtonClick }) }))] }) })] }));
169
+ return (_jsxs("div", { ...supportProps, className: cn(styles.root, syntaxStyles.syntax, className), "data-test-id": dataTestId, "data-preview": previewMode || undefined, children: [showHeader && (_jsxs("div", { className: styles.header, "data-test-id": TEST_IDS.editorHeader, children: [_jsxs("label", { className: styles.previewToggle, children: [_jsx(Switch, { size: 's', checked: previewMode, onChange: setPreview, "data-test-id": TEST_IDS.editorPreviewToggle }), _jsx("span", { className: styles.previewToggleLabel, children: previewLabel })] }), label && (_jsx("span", { className: styles.label, "data-test-id": TEST_IDS.editorLabel, children: label }))] })), _jsx(FieldShell, { "data-test-id": TEST_IDS.editorField, header: toolbarNode, focusVisible: previewFocusVisible, hover: previewHover, onMouseEnter: () => setPreviewHover(true), onMouseLeave: () => setPreviewHover(false), children: _jsxs("div", { className: styles.contentArea, onClick: handleContentClick, onFocus: handlePreviewFocus, onBlur: handlePreviewBlur, children: [_jsx(Scroll, { className: styles.resizeBox, size: 's', resize: resizable ? 'vertical' : 'none', overflow: { x: 'hidden' }, children: previewMode ? (_jsx(EditorContent, { ref: editorContentRef, editor: editor, className: styles.content, "data-test-id": TEST_IDS.editorContent, spellCheck: spellCheck })) : (_jsx("div", { className: styles.rawInputWrapper, children: _jsx(TextareaAutosize, { ref: textareaRef, className: styles.rawInput, "data-test-id": TEST_IDS.editorRawInput, value: currentValue ?? '', onChange: handleRawValueChange, placeholder: placeholder, spellCheck: spellCheck }) })) }), hasValue && (_jsx("div", { className: styles.postfix, children: _jsx(Button, { view: 'function', appearance: 'neutral', size: 'm', icon: _jsx(CrossCircleSVG, {}), "data-test-id": TEST_IDS.editorClear, "aria-label": t('clear'), onClick: handleClearButtonClick }) }))] }) })] }));
170
170
  }