@uiw/react-md-editor 3.9.5 → 3.9.6

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 CHANGED
@@ -465,10 +465,14 @@ npm run start # Preview code example.
465
465
 
466
466
  ## Contributors
467
467
 
468
+ As always, thanks to our amazing contributors!
469
+
468
470
  <a href="https://github.com/uiwjs/react-md-editor/graphs/contributors">
469
471
  <img src="https://uiwjs.github.io/react-md-editor/CONTRIBUTORS.svg" />
470
472
  </a>
471
473
 
474
+ Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).
475
+
472
476
  ### License
473
477
 
474
478
  Licensed under the MIT License.
package/dist/mdeditor.js CHANGED
@@ -36536,12 +36536,15 @@ function isPlainObject(value) {
36536
36536
 
36537
36537
 
36538
36538
  /**
36539
- * @typedef {(error?: Error|null|undefined, ...output: any[]) => void} Callback
36540
- * @typedef {(...input: any[]) => any} Middleware
36539
+ * @typedef {(error?: Error|null|undefined, ...output: Array<any>) => void} Callback
36540
+ * @typedef {(...input: Array<any>) => any} Middleware
36541
36541
  *
36542
- * @typedef {(...input: any[]) => void} Run Call all middleware.
36543
- * @typedef {(fn: Middleware) => Pipeline} Use Add `fn` (middleware) to the list.
36542
+ * @typedef {(...input: Array<any>) => void} Run
36543
+ * Call all middleware.
36544
+ * @typedef {(fn: Middleware) => Pipeline} Use
36545
+ * Add `fn` (middleware) to the list.
36544
36546
  * @typedef {{run: Run, use: Use}} Pipeline
36547
+ * Middleware.
36545
36548
  */
36546
36549
 
36547
36550
  /**
@@ -36550,7 +36553,7 @@ function isPlainObject(value) {
36550
36553
  * @returns {Pipeline}
36551
36554
  */
36552
36555
  function trough() {
36553
- /** @type {Middleware[]} */
36556
+ /** @type {Array<Middleware>} */
36554
36557
  var fns = [];
36555
36558
  /** @type {Pipeline} */
36556
36559
 
@@ -36580,7 +36583,7 @@ function trough() {
36580
36583
  * Run the next `fn`, or we’re done.
36581
36584
  *
36582
36585
  * @param {Error|null|undefined} error
36583
- * @param {any[]} output
36586
+ * @param {Array<any>} output
36584
36587
  */
36585
36588
 
36586
36589
  function next(error) {
@@ -36640,7 +36643,8 @@ function wrap(middleware, callback) {
36640
36643
  return wrapped;
36641
36644
  /**
36642
36645
  * Call `middleware`.
36643
- * @param {any[]} parameters
36646
+ * @this {any}
36647
+ * @param {Array<any>} parameters
36644
36648
  * @returns {void}
36645
36649
  */
36646
36650
 
@@ -36659,10 +36663,11 @@ function wrap(middleware, callback) {
36659
36663
  }
36660
36664
 
36661
36665
  try {
36662
- result = middleware.apply(void 0, parameters);
36666
+ result = middleware.apply(this, parameters);
36663
36667
  } catch (error) {
36668
+ var exception =
36664
36669
  /** @type {Error} */
36665
- var exception = error; // Well, this is quite the pickle.
36670
+ error; // Well, this is quite the pickle.
36666
36671
  // `middleware` received a callback and called it synchronously, but that
36667
36672
  // threw an error.
36668
36673
  // The only thing left to do is to throw the thing instead.
@@ -73261,6 +73266,16 @@ var InternalMDEditor = function InternalMDEditor(props, ref) {
73261
73266
  }
73262
73267
  };
73263
73268
 
73269
+ var mdPreview = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
73270
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(esm, _extends({}, previewOptions, {
73271
+ onScroll: function onScroll(e) {
73272
+ return handleScroll(e, 'preview');
73273
+ },
73274
+ ref: previewRef,
73275
+ source: state.markdown || '',
73276
+ className: prefixCls + "-preview " + (previewOptions.className || '')
73277
+ }));
73278
+ }, [prefixCls, previewOptions, state.markdown]);
73264
73279
  return /*#__PURE__*/(0,jsx_runtime.jsx)(EditorContext.Provider, {
73265
73280
  value: _extends({}, state, {
73266
73281
  dispatch: dispatch
@@ -73301,14 +73316,7 @@ var InternalMDEditor = function InternalMDEditor(props, ref) {
73301
73316
  onScroll: function onScroll(e) {
73302
73317
  return handleScroll(e, 'text');
73303
73318
  }
73304
- })), /(live|preview)/.test(state.preview || '') && /*#__PURE__*/(0,jsx_runtime.jsx)(esm, _extends({}, previewOptions, {
73305
- onScroll: function onScroll(e) {
73306
- return handleScroll(e, 'preview');
73307
- },
73308
- ref: previewRef,
73309
- source: state.markdown || '',
73310
- className: prefixCls + "-preview " + (previewOptions.className || '')
73311
- }))]
73319
+ })), /(live|preview)/.test(state.preview || '') && mdPreview]
73312
73320
  }), visiableDragbar && !state.fullscreen && /*#__PURE__*/(0,jsx_runtime.jsx)(components_DragBar, {
73313
73321
  prefixCls: prefixCls,
73314
73322
  height: state.height,