react-native-marcus 0.1.0 → 0.2.0
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 +220 -63
- package/RNMarcus.podspec +6 -0
- package/android/src/main/java/app/getbullet/marcus/MarcusPackage.kt +2 -1
- package/android/src/main/java/app/getbullet/marcus/MarcusTextDecoratorView.kt +168 -0
- package/android/src/main/java/app/getbullet/marcus/MarcusTextDecoratorViewManager.kt +38 -0
- package/android/src/main/java/app/getbullet/marcus/MarcusTextDecoratorViewManagerSpec.kt +19 -0
- package/android/src/main/java/app/getbullet/marcus/MarcusTextInputDecoratorView.kt +23 -1
- package/android/src/main/java/app/getbullet/marcus/MarkdownBackgroundPainter.kt +147 -0
- package/android/src/main/java/app/getbullet/marcus/MarkdownBackgroundPass.kt +19 -0
- package/android/src/main/java/app/getbullet/marcus/MarkdownCopy.kt +87 -0
- package/android/src/main/java/app/getbullet/marcus/MarkdownFormatter.kt +652 -113
- package/android/src/main/java/app/getbullet/marcus/MarkdownRanges.kt +47 -0
- package/android/src/main/java/app/getbullet/marcus/MarkdownStyle.kt +140 -61
- package/android/src/main/java/app/getbullet/marcus/MarkdownUtils.kt +37 -7
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownAbsoluteLineHeightSpan.kt +48 -0
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownBackgroundSpan.kt +102 -48
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownBlockIndentSpan.kt +22 -4
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownBulletSpan.kt +78 -0
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownCodeBlockSpan.kt +177 -0
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownFontStyleSpan.kt +32 -0
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownFontWeightSpan.kt +34 -0
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownGapSpan.kt +24 -11
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownLetterSpacingSpan.kt +32 -0
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownTextShadowSpan.kt +32 -0
- package/android/src/main/new_arch/CMakeLists.txt +17 -0
- package/android/src/main/new_arch/RNMarcusSpec.h +1 -0
- package/android/src/main/new_arch/react/renderer/components/RNMarcusSpec/MarcusTextDecoratorShadowNode.cpp +235 -0
- package/android/src/main/new_arch/react/renderer/components/RNMarcusSpec/MarcusTextDecoratorShadowNode.h +62 -0
- package/android/src/reactNativeVersionPatch/CustomMountingManager/81/app/getbullet/marcus/CustomFabricUIManager.java +22 -3
- package/android/src/reactNativeVersionPatch/CustomMountingManager/latest/app/getbullet/marcus/CustomFabricUIManager.java +22 -3
- package/android/src/test/java/app/getbullet/marcus/MarkdownCopyTest.kt +69 -0
- package/android/src/test/java/app/getbullet/marcus/MarkdownFormatterTest.kt +170 -25
- package/android/src/test/java/app/getbullet/marcus/RenderModel.kt +22 -5
- package/android/src/test/java/app/getbullet/marcus/spans/MarkdownCodeBlockSpanTest.kt +91 -0
- package/android/src/test/resources/render-model.txt +221 -16
- package/apple/MarcusSwizzle.h +25 -0
- package/apple/MarcusTextDecoratorComponentView.h +22 -0
- package/apple/MarcusTextDecoratorComponentView.mm +72 -0
- package/apple/MarcusTextDecoratorShadowNode.h +62 -0
- package/apple/MarcusTextDecoratorShadowNode.mm +192 -0
- package/apple/MarcusTextDecoratorViewManager.h +4 -0
- package/apple/MarcusTextDecoratorViewManager.mm +11 -0
- package/apple/MarcusTextInputDecoratorComponentView.mm +1 -1
- package/apple/MarcusTextInputDecoratorShadowNode.mm +1 -1
- package/apple/MarcusTextLayoutManager.h +40 -0
- package/apple/MarcusTextLayoutManager.mm +173 -0
- package/apple/MarkdownAttributes.h +23 -2
- package/apple/MarkdownAttributes.m +6 -0
- package/apple/MarkdownCopy.swift +63 -0
- package/apple/MarkdownDecorator.swift +2 -2
- package/apple/MarkdownFormatter+React.swift +23 -0
- package/apple/MarkdownFormatter.swift +869 -148
- package/apple/MarkdownParagraphLayoutManager.swift +455 -0
- package/apple/MarkdownSwiftInterop.h +0 -1
- package/apple/MarkdownTextBackground.swift +59 -1
- package/apple/MarkdownTextFieldObserver.swift +2 -2
- package/apple/MarkdownTextLayoutFragment.swift +159 -33
- package/apple/MarkdownTextLayoutManagerDelegate.swift +67 -3
- package/apple/MarkdownTextStorageDelegate.swift +2 -2
- package/apple/MarkdownTextViewObserver.swift +2 -2
- package/apple/MarkdownUtils.swift +38 -0
- package/apple/MarkdownWritingDirection.swift +132 -0
- package/apple/RCTMarcusStyle+Codegen.h +115 -9
- package/apple/RCTMarcusStyle.h +128 -31
- package/apple/RCTMarcusStyle.m +48 -0
- package/apple/RCTParagraphComponentView+Marcus.h +17 -0
- package/apple/RCTParagraphComponentView+Marcus.mm +38 -0
- package/apple/RCTTextInputComponentView+Marcus.mm +1 -25
- package/cpp/react/renderer/components/RNMarcusSpec/MarcusTextDecoratorState.h +37 -0
- package/cpp/react/renderer/components/RNMarcusSpec/MarcusTextDecoratorViewComponentDescriptor.h +17 -0
- package/lib/commonjs/MarcusTextDecoratorViewNativeComponent.ts +199 -0
- package/lib/commonjs/MarcusTextInputDecoratorViewNativeComponent.ts +145 -58
- package/lib/commonjs/MarkdownText.js +330 -0
- package/lib/commonjs/MarkdownText.js.map +1 -0
- package/lib/commonjs/MarkdownText.web.js +529 -0
- package/lib/commonjs/MarkdownText.web.js.map +1 -0
- package/lib/commonjs/MarkdownTextInput.js +22 -27
- package/lib/commonjs/MarkdownTextInput.js.map +1 -1
- package/lib/commonjs/MarkdownTextInput.web.js +12 -7
- package/lib/commonjs/MarkdownTextInput.web.js.map +1 -1
- package/lib/commonjs/atomUtils.js +112 -0
- package/lib/commonjs/atomUtils.js.map +1 -0
- package/lib/commonjs/childrenUtils.js +36 -0
- package/lib/commonjs/childrenUtils.js.map +1 -0
- package/lib/commonjs/index.js +8 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/math/environment.js +69 -0
- package/lib/commonjs/math/environment.js.map +1 -0
- package/lib/commonjs/math/index.js +61 -0
- package/lib/commonjs/math/index.js.map +1 -0
- package/lib/commonjs/math/mathjax.js +548 -0
- package/lib/commonjs/math/mathjax.js.map +1 -0
- package/lib/commonjs/metro.js +172 -0
- package/lib/commonjs/metro.js.map +1 -0
- package/lib/commonjs/parser/index.d.ts +3 -0
- package/lib/commonjs/parser/index.js +450 -42
- package/lib/commonjs/parser/index.js.map +4 -4
- package/lib/commonjs/stripUtils.js +743 -0
- package/lib/commonjs/stripUtils.js.map +1 -0
- package/lib/commonjs/styleUtils.js +194 -23
- package/lib/commonjs/styleUtils.js.map +1 -1
- package/lib/commonjs/web/MarkdownElements.css +67 -0
- package/lib/commonjs/web/MarkdownTextInput.css +9 -7
- package/lib/commonjs/web/utils/blockLayout.js +95 -7
- package/lib/commonjs/web/utils/blockLayout.js.map +1 -1
- package/lib/commonjs/web/utils/blockUtils.js +327 -54
- package/lib/commonjs/web/utils/blockUtils.js.map +1 -1
- package/lib/commonjs/web/utils/elementUtils.js +80 -0
- package/lib/commonjs/web/utils/elementUtils.js.map +1 -0
- package/lib/commonjs/web/utils/parserUtils.js +84 -28
- package/lib/commonjs/web/utils/parserUtils.js.map +1 -1
- package/lib/commonjs/web/utils/treeUtils.js +6 -0
- package/lib/commonjs/web/utils/treeUtils.js.map +1 -1
- package/lib/commonjs/web/utils/webStyleUtils.js +25 -5
- package/lib/commonjs/web/utils/webStyleUtils.js.map +1 -1
- package/lib/module/MarcusTextDecoratorViewNativeComponent.ts +199 -0
- package/lib/module/MarcusTextInputDecoratorViewNativeComponent.ts +145 -58
- package/lib/module/MarkdownText.js +325 -0
- package/lib/module/MarkdownText.js.map +1 -0
- package/lib/module/MarkdownText.web.js +524 -0
- package/lib/module/MarkdownText.web.js.map +1 -0
- package/lib/module/MarkdownTextInput.js +24 -29
- package/lib/module/MarkdownTextInput.js.map +1 -1
- package/lib/module/MarkdownTextInput.web.js +12 -7
- package/lib/module/MarkdownTextInput.web.js.map +1 -1
- package/lib/module/atomUtils.js +106 -0
- package/lib/module/atomUtils.js.map +1 -0
- package/lib/module/childrenUtils.js +33 -0
- package/lib/module/childrenUtils.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/math/environment.js +67 -0
- package/lib/module/math/environment.js.map +1 -0
- package/lib/module/math/index.js +56 -0
- package/lib/module/math/index.js.map +1 -0
- package/lib/module/math/mathjax.js +541 -0
- package/lib/module/math/mathjax.js.map +1 -0
- package/lib/module/metro.js +169 -0
- package/lib/module/metro.js.map +1 -0
- package/lib/module/parser/index.d.ts +3 -0
- package/lib/module/parser/index.js +450 -42
- package/lib/module/parser/index.js.map +4 -4
- package/lib/module/stripUtils.js +739 -0
- package/lib/module/stripUtils.js.map +1 -0
- package/lib/module/styleUtils.js +196 -25
- package/lib/module/styleUtils.js.map +1 -1
- package/lib/module/web/MarkdownElements.css +67 -0
- package/lib/module/web/MarkdownTextInput.css +9 -7
- package/lib/module/web/utils/blockLayout.js +94 -8
- package/lib/module/web/utils/blockLayout.js.map +1 -1
- package/lib/module/web/utils/blockUtils.js +328 -56
- package/lib/module/web/utils/blockUtils.js.map +1 -1
- package/lib/module/web/utils/elementUtils.js +75 -0
- package/lib/module/web/utils/elementUtils.js.map +1 -0
- package/lib/module/web/utils/parserUtils.js +86 -30
- package/lib/module/web/utils/parserUtils.js.map +1 -1
- package/lib/module/web/utils/treeUtils.js +6 -0
- package/lib/module/web/utils/treeUtils.js.map +1 -1
- package/lib/module/web/utils/webStyleUtils.js +25 -5
- package/lib/module/web/utils/webStyleUtils.js.map +1 -1
- package/lib/typescript/commonjs/e2e/links.test.d.ts +2 -0
- package/lib/typescript/commonjs/e2e/links.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MarcusTextDecoratorViewNativeComponent.d.ts +93 -0
- package/lib/typescript/commonjs/src/MarcusTextDecoratorViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MarcusTextInputDecoratorViewNativeComponent.d.ts +64 -51
- package/lib/typescript/commonjs/src/MarcusTextInputDecoratorViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MarkdownText.d.ts +127 -0
- package/lib/typescript/commonjs/src/MarkdownText.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MarkdownText.web.d.ts +126 -0
- package/lib/typescript/commonjs/src/MarkdownText.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/MarkdownTextInput.d.ts +23 -1
- package/lib/typescript/commonjs/src/MarkdownTextInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/MarkdownTextInput.web.d.ts +26 -4
- package/lib/typescript/commonjs/src/MarkdownTextInput.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/atomUtils.d.ts +58 -0
- package/lib/typescript/commonjs/src/atomUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/childrenUtils.d.ts +12 -0
- package/lib/typescript/commonjs/src/childrenUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/commonTypes.d.ts +39 -3
- package/lib/typescript/commonjs/src/commonTypes.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/math/environment.d.ts +7 -0
- package/lib/typescript/commonjs/src/math/environment.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/math/index.d.ts +64 -0
- package/lib/typescript/commonjs/src/math/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/math/mathjax.d.ts +63 -0
- package/lib/typescript/commonjs/src/math/mathjax.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/metro.d.ts +59 -0
- package/lib/typescript/commonjs/src/metro.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/parser/index.d.ts +3 -3
- package/lib/typescript/commonjs/src/parser/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/parser/micromark-extension-mentions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/rangeUtils.d.ts +1 -1
- package/lib/typescript/commonjs/src/stripUtils.d.ts +108 -0
- package/lib/typescript/commonjs/src/stripUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/styleUtils.d.ts +62 -4
- package/lib/typescript/commonjs/src/styleUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/web/utils/blockLayout.d.ts +32 -4
- package/lib/typescript/commonjs/src/web/utils/blockLayout.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/web/utils/blockUtils.d.ts +20 -8
- package/lib/typescript/commonjs/src/web/utils/blockUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/web/utils/elementUtils.d.ts +37 -0
- package/lib/typescript/commonjs/src/web/utils/elementUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/web/utils/parserUtils.d.ts +5 -5
- package/lib/typescript/commonjs/src/web/utils/parserUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/web/utils/treeUtils.d.ts +6 -1
- package/lib/typescript/commonjs/src/web/utils/treeUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/web/utils/webStyleUtils.d.ts +2 -2
- package/lib/typescript/commonjs/src/web/utils/webStyleUtils.d.ts.map +1 -1
- package/lib/typescript/module/e2e/links.test.d.ts +2 -0
- package/lib/typescript/module/e2e/links.test.d.ts.map +1 -0
- package/lib/typescript/module/src/MarcusTextDecoratorViewNativeComponent.d.ts +93 -0
- package/lib/typescript/module/src/MarcusTextDecoratorViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/MarcusTextInputDecoratorViewNativeComponent.d.ts +64 -51
- package/lib/typescript/module/src/MarcusTextInputDecoratorViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/module/src/MarkdownText.d.ts +127 -0
- package/lib/typescript/module/src/MarkdownText.d.ts.map +1 -0
- package/lib/typescript/module/src/MarkdownText.web.d.ts +126 -0
- package/lib/typescript/module/src/MarkdownText.web.d.ts.map +1 -0
- package/lib/typescript/module/src/MarkdownTextInput.d.ts +23 -1
- package/lib/typescript/module/src/MarkdownTextInput.d.ts.map +1 -1
- package/lib/typescript/module/src/MarkdownTextInput.web.d.ts +26 -4
- package/lib/typescript/module/src/MarkdownTextInput.web.d.ts.map +1 -1
- package/lib/typescript/module/src/atomUtils.d.ts +58 -0
- package/lib/typescript/module/src/atomUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/childrenUtils.d.ts +12 -0
- package/lib/typescript/module/src/childrenUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/commonTypes.d.ts +39 -3
- package/lib/typescript/module/src/commonTypes.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/math/environment.d.ts +7 -0
- package/lib/typescript/module/src/math/environment.d.ts.map +1 -0
- package/lib/typescript/module/src/math/index.d.ts +64 -0
- package/lib/typescript/module/src/math/index.d.ts.map +1 -0
- package/lib/typescript/module/src/math/mathjax.d.ts +63 -0
- package/lib/typescript/module/src/math/mathjax.d.ts.map +1 -0
- package/lib/typescript/module/src/metro.d.ts +59 -0
- package/lib/typescript/module/src/metro.d.ts.map +1 -0
- package/lib/typescript/module/src/parser/index.d.ts +3 -3
- package/lib/typescript/module/src/parser/index.d.ts.map +1 -1
- package/lib/typescript/module/src/parser/micromark-extension-mentions.d.ts.map +1 -1
- package/lib/typescript/module/src/rangeUtils.d.ts +1 -1
- package/lib/typescript/module/src/stripUtils.d.ts +108 -0
- package/lib/typescript/module/src/stripUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/styleUtils.d.ts +62 -4
- package/lib/typescript/module/src/styleUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/web/utils/blockLayout.d.ts +32 -4
- package/lib/typescript/module/src/web/utils/blockLayout.d.ts.map +1 -1
- package/lib/typescript/module/src/web/utils/blockUtils.d.ts +20 -8
- package/lib/typescript/module/src/web/utils/blockUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/web/utils/elementUtils.d.ts +37 -0
- package/lib/typescript/module/src/web/utils/elementUtils.d.ts.map +1 -0
- package/lib/typescript/module/src/web/utils/parserUtils.d.ts +5 -5
- package/lib/typescript/module/src/web/utils/parserUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/web/utils/treeUtils.d.ts +6 -1
- package/lib/typescript/module/src/web/utils/treeUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/web/utils/webStyleUtils.d.ts +2 -2
- package/lib/typescript/module/src/web/utils/webStyleUtils.d.ts.map +1 -1
- package/package.json +29 -2
- package/react-native.config.js +8 -1
- package/src/MarcusTextDecoratorViewNativeComponent.ts +199 -0
- package/src/MarcusTextInputDecoratorViewNativeComponent.ts +145 -58
- package/src/MarkdownText.tsx +472 -0
- package/src/MarkdownText.web.tsx +668 -0
- package/src/MarkdownTextInput.tsx +42 -38
- package/src/MarkdownTextInput.web.tsx +36 -13
- package/src/atomUtils.ts +112 -0
- package/src/childrenUtils.ts +39 -0
- package/src/commonTypes.ts +69 -9
- package/src/index.tsx +2 -1
- package/src/math/environment.ts +68 -0
- package/src/math/index.ts +78 -0
- package/src/math/mathjax.ts +604 -0
- package/src/metro.ts +238 -0
- package/src/parser/index.ts +175 -10
- package/src/parser/micromark-extension-mentions.ts +104 -11
- package/src/stripUtils.ts +919 -0
- package/src/styleUtils.ts +290 -26
- package/src/web/MarkdownElements.css +67 -0
- package/src/web/MarkdownTextInput.css +9 -7
- package/src/web/utils/blockLayout.ts +124 -14
- package/src/web/utils/blockUtils.ts +365 -59
- package/src/web/utils/elementUtils.ts +87 -0
- package/src/web/utils/parserUtils.ts +119 -31
- package/src/web/utils/treeUtils.ts +6 -1
- package/src/web/utils/webStyleUtils.ts +32 -8
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownBackgroundColorSpan.kt +0 -6
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownBoldSpan.kt +0 -6
- package/android/src/main/java/app/getbullet/marcus/spans/MarkdownItalicSpan.kt +0 -6
- package/apple/RCTMarcusStyle+Codegen.mm +0 -64
- package/apple/RCTMarcusUtils.h +0 -26
- package/apple/RCTMarcusUtils.mm +0 -26
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _MarcusTextDecoratorViewNativeComponent = _interopRequireDefault(require("./MarcusTextDecoratorViewNativeComponent"));
|
|
10
|
+
var _styleUtils = require("./styleUtils.js");
|
|
11
|
+
var _stripUtils = require("./stripUtils.js");
|
|
12
|
+
var _atomUtils = require("./atomUtils.js");
|
|
13
|
+
var _index = require("./math/index.js");
|
|
14
|
+
var _childrenUtils = require("./childrenUtils.js");
|
|
15
|
+
var _index2 = require("./parser/index.js");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
/**
|
|
19
|
+
* What to show in place of an image.
|
|
20
|
+
*
|
|
21
|
+
* Must return a single view with a definite width and height, or nothing: the
|
|
22
|
+
* text layout has to know how much room to leave before it can lay the line
|
|
23
|
+
* out, and markdown carries no dimensions. Anything that reports no size --
|
|
24
|
+
* a bare `Image` with a remote source, most obviously -- measures zero and
|
|
25
|
+
* disappears.
|
|
26
|
+
*
|
|
27
|
+
* The alt text is passed through rather than used: what it is good for, an
|
|
28
|
+
* accessibility label most of all, is a question only the caller can answer.
|
|
29
|
+
*
|
|
30
|
+
* `inline` says whether the image shares its line with anything else, which is
|
|
31
|
+
* usually what decides how big it should be: alone on a line it is a figure,
|
|
32
|
+
* and in the middle of a sentence it is a badge. A block marker does not count
|
|
33
|
+
* as company, and another image does.
|
|
34
|
+
*
|
|
35
|
+
* Every string is always a string: an image written without a title is handed
|
|
36
|
+
* an empty one rather than nothing, so a caller never has to tell the two
|
|
37
|
+
* apart.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* What to draw an SVG with.
|
|
42
|
+
*
|
|
43
|
+
* Handed a complete SVG document and the box it belongs in, and expected to
|
|
44
|
+
* return a view of exactly that size. There is deliberately nothing else in the
|
|
45
|
+
* signature: everything a picture needs -- the colour, the glyph outlines, the
|
|
46
|
+
* baseline it sits on -- is either inside the XML already or has been taken
|
|
47
|
+
* care of by the time this is called, so `<SvgXml xml={xml} width={width}
|
|
48
|
+
* height={height} />` is the whole of a correct implementation.
|
|
49
|
+
*
|
|
50
|
+
* It exists because a renderer for SVG is a dependency, and which one is not
|
|
51
|
+
* this library's business: `react-native-svg` on native, whatever you like on
|
|
52
|
+
* the web.
|
|
53
|
+
*
|
|
54
|
+
* Returning nothing leaves the drawing out, and the span it stood for still
|
|
55
|
+
* costs its one character either way.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* What to do when a link is pressed.
|
|
60
|
+
*
|
|
61
|
+
* The label is the text the link was rendered as, which is all a reader saw of
|
|
62
|
+
* it: the destination is not in the document any more. Reference links are not
|
|
63
|
+
* covered -- their destination is written somewhere else and is not resolved
|
|
64
|
+
* yet -- so they render as links and do nothing.
|
|
65
|
+
*
|
|
66
|
+
* Opening the URL is deliberately not done for you: what a link means is the
|
|
67
|
+
* application's to decide, and a message from a stranger is the last place to
|
|
68
|
+
* hand an arbitrary URL to `Linking.openURL` without looking at it first.
|
|
69
|
+
*
|
|
70
|
+
* Every string is always a string: a link written without a title is handed an
|
|
71
|
+
* empty one rather than nothing.
|
|
72
|
+
*/
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The stripped text with the embeds spliced back in and the links wrapped, as
|
|
76
|
+
* the children of one `Text`.
|
|
77
|
+
*
|
|
78
|
+
* A view nested in a `Text` is one character to the platform -- iOS and Android
|
|
79
|
+
* both put a single U+FFFC in the string their formatters index -- and it is
|
|
80
|
+
* the very character the strip left behind, so the ranges need no adjusting and
|
|
81
|
+
* an embed inside a blockquote is laid out inside the quote's indent by the
|
|
82
|
+
* same code that indents the prose around it.
|
|
83
|
+
*
|
|
84
|
+
* A nested `Text` costs no characters at all: its content goes into that same
|
|
85
|
+
* string where it stands. So a link can be wrapped in one to be pressed without
|
|
86
|
+
* moving anything either, and the decorator styles it through the ranges the
|
|
87
|
+
* way it styles a link nobody can press.
|
|
88
|
+
*/
|
|
89
|
+
function textChildren(markdown, renderEmbed, renderSVG, fontSize, color, locale, onLinkPress) {
|
|
90
|
+
const {
|
|
91
|
+
text,
|
|
92
|
+
links
|
|
93
|
+
} = markdown;
|
|
94
|
+
const children = [];
|
|
95
|
+
const atoms = (0, _atomUtils.atomsOf)(markdown);
|
|
96
|
+
// Atoms are in text order and each is used once, whether it falls inside a
|
|
97
|
+
// link or between two, so one walk covers both.
|
|
98
|
+
let next = 0;
|
|
99
|
+
|
|
100
|
+
/** What stands where one placeholder character is. */
|
|
101
|
+
function draw(atom) {
|
|
102
|
+
if (atom.kind === "embed") {
|
|
103
|
+
return renderEmbed?.(atom.uri, atom.alt, atom.title, atom.inline);
|
|
104
|
+
}
|
|
105
|
+
const drawn = (0, _index.renderMath)(atom.tex, atom.display, fontSize, color);
|
|
106
|
+
if (drawn === null) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const element = renderSVG?.(drawn.svg, drawn.width, drawn.height);
|
|
110
|
+
if (!element) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Wrapped rather than cloned: what came back is the caller's element and
|
|
115
|
+
// its own props are not ours to rewrite.
|
|
116
|
+
//
|
|
117
|
+
// The wrapper does two things. It carries the label -- what the picture
|
|
118
|
+
// says, read out the way a screen reader reads maths on the web, because a
|
|
119
|
+
// drawing is the one thing in a document that cannot be read for itself.
|
|
120
|
+
// And it shifts the picture down by its depth -- both platforms put the
|
|
121
|
+
// *bottom* edge of a view mounted in a `Text` on the baseline, so without
|
|
122
|
+
// this a fraction floats above the line. The shift happens after
|
|
123
|
+
// measurement, so the line keeps the height the maths asked for.
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
125
|
+
accessible: true,
|
|
126
|
+
accessibilityLabel: (0, _index.speakMath)(atom.tex, atom.display, locale) ?? atom.tex,
|
|
127
|
+
style: drawn.depth ? {
|
|
128
|
+
transform: [{
|
|
129
|
+
translateY: drawn.depth
|
|
130
|
+
}]
|
|
131
|
+
} : undefined,
|
|
132
|
+
children: element
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** The text between two offsets, with any atoms in it spliced in. */
|
|
137
|
+
function content(from, to) {
|
|
138
|
+
const between = [];
|
|
139
|
+
let cursor = from;
|
|
140
|
+
while (next < atoms.length && atoms[next].index < to) {
|
|
141
|
+
const atom = atoms[next];
|
|
142
|
+
if (atom.index > cursor) {
|
|
143
|
+
between.push(text.slice(cursor, atom.index));
|
|
144
|
+
}
|
|
145
|
+
between.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
146
|
+
children: draw(atom) ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {})
|
|
147
|
+
}, `atom-${atom.index}`));
|
|
148
|
+
cursor = atom.index + 1;
|
|
149
|
+
next++;
|
|
150
|
+
}
|
|
151
|
+
if (cursor < to) {
|
|
152
|
+
between.push(text.slice(cursor, to));
|
|
153
|
+
}
|
|
154
|
+
return between;
|
|
155
|
+
}
|
|
156
|
+
let cursor = 0;
|
|
157
|
+
for (const link of links) {
|
|
158
|
+
if (link.start > cursor) {
|
|
159
|
+
children.push(...content(cursor, link.start));
|
|
160
|
+
}
|
|
161
|
+
const end = link.start + link.length;
|
|
162
|
+
children.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
163
|
+
role: "link",
|
|
164
|
+
onPress: () => onLinkPress.current?.(link.uri, link.label, link.title),
|
|
165
|
+
children: content(link.start, end)
|
|
166
|
+
}, `link-${link.start}`));
|
|
167
|
+
cursor = end;
|
|
168
|
+
}
|
|
169
|
+
children.push(...content(cursor, text.length));
|
|
170
|
+
return children;
|
|
171
|
+
}
|
|
172
|
+
const EMPTY_RANGES = [];
|
|
173
|
+
const NO_SUBSTITUTIONS = [];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* What maths is sized against when the caller set no size at all, which is
|
|
177
|
+
* React Native's own default for a `Text`.
|
|
178
|
+
*/
|
|
179
|
+
const DEFAULT_FONT_SIZE = 14;
|
|
180
|
+
function toRangeStructs(ranges) {
|
|
181
|
+
return ranges.map(range => ({
|
|
182
|
+
type: range.type,
|
|
183
|
+
start: range.start,
|
|
184
|
+
length: range.length,
|
|
185
|
+
depth: range.depth ?? 0
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* `Text`, with the markdown in its content rendered rather than shown.
|
|
191
|
+
*
|
|
192
|
+
* The syntax is removed in JavaScript before the text ever reaches the shadow
|
|
193
|
+
* tree, so what gets measured, drawn, selected, copied and read out is the
|
|
194
|
+
* finished prose. What is left over -- which run is bold, where a quote starts
|
|
195
|
+
* -- is handed to the native decorator as ranges over that stripped string, and
|
|
196
|
+
* styled by the same formatter the input uses, so a message and the composer it
|
|
197
|
+
* was typed in agree by construction.
|
|
198
|
+
*
|
|
199
|
+
* List markers are the exception that stays: `1.` numbers an item and `-`
|
|
200
|
+
* stands in for a bullet, so they are laid out rather than removed.
|
|
201
|
+
*/
|
|
202
|
+
const MarkdownText = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
203
|
+
const {
|
|
204
|
+
markdownStyle: markdownStyleProp,
|
|
205
|
+
gfm,
|
|
206
|
+
mention,
|
|
207
|
+
math,
|
|
208
|
+
renderEmbed,
|
|
209
|
+
renderSVG,
|
|
210
|
+
mathAccessibilityLocale,
|
|
211
|
+
onLinkPress,
|
|
212
|
+
children,
|
|
213
|
+
...textProps
|
|
214
|
+
} = props;
|
|
215
|
+
const markdownStyle = _react.default.useMemo(() => (0, _styleUtils.processMarkdownStyle)(markdownStyleProp), [markdownStyleProp]);
|
|
216
|
+
|
|
217
|
+
// Whether there is a handler, not which one: a caller who writes the callback
|
|
218
|
+
// inline would otherwise re-parse the document on every render.
|
|
219
|
+
const withEmbeds = renderEmbed !== undefined;
|
|
220
|
+
// Maths is only taken out of the text when there is both something to draw it
|
|
221
|
+
// with and a backend to typeset it -- see `./math`. Left in, `$$x^2$$` is
|
|
222
|
+
// shown as it was written, which beats an empty box where an equation should
|
|
223
|
+
// be and is the one hint an application gets that its Metro config is a line
|
|
224
|
+
// short.
|
|
225
|
+
const withMath = renderSVG !== undefined && _index.available;
|
|
226
|
+
const withLinks = onLinkPress !== undefined;
|
|
227
|
+
|
|
228
|
+
// The same worklet for as long as the flavour is the same one, so the
|
|
229
|
+
// document is only re-parsed when the document itself changes.
|
|
230
|
+
const parser = (0, _index2.createParser)({
|
|
231
|
+
gfm,
|
|
232
|
+
mention,
|
|
233
|
+
math
|
|
234
|
+
});
|
|
235
|
+
const markdown = _react.default.useMemo(() => {
|
|
236
|
+
const text = (0, _childrenUtils.flattenText)(children);
|
|
237
|
+
return text === null ? null : (0, _stripUtils.stripSyntax)(text, parser(text), {
|
|
238
|
+
embeds: withEmbeds,
|
|
239
|
+
math: withMath,
|
|
240
|
+
links: withLinks
|
|
241
|
+
});
|
|
242
|
+
}, [children, parser, withEmbeds, withMath, withLinks]);
|
|
243
|
+
|
|
244
|
+
// What the maths has to be sized against. Read off the style the caller gave
|
|
245
|
+
// this element, because that is the only size known here -- a size inherited
|
|
246
|
+
// from an enclosing `Text` is resolved by the platform, long after this.
|
|
247
|
+
const {
|
|
248
|
+
fontSize,
|
|
249
|
+
color
|
|
250
|
+
} = _react.default.useMemo(() => {
|
|
251
|
+
const flattened = _reactNative.StyleSheet.flatten(textProps.style);
|
|
252
|
+
return {
|
|
253
|
+
fontSize: typeof flattened?.fontSize === "number" ? flattened.fontSize : DEFAULT_FONT_SIZE,
|
|
254
|
+
// MathJax paints in `currentColor`, and a view mounted in a `Text`
|
|
255
|
+
// inherits none of its text attributes on either platform, so the colour
|
|
256
|
+
// is painted into the SVG before it is handed over. Left unset, maths is
|
|
257
|
+
// drawn in whatever the SVG renderer makes of `currentColor` -- so a
|
|
258
|
+
// display that means to be readable in the dark should say what colour it
|
|
259
|
+
// is, which it had to do for its own text anyway.
|
|
260
|
+
color: typeof flattened?.color === "string" ? flattened.color : undefined
|
|
261
|
+
};
|
|
262
|
+
}, [textProps.style]);
|
|
263
|
+
|
|
264
|
+
// The handler as the caller last wrote it, kept beside the text rather than
|
|
265
|
+
// baked into it. Written inline -- which is how a handler that reaches for
|
|
266
|
+
// component state has to be written -- it is a different function on every
|
|
267
|
+
// render, and rebuilding the children for each press means rebuilding the
|
|
268
|
+
// string the platform lays out, on the main thread, for every press.
|
|
269
|
+
const pressHandler = _react.default.useRef(onLinkPress);
|
|
270
|
+
_react.default.useEffect(() => {
|
|
271
|
+
pressHandler.current = onLinkPress;
|
|
272
|
+
}, [onLinkPress]);
|
|
273
|
+
|
|
274
|
+
// Rebuilt when the document changes, or when a caller hands over a different
|
|
275
|
+
// renderer -- one that draws from state has to be able to draw again.
|
|
276
|
+
const spliced = _react.default.useMemo(() => markdown === null || markdown.embeds.length === 0 && markdown.maths.length === 0 && markdown.links.length === 0 ? null : textChildren(markdown, renderEmbed, renderSVG, fontSize, color, mathAccessibilityLocale, pressHandler), [markdown, renderEmbed, renderSVG, fontSize, color, mathAccessibilityLocale]);
|
|
277
|
+
|
|
278
|
+
// What the paragraph reads as. A drawing is one U+FFFC in the string the
|
|
279
|
+
// platform lays out -- that is what a view nested in a `Text` costs -- and
|
|
280
|
+
// there is nothing in that character for a screen reader to say, so the whole
|
|
281
|
+
// paragraph is described instead with each placeholder written back out as
|
|
282
|
+
// the alt text or the spoken form of the equation it stands for. Only when
|
|
283
|
+
// the caller has not described it themselves, and only when there is
|
|
284
|
+
// something to describe.
|
|
285
|
+
const accessibilityLabel = _react.default.useMemo(() => textProps.accessibilityLabel ?? (markdown === null || markdown.embeds.length === 0 && markdown.maths.length === 0 ? undefined : (0, _atomUtils.describeAtoms)(markdown, _index.speakMath, mathAccessibilityLocale)), [markdown, textProps.accessibilityLabel, mathAccessibilityLocale]);
|
|
286
|
+
|
|
287
|
+
// What each of those placeholders copies as, which is the markdown it was
|
|
288
|
+
// written as. Handed to the decorator rather than used here: the copy is the
|
|
289
|
+
// platform's, made from the string it laid out, and only the platform can
|
|
290
|
+
// catch it -- Android at the moment the action mode's copy is pressed, iOS
|
|
291
|
+
// when the paragraph is asked for its own `copy:`.
|
|
292
|
+
const substitutions = _react.default.useMemo(() => markdown === null || markdown.embeds.length === 0 && markdown.maths.length === 0 ? NO_SUBSTITUTIONS : (0, _atomUtils.atomsOf)(markdown).map(atom => ({
|
|
293
|
+
index: atom.index,
|
|
294
|
+
text: (0, _atomUtils.sourceOf)(atom)
|
|
295
|
+
})), [markdown]);
|
|
296
|
+
|
|
297
|
+
// The same array while the document is the same one: a new one is a new props
|
|
298
|
+
// object to the mounting layer, and every press that a caller answers with a
|
|
299
|
+
// `setState` would otherwise have the decorator format the paragraph again.
|
|
300
|
+
const ranges = _react.default.useMemo(() => markdown === null ? EMPTY_RANGES : toRangeStructs(markdown.ranges), [markdown]);
|
|
301
|
+
if (markdown === null) {
|
|
302
|
+
if (__DEV__) {
|
|
303
|
+
console.warn("[react-native-marcus] `MarkdownText` was given children other than text and is rendering them unformatted.");
|
|
304
|
+
}
|
|
305
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
306
|
+
...textProps,
|
|
307
|
+
ref: ref,
|
|
308
|
+
children: children
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MarcusTextDecoratorViewNativeComponent.default, {
|
|
312
|
+
style: styles.displayContents,
|
|
313
|
+
markdownStyle: markdownStyle,
|
|
314
|
+
ranges: ranges,
|
|
315
|
+
substitutions: substitutions,
|
|
316
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
317
|
+
...textProps,
|
|
318
|
+
accessibilityLabel: accessibilityLabel,
|
|
319
|
+
ref: ref,
|
|
320
|
+
children: spliced ?? markdown.text
|
|
321
|
+
})
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
const styles = _reactNative.StyleSheet.create({
|
|
325
|
+
displayContents: {
|
|
326
|
+
display: "contents"
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
var _default = exports.default = MarkdownText;
|
|
330
|
+
//# sourceMappingURL=MarkdownText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_MarcusTextDecoratorViewNativeComponent","_styleUtils","_stripUtils","_atomUtils","_index","_childrenUtils","_index2","_jsxRuntime","e","__esModule","default","textChildren","markdown","renderEmbed","renderSVG","fontSize","color","locale","onLinkPress","text","links","children","atoms","atomsOf","next","draw","atom","kind","uri","alt","title","inline","drawn","renderMath","tex","display","element","svg","width","height","jsx","View","accessible","accessibilityLabel","speakMath","style","depth","transform","translateY","undefined","content","from","to","between","cursor","length","index","push","slice","Fragment","link","start","end","Text","role","onPress","current","label","EMPTY_RANGES","NO_SUBSTITUTIONS","DEFAULT_FONT_SIZE","toRangeStructs","ranges","map","range","type","MarkdownText","React","forwardRef","props","ref","markdownStyle","markdownStyleProp","gfm","mention","math","mathAccessibilityLocale","textProps","useMemo","processMarkdownStyle","withEmbeds","withMath","mathAvailable","withLinks","parser","createParser","flattenText","stripSyntax","embeds","flattened","StyleSheet","flatten","pressHandler","useRef","useEffect","spliced","maths","describeAtoms","substitutions","sourceOf","__DEV__","console","warn","styles","displayContents","create","_default","exports"],"sourceRoot":"../../src","sources":["MarkdownText.t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