react-native-marked 7.0.1-rc.0 → 7.0.2-rc.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/dist/commonjs/components/MDImage.js +3 -3
- package/dist/commonjs/components/MDImage.js.map +1 -1
- package/dist/commonjs/components/MDList.js +38 -0
- package/dist/commonjs/components/MDList.js.map +1 -0
- package/dist/commonjs/components/MDSvg.js +1 -1
- package/dist/commonjs/components/MDSvg.js.map +1 -1
- package/dist/commonjs/hooks/useMarkdown.js +1 -1
- package/dist/commonjs/hooks/useMarkdown.js.map +1 -1
- package/dist/commonjs/index.js +1 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/Markdown.js.map +1 -1
- package/dist/commonjs/lib/Parser.js +1 -1
- package/dist/commonjs/lib/Parser.js.map +1 -1
- package/dist/commonjs/lib/Renderer.js +10 -12
- package/dist/commonjs/lib/Renderer.js.map +1 -1
- package/dist/commonjs/theme/styles.js +1 -1
- package/dist/commonjs/theme/styles.js.map +1 -1
- package/dist/module/components/MDImage.js +4 -4
- package/dist/module/components/MDImage.js.map +1 -1
- package/dist/module/components/MDList.js +31 -0
- package/dist/module/components/MDList.js.map +1 -0
- package/dist/module/components/MDSvg.js +2 -2
- package/dist/module/components/MDSvg.js.map +1 -1
- package/dist/module/components/MDTable.js +2 -2
- package/dist/module/components/MDTable.js.map +1 -1
- package/dist/module/hooks/useMarkdown.js +1 -1
- package/dist/module/hooks/useMarkdown.js.map +1 -1
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/Markdown.js.map +1 -1
- package/dist/module/lib/Parser.js +1 -1
- package/dist/module/lib/Parser.js.map +1 -1
- package/dist/module/lib/Renderer.js +11 -13
- package/dist/module/lib/Renderer.js.map +1 -1
- package/dist/module/theme/styles.js +1 -1
- package/dist/module/theme/styles.js.map +1 -1
- package/dist/typescript/components/MDList.d.ts +12 -0
- package/dist/typescript/components/MDList.d.ts.map +1 -0
- package/dist/typescript/hooks/useMarkdown.d.ts +2 -2
- package/dist/typescript/hooks/useMarkdown.d.ts.map +1 -1
- package/dist/typescript/index.d.ts +4 -3
- package/dist/typescript/index.d.ts.map +1 -1
- package/dist/typescript/lib/Markdown.d.ts.map +1 -1
- package/dist/typescript/lib/Parser.d.ts +1 -1
- package/dist/typescript/lib/Parser.d.ts.map +1 -1
- package/dist/typescript/lib/Renderer.d.ts +1 -1
- package/dist/typescript/lib/Renderer.d.ts.map +1 -1
- package/dist/typescript/lib/types.d.ts +2 -2
- package/dist/typescript/lib/types.d.ts.map +1 -1
- package/dist/typescript/theme/styles.d.ts.map +1 -1
- package/package.json +23 -22
- package/src/components/MDImage.tsx +5 -5
- package/src/components/MDList.tsx +46 -0
- package/src/components/MDSvg.tsx +4 -4
- package/src/components/MDTable.tsx +3 -3
- package/src/hooks/useMarkdown.ts +4 -4
- package/src/index.ts +4 -2
- package/src/lib/Markdown.tsx +2 -2
- package/src/lib/Parser.tsx +5 -5
- package/src/lib/Renderer.tsx +15 -18
- package/src/lib/types.ts +3 -3
- package/src/theme/styles.ts +2 -2
package/src/lib/Renderer.tsx
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
+
import Slugger from "github-slugger";
|
|
1
2
|
import React, { type ReactNode } from "react";
|
|
2
3
|
import {
|
|
4
|
+
Dimensions,
|
|
5
|
+
type ImageStyle,
|
|
3
6
|
ScrollView,
|
|
4
|
-
View,
|
|
5
7
|
Text,
|
|
6
|
-
TouchableHighlight,
|
|
7
8
|
type TextStyle,
|
|
9
|
+
TouchableHighlight,
|
|
10
|
+
View,
|
|
8
11
|
type ViewStyle,
|
|
9
|
-
type ImageStyle,
|
|
10
|
-
Dimensions,
|
|
11
12
|
} from "react-native";
|
|
12
|
-
import MarkedList from "@jsamr/react-native-li";
|
|
13
|
-
import Disc from "@jsamr/counter-style/presets/disc";
|
|
14
|
-
import Decimal from "@jsamr/counter-style/presets/decimal";
|
|
15
|
-
import Slugger from "github-slugger";
|
|
16
13
|
import MDImage from "./../components/MDImage";
|
|
17
|
-
import
|
|
18
|
-
import type { RendererInterface } from "./types";
|
|
19
|
-
import { getTableWidthArr } from "../utils/table";
|
|
14
|
+
import MDList from "./../components/MDList";
|
|
20
15
|
import MDSvg from "./../components/MDSvg";
|
|
21
16
|
import MDTable from "./../components/MDTable";
|
|
17
|
+
import { onLinkPress } from "../utils/handlers";
|
|
18
|
+
import { getTableWidthArr } from "../utils/table";
|
|
19
|
+
import type { RendererInterface } from "./types";
|
|
22
20
|
|
|
23
21
|
class Renderer implements RendererInterface {
|
|
24
22
|
private slugPrefix = "react-native-marked-ele";
|
|
@@ -80,15 +78,14 @@ class Renderer implements RendererInterface {
|
|
|
80
78
|
startIndex?: number,
|
|
81
79
|
): ReactNode {
|
|
82
80
|
return (
|
|
83
|
-
<
|
|
84
|
-
counterRenderer={ordered ? Decimal : Disc}
|
|
85
|
-
markerTextStyle={textStyle}
|
|
86
|
-
markerBoxStyle={listStyle}
|
|
81
|
+
<MDList
|
|
87
82
|
key={this.getKey()}
|
|
83
|
+
ordered={ordered}
|
|
84
|
+
li={li}
|
|
85
|
+
listStyle={listStyle}
|
|
86
|
+
textStyle={textStyle}
|
|
88
87
|
startIndex={startIndex}
|
|
89
|
-
|
|
90
|
-
{li.map((node) => node)}
|
|
91
|
-
</MarkedList>
|
|
88
|
+
/>
|
|
92
89
|
);
|
|
93
90
|
}
|
|
94
91
|
|
package/src/lib/types.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { Tokenizer } from "marked";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import type {
|
|
3
4
|
FlatListProps,
|
|
4
|
-
ViewStyle,
|
|
5
|
-
TextStyle,
|
|
6
5
|
ImageStyle,
|
|
6
|
+
TextStyle,
|
|
7
|
+
ViewStyle,
|
|
7
8
|
} from "react-native";
|
|
8
9
|
import type { MarkedStyles, UserTheme } from "./../theme/types";
|
|
9
|
-
import type { Tokenizer } from "marked";
|
|
10
10
|
|
|
11
11
|
export interface ParserOptions {
|
|
12
12
|
styles?: MarkedStyles;
|
package/src/theme/styles.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import spacing from "./spacing";
|
|
1
|
+
import { type ColorSchemeName, StyleSheet } from "react-native";
|
|
3
2
|
import colors, { type ColorsPropType } from "./colors";
|
|
3
|
+
import spacing from "./spacing";
|
|
4
4
|
import type { MarkedStyles, UserTheme } from "./types";
|
|
5
5
|
|
|
6
6
|
const getFontStyles = (mdColors: ColorsPropType) => {
|