@expensify/react-native-live-markdown 0.1.186 → 0.1.187
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/android/src/main/new_arch/CMakeLists.txt +0 -2
- package/lib/commonjs/MarkdownTextInput.js +3 -3
- package/lib/commonjs/MarkdownTextInput.js.map +1 -1
- package/lib/commonjs/MarkdownTextInput.web.js +5 -3
- package/lib/commonjs/MarkdownTextInput.web.js.map +1 -1
- package/lib/commonjs/MarkdownTextInputDecoratorViewNativeComponent.js +1 -1
- package/lib/commonjs/MarkdownTextInputDecoratorViewNativeComponent.js.map +1 -1
- package/lib/commonjs/NativeLiveMarkdownModule.js.map +1 -1
- package/lib/commonjs/commonTypes.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/react-native-web.d.js.map +1 -1
- package/lib/commonjs/styleUtils.js.map +1 -1
- package/lib/commonjs/web/InputHistory.js.map +1 -1
- package/lib/commonjs/web/inputElements/inlineImage.js.map +1 -1
- package/lib/commonjs/web/inputElements/loadingIndicator.js.map +1 -1
- package/lib/commonjs/web/utils/animationUtils.js.map +1 -1
- package/lib/commonjs/web/utils/blockUtils.js.map +1 -1
- package/lib/commonjs/web/utils/browserUtils.js.map +1 -1
- package/lib/commonjs/web/utils/cursorUtils.js.map +1 -1
- package/lib/commonjs/web/utils/inputUtils.js.map +1 -1
- package/lib/commonjs/web/utils/parserUtils.js +1 -1
- package/lib/commonjs/web/utils/parserUtils.js.map +1 -1
- package/lib/commonjs/web/utils/treeUtils.js.map +1 -1
- package/lib/commonjs/web/utils/webStyleUtils.js.map +1 -1
- package/lib/module/MarkdownTextInput.js +2 -2
- package/lib/module/MarkdownTextInput.js.map +1 -1
- package/lib/module/MarkdownTextInput.web.js +3 -1
- package/lib/module/MarkdownTextInput.web.js.map +1 -1
- package/lib/module/MarkdownTextInputDecoratorViewNativeComponent.js.map +1 -1
- package/lib/module/NativeLiveMarkdownModule.js.map +1 -1
- package/lib/module/commonTypes.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/react-native-web.d.js.map +1 -1
- package/lib/module/styleUtils.js.map +1 -1
- package/lib/module/web/InputHistory.js.map +1 -1
- package/lib/module/web/inputElements/inlineImage.js.map +1 -1
- package/lib/module/web/inputElements/loadingIndicator.js.map +1 -1
- package/lib/module/web/utils/animationUtils.js.map +1 -1
- package/lib/module/web/utils/blockUtils.js.map +1 -1
- package/lib/module/web/utils/browserUtils.js.map +1 -1
- package/lib/module/web/utils/cursorUtils.js.map +1 -1
- package/lib/module/web/utils/inputUtils.js.map +1 -1
- package/lib/module/web/utils/parserUtils.js +1 -1
- package/lib/module/web/utils/parserUtils.js.map +1 -1
- package/lib/module/web/utils/treeUtils.js.map +1 -1
- package/lib/module/web/utils/webStyleUtils.js.map +1 -1
- package/lib/parser/react-native-live-markdown-parser.js +19 -19
- package/lib/typescript/src/MarkdownTextInput.web.d.ts.map +1 -1
- package/lib/typescript/src/MarkdownTextInputDecoratorViewNativeComponent.d.ts +0 -1
- package/lib/typescript/src/MarkdownTextInputDecoratorViewNativeComponent.d.ts.map +1 -1
- package/package.json +9 -15
- package/parser/react-native-live-markdown-parser.js +19 -19
- package/src/MarkdownTextInput.web.tsx +5 -4
- package/src/web/utils/parserUtils.ts +1 -1
|
@@ -275,7 +275,7 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
|
|
|
275
275
|
);
|
|
276
276
|
|
|
277
277
|
const handleOnSelect = useCallback(
|
|
278
|
-
(e) => {
|
|
278
|
+
(e: React.SyntheticEvent<HTMLDivElement>) => {
|
|
279
279
|
updateSelection(e);
|
|
280
280
|
|
|
281
281
|
// If the input has just been focused, we need to scroll the cursor into view
|
|
@@ -576,7 +576,7 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
|
|
|
576
576
|
}, []);
|
|
577
577
|
|
|
578
578
|
const handleCut = useCallback(
|
|
579
|
-
(e) => {
|
|
579
|
+
(e: React.ClipboardEvent<HTMLDivElement>) => {
|
|
580
580
|
if (!divRef.current || !contentSelection.current) {
|
|
581
581
|
return;
|
|
582
582
|
}
|
|
@@ -589,7 +589,7 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
|
|
|
589
589
|
);
|
|
590
590
|
|
|
591
591
|
const handlePaste = useCallback(
|
|
592
|
-
(e) => {
|
|
592
|
+
(e: React.ClipboardEvent<HTMLDivElement>) => {
|
|
593
593
|
if (e.isDefaultPrevented() || !divRef.current || !contentSelection.current) {
|
|
594
594
|
return;
|
|
595
595
|
}
|
|
@@ -606,7 +606,7 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
|
|
|
606
606
|
}, []);
|
|
607
607
|
|
|
608
608
|
const endComposition = useCallback(
|
|
609
|
-
(e) => {
|
|
609
|
+
(e: React.CompositionEvent<HTMLDivElement>) => {
|
|
610
610
|
compositionRef.current = false;
|
|
611
611
|
handleOnChangeText(e);
|
|
612
612
|
},
|
|
@@ -741,6 +741,7 @@ const MarkdownTextInput = React.forwardRef<MarkdownTextInput, MarkdownTextInputP
|
|
|
741
741
|
onCopy={handleCopy}
|
|
742
742
|
onCut={handleCut}
|
|
743
743
|
onPaste={handlePaste}
|
|
744
|
+
// @ts-expect-error: we use placeholder prop to style it in CSS even though its not handled internally
|
|
744
745
|
placeholder={heightSafePlaceholder}
|
|
745
746
|
spellCheck={spellCheck}
|
|
746
747
|
dir={dir}
|
|
@@ -117,7 +117,7 @@ function addTextToElement(node: TreeNode, text: string) {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
function addParagraph(node: TreeNode, text: string | null
|
|
120
|
+
function addParagraph(node: TreeNode, text: string | null, length: number, disableInlineStyles = false) {
|
|
121
121
|
const p = document.createElement('p');
|
|
122
122
|
p.setAttribute('data-type', 'line');
|
|
123
123
|
if (!disableInlineStyles) {
|