react-native-advanced-text 0.1.17 → 0.1.19

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/package.json CHANGED
@@ -1,175 +1,175 @@
1
- {
2
- "name": "react-native-advanced-text",
3
- "version": "0.1.17",
4
- "description": " Advanced text component for React Native with custom select options.",
5
- "main": "./lib/module/index.js",
6
- "types": "./lib/typescript/src/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "source": "./src/index.tsx",
10
- "types": "./lib/typescript/src/index.d.ts",
11
- "default": "./lib/module/index.js"
12
- },
13
- "./package.json": "./package.json"
14
- },
15
- "files": [
16
- "src",
17
- "lib",
18
- "android",
19
- "ios",
20
- "cpp",
21
- "*.podspec",
22
- "react-native.config.js",
23
- "!ios/build",
24
- "!android/build",
25
- "!android/gradle",
26
- "!android/gradlew",
27
- "!android/gradlew.bat",
28
- "!android/local.properties",
29
- "!**/__tests__",
30
- "!**/__fixtures__",
31
- "!**/__mocks__",
32
- "!**/.*"
33
- ],
34
- "scripts": {
35
- "example": "yarn workspace react-native-advanced-text-example",
36
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
- "prepare": "bob build",
38
- "typecheck": "tsc",
39
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
40
- "release": "release-it --only-version",
41
- "test": "jest"
42
- },
43
- "keywords": [
44
- "react-native",
45
- "ios",
46
- "android"
47
- ],
48
- "repository": {
49
- "type": "git",
50
- "url": "git+https://github.com/AminAllahham/react-native-advanced-text.git"
51
- },
52
- "author": "Amin Al-lahham <amin.allahham9@gmail.com> (https://github.com/AminAllahham)",
53
- "license": "MIT",
54
- "bugs": {
55
- "url": "https://github.com/AminAllahham/react-native-advanced-text/issues"
56
- },
57
- "homepage": "https://github.com/AminAllahham/react-native-advanced-text#readme",
58
- "publishConfig": {
59
- "registry": "https://registry.npmjs.org/"
60
- },
61
- "devDependencies": {
62
- "@commitlint/config-conventional": "^19.8.1",
63
- "@eslint/compat": "^1.3.2",
64
- "@eslint/eslintrc": "^3.3.1",
65
- "@eslint/js": "^9.35.0",
66
- "@react-native-community/cli": "20.0.1",
67
- "@react-native/babel-preset": "0.81.1",
68
- "@react-native/eslint-config": "^0.81.1",
69
- "@release-it/conventional-changelog": "^10.0.1",
70
- "@types/jest": "^29.5.14",
71
- "@types/react": "^19.1.0",
72
- "commitlint": "^19.8.1",
73
- "del-cli": "^6.0.0",
74
- "eslint": "^9.35.0",
75
- "eslint-config-prettier": "^10.1.8",
76
- "eslint-plugin-prettier": "^5.5.4",
77
- "jest": "^29.7.0",
78
- "lefthook": "^2.0.3",
79
- "prettier": "^2.8.8",
80
- "react": "19.1.0",
81
- "react-native": "0.81.1",
82
- "react-native-builder-bob": "^0.40.16",
83
- "release-it": "^19.0.4",
84
- "turbo": "^2.5.6",
85
- "typescript": "^5.9.2"
86
- },
87
- "peerDependencies": {
88
- "react": "*",
89
- "react-native": "*"
90
- },
91
- "workspaces": [
92
- "example"
93
- ],
94
- "packageManager": "yarn@4.11.0",
95
- "react-native-builder-bob": {
96
- "source": "src",
97
- "output": "lib",
98
- "targets": [
99
- [
100
- "module",
101
- {
102
- "esm": true
103
- }
104
- ],
105
- [
106
- "typescript",
107
- {
108
- "project": "tsconfig.build.json"
109
- }
110
- ]
111
- ]
112
- },
113
- "codegenConfig": {
114
- "name": "AdvancedTextViewSpec",
115
- "type": "all",
116
- "jsSrcsDir": "src",
117
- "android": {
118
- "javaPackageName": "com.advancedtext"
119
- },
120
- "ios": {
121
- "componentProvider": {
122
- "AdvancedTextView": "AdvancedTextView"
123
- }
124
- }
125
- },
126
- "prettier": {
127
- "quoteProps": "consistent",
128
- "singleQuote": true,
129
- "tabWidth": 2,
130
- "trailingComma": "es5",
131
- "useTabs": false
132
- },
133
- "commitlint": {
134
- "extends": [
135
- "@commitlint/config-conventional"
136
- ]
137
- },
138
- "release-it": {
139
- "git": {
140
- "commitMessage": "chore: release ${version}",
141
- "tagName": "v${version}"
142
- },
143
- "npm": {
144
- "publish": true
145
- },
146
- "github": {
147
- "release": true
148
- },
149
- "plugins": {
150
- "@release-it/conventional-changelog": {
151
- "preset": {
152
- "name": "angular"
153
- }
154
- }
155
- }
156
- },
157
- "jest": {
158
- "preset": "react-native",
159
- "modulePathIgnorePatterns": [
160
- "<rootDir>/example/node_modules",
161
- "<rootDir>/lib/"
162
- ]
163
- },
164
- "create-react-native-library": {
165
- "languages": "kotlin-objc",
166
- "type": "fabric-view",
167
- "tools": [
168
- "eslint",
169
- "lefthook",
170
- "release-it",
171
- "jest"
172
- ],
173
- "version": "0.55.1"
174
- }
175
- }
1
+ {
2
+ "name": "react-native-advanced-text",
3
+ "version": "0.1.19",
4
+ "description": " Advanced text component for React Native with custom select options.",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-advanced-text-example",
36
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
+ "prepare": "bob build",
38
+ "typecheck": "tsc",
39
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
40
+ "release": "release-it --only-version",
41
+ "test": "jest"
42
+ },
43
+ "keywords": [
44
+ "react-native",
45
+ "ios",
46
+ "android"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/AminAllahham/react-native-advanced-text.git"
51
+ },
52
+ "author": "Amin Al-lahham <amin.allahham9@gmail.com> (https://github.com/AminAllahham)",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://github.com/AminAllahham/react-native-advanced-text/issues"
56
+ },
57
+ "homepage": "https://github.com/AminAllahham/react-native-advanced-text#readme",
58
+ "publishConfig": {
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "devDependencies": {
62
+ "@commitlint/config-conventional": "^19.8.1",
63
+ "@eslint/compat": "^1.3.2",
64
+ "@eslint/eslintrc": "^3.3.1",
65
+ "@eslint/js": "^9.35.0",
66
+ "@react-native-community/cli": "20.0.1",
67
+ "@react-native/babel-preset": "0.81.1",
68
+ "@react-native/eslint-config": "^0.81.1",
69
+ "@release-it/conventional-changelog": "^10.0.1",
70
+ "@types/jest": "^29.5.14",
71
+ "@types/react": "^19.1.0",
72
+ "commitlint": "^19.8.1",
73
+ "del-cli": "^6.0.0",
74
+ "eslint": "^9.35.0",
75
+ "eslint-config-prettier": "^10.1.8",
76
+ "eslint-plugin-prettier": "^5.5.4",
77
+ "jest": "^29.7.0",
78
+ "lefthook": "^2.0.3",
79
+ "prettier": "^2.8.8",
80
+ "react": "19.1.0",
81
+ "react-native": "0.81.1",
82
+ "react-native-builder-bob": "^0.40.16",
83
+ "release-it": "^19.0.4",
84
+ "turbo": "^2.5.6",
85
+ "typescript": "^5.9.2"
86
+ },
87
+ "peerDependencies": {
88
+ "react": "*",
89
+ "react-native": "*"
90
+ },
91
+ "workspaces": [
92
+ "example"
93
+ ],
94
+ "packageManager": "yarn@4.11.0",
95
+ "react-native-builder-bob": {
96
+ "source": "src",
97
+ "output": "lib",
98
+ "targets": [
99
+ [
100
+ "module",
101
+ {
102
+ "esm": true
103
+ }
104
+ ],
105
+ [
106
+ "typescript",
107
+ {
108
+ "project": "tsconfig.build.json"
109
+ }
110
+ ]
111
+ ]
112
+ },
113
+ "codegenConfig": {
114
+ "name": "AdvancedTextViewSpec",
115
+ "type": "all",
116
+ "jsSrcsDir": "src",
117
+ "android": {
118
+ "javaPackageName": "com.advancedtext"
119
+ },
120
+ "ios": {
121
+ "componentProvider": {
122
+ "AdvancedTextView": "AdvancedTextView"
123
+ }
124
+ }
125
+ },
126
+ "prettier": {
127
+ "quoteProps": "consistent",
128
+ "singleQuote": true,
129
+ "tabWidth": 2,
130
+ "trailingComma": "es5",
131
+ "useTabs": false
132
+ },
133
+ "commitlint": {
134
+ "extends": [
135
+ "@commitlint/config-conventional"
136
+ ]
137
+ },
138
+ "release-it": {
139
+ "git": {
140
+ "commitMessage": "chore: release ${version}",
141
+ "tagName": "v${version}"
142
+ },
143
+ "npm": {
144
+ "publish": true
145
+ },
146
+ "github": {
147
+ "release": true
148
+ },
149
+ "plugins": {
150
+ "@release-it/conventional-changelog": {
151
+ "preset": {
152
+ "name": "angular"
153
+ }
154
+ }
155
+ }
156
+ },
157
+ "jest": {
158
+ "preset": "react-native",
159
+ "modulePathIgnorePatterns": [
160
+ "<rootDir>/example/node_modules",
161
+ "<rootDir>/lib/"
162
+ ]
163
+ },
164
+ "create-react-native-library": {
165
+ "languages": "kotlin-objc",
166
+ "type": "fabric-view",
167
+ "tools": [
168
+ "eslint",
169
+ "lefthook",
170
+ "release-it",
171
+ "jest"
172
+ ],
173
+ "version": "0.55.1"
174
+ }
175
+ }
@@ -1,4 +1,10 @@
1
- import type { NativeSyntheticEvent, ViewProps } from 'react-native';
1
+ import React from 'react';
2
+ import type {
3
+ NativeSyntheticEvent,
4
+ StyleProp,
5
+ ViewProps,
6
+ ViewStyle,
7
+ } from 'react-native';
2
8
  import AdvancedTextViewNativeComponent from './AdvancedTextViewNativeComponent';
3
9
 
4
10
  interface HighlightedWord {
@@ -6,30 +12,40 @@ interface HighlightedWord {
6
12
  highlightColor: string;
7
13
  }
8
14
 
15
+ interface WordPressEvent {
16
+ word: string;
17
+ index: number;
18
+ }
19
+
20
+ interface SelectionEvent {
21
+ selectedText: string;
22
+ event: string;
23
+ }
24
+
9
25
  interface NativeProps extends ViewProps {
10
26
  text: string;
27
+ style?: StyleProp<ViewStyle>;
11
28
  highlightedWords?: ReadonlyArray<HighlightedWord>;
12
-
13
29
  menuOptions?: ReadonlyArray<string>;
14
- onWordPress?: (
15
- event: NativeSyntheticEvent<{ word: string; index: string }>
16
- ) => void;
17
- onSelection?: (
18
- event: NativeSyntheticEvent<{ selectedText: string; event: string }>
19
- ) => void;
30
+ onWordPress?: (event: NativeSyntheticEvent<WordPressEvent>) => void;
31
+ onSelection?: (event: NativeSyntheticEvent<SelectionEvent>) => void;
20
32
  indicatorWordIndex?: number;
21
33
  }
22
34
 
23
35
  export const AdvancedText: React.FC<NativeProps> = ({
24
36
  text,
37
+ style,
25
38
  highlightedWords,
26
39
  menuOptions,
27
40
  onWordPress,
28
41
  onSelection,
29
42
  indicatorWordIndex,
43
+ ...restProps
30
44
  }) => {
31
45
  return (
32
46
  <AdvancedTextViewNativeComponent
47
+ {...restProps}
48
+ style={style}
33
49
  text={text}
34
50
  highlightedWords={highlightedWords}
35
51
  menuOptions={menuOptions}
@@ -1,8 +1,8 @@
1
+ /* eslint-disable prettier/prettier */
1
2
  import type { ViewProps } from 'react-native';
2
3
  import { codegenNativeComponent } from 'react-native';
3
4
  // @ts-ignore
4
- // eslint-disable-next-line prettier/prettier
5
- import type { DirectEventHandler, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
5
+ import type { DirectEventHandler, Int32} from 'react-native/Libraries/Types/CodegenTypes';
6
6
 
7
7
  interface HighlightedWord {
8
8
  index: Int32;
@@ -13,8 +13,8 @@ interface NativeProps extends ViewProps {
13
13
  text: string;
14
14
  highlightedWords?: ReadonlyArray<HighlightedWord>;
15
15
  menuOptions?: ReadonlyArray<string>;
16
- onWordPress?: DirectEventHandler<{ word: string }>;
17
- onSelection?: DirectEventHandler<{ selectedText: string; eventType: string }>;
16
+ onWordPress?: DirectEventHandler<{ word: string; index: Int32 }>;
17
+ onSelection?: DirectEventHandler<{ selectedText: string; event: string }>;
18
18
  indicatorWordIndex?: Int32;
19
19
  }
20
20