expo-paste-input 0.1.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/.eslintrc.js +5 -0
- package/README.md +123 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build.gradle +43 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/pasteinput/ExpoPasteInputModule.kt +14 -0
- package/android/src/main/java/expo/modules/pasteinput/ExpoPasteInputView.kt +418 -0
- package/build/TextInputWrapper.types.d.ts +22 -0
- package/build/TextInputWrapper.types.d.ts.map +1 -0
- package/build/TextInputWrapper.types.js +2 -0
- package/build/TextInputWrapper.types.js.map +1 -0
- package/build/TextInputWrapperView.d.ts +5 -0
- package/build/TextInputWrapperView.d.ts.map +1 -0
- package/build/TextInputWrapperView.js +17 -0
- package/build/TextInputWrapperView.js.map +1 -0
- package/build/TextInputWrapperView.web.d.ts +5 -0
- package/build/TextInputWrapperView.web.d.ts.map +1 -0
- package/build/TextInputWrapperView.web.js +10 -0
- package/build/TextInputWrapperView.web.js.map +1 -0
- package/build/index.d.ts +4 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +4 -0
- package/build/index.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/ExpoPasteInput.podspec +23 -0
- package/ios/ExpoPasteInputModule.swift +11 -0
- package/ios/ExpoPasteInputView.swift +601 -0
- package/package.json +43 -0
- package/src/TextInputWrapper.types.ts +19 -0
- package/src/TextInputWrapperView.tsx +34 -0
- package/src/TextInputWrapperView.web.tsx +17 -0
- package/src/index.ts +5 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { requireNativeView } from "expo";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const NativeTextInputWrapper = requireNativeView("ExpoPasteInput");
|
|
4
|
+
export const TextInputWrapperView = React.forwardRef((props, ref) => {
|
|
5
|
+
const { onPaste, children, ...viewProps } = props;
|
|
6
|
+
const handlePaste = React.useCallback((event) => {
|
|
7
|
+
if (onPaste) {
|
|
8
|
+
// Expo View events wrap the payload in nativeEvent
|
|
9
|
+
onPaste(event.nativeEvent);
|
|
10
|
+
}
|
|
11
|
+
}, [onPaste]);
|
|
12
|
+
return (<NativeTextInputWrapper ref={ref} onPaste={handlePaste} {...viewProps}>
|
|
13
|
+
{children}
|
|
14
|
+
</NativeTextInputWrapper>);
|
|
15
|
+
});
|
|
16
|
+
TextInputWrapperView.displayName = "TextInputWrapperView";
|
|
17
|
+
//# sourceMappingURL=TextInputWrapperView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputWrapperView.js","sourceRoot":"","sources":["../src/TextInputWrapperView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAGlD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAElD,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CACnC,CAAC,KAAyC,EAAE,EAAE;QAC5C,IAAI,OAAO,EAAE,CAAC;YACZ,mDAAmD;YACnD,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,IAAI,SAAS,CAAC,CACpE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,sBAAsB,CAAC,CAC1B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC","sourcesContent":["import { requireNativeView } from \"expo\";\nimport * as React from \"react\";\nimport type { View } from \"react-native\";\nimport type {\n PasteEventPayload,\n TextInputWrapperViewProps,\n} from \"./TextInputWrapper.types\";\n\nconst NativeTextInputWrapper = requireNativeView(\"ExpoPasteInput\");\n\nexport const TextInputWrapperView = React.forwardRef<\n View,\n TextInputWrapperViewProps\n>((props, ref) => {\n const { onPaste, children, ...viewProps } = props;\n\n const handlePaste = React.useCallback(\n (event: { nativeEvent: PasteEventPayload }) => {\n if (onPaste) {\n // Expo View events wrap the payload in nativeEvent\n onPaste(event.nativeEvent);\n }\n },\n [onPaste],\n );\n\n return (\n <NativeTextInputWrapper ref={ref} onPaste={handlePaste} {...viewProps}>\n {children}\n </NativeTextInputWrapper>\n );\n});\n\nTextInputWrapperView.displayName = \"TextInputWrapperView\";\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { TextInputWrapperViewProps } from "./TextInputWrapper.types";
|
|
4
|
+
export declare const TextInputWrapperView: React.ForwardRefExoticComponent<TextInputWrapperViewProps & React.RefAttributes<View>>;
|
|
5
|
+
//# sourceMappingURL=TextInputWrapperView.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputWrapperView.web.d.ts","sourceRoot":"","sources":["../src/TextInputWrapperView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,eAAO,MAAM,oBAAoB,wFAU/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
export const TextInputWrapperView = React.forwardRef((props, ref) => {
|
|
4
|
+
const { onPaste, ...viewProps } = props;
|
|
5
|
+
return (<View ref={ref} {...viewProps}>
|
|
6
|
+
{props.children}
|
|
7
|
+
</View>);
|
|
8
|
+
});
|
|
9
|
+
TextInputWrapperView.displayName = "TextInputWrapperView";
|
|
10
|
+
//# sourceMappingURL=TextInputWrapperView.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextInputWrapperView.web.js","sourceRoot":"","sources":["../src/TextInputWrapperView.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,UAAU,CAGlD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,SAAS,CAAC,CAC5B;MAAA,CAAC,KAAK,CAAC,QAAQ,CACjB;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC","sourcesContent":["import * as React from \"react\";\nimport { View } from \"react-native\";\nimport { TextInputWrapperViewProps } from \"./TextInputWrapper.types\";\n\nexport const TextInputWrapperView = React.forwardRef<\n View,\n TextInputWrapperViewProps\n>((props, ref) => {\n const { onPaste, ...viewProps } = props;\n return (\n <View ref={ref} {...viewProps}>\n {props.children}\n </View>\n );\n});\n\nTextInputWrapperView.displayName = \"TextInputWrapperView\";\n"]}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,0BAA0B,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,oBAAoB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,gCAAgC;AAChC,OAAO,EAAE,oBAAoB,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export type * from \"./TextInputWrapper.types\";\nexport { TextInputWrapperView } from \"./TextInputWrapperView\";\n\n// Re-export with a simpler name\nexport { TextInputWrapperView as TextInputWrapper } from \"./TextInputWrapperView\";\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = 'ExpoPasteInput'
|
|
3
|
+
s.version = '1.0.0'
|
|
4
|
+
s.summary = 'Native text input wrapper with paste event handling'
|
|
5
|
+
s.description = 'Expo module providing cross-platform paste event detection for text inputs with support for text and image content'
|
|
6
|
+
s.author = 'Arunabh Verma'
|
|
7
|
+
s.homepage = 'https://github.com/arunabhverma/expo-paste-input'
|
|
8
|
+
s.platforms = {
|
|
9
|
+
:ios => '15.1',
|
|
10
|
+
:tvos => '15.1'
|
|
11
|
+
}
|
|
12
|
+
s.source = { git: 'https://github.com/arunabhverma/expo-paste-input.git', tag: "v#{s.version}" }
|
|
13
|
+
s.static_framework = true
|
|
14
|
+
|
|
15
|
+
s.dependency 'ExpoModulesCore'
|
|
16
|
+
|
|
17
|
+
# Swift/Objective-C compatibility
|
|
18
|
+
s.pod_target_xcconfig = {
|
|
19
|
+
'DEFINES_MODULE' => 'YES',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
s.source_files = "**/*.{h,m,mm,swift,hpp,cpp}"
|
|
23
|
+
end
|