@oxyhq/services 22.6.1 → 22.6.3
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/lib/commonjs/ui/components/fileManagement/FileViewer.js +99 -77
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +33 -40
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +92 -88
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +169 -310
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js +17 -14
- package/lib/commonjs/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +16 -20
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js +29 -12
- package/lib/commonjs/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/commonjs/ui/server.js +1 -1
- package/lib/commonjs/ui/server.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +100 -78
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +34 -41
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +94 -90
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +171 -313
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/FileListSection.js +17 -14
- package/lib/module/ui/screens/fileManagement/FileListSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +17 -21
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/UploadBar.js +30 -13
- package/lib/module/ui/screens/fileManagement/UploadBar.js.map +1 -1
- package/lib/module/ui/server.js +1 -1
- package/lib/module/ui/server.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +2 -2
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/FileListSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/UploadBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/server.d.ts +1 -1
- package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +2 -2
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/FileListSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/UploadBar.d.ts.map +1 -1
- package/lib/typescript/module/ui/server.d.ts +1 -1
- package/lib/typescript/module/ui/server.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +82 -68
- package/src/ui/components/fileManagement/UploadPreview.tsx +34 -29
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +14 -12
- package/src/ui/screens/FileManagementScreen.tsx +123 -300
- package/src/ui/screens/fileManagement/FileListSection.tsx +10 -10
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +16 -19
- package/src/ui/screens/fileManagement/UploadBar.tsx +29 -14
- package/src/ui/server.ts +1 -1
- package/lib/commonjs/ui/components/fileManagement/styles.js +0 -832
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +0 -1
- package/lib/module/ui/components/fileManagement/styles.js +0 -828
- package/lib/module/ui/components/fileManagement/styles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts +0 -825
- package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/fileManagement/styles.d.ts +0 -825
- package/lib/typescript/module/ui/components/fileManagement/styles.d.ts.map +0 -1
- package/src/ui/components/fileManagement/styles.ts +0 -823
|
@@ -11,7 +11,6 @@ import { Ionicons } from '@expo/vector-icons';
|
|
|
11
11
|
import type { FileMetadata } from '@oxyhq/core';
|
|
12
12
|
import { SettingsListGroup, SettingsListItem } from '@oxyhq/bloom/settings-list';
|
|
13
13
|
import type { useTheme } from '@oxyhq/bloom/theme';
|
|
14
|
-
import { fileManagementStyles } from '../../components/fileManagement/styles';
|
|
15
14
|
|
|
16
15
|
type ThemeColors = ReturnType<typeof useTheme>['colors'];
|
|
17
16
|
|
|
@@ -63,8 +62,8 @@ const FileListSection: React.FC<FileListSectionProps> = ({
|
|
|
63
62
|
return (
|
|
64
63
|
<ScrollView
|
|
65
64
|
ref={scrollViewRef}
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
className="flex-1"
|
|
66
|
+
contentContainerClassName="px-space-12 pt-0 pb-space-12"
|
|
68
67
|
refreshControl={
|
|
69
68
|
<RefreshControl
|
|
70
69
|
refreshing={refreshing}
|
|
@@ -82,18 +81,19 @@ const FileListSection: React.FC<FileListSectionProps> = ({
|
|
|
82
81
|
scrollEventThrottle={250}
|
|
83
82
|
>
|
|
84
83
|
{filteredFiles.length === 0 && searchQuery.length > 0 ? (
|
|
85
|
-
<View
|
|
84
|
+
<View className="items-center py-10 px-space-24">
|
|
86
85
|
<Ionicons name="search" size={64} color={colors.textTertiary} />
|
|
87
|
-
<Text
|
|
88
|
-
<Text
|
|
86
|
+
<Text className="text-[24px] font-bold mt-space-16 mb-space-8" style={{ color: colors.text }}>{t('fileManagement.noResults.title')}</Text>
|
|
87
|
+
<Text className="text-[16px] text-center leading-[24px] mb-space-32" style={{ color: colors.textSecondary }}>
|
|
89
88
|
{t('fileManagement.noResults.description', { query: searchQuery })}
|
|
90
89
|
</Text>
|
|
91
90
|
<TouchableOpacity
|
|
92
|
-
|
|
91
|
+
className="flex-row items-center px-space-24 py-space-12 rounded-[24px] gap-space-8"
|
|
92
|
+
style={{ backgroundColor: colors.primary }}
|
|
93
93
|
onPress={onClearSearch}
|
|
94
94
|
>
|
|
95
95
|
<Ionicons name="refresh" size={20} color="#FFFFFF" />
|
|
96
|
-
<Text
|
|
96
|
+
<Text className="text-white text-[16px] font-semibold">{t('fileManagement.clearSearch')}</Text>
|
|
97
97
|
</TouchableOpacity>
|
|
98
98
|
</View>
|
|
99
99
|
) : filteredFiles.length === 0 ? renderEmptyState() : (
|
|
@@ -112,9 +112,9 @@ const FileListSection: React.FC<FileListSectionProps> = ({
|
|
|
112
112
|
))}
|
|
113
113
|
</SettingsListGroup>
|
|
114
114
|
{paging.loadingMore && (
|
|
115
|
-
<View
|
|
115
|
+
<View className="flex-row items-center justify-center py-space-12 gap-space-8">
|
|
116
116
|
<ActivityIndicator size="small" color={colors.primary} />
|
|
117
|
-
<Text
|
|
117
|
+
<Text className="text-[13px] font-medium" style={{ color: colors.text }}>{t('fileManagement.loadingMore')}</Text>
|
|
118
118
|
</View>
|
|
119
119
|
)}
|
|
120
120
|
</>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
RefreshControl,
|
|
8
8
|
FlatList,
|
|
9
9
|
Platform,
|
|
10
|
+
useWindowDimensions,
|
|
10
11
|
type LayoutChangeEvent,
|
|
11
12
|
} from 'react-native';
|
|
12
13
|
import { Image as ExpoImage } from 'expo-image';
|
|
@@ -314,20 +315,27 @@ const PhotoPickerView: React.FC<PhotoPickerViewProps> = ({
|
|
|
314
315
|
onConfirm,
|
|
315
316
|
t,
|
|
316
317
|
}) => {
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
// screen
|
|
320
|
-
//
|
|
321
|
-
//
|
|
318
|
+
// Grid sizing width. We PREFER the measured grid-container width (the
|
|
319
|
+
// bottom-sheet content width) so tiles size to the sheet, not the device
|
|
320
|
+
// screen — on wide viewports the sheet is centered/narrower than the screen.
|
|
321
|
+
// But we must NEVER gate the whole grid on that measurement: `onLayout` is
|
|
322
|
+
// unreliable on web (react-native-css can suppress it), and a grid that only
|
|
323
|
+
// renders after a measurement can stay blank forever. So we fall back to the
|
|
324
|
+
// window width until a real measurement arrives — the grid ALWAYS renders,
|
|
325
|
+
// then snaps to the sheet width once `onLayout` reports it. The measured
|
|
326
|
+
// wrapper carries ONLY a `style` (no `className`) to maximise the chance
|
|
327
|
+
// `onLayout` fires on web.
|
|
328
|
+
const { width: windowWidth } = useWindowDimensions();
|
|
322
329
|
const [gridWidth, setGridWidth] = useState(0);
|
|
323
330
|
const onRootLayout = useCallback((e: LayoutChangeEvent) => {
|
|
324
331
|
const w = Math.round(e.nativeEvent.layout.width);
|
|
325
332
|
setGridWidth((prev) => (prev === w ? prev : w));
|
|
326
333
|
}, []);
|
|
327
334
|
|
|
335
|
+
const effectiveWidth = gridWidth > 0 ? gridWidth : windowWidth;
|
|
328
336
|
const { columns, cellSize, gutter } = useMemo(
|
|
329
|
-
() => computePhotoGridLayout(
|
|
330
|
-
[
|
|
337
|
+
() => computePhotoGridLayout(effectiveWidth),
|
|
338
|
+
[effectiveWidth],
|
|
331
339
|
);
|
|
332
340
|
|
|
333
341
|
// Map selectedIds → 1-based selection order for the badge. We freeze a
|
|
@@ -345,13 +353,9 @@ const PhotoPickerView: React.FC<PhotoPickerViewProps> = ({
|
|
|
345
353
|
const hasAnySelection = selectedIds.size > 0;
|
|
346
354
|
|
|
347
355
|
// Compact icon-only upload pill on narrow sheets; full pill otherwise.
|
|
348
|
-
|
|
349
|
-
const showUploadLabel = gridWidth === 0 || gridWidth >= 360;
|
|
356
|
+
const showUploadLabel = effectiveWidth >= 360;
|
|
350
357
|
|
|
351
358
|
const isEmpty = photos.length === 0;
|
|
352
|
-
// Only mount the grid once a real container width is known, so columns /
|
|
353
|
-
// tile size derive from the sheet width instead of a placeholder.
|
|
354
|
-
const gridReady = gridWidth > 0 && cellSize > 0;
|
|
355
359
|
const atSelectionLimit =
|
|
356
360
|
multiSelect && maxSelection != null && selectedIds.size >= maxSelection;
|
|
357
361
|
|
|
@@ -494,13 +498,6 @@ const PhotoPickerView: React.FC<PhotoPickerViewProps> = ({
|
|
|
494
498
|
</TouchableOpacity>
|
|
495
499
|
)}
|
|
496
500
|
</View>
|
|
497
|
-
) : !gridReady ? (
|
|
498
|
-
<View className="flex-1 items-center justify-center pt-[88px]">
|
|
499
|
-
<ActivityIndicator size="large" color="#FFFFFF" />
|
|
500
|
-
<Text className="text-white text-[14px] mt-space-12 opacity-70">
|
|
501
|
-
{t('fileManagement.loadingPhotoLayout')}
|
|
502
|
-
</Text>
|
|
503
|
-
</View>
|
|
504
501
|
) : (
|
|
505
502
|
<FlatList
|
|
506
503
|
key={`cols-${columns}`}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { View, Text, ActivityIndicator } from 'react-native';
|
|
2
|
+
import { View, Text, ActivityIndicator, StyleSheet } from 'react-native';
|
|
3
3
|
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
-
import { fileManagementStyles } from '../../components/fileManagement/styles';
|
|
5
4
|
|
|
6
5
|
export interface UploadBarProps {
|
|
7
6
|
/** Aggregate upload progress, or null when indeterminate. */
|
|
@@ -13,29 +12,45 @@ export interface UploadBarProps {
|
|
|
13
12
|
t: (key: string, vars?: Record<string, string | number>) => string;
|
|
14
13
|
}
|
|
15
14
|
|
|
15
|
+
// The banner drop-shadow has no Bloom/Tailwind token equivalent, so it stays an
|
|
16
|
+
// inline style (genuinely-required exception).
|
|
17
|
+
const shadowStyle = StyleSheet.create({
|
|
18
|
+
banner: {
|
|
19
|
+
shadowColor: '#000',
|
|
20
|
+
shadowOpacity: 0.1,
|
|
21
|
+
shadowRadius: 6,
|
|
22
|
+
shadowOffset: { width: 0, height: 2 },
|
|
23
|
+
elevation: 2,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
16
27
|
/**
|
|
17
28
|
* The non-blocking "Uploading…" banner overlay shown at the bottom of the file
|
|
18
29
|
* manager while uploads are in flight. Purely presentational — the orchestrator
|
|
19
30
|
* gates rendering on `!selectMode && uploading`.
|
|
20
31
|
*/
|
|
21
32
|
const UploadBar: React.FC<UploadBarProps> = ({ uploadProgress, isDark, colors, t }) => (
|
|
22
|
-
<View
|
|
23
|
-
<View
|
|
33
|
+
<View pointerEvents="none" className="absolute top-[72px] left-0 right-0 items-center z-50">
|
|
34
|
+
<View
|
|
35
|
+
className="flex-row items-center px-3.5 py-2.5 rounded-[24px] gap-2.5 border min-w-[200px]"
|
|
36
|
+
style={[shadowStyle.banner, { backgroundColor: isDark ? '#222831EE' : '#FFFFFFEE', borderColor: colors.border }]}
|
|
37
|
+
>
|
|
24
38
|
<Ionicons name="cloud-upload" size={18} color={colors.primary} />
|
|
25
|
-
<View
|
|
26
|
-
<Text
|
|
39
|
+
<View className="flex-1 gap-1.5">
|
|
40
|
+
<Text className="text-[13px] font-medium" style={{ color: colors.text }}>
|
|
27
41
|
{t('fileManagement.uploading')}{uploadProgress ? ` ${uploadProgress.current}/${uploadProgress.total}` : '...'}
|
|
28
42
|
</Text>
|
|
29
43
|
{uploadProgress && uploadProgress.total > 0 && (
|
|
30
|
-
<View
|
|
44
|
+
<View
|
|
45
|
+
className="h-[3px] rounded-[2px] overflow-hidden"
|
|
46
|
+
style={{ backgroundColor: isDark ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.1)' }}
|
|
47
|
+
>
|
|
31
48
|
<View
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
]}
|
|
49
|
+
className="h-full rounded-[2px]"
|
|
50
|
+
style={{
|
|
51
|
+
width: `${(uploadProgress.current / uploadProgress.total) * 100}%`,
|
|
52
|
+
backgroundColor: colors.primary,
|
|
53
|
+
}}
|
|
39
54
|
/>
|
|
40
55
|
</View>
|
|
41
56
|
)}
|
package/src/ui/server.ts
CHANGED
|
@@ -21,7 +21,7 @@ export const LogoText = noopComponent;
|
|
|
21
21
|
export const FollowButton = noopComponent;
|
|
22
22
|
export const OxyPayButton = noopComponent;
|
|
23
23
|
export const FontLoader = noopComponent;
|
|
24
|
-
export const setupFonts = () =>
|
|
24
|
+
export const setupFonts = async (): Promise<boolean> => true;
|
|
25
25
|
|
|
26
26
|
// Context
|
|
27
27
|
export const useOxy = noopHook;
|