@bsky.app/react-native-uitextview 2.3.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/LICENSE +20 -0
- package/README.md +188 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/CMakeLists.txt +28 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNUITextViewSpec-generated.cpp +22 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/RNUITextViewSpec.h +24 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/ComponentDescriptors.cpp +23 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/ComponentDescriptors.h +25 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/EventEmitters.cpp +61 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/EventEmitters.h +49 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/Props.cpp +151 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/Props.h +236 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/RNUITextViewSpecJSI.h +19 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/ShadowNodes.cpp +18 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/ShadowNodes.h +43 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/States.cpp +16 -0
- package/android/generated/android/app/build/generated/source/codegen/jni/react/renderer/components/RNUITextViewSpec/States.h +22 -0
- package/ios/RNUITextView.h +13 -0
- package/ios/RNUITextView.mm +338 -0
- package/ios/RNUITextViewChild.h +24 -0
- package/ios/RNUITextViewChild.mm +72 -0
- package/ios/RNUITextViewChildComponentDescriptor.h +13 -0
- package/ios/RNUITextViewChildShadowNode.cpp +6 -0
- package/ios/RNUITextViewChildShadowNode.h +16 -0
- package/ios/RNUITextViewComponentDescriptor.h +13 -0
- package/ios/RNUITextViewManager.mm +36 -0
- package/ios/RNUITextViewShadowNode.cpp +139 -0
- package/ios/RNUITextViewShadowNode.h +48 -0
- package/ios/generated/build/generated/ios/ReactCodegen/RNUITextViewSpec/RNUITextViewSpec-generated.mm +16 -0
- package/ios/generated/build/generated/ios/ReactCodegen/RNUITextViewSpec/RNUITextViewSpec.h +38 -0
- package/ios/generated/build/generated/ios/ReactCodegen/RNUITextViewSpecJSI.h +19 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/ComponentDescriptors.cpp +23 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/ComponentDescriptors.h +25 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/EventEmitters.cpp +61 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/EventEmitters.h +49 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/Props.cpp +151 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/Props.h +236 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/RCTComponentViewHelpers.h +24 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/ShadowNodes.cpp +18 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/ShadowNodes.h +43 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/States.cpp +16 -0
- package/ios/generated/build/generated/ios/ReactCodegen/react/renderer/components/RNUITextViewSpec/States.h +22 -0
- package/lib/commonjs/RNUITextViewChildNativeComponent.ts +49 -0
- package/lib/commonjs/RNUITextViewNativeComponent.ts +53 -0
- package/lib/commonjs/Text.js +111 -0
- package/lib/commonjs/Text.js.map +1 -0
- package/lib/commonjs/Text.web.js +23 -0
- package/lib/commonjs/Text.web.js.map +1 -0
- package/lib/commonjs/index.js +17 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/util.js +66 -0
- package/lib/commonjs/util.js.map +1 -0
- package/lib/module/RNUITextViewChildNativeComponent.ts +49 -0
- package/lib/module/RNUITextViewNativeComponent.ts +53 -0
- package/lib/module/Text.js +106 -0
- package/lib/module/Text.js.map +1 -0
- package/lib/module/Text.web.js +19 -0
- package/lib/module/Text.web.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/util.js +62 -0
- package/lib/module/util.js.map +1 -0
- package/lib/typescript/commonjs/example/src/App.d.ts +3 -0
- package/lib/typescript/commonjs/example/src/App.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/RNUITextViewChildNativeComponent.d.ts +29 -0
- package/lib/typescript/commonjs/src/RNUITextViewChildNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/RNUITextViewNativeComponent.d.ts +43 -0
- package/lib/typescript/commonjs/src/RNUITextViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Text.d.ts +25 -0
- package/lib/typescript/commonjs/src/Text.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Text.web.d.ts +19 -0
- package/lib/typescript/commonjs/src/Text.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/util.d.ts +163 -0
- package/lib/typescript/commonjs/src/util.d.ts.map +1 -0
- package/lib/typescript/module/example/src/App.d.ts +3 -0
- package/lib/typescript/module/example/src/App.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/RNUITextViewChildNativeComponent.d.ts +29 -0
- package/lib/typescript/module/src/RNUITextViewChildNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/RNUITextViewNativeComponent.d.ts +43 -0
- package/lib/typescript/module/src/RNUITextViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/Text.d.ts +25 -0
- package/lib/typescript/module/src/Text.d.ts.map +1 -0
- package/lib/typescript/module/src/Text.web.d.ts +19 -0
- package/lib/typescript/module/src/Text.web.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +2 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/util.d.ts +163 -0
- package/lib/typescript/module/src/util.d.ts.map +1 -0
- package/package.json +185 -0
- package/react-native-uitextview.podspec +34 -0
- package/react-native.config.js +28 -0
- package/scripts/ensure-rnc-cli-executable.js +19 -0
- package/src/RNUITextViewChildNativeComponent.ts +49 -0
- package/src/RNUITextViewNativeComponent.ts +53 -0
- package/src/Text.tsx +125 -0
- package/src/Text.web.tsx +22 -0
- package/src/index.tsx +1 -0
- package/src/util.ts +67 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { Platform, StyleSheet, Text as RNText } from 'react-native';
|
|
5
|
+
import RNUITextViewChildNativeComponent from './RNUITextViewChildNativeComponent';
|
|
6
|
+
import RNUITextViewNativeComponent from './RNUITextViewNativeComponent';
|
|
7
|
+
import { flattenStyles } from "./util.js";
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
const TextAncestorContext = /*#__PURE__*/React.createContext([false, StyleSheet.create({})]);
|
|
10
|
+
const textDefaults = {
|
|
11
|
+
allowFontScaling: true,
|
|
12
|
+
selectable: true
|
|
13
|
+
};
|
|
14
|
+
const useTextAncestorContext = () => React.useContext(TextAncestorContext);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Event fired by `onSelectionChange`. `start`/`end` are 0-based UTF-16 indices
|
|
18
|
+
* into the rendered string. `start === end` means the selection was cleared.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
function UITextViewChild({
|
|
22
|
+
style,
|
|
23
|
+
children,
|
|
24
|
+
...rest
|
|
25
|
+
}) {
|
|
26
|
+
const [isAncestor, rootStyle] = useTextAncestorContext();
|
|
27
|
+
|
|
28
|
+
// Flatten the styles, and apply the root styles when needed
|
|
29
|
+
const flattenedStyle = React.useMemo(() => flattenStyles(rootStyle, style), [rootStyle, style]);
|
|
30
|
+
if (!isAncestor) {
|
|
31
|
+
return /*#__PURE__*/_jsx(TextAncestorContext.Provider, {
|
|
32
|
+
value: [true, flattenedStyle],
|
|
33
|
+
children: /*#__PURE__*/_jsx(RNUITextViewNativeComponent, {
|
|
34
|
+
...textDefaults,
|
|
35
|
+
...rest,
|
|
36
|
+
// ellipsizeMode={rest.ellipsizeMode ?? rest.lineBreakMode ?? 'tail'}
|
|
37
|
+
style: [flattenedStyle]
|
|
38
|
+
// @ts-expect-error Weirdness
|
|
39
|
+
,
|
|
40
|
+
onPress: undefined,
|
|
41
|
+
onLongPress: undefined,
|
|
42
|
+
children: React.Children.toArray(children).map((c, index) => {
|
|
43
|
+
if (/*#__PURE__*/React.isValidElement(c)) {
|
|
44
|
+
return c;
|
|
45
|
+
} else if (typeof c === 'string' || typeof c === 'number') {
|
|
46
|
+
return (
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
// @ts-expect-error @TODO fix this type
|
|
49
|
+
_jsx(RNUITextViewChildNativeComponent, {
|
|
50
|
+
style: flattenedStyle,
|
|
51
|
+
text: c.toString(),
|
|
52
|
+
...rest
|
|
53
|
+
}, index)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
} else {
|
|
61
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
62
|
+
children: React.Children.toArray(children).map((c, index) => {
|
|
63
|
+
if (/*#__PURE__*/React.isValidElement(c)) {
|
|
64
|
+
return c;
|
|
65
|
+
} else if (typeof c === 'string' || typeof c === 'number') {
|
|
66
|
+
return (
|
|
67
|
+
/*#__PURE__*/
|
|
68
|
+
// @ts-expect-error @TODO fix this type
|
|
69
|
+
_jsx(RNUITextViewChildNativeComponent, {
|
|
70
|
+
style: flattenedStyle,
|
|
71
|
+
text: c.toString(),
|
|
72
|
+
...rest
|
|
73
|
+
}, index)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function UITextViewInner(props) {
|
|
82
|
+
const [isAncestor] = useTextAncestorContext();
|
|
83
|
+
|
|
84
|
+
// Even if the uiTextView prop is set, we can still default to using
|
|
85
|
+
// normal selection (i.e. base RN text) if the text doesn't need to be
|
|
86
|
+
// selectable
|
|
87
|
+
if ((!props.selectable || !props.uiTextView) && !isAncestor) {
|
|
88
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return /*#__PURE__*/_jsx(UITextViewChild, {
|
|
93
|
+
...props
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export function UITextView(props) {
|
|
97
|
+
if (Platform.OS !== 'ios') {
|
|
98
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return /*#__PURE__*/_jsx(UITextViewInner, {
|
|
103
|
+
...props
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","Text","RNText","RNUITextViewChildNativeComponent","RNUITextViewNativeComponent","flattenStyles","jsx","_jsx","Fragment","_Fragment","TextAncestorContext","createContext","create","textDefaults","allowFontScaling","selectable","useTextAncestorContext","useContext","UITextViewChild","style","children","rest","isAncestor","rootStyle","flattenedStyle","useMemo","Provider","value","onPress","undefined","onLongPress","Children","toArray","map","c","index","isValidElement","text","toString","UITextViewInner","props","uiTextView","UITextView","OS"],"sourceRoot":"../../src","sources":["Text.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,QAAQ,EACRC,UAAU,EACVC,IAAI,IAAIC,MAAM,QAGT,cAAc;AACrB,OAAOC,gCAAgC,MAAM,oCAAoC;AACjF,OAAOC,2BAA2B,MAAM,+BAA+B;AACvE,SAAQC,aAAa,QAAO,WAAQ;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAEpC,MAAMC,mBAAmB,gBAAGZ,KAAK,CAACa,aAAa,CAAuB,CACpE,KAAK,EACLX,UAAU,CAACY,MAAM,CAAC,CAAC,CAAC,CAAC,CACtB,CAAC;AAEF,MAAMC,YAAuB,GAAG;EAC9BC,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE;AACd,CAAC;AAED,MAAMC,sBAAsB,GAAGA,CAAA,KAAMlB,KAAK,CAACmB,UAAU,CAACP,mBAAmB,CAAC;;AAE1E;AACA;AACA;AACA;;AAgBA,SAASQ,eAAeA,CAAC;EAACC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAqB,CAAC,EAAE;EACpE,MAAM,CAACC,UAAU,EAAEC,SAAS,CAAC,GAAGP,sBAAsB,CAAC,CAAC;;EAExD;EACA,MAAMQ,cAAc,GAAG1B,KAAK,CAAC2B,OAAO,CAClC,MAAMpB,aAAa,CAACkB,SAAS,EAAEJ,KAAK,CAAC,EACrC,CAACI,SAAS,EAAEJ,KAAK,CACnB,CAAC;EAED,IAAI,CAACG,UAAU,EAAE;IACf,oBACEf,IAAA,CAACG,mBAAmB,CAACgB,QAAQ;MAACC,KAAK,EAAE,CAAC,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;QAEN;QAEA,OAAO,IAAI;MACb,CAAC;IAAC,CACF,CAAC;EAEP;AACF;AAEA,SAASI,eAAeA,CAACC,KAAsB,EAAE;EAC/C,MAAM,CAAClB,UAAU,CAAC,GAAGN,sBAAsB,CAAC,CAAC;;EAE7C;EACA;EACA;EACA,IAAI,CAAC,CAACwB,KAAK,CAACzB,UAAU,IAAI,CAACyB,KAAK,CAACC,UAAU,KAAK,CAACnB,UAAU,EAAE;IAC3D,oBAAOf,IAAA,CAACL,MAAM;MAAA,GAAKsC;IAAK,CAAG,CAAC;EAC9B;EACA,oBAAOjC,IAAA,CAACW,eAAe;IAAA,GAAKsB;EAAK,CAAG,CAAC;AACvC;AAEA,OAAO,SAASE,UAAUA,CAACF,KAAsB,EAAE;EACjD,IAAIzC,QAAQ,CAAC4C,EAAE,KAAK,KAAK,EAAE;IACzB,oBAAOpC,IAAA,CAACL,MAAM;MAAA,GAAKsC;IAAK,CAAG,CAAC;EAC9B;EACA,oBAAOjC,IAAA,CAACgC,eAAe;IAAA,GAAKC;EAAK,CAAG,CAAC;AACvC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Text as RNText } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Event fired by `onSelectionChange`. This event is only available when using
|
|
7
|
+
* the native UITextView implementation on iOS.
|
|
8
|
+
*/
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
export function UITextView({
|
|
11
|
+
uiTextView: _uiTextView,
|
|
12
|
+
onSelectionChange: _onSelectionChange,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /*#__PURE__*/_jsx(RNText, {
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=Text.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Text","RNText","jsx","_jsx","UITextView","uiTextView","_uiTextView","onSelectionChange","_onSelectionChange","props"],"sourceRoot":"../../src","sources":["Text.web.tsx"],"mappings":";;AAAA,SAAQA,IAAI,IAAIC,MAAM,QAAuB,cAAc;;AAE3D;AACA;AACA;AACA;AAHA,SAAAC,GAAA,IAAAC,IAAA;AAaA,OAAO,SAASC,UAAUA,CAAC;EACzBC,UAAU,EAAEC,WAAW;EACvBC,iBAAiB,EAAEC,kBAAkB;EACrC,GAAGC;AACY,CAAC,EAAE;EAClB,oBAAON,IAAA,CAACF,MAAM;IAAA,GAAKQ;EAAK,CAAG,CAAC;AAC9B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
export function flattenStyles(rootStyle, style) {
|
|
5
|
+
const flattenedStyle = StyleSheet.flatten([rootStyle, style]);
|
|
6
|
+
return {
|
|
7
|
+
...flattenedStyle,
|
|
8
|
+
fontWeight: fontWeightToNativeProp(flattenedStyle.fontWeight ?? 'normal'),
|
|
9
|
+
backgroundColor: flattenedStyle.backgroundColor ? flattenedStyle.backgroundColor : 'transparent',
|
|
10
|
+
shadowOffset: flattenedStyle.shadowOffset ? flattenedStyle.shadowOffset : {
|
|
11
|
+
width: 0,
|
|
12
|
+
height: 0
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Codegen doesn't like using integer values for enums (c++ L) so we'll conver them to the proper native prop
|
|
18
|
+
// value before returning flattened styles.
|
|
19
|
+
function fontWeightToNativeProp(fontWeight) {
|
|
20
|
+
switch (fontWeight) {
|
|
21
|
+
case 'normal':
|
|
22
|
+
return 'normal';
|
|
23
|
+
case 'bold':
|
|
24
|
+
return 'bold';
|
|
25
|
+
case 100:
|
|
26
|
+
case '100':
|
|
27
|
+
case 'ultralight':
|
|
28
|
+
return 'ultraLight';
|
|
29
|
+
case 200:
|
|
30
|
+
case '200':
|
|
31
|
+
return 'ultraLight';
|
|
32
|
+
case 300:
|
|
33
|
+
case '300':
|
|
34
|
+
case 'light':
|
|
35
|
+
return 'light';
|
|
36
|
+
case 400:
|
|
37
|
+
case '400':
|
|
38
|
+
case 'regular':
|
|
39
|
+
return 'normal';
|
|
40
|
+
case 500:
|
|
41
|
+
case '500':
|
|
42
|
+
case 'medium':
|
|
43
|
+
return 'medium';
|
|
44
|
+
case 600:
|
|
45
|
+
case '600':
|
|
46
|
+
case 'semibold':
|
|
47
|
+
return 'semibold';
|
|
48
|
+
case 700:
|
|
49
|
+
case '700':
|
|
50
|
+
return 'semibold';
|
|
51
|
+
case 800:
|
|
52
|
+
case '800':
|
|
53
|
+
return 'bold';
|
|
54
|
+
case 900:
|
|
55
|
+
case '900':
|
|
56
|
+
case 'heavy':
|
|
57
|
+
return 'heavy';
|
|
58
|
+
default:
|
|
59
|
+
return 'normal';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","flattenStyles","rootStyle","style","flattenedStyle","flatten","fontWeight","fontWeightToNativeProp","backgroundColor","shadowOffset","width","height"],"sourceRoot":"../../src","sources":["util.ts"],"mappings":";;AAAA,SAAwBA,UAAU,QAAuB,cAAc;AAGvE,OAAO,SAASC,aAAaA,CAC3BC,SAAoB,EACpBC,KAA2B,EAC3B;EACA,MAAMC,cAAc,GAAGJ,UAAU,CAACK,OAAO,CAAC,CAACH,SAAS,EAAEC,KAAK,CAAC,CAAc;EAC1E,OAAO;IACL,GAAGC,cAAc;IACjBE,UAAU,EAAEC,sBAAsB,CAACH,cAAc,CAACE,UAAU,IAAI,QAAQ,CAAC;IACzEE,eAAe,EAAEJ,cAAc,CAACI,eAAe,GAC3CJ,cAAc,CAACI,eAAe,GAC9B,aAAa;IACjBC,YAAY,EAAEL,cAAc,CAACK,YAAY,GACrCL,cAAc,CAACK,YAAY,GAC3B;MAACC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAC;EAC1B,CAAC;AACH;;AAEA;AACA;AACA,SAASJ,sBAAsBA,CAC7BD,UAAmC,EACjB;EAClB,QAAQA,UAAU;IAChB,KAAK,QAAQ;MACX,OAAO,QAAQ;IACjB,KAAK,MAAM;MACT,OAAO,MAAM;IACf,KAAK,GAAG;IACR,KAAK,KAAK;IACV,KAAK,YAAY;MACf,OAAO,YAAY;IACrB,KAAK,GAAG;IACR,KAAK,KAAK;MACR,OAAO,YAAY;IACrB,KAAK,GAAG;IACR,KAAK,KAAK;IACV,KAAK,OAAO;MACV,OAAO,OAAO;IAChB,KAAK,GAAG;IACR,KAAK,KAAK;IACV,KAAK,SAAS;MACZ,OAAO,QAAQ;IACjB,KAAK,GAAG;IACR,KAAK,KAAK;IACV,KAAK,QAAQ;MACX,OAAO,QAAQ;IACjB,KAAK,GAAG;IACR,KAAK,KAAK;IACV,KAAK,UAAU;MACb,OAAO,UAAU;IACnB,KAAK,GAAG;IACR,KAAK,KAAK;MACR,OAAO,UAAU;IACnB,KAAK,GAAG;IACR,KAAK,KAAK;MACR,OAAO,MAAM;IACf,KAAK,GAAG;IACR,KAAK,KAAK;IACV,KAAK,OAAO;MACV,OAAO,OAAO;IAChB;MACE,OAAO,QAAQ;EACnB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../example/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8E9B,MAAM,CAAC,OAAO,UAAU,GAAG,sBA8sB1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
|
|
2
|
+
interface TargetedEvent {
|
|
3
|
+
target: CodegenTypes.Int32;
|
|
4
|
+
}
|
|
5
|
+
type TextDecorationLine = 'none' | 'underline' | 'line-through';
|
|
6
|
+
type TextDecorationStyle = 'solid' | 'double' | 'dotted' | 'dashed';
|
|
7
|
+
export type NativeFontWeight = 'normal' | 'bold' | 'ultraLight' | 'light' | 'medium' | 'semibold' | 'heavy';
|
|
8
|
+
type FontStyle = 'normal' | 'italic';
|
|
9
|
+
type TextAlign = 'auto' | 'left' | 'right' | 'center' | 'justify';
|
|
10
|
+
interface NativeProps extends ViewProps {
|
|
11
|
+
text: string;
|
|
12
|
+
color?: ColorValue;
|
|
13
|
+
fontSize?: CodegenTypes.Float;
|
|
14
|
+
fontStyle?: CodegenTypes.WithDefault<FontStyle, 'normal'>;
|
|
15
|
+
fontWeight?: CodegenTypes.WithDefault<NativeFontWeight, 'normal'>;
|
|
16
|
+
fontFamily?: string;
|
|
17
|
+
letterSpacing?: CodegenTypes.Float;
|
|
18
|
+
lineHeight?: CodegenTypes.Float;
|
|
19
|
+
textDecorationLine?: CodegenTypes.WithDefault<TextDecorationLine, 'none'>;
|
|
20
|
+
textDecorationStyle?: CodegenTypes.WithDefault<TextDecorationStyle, 'solid'>;
|
|
21
|
+
textDecorationColor?: ColorValue;
|
|
22
|
+
textAlign?: CodegenTypes.WithDefault<TextAlign, 'auto'>;
|
|
23
|
+
shadowRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
|
|
24
|
+
onPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
|
|
25
|
+
onLongPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
28
|
+
export default _default;
|
|
29
|
+
//# sourceMappingURL=RNUITextViewChildNativeComponent.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AAC,EAAE,YAAY,CAAC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAA;IAC5E,mBAAmB,CAAC,EAAE,UAAU,CAAA;IAChC,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IACvD,YAAY,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC9D,OAAO,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;IAC1D,WAAW,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;CAC/D;;AAED,wBAEE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type CodegenTypes, type ViewProps } from 'react-native';
|
|
2
|
+
interface TargetedEvent {
|
|
3
|
+
target: CodegenTypes.Int32;
|
|
4
|
+
}
|
|
5
|
+
interface TextLayoutEvent extends TargetedEvent {
|
|
6
|
+
lines: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Event fired when text selection changes in the UITextView.
|
|
10
|
+
* @property target - The view tag identifier
|
|
11
|
+
* @property start - The start index of the selected range (0-based)
|
|
12
|
+
* @property end - The end index of the selected range (0-based, exclusive)
|
|
13
|
+
*/
|
|
14
|
+
interface SelectionChangeEvent extends TargetedEvent {
|
|
15
|
+
start: CodegenTypes.Int32;
|
|
16
|
+
end: CodegenTypes.Int32;
|
|
17
|
+
}
|
|
18
|
+
type EllipsizeMode = 'head' | 'middle' | 'tail' | 'clip';
|
|
19
|
+
interface NativeProps extends ViewProps {
|
|
20
|
+
numberOfLines?: CodegenTypes.Int32;
|
|
21
|
+
allowFontScaling?: CodegenTypes.WithDefault<boolean, true>;
|
|
22
|
+
ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>;
|
|
23
|
+
selectable?: boolean;
|
|
24
|
+
onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>;
|
|
25
|
+
/**
|
|
26
|
+
* Callback fired when the text selection changes.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <UITextView
|
|
31
|
+
* onSelectionChange={(event) => {
|
|
32
|
+
* console.log('Selection:', event.nativeEvent.start, event.nativeEvent.end);
|
|
33
|
+
* }}
|
|
34
|
+
* >
|
|
35
|
+
* Selectable text
|
|
36
|
+
* </UITextView>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
onSelectionChange?: CodegenTypes.BubblingEventHandler<SelectionChangeEvent>;
|
|
40
|
+
}
|
|
41
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
42
|
+
export default _default;
|
|
43
|
+
//# sourceMappingURL=RNUITextViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RNUITextViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/RNUITextViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAErB,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,CAAC,KAAK,CAAA;CAC3B;AAED,UAAU,eAAgB,SAAQ,aAAa;IAC7C,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED;;;;;GAKG;AACH,UAAU,oBAAqB,SAAQ,aAAa;IAClD,KAAK,EAAE,YAAY,CAAC,KAAK,CAAA;IACzB,GAAG,EAAE,YAAY,CAAC,KAAK,CAAA;CACxB;AAED,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAA;AAExD,UAAU,WAAY,SAAQ,SAAS;IACrC,aAAa,CAAC,EAAE,YAAY,CAAC,KAAK,CAAA;IAClC,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC1D,aAAa,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAA;IACjE;;;;;;;;;;;;;OAaG;IACH,iBAAiB,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;CAC5E;;AAED,wBAEE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type TextProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Event fired by `onSelectionChange`. `start`/`end` are 0-based UTF-16 indices
|
|
4
|
+
* into the rendered string. `start === end` means the selection was cleared.
|
|
5
|
+
*/
|
|
6
|
+
export type SelectionChangeEvent = {
|
|
7
|
+
nativeEvent: {
|
|
8
|
+
target: number;
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type UITextViewProps = TextProps & {
|
|
14
|
+
uiTextView?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Fired when the native text selection changes. Only fires on iOS when
|
|
17
|
+
* `uiTextView` is true. Note: fires on every selection-edge adjustment
|
|
18
|
+
* (e.g. dragging a selection handle), so consumers driving expensive work
|
|
19
|
+
* off this event should debounce.
|
|
20
|
+
*/
|
|
21
|
+
onSelectionChange?: (event: SelectionChangeEvent) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare function UITextView(props: UITextViewProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAiBrB;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAA;CAC1D,CAAA;AAED,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAC1D,CAAA;AA8ED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAKhD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type TextProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Event fired by `onSelectionChange`. This event is only available when using
|
|
4
|
+
* the native UITextView implementation on iOS.
|
|
5
|
+
*/
|
|
6
|
+
export type SelectionChangeEvent = {
|
|
7
|
+
nativeEvent: {
|
|
8
|
+
target: number;
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
type UITextViewProps = TextProps & {
|
|
14
|
+
uiTextView?: boolean;
|
|
15
|
+
onSelectionChange?: (event: SelectionChangeEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare function UITextView({ uiTextView: _uiTextView, onSelectionChange: _onSelectionChange, ...props }: UITextViewProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Text.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.web.d.ts","sourceRoot":"","sources":["../../../../src/Text.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAC,MAAM,cAAc,CAAA;AAE3D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAA;CAC1D,CAAA;AAED,KAAK,eAAe,GAAG,SAAS,GAAG;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAA;CAC1D,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,UAAU,EAAE,WAAW,EACvB,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,KAAK,EACT,EAAE,eAAe,+BAEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { type StyleProp, type TextStyle } from 'react-native';
|
|
2
|
+
import type { NativeFontWeight } from './RNUITextViewChildNativeComponent';
|
|
3
|
+
export declare function flattenStyles(rootStyle: TextStyle, style: StyleProp<TextStyle>): {
|
|
4
|
+
fontWeight: NativeFontWeight;
|
|
5
|
+
backgroundColor: import("react-native").ColorValue;
|
|
6
|
+
shadowOffset: Readonly<{
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}>;
|
|
10
|
+
color?: import("react-native").ColorValue | undefined;
|
|
11
|
+
fontFamily?: string | undefined;
|
|
12
|
+
fontSize?: number | undefined;
|
|
13
|
+
fontStyle?: "normal" | "italic" | undefined;
|
|
14
|
+
letterSpacing?: number | undefined;
|
|
15
|
+
lineHeight?: number | undefined;
|
|
16
|
+
textAlign?: "auto" | "left" | "right" | "center" | "justify" | undefined;
|
|
17
|
+
textDecorationLine?: "none" | "underline" | "line-through" | "underline line-through" | undefined;
|
|
18
|
+
textDecorationStyle?: "solid" | "double" | "dotted" | "dashed" | undefined;
|
|
19
|
+
textDecorationColor?: import("react-native").ColorValue | undefined;
|
|
20
|
+
textShadowColor?: import("react-native").ColorValue | undefined;
|
|
21
|
+
textShadowOffset?: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
} | undefined;
|
|
25
|
+
textShadowRadius?: number | undefined;
|
|
26
|
+
textTransform?: "none" | "capitalize" | "uppercase" | "lowercase" | undefined;
|
|
27
|
+
userSelect?: "auto" | "none" | "text" | "contain" | "all" | undefined;
|
|
28
|
+
fontVariant?: import("react-native").FontVariant[] | undefined;
|
|
29
|
+
writingDirection?: "auto" | "ltr" | "rtl" | undefined;
|
|
30
|
+
backfaceVisibility?: "visible" | "hidden" | undefined;
|
|
31
|
+
borderBlockColor?: import("react-native").ColorValue | undefined;
|
|
32
|
+
borderBlockEndColor?: import("react-native").ColorValue | undefined;
|
|
33
|
+
borderBlockStartColor?: import("react-native").ColorValue | undefined;
|
|
34
|
+
borderBottomColor?: import("react-native").ColorValue | undefined;
|
|
35
|
+
borderBottomEndRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
36
|
+
borderBottomLeftRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
37
|
+
borderBottomRightRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
38
|
+
borderBottomStartRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
39
|
+
borderColor?: import("react-native").ColorValue | undefined;
|
|
40
|
+
borderCurve?: "circular" | "continuous" | undefined;
|
|
41
|
+
borderEndColor?: import("react-native").ColorValue | undefined;
|
|
42
|
+
borderEndEndRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
43
|
+
borderEndStartRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
44
|
+
borderLeftColor?: import("react-native").ColorValue | undefined;
|
|
45
|
+
borderRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
46
|
+
borderRightColor?: import("react-native").ColorValue | undefined;
|
|
47
|
+
borderStartColor?: import("react-native").ColorValue | undefined;
|
|
48
|
+
borderStartEndRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
49
|
+
borderStartStartRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
50
|
+
borderStyle?: "solid" | "dotted" | "dashed" | undefined;
|
|
51
|
+
borderTopColor?: import("react-native").ColorValue | undefined;
|
|
52
|
+
borderTopEndRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
53
|
+
borderTopLeftRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
54
|
+
borderTopRightRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
55
|
+
borderTopStartRadius?: import("react-native").AnimatableNumericValue | string | undefined;
|
|
56
|
+
outlineColor?: import("react-native").ColorValue | undefined;
|
|
57
|
+
outlineOffset?: import("react-native").AnimatableNumericValue | undefined;
|
|
58
|
+
outlineStyle?: "solid" | "dotted" | "dashed" | undefined;
|
|
59
|
+
outlineWidth?: import("react-native").AnimatableNumericValue | undefined;
|
|
60
|
+
opacity?: import("react-native").AnimatableNumericValue | undefined;
|
|
61
|
+
elevation?: number | undefined;
|
|
62
|
+
pointerEvents?: "box-none" | "none" | "box-only" | "auto" | undefined;
|
|
63
|
+
isolation?: "auto" | "isolate" | undefined;
|
|
64
|
+
cursor?: import("react-native").CursorValue | undefined;
|
|
65
|
+
boxShadow?: ReadonlyArray<import("react-native").BoxShadowValue> | string | undefined;
|
|
66
|
+
filter?: ReadonlyArray<import("react-native").FilterFunction> | string | undefined;
|
|
67
|
+
mixBlendMode?: import("react-native").BlendMode | undefined;
|
|
68
|
+
experimental_backgroundImage?: ReadonlyArray<import("react-native").BackgroundImageValue> | string | undefined;
|
|
69
|
+
experimental_backgroundSize?: ReadonlyArray<import("react-native").BackgroundSizeValue> | string | undefined;
|
|
70
|
+
experimental_backgroundPosition?: ReadonlyArray<import("react-native").BackgroundPositionValue> | string | undefined;
|
|
71
|
+
experimental_backgroundRepeat?: ReadonlyArray<import("react-native").BackgroundRepeatValue> | string | undefined;
|
|
72
|
+
alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
73
|
+
alignItems?: import("react-native").FlexAlignType | undefined;
|
|
74
|
+
alignSelf?: "auto" | import("react-native").FlexAlignType | undefined;
|
|
75
|
+
aspectRatio?: number | string | undefined;
|
|
76
|
+
borderBottomWidth?: number | undefined;
|
|
77
|
+
borderEndWidth?: number | undefined;
|
|
78
|
+
borderLeftWidth?: number | undefined;
|
|
79
|
+
borderRightWidth?: number | undefined;
|
|
80
|
+
borderStartWidth?: number | undefined;
|
|
81
|
+
borderTopWidth?: number | undefined;
|
|
82
|
+
borderWidth?: number | undefined;
|
|
83
|
+
bottom?: import("react-native").DimensionValue | undefined;
|
|
84
|
+
boxSizing?: "border-box" | "content-box" | undefined;
|
|
85
|
+
display?: "none" | "flex" | "contents" | undefined;
|
|
86
|
+
end?: import("react-native").DimensionValue | undefined;
|
|
87
|
+
flex?: number | undefined;
|
|
88
|
+
flexBasis?: import("react-native").DimensionValue | undefined;
|
|
89
|
+
flexDirection?: "row" | "column" | "row-reverse" | "column-reverse" | undefined;
|
|
90
|
+
rowGap?: number | string | undefined;
|
|
91
|
+
gap?: number | string | undefined;
|
|
92
|
+
columnGap?: number | string | undefined;
|
|
93
|
+
flexGrow?: number | undefined;
|
|
94
|
+
flexShrink?: number | undefined;
|
|
95
|
+
flexWrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
|
|
96
|
+
height?: import("react-native").DimensionValue | undefined;
|
|
97
|
+
justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly" | undefined;
|
|
98
|
+
left?: import("react-native").DimensionValue | undefined;
|
|
99
|
+
margin?: import("react-native").DimensionValue | undefined;
|
|
100
|
+
marginBottom?: import("react-native").DimensionValue | undefined;
|
|
101
|
+
marginEnd?: import("react-native").DimensionValue | undefined;
|
|
102
|
+
marginHorizontal?: import("react-native").DimensionValue | undefined;
|
|
103
|
+
marginLeft?: import("react-native").DimensionValue | undefined;
|
|
104
|
+
marginRight?: import("react-native").DimensionValue | undefined;
|
|
105
|
+
marginStart?: import("react-native").DimensionValue | undefined;
|
|
106
|
+
marginTop?: import("react-native").DimensionValue | undefined;
|
|
107
|
+
marginVertical?: import("react-native").DimensionValue | undefined;
|
|
108
|
+
maxHeight?: import("react-native").DimensionValue | undefined;
|
|
109
|
+
maxWidth?: import("react-native").DimensionValue | undefined;
|
|
110
|
+
minHeight?: import("react-native").DimensionValue | undefined;
|
|
111
|
+
minWidth?: import("react-native").DimensionValue | undefined;
|
|
112
|
+
overflow?: "visible" | "hidden" | "scroll" | undefined;
|
|
113
|
+
padding?: import("react-native").DimensionValue | undefined;
|
|
114
|
+
paddingBottom?: import("react-native").DimensionValue | undefined;
|
|
115
|
+
paddingEnd?: import("react-native").DimensionValue | undefined;
|
|
116
|
+
paddingHorizontal?: import("react-native").DimensionValue | undefined;
|
|
117
|
+
paddingLeft?: import("react-native").DimensionValue | undefined;
|
|
118
|
+
paddingRight?: import("react-native").DimensionValue | undefined;
|
|
119
|
+
paddingStart?: import("react-native").DimensionValue | undefined;
|
|
120
|
+
paddingTop?: import("react-native").DimensionValue | undefined;
|
|
121
|
+
paddingVertical?: import("react-native").DimensionValue | undefined;
|
|
122
|
+
position?: "absolute" | "relative" | "static" | undefined;
|
|
123
|
+
right?: import("react-native").DimensionValue | undefined;
|
|
124
|
+
start?: import("react-native").DimensionValue | undefined;
|
|
125
|
+
top?: import("react-native").DimensionValue | undefined;
|
|
126
|
+
width?: import("react-native").DimensionValue | undefined;
|
|
127
|
+
zIndex?: number | undefined;
|
|
128
|
+
direction?: "inherit" | "ltr" | "rtl" | undefined;
|
|
129
|
+
inset?: import("react-native").DimensionValue | undefined;
|
|
130
|
+
insetBlock?: import("react-native").DimensionValue | undefined;
|
|
131
|
+
insetBlockEnd?: import("react-native").DimensionValue | undefined;
|
|
132
|
+
insetBlockStart?: import("react-native").DimensionValue | undefined;
|
|
133
|
+
insetInline?: import("react-native").DimensionValue | undefined;
|
|
134
|
+
insetInlineEnd?: import("react-native").DimensionValue | undefined;
|
|
135
|
+
insetInlineStart?: import("react-native").DimensionValue | undefined;
|
|
136
|
+
marginBlock?: import("react-native").DimensionValue | undefined;
|
|
137
|
+
marginBlockEnd?: import("react-native").DimensionValue | undefined;
|
|
138
|
+
marginBlockStart?: import("react-native").DimensionValue | undefined;
|
|
139
|
+
marginInline?: import("react-native").DimensionValue | undefined;
|
|
140
|
+
marginInlineEnd?: import("react-native").DimensionValue | undefined;
|
|
141
|
+
marginInlineStart?: import("react-native").DimensionValue | undefined;
|
|
142
|
+
paddingBlock?: import("react-native").DimensionValue | undefined;
|
|
143
|
+
paddingBlockEnd?: import("react-native").DimensionValue | undefined;
|
|
144
|
+
paddingBlockStart?: import("react-native").DimensionValue | undefined;
|
|
145
|
+
paddingInline?: import("react-native").DimensionValue | undefined;
|
|
146
|
+
paddingInlineEnd?: import("react-native").DimensionValue | undefined;
|
|
147
|
+
paddingInlineStart?: import("react-native").DimensionValue | undefined;
|
|
148
|
+
shadowColor?: import("react-native").ColorValue | undefined;
|
|
149
|
+
shadowOpacity?: import("react-native").AnimatableNumericValue | undefined;
|
|
150
|
+
shadowRadius?: number | undefined;
|
|
151
|
+
transform?: Readonly<import("react-native").MaximumOneOf<import("react-native").PerspectiveTransform & import("react-native").RotateTransform & import("react-native").RotateXTransform & import("react-native").RotateYTransform & import("react-native").RotateZTransform & import("react-native").ScaleTransform & import("react-native").ScaleXTransform & import("react-native").ScaleYTransform & import("react-native").TranslateXTransform & import("react-native").TranslateYTransform & import("react-native").SkewXTransform & import("react-native").SkewYTransform & import("react-native").MatrixTransform>[]> | string | undefined;
|
|
152
|
+
transformOrigin?: Array<string | number> | string | undefined;
|
|
153
|
+
transformMatrix?: Array<number> | undefined;
|
|
154
|
+
rotation?: import("react-native").AnimatableNumericValue | undefined;
|
|
155
|
+
scaleX?: import("react-native").AnimatableNumericValue | undefined;
|
|
156
|
+
scaleY?: import("react-native").AnimatableNumericValue | undefined;
|
|
157
|
+
translateX?: import("react-native").AnimatableNumericValue | undefined;
|
|
158
|
+
translateY?: import("react-native").AnimatableNumericValue | undefined;
|
|
159
|
+
textAlignVertical?: "auto" | "top" | "bottom" | "center" | undefined;
|
|
160
|
+
verticalAlign?: "auto" | "top" | "bottom" | "middle" | undefined;
|
|
161
|
+
includeFontPadding?: boolean | undefined;
|
|
162
|
+
};
|
|
163
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,SAAS,EAAc,KAAK,SAAS,EAAC,MAAM,cAAc,CAAA;AACvE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAA;AAExE,wBAAgB,aAAa,CAC3B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../../example/src/App.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8E9B,MAAM,CAAC,OAAO,UAAU,GAAG,sBA8sB1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type CodegenTypes, type ColorValue, type ViewProps } from 'react-native';
|
|
2
|
+
interface TargetedEvent {
|
|
3
|
+
target: CodegenTypes.Int32;
|
|
4
|
+
}
|
|
5
|
+
type TextDecorationLine = 'none' | 'underline' | 'line-through';
|
|
6
|
+
type TextDecorationStyle = 'solid' | 'double' | 'dotted' | 'dashed';
|
|
7
|
+
export type NativeFontWeight = 'normal' | 'bold' | 'ultraLight' | 'light' | 'medium' | 'semibold' | 'heavy';
|
|
8
|
+
type FontStyle = 'normal' | 'italic';
|
|
9
|
+
type TextAlign = 'auto' | 'left' | 'right' | 'center' | 'justify';
|
|
10
|
+
interface NativeProps extends ViewProps {
|
|
11
|
+
text: string;
|
|
12
|
+
color?: ColorValue;
|
|
13
|
+
fontSize?: CodegenTypes.Float;
|
|
14
|
+
fontStyle?: CodegenTypes.WithDefault<FontStyle, 'normal'>;
|
|
15
|
+
fontWeight?: CodegenTypes.WithDefault<NativeFontWeight, 'normal'>;
|
|
16
|
+
fontFamily?: string;
|
|
17
|
+
letterSpacing?: CodegenTypes.Float;
|
|
18
|
+
lineHeight?: CodegenTypes.Float;
|
|
19
|
+
textDecorationLine?: CodegenTypes.WithDefault<TextDecorationLine, 'none'>;
|
|
20
|
+
textDecorationStyle?: CodegenTypes.WithDefault<TextDecorationStyle, 'solid'>;
|
|
21
|
+
textDecorationColor?: ColorValue;
|
|
22
|
+
textAlign?: CodegenTypes.WithDefault<TextAlign, 'auto'>;
|
|
23
|
+
shadowRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 0>;
|
|
24
|
+
onPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
|
|
25
|
+
onLongPress?: CodegenTypes.BubblingEventHandler<TargetedEvent>;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
28
|
+
export default _default;
|
|
29
|
+
//# sourceMappingURL=RNUITextViewChildNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RNUITextViewChildNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/RNUITextViewChildNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,SAAS,EAEf,MAAM,cAAc,CAAA;AAErB,UAAU,aAAa;IACrB,MAAM,EAAE,YAAY,CAAC,K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9D,OAAO,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;IAC1D,WAAW,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;CAC/D;;AAED,wBAEE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type CodegenTypes, type ViewProps } from 'react-native';
|
|
2
|
+
interface TargetedEvent {
|
|
3
|
+
target: CodegenTypes.Int32;
|
|
4
|
+
}
|
|
5
|
+
interface TextLayoutEvent extends TargetedEvent {
|
|
6
|
+
lines: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Event fired when text selection changes in the UITextView.
|
|
10
|
+
* @property target - The view tag identifier
|
|
11
|
+
* @property start - The start index of the selected range (0-based)
|
|
12
|
+
* @property end - The end index of the selected range (0-based, exclusive)
|
|
13
|
+
*/
|
|
14
|
+
interface SelectionChangeEvent extends TargetedEvent {
|
|
15
|
+
start: CodegenTypes.Int32;
|
|
16
|
+
end: CodegenTypes.Int32;
|
|
17
|
+
}
|
|
18
|
+
type EllipsizeMode = 'head' | 'middle' | 'tail' | 'clip';
|
|
19
|
+
interface NativeProps extends ViewProps {
|
|
20
|
+
numberOfLines?: CodegenTypes.Int32;
|
|
21
|
+
allowFontScaling?: CodegenTypes.WithDefault<boolean, true>;
|
|
22
|
+
ellipsizeMode?: CodegenTypes.WithDefault<EllipsizeMode, 'tail'>;
|
|
23
|
+
selectable?: boolean;
|
|
24
|
+
onTextLayout?: CodegenTypes.BubblingEventHandler<TextLayoutEvent>;
|
|
25
|
+
/**
|
|
26
|
+
* Callback fired when the text selection changes.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <UITextView
|
|
31
|
+
* onSelectionChange={(event) => {
|
|
32
|
+
* console.log('Selection:', event.nativeEvent.start, event.nativeEvent.end);
|
|
33
|
+
* }}
|
|
34
|
+
* >
|
|
35
|
+
* Selectable text
|
|
36
|
+
* </UITextView>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
onSelectionChange?: CodegenTypes.BubblingEventHandler<SelectionChangeEvent>;
|
|
40
|
+
}
|
|
41
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
42
|
+
export default _default;
|
|
43
|
+
//# sourceMappingURL=RNUITextViewNativeComponent.d.ts.map
|