@cloudbase/weda-ui 3.11.6 → 3.11.8

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.
@@ -86,7 +86,7 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
86
86
  const [editorHeight, setEditorHeight] = React.useState(0);
87
87
  const [syncedValue] = useSyncValue(xss(value, getWhitelist()));
88
88
  const [currentMap, setCurrentMap] = React.useState({});
89
- const [currentCursor, setCurrentCursor] = React.useState(0);
89
+ const [currentCursor, setCurrentCursor] = React.useState(undefined);
90
90
  const [toolbar, setToolbar] = React.useState(platform === 'h5' ? toolbarArrayH5.join(' ') : toolbarPC);
91
91
  const ref = React.useRef({});
92
92
  const editorDomRef = React.useRef(null);
@@ -314,7 +314,9 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
314
314
  ref.current.editor.setHTML(tempValue);
315
315
  }
316
316
  window.setTimeout(() => {
317
- ref.current.editor.selection(currentCursor, currentCursor);
317
+ if (currentCursor) {
318
+ ref.current.editor.selection(currentCursor, currentCursor);
319
+ }
318
320
  }, 0);
319
321
  }
320
322
  }, [syncedValue, ref.current.editor]);
@@ -110,3 +110,7 @@
110
110
  .weda-RichTextView i {
111
111
  font-style: italic;
112
112
  }
113
+
114
+ .weda-RichTextView p {
115
+ min-height: 1em;
116
+ }
@@ -1,3 +1,4 @@
1
+ /// <reference types="moment" />
1
2
  /// <reference types="react" />
2
3
  import type { DataType } from '../../../../configs/components/wd-date';
3
4
  type IDateValue = number | string | moment.Moment;
@@ -81,33 +81,33 @@ export const WdText = forwardRef(function WdText({ className, style, id, level:
81
81
  case 'title-1':
82
82
  return (_jsx("h1", { className: classNames(classes, className), style: inlineStyle, id: id,
83
83
  //@ts-expect-error contentEditable type def sucks
84
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
84
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
85
85
  case 'title-2':
86
86
  return (_jsx("h2", { className: classNames(classes, className), style: inlineStyle, id: id,
87
87
  //@ts-expect-error contentEditable type def sucks
88
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
88
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
89
89
  case 'title-3':
90
90
  return (_jsx("h3", { className: classNames(classes, className), style: inlineStyle, id: id,
91
91
  //@ts-expect-error contentEditable type def sucks
92
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
92
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
93
93
  case 'title-4':
94
94
  return (_jsx("h4", { className: classNames(classes, className), style: inlineStyle, id: id,
95
95
  //@ts-expect-error contentEditable type def sucks
96
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
96
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
97
97
  case 'title-5':
98
98
  return (_jsx("h5", { className: classNames(classes, className), style: inlineStyle, id: id,
99
99
  //@ts-expect-error contentEditable type def sucks
100
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
100
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
101
101
  case 'title-6':
102
102
  case 'title-7':
103
103
  case 'title-8':
104
104
  case 'title-9':
105
105
  return (_jsx("h6", { className: classNames(classes, className), style: inlineStyle, id: id,
106
106
  //@ts-expect-error contentEditable type def sucks
107
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
107
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
108
108
  default:
109
109
  return (_jsx("p", { className: classNames(classes, className), style: inlineStyle, id: id,
110
110
  //@ts-expect-error contentEditable type def sucks
111
- contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
111
+ contentEditable: contenteditable, onInput: onInput, onBlur: onBlur, title: tips ? textToString(text) : '', onClick: (e) => events === null || events === void 0 ? void 0 : events.tap({}, { originEvent: e }), ...propsStartWithOn, children: textToString(text) }));
112
112
  }
113
113
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/weda-ui",
3
- "version": "3.11.6",
3
+ "version": "3.11.8",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index",
6
6
  "miniprogram": "mpdist",
@@ -117,7 +117,7 @@
117
117
  "markdown-it": "^14.1.0",
118
118
  "markdown-it-code-copy": "^0.1.2",
119
119
  "mobx": "^5.15.4",
120
- "moment": "^2.29.4",
120
+ "moment": "^2.24.0",
121
121
  "object.fromentries": "^2.0.7",
122
122
  "prop-types": "^15.7.2",
123
123
  "qrcode.react": "^3.1.0",