@react-native-ohos/react-native-safe-area-context 4.7.5-rc.1 → 5.1.1-rc.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/LICENSE +1 -1
- package/README.OpenSource +1 -1
- package/README.md +1 -2
- package/harmony/safe_area/index.ets +1 -3
- package/harmony/safe_area/oh-package.json5 +14 -7
- package/harmony/safe_area/src/main/cpp/SafeAreaBeanData.h +2 -1
- package/harmony/safe_area/src/main/cpp/SafeAreaColumnNode.cpp +6 -7
- package/harmony/safe_area/src/main/cpp/SafeAreaColumnNode.h +4 -5
- package/harmony/safe_area/src/main/cpp/SafeAreaManagerMap.cpp +3 -2
- package/harmony/safe_area/src/main/cpp/SafeAreaManagerMap.h +15 -0
- package/harmony/safe_area/src/main/cpp/SafeAreaProviderComponentInstance.cpp +9 -15
- package/harmony/safe_area/src/main/cpp/SafeAreaProviderComponentInstance.h +18 -16
- package/harmony/safe_area/src/main/cpp/SafeAreaStackNode.cpp +64 -48
- package/harmony/safe_area/src/main/cpp/SafeAreaStackNode.h +43 -19
- package/harmony/safe_area/src/main/cpp/SafeAreaViewComponentInstance.cpp +44 -32
- package/harmony/safe_area/src/main/cpp/SafeAreaViewComponentInstance.h +15 -9
- package/harmony/safe_area/src/main/cpp/SafeAreaViewPackage.h +9 -9
- package/harmony/safe_area/src/main/cpp/TurboModuleRequest.cpp +11 -11
- package/harmony/safe_area/src/main/cpp/TurboModuleRequest.h +2 -1
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/BaseReactNativeSafeAreaContextPackage.h +23 -26
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/components/BaseRNCSafeAreaProviderComponentInstance.h +8 -9
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/components/BaseRNCSafeAreaViewComponentInstance.h +7 -8
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/components/RNCSafeAreaProviderJSIBinder.h +6 -7
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/components/RNCSafeAreaViewJSIBinder.h +3 -6
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCSafeAreaContext.cpp +3 -4
- package/harmony/safe_area/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCSafeAreaContext.h +2 -1
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/ComponentDescriptors.h +6 -2
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/EventEmitters.cpp +35 -36
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/EventEmitters.h +28 -31
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/Props.cpp +5 -2
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/Props.h +46 -57
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/ShadowNodes.cpp +4 -2
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/ShadowNodes.h +15 -5
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/States.cpp +5 -2
- package/harmony/safe_area/src/main/cpp/generated/react/renderer/components/react_native_safe_area_context/States.h +5 -2
- package/harmony/safe_area/src/main/ets/Logger.ts +1 -1
- package/harmony/safe_area/src/main/ets/SafeAreaProvider.ets +1 -1
- package/harmony/safe_area/src/main/ets/SafeAreaProviderModifier.ets +1 -1
- package/harmony/safe_area/src/main/ets/SafeAreaView.ets +1 -1
- package/harmony/safe_area/src/main/ets/SafeAreaViewModifier.ets +1 -1
- package/harmony/safe_area/src/main/ets/{SafeAreaViewPackage.ets → SafeAreaViewPackage.ts} +2 -3
- package/harmony/safe_area/src/main/ets/SafeViewTurboModule.ts +1 -1
- package/harmony/safe_area/src/main/ets/common/SafeAreaType.ts +1 -1
- package/harmony/safe_area/{ts.ets → ts.ts} +1 -1
- package/harmony/safe_area.har +0 -0
- package/lib/commonjs/SafeArea.types.js +6 -0
- package/lib/commonjs/SafeArea.types.js.map +1 -0
- package/lib/commonjs/SafeAreaView.js +209 -0
- package/lib/commonjs/SafeAreaView.js.map +1 -0
- package/lib/commonjs/index.js +74 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/NativeSafeAreaContext.js +32 -0
- package/lib/commonjs/specs/NativeSafeAreaContext.js.map +1 -0
- package/lib/commonjs/specs/NativeSafeAreaProvider.js +33 -0
- package/lib/commonjs/specs/NativeSafeAreaProvider.js.map +1 -0
- package/lib/commonjs/specs/NativeSafeAreaView.js +35 -0
- package/lib/commonjs/specs/NativeSafeAreaView.js.map +1 -0
- package/lib/module/SafeArea.types.js +4 -0
- package/lib/module/SafeArea.types.js.map +1 -0
- package/lib/module/SafeAreaView.js +202 -0
- package/lib/module/SafeAreaView.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/NativeSafeAreaContext.js +28 -0
- package/lib/module/specs/NativeSafeAreaContext.js.map +1 -0
- package/lib/module/specs/NativeSafeAreaProvider.js +29 -0
- package/lib/module/specs/NativeSafeAreaProvider.js.map +1 -0
- package/lib/module/specs/NativeSafeAreaView.js +30 -0
- package/lib/module/specs/NativeSafeAreaView.js.map +1 -0
- package/lib/typescript/SafeArea.types.d.ts +59 -0
- package/lib/typescript/SafeArea.types.d.ts.map +1 -0
- package/lib/typescript/SafeAreaView.d.ts +29 -0
- package/lib/typescript/SafeAreaView.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/specs/NativeSafeAreaContext.d.ts +46 -0
- package/lib/typescript/specs/NativeSafeAreaContext.d.ts.map +1 -0
- package/lib/typescript/specs/NativeSafeAreaProvider.d.ts +45 -0
- package/lib/typescript/specs/NativeSafeAreaProvider.d.ts.map +1 -0
- package/lib/typescript/specs/NativeSafeAreaView.d.ts +24 -0
- package/lib/typescript/specs/NativeSafeAreaView.d.ts.map +1 -0
- package/package.json +39 -39
- package/src/SafeArea.types.ts +23 -0
- package/src/SafeAreaView.tsx +23 -0
- package/src/index.tsx +25 -0
- package/src/specs/NativeSafeAreaContext.ts +23 -0
- package/src/specs/NativeSafeAreaProvider.ts +24 -1
- package/src/specs/NativeSafeAreaView.ts +23 -0
- package/harmony/safe_area/LICENSE +0 -21
- package/harmony/safe_area/NOTICE +0 -33
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
'use client';
|
|
26
|
+
|
|
27
|
+
Object.defineProperty(exports, "__esModule", {
|
|
28
|
+
value: true
|
|
29
|
+
});
|
|
30
|
+
var _SafeAreaContext = require("react-native-safe-area-context/src/SafeAreaContext");
|
|
31
|
+
Object.keys(_SafeAreaContext).forEach(function (key) {
|
|
32
|
+
if (key === "default" || key === "__esModule") return;
|
|
33
|
+
if (key in exports && exports[key] === _SafeAreaContext[key]) return;
|
|
34
|
+
Object.defineProperty(exports, key, {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return _SafeAreaContext[key];
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
var _SafeAreaView = require("./SafeAreaView");
|
|
42
|
+
Object.keys(_SafeAreaView).forEach(function (key) {
|
|
43
|
+
if (key === "default" || key === "__esModule") return;
|
|
44
|
+
if (key in exports && exports[key] === _SafeAreaView[key]) return;
|
|
45
|
+
Object.defineProperty(exports, key, {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function () {
|
|
48
|
+
return _SafeAreaView[key];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
var _InitialWindow = require("react-native-safe-area-context/src//InitialWindow");
|
|
53
|
+
Object.keys(_InitialWindow).forEach(function (key) {
|
|
54
|
+
if (key === "default" || key === "__esModule") return;
|
|
55
|
+
if (key in exports && exports[key] === _InitialWindow[key]) return;
|
|
56
|
+
Object.defineProperty(exports, key, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _InitialWindow[key];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var _SafeArea = require("react-native-safe-area-context/src//SafeArea.types");
|
|
64
|
+
Object.keys(_SafeArea).forEach(function (key) {
|
|
65
|
+
if (key === "default" || key === "__esModule") return;
|
|
66
|
+
if (key in exports && exports[key] === _SafeArea[key]) return;
|
|
67
|
+
Object.defineProperty(exports, key, {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function () {
|
|
70
|
+
return _SafeArea[key];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Object","defineProperty","exports","value","_SafeAreaContext","require","keys","forEach","key","enumerable","get","_SafeAreaView","_InitialWindow","_SafeArea"],"sourceRoot":"..\\..\\src","sources":["index.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;AACA,YAAY;;AAACA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAEb,IAAAC,gBAAA,GAAAC,OAAA;AAAAL,MAAA,CAAAM,IAAA,CAAAF,gBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAN,OAAA,IAAAA,OAAA,CAAAM,GAAA,MAAAJ,gBAAA,CAAAI,GAAA;EAAAR,MAAA,CAAAC,cAAA,CAAAC,OAAA,EAAAM,GAAA;IAAAC,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAN,gBAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAG,aAAA,GAAAN,OAAA;AAAAL,MAAA,CAAAM,IAAA,CAAAK,aAAA,EAAAJ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAN,OAAA,IAAAA,OAAA,CAAAM,GAAA,MAAAG,aAAA,CAAAH,GAAA;EAAAR,MAAA,CAAAC,cAAA,CAAAC,OAAA,EAAAM,GAAA;IAAAC,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAH,GAAA;IAAA;EAAA;AAAA;AACA,IAAAI,cAAA,GAAAP,OAAA;AAAAL,MAAA,CAAAM,IAAA,CAAAM,cAAA,EAAAL,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAN,OAAA,IAAAA,OAAA,CAAAM,GAAA,MAAAI,cAAA,CAAAJ,GAAA;EAAAR,MAAA,CAAAC,cAAA,CAAAC,OAAA,EAAAM,GAAA;IAAAC,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,cAAA,CAAAJ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,SAAA,GAAAR,OAAA;AAAAL,MAAA,CAAAM,IAAA,CAAAO,SAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAN,OAAA,IAAAA,OAAA,CAAAM,GAAA,MAAAK,SAAA,CAAAL,GAAA;EAAAR,MAAA,CAAAC,cAAA,CAAAC,OAAA,EAAAM,GAAA;IAAAC,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,SAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
/**
|
|
9
|
+
* MIT License
|
|
10
|
+
*
|
|
11
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
12
|
+
*
|
|
13
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
* in the Software without restriction, including without limitation the rights
|
|
16
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
* furnished to do so, subject to the following conditions:
|
|
19
|
+
*
|
|
20
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
* copies or substantial portions of the Software.
|
|
22
|
+
*
|
|
23
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
* SOFTWARE.
|
|
30
|
+
*/
|
|
31
|
+
var _default = exports.default = _reactNative.TurboModuleRegistry.get('RNCSafeAreaContext');
|
|
32
|
+
//# sourceMappingURL=NativeSafeAreaContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","TurboModuleRegistry","get"],"sourceRoot":"..\\..\\..\\src","sources":["specs/NativeSafeAreaContext.ts"],"mappings":";;;;;;AAuBA,IAAAA,YAAA,GAAAC,OAAA;AAvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GA6CeC,gCAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* MIT License
|
|
11
|
+
*
|
|
12
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
* in the Software without restriction, including without limitation the rights
|
|
17
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
* furnished to do so, subject to the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
* copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
* SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
var _default = exports.default = (0, _codegenNativeComponent.default)('RNCSafeAreaProvider');
|
|
33
|
+
//# sourceMappingURL=NativeSafeAreaProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent"],"sourceRoot":"..\\..\\..\\src","sources":["specs/NativeSafeAreaProvider.ts"],"mappings":";;;;;;AA2BA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA3B7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAiDe,IAAAG,+BAAsB,EACnC,qBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
/**
|
|
10
|
+
* MIT License
|
|
11
|
+
*
|
|
12
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
13
|
+
*
|
|
14
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
* in the Software without restriction, including without limitation the rights
|
|
17
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
* furnished to do so, subject to the following conditions:
|
|
20
|
+
*
|
|
21
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
22
|
+
* copies or substantial portions of the Software.
|
|
23
|
+
*
|
|
24
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
30
|
+
* SOFTWARE.
|
|
31
|
+
*/
|
|
32
|
+
var _default = exports.default = (0, _codegenNativeComponent.default)('RNCSafeAreaView', {
|
|
33
|
+
interfaceOnly: true
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=NativeSafeAreaView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","default","_default","exports","codegenNativeComponent","interfaceOnly"],"sourceRoot":"..\\..\\..\\src","sources":["specs/NativeSafeAreaView.ts"],"mappings":";;;;;;AAuBA,IAAAA,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAvB7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA,IAAAG,QAAA,GAAAC,OAAA,CAAAF,OAAA,GAgDe,IAAAG,+BAAsB,EAAc,iBAAiB,EAAE;EACpEC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["SafeArea.types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
import NativeSafeAreaView from './specs/NativeSafeAreaView';
|
|
28
|
+
import { useMemo, useState } from 'react';
|
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
+
const defaultEdges = {
|
|
31
|
+
top: 'additive',
|
|
32
|
+
left: 'additive',
|
|
33
|
+
bottom: 'additive',
|
|
34
|
+
right: 'additive'
|
|
35
|
+
};
|
|
36
|
+
let isOnChange = false;
|
|
37
|
+
let realTop = 0;
|
|
38
|
+
let realLeft = 0;
|
|
39
|
+
let realBottom = 0;
|
|
40
|
+
let realRight = 0;
|
|
41
|
+
let safeAreaTop = 0;
|
|
42
|
+
let safeAreaLeft = 0;
|
|
43
|
+
let safeAreaBottom = 0;
|
|
44
|
+
let safeAreaRight = 0;
|
|
45
|
+
function getEdgeValue(edgeMode, insetValue, edgeValue) {
|
|
46
|
+
if (edgeMode === 'off') {
|
|
47
|
+
return edgeValue;
|
|
48
|
+
} else if (edgeMode === 'maximum') {
|
|
49
|
+
return Math.max(insetValue, edgeValue);
|
|
50
|
+
} else {
|
|
51
|
+
return insetValue + edgeValue;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export const SafeAreaView = /*#__PURE__*/React.forwardRef(({
|
|
55
|
+
edges,
|
|
56
|
+
...props
|
|
57
|
+
}, ref) => {
|
|
58
|
+
const nativeEdges = useMemo(() => {
|
|
59
|
+
if (edges == null) {
|
|
60
|
+
return defaultEdges;
|
|
61
|
+
}
|
|
62
|
+
const edgesObj = Array.isArray(edges) ? edges.reduce((acc, edge) => {
|
|
63
|
+
acc[edge] = 'additive';
|
|
64
|
+
return acc;
|
|
65
|
+
}, {}) :
|
|
66
|
+
// ts has trouble with refining readonly arrays.
|
|
67
|
+
edges;
|
|
68
|
+
|
|
69
|
+
// make sure that we always pass all edges, required for fabric
|
|
70
|
+
const requiredEdges = {
|
|
71
|
+
top: edgesObj.top ?? 'off',
|
|
72
|
+
right: edgesObj.right ?? 'off',
|
|
73
|
+
bottom: edgesObj.bottom ?? 'off',
|
|
74
|
+
left: edgesObj.left ?? 'off'
|
|
75
|
+
};
|
|
76
|
+
return requiredEdges;
|
|
77
|
+
}, [edges]);
|
|
78
|
+
const [isFirstRefresh, setIsFirstRefresh] = useState(false);
|
|
79
|
+
let safeAreaStyle = [props.style];
|
|
80
|
+
let rawPadding = 0;
|
|
81
|
+
let rawMargin = 0;
|
|
82
|
+
let rawPaddingTop = undefined;
|
|
83
|
+
let rawPaddingLeft = undefined;
|
|
84
|
+
let rawPaddingBottom = undefined;
|
|
85
|
+
let rawPaddingRight = undefined;
|
|
86
|
+
let rawMarginTop = undefined;
|
|
87
|
+
let rawMarginLeft = undefined;
|
|
88
|
+
let rawMarginBottom = undefined;
|
|
89
|
+
let rawMarginRight = undefined;
|
|
90
|
+
const safeAreaChange = e => {
|
|
91
|
+
if (e.nativeEvent.safeAreaViewInsetsValue?.top) {
|
|
92
|
+
safeAreaTop = e.nativeEvent.safeAreaViewInsetsValue?.top;
|
|
93
|
+
}
|
|
94
|
+
if (e.nativeEvent.safeAreaViewInsetsValue?.right) {
|
|
95
|
+
safeAreaRight = e.nativeEvent.safeAreaViewInsetsValue?.right;
|
|
96
|
+
}
|
|
97
|
+
if (e.nativeEvent.safeAreaViewInsetsValue?.bottom) {
|
|
98
|
+
safeAreaBottom = e.nativeEvent.safeAreaViewInsetsValue?.bottom;
|
|
99
|
+
}
|
|
100
|
+
if (e.nativeEvent.safeAreaViewInsetsValue?.left) {
|
|
101
|
+
safeAreaLeft = e.nativeEvent.safeAreaViewInsetsValue?.left;
|
|
102
|
+
}
|
|
103
|
+
if (!isOnChange) {
|
|
104
|
+
setIsFirstRefresh(true);
|
|
105
|
+
}
|
|
106
|
+
isOnChange = true;
|
|
107
|
+
};
|
|
108
|
+
let rawProp = props.style;
|
|
109
|
+
let i;
|
|
110
|
+
if (rawProp && rawProp.length > 0) {
|
|
111
|
+
for (i = 0; i < rawProp.length; i++) {
|
|
112
|
+
if (rawProp[i]?.padding) {
|
|
113
|
+
rawPadding = rawProp[i]?.padding;
|
|
114
|
+
}
|
|
115
|
+
if (rawProp[i]?.margin) {
|
|
116
|
+
rawMargin = rawProp[i]?.margin;
|
|
117
|
+
}
|
|
118
|
+
if (rawProp[i]?.paddingTop) {
|
|
119
|
+
rawPaddingTop = rawProp[i]?.paddingTop;
|
|
120
|
+
}
|
|
121
|
+
if (rawProp[i]?.paddingLeft) {
|
|
122
|
+
rawPaddingLeft = rawProp[i]?.paddingLeft;
|
|
123
|
+
}
|
|
124
|
+
if (rawProp[i]?.paddingRight) {
|
|
125
|
+
rawPaddingRight = rawProp[i]?.paddingRight;
|
|
126
|
+
}
|
|
127
|
+
if (rawProp[i]?.paddingBottom) {
|
|
128
|
+
rawPaddingBottom = rawProp[i]?.paddingBottom;
|
|
129
|
+
}
|
|
130
|
+
if (rawProp[i]?.marginTop) {
|
|
131
|
+
rawMarginTop = rawProp[i]?.marginTop;
|
|
132
|
+
}
|
|
133
|
+
if (rawProp[i]?.marginLeft) {
|
|
134
|
+
rawMarginLeft = rawProp[i]?.marginLeft;
|
|
135
|
+
}
|
|
136
|
+
if (rawProp[i]?.marginRight) {
|
|
137
|
+
rawMarginRight = rawProp[i]?.marginRight;
|
|
138
|
+
}
|
|
139
|
+
if (rawProp[i]?.marginBottom) {
|
|
140
|
+
rawMarginBottom = rawProp[i]?.marginBottom;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
if (!rawPaddingTop) {
|
|
145
|
+
rawPaddingTop = rawPadding;
|
|
146
|
+
}
|
|
147
|
+
if (!rawPaddingLeft) {
|
|
148
|
+
rawPaddingLeft = rawPadding;
|
|
149
|
+
}
|
|
150
|
+
if (!rawPaddingRight) {
|
|
151
|
+
rawPaddingRight = rawPadding;
|
|
152
|
+
}
|
|
153
|
+
if (!rawPaddingBottom) {
|
|
154
|
+
rawPaddingBottom = rawPadding;
|
|
155
|
+
}
|
|
156
|
+
if (!rawMarginTop) {
|
|
157
|
+
rawMarginTop = rawMargin;
|
|
158
|
+
}
|
|
159
|
+
if (!rawMarginLeft) {
|
|
160
|
+
rawMarginLeft = rawMargin;
|
|
161
|
+
}
|
|
162
|
+
if (!rawMarginRight) {
|
|
163
|
+
rawMarginRight = rawMargin;
|
|
164
|
+
}
|
|
165
|
+
if (!rawMarginBottom) {
|
|
166
|
+
rawMarginBottom = rawMargin;
|
|
167
|
+
}
|
|
168
|
+
if (isOnChange) {
|
|
169
|
+
if (props.mode === 'margin') {
|
|
170
|
+
realTop = getEdgeValue(nativeEdges.top, safeAreaTop, rawMarginTop);
|
|
171
|
+
realLeft = getEdgeValue(nativeEdges.left, safeAreaLeft, rawMarginLeft);
|
|
172
|
+
realBottom = getEdgeValue(nativeEdges.bottom, safeAreaBottom, rawMarginBottom);
|
|
173
|
+
realRight = getEdgeValue(nativeEdges.right, safeAreaRight, rawMarginRight);
|
|
174
|
+
safeAreaStyle = [props.style, {
|
|
175
|
+
marginTop: realTop,
|
|
176
|
+
marginLeft: realLeft,
|
|
177
|
+
marginBottom: realBottom,
|
|
178
|
+
marginRight: realRight
|
|
179
|
+
}];
|
|
180
|
+
} else {
|
|
181
|
+
realTop = getEdgeValue(nativeEdges.top, safeAreaTop, rawPaddingTop);
|
|
182
|
+
realLeft = getEdgeValue(nativeEdges.left, safeAreaLeft, rawPaddingLeft);
|
|
183
|
+
realBottom = getEdgeValue(nativeEdges.bottom, safeAreaBottom, rawPaddingBottom);
|
|
184
|
+
realRight = getEdgeValue(nativeEdges.right, safeAreaRight, rawPaddingRight);
|
|
185
|
+
safeAreaStyle = [props.style, {
|
|
186
|
+
paddingTop: realTop,
|
|
187
|
+
paddingLeft: realLeft,
|
|
188
|
+
paddingBottom: realBottom,
|
|
189
|
+
paddingRight: realRight
|
|
190
|
+
}];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return /*#__PURE__*/_jsx(NativeSafeAreaView, {
|
|
194
|
+
...props,
|
|
195
|
+
style: safeAreaStyle,
|
|
196
|
+
edges: nativeEdges,
|
|
197
|
+
isFirstRefresh: isFirstRefresh,
|
|
198
|
+
onSafeAreaValueChange: safeAreaChange,
|
|
199
|
+
ref: ref
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
//# sourceMappingURL=SafeAreaView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","NativeSafeAreaView","useMemo","useState","jsx","_jsx","defaultEdges","top","left","bottom","right","isOnChange","realTop","realLeft","realBottom","realRight","safeAreaTop","safeAreaLeft","safeAreaBottom","safeAreaRight","getEdgeValue","edgeMode","insetValue","edgeValue","Math","max","SafeAreaView","forwardRef","edges","props","ref","nativeEdges","edgesObj","Array","isArray","reduce","acc","edge","requiredEdges","isFirstRefresh","setIsFirstRefresh","safeAreaStyle","style","rawPadding","rawMargin","rawPaddingTop","undefined","rawPaddingLeft","rawPaddingBottom","rawPaddingRight","rawMarginTop","rawMarginLeft","rawMarginBottom","rawMarginRight","safeAreaChange","e","nativeEvent","safeAreaViewInsetsValue","rawProp","i","length","padding","margin","paddingTop","paddingLeft","paddingRight","paddingBottom","marginTop","marginLeft","marginRight","marginBottom","mode","onSafeAreaValueChange"],"sourceRoot":"..\\..\\src","sources":["SafeAreaView.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;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAQ9B,OAAOC,kBAAkB,MAAsC,4BAA4B;AAE3F,SAASC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1C,MAAMC,YAAoC,GAAG;EAC3CC,GAAG,EAAE,UAAU;EACfC,IAAI,EAAE,UAAU;EAChBC,MAAM,EAAE,UAAU;EAClBC,KAAK,EAAE;AACT,CAAC;AAID,IAAIC,UAAU,GAAG,KAAK;AACtB,IAAIC,OAAO,GAAG,CAAC;AACf,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,aAAa,GAAG,CAACZ,KAAK,CAACa,KAAK,EAAE;QAAEyB,SAAS,EAAEvD,OAAO;QAAEwD,UAAU,EAAEvD,QAAQ;QAAEyD,YAAY,EAAExD,UAAU;QAAEuD,WAAW,EAAEtD;MAAU,CAAC,CAAC;IAC/H,CAAC,MAAM;MACLH,OAAO,GAAGQ,YAAY,CAACW,WAAW,CAACxB,GAAG,EAAES,WAAW,EAAE6B,aAAa,CAAC;MACnEhC,QAAQ,GAAGO,YAAY,CAACW,WAAW,CAACvB,IAAI,EAAES,YAAY,EAAE8B,cAAc,CAAC;MACvEjC,UAAU,GAAGM,YAAY,CAACW,WAAW,CAACtB,MAAM,EAAES,cAAc,EAAE8B,gBAAgB,CAAC;MAC/EjC,SAAS,GAAGK,YAAY,CAACW,WAAW,CAACrB,KAAK,EAAES,aAAa,EAAE8B,eAAe,CAAC;MAC3ER,aAAa,GAAG,CAACZ,KAAK,CAACa,KAAK,EAAE;QAAEqB,UAAU,EAAEnD,OAAO;QAAEoD,WAAW,EAAEnD,QAAQ;QAAEqD,aAAa,EAAEpD,UAAU;QAAEmD,YAAY,EAAElD;MAAU,CAAC,CAAC;IACnI;EACF;EAEA,oBAAOV,IAAA,CAACJ,kBAAkB;IAAA,GAAK4B,KAAK;IAAEa,KAAK,EAAED,aAAc;IAACb,KAAK,EAAEG,WAAY;IAACQ,cAAc,EAAEA,cAAe;IAACiC,qBAAqB,EAAElB,cAAe;IAACxB,GAAG,EAAEA;EAAI,CAAE,CAAC;AACrK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
'use client';
|
|
26
|
+
|
|
27
|
+
export * from 'react-native-safe-area-context/src/SafeAreaContext';
|
|
28
|
+
export * from './SafeAreaView';
|
|
29
|
+
export * from 'react-native-safe-area-context/src//InitialWindow';
|
|
30
|
+
export * from 'react-native-safe-area-context/src//SafeArea.types';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["index.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;AACA,YAAY;;AAEZ,cAAc,oDAAoD;AAClE,cAAc,gBAAgB;AAC9B,cAAc,mDAAmD;AACjE,cAAc,oDAAoD","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
27
|
+
export default TurboModuleRegistry.get('RNCSafeAreaContext');
|
|
28
|
+
//# sourceMappingURL=NativeSafeAreaContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"..\\..\\..\\src","sources":["specs/NativeSafeAreaContext.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAsBA,mBAAmB,QAAQ,cAAc;AAsB/D,eAAeA,mBAAmB,CAACC,GAAG,CAAO,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
28
|
+
export default codegenNativeComponent('RNCSafeAreaProvider');
|
|
29
|
+
//# sourceMappingURL=NativeSafeAreaProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent"],"sourceRoot":"..\\..\\..\\src","sources":["specs/NativeSafeAreaProvider.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAOA,sBAAsB,MAAM,yDAAyD;AAsB5F,eAAeA,sBAAsB,CACnC,qBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
26
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
27
|
+
export default codegenNativeComponent('RNCSafeAreaView', {
|
|
28
|
+
interfaceOnly: true
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=NativeSafeAreaView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"..\\..\\..\\src","sources":["specs/NativeSafeAreaView.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,sBAAsB,MAAM,yDAAyD;AAyB5F,eAAeA,sBAAsB,CAAc,iBAAiB,EAAE;EACpEC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import type * as React from 'react';
|
|
25
|
+
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
26
|
+
import NativeSafeAreaView from './specs/NativeSafeAreaView';
|
|
27
|
+
export type Edge = 'top' | 'right' | 'bottom' | 'left';
|
|
28
|
+
export type EdgeMode = 'off' | 'additive' | 'maximum';
|
|
29
|
+
export type EdgeRecord = Partial<Record<Edge, EdgeMode>>;
|
|
30
|
+
export type Edges = readonly Edge[] | Readonly<EdgeRecord>;
|
|
31
|
+
export interface EdgeInsets {
|
|
32
|
+
top: number;
|
|
33
|
+
right: number;
|
|
34
|
+
bottom: number;
|
|
35
|
+
left: number;
|
|
36
|
+
}
|
|
37
|
+
export interface Rect {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}
|
|
43
|
+
export interface Metrics {
|
|
44
|
+
insets: EdgeInsets;
|
|
45
|
+
frame: Rect;
|
|
46
|
+
}
|
|
47
|
+
export type InsetChangedEvent = NativeSyntheticEvent<Metrics>;
|
|
48
|
+
export type InsetChangeNativeCallback = (event: InsetChangedEvent) => void;
|
|
49
|
+
export interface NativeSafeAreaProviderProps extends ViewProps {
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
onInsetsChange: InsetChangeNativeCallback;
|
|
52
|
+
}
|
|
53
|
+
export interface NativeSafeAreaViewProps extends ViewProps {
|
|
54
|
+
children?: React.ReactNode;
|
|
55
|
+
mode?: 'padding' | 'margin';
|
|
56
|
+
edges?: Edges;
|
|
57
|
+
}
|
|
58
|
+
export type NativeSafeAreaViewInstance = InstanceType<typeof NativeSafeAreaView>;
|
|
59
|
+
//# sourceMappingURL=SafeArea.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SafeArea.types.d.ts","sourceRoot":"","sources":["../../src/SafeArea.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAE5D,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AACvD,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AACzD,MAAM,MAAM,KAAK,GAAG,SAAS,IAAI,EAAE,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,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