@uiw/react-md-editor 4.1.4 → 4.1.5
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/README.md +1 -1
- package/dist/mdeditor.js +2 -2
- package/dist/mdeditor.min.js +1 -1
- package/esm/components/TextArea/Textarea.js +0 -1
- package/esm/components/TextArea/factory.js +0 -1
- package/lib/components/TextArea/Textarea.js +0 -1
- package/lib/components/TextArea/factory.js +0 -1
- package/package.json +1 -1
- package/src/components/TextArea/Textarea.tsx +0 -1
- package/src/components/TextArea/factory.tsx +0 -1
package/README.md
CHANGED
|
@@ -1191,6 +1191,7 @@ As always, thanks to our amazing contributors!
|
|
|
1191
1191
|
<a href="https://github.com/alpharomercoma" title="Alpha Romer Coma"><img src="https://avatars.githubusercontent.com/u/108984668?v=4" width="42;" alt="Alpha Romer Coma"/></a>
|
|
1192
1192
|
<a href="https://github.com/Exmirai" title="UniqueUlysees"><img src="https://avatars.githubusercontent.com/u/6436703?v=4" width="42;" alt="UniqueUlysees"/></a>
|
|
1193
1193
|
<a href="https://github.com/BetterAndBetterII" title="Yuzhong Zhang"><img src="https://avatars.githubusercontent.com/u/141388234?v=4" width="42;" alt="Yuzhong Zhang"/></a>
|
|
1194
|
+
<a href="https://github.com/hiyouwhatsapp" title="hiyouwhatsapp"><img src="https://avatars.githubusercontent.com/u/89997383?v=4" width="42;" alt="hiyouwhatsapp"/></a>
|
|
1194
1195
|
<a href="https://github.com/sandiiarov" title="Alex Sandiiarov"><img src="https://avatars.githubusercontent.com/u/15861257?v=4" width="42;" alt="Alex Sandiiarov"/></a>
|
|
1195
1196
|
<a href="https://github.com/nuragic" title="Andrea Puddu"><img src="https://avatars.githubusercontent.com/u/1586378?v=4" width="42;" alt="Andrea Puddu"/></a>
|
|
1196
1197
|
<a href="https://github.com/AntonR31337" title="Anton"><img src="https://avatars.githubusercontent.com/u/88384647?v=4" width="42;" alt="Anton"/></a>
|
|
@@ -1208,7 +1209,6 @@ As always, thanks to our amazing contributors!
|
|
|
1208
1209
|
<a href="https://github.com/rami-maalouf" title="Rami Maalouf"><img src="https://avatars.githubusercontent.com/u/81759594?v=4" width="42;" alt="Rami Maalouf"/></a>
|
|
1209
1210
|
<a href="https://github.com/toresbe" title="Tore Sinding Bekkedal"><img src="https://avatars.githubusercontent.com/u/1761606?v=4" width="42;" alt="Tore Sinding Bekkedal"/></a>
|
|
1210
1211
|
<a href="https://github.com/valenfv" title="Valentin"><img src="https://avatars.githubusercontent.com/u/34139820?v=4" width="42;" alt="Valentin"/></a>
|
|
1211
|
-
<a href="https://github.com/hiyouwhatsapp" title="hiyouwhatsapp"><img src="https://avatars.githubusercontent.com/u/89997383?v=4" width="42;" alt="hiyouwhatsapp"/></a>
|
|
1212
1212
|
<a href="https://github.com/jmtes" title="juno tesoro"><img src="https://avatars.githubusercontent.com/u/38450133?v=4" width="42;" alt="juno tesoro"/></a>
|
|
1213
1213
|
<a href="https://github.com/juspky" title="juspky"><img src="https://avatars.githubusercontent.com/u/11074890?v=4" width="42;" alt="juspky"/></a>
|
|
1214
1214
|
<a href="https://github.com/ryicoh" title="ryicoh"><img src="https://avatars.githubusercontent.com/u/37844673?v=4" width="42;" alt="ryicoh"/></a>
|
package/dist/mdeditor.js
CHANGED
|
@@ -77811,11 +77811,11 @@ stopPropagation(e);var selection={start:target.selectionStart,end:target.selecti
|
|
|
77811
77811
|
var Textarea_excluded=["prefixCls","onChange"],_excluded2=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function Textarea(props){var prefixCls=props.prefixCls,_onChange=props.onChange,other=_objectWithoutProperties(props,Textarea_excluded);var _useContext=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useContext)(EditorContext),markdown=_useContext.markdown,commands=_useContext.commands,fullscreen=_useContext.fullscreen,preview=_useContext.preview,highlightEnable=_useContext.highlightEnable,extraCommands=_useContext.extraCommands,tabSize=_useContext.tabSize,defaultTabEnable=_useContext.defaultTabEnable,autoFocusEnd=_useContext.autoFocusEnd,textareaWarp=_useContext.textareaWarp,dispatch=_useContext.dispatch,otherStore=_objectWithoutProperties(_useContext,_excluded2);var textRef=(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().useRef)(null);var executeRef=(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().useRef)();var statesRef=(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().useRef)({fullscreen:fullscreen,preview:preview});(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useEffect)(function(){statesRef.current={fullscreen:fullscreen,preview:preview,highlightEnable:highlightEnable};},[fullscreen,preview,highlightEnable]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useEffect)(function(){if(textRef.current&&dispatch){var commandOrchestrator=new TextAreaCommandOrchestrator(textRef.current);executeRef.current=commandOrchestrator;dispatch({textarea:textRef.current,commandOrchestrator:commandOrchestrator});}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77812
77812
|
},[]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useEffect)(function(){if(autoFocusEnd&&textRef.current&&textareaWarp){textRef.current.focus();var length=textRef.current.value.length;textRef.current.setSelectionRange(length,length);setTimeout(function(){if(textareaWarp){textareaWarp.scrollTop=textareaWarp.scrollHeight;}if(textRef.current){textRef.current.scrollTop=textRef.current.scrollHeight;}},0);}},[textareaWarp]);var onKeyDown=function onKeyDown(e){handleKeyDown(e,tabSize,defaultTabEnable);shortcutsHandle(e,[].concat(_toConsumableArray(commands||[]),_toConsumableArray(extraCommands||[])),executeRef.current,dispatch,statesRef.current);};(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useEffect)(function(){if(textRef.current){textRef.current.addEventListener('keydown',onKeyDown);}return function(){if(textRef.current){// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77813
77813
|
textRef.current.removeEventListener('keydown',onKeyDown);}};// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77814
|
-
},[]);return/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)("textarea",_objectSpread2(_objectSpread2({autoComplete:"off",
|
|
77814
|
+
},[]);return/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)("textarea",_objectSpread2(_objectSpread2({autoComplete:"off",autoCapitalize:"off",spellCheck:false},other),{},{ref:textRef,className:"".concat(prefixCls,"-text-input ").concat(other.className?other.className:''),value:markdown,onChange:function onChange(e){dispatch&&dispatch({markdown:e.target.value});_onChange&&_onChange(e);}}));}
|
|
77815
77815
|
;// ./src/components/TextArea/factory.tsx
|
|
77816
77816
|
var factory_excluded=["prefixCls","className","onScroll","renderTextarea"];function createTextArea(options){var _options$useMinHeight;var MarkdownComponent=options===null||options===void 0?void 0:options.Markdown;var useMinHeight=(_options$useMinHeight=options===null||options===void 0?void 0:options.useMinHeight)!==null&&_options$useMinHeight!==void 0?_options$useMinHeight:false;return function TextArea(props){var _ref=props||{},prefixCls=_ref.prefixCls,className=_ref.className,onScroll=_ref.onScroll,renderTextarea=_ref.renderTextarea,otherProps=_objectWithoutProperties(_ref,factory_excluded);var _useContext=(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useContext)(EditorContext),markdown=_useContext.markdown,scrollTop=_useContext.scrollTop,commands=_useContext.commands,minHeight=_useContext.minHeight,highlightEnable=_useContext.highlightEnable,extraCommands=_useContext.extraCommands,dispatch=_useContext.dispatch;var textRef=(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().useRef)(null);var executeRef=(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().useRef)();var warp=/*#__PURE__*/(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().createRef)();(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useEffect)(function(){var state={};if(warp.current){state.textareaWarp=warp.current||undefined;warp.current.scrollTop=scrollTop||0;}if(dispatch){dispatch(_objectSpread2({},state));}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77817
77817
|
},[]);(0,external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().useEffect)(function(){if(textRef.current&&dispatch){var commandOrchestrator=new TextAreaCommandOrchestrator(textRef.current);executeRef.current=commandOrchestrator;dispatch({textarea:textRef.current,commandOrchestrator:commandOrchestrator});}// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
77818
|
-
},[]);var textStyle=MarkdownComponent&&highlightEnable?{}:{WebkitTextFillColor:'initial',overflow:'auto'};return/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)("div",{ref:warp,className:"".concat(prefixCls,"-area ").concat(className||''),onScroll:onScroll,children:/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)("div",{className:"".concat(prefixCls,"-text"),style:useMinHeight?{minHeight:minHeight}:undefined,children:renderTextarea?(/*#__PURE__*/(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().cloneElement)(renderTextarea(_objectSpread2(_objectSpread2({},otherProps),{},{value:markdown,autoComplete:'off',
|
|
77818
|
+
},[]);var textStyle=MarkdownComponent&&highlightEnable?{}:{WebkitTextFillColor:'initial',overflow:'auto'};return/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)("div",{ref:warp,className:"".concat(prefixCls,"-area ").concat(className||''),onScroll:onScroll,children:/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)("div",{className:"".concat(prefixCls,"-text"),style:useMinHeight?{minHeight:minHeight}:undefined,children:renderTextarea?(/*#__PURE__*/(external_root_React_commonjs2_react_commonjs_react_amd_react_default()().cloneElement)(renderTextarea(_objectSpread2(_objectSpread2({},otherProps),{},{value:markdown,autoComplete:'off',spellCheck:'false',autoCapitalize:'off',className:"".concat(prefixCls,"-text-input"),style:{WebkitTextFillColor:'inherit',overflow:'auto'}}),{dispatch:dispatch,onChange:otherProps.onChange,shortcuts:shortcutsHandle,useContext:{commands:commands,extraCommands:extraCommands,commandOrchestrator:executeRef.current}}),{ref:textRef})):/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsxs)((external_root_React_commonjs2_react_commonjs_react_amd_react_namespaceFn().Fragment),{children:[MarkdownComponent&&highlightEnable&&/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)(MarkdownComponent,{prefixCls:prefixCls}),/*#__PURE__*/(0,react_jsx_runtime_production_min_namespaceFn().jsx)(Textarea,_objectSpread2(_objectSpread2({prefixCls:prefixCls},otherProps),{},{style:textStyle}))]})})});};}
|
|
77819
77819
|
;// ./src/components/TextArea/index.tsx
|
|
77820
77820
|
/* harmony default export */ const components_TextArea = (createTextArea({Markdown:Markdown_Markdown,useMinHeight:true}));
|
|
77821
77821
|
;// ../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|