@skbkontur/markdown 1.6.0 → 1.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skbkontur/markdown",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -12,5 +12,7 @@ export interface MarkdownEditorProps extends Omit<TextareaProps, 'rows' | 'maxRo
12
12
  textareaRef?: RefObject<Textarea>;
13
13
  /** Стандартная валидация из react-ui-validations */
14
14
  validationInfo?: Nullable<ValidationInfo>;
15
+ /** Обернуть в ValidationWrapper из react-ui-validations */
16
+ withValidationWrapper?: boolean;
15
17
  }
16
18
  export declare const MarkdownEditor: FC<MarkdownEditorProps>;
@@ -26,9 +26,9 @@ import React from 'react';
26
26
  import { useDropzone } from 'react-dropzone';
27
27
  import { createMarkdownHelpKeyDownHandler } from './MarkdownHelpers/markdownHelpers';
28
28
  export var MarkdownEditor = function (props) {
29
- var _a = props.resize, resize = _a === void 0 ? 'none' : _a, _b = props.width, width = _b === void 0 ? '100%' : _b, _c = props.autoResize, autoResize = _c === void 0 ? true : _c, _d = props.showLengthCounter, propsShowLengthCounter = _d === void 0 ? true : _d, textareaRef = props.textareaRef, validationInfo = props.validationInfo, renderMessage = props.renderMessage, rest = __rest(props, ["resize", "width", "autoResize", "showLengthCounter", "textareaRef", "validationInfo", "renderMessage"]);
29
+ var _a = props.resize, resize = _a === void 0 ? 'none' : _a, _b = props.width, width = _b === void 0 ? '100%' : _b, _c = props.autoResize, autoResize = _c === void 0 ? true : _c, _d = props.showLengthCounter, propsShowLengthCounter = _d === void 0 ? true : _d, textareaRef = props.textareaRef, validationInfo = props.validationInfo, renderMessage = props.renderMessage, withValidationWrapper = props.withValidationWrapper, rest = __rest(props, ["resize", "width", "autoResize", "showLengthCounter", "textareaRef", "validationInfo", "renderMessage", "withValidationWrapper"]);
30
30
  var getInputProps = useDropzone().getInputProps;
31
- return validationInfo ? (React.createElement(ValidationWrapper, { validationInfo: validationInfo, renderMessage: renderMessage }, renderTextarea())) : (renderTextarea());
31
+ return withValidationWrapper ? (React.createElement(ValidationWrapper, { validationInfo: validationInfo, renderMessage: renderMessage }, renderTextarea())) : (renderTextarea());
32
32
  function renderTextarea() {
33
33
  return (React.createElement(Textarea, __assign({ ref: textareaRef, id: "MarkdownTextArea" }, rest, getInputProps, { resize: resize, width: width, showLengthCounter: showLengthCounter(), autoResize: autoResize, onKeyDown: createMarkdownHelpKeyDownHandler(props.value || '', textareaRef, props.onKeyDown) })));
34
34
  }