@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.
Files changed (55) hide show
  1. package/android/src/main/new_arch/CMakeLists.txt +0 -2
  2. package/lib/commonjs/MarkdownTextInput.js +3 -3
  3. package/lib/commonjs/MarkdownTextInput.js.map +1 -1
  4. package/lib/commonjs/MarkdownTextInput.web.js +5 -3
  5. package/lib/commonjs/MarkdownTextInput.web.js.map +1 -1
  6. package/lib/commonjs/MarkdownTextInputDecoratorViewNativeComponent.js +1 -1
  7. package/lib/commonjs/MarkdownTextInputDecoratorViewNativeComponent.js.map +1 -1
  8. package/lib/commonjs/NativeLiveMarkdownModule.js.map +1 -1
  9. package/lib/commonjs/commonTypes.js.map +1 -1
  10. package/lib/commonjs/index.js +1 -1
  11. package/lib/commonjs/index.js.map +1 -1
  12. package/lib/commonjs/react-native-web.d.js.map +1 -1
  13. package/lib/commonjs/styleUtils.js.map +1 -1
  14. package/lib/commonjs/web/InputHistory.js.map +1 -1
  15. package/lib/commonjs/web/inputElements/inlineImage.js.map +1 -1
  16. package/lib/commonjs/web/inputElements/loadingIndicator.js.map +1 -1
  17. package/lib/commonjs/web/utils/animationUtils.js.map +1 -1
  18. package/lib/commonjs/web/utils/blockUtils.js.map +1 -1
  19. package/lib/commonjs/web/utils/browserUtils.js.map +1 -1
  20. package/lib/commonjs/web/utils/cursorUtils.js.map +1 -1
  21. package/lib/commonjs/web/utils/inputUtils.js.map +1 -1
  22. package/lib/commonjs/web/utils/parserUtils.js +1 -1
  23. package/lib/commonjs/web/utils/parserUtils.js.map +1 -1
  24. package/lib/commonjs/web/utils/treeUtils.js.map +1 -1
  25. package/lib/commonjs/web/utils/webStyleUtils.js.map +1 -1
  26. package/lib/module/MarkdownTextInput.js +2 -2
  27. package/lib/module/MarkdownTextInput.js.map +1 -1
  28. package/lib/module/MarkdownTextInput.web.js +3 -1
  29. package/lib/module/MarkdownTextInput.web.js.map +1 -1
  30. package/lib/module/MarkdownTextInputDecoratorViewNativeComponent.js.map +1 -1
  31. package/lib/module/NativeLiveMarkdownModule.js.map +1 -1
  32. package/lib/module/commonTypes.js.map +1 -1
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/react-native-web.d.js.map +1 -1
  35. package/lib/module/styleUtils.js.map +1 -1
  36. package/lib/module/web/InputHistory.js.map +1 -1
  37. package/lib/module/web/inputElements/inlineImage.js.map +1 -1
  38. package/lib/module/web/inputElements/loadingIndicator.js.map +1 -1
  39. package/lib/module/web/utils/animationUtils.js.map +1 -1
  40. package/lib/module/web/utils/blockUtils.js.map +1 -1
  41. package/lib/module/web/utils/browserUtils.js.map +1 -1
  42. package/lib/module/web/utils/cursorUtils.js.map +1 -1
  43. package/lib/module/web/utils/inputUtils.js.map +1 -1
  44. package/lib/module/web/utils/parserUtils.js +1 -1
  45. package/lib/module/web/utils/parserUtils.js.map +1 -1
  46. package/lib/module/web/utils/treeUtils.js.map +1 -1
  47. package/lib/module/web/utils/webStyleUtils.js.map +1 -1
  48. package/lib/parser/react-native-live-markdown-parser.js +19 -19
  49. package/lib/typescript/src/MarkdownTextInput.web.d.ts.map +1 -1
  50. package/lib/typescript/src/MarkdownTextInputDecoratorViewNativeComponent.d.ts +0 -1
  51. package/lib/typescript/src/MarkdownTextInputDecoratorViewNativeComponent.d.ts.map +1 -1
  52. package/package.json +9 -15
  53. package/parser/react-native-live-markdown-parser.js +19 -19
  54. package/src/MarkdownTextInput.web.tsx +5 -4
  55. 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 = null, length: number, disableInlineStyles = false) {
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) {