@amityco/react-native-social-uikit 4.1.1-dfb439b1.0 → 4.1.1-e85011d9.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.
Files changed (48) hide show
  1. package/lib/commonjs/core/assets/icons/xml.js +1 -15
  2. package/lib/commonjs/core/assets/icons/xml.js.map +1 -1
  3. package/lib/commonjs/core/hooks/usePostByIds.js +38 -0
  4. package/lib/commonjs/core/hooks/usePostByIds.js.map +1 -0
  5. package/lib/commonjs/social/components/MediaViewer/MediaViewer.js +3 -24
  6. package/lib/commonjs/social/components/MediaViewer/MediaViewer.js.map +1 -1
  7. package/lib/commonjs/social/features/post/Composer/PostComposer.js +32 -39
  8. package/lib/commonjs/social/features/post/Composer/PostComposer.js.map +1 -1
  9. package/lib/module/core/assets/icons/xml.js +0 -12
  10. package/lib/module/core/assets/icons/xml.js.map +1 -1
  11. package/lib/module/core/hooks/usePostByIds.js +32 -0
  12. package/lib/module/core/hooks/usePostByIds.js.map +1 -0
  13. package/lib/module/social/components/MediaViewer/MediaViewer.js +4 -25
  14. package/lib/module/social/components/MediaViewer/MediaViewer.js.map +1 -1
  15. package/lib/module/social/features/post/Composer/PostComposer.js +34 -41
  16. package/lib/module/social/features/post/Composer/PostComposer.js.map +1 -1
  17. package/lib/typescript/core/assets/icons/xml.d.ts +0 -2
  18. package/lib/typescript/core/assets/icons/xml.d.ts.map +1 -1
  19. package/lib/typescript/core/hooks/usePostByIds.d.ts +8 -0
  20. package/lib/typescript/core/hooks/usePostByIds.d.ts.map +1 -0
  21. package/lib/typescript/social/components/MediaViewer/MediaViewer.d.ts.map +1 -1
  22. package/lib/typescript/social/features/post/Composer/PostComposer.d.ts.map +1 -1
  23. package/package.json +1 -3
  24. package/src/core/assets/icons/xml.ts +0 -16
  25. package/src/core/hooks/usePostByIds.ts +33 -0
  26. package/src/social/components/MediaViewer/MediaViewer.tsx +1 -30
  27. package/src/social/features/post/Composer/PostComposer.tsx +48 -65
  28. package/lib/commonjs/social/components/MediaSelector/MediaSelector.js +0 -164
  29. package/lib/commonjs/social/components/MediaSelector/MediaSelector.js.map +0 -1
  30. package/lib/commonjs/social/components/MediaSelector/index.js +0 -13
  31. package/lib/commonjs/social/components/MediaSelector/index.js.map +0 -1
  32. package/lib/commonjs/social/components/MediaSelector/styles.js +0 -130
  33. package/lib/commonjs/social/components/MediaSelector/styles.js.map +0 -1
  34. package/lib/module/social/components/MediaSelector/MediaSelector.js +0 -158
  35. package/lib/module/social/components/MediaSelector/MediaSelector.js.map +0 -1
  36. package/lib/module/social/components/MediaSelector/index.js +0 -2
  37. package/lib/module/social/components/MediaSelector/index.js.map +0 -1
  38. package/lib/module/social/components/MediaSelector/styles.js +0 -123
  39. package/lib/module/social/components/MediaSelector/styles.js.map +0 -1
  40. package/lib/typescript/social/components/MediaSelector/MediaSelector.d.ts +0 -14
  41. package/lib/typescript/social/components/MediaSelector/MediaSelector.d.ts.map +0 -1
  42. package/lib/typescript/social/components/MediaSelector/index.d.ts +0 -2
  43. package/lib/typescript/social/components/MediaSelector/index.d.ts.map +0 -1
  44. package/lib/typescript/social/components/MediaSelector/styles.d.ts +0 -116
  45. package/lib/typescript/social/components/MediaSelector/styles.d.ts.map +0 -1
  46. package/src/social/components/MediaSelector/MediaSelector.tsx +0 -231
  47. package/src/social/components/MediaSelector/index.tsx +0 -1
  48. package/src/social/components/MediaSelector/styles.ts +0 -124
@@ -1,158 +0,0 @@
1
- import { useCallback, useEffect, useState } from 'react';
2
- import { FlatList, Image, Modal, PermissionsAndroid, Platform, Text, TouchableOpacity, TouchableWithoutFeedback, View } from 'react-native';
3
- import { CameraRoll } from '@react-native-camera-roll/camera-roll';
4
- import { useStyles } from './styles';
5
- const PAGE_SIZE = 90;
6
- async function ensureLibraryPermission(mediaType) {
7
- if (Platform.OS !== 'android') return true;
8
- const version = typeof Platform.Version === 'number' ? Platform.Version : parseInt(Platform.Version, 10);
9
- const perms = version >= 33 ? [mediaType === 'photo' ? PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES : PermissionsAndroid.PERMISSIONS.READ_MEDIA_VIDEO] : [PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE];
10
- try {
11
- const result = await PermissionsAndroid.requestMultiple(perms);
12
- return Object.values(result).every(status => status === PermissionsAndroid.RESULTS.GRANTED);
13
- } catch {
14
- return false;
15
- }
16
- }
17
- function formatDuration(seconds) {
18
- if (!seconds || seconds <= 0) return '';
19
- const total = Math.round(seconds);
20
- const mins = Math.floor(total / 60);
21
- const secs = total % 60;
22
- return `${mins}:${secs.toString().padStart(2, '0')}`;
23
- }
24
- export function MediaSelector({
25
- visible,
26
- mediaType,
27
- existing,
28
- remaining,
29
- onClose,
30
- onConfirm
31
- }) {
32
- const {
33
- styles
34
- } = useStyles();
35
- const [items, setItems] = useState([]);
36
- const [selected, setSelected] = useState([]);
37
- const [cursor, setCursor] = useState(undefined);
38
- const [hasNextPage, setHasNextPage] = useState(false);
39
- const [loading, setLoading] = useState(false);
40
- const loadPage = useCallback(async after => {
41
- if (loading) return;
42
- setLoading(true);
43
- try {
44
- const res = await CameraRoll.getPhotos({
45
- first: PAGE_SIZE,
46
- after,
47
- assetType: mediaType === 'photo' ? 'Photos' : 'Videos',
48
- include: ['filename', 'playableDuration']
49
- });
50
- setItems(prev => after ? [...prev, ...res.edges] : res.edges);
51
- setCursor(res.page_info.end_cursor);
52
- setHasNextPage(res.page_info.has_next_page);
53
- } catch {
54
- // permission denied / empty library — leave the list empty
55
- } finally {
56
- setLoading(false);
57
- }
58
- }, [loading, mediaType]);
59
-
60
- // Reset and (re)load whenever the selector opens. A fresh open starts with an
61
- // empty selection; previously-added items are handled by duplicate detection.
62
- useEffect(() => {
63
- if (!visible) return;
64
- setSelected([]);
65
- setItems([]);
66
- setCursor(undefined);
67
- setHasNextPage(false);
68
- (async () => {
69
- const granted = await ensureLibraryPermission(mediaType);
70
- if (granted) loadPage();
71
- })();
72
- }, [visible, mediaType]);
73
- const toggle = useCallback(uri => {
74
- setSelected(prev => {
75
- const index = prev.indexOf(uri);
76
- if (index !== -1) {
77
- // Deselect: removing from the array renumbers the rest automatically.
78
- return prev.filter(u => u !== uri);
79
- }
80
- if (prev.length >= remaining) return prev; // respect the cap silently
81
- return [...prev, uri];
82
- });
83
- }, [remaining]);
84
- const handleConfirm = useCallback(() => {
85
- const deduped = selected.filter(uri => !existing.includes(uri));
86
- onConfirm(deduped);
87
- }, [selected, existing, onConfirm]);
88
- const onEndReached = useCallback(() => {
89
- if (hasNextPage && !loading) loadPage(cursor);
90
- }, [hasNextPage, loading, cursor, loadPage]);
91
- const renderItem = useCallback(({
92
- item
93
- }) => {
94
- const uri = item.node.image.uri;
95
- const order = selected.indexOf(uri);
96
- const isSelected = order !== -1;
97
- const duration = mediaType === 'video' ? formatDuration(item.node.image.playableDuration) : '';
98
- return /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
99
- onPress: () => toggle(uri)
100
- }, /*#__PURE__*/React.createElement(View, {
101
- style: styles.cell
102
- }, /*#__PURE__*/React.createElement(Image, {
103
- style: styles.cell__image,
104
- source: {
105
- uri
106
- }
107
- }), !!duration && /*#__PURE__*/React.createElement(Text, {
108
- style: styles.cell__videoDuration
109
- }, duration), isSelected ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
110
- style: styles.cell__selectedOverlay
111
- }), /*#__PURE__*/React.createElement(View, {
112
- style: styles.cell__badge
113
- }, /*#__PURE__*/React.createElement(Text, {
114
- style: styles.cell__badgeLabel
115
- }, order + 1))) : /*#__PURE__*/React.createElement(View, {
116
- style: styles.cell__badgeEmpty
117
- })));
118
- }, [selected, mediaType, toggle, styles]);
119
- return /*#__PURE__*/React.createElement(Modal, {
120
- visible: visible,
121
- animationType: "slide",
122
- onRequestClose: onClose,
123
- presentationStyle: "fullScreen"
124
- }, /*#__PURE__*/React.createElement(View, {
125
- style: styles.container
126
- }, /*#__PURE__*/React.createElement(View, {
127
- style: styles.header
128
- }, /*#__PURE__*/React.createElement(TouchableOpacity, {
129
- style: styles.headerButton,
130
- onPress: onClose
131
- }, /*#__PURE__*/React.createElement(Text, {
132
- style: styles.headerClose
133
- }, "Cancel")), /*#__PURE__*/React.createElement(Text, {
134
- style: styles.headerTitle
135
- }, mediaType === 'photo' ? 'Photos' : 'Videos'), /*#__PURE__*/React.createElement(TouchableOpacity, {
136
- style: styles.headerButton__right,
137
- disabled: selected.length === 0,
138
- onPress: handleConfirm
139
- }, /*#__PURE__*/React.createElement(Text, {
140
- style: selected.length === 0 ? styles.headerAdd__disabled : styles.headerAdd
141
- }, selected.length > 0 ? `Add (${selected.length})` : 'Add'))), /*#__PURE__*/React.createElement(FlatList, {
142
- data: items,
143
- numColumns: 3,
144
- keyExtractor: item => item.node.image.uri,
145
- renderItem: renderItem,
146
- contentContainerStyle: styles.grid,
147
- onEndReached: onEndReached,
148
- onEndReachedThreshold: 0.6,
149
- initialNumToRender: 30,
150
- windowSize: 5,
151
- ListEmptyComponent: !loading ? /*#__PURE__*/React.createElement(View, {
152
- style: styles.empty
153
- }, /*#__PURE__*/React.createElement(Text, {
154
- style: styles.empty__text
155
- }, "No ", mediaType === 'photo' ? 'photos' : 'videos', " found on this device.")) : null
156
- })));
157
- }
158
- //# sourceMappingURL=MediaSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useEffect","useState","FlatList","Image","Modal","PermissionsAndroid","Platform","Text","TouchableOpacity","TouchableWithoutFeedback","View","CameraRoll","useStyles","PAGE_SIZE","ensureLibraryPermission","mediaType","OS","version","Version","parseInt","perms","PERMISSIONS","READ_MEDIA_IMAGES","READ_MEDIA_VIDEO","READ_EXTERNAL_STORAGE","result","requestMultiple","Object","values","every","status","RESULTS","GRANTED","formatDuration","seconds","total","Math","round","mins","floor","secs","toString","padStart","MediaSelector","visible","existing","remaining","onClose","onConfirm","styles","items","setItems","selected","setSelected","cursor","setCursor","undefined","hasNextPage","setHasNextPage","loading","setLoading","loadPage","after","res","getPhotos","first","assetType","include","prev","edges","page_info","end_cursor","has_next_page","granted","toggle","uri","index","indexOf","filter","u","length","handleConfirm","deduped","includes","onEndReached","renderItem","item","node","image","order","isSelected","duration","playableDuration","React","createElement","onPress","style","cell","cell__image","source","cell__videoDuration","Fragment","cell__selectedOverlay","cell__badge","cell__badgeLabel","cell__badgeEmpty","animationType","onRequestClose","presentationStyle","container","header","headerButton","headerClose","headerTitle","headerButton__right","disabled","headerAdd__disabled","headerAdd","data","numColumns","keyExtractor","contentContainerStyle","grid","onEndReachedThreshold","initialNumToRender","windowSize","ListEmptyComponent","empty","empty__text"],"sourceRoot":"../../../../../src","sources":["social/components/MediaSelector/MediaSelector.tsx"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SACEC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACLC,kBAAkB,EAClBC,QAAQ,EACRC,IAAI,EACJC,gBAAgB,EAChBC,wBAAwB,EACxBC,IAAI,QACC,cAAc;AACrB,SACEC,UAAU,QAEL,uCAAuC;AAC9C,SAASC,SAAS,QAAQ,UAAU;AAcpC,MAAMC,SAAS,GAAG,EAAE;AAEpB,eAAeC,uBAAuBA,CACpCC,SAA4B,EACV;EAClB,IAAIT,QAAQ,CAACU,EAAE,KAAK,SAAS,EAAE,OAAO,IAAI;EAC1C,MAAMC,OAAO,GACX,OAAOX,QAAQ,CAACY,OAAO,KAAK,QAAQ,GAChCZ,QAAQ,CAACY,OAAO,GAChBC,QAAQ,CAACb,QAAQ,CAACY,OAAO,EAAE,EAAE,CAAC;EACpC,MAAME,KAAK,GACTH,OAAO,IAAI,EAAE,GACT,CACEF,SAAS,KAAK,OAAO,GACjBV,kBAAkB,CAACgB,WAAW,CAACC,iBAAiB,GAChDjB,kBAAkB,CAACgB,WAAW,CAACE,gBAAgB,CACpD,GACD,CAAClB,kBAAkB,CAACgB,WAAW,CAACG,qBAAqB,CAAC;EAC5D,IAAI;IAC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C,qBAAqB,EAAE,GAAI;IAC3BC,kBAAkB,EAAE,EAAG;IACvBC,UAAU,EAAE,CAAE;IACdC,kBAAkB,EAChB,CAACnE,OAAO,gBACNkC,KAAA,CAAAC,aAAA,CAACpF,IAAI;MAACsF,KAAK,EAAE/C,MAAM,CAAC8E;IAAM,gBACxBlC,KAAA,CAAAC,aAAA,CAACvF,IAAI;MAACyF,KAAK,EAAE/C,MAAM,CAAC+E;IAAY,GAAC,KAC5B,EAACjH,SAAS,KAAK,OAAO,GAAG,QAAQ,GAAG,QAAQ,EAAC,wBAE5C,CACF,CAAC,GACL;EACL,CACF,CACG,CACD,CAAC;AAEZ","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export { MediaSelector } from './MediaSelector';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["MediaSelector"],"sourceRoot":"../../../../../src","sources":["social/components/MediaSelector/index.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB","ignoreList":[]}
@@ -1,123 +0,0 @@
1
- import { StyleSheet, useWindowDimensions } from 'react-native';
2
- import { useTheme } from 'react-native-paper';
3
- const NUM_COLUMNS = 3;
4
- const CELL_GAP = 2;
5
- export const useStyles = () => {
6
- const theme = useTheme();
7
- const {
8
- width
9
- } = useWindowDimensions();
10
- const cellSize = Math.floor((width - CELL_GAP * (NUM_COLUMNS - 1)) / NUM_COLUMNS);
11
- const styles = StyleSheet.create({
12
- container: {
13
- flex: 1,
14
- backgroundColor: theme.colors.background
15
- },
16
- header: {
17
- flexDirection: 'row',
18
- alignItems: 'center',
19
- justifyContent: 'space-between',
20
- paddingHorizontal: 16,
21
- height: 56
22
- },
23
- headerButton: {
24
- minWidth: 64
25
- },
26
- headerButton__right: {
27
- minWidth: 64,
28
- alignItems: 'flex-end'
29
- },
30
- headerTitle: {
31
- color: theme.colors.base,
32
- fontSize: 16,
33
- fontWeight: '600'
34
- },
35
- headerClose: {
36
- color: theme.colors.base,
37
- fontSize: 16
38
- },
39
- headerAdd: {
40
- color: theme.colors.primary,
41
- fontSize: 16,
42
- fontWeight: '600'
43
- },
44
- headerAdd__disabled: {
45
- color: theme.colors.baseShade3,
46
- fontSize: 16,
47
- fontWeight: '600'
48
- },
49
- grid: {
50
- paddingBottom: 24
51
- },
52
- cell: {
53
- width: cellSize,
54
- height: cellSize,
55
- marginRight: CELL_GAP,
56
- marginBottom: CELL_GAP,
57
- backgroundColor: theme.colors.baseShade4
58
- },
59
- cell__image: {
60
- width: '100%',
61
- height: '100%'
62
- },
63
- cell__selectedOverlay: {
64
- ...StyleSheet.absoluteFillObject,
65
- borderWidth: 2,
66
- borderColor: theme.colors.primary
67
- },
68
- cell__badge: {
69
- position: 'absolute',
70
- top: 6,
71
- right: 6,
72
- minWidth: 22,
73
- height: 22,
74
- borderRadius: 11,
75
- paddingHorizontal: 5,
76
- alignItems: 'center',
77
- justifyContent: 'center',
78
- backgroundColor: theme.colors.primary
79
- },
80
- cell__badgeEmpty: {
81
- position: 'absolute',
82
- top: 6,
83
- right: 6,
84
- width: 22,
85
- height: 22,
86
- borderRadius: 11,
87
- borderWidth: 1.5,
88
- borderColor: '#FFFFFF',
89
- backgroundColor: 'rgba(0,0,0,0.2)'
90
- },
91
- cell__badgeLabel: {
92
- color: '#FFFFFF',
93
- fontSize: 12,
94
- fontWeight: '700'
95
- },
96
- cell__videoDuration: {
97
- position: 'absolute',
98
- bottom: 6,
99
- right: 6,
100
- color: '#FFFFFF',
101
- fontSize: 11,
102
- fontWeight: '600',
103
- textShadowColor: 'rgba(0,0,0,0.6)',
104
- textShadowRadius: 2
105
- },
106
- empty: {
107
- flex: 1,
108
- alignItems: 'center',
109
- justifyContent: 'center',
110
- padding: 32
111
- },
112
- empty__text: {
113
- color: theme.colors.baseShade1,
114
- fontSize: 14,
115
- textAlign: 'center'
116
- }
117
- });
118
- return {
119
- styles,
120
- theme
121
- };
122
- };
123
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["StyleSheet","useWindowDimensions","useTheme","NUM_COLUMNS","CELL_GAP","useStyles","theme","width","cellSize","Math","floor","styles","create","container","flex","backgroundColor","colors","background","header","flexDirection","alignItems","justifyContent","paddingHorizontal","height","headerButton","minWidth","headerButton__right","headerTitle","color","base","fontSize","fontWeight","headerClose","headerAdd","primary","headerAdd__disabled","baseShade3","grid","paddingBottom","cell","marginRight","marginBottom","baseShade4","cell__image","cell__selectedOverlay","absoluteFillObject","borderWidth","borderColor","cell__badge","position","top","right","borderRadius","cell__badgeEmpty","cell__badgeLabel","cell__videoDuration","bottom","textShadowColor","textShadowRadius","empty","padding","empty__text","baseShade1","textAlign"],"sourceRoot":"../../../../../src","sources":["social/components/MediaSelector/styles.ts"],"mappings":"AAAA,SAASA,UAAU,EAAEC,mBAAmB,QAAQ,cAAc;AAC9D,SAASC,QAAQ,QAAQ,oBAAoB;AAG7C,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,QAAQ,GAAG,CAAC;AAElB,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,MAAMC,KAAK,GAAGJ,QAAQ,CAAa,CAAC;EACpC,MAAM;IAAEK;EAAM,CAAC,GAAGN,mBAAmB,CAAC,CAAC;EACvC,MAAMO,QAAQ,GAAGC,IAAI,CAACC,KAAK,CACzB,CAACH,KAAK,GAAGH,QAAQ,IAAID,WAAW,GAAG,CAAC,CAAC,IAAIA,WAC3C,CAAC;EAED,MAAMQ,MAAM,GAAGX,UAAU,CAACY,MAAM,CAAC;IAC/BC,SAAS,EAAE;MACTC,IAAI,EAAE,CAAC;MACPC,eAAe,EAAET,KAAK,CAACU,MAAM,CAACC;IAChC,CAAC;IACDC,MAAM,EAAE;MACNC,aAAa,EAAE,KAAK;MACpBC,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,eAAe;MAC/BC,iBAAiB,EAAE,EAAE;MACrBC,MAAM,EAAE;IACV,CAAC;IACDC,YAAY,EAAE;MACZC,QAAQ,EAAE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AAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBN,eAAe,EAAET,KAAK,CAACU,MAAM,CAACkB;IAChC,CAAC;IACDmB,gBAAgB,EAAE;MAChBJ,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,CAAC;MACNC,KAAK,EAAE,CAAC;MACR5C,KAAK,EAAE,EAAE;MACTgB,MAAM,EAAE,EAAE;MACV6B,YAAY,EAAE,EAAE;MAChBN,WAAW,EAAE,GAAG;MAChBC,WAAW,EAAE,SAAS;MACtBhC,eAAe,EAAE;IACnB,CAAC;IACDuC,gBAAgB,EAAE;MAChB1B,KAAK,EAAE,SAAS;MAChBE,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd,CAAC;IACDwB,mBAAmB,EAAE;MACnBN,QAAQ,EAAE,UAAU;MACpBO,MAAM,EAAE,CAAC;MACTL,KAAK,EAAE,CAAC;MACRvB,KAAK,EAAE,SAAS;MAChBE,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE,KAAK;MACjB0B,eAAe,EAAE,iBAAiB;MAClCC,gBAAgB,EAAE;IACpB,CAAC;IACDC,KAAK,EAAE;MACL7C,IAAI,EAAE,CAAC;MACPM,UAAU,EAAE,QAAQ;MACpBC,cAAc,EAAE,QAAQ;MACxBuC,OAAO,EAAE;IACX,CAAC;IACDC,WAAW,EAAE;MACXjC,KAAK,EAAEtB,KAAK,CAACU,MAAM,CAAC8C,UAAU;MAC9BhC,QAAQ,EAAE,EAAE;MACZiC,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EAEF,OAAO;IAAEpD,MAAM;IAAEL;EAAM,CAAC;AAC1B,CAAC","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- type MediaSelectorProps = {
2
- visible: boolean;
3
- mediaType: 'photo' | 'video';
4
- /** URIs already added to the composer — used for silent duplicate detection. */
5
- existing: string[];
6
- /** How many more items may be added (10 - current count). */
7
- remaining: number;
8
- onClose: () => void;
9
- /** New, de-duplicated URIs in the order they were selected. */
10
- onConfirm: (uris: string[]) => void;
11
- };
12
- export declare function MediaSelector({ visible, mediaType, existing, remaining, onClose, onConfirm, }: MediaSelectorProps): import("react/jsx-runtime").JSX.Element;
13
- export {};
14
- //# sourceMappingURL=MediaSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MediaSelector.d.ts","sourceRoot":"","sources":["../../../../../src/social/components/MediaSelector/MediaSelector.tsx"],"names":[],"mappings":"AAkBA,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,gFAAgF;IAChF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+DAA+D;IAC/D,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACrC,CAAC;AAsCF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,SAAS,GACV,EAAE,kBAAkB,2CA6JpB"}
@@ -1,2 +0,0 @@
1
- export { MediaSelector } from './MediaSelector';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/social/components/MediaSelector/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,116 +0,0 @@
1
- import type { MyMD3Theme } from '../../../core/providers/AmityUIKitProvider';
2
- export declare const useStyles: () => {
3
- styles: {
4
- container: {
5
- flex: number;
6
- backgroundColor: string;
7
- };
8
- header: {
9
- flexDirection: "row";
10
- alignItems: "center";
11
- justifyContent: "space-between";
12
- paddingHorizontal: number;
13
- height: number;
14
- };
15
- headerButton: {
16
- minWidth: number;
17
- };
18
- headerButton__right: {
19
- minWidth: number;
20
- alignItems: "flex-end";
21
- };
22
- headerTitle: {
23
- color: string;
24
- fontSize: number;
25
- fontWeight: "600";
26
- };
27
- headerClose: {
28
- color: string;
29
- fontSize: number;
30
- };
31
- headerAdd: {
32
- color: string;
33
- fontSize: number;
34
- fontWeight: "600";
35
- };
36
- headerAdd__disabled: {
37
- color: string;
38
- fontSize: number;
39
- fontWeight: "600";
40
- };
41
- grid: {
42
- paddingBottom: number;
43
- };
44
- cell: {
45
- width: number;
46
- height: number;
47
- marginRight: number;
48
- marginBottom: number;
49
- backgroundColor: string;
50
- };
51
- cell__image: {
52
- width: "100%";
53
- height: "100%";
54
- };
55
- cell__selectedOverlay: {
56
- borderWidth: number;
57
- borderColor: string;
58
- position: "absolute";
59
- left: 0;
60
- right: 0;
61
- top: 0;
62
- bottom: 0;
63
- };
64
- cell__badge: {
65
- position: "absolute";
66
- top: number;
67
- right: number;
68
- minWidth: number;
69
- height: number;
70
- borderRadius: number;
71
- paddingHorizontal: number;
72
- alignItems: "center";
73
- justifyContent: "center";
74
- backgroundColor: string;
75
- };
76
- cell__badgeEmpty: {
77
- position: "absolute";
78
- top: number;
79
- right: number;
80
- width: number;
81
- height: number;
82
- borderRadius: number;
83
- borderWidth: number;
84
- borderColor: string;
85
- backgroundColor: string;
86
- };
87
- cell__badgeLabel: {
88
- color: string;
89
- fontSize: number;
90
- fontWeight: "700";
91
- };
92
- cell__videoDuration: {
93
- position: "absolute";
94
- bottom: number;
95
- right: number;
96
- color: string;
97
- fontSize: number;
98
- fontWeight: "600";
99
- textShadowColor: string;
100
- textShadowRadius: number;
101
- };
102
- empty: {
103
- flex: number;
104
- alignItems: "center";
105
- justifyContent: "center";
106
- padding: number;
107
- };
108
- empty__text: {
109
- color: string;
110
- fontSize: number;
111
- textAlign: "center";
112
- };
113
- };
114
- theme: MyMD3Theme;
115
- };
116
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../src/social/components/MediaSelector/styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAK7E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHrB,CAAC"}