@oxy.so/services 12.1.0 → 12.2.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/lib/commonjs/assets/assets/one/floral.jpg.d.ts +1 -1
- package/lib/commonjs/index.js +4 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/registerPlatform.js +20 -0
- package/lib/commonjs/registerPlatform.js.map +1 -0
- package/lib/commonjs/ui/client.js +15 -0
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +6 -5
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/SafeAreaRoot.js +139 -0
- package/lib/commonjs/ui/components/SafeAreaRoot.js.map +1 -0
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +17 -14
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +10 -17
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/index.js +1 -37
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/surfaces.js +2 -2
- package/lib/commonjs/ui/one-video.js +3 -2
- package/lib/commonjs/ui/one-video.js.map +1 -1
- package/lib/commonjs/ui/screens/AvatarCropScreen.js +39 -25
- package/lib/commonjs/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +4 -2
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyOneScreen.js +3 -2
- package/lib/commonjs/ui/screens/OxyOneScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/imageSize.js +31 -0
- package/lib/commonjs/ui/utils/imageSize.js.map +1 -0
- package/lib/commonjs/ui/utils/imageSize.native.js +31 -0
- package/lib/commonjs/ui/utils/imageSize.native.js.map +1 -0
- package/lib/module/assets/assets/one/floral.jpg.d.ts +1 -1
- package/lib/module/index.js +2 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/registerPlatform.js +19 -0
- package/lib/module/registerPlatform.js.map +1 -0
- package/lib/module/ui/client.js +7 -0
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +6 -5
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/SafeAreaRoot.js +135 -0
- package/lib/module/ui/components/SafeAreaRoot.js.map +1 -0
- package/lib/module/ui/components/fileManagement/FileViewer.js +18 -15
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +11 -18
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/index.js +8 -3
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/surfaces.js +2 -2
- package/lib/module/ui/one-video.js +4 -3
- package/lib/module/ui/one-video.js.map +1 -1
- package/lib/module/ui/screens/AvatarCropScreen.js +41 -25
- package/lib/module/ui/screens/AvatarCropScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +5 -3
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyOneScreen.js +4 -3
- package/lib/module/ui/screens/OxyOneScreen.js.map +1 -1
- package/lib/module/ui/utils/imageSize.js +26 -0
- package/lib/module/ui/utils/imageSize.js.map +1 -0
- package/lib/module/ui/utils/imageSize.native.js +26 -0
- package/lib/module/ui/utils/imageSize.native.js.map +1 -0
- package/lib/typescript/assets/one/floral.jpg.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/registerPlatform.d.ts +2 -0
- package/lib/typescript/commonjs/registerPlatform.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/client.d.ts +3 -0
- package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SafeAreaRoot.d.ts +28 -0
- package/lib/typescript/commonjs/ui/components/SafeAreaRoot.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/one-video.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/OxyOneScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/imageSize.d.ts +6 -0
- package/lib/typescript/commonjs/ui/utils/imageSize.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/imageSize.native.d.ts +6 -0
- package/lib/typescript/commonjs/ui/utils/imageSize.native.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/registerPlatform.d.ts +2 -0
- package/lib/typescript/module/registerPlatform.d.ts.map +1 -0
- package/lib/typescript/module/ui/client.d.ts +3 -0
- package/lib/typescript/module/ui/client.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyProvider.d.ts +3 -2
- package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SafeAreaRoot.d.ts +28 -0
- package/lib/typescript/module/ui/components/SafeAreaRoot.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/module/ui/icons/MaterialCommunityIcons.d.ts +1 -1
- package/lib/typescript/module/ui/index.d.ts +1 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/one-video.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AvatarCropScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/EditProfileFieldScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/OxyOneScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/imageSize.d.ts +6 -0
- package/lib/typescript/module/ui/utils/imageSize.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/imageSize.native.d.ts +6 -0
- package/lib/typescript/module/ui/utils/imageSize.native.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/assets/one/floral.jpg.d.ts +1 -1
- package/src/index.ts +2 -3
- package/src/registerPlatform.ts +17 -0
- package/src/ui/client.ts +7 -0
- package/src/ui/components/OxyProvider.tsx +7 -6
- package/src/ui/components/SafeAreaRoot.tsx +123 -0
- package/src/ui/components/__tests__/SafeAreaRoot.test.tsx +162 -0
- package/src/ui/components/fileManagement/FileViewer.tsx +18 -13
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +13 -24
- package/src/ui/index.ts +7 -3
- package/src/ui/navigation/surfaces.ts +2 -2
- package/src/ui/one-video.tsx +3 -2
- package/src/ui/screens/AvatarCropScreen.tsx +30 -25
- package/src/ui/screens/EditProfileFieldScreen.tsx +7 -2
- package/src/ui/screens/OxyOneScreen.tsx +4 -3
- package/src/ui/utils/__tests__/imageSize.test.ts +61 -0
- package/src/ui/utils/imageSize.native.ts +26 -0
- package/src/ui/utils/imageSize.ts +26 -0
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = OxyOneScreen;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _expoImage = require("expo-image");
|
|
9
10
|
var _subscriptionPlans = require("@oxy.so/bloom/subscription-plans");
|
|
10
11
|
var _segmentedControl = require("@oxy.so/bloom/segmented-control");
|
|
11
12
|
var _stepper = require("@oxy.so/bloom/stepper");
|
|
@@ -164,9 +165,9 @@ function OxyOneScreen() {
|
|
|
164
165
|
});
|
|
165
166
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_subscriptionPlans.SubscriptionPlans, {
|
|
166
167
|
productName: "Oxy One",
|
|
167
|
-
heroBackground: oxyOneArtwork ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
168
|
+
heroBackground: oxyOneArtwork ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoImage.Image, {
|
|
168
169
|
source: _floral.default,
|
|
169
|
-
|
|
170
|
+
contentFit: "cover",
|
|
170
171
|
style: {
|
|
171
172
|
width: '100%',
|
|
172
173
|
height: '100%'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_subscriptionPlans","_segmentedControl","_stepper","_typography","_toast","_client","_theme","_SettingsIcon","_oxySupportContext","_floral","_interopRequireDefault","_useI18n","_useSurfaceHeader","_jsxRuntime","e","__esModule","default","apps","personal","creator","business","OxyOneScreen","t","locale","useI18n","theme","useTheme","oxyOneArtwork","useContext","OxySupportContext","audience","setAudience","useState","mode","setMode","period","setPeriod","selected","setSelected","seats","setSeats","useSurfaceHeader","title","titleLayout","money","cents","Intl","NumberFormat","style","currency","format","number","n","toLocaleString","plans","getOnePlans","map","plan","quote","onePlanQuote","totalMonthly","undefined","totalAnnual","monthlyCredits","Error","tier","name","bundled","flatMap","key","app","OXY_ONE_APP_SUBSCRIPTIONS","appTier","creatorTiers","tiers","storage","storageGB","free","id","label","subtitle","price","amount","suffix","description","total","benefits","count","icon","jsx","SettingsIcon","color","colors","primary","length","join","creditDiscount","percent","OXY_ONE_FAMILY_MEMBERS","mercaria","base","baseMonthly","seat","seatMonthly","segments","value","options","change","SegmentedControl","type","onValueChange","size","children","option","SegmentedControlItem","SegmentedControlItemText","SubscriptionPlans","productName","heroBackground","Image","source","floralPoster","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_expoImage","_subscriptionPlans","_segmentedControl","_stepper","_typography","_toast","_client","_theme","_SettingsIcon","_oxySupportContext","_floral","_interopRequireDefault","_useI18n","_useSurfaceHeader","_jsxRuntime","e","__esModule","default","apps","personal","creator","business","OxyOneScreen","t","locale","useI18n","theme","useTheme","oxyOneArtwork","useContext","OxySupportContext","audience","setAudience","useState","mode","setMode","period","setPeriod","selected","setSelected","seats","setSeats","useSurfaceHeader","title","titleLayout","money","cents","Intl","NumberFormat","style","currency","format","number","n","toLocaleString","plans","getOnePlans","map","plan","quote","onePlanQuote","totalMonthly","undefined","totalAnnual","monthlyCredits","Error","tier","name","bundled","flatMap","key","app","OXY_ONE_APP_SUBSCRIPTIONS","appTier","creatorTiers","tiers","storage","storageGB","free","id","label","subtitle","price","amount","suffix","description","total","benefits","count","icon","jsx","SettingsIcon","color","colors","primary","length","join","creditDiscount","percent","OXY_ONE_FAMILY_MEMBERS","mercaria","base","baseMonthly","seat","seatMonthly","segments","value","options","change","SegmentedControl","type","onValueChange","size","children","option","SegmentedControlItem","SegmentedControlItemText","SubscriptionPlans","productName","heroBackground","Image","source","floralPoster","contentFit","width","height","selectorLabel","controls","jsxs","View","gap","StepperRow","min","max","terms","Text","primaryAction","disabled","onPress","moreBenefits","Linking","openURL","catch","toast","error"],"sourceRoot":"../../../../src","sources":["ui/screens/OxyOneScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OA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C,CAAC,gBAAgB;IAAC,CAAO,CAAE;IAC1CiH,aAAa,EAAE;MAAExD,KAAK,EAAEzD,CAAC,CAAC,oBAAoB,CAAC;MAAEkH,QAAQ,EAAE,IAAI;MAAEC,OAAO,EAAEA,CAAA,KAAM5E;IAAU,CAAE;IAC5F6E,YAAY,EAAE;MACZ3D,KAAK,EAAEzD,CAAC,CAAC,aAAa,CAAC;MACvBmH,OAAO,EAAEA,CAAA,KAAM;QACb,KAAKE,oBAAO,CAACC,OAAO,CAAC,oBAAoB,CAAC,CAACC,KAAK,CAAC,MAAMC,YAAK,CAACC,KAAK,CAACzH,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;MAC1F;IACF;EAAE,CACH,CAAC;AAEN","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getImageSize = getImageSize;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* Intrinsic pixel size of an image the SDK is about to draw, for the layouts
|
|
10
|
+
* that size a box from it (the justified photo grid, the file viewer, the
|
|
11
|
+
* avatar crop stage). Resolves `{ width, height }`; rejects when the image
|
|
12
|
+
* cannot be loaded, exactly as react-native's `Image.getSize` reports through
|
|
13
|
+
* its failure callback.
|
|
14
|
+
*
|
|
15
|
+
* This is the web (and `tsc`/Vite) fork: react-native-web's `getSize` is an
|
|
16
|
+
* `<img>` probe, which needs no CORS headers — expo-image's web `loadAsync`
|
|
17
|
+
* uses `fetch`, which does. The native fork (`imageSize.native.ts`) measures
|
|
18
|
+
* through expo-image, so no SDK image depends on react-native's GIF/WebP
|
|
19
|
+
* decoders on Android and an app may turn them off
|
|
20
|
+
* (`expo-build-properties` `android.gifEnabled`/`webpEnabled: false`).
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
function getImageSize(uri) {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
_reactNative.Image.getSize(uri, (width, height) => resolve({
|
|
26
|
+
width,
|
|
27
|
+
height
|
|
28
|
+
}), reject);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=imageSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","getImageSize","uri","Promise","resolve","reject","Image","getSize","width","height"],"sourceRoot":"../../../../src","sources":["ui/utils/imageSize.ts"],"mappings":";;;;;;AAcA,IAAAA,YAAA,GAAAC,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,SAASC,YAAYA,CAACC,GAAW,EAAsB;EAC5D,OAAO,IAAIC,OAAO,CAAY,CAACC,OAAO,EAAEC,MAAM,KAAK;IACjDC,kBAAK,CAACC,OAAO,CAACL,GAAG,EAAE,CAACM,KAAK,EAAEC,MAAM,KAAKL,OAAO,CAAC;MAAEI,KAAK;MAAEC;IAAO,CAAC,CAAC,EAAEJ,MAAM,CAAC;EAC3E,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getImageSize = getImageSize;
|
|
7
|
+
var _expoImage = require("expo-image");
|
|
8
|
+
/**
|
|
9
|
+
* Native fork of `imageSize.ts`: measures through expo-image (Glide on
|
|
10
|
+
* Android, SDWebImage on iOS), the same pipeline and cache `ExpoImage` draws
|
|
11
|
+
* from. react-native's `Image.getSize` decodes through Fresco, whose GIF and
|
|
12
|
+
* animated-WebP support an Android app ships only while `expo-build-properties`
|
|
13
|
+
* keeps `gifEnabled`/`webpEnabled` on — so this file must never name
|
|
14
|
+
* react-native's `Image` (`__tests__/packaging/rnImageBoundary.test.ts`).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
async function getImageSize(uri) {
|
|
18
|
+
const ref = await _expoImage.Image.loadAsync(uri);
|
|
19
|
+
try {
|
|
20
|
+
// `width`/`height` are logical; times `scale` is the pixel size
|
|
21
|
+
// `Image.getSize` reports, which the callers' layouts were written for.
|
|
22
|
+
const scale = ref.scale > 0 ? ref.scale : 1;
|
|
23
|
+
return {
|
|
24
|
+
width: ref.width * scale,
|
|
25
|
+
height: ref.height * scale
|
|
26
|
+
};
|
|
27
|
+
} finally {
|
|
28
|
+
ref.release();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=imageSize.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_expoImage","require","getImageSize","uri","ref","ExpoImage","loadAsync","scale","width","height","release"],"sourceRoot":"../../../../src","sources":["ui/utils/imageSize.native.ts"],"mappings":";;;;;;AAQA,IAAAA,UAAA,GAAAC,OAAA;AARA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,eAAeC,YAAYA,CAACC,GAAW,EAAsB;EAClE,MAAMC,GAAG,GAAG,MAAMC,gBAAS,CAACC,SAAS,CAACH,GAAG,CAAC;EAC1C,IAAI;IACF;IACA;IACA,MAAMI,KAAK,GAAGH,GAAG,CAACG,KAAK,GAAG,CAAC,GAAGH,GAAG,CAACG,KAAK,GAAG,CAAC;IAC3C,OAAO;MAAEC,KAAK,EAAEJ,GAAG,CAACI,KAAK,GAAGD,KAAK;MAAEE,MAAM,EAAEL,GAAG,CAACK,MAAM,GAAGF;IAAM,CAAC;EACjE,CAAC,SAAS;IACRH,GAAG,CAACM,OAAO,CAAC,CAAC;EACf;AACF","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const source:
|
|
1
|
+
declare const source: number;
|
|
2
2
|
export default source;
|
package/lib/module/index.js
CHANGED
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
/// <reference path="./types/react-native-classname.d.ts" />
|
|
27
27
|
/// <reference path="./types/react-native-web-style.d.ts" />
|
|
28
28
|
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
setPlatformOS(Platform.OS);
|
|
29
|
+
// Must stay the first runtime import: core reads the platform from it.
|
|
30
|
+
import "./registerPlatform.js";
|
|
32
31
|
import { registerScreens } from "./ui/navigation/routes.js";
|
|
33
32
|
import { screenComponents } from "./ui/navigation/screenComponents.js";
|
|
34
33
|
registerScreens(screenComponents);
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["registerScreens","screenComponents","default","OxyProvider","useOxy","useOptionalOxy","OxyProviderMissingError","useOxyRuntime","useOxySnapshot","useActiveAccount","useDeviceDirectory","OxyRuntimeMissingError","useAuth","useAppAssertion","AppAssertionProviderMissingError","createDeferredProductAnalytics","IdentityBoundSessionError","useAuthStore","useAssetStore","useAssets","useAssetsStore","useAsset","useUploadProgress","useAssetLoading","useAssetErrors","useAssetsByApp","useAssetsByEntity","useAssetUsageCount","useIsAssetLinked","setOxyAssetInstance","useFileDownloadUrl","useFollow","useFollowerCounts","useSeedFollowStatuses","useStorage","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useUsersBySessions","usePrivacySettings","useConnectedApps","useSessions","useSession","useDeviceSessions","useUserDevices","useSecurityInfo","useAccountStorageUsage","useSecurityActivity","useRecentSecurityActivity","useInfiniteSecurityActivity","useAuthMethods","useSignInMethods","useUserSubscription","useUserPayments","useUserWallet","useUserWalletTransactions","useUpdateProfile","useUploadAvatar","useUpdateAccountSettings","useUpdatePrivacySettings","useUpdateNotificationPreferences","useUpdateUserPreferences","useRevokeConnectedApp","useUploadFile","useSwitchSession","useLogoutSession","useLogoutAll","useUpdateDeviceName","useRemoveDevice","createProfileMutation","createGenericMutation","mutationKeys","queryKeys","invalidateAccountQueries","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","invalidateAuthMethodsQueries","upsertCachedUser","upsertCachedUsers","CLEARABLE_USER_FIELDS","clearedFieldsFromProfileUpdate","clearedFieldsFromAccountUpdate","useMutationStatus","useOnlineStatus","useOxyEvent","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage","useFileFiltering","OXY_OAUTH_STATE_STORAGE_KEY","OXY_OAUTH_CODE_VERIFIER_STORAGE_KEY","OxySignInButton","openOAuthPopup","OxyAuthPrompt","OxyOAuthCallback","OxyConsentScreen","RequireOxyAuth","FollowButton","FollowTargetButton","buildFollowMenuItems","resolveFollowPrimaryAction","FOLLOW_ACTION_LEAVES_ACTIVE","useFollowTarget","useFollowTargetStore","UNKNOWN_FOLLOW_STATUS","isFollowedGlobally","withApplicationMode","isCompleteFollowStatus","followRecordToStatus","followRecordsToStatusMap","PeableButton","OxyPayButton","LogoIcon","LogoText","ProfileButton","OxySignInPanel","OxySignUpPanel","OxyAccountPicker","OxyDeleteAccountPanel","OxyLinkCommonsPanel","OxyPasswordPanel","OxyAuthenticatorPanel","OxyAuthScreen","OxyAuthScreenHeader","OxyAuthLoading","OxyAuthTerms","OxySignInRequestSurface","useDeviceSwitcher","showBottomSheet","closeBottomSheet","useSurfaceHeader","SurfaceHeaderAction","openAccountDialog","closeAccountDialog","subscribeToAccountDialog","usePersonalPlans","usePersonalPlanSubscriptions","AccountInvitationAcceptance","DisplayCurrencySelector","useDisplayCurrency","useDisplayPrice"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,OAAO,uBAAoB;AAE3B,SAASA,eAAe,QAAQ,2BAAwB;AACxD,SAASC,gBAAgB,QAAQ,qCAAkC;AAEnED,eAA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Y,QACP,yCAAsC;AAG7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,4CAAyC;AAIjF;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,iCAA8B;AAGhE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,uCAAoC;AAGtF;AACA;AACA;AACA,SAASC,gBAAgB,QAAmC,gCAA6B;AACzF,SACEC,mBAAmB,QAEd,wCAAqC;;AAE5C;AACA;AACA;AACA;AACA,SACEC,iBAAiB,EACjBC,kBAAkB,EAClBC,wBAAwB,QACnB,yCAAsC;AAO7C,SACEC,gBAAgB,EAChBC,4BAA4B,QACvB,wCAAqC;AAC5C,SAASC,2BAA2B,QAAQ,gDAA6C;AAEzF,SAASC,uBAAuB,QAAQ,4CAAyC;AACjF,SAASC,kBAAkB,QAAQ,kCAA+B;AAClE,SAASC,eAAe,QAAQ,+BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tells `@oxy.so/core` which platform it runs on.
|
|
5
|
+
*
|
|
6
|
+
* Core never imports `react-native`, so on iOS and Android it cannot detect the
|
|
7
|
+
* platform by itself (`navigator.product === 'ReactNative'` only says "native"
|
|
8
|
+
* and it answers `'unknown'`). Until this runs, `isNative()`, `isIOS()` and
|
|
9
|
+
* `isAndroid()` are false on a phone: the shared identity key is not read, the
|
|
10
|
+
* Commons session fallback is off, and Android-only identity paths are skipped.
|
|
11
|
+
*
|
|
12
|
+
* Every client entry imports this module FIRST (`index.ts`, `ui/index.ts`,
|
|
13
|
+
* `ui/client.ts`), so an app that keeps to a lean entry gets the same platform
|
|
14
|
+
* as one that imports the root barrel. `__tests__/boot/cryptoPolyfillOrder.test.ts` pins it.
|
|
15
|
+
*/
|
|
16
|
+
import { setPlatformOS } from '@oxy.so/core';
|
|
17
|
+
import { Platform } from 'react-native';
|
|
18
|
+
setPlatformOS(Platform.OS);
|
|
19
|
+
//# sourceMappingURL=registerPlatform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["registerPlatform.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,QAAyB,cAAc;AAC7D,SAASC,QAAQ,QAAQ,cAAc;AAEvCD,aAAa,CAACC,QAAQ,CAACC,EAAgB,CAAC","ignoreList":[]}
|
package/lib/module/ui/client.js
CHANGED
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* import { OxyProvider, useOxy, LogoIcon } from '@oxy.so/services/ui/client';
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
// Must stay the first runtime import: core reads the platform from it.
|
|
18
|
+
import "../registerPlatform.js";
|
|
19
|
+
|
|
17
20
|
// Components
|
|
18
21
|
export { default as OxyProvider } from "./components/OxyProvider.js";
|
|
19
22
|
export { default as OxySignInButton } from "./components/OxySignInButton.js";
|
|
@@ -42,6 +45,10 @@ export { useFollowTarget } from "./hooks/useFollowTarget.js";
|
|
|
42
45
|
export { useSupervision, supervisionQueryKeys } from "./hooks/queries/useSupervision.js";
|
|
43
46
|
export { useUserProfile, useUserProfiles, useCurrentUser, useUserById, useUserByUsername } from "./hooks/queries/useAccountQueries.js";
|
|
44
47
|
export { useStorage } from "./hooks/useStorage.js";
|
|
48
|
+
// Realtime events and the profile mutation, which startup code (a socket hook,
|
|
49
|
+
// a locale provider) needs without the root barrel's account screens.
|
|
50
|
+
export { useOxyEvent } from "./hooks/useOxyEvent.js";
|
|
51
|
+
export { useUpdateProfile } from "./hooks/mutations/useAccountMutations.js";
|
|
45
52
|
// Route screens live at `@oxy.so/services/screens` so client imports preserve
|
|
46
53
|
// the lean startup bundle; the provider warms their shared chunk before navigation.
|
|
47
54
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","OxyProvider","OxySignInButton","OxyAuthPrompt","LogoIcon","LogoText","FollowButton","FollowTargetButton","ProfileButton","PeableButton","OxyPayButton","useOxy","useOptionalOxy","OxyProviderMissingError","useAuth","useAppAssertion","AppAssertionProviderMissingError","createDeferredProductAnalytics","useFollow","useFollowerCounts","useSeedFollowStatuses","useFollowTarget","useSupervision","supervisionQueryKeys","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useStorage","buildFollowMenuItems","resolveFollowPrimaryAction","FOLLOW_ACTION_LEAVES_ACTIVE","queryKeys","invalidateAccountQueries","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","invalidateAuthMethodsQueries","upsertCachedUser","upsertCachedUsers","CLEARABLE_USER_FIELDS","clearedFieldsFromProfileUpdate","clearedFieldsFromAccountUpdate","useAuthStore","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage"],"sourceRoot":"../../../src","sources":["ui/client.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASA,OAAO,IAAIC,WAAW,QAAQ,6BAA0B;AACjE,SAASD,OAAO,IAAIE,eAAe,QAAQ,iCAA8B;AACzE,SAASF,OAAO,IAAIG,aAAa,QAAQ,+BAA4B;AAErE,SAASC,QAAQ,QAAQ,+BAA4B;AACrD,SAASC,QAAQ,QAAQ,+BAA4B;AACrD,SAASL,OAAO,IAAIM,YAAY,QAAQ,8BAA2B;AACnE,SAASC,kBAAkB,QAAQ,oCAAiC;AAMpE,SAASP,OAAO,IAAIQ,aAAa,QAAQ,+BAA4B;AAErE,SAASR,OAAO,IAAIS,YAAY,QAAQ,8BAA2B;AAEnE;AACA,SAAST,OAAO,IAAIU,YAAY,QAAQ,8BAA2B;AACnE;;AAGA;AACA,SAASC,MAAM,EAAEC,cAAc,EAAEC,uBAAuB,QAAQ,yBAAsB;;AAEtF;AACA,SAASC,OAAO,QAAQ,oBAAiB;AACzC;AACA;AACA,SACEC,eAAe,EACfC,gCAAgC,QAC3B,uCAAoC;AAI3C,SAASC,8BAA8B,QAAQ,iCAA8B;AAE7E,SAASC,SAAS,EAAEC,iBAAiB,EAAEC,qBAAqB,QAAQ,sBAAmB;AACvF,SAASC,eAAe,QAAQ,4BAAyB;AACzD,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,mCAAgC;AAErF,SACEC,cAAc,EACdC,eAAe,EACfC,cAAc,EACdC,WAAW,EACXC,iBAAiB,QACZ,sCAAmC;AAC1C,SAASC,UAAU,QAAQ,uBAAoB;
|
|
1
|
+
{"version":3,"names":["default","OxyProvider","OxySignInButton","OxyAuthPrompt","LogoIcon","LogoText","FollowButton","FollowTargetButton","ProfileButton","PeableButton","OxyPayButton","useOxy","useOptionalOxy","OxyProviderMissingError","useAuth","useAppAssertion","AppAssertionProviderMissingError","createDeferredProductAnalytics","useFollow","useFollowerCounts","useSeedFollowStatuses","useFollowTarget","useSupervision","supervisionQueryKeys","useUserProfile","useUserProfiles","useCurrentUser","useUserById","useUserByUsername","useStorage","useOxyEvent","useUpdateProfile","buildFollowMenuItems","resolveFollowPrimaryAction","FOLLOW_ACTION_LEAVES_ACTIVE","queryKeys","invalidateAccountQueries","invalidateUserQueries","invalidateSessionQueries","invalidateDeviceQueries","invalidatePrivacyQueries","invalidateSecurityQueries","invalidateStorageQueries","invalidatePaymentsQueries","invalidateConnectedAppsQueries","invalidateAuthMethodsQueries","upsertCachedUser","upsertCachedUsers","CLEARABLE_USER_FIELDS","clearedFieldsFromProfileUpdate","clearedFieldsFromAccountUpdate","useAuthStore","handleAuthError","isInvalidSessionError","isTimeoutOrNetworkError","extractErrorMessage"],"sourceRoot":"../../../src","sources":["ui/client.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA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uBAAuB,EACvBC,wBAAwB,EACxBC,yBAAyB,EACzBC,wBAAwB,EACxBC,yBAAyB,EACzBC,8BAA8B,EAC9BC,4BAA4B,QACvB,8BAA2B;AAClC,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,qBAAqB,EACrBC,8BAA8B,EAC9BC,8BAA8B,QACzB,8BAA2B;AAOlC;AACA,SAASC,YAAY,QAAQ,uBAAoB;;AAEjD;AACA,SACEC,eAAe,EACfC,qBAAqB,EACrBC,uBAAuB,EACvBC,mBAAmB,QACd,0BAAuB","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ import { loadScreens } from "../navigation/routes.js";
|
|
|
5
5
|
import { useEffect, useRef, useState, useMemo } from 'react';
|
|
6
6
|
import { AppState, Platform, StyleSheet } from 'react-native';
|
|
7
7
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
8
|
-
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
9
8
|
import { OxyRuntimeProvider } from "../context/OxyContext.js";
|
|
10
9
|
import { QueryClientProvider, focusManager, onlineManager } from '@tanstack/react-query';
|
|
11
10
|
import { SurfaceProvider } from '@oxy.so/bloom/surfaces';
|
|
@@ -16,6 +15,7 @@ import { attachQueryPersistence, createQueryClient } from "../hooks/queryClient.
|
|
|
16
15
|
import { createMemoryStorage, createPlatformStorage } from "../utils/storageHelpers.js";
|
|
17
16
|
import { isNetConnectivityOnline } from "../utils/netConnectivity.js";
|
|
18
17
|
import { KeyboardBoundary } from './KeyboardBoundary';
|
|
18
|
+
import { SafeAreaRoot } from "./SafeAreaRoot.js";
|
|
19
19
|
import { ProductAnalyticsObserver } from "../analytics/productAnalytics.js";
|
|
20
20
|
import { LanguageBridge } from "./LanguageBridge.js";
|
|
21
21
|
import { BloomLocaleBridge } from "./BloomLocaleBridge.js";
|
|
@@ -46,8 +46,9 @@ const isWeb = Platform.OS === 'web';
|
|
|
46
46
|
* OxyProvider - Universal provider for Expo apps (native + web)
|
|
47
47
|
*
|
|
48
48
|
* Provides authentication, session management, query client, and UI overlays.
|
|
49
|
-
* Wraps its own overlay stack in
|
|
50
|
-
*
|
|
49
|
+
* Wraps its own overlay stack in a safe-area root (`SafeAreaRoot`: the native
|
|
50
|
+
* SafeAreaProvider on a device, the window's metrics on web) and
|
|
51
|
+
* GestureHandlerRootView so the shared Bloom SURFACE STACK (`<SurfaceProvider>` / `<SurfaceHost>`) — which
|
|
51
52
|
* hosts every SDK surface (the ~35 bottom-sheet routes + the AccountDialog) — can
|
|
52
53
|
* safely render even when a consuming app has not mounted those providers yet.
|
|
53
54
|
*
|
|
@@ -121,7 +122,7 @@ const OxyProvider = ({
|
|
|
121
122
|
oxyOneArtwork
|
|
122
123
|
}), [onAskAlia, documentationUrl, aliaAvatar, oxyOneArtwork]);
|
|
123
124
|
useEffect(() => {
|
|
124
|
-
//
|
|
125
|
+
// The root entry registers the screens itself; `ui` and `ui/client` warm their chunk here.
|
|
125
126
|
void loadScreens().catch(() => undefined);
|
|
126
127
|
}, []);
|
|
127
128
|
// Storage + persistence wiring.
|
|
@@ -285,7 +286,7 @@ const OxyProvider = ({
|
|
|
285
286
|
});
|
|
286
287
|
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
287
288
|
style: bootStyles.providerRoot,
|
|
288
|
-
children: /*#__PURE__*/_jsx(
|
|
289
|
+
children: /*#__PURE__*/_jsx(SafeAreaRoot, {
|
|
289
290
|
children: /*#__PURE__*/_jsx(KeyboardBoundary, {
|
|
290
291
|
children: coreContent
|
|
291
292
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OxySupportContext","loadScreens","useEffect","useRef","useState","useMemo","AppState","Platform","StyleSheet","GestureHandlerRootView","
|
|
1
|
+
{"version":3,"names":["OxySupportContext","loadScreens","useEffect","useRef","useState","useMemo","AppState","Platform","StyleSheet","GestureHandlerRootView","OxyRuntimeProvider","QueryClientProvider","focusManager","onlineManager","SurfaceProvider","ToastOutlet","logger","loggerUtil","RequireOxyAuth","attachQueryPersistence","createQueryClient","createMemoryStorage","createPlatformStorage","isNetConnectivityOnline","KeyboardBoundary","SafeAreaRoot","ProductAnalyticsObserver","LanguageBridge","BloomLocaleBridge","useOxy","useCurrentUser","jsx","_jsx","jsxs","_jsxs","AccountProfileObserver","canUsePrivateApi","enabled","bootStyles","create","providerRoot","flex","isWeb","OS","OxyProvider","oxyServices","children","onAuthStateChange","onAskAlia","documentationUrl","aliaAvatar","oxyOneArtwork","productAnalytics","storageKeyPrefix","clientId","baseURL","authWebUrl","authRedirectUri","authorizeBaseUrl","sessionMode","webAuthMode","queryClient","providedQueryClient","accountQueries","requireAuth","backgroundSession","language","support","catch","undefined","queryClientRef","persistenceUnsubRef","ownsQueryClientRef","accountQueriesRef","platformStorage","setPlatformStorage","current","client","mounted","bootstrap","storage","error","__DEV__","warn","component","persistence","unsubscribe","restored","handleVisibilityChange","setFocused","document","visibilityState","addEventListener","removeEventListener","subscription","state","remove","cleanup","setupNetworkMonitoring","setOnline","navigator","onLine","handleOnline","handleOffline","window","NetInfo","default","fetch","coreContent","analytics","Provider","value","prompt","style"],"sourceRoot":"../../../../src","sources":["ui/components/OxyProvider.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,iCAA8B;AAChE,SAASC,WAAW,QAAQ,yBAAsB;AAClD,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,QAAiB,OAAO;AACrE,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC7D,SAASC,sBAAsB,QAAQ,8BAA8B;AAErE,SAASC,kBAAkB,QAAsC,0BAAuB;AACxF,SAASC,mBAAmB,EAAEC,YAAY,EAAEC,aAAa,QAAQ,uBAAuB;AACxF,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,MAAM,IAAIC,UAAU,QAAQ,cAAc;AACnD,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,s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N,iBAAiB;QAAAkB,QAAA,gBAChBd,IAAA,CAAChC,iBAAiB,CAAC8G,QAAQ;UAACC,KAAK,EAAE5C,OAAQ;UAAArB,QAAA,eACzCd,IAAA,CAAClB,eAAe;YAAAgC,QAAA,EACbkB,WAAW,KAAK,KAAK,GACpBlB,QAAQ,gBAERd,IAAA,CAACd,cAAc;cAAC8F,MAAM,EAAEhD,WAAY;cAAAlB,QAAA,EAAEA;YAAQ,CAAiB;UAChE,CACc;QAAC,CACQ,CAAC,eAC7Bd,IAAA,CAACjB,WAAW,IAAE,CAAC;MAAA,CACE,CAAC;IAAA,CACF;EAAC,CACF,CACtB;EAED,oBACEiB,IAAA,CAACvB,sBAAsB;IAACwG,KAAK,EAAE3E,UAAU,CAACE,YAAa;IAAAM,QAAA,eACrDd,IAAA,CAACP,YAAY;MAAAqB,QAAA,eACXd,IAAA,CAACR,gBAAgB;QAAAsB,QAAA,EAAE8D;MAAW,CAAmB;IAAC,CACtC;EAAC,CACO,CAAC;AAE7B,CAAC;AAED,eAAehE,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The safe-area root `OxyProvider` mounts around everything it renders.
|
|
5
|
+
*
|
|
6
|
+
* On iOS and Android it is react-native-safe-area-context's own
|
|
7
|
+
* `SafeAreaProvider`, which measures the native root view.
|
|
8
|
+
*
|
|
9
|
+
* On web it does NOT measure. From react-native-safe-area-context 5.9, the web
|
|
10
|
+
* provider measures its own element and reports
|
|
11
|
+
* `windowInsets.bottom - (innerHeight - rect.bottom)` as the bottom inset with
|
|
12
|
+
* no upper clamp (likewise `top - rect.top`). `OxyProvider` wraps the app's
|
|
13
|
+
* whole document, and on a page that scrolls that element is taller than the
|
|
14
|
+
* viewport, so everything below the fold became bottom inset: an 844px phone
|
|
15
|
+
* viewport with a 2690px page reported a ~1850px inset, and the mobile account
|
|
16
|
+
* dialog laid itself out empty. Web therefore gets the WINDOW's metrics — what
|
|
17
|
+
* every version before 5.9 reported for a root provider:
|
|
18
|
+
*
|
|
19
|
+
* - insets: CSS `env(safe-area-inset-*)`, read from one fixed, hidden probe
|
|
20
|
+
* after mount (zero during server rendering and hydration);
|
|
21
|
+
* - frame: the viewport (`useWindowDimensions`), never the document's height.
|
|
22
|
+
*
|
|
23
|
+
* Bloom raises its own web insets to the same `env()` values
|
|
24
|
+
* (`useCssSafeAreaInsets`), so nothing pads twice.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import { useMemo, useSyncExternalStore } from 'react';
|
|
28
|
+
import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
29
|
+
import { SafeAreaFrameContext, SafeAreaInsetsContext, SafeAreaProvider } from 'react-native-safe-area-context';
|
|
30
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
31
|
+
const styles = StyleSheet.create({
|
|
32
|
+
fill: {
|
|
33
|
+
flex: 1
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export function SafeAreaRoot({
|
|
37
|
+
children
|
|
38
|
+
}) {
|
|
39
|
+
if (Platform.OS === 'web') return /*#__PURE__*/_jsx(WindowSafeAreaProvider, {
|
|
40
|
+
children: children
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Web: window metrics, provided through the library's own contexts. */
|
|
48
|
+
function WindowSafeAreaProvider({
|
|
49
|
+
children
|
|
50
|
+
}) {
|
|
51
|
+
const insets = useSyncExternalStore(subscribeWindowInsets, readWindowInsets, readServerInsets);
|
|
52
|
+
const {
|
|
53
|
+
width,
|
|
54
|
+
height
|
|
55
|
+
} = useWindowDimensions();
|
|
56
|
+
const frame = useMemo(() => ({
|
|
57
|
+
x: 0,
|
|
58
|
+
y: 0,
|
|
59
|
+
width,
|
|
60
|
+
height
|
|
61
|
+
}), [width, height]);
|
|
62
|
+
// The same flex-filling view `SafeAreaProvider` renders, so layout below is unchanged.
|
|
63
|
+
return /*#__PURE__*/_jsx(View, {
|
|
64
|
+
style: styles.fill,
|
|
65
|
+
children: /*#__PURE__*/_jsx(SafeAreaFrameContext.Provider, {
|
|
66
|
+
value: frame,
|
|
67
|
+
children: /*#__PURE__*/_jsx(SafeAreaInsetsContext.Provider, {
|
|
68
|
+
value: insets,
|
|
69
|
+
children: children
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const ZERO = Object.freeze({
|
|
75
|
+
top: 0,
|
|
76
|
+
right: 0,
|
|
77
|
+
bottom: 0,
|
|
78
|
+
left: 0
|
|
79
|
+
});
|
|
80
|
+
let probe = null;
|
|
81
|
+
let snapshot = ZERO;
|
|
82
|
+
const listeners = new Set();
|
|
83
|
+
function readServerInsets() {
|
|
84
|
+
return ZERO;
|
|
85
|
+
}
|
|
86
|
+
function readWindowInsets() {
|
|
87
|
+
return snapshot;
|
|
88
|
+
}
|
|
89
|
+
function measure() {
|
|
90
|
+
if (!probe) return;
|
|
91
|
+
const style = getComputedStyle(probe);
|
|
92
|
+
const next = {
|
|
93
|
+
top: Number.parseFloat(style.paddingTop) || 0,
|
|
94
|
+
right: Number.parseFloat(style.paddingRight) || 0,
|
|
95
|
+
bottom: Number.parseFloat(style.paddingBottom) || 0,
|
|
96
|
+
left: Number.parseFloat(style.paddingLeft) || 0
|
|
97
|
+
};
|
|
98
|
+
if (next.top === snapshot.top && next.right === snapshot.right && next.bottom === snapshot.bottom && next.left === snapshot.left) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
snapshot = next.top || next.right || next.bottom || next.left ? next : ZERO;
|
|
102
|
+
for (const listener of listeners) listener();
|
|
103
|
+
}
|
|
104
|
+
function subscribeWindowInsets(listener) {
|
|
105
|
+
if (typeof document === 'undefined' || !document.body) return () => {};
|
|
106
|
+
listeners.add(listener);
|
|
107
|
+
if (!probe) {
|
|
108
|
+
probe = document.createElement('div');
|
|
109
|
+
probe.setAttribute('aria-hidden', 'true');
|
|
110
|
+
// Through the CSSOM, which CSP `style-src` does not block.
|
|
111
|
+
probe.style.position = 'fixed';
|
|
112
|
+
probe.style.visibility = 'hidden';
|
|
113
|
+
probe.style.pointerEvents = 'none';
|
|
114
|
+
probe.style.top = '0';
|
|
115
|
+
probe.style.left = '0';
|
|
116
|
+
probe.style.setProperty('padding-top', 'env(safe-area-inset-top, 0px)');
|
|
117
|
+
probe.style.setProperty('padding-right', 'env(safe-area-inset-right, 0px)');
|
|
118
|
+
probe.style.setProperty('padding-bottom', 'env(safe-area-inset-bottom, 0px)');
|
|
119
|
+
probe.style.setProperty('padding-left', 'env(safe-area-inset-left, 0px)');
|
|
120
|
+
document.body.appendChild(probe);
|
|
121
|
+
window.addEventListener('resize', measure);
|
|
122
|
+
window.addEventListener('orientationchange', measure);
|
|
123
|
+
}
|
|
124
|
+
measure();
|
|
125
|
+
return () => {
|
|
126
|
+
listeners.delete(listener);
|
|
127
|
+
if (listeners.size > 0 || !probe) return;
|
|
128
|
+
window.removeEventListener('resize', measure);
|
|
129
|
+
window.removeEventListener('orientationchange', measure);
|
|
130
|
+
probe.remove();
|
|
131
|
+
probe = null;
|
|
132
|
+
snapshot = ZERO;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=SafeAreaRoot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","useSyncExternalStore","Platform","StyleSheet","useWindowDimensions","View","SafeAreaFrameContext","SafeAreaInsetsContext","SafeAreaProvider","jsx","_jsx","styles","create","fill","flex","SafeAreaRoot","children","OS","WindowSafeAreaProvider","insets","subscribeWindowInsets","readWindowInsets","readServerInsets","width","height","frame","x","y","style","Provider","value","ZERO","Object","freeze","top","right","bottom","left","probe","snapshot","listeners","Set","measure","getComputedStyle","next","Number","parseFloat","paddingTop","paddingRight","paddingBottom","paddingLeft","listener","document","body","add","createElement","setAttribute","position","visibility","pointerEvents","setProperty","appendChild","window","addEventListener","delete","size","removeEventListener","remove"],"sourceRoot":"../../../../src","sources":["ui/components/SafeAreaRoot.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,EAAEC,oBAAoB,QAAQ,OAAO;AACrD,SAASC,QAAQ,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAC9E,SAEEC,oBAAoB,EACpBC,qBAAqB,EACrBC,gBAAgB,QACX,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExC,MAAMC,MAAM,GAAGR,UAAU,CAACS,MAAM,CAAC;EAC/BC,IAAI,EAAE;IAAEC,IAAI,EAAE;EAAE;AAClB,CAAC,CAAC;AAEF,OAAO,SAASC,YAAYA,CAAC;EAAEC;AAAmC,CAAC,EAAE;EACnE,IAAId,QAAQ,CAACe,EAAE,KAAK,KAAK,EAAE,oBAAOP,IAAA,CAACQ,sBAAsB;IAAAF,QAAA,EAAEA;EAAQ,CAAyB,CAAC;EAC7F,oBAAON,IAAA,CAACF,gBAAgB;IAAAQ,QAAA,EAAEA;EAAQ,CAAmB,CAAC;AACxD;;AAEA;AACA,SAASE,sBAAsBA,CAAC;EAAEF;AAAmC,CAAC,EAAE;EACtE,MAAMG,MAAM,GAAGlB,oBAAoB,CAACmB,qBAAqB,EAAEC,gBAAgB,EAAEC,gBAAgB,CAAC;EAC9F,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGpB,mBAAmB,CAAC,CAAC;EAC/C,MAAMqB,KAAK,GAAGzB,OAAO,CAAC,OAAO;IAAE0B,CAAC,EAAE,CAAC;IAAEC,CAAC,EAAE,CAAC;IAAEJ,KAAK;IAAEC;EAAO,CAAC,CAAC,EAAE,CAACD,KAAK,EAA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C,gBAAgB,EAAE,kCAAkC,CAAC;IAC7EtB,KAAK,CAACV,KAAK,CAACgC,WAAW,CAAC,cAAc,EAAE,gCAAgC,CAAC;IACzER,QAAQ,CAACC,IAAI,CAACQ,WAAW,CAACvB,KAAK,CAAC;IAChCwB,MAAM,CAACC,gBAAgB,CAAC,QAAQ,EAAErB,OAAO,CAAC;IAC1CoB,MAAM,CAACC,gBAAgB,CAAC,mBAAmB,EAAErB,OAAO,CAAC;EACvD;EACAA,OAAO,CAAC,CAAC;EACT,OAAO,MAAM;IACXF,SAAS,CAACwB,MAAM,CAACb,QAAQ,CAAC;IAC1B,IAAIX,SAAS,CAACyB,IAAI,GAAG,CAAC,IAAI,CAAC3B,KAAK,EAAE;IAClCwB,MAAM,CAACI,mBAAmB,CAAC,QAAQ,EAAExB,OAAO,CAAC;IAC7CoB,MAAM,CAACI,mBAAmB,CAAC,mBAAmB,EAAExB,OAAO,CAAC;IACxDJ,KAAK,CAAC6B,MAAM,CAAC,CAAC;IACd7B,KAAK,GAAG,IAAI;IACZC,QAAQ,GAAGR,IAAI;EACjB,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { SpinnerIcon } from '@oxy.so/bloom/loading';
|
|
4
4
|
import { useMemo, useState, useEffect } from 'react';
|
|
5
|
-
import { View, ScrollView,
|
|
5
|
+
import { View, ScrollView, StyleSheet } from 'react-native';
|
|
6
6
|
import { Button } from '@oxy.so/bloom/button';
|
|
7
7
|
import { Text } from '@oxy.so/bloom/typography';
|
|
8
8
|
import { Image as ExpoImage } from 'expo-image';
|
|
9
9
|
import MaterialCommunityIcons from "../../icons/MaterialCommunityIcons.js";
|
|
10
10
|
import { useTheme } from '@oxy.so/bloom/theme';
|
|
11
11
|
import { formatFileSize } from "../../utils/fileManagement.js";
|
|
12
|
+
import { getImageSize } from '../../utils/imageSize';
|
|
12
13
|
import { GroupedSection, GroupedSectionItem } from '@oxy.so/bloom/grouped-section';
|
|
13
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
// Genuinely-inline-only styles: the full-bleed blurred background is an
|
|
@@ -59,22 +60,24 @@ export const FileViewer = ({
|
|
|
59
60
|
|
|
60
61
|
// Load image dimensions when image content is available
|
|
61
62
|
useEffect(() => {
|
|
62
|
-
if (isImage
|
|
63
|
-
Image.getSize(fileContent, (width, height) => {
|
|
64
|
-
setImageDimensions({
|
|
65
|
-
width,
|
|
66
|
-
height
|
|
67
|
-
});
|
|
68
|
-
}, () => {
|
|
69
|
-
// Fallback if dimensions can't be loaded
|
|
70
|
-
setImageDimensions({
|
|
71
|
-
width: 400,
|
|
72
|
-
height: 400
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
} else {
|
|
63
|
+
if (!isImage || !fileContent) {
|
|
76
64
|
setImageDimensions(null);
|
|
65
|
+
return;
|
|
77
66
|
}
|
|
67
|
+
// A newer file may replace this one before its size arrives.
|
|
68
|
+
let current = true;
|
|
69
|
+
getImageSize(fileContent).then(size => {
|
|
70
|
+
if (current) setImageDimensions(size);
|
|
71
|
+
}, () => {
|
|
72
|
+
// Fallback if dimensions can't be loaded
|
|
73
|
+
if (current) setImageDimensions({
|
|
74
|
+
width: 400,
|
|
75
|
+
height: 400
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
return () => {
|
|
79
|
+
current = false;
|
|
80
|
+
};
|
|
78
81
|
}, [isImage, fileContent]);
|
|
79
82
|
|
|
80
83
|
// Calculate display size based on natural dimensions and max constraints
|