@expensify/react-native-live-markdown 0.1.87 → 0.1.89
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/lib/commonjs/MarkdownTextInput.web.js +9 -3
- package/lib/commonjs/MarkdownTextInput.web.js.map +1 -1
- package/lib/module/MarkdownTextInput.web.js +9 -3
- package/lib/module/MarkdownTextInput.web.js.map +1 -1
- package/lib/parser/react-native-live-markdown-parser.js +21 -33
- package/lib/typescript/src/MarkdownTextInput.web.d.ts.map +1 -1
- package/package.json +5 -2
- package/parser/react-native-live-markdown-parser.js +21 -33
- package/src/MarkdownTextInput.web.tsx +8 -2
|
@@ -166,6 +166,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
166
166
|
value,
|
|
167
167
|
autoFocus = false,
|
|
168
168
|
onContentSizeChange,
|
|
169
|
+
id,
|
|
169
170
|
},
|
|
170
171
|
ref,
|
|
171
172
|
) => {
|
|
@@ -240,7 +241,9 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
240
241
|
|
|
241
242
|
const undo = useCallback(
|
|
242
243
|
(target: HTMLDivElement) => {
|
|
243
|
-
if (!history.current)
|
|
244
|
+
if (!history.current) {
|
|
245
|
+
return '';
|
|
246
|
+
}
|
|
244
247
|
const item = history.current.undo();
|
|
245
248
|
const undoValue = item ? denormalizeValue(item.text) : null;
|
|
246
249
|
return parseText(target, undoValue, processedMarkdownStyle, item ? item.cursorPosition : null, false).text;
|
|
@@ -250,7 +253,9 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
250
253
|
|
|
251
254
|
const redo = useCallback(
|
|
252
255
|
(target: HTMLDivElement) => {
|
|
253
|
-
if (!history.current)
|
|
256
|
+
if (!history.current) {
|
|
257
|
+
return '';
|
|
258
|
+
}
|
|
254
259
|
const item = history.current.redo();
|
|
255
260
|
const redoValue = item ? denormalizeValue(item.text) : null;
|
|
256
261
|
return parseText(target, redoValue, processedMarkdownStyle, item ? item.cursorPosition : null, false).text;
|
|
@@ -609,6 +614,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
|
|
|
609
614
|
return (
|
|
610
615
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
611
616
|
<div
|
|
617
|
+
id={id}
|
|
612
618
|
ref={setRef}
|
|
613
619
|
contentEditable={!disabled}
|
|
614
620
|
style={inputStyles}
|