react-native-platform-components 0.5.5 → 0.6.1
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 +342 -72
- package/android/src/main/java/com/platformcomponents/PCContextMenuView.kt +419 -0
- package/android/src/main/java/com/platformcomponents/PCContextMenuViewManager.kt +200 -0
- package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +4 -0
- package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +1 -0
- package/app.plugin.cjs +4 -0
- package/expo-module.config.json +4 -0
- package/ios/PCContextMenu.h +12 -0
- package/ios/PCContextMenu.mm +247 -0
- package/ios/PCContextMenu.swift +389 -0
- package/ios/PCDatePickerView.swift +25 -11
- package/lib/commonjs/ContextMenu.js +118 -0
- package/lib/commonjs/ContextMenu.js.map +1 -0
- package/lib/commonjs/ContextMenuNativeComponent.ts +141 -0
- package/lib/commonjs/DatePicker.js +86 -0
- package/lib/commonjs/DatePicker.js.map +1 -0
- package/lib/commonjs/DatePickerNativeComponent.ts +69 -0
- package/lib/commonjs/SelectionMenu.js +73 -0
- package/lib/commonjs/SelectionMenu.js.map +1 -0
- package/lib/commonjs/SelectionMenuNativeComponent.ts +97 -0
- package/lib/commonjs/index.js +50 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/sharedTypes.js +6 -0
- package/lib/commonjs/sharedTypes.js.map +1 -0
- package/lib/module/ContextMenu.js +111 -0
- package/lib/module/ContextMenu.js.map +1 -0
- package/lib/module/ContextMenuNativeComponent.ts +141 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/ContextMenu.d.ts +79 -0
- package/lib/typescript/commonjs/src/ContextMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +122 -0
- package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DatePicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SelectionMenu.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{src → commonjs/src}/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -0
- package/lib/typescript/module/src/ContextMenu.d.ts +79 -0
- package/lib/typescript/module/src/ContextMenu.d.ts.map +1 -0
- package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +122 -0
- package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/DatePicker.d.ts +40 -0
- package/lib/typescript/module/src/DatePicker.d.ts.map +1 -0
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +54 -0
- package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/SelectionMenu.d.ts +47 -0
- package/lib/typescript/module/src/SelectionMenu.d.ts.map +1 -0
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +78 -0
- package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +5 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/sharedTypes.d.ts +12 -0
- package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -0
- package/package.json +32 -11
- package/plugin/build/index.cjs +26 -0
- package/plugin/build/index.d.ts +22 -0
- package/plugin/build/index.d.ts.map +1 -0
- package/plugin/tsconfig.json +16 -0
- package/src/ContextMenu.tsx +209 -0
- package/src/ContextMenuNativeComponent.ts +141 -0
- package/src/index.tsx +1 -0
- package/lib/typescript/src/DatePicker.d.ts.map +0 -1
- package/lib/typescript/src/DatePickerNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/SelectionMenu.d.ts.map +0 -1
- package/lib/typescript/src/SelectionMenuNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/sharedTypes.d.ts.map +0 -1
- /package/lib/typescript/{src → commonjs/src}/DatePicker.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/DatePickerNativeComponent.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/SelectionMenu.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/SelectionMenuNativeComponent.d.ts +0 -0
- /package/lib/typescript/{src → commonjs/src}/sharedTypes.d.ts +0 -0
- /package/lib/typescript/{package.json → module/package.json} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Attributes for a context menu action.
|
|
4
|
+
*/
|
|
5
|
+
export type ContextMenuActionAttributes = Readonly<{
|
|
6
|
+
/** Whether the action is destructive (red styling) */
|
|
7
|
+
destructive?: string;
|
|
8
|
+
/** Whether the action is disabled (grayed out) */
|
|
9
|
+
disabled?: string;
|
|
10
|
+
/** Whether the action is hidden */
|
|
11
|
+
hidden?: string;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* A leaf subaction (no further nesting to avoid codegen recursion issues).
|
|
15
|
+
*/
|
|
16
|
+
export type ContextMenuSubaction = Readonly<{
|
|
17
|
+
/** Unique identifier returned in callbacks */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Display title */
|
|
20
|
+
title: string;
|
|
21
|
+
/** Secondary text (iOS only) */
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
/** Icon name (SF Symbol on iOS, drawable resource on Android) */
|
|
24
|
+
image?: string;
|
|
25
|
+
/** Tint color for the icon (hex string, e.g., "#FF0000") */
|
|
26
|
+
imageColor?: string;
|
|
27
|
+
/** Action attributes */
|
|
28
|
+
attributes?: ContextMenuActionAttributes;
|
|
29
|
+
/** Checkmark state: 'off' | 'on' | 'mixed' */
|
|
30
|
+
state?: string;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* A single action in the context menu.
|
|
34
|
+
* Actions can be nested one level via `subactions` for submenus.
|
|
35
|
+
*/
|
|
36
|
+
export type ContextMenuAction = Readonly<{
|
|
37
|
+
/** Unique identifier returned in callbacks */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Display title */
|
|
40
|
+
title: string;
|
|
41
|
+
/** Secondary text (iOS only) */
|
|
42
|
+
subtitle?: string;
|
|
43
|
+
/** Icon name (SF Symbol on iOS, drawable resource on Android) */
|
|
44
|
+
image?: string;
|
|
45
|
+
/** Tint color for the icon (hex string, e.g., "#FF0000") */
|
|
46
|
+
imageColor?: string;
|
|
47
|
+
/** Action attributes */
|
|
48
|
+
attributes?: ContextMenuActionAttributes;
|
|
49
|
+
/** Checkmark state: 'off' | 'on' | 'mixed' */
|
|
50
|
+
state?: string;
|
|
51
|
+
/** Nested actions for submenu (one level deep) */
|
|
52
|
+
subactions?: ReadonlyArray<ContextMenuSubaction>;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Event emitted when an action is pressed.
|
|
56
|
+
*/
|
|
57
|
+
export type ContextMenuPressActionEvent = Readonly<{
|
|
58
|
+
/** The action's unique identifier */
|
|
59
|
+
actionId: string;
|
|
60
|
+
/** The action's title */
|
|
61
|
+
actionTitle: string;
|
|
62
|
+
}>;
|
|
63
|
+
/** Interactivity state (no booleans for codegen). */
|
|
64
|
+
export type ContextMenuInteractivity = 'enabled' | 'disabled';
|
|
65
|
+
/** Trigger mode for opening the menu. */
|
|
66
|
+
export type ContextMenuTrigger = 'longPress' | 'tap';
|
|
67
|
+
/**
|
|
68
|
+
* iOS-specific configuration.
|
|
69
|
+
*/
|
|
70
|
+
export type IOSProps = Readonly<{
|
|
71
|
+
/** Enable preview when long-pressing */
|
|
72
|
+
enablePreview?: string;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Android-specific configuration.
|
|
76
|
+
*/
|
|
77
|
+
export type AndroidProps = Readonly<{
|
|
78
|
+
/** Anchor position for the popup menu */
|
|
79
|
+
anchorPosition?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Programmatic visibility control (Android only).
|
|
82
|
+
* 'open' to show the menu, 'closed' to hide it.
|
|
83
|
+
*/
|
|
84
|
+
visible?: string;
|
|
85
|
+
}>;
|
|
86
|
+
export interface ContextMenuProps extends ViewProps {
|
|
87
|
+
/**
|
|
88
|
+
* Menu title (shown as header on iOS).
|
|
89
|
+
*/
|
|
90
|
+
title?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Menu actions.
|
|
93
|
+
*/
|
|
94
|
+
actions: ReadonlyArray<ContextMenuAction>;
|
|
95
|
+
/**
|
|
96
|
+
* Enabled / disabled state.
|
|
97
|
+
*/
|
|
98
|
+
interactivity?: string;
|
|
99
|
+
/**
|
|
100
|
+
* How the menu is triggered:
|
|
101
|
+
* - 'longPress' (default): Long-press opens the menu
|
|
102
|
+
* - 'tap': Single tap opens the menu
|
|
103
|
+
*/
|
|
104
|
+
trigger?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Fired when user presses an action.
|
|
107
|
+
*/
|
|
108
|
+
onPressAction?: CodegenTypes.BubblingEventHandler<ContextMenuPressActionEvent>;
|
|
109
|
+
/**
|
|
110
|
+
* Fired when menu opens.
|
|
111
|
+
*/
|
|
112
|
+
onMenuOpen?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
|
|
113
|
+
/**
|
|
114
|
+
* Fired when menu closes.
|
|
115
|
+
*/
|
|
116
|
+
onMenuClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
|
|
117
|
+
ios?: IOSProps;
|
|
118
|
+
android?: AndroidProps;
|
|
119
|
+
}
|
|
120
|
+
declare const _default: HostComponent<ContextMenuProps>;
|
|
121
|
+
export default _default;
|
|
122
|
+
//# sourceMappingURL=ContextMenuNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextMenuNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/ContextMenuNativeComponent.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { type IOSProps as NativeIOSProps, type AndroidProps as NativeAndroidProps, type DatePickerPresentation, type DatePickerMode, type IOSRoundsToMinuteInterval, type IOSDatePickerStyle } from './DatePickerNativeComponent';
|
|
4
|
+
import type { AndroidMaterialMode } from './sharedTypes';
|
|
5
|
+
export type DatePickerProps = {
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
/** Controlled value. Use `null` for "no date selected". */
|
|
8
|
+
date: Date | null;
|
|
9
|
+
/** Optional bounds. Use `null` for "unbounded". */
|
|
10
|
+
minDate?: Date | null;
|
|
11
|
+
maxDate?: Date | null;
|
|
12
|
+
locale?: string;
|
|
13
|
+
timeZoneName?: string;
|
|
14
|
+
mode?: DatePickerMode;
|
|
15
|
+
presentation?: DatePickerPresentation;
|
|
16
|
+
/**
|
|
17
|
+
* Modal only. If presentation !== "modal", ignored.
|
|
18
|
+
* Wrapper ergonomics: boolean.
|
|
19
|
+
*/
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
onConfirm?: (dateTime: Date) => void;
|
|
22
|
+
onClosed?: () => void;
|
|
23
|
+
/** Test identifier */
|
|
24
|
+
testID?: string;
|
|
25
|
+
ios?: {
|
|
26
|
+
preferredStyle?: IOSDatePickerStyle;
|
|
27
|
+
countDownDurationSeconds?: NativeIOSProps['countDownDurationSeconds'];
|
|
28
|
+
minuteInterval?: NativeIOSProps['minuteInterval'];
|
|
29
|
+
roundsToMinuteInterval?: IOSRoundsToMinuteInterval;
|
|
30
|
+
};
|
|
31
|
+
android?: {
|
|
32
|
+
firstDayOfWeek?: NativeAndroidProps['firstDayOfWeek'];
|
|
33
|
+
material?: AndroidMaterialMode;
|
|
34
|
+
dialogTitle?: NativeAndroidProps['dialogTitle'];
|
|
35
|
+
positiveButtonTitle?: NativeAndroidProps['positiveButtonTitle'];
|
|
36
|
+
negativeButtonTitle?: NativeAndroidProps['negativeButtonTitle'];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare function DatePicker(props: DatePickerProps): React.ReactElement;
|
|
40
|
+
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/DatePicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAwB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAyB,EAGvB,KAAK,QAAQ,IAAI,cAAc,EAC/B,KAAK,YAAY,IAAI,kBAAkB,EACvC,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,mBAAmB,EAAW,MAAM,eAAe,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B,2DAA2D;IAC3D,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAElB,mDAAmD;IACnD,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAEtC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,GAAG,CAAC,EAAE;QACJ,cAAc,CAAC,EAAE,kBAAkB,CAAC;QACpC,wBAAwB,CAAC,EAAE,cAAc,CAAC,0BAA0B,CAAC,CAAC;QACtE,cAAc,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;QAClD,sBAAsB,CAAC,EAAE,yBAAyB,CAAC;KACpD,CAAC;IAEF,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;QACtD,QAAQ,CAAC,EAAE,mBAAmB,CAAC;QAC/B,WAAW,CAAC,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;QAChD,mBAAmB,CAAC,EAAE,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;QAChE,mBAAmB,CAAC,EAAE,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;KACjE,CAAC;CACH,CAAC;AAqBF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CAqErE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { CodegenTypes, ViewProps } from 'react-native';
|
|
2
|
+
export type TimestampMs = CodegenTypes.Double;
|
|
3
|
+
export type DateChangeEvent = {
|
|
4
|
+
timestampMs: CodegenTypes.Double;
|
|
5
|
+
};
|
|
6
|
+
export type DatePickerMode = 'date' | 'time' | 'dateAndTime' | 'countDownTimer';
|
|
7
|
+
export type DatePickerPresentation = 'modal' | 'embedded';
|
|
8
|
+
export type IOSDatePickerStyle = 'automatic' | 'compact' | 'inline' | 'wheels';
|
|
9
|
+
export type IOSRoundsToMinuteInterval = 'inherit' | 'round' | 'noRound';
|
|
10
|
+
export type IOSProps = {
|
|
11
|
+
preferredStyle?: string;
|
|
12
|
+
countDownDurationSeconds?: CodegenTypes.Double;
|
|
13
|
+
minuteInterval?: CodegenTypes.Int32;
|
|
14
|
+
roundsToMinuteInterval?: string;
|
|
15
|
+
};
|
|
16
|
+
export type AndroidProps = {
|
|
17
|
+
firstDayOfWeek?: CodegenTypes.Int32;
|
|
18
|
+
material?: string;
|
|
19
|
+
dialogTitle?: string;
|
|
20
|
+
positiveButtonTitle?: string;
|
|
21
|
+
negativeButtonTitle?: string;
|
|
22
|
+
};
|
|
23
|
+
export type WebProps = Readonly<{}>;
|
|
24
|
+
export type WindowsProps = Readonly<{}>;
|
|
25
|
+
export type MacOSProps = Readonly<{}>;
|
|
26
|
+
/**
|
|
27
|
+
* Sentinel convention:
|
|
28
|
+
* - `Number.MIN_SAFE_INTEGER` means "no value / unbounded / unset".
|
|
29
|
+
* (Allows negative timestamps for pre-1970 dates.)
|
|
30
|
+
*/
|
|
31
|
+
export type CommonProps = {
|
|
32
|
+
mode?: string;
|
|
33
|
+
dateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
|
|
34
|
+
minDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
|
|
35
|
+
maxDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
|
|
36
|
+
locale?: string;
|
|
37
|
+
timeZoneName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Only used when presentation === "modal".
|
|
40
|
+
* Defaults should be applied in JS wrapper (recommended).
|
|
41
|
+
*/
|
|
42
|
+
visible?: string;
|
|
43
|
+
/** Defaults should be applied in JS wrapper (recommended). */
|
|
44
|
+
presentation?: string;
|
|
45
|
+
};
|
|
46
|
+
export interface NativeProps extends ViewProps, CommonProps {
|
|
47
|
+
ios?: IOSProps;
|
|
48
|
+
android?: AndroidProps;
|
|
49
|
+
onConfirm?: CodegenTypes.BubblingEventHandler<DateChangeEvent>;
|
|
50
|
+
onClosed?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
|
|
51
|
+
}
|
|
52
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
53
|
+
export default _default;
|
|
54
|
+
//# sourceMappingURL=DatePickerNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePickerNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/DatePickerNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,YAAY,CAAC,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAChF,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC/E,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAExE,MAAM,MAAM,QAAQ,GAAG;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC;IAC/C,cAAc,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IACpC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AACpC,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,MAAM,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAClE,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAErE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,WAAW;IACzD,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,SAAS,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC;IAC/D,QAAQ,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;CAC5D;;AAED,wBAAmE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewProps } from 'react-native';
|
|
3
|
+
import { type SelectionMenuOption } from './SelectionMenuNativeComponent';
|
|
4
|
+
import type { AndroidMaterialMode, Presentation } from './sharedTypes';
|
|
5
|
+
export interface SelectionMenuProps extends ViewProps {
|
|
6
|
+
/** Options are label + data (payload) */
|
|
7
|
+
options: readonly SelectionMenuOption[];
|
|
8
|
+
/**
|
|
9
|
+
* Controlled selection by the option's `data`.
|
|
10
|
+
* Use `null` for "no selection".
|
|
11
|
+
*/
|
|
12
|
+
selected: string | null;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Presentation mode:
|
|
17
|
+
* - 'modal' (default): Headless mode, controlled by `visible` prop.
|
|
18
|
+
* - 'embedded': Native renders its own inline anchor and manages open/close internally.
|
|
19
|
+
*/
|
|
20
|
+
presentation?: Presentation;
|
|
21
|
+
/**
|
|
22
|
+
* Modal mode only (presentation === 'modal'):
|
|
23
|
+
* controls whether the native menu UI is presented.
|
|
24
|
+
*/
|
|
25
|
+
visible?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Called when the user selects an option.
|
|
28
|
+
* Receives the selected `data` payload, plus label/index for convenience.
|
|
29
|
+
*/
|
|
30
|
+
onSelect?: (data: string, label: string, index: number) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Called when the user dismisses without selecting.
|
|
33
|
+
*/
|
|
34
|
+
onRequestClose?: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Pass-through platform props.
|
|
37
|
+
*/
|
|
38
|
+
ios?: {};
|
|
39
|
+
android?: {
|
|
40
|
+
/** Material preference ('system' | 'm3'). */
|
|
41
|
+
material?: AndroidMaterialMode;
|
|
42
|
+
};
|
|
43
|
+
/** Test identifier */
|
|
44
|
+
testID?: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function SelectionMenu(props: SelectionMenuProps): React.ReactElement;
|
|
47
|
+
//# sourceMappingURL=SelectionMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionMenu.d.ts","sourceRoot":"","sources":["../../../../src/SelectionMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAA4B,EAC1B,KAAK,mBAAmB,EAEzB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD,yCAAyC;IACzC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAExC;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhE;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;OAEG;IACH,GAAG,CAAC,EAAE,EAAE,CAAC;IAET,OAAO,CAAC,EAAE;QACR,6CAA6C;QAC7C,QAAQ,CAAC,EAAE,mBAAmB,CAAC;KAChC,CAAC;IAEF,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAeD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CA4D3E"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { CodegenTypes, ViewProps } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* A single option in the menu.
|
|
4
|
+
*/
|
|
5
|
+
export type SelectionMenuOption = Readonly<{
|
|
6
|
+
label: string;
|
|
7
|
+
data: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Event emitted when the user selects an option.
|
|
11
|
+
*/
|
|
12
|
+
export type SelectionMenuSelectEvent = Readonly<{
|
|
13
|
+
/** Selected option index (implementation detail; stable for this render) */
|
|
14
|
+
index: CodegenTypes.Int32;
|
|
15
|
+
/** Selected option label */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Selected option data payload (source of truth) */
|
|
18
|
+
data: string;
|
|
19
|
+
}>;
|
|
20
|
+
/** Visibility state (headless mode only). */
|
|
21
|
+
export type SelectionMenuVisible = 'open' | 'closed';
|
|
22
|
+
/** Interactivity state (no booleans). */
|
|
23
|
+
export type SelectionMenuInteractivity = 'enabled' | 'disabled';
|
|
24
|
+
/** Anchor behavior (no booleans). */
|
|
25
|
+
export type SelectionMenuAnchorMode = 'inline' | 'headless';
|
|
26
|
+
/**
|
|
27
|
+
* iOS-specific configuration (reserved).
|
|
28
|
+
*/
|
|
29
|
+
export type IOSProps = Readonly<{}>;
|
|
30
|
+
/**
|
|
31
|
+
* Android-specific configuration.
|
|
32
|
+
*/
|
|
33
|
+
export type AndroidProps = Readonly<{
|
|
34
|
+
material?: string;
|
|
35
|
+
}>;
|
|
36
|
+
export interface SelectionMenuProps extends ViewProps {
|
|
37
|
+
/**
|
|
38
|
+
* Menu options.
|
|
39
|
+
*/
|
|
40
|
+
options: ReadonlyArray<SelectionMenuOption>;
|
|
41
|
+
/**
|
|
42
|
+
* Controlled selection by `data`.
|
|
43
|
+
*
|
|
44
|
+
* - Empty string means "no selection".
|
|
45
|
+
* - Native should treat this as the single source of truth.
|
|
46
|
+
*/
|
|
47
|
+
selectedData?: CodegenTypes.WithDefault<string, ''>;
|
|
48
|
+
/**
|
|
49
|
+
* Enabled / disabled state.
|
|
50
|
+
*/
|
|
51
|
+
interactivity?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Placeholder text shown when selectedData === "".
|
|
54
|
+
*/
|
|
55
|
+
placeholder?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Inline vs headless behavior.
|
|
58
|
+
*/
|
|
59
|
+
anchorMode?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Headless mode only:
|
|
62
|
+
* controls visibility.
|
|
63
|
+
*/
|
|
64
|
+
visible?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Fired when the user selects an option.
|
|
67
|
+
*/
|
|
68
|
+
onSelect?: CodegenTypes.BubblingEventHandler<SelectionMenuSelectEvent>;
|
|
69
|
+
/**
|
|
70
|
+
* Fired when dismissed without selection.
|
|
71
|
+
*/
|
|
72
|
+
onRequestClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
|
|
73
|
+
ios?: IOSProps;
|
|
74
|
+
android?: AndroidProps;
|
|
75
|
+
}
|
|
76
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<SelectionMenuProps>;
|
|
77
|
+
export default _default;
|
|
78
|
+
//# sourceMappingURL=SelectionMenuNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionMenuNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/SelectionMenuNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG5D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,4EAA4E;IAC5E,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;IAE1B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IAEd,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErD,yCAAyC;AACzC,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,UAAU,CAAC;AAEhE,qCAAqC;AACrC,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,WAAW,kBAAmB,SAAQ,SAAS;IACnD;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAE5C;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEpD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;IAEvE;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAEjE,GAAG,CAAC,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;;AAED,wBAA6E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CodegenTypes } from 'react-native';
|
|
2
|
+
/** Shared "open/closed" control state. */
|
|
3
|
+
export type Visible = 'open' | 'closed';
|
|
4
|
+
/** Shared presentation mode for pickers/menus. */
|
|
5
|
+
export type Presentation = 'modal' | 'embedded';
|
|
6
|
+
/** Shared Material preference (Android). */
|
|
7
|
+
export type AndroidMaterialMode = 'system' | 'm3';
|
|
8
|
+
/** Common event empty payload type. */
|
|
9
|
+
export type EmptyEvent = Readonly<{}>;
|
|
10
|
+
/** Convenience alias (optional). */
|
|
11
|
+
export type Bubbling<T> = CodegenTypes.BubblingEventHandler<T>;
|
|
12
|
+
//# sourceMappingURL=sharedTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedTypes.d.ts","sourceRoot":"","sources":["../../../../src/sharedTypes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,0CAA0C;AAC1C,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAExC,kDAAkD;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhD,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,IAAI,CAAC;AAElD,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAEtC,oCAAoC;AACpC,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-platform-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "A cross-platform toolkit of native UI components for React Native.",
|
|
5
|
-
"main": "./lib/
|
|
6
|
-
"
|
|
5
|
+
"main": "./lib/commonjs/index.js",
|
|
6
|
+
"module": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"source": "./src/index.tsx",
|
|
10
|
-
"
|
|
11
|
-
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./lib/typescript/module/src/index.d.ts",
|
|
13
|
+
"default": "./lib/module/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./lib/typescript/commonjs/src/index.d.ts",
|
|
17
|
+
"default": "./lib/commonjs/index.js"
|
|
18
|
+
}
|
|
12
19
|
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
"./app.plugin": "./app.plugin.cjs"
|
|
14
22
|
},
|
|
15
23
|
"files": [
|
|
16
24
|
"src",
|
|
@@ -19,14 +27,18 @@
|
|
|
19
27
|
"android",
|
|
20
28
|
"ios",
|
|
21
29
|
"cpp",
|
|
30
|
+
"plugin",
|
|
22
31
|
"*.podspec",
|
|
23
32
|
"react-native.config.js",
|
|
33
|
+
"app.plugin.cjs",
|
|
34
|
+
"expo-module.config.json",
|
|
24
35
|
"!ios/build",
|
|
25
36
|
"!android/build",
|
|
26
37
|
"!android/gradle",
|
|
27
38
|
"!android/gradlew",
|
|
28
39
|
"!android/gradlew.bat",
|
|
29
40
|
"!android/local.properties",
|
|
41
|
+
"!plugin/src",
|
|
30
42
|
"!**/__tests__",
|
|
31
43
|
"!**/__fixtures__",
|
|
32
44
|
"!**/__mocks__",
|
|
@@ -34,11 +46,13 @@
|
|
|
34
46
|
],
|
|
35
47
|
"scripts": {
|
|
36
48
|
"example": "yarn workspace react-native-platform-components-example",
|
|
37
|
-
"
|
|
38
|
-
"
|
|
49
|
+
"example-expo": "yarn workspace react-native-platform-components-example-expo",
|
|
50
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib plugin/build",
|
|
51
|
+
"prepare": "bob build && yarn build:plugin",
|
|
39
52
|
"typecheck": "tsc",
|
|
40
53
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
41
54
|
"build": "tsc --noEmit",
|
|
55
|
+
"build:plugin": "tsc -p plugin/tsconfig.json && mv plugin/build/index.js plugin/build/index.cjs",
|
|
42
56
|
"release": "release-it",
|
|
43
57
|
"test": "jest",
|
|
44
58
|
"upgrade:check": "yarn dlx npm-check-updates",
|
|
@@ -55,9 +69,11 @@
|
|
|
55
69
|
"picker",
|
|
56
70
|
"menu",
|
|
57
71
|
"selection-menu",
|
|
72
|
+
"context-menu",
|
|
58
73
|
"dropdown",
|
|
59
74
|
"native",
|
|
60
|
-
"material-design"
|
|
75
|
+
"material-design",
|
|
76
|
+
"expo"
|
|
61
77
|
],
|
|
62
78
|
"repository": {
|
|
63
79
|
"type": "git",
|
|
@@ -77,6 +93,7 @@
|
|
|
77
93
|
"@eslint/compat": "^2.0.1",
|
|
78
94
|
"@eslint/eslintrc": "^3.3.3",
|
|
79
95
|
"@eslint/js": "^9.39.2",
|
|
96
|
+
"@expo/config-plugins": "^54.0.4",
|
|
80
97
|
"@react-native-community/cli": "20.1.0",
|
|
81
98
|
"@react-native/babel-preset": "0.83.1",
|
|
82
99
|
"@react-native/eslint-config": "^0.83.1",
|
|
@@ -84,6 +101,7 @@
|
|
|
84
101
|
"@types/jest": "^30.0.0",
|
|
85
102
|
"@types/react": "^19.2.9",
|
|
86
103
|
"@types/react-test-renderer": "^19.1.0",
|
|
104
|
+
"babel-preset-expo": "^54.0.10",
|
|
87
105
|
"commitlint": "^20.3.1",
|
|
88
106
|
"del-cli": "^7.0.0",
|
|
89
107
|
"eslint": "^9.39.2",
|
|
@@ -105,13 +123,15 @@
|
|
|
105
123
|
"react-native": "*"
|
|
106
124
|
},
|
|
107
125
|
"workspaces": [
|
|
108
|
-
"example"
|
|
126
|
+
"example",
|
|
127
|
+
"example-expo"
|
|
109
128
|
],
|
|
110
129
|
"packageManager": "yarn@4.11.0",
|
|
111
130
|
"react-native-builder-bob": {
|
|
112
131
|
"source": "src",
|
|
113
132
|
"output": "lib",
|
|
114
133
|
"targets": [
|
|
134
|
+
"commonjs",
|
|
115
135
|
[
|
|
116
136
|
"module",
|
|
117
137
|
{
|
|
@@ -136,7 +156,8 @@
|
|
|
136
156
|
"ios": {
|
|
137
157
|
"componentProvider": {
|
|
138
158
|
"PCSelectionMenu": "PCSelectionMenu",
|
|
139
|
-
"PCDatePicker": "PCDatePicker"
|
|
159
|
+
"PCDatePicker": "PCDatePicker",
|
|
160
|
+
"PCContextMenu": "PCContextMenu"
|
|
140
161
|
}
|
|
141
162
|
}
|
|
142
163
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Expo config plugin for react-native-platform-components.
|
|
5
|
+
*
|
|
6
|
+
* This library requires no manual native configuration on either iOS or Android.
|
|
7
|
+
* The native modules are automatically linked via Expo prebuild and React Native's
|
|
8
|
+
* autolinking system.
|
|
9
|
+
*
|
|
10
|
+
* iOS:
|
|
11
|
+
* - Pod linkage works automatically via the standard podspec
|
|
12
|
+
* - No Info.plist, entitlements, or AppDelegate changes required
|
|
13
|
+
*
|
|
14
|
+
* Android:
|
|
15
|
+
* - Gradle linkage works automatically via autolinking
|
|
16
|
+
* - No AndroidManifest.xml, theme, or permission changes required
|
|
17
|
+
*
|
|
18
|
+
* This plugin is provided for discoverability and to enable future configuration
|
|
19
|
+
* options if needed. Running prebuild multiple times is idempotent.
|
|
20
|
+
*/
|
|
21
|
+
const withPlatformComponents = (config) => {
|
|
22
|
+
// No-op plugin: react-native-platform-components requires no native configuration
|
|
23
|
+
// beyond standard autolinking which Expo prebuild handles automatically.
|
|
24
|
+
return config;
|
|
25
|
+
};
|
|
26
|
+
exports.default = withPlatformComponents;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
/**
|
|
3
|
+
* Expo config plugin for react-native-platform-components.
|
|
4
|
+
*
|
|
5
|
+
* This library requires no manual native configuration on either iOS or Android.
|
|
6
|
+
* The native modules are automatically linked via Expo prebuild and React Native's
|
|
7
|
+
* autolinking system.
|
|
8
|
+
*
|
|
9
|
+
* iOS:
|
|
10
|
+
* - Pod linkage works automatically via the standard podspec
|
|
11
|
+
* - No Info.plist, entitlements, or AppDelegate changes required
|
|
12
|
+
*
|
|
13
|
+
* Android:
|
|
14
|
+
* - Gradle linkage works automatically via autolinking
|
|
15
|
+
* - No AndroidManifest.xml, theme, or permission changes required
|
|
16
|
+
*
|
|
17
|
+
* This plugin is provided for discoverability and to enable future configuration
|
|
18
|
+
* options if needed. Running prebuild multiple times is idempotent.
|
|
19
|
+
*/
|
|
20
|
+
declare const withPlatformComponents: ConfigPlugin;
|
|
21
|
+
export default withPlatformComponents;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;;;;;;;;;;;;;;;GAiBG;AAEH,QAAA,MAAM,sBAAsB,EAAE,YAI7B,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"declarationMap": true,
|
|
11
|
+
"outDir": "build",
|
|
12
|
+
"rootDir": "src"
|
|
13
|
+
},
|
|
14
|
+
"include": ["src/**/*"],
|
|
15
|
+
"exclude": ["node_modules"]
|
|
16
|
+
}
|