@apps-in-toss/web-bridge 1.4.5 → 1.4.7
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/built/index.cjs +69 -51
- package/built/index.d.cts +45 -1
- package/built/index.d.ts +45 -1
- package/built/index.js +33 -16
- package/package.json +5 -5
package/built/index.cjs
CHANGED
|
@@ -24,6 +24,7 @@ var index_exports = {};
|
|
|
24
24
|
__export(index_exports, {
|
|
25
25
|
GoogleAdMob: () => GoogleAdMob,
|
|
26
26
|
IAP: () => IAP,
|
|
27
|
+
SafeAreaInsets: () => SafeAreaInsets,
|
|
27
28
|
Storage: () => Storage,
|
|
28
29
|
appsInTossEvent: () => appsInTossEvent,
|
|
29
30
|
env: () => env,
|
|
@@ -373,12 +374,28 @@ var IAP = {
|
|
|
373
374
|
var import_bridge_core4 = require("@apps-in-toss/bridge-core");
|
|
374
375
|
var getSafeAreaBottom = (0, import_bridge_core4.createConstantBridge)("getSafeAreaBottom");
|
|
375
376
|
var getSafeAreaTop = (0, import_bridge_core4.createConstantBridge)("getSafeAreaTop");
|
|
377
|
+
var getSafeAreaLeft = (0, import_bridge_core4.createConstantBridge)("getSafeAreaLeft");
|
|
378
|
+
var getSafeAreaRight = (0, import_bridge_core4.createConstantBridge)("getSafeAreaRight");
|
|
376
379
|
function getSafeAreaInsets() {
|
|
377
|
-
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom() };
|
|
380
|
+
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom(), left: getSafeAreaLeft(), right: getSafeAreaRight() };
|
|
378
381
|
}
|
|
379
382
|
|
|
380
|
-
// src/
|
|
383
|
+
// src/safeAreaInsets.ts
|
|
381
384
|
var import_bridge_core5 = require("@apps-in-toss/bridge-core");
|
|
385
|
+
function subscribeSafeAreaInsets({ onEvent }) {
|
|
386
|
+
return (0, import_bridge_core5.createEventBridge)("safeAreaInsetsChange")({
|
|
387
|
+
onEvent,
|
|
388
|
+
onError: () => {
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
var SafeAreaInsets = {
|
|
393
|
+
get: getSafeAreaInsets,
|
|
394
|
+
subscribe: subscribeSafeAreaInsets
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
// src/googleAdMob.ts
|
|
398
|
+
var import_bridge_core6 = require("@apps-in-toss/bridge-core");
|
|
382
399
|
var GoogleAdMob = {
|
|
383
400
|
/**
|
|
384
401
|
* @public
|
|
@@ -429,9 +446,9 @@ var GoogleAdMob = {
|
|
|
429
446
|
* ```
|
|
430
447
|
*/
|
|
431
448
|
loadAdMobInterstitialAd: Object.assign(
|
|
432
|
-
(0,
|
|
449
|
+
(0, import_bridge_core6.createEventBridge)("loadAdMobInterstitialAd"),
|
|
433
450
|
{
|
|
434
|
-
isSupported: (0,
|
|
451
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAdMobInterstitialAd_isSupported")
|
|
435
452
|
}
|
|
436
453
|
),
|
|
437
454
|
/**
|
|
@@ -504,9 +521,9 @@ var GoogleAdMob = {
|
|
|
504
521
|
* ```
|
|
505
522
|
*/
|
|
506
523
|
showAdMobInterstitialAd: Object.assign(
|
|
507
|
-
(0,
|
|
524
|
+
(0, import_bridge_core6.createEventBridge)("showAdMobInterstitialAd"),
|
|
508
525
|
{
|
|
509
|
-
isSupported: (0,
|
|
526
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("showAdMobInterstitialAd_isSupported")
|
|
510
527
|
}
|
|
511
528
|
),
|
|
512
529
|
/**
|
|
@@ -558,9 +575,9 @@ var GoogleAdMob = {
|
|
|
558
575
|
* ```
|
|
559
576
|
*/
|
|
560
577
|
loadAdMobRewardedAd: Object.assign(
|
|
561
|
-
(0,
|
|
578
|
+
(0, import_bridge_core6.createEventBridge)("loadAdMobRewardedAd"),
|
|
562
579
|
{
|
|
563
|
-
isSupported: (0,
|
|
580
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAdMobRewardedAd_isSupported")
|
|
564
581
|
}
|
|
565
582
|
),
|
|
566
583
|
/**
|
|
@@ -633,9 +650,9 @@ var GoogleAdMob = {
|
|
|
633
650
|
* ```
|
|
634
651
|
*/
|
|
635
652
|
showAdMobRewardedAd: Object.assign(
|
|
636
|
-
(0,
|
|
653
|
+
(0, import_bridge_core6.createEventBridge)("showAdMobRewardedAd"),
|
|
637
654
|
{
|
|
638
|
-
isSupported: (0,
|
|
655
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("showAdMobRewardedAd_isSupported")
|
|
639
656
|
}
|
|
640
657
|
),
|
|
641
658
|
/**
|
|
@@ -692,8 +709,8 @@ var GoogleAdMob = {
|
|
|
692
709
|
* }
|
|
693
710
|
* ```
|
|
694
711
|
*/
|
|
695
|
-
loadAppsInTossAdMob: Object.assign((0,
|
|
696
|
-
isSupported: (0,
|
|
712
|
+
loadAppsInTossAdMob: Object.assign((0, import_bridge_core6.createEventBridge)("loadAppsInTossAdMob"), {
|
|
713
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("loadAppsInTossAdMob_isSupported")
|
|
697
714
|
}),
|
|
698
715
|
/**
|
|
699
716
|
* @public
|
|
@@ -770,19 +787,19 @@ var GoogleAdMob = {
|
|
|
770
787
|
* }
|
|
771
788
|
* ```
|
|
772
789
|
*/
|
|
773
|
-
showAppsInTossAdMob: Object.assign((0,
|
|
774
|
-
isSupported: (0,
|
|
790
|
+
showAppsInTossAdMob: Object.assign((0, import_bridge_core6.createEventBridge)("showAppsInTossAdMob"), {
|
|
791
|
+
isSupported: (0, import_bridge_core6.createConstantBridge)("showAppsInTossAdMob_isSupported")
|
|
775
792
|
})
|
|
776
793
|
};
|
|
777
794
|
|
|
778
795
|
// src/graniteEvent.ts
|
|
779
|
-
var
|
|
796
|
+
var import_bridge_core7 = require("@apps-in-toss/bridge-core");
|
|
780
797
|
var graniteEvent = {
|
|
781
798
|
addEventListener: (event, {
|
|
782
799
|
onEvent,
|
|
783
800
|
onError,
|
|
784
801
|
options
|
|
785
|
-
}) => (0,
|
|
802
|
+
}) => (0, import_bridge_core7.createEventBridge)(event)({
|
|
786
803
|
onEvent,
|
|
787
804
|
onError: onError ?? (() => {
|
|
788
805
|
}),
|
|
@@ -791,13 +808,13 @@ var graniteEvent = {
|
|
|
791
808
|
};
|
|
792
809
|
|
|
793
810
|
// src/appsInTossEvent.ts
|
|
794
|
-
var
|
|
811
|
+
var import_bridge_core8 = require("@apps-in-toss/bridge-core");
|
|
795
812
|
var appsInTossEvent = {
|
|
796
813
|
addEventListener: (event, {
|
|
797
814
|
onEvent,
|
|
798
815
|
onError,
|
|
799
816
|
options
|
|
800
|
-
}) => (0,
|
|
817
|
+
}) => (0, import_bridge_core8.createEventBridge)(event)({
|
|
801
818
|
onEvent,
|
|
802
819
|
onError: onError ?? (() => {
|
|
803
820
|
}),
|
|
@@ -806,18 +823,18 @@ var appsInTossEvent = {
|
|
|
806
823
|
};
|
|
807
824
|
|
|
808
825
|
// src/env.ts
|
|
809
|
-
var
|
|
826
|
+
var import_bridge_core9 = require("@apps-in-toss/bridge-core");
|
|
810
827
|
var env = {
|
|
811
|
-
getDeploymentId: (0,
|
|
828
|
+
getDeploymentId: (0, import_bridge_core9.createConstantBridge)("getDeploymentId")
|
|
812
829
|
};
|
|
813
830
|
|
|
814
831
|
// src/global.ts
|
|
815
|
-
var
|
|
816
|
-
var deploymentId = (0,
|
|
817
|
-
var brandDisplayName = (0,
|
|
818
|
-
var brandIcon = (0,
|
|
819
|
-
var brandPrimaryColor = (0,
|
|
820
|
-
var brandBridgeColorMode = (0,
|
|
832
|
+
var import_bridge_core10 = require("@apps-in-toss/bridge-core");
|
|
833
|
+
var deploymentId = (0, import_bridge_core10.createConstantBridge)("deploymentId");
|
|
834
|
+
var brandDisplayName = (0, import_bridge_core10.createConstantBridge)("brandDisplayName");
|
|
835
|
+
var brandIcon = (0, import_bridge_core10.createConstantBridge)("brandIcon");
|
|
836
|
+
var brandPrimaryColor = (0, import_bridge_core10.createConstantBridge)("brandPrimaryColor");
|
|
837
|
+
var brandBridgeColorMode = (0, import_bridge_core10.createConstantBridge)("brandBridgeColorMode");
|
|
821
838
|
var getAppsInTossGlobals = () => {
|
|
822
839
|
return {
|
|
823
840
|
deploymentId: deploymentId(),
|
|
@@ -829,7 +846,7 @@ var getAppsInTossGlobals = () => {
|
|
|
829
846
|
};
|
|
830
847
|
|
|
831
848
|
// src/tdsEvent.ts
|
|
832
|
-
var
|
|
849
|
+
var import_bridge_core11 = require("@apps-in-toss/bridge-core");
|
|
833
850
|
var tdsEvent = {
|
|
834
851
|
/**
|
|
835
852
|
* @public
|
|
@@ -859,7 +876,7 @@ var tdsEvent = {
|
|
|
859
876
|
onEvent,
|
|
860
877
|
onError,
|
|
861
878
|
options
|
|
862
|
-
}) => (0,
|
|
879
|
+
}) => (0, import_bridge_core11.createEventBridge)(event)({
|
|
863
880
|
onEvent,
|
|
864
881
|
onError: onError ?? (() => {
|
|
865
882
|
}),
|
|
@@ -868,7 +885,7 @@ var tdsEvent = {
|
|
|
868
885
|
};
|
|
869
886
|
|
|
870
887
|
// src/partner.ts
|
|
871
|
-
var
|
|
888
|
+
var import_bridge_core12 = require("@apps-in-toss/bridge-core");
|
|
872
889
|
var partner = {
|
|
873
890
|
/**
|
|
874
891
|
* @public
|
|
@@ -890,7 +907,7 @@ var partner = {
|
|
|
890
907
|
});
|
|
891
908
|
* ```
|
|
892
909
|
*/
|
|
893
|
-
addAccessoryButton: (0,
|
|
910
|
+
addAccessoryButton: (0, import_bridge_core12.createAsyncBridge)("addAccessoryButton"),
|
|
894
911
|
/**
|
|
895
912
|
* @public
|
|
896
913
|
* @category 파트너
|
|
@@ -904,18 +921,18 @@ var partner = {
|
|
|
904
921
|
* partner.removeAccessoryButton();
|
|
905
922
|
* ```
|
|
906
923
|
*/
|
|
907
|
-
removeAccessoryButton: (0,
|
|
924
|
+
removeAccessoryButton: (0, import_bridge_core12.createAsyncBridge)("removeAccessoryButton")
|
|
908
925
|
};
|
|
909
926
|
|
|
910
927
|
// src/permissions/fetchAlbumPhotos.ts
|
|
911
|
-
var
|
|
928
|
+
var import_bridge_core14 = require("@apps-in-toss/bridge-core");
|
|
912
929
|
var import_types = require("@apps-in-toss/types");
|
|
913
930
|
|
|
914
931
|
// src/permissions/createPermissionFunction.ts
|
|
915
|
-
var
|
|
916
|
-
var requestPermission = (0,
|
|
917
|
-
var getPermission = (0,
|
|
918
|
-
var openPermissionDialog = (0,
|
|
932
|
+
var import_bridge_core13 = require("@apps-in-toss/bridge-core");
|
|
933
|
+
var requestPermission = (0, import_bridge_core13.createAsyncBridge)("requestPermission");
|
|
934
|
+
var getPermission = (0, import_bridge_core13.createAsyncBridge)("getPermission");
|
|
935
|
+
var openPermissionDialog = (0, import_bridge_core13.createAsyncBridge)("openPermissionDialog");
|
|
919
936
|
function createPermissionFunction({
|
|
920
937
|
permission,
|
|
921
938
|
handler,
|
|
@@ -936,7 +953,7 @@ function createPermissionFunction({
|
|
|
936
953
|
// src/permissions/fetchAlbumPhotos.ts
|
|
937
954
|
var fetchAlbumPhotos = createPermissionFunction({
|
|
938
955
|
handler: (options) => {
|
|
939
|
-
return (0,
|
|
956
|
+
return (0, import_bridge_core14.createAsyncBridge)("fetchAlbumPhotos")(
|
|
940
957
|
options
|
|
941
958
|
);
|
|
942
959
|
},
|
|
@@ -948,11 +965,11 @@ var fetchAlbumPhotos = createPermissionFunction({
|
|
|
948
965
|
});
|
|
949
966
|
|
|
950
967
|
// src/permissions/fetchContacts.ts
|
|
951
|
-
var
|
|
968
|
+
var import_bridge_core15 = require("@apps-in-toss/bridge-core");
|
|
952
969
|
var import_types2 = require("@apps-in-toss/types");
|
|
953
970
|
var fetchContacts = createPermissionFunction({
|
|
954
971
|
handler: (options) => {
|
|
955
|
-
return (0,
|
|
972
|
+
return (0, import_bridge_core15.createAsyncBridge)("fetchContacts")(options);
|
|
956
973
|
},
|
|
957
974
|
permission: {
|
|
958
975
|
name: "contacts",
|
|
@@ -962,11 +979,11 @@ var fetchContacts = createPermissionFunction({
|
|
|
962
979
|
});
|
|
963
980
|
|
|
964
981
|
// src/permissions/getCurrentLocation.ts
|
|
965
|
-
var
|
|
982
|
+
var import_bridge_core16 = require("@apps-in-toss/bridge-core");
|
|
966
983
|
var import_types3 = require("@apps-in-toss/types");
|
|
967
984
|
var getCurrentLocation = createPermissionFunction({
|
|
968
985
|
handler: (options) => {
|
|
969
|
-
return (0,
|
|
986
|
+
return (0, import_bridge_core16.createAsyncBridge)(
|
|
970
987
|
"getCurrentLocation"
|
|
971
988
|
)(options);
|
|
972
989
|
},
|
|
@@ -978,11 +995,11 @@ var getCurrentLocation = createPermissionFunction({
|
|
|
978
995
|
});
|
|
979
996
|
|
|
980
997
|
// src/permissions/openCamera.ts
|
|
981
|
-
var
|
|
998
|
+
var import_bridge_core17 = require("@apps-in-toss/bridge-core");
|
|
982
999
|
var import_types4 = require("@apps-in-toss/types");
|
|
983
1000
|
var openCamera = createPermissionFunction({
|
|
984
1001
|
handler: (options) => {
|
|
985
|
-
return (0,
|
|
1002
|
+
return (0, import_bridge_core17.createAsyncBridge)("openCamera")(options);
|
|
986
1003
|
},
|
|
987
1004
|
permission: {
|
|
988
1005
|
name: "camera",
|
|
@@ -992,11 +1009,11 @@ var openCamera = createPermissionFunction({
|
|
|
992
1009
|
});
|
|
993
1010
|
|
|
994
1011
|
// src/permissions/setClipboardText.ts
|
|
995
|
-
var
|
|
1012
|
+
var import_bridge_core18 = require("@apps-in-toss/bridge-core");
|
|
996
1013
|
var import_types5 = require("@apps-in-toss/types");
|
|
997
1014
|
var setClipboardText = createPermissionFunction({
|
|
998
1015
|
handler: (options) => {
|
|
999
|
-
return (0,
|
|
1016
|
+
return (0, import_bridge_core18.createAsyncBridge)("setClipboardText")(
|
|
1000
1017
|
options
|
|
1001
1018
|
);
|
|
1002
1019
|
},
|
|
@@ -1008,11 +1025,11 @@ var setClipboardText = createPermissionFunction({
|
|
|
1008
1025
|
});
|
|
1009
1026
|
|
|
1010
1027
|
// src/permissions/getClipboardText.ts
|
|
1011
|
-
var
|
|
1028
|
+
var import_bridge_core19 = require("@apps-in-toss/bridge-core");
|
|
1012
1029
|
var import_types6 = require("@apps-in-toss/types");
|
|
1013
1030
|
var getClipboardText = createPermissionFunction({
|
|
1014
1031
|
handler: () => {
|
|
1015
|
-
return (0,
|
|
1032
|
+
return (0, import_bridge_core19.createAsyncBridge)("getClipboardText")();
|
|
1016
1033
|
},
|
|
1017
1034
|
permission: {
|
|
1018
1035
|
name: "clipboard",
|
|
@@ -1022,12 +1039,12 @@ var getClipboardText = createPermissionFunction({
|
|
|
1022
1039
|
});
|
|
1023
1040
|
|
|
1024
1041
|
// src/permissions/startUpdateLocation.ts
|
|
1025
|
-
var
|
|
1042
|
+
var import_bridge_core20 = require("@apps-in-toss/bridge-core");
|
|
1026
1043
|
var import_types7 = require("@apps-in-toss/types");
|
|
1027
|
-
var getPermission2 = (0,
|
|
1028
|
-
var openPermissionDialog2 = (0,
|
|
1044
|
+
var getPermission2 = (0, import_bridge_core20.createAsyncBridge)("getPermission");
|
|
1045
|
+
var openPermissionDialog2 = (0, import_bridge_core20.createAsyncBridge)("openPermissionDialog");
|
|
1029
1046
|
var startUpdateLocation = (params) => {
|
|
1030
|
-
return (0,
|
|
1047
|
+
return (0, import_bridge_core20.createEventBridge)("updateLocationEvent")({
|
|
1031
1048
|
...params,
|
|
1032
1049
|
onError: (error) => {
|
|
1033
1050
|
const locationError = new import_types7.StartUpdateLocationPermissionError();
|
|
@@ -1047,6 +1064,7 @@ __reExport(index_exports, require("@apps-in-toss/types"), module.exports);
|
|
|
1047
1064
|
0 && (module.exports = {
|
|
1048
1065
|
GoogleAdMob,
|
|
1049
1066
|
IAP,
|
|
1067
|
+
SafeAreaInsets,
|
|
1050
1068
|
Storage,
|
|
1051
1069
|
appsInTossEvent,
|
|
1052
1070
|
env,
|
package/built/index.d.cts
CHANGED
|
@@ -305,9 +305,53 @@ declare const IAP: {
|
|
|
305
305
|
}) => Promise<boolean>;
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link SafeAreaInsets.get}를 사용해주세요.
|
|
311
|
+
*/
|
|
308
312
|
declare function getSafeAreaInsets(): {
|
|
309
313
|
top: number;
|
|
310
314
|
bottom: number;
|
|
315
|
+
left: number;
|
|
316
|
+
right: number;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @public
|
|
321
|
+
* @name subscribeSafeAreaInsets
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ### 화면 모드 변경 시 바뀌는 safe area 값 구독하기
|
|
325
|
+
* ```tsx
|
|
326
|
+
* import { SafeAreaInsets } from '@apps-in-toss/web-framework';
|
|
327
|
+
* import { useEffect, useState } from 'react';
|
|
328
|
+
*
|
|
329
|
+
* function Page() {
|
|
330
|
+
* const [safeAreaInsetsValue, setSafeAreaInsetsValue] = useState<SafeAreaInsets>(() => SafeAreaInsets.get())
|
|
331
|
+
* useEffect(() => {
|
|
332
|
+
* const cleanup = SafeAreaInsets.subscribe({
|
|
333
|
+
* onEvent: (insets) => {
|
|
334
|
+
* setSafeAreaInsetsValue(insets);
|
|
335
|
+
* }
|
|
336
|
+
* });
|
|
337
|
+
*
|
|
338
|
+
* return () => cleanup();
|
|
339
|
+
* }, []);
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
declare function subscribeSafeAreaInsets({ onEvent }: {
|
|
344
|
+
onEvent: (data: SafeAreaInsets) => void;
|
|
345
|
+
}): () => void;
|
|
346
|
+
interface SafeAreaInsets {
|
|
347
|
+
top: number;
|
|
348
|
+
bottom: number;
|
|
349
|
+
left: number;
|
|
350
|
+
right: number;
|
|
351
|
+
}
|
|
352
|
+
declare const SafeAreaInsets: {
|
|
353
|
+
get: typeof getSafeAreaInsets;
|
|
354
|
+
subscribe: typeof subscribeSafeAreaInsets;
|
|
311
355
|
};
|
|
312
356
|
|
|
313
357
|
declare const GoogleAdMob: {
|
|
@@ -922,4 +966,4 @@ declare const startUpdateLocation: {
|
|
|
922
966
|
openPermissionDialog(): Promise<"denied" | "allowed">;
|
|
923
967
|
};
|
|
924
968
|
|
|
925
|
-
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
|
969
|
+
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, SafeAreaInsets, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
package/built/index.d.ts
CHANGED
|
@@ -305,9 +305,53 @@ declare const IAP: {
|
|
|
305
305
|
}) => Promise<boolean>;
|
|
306
306
|
};
|
|
307
307
|
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* @deprecated 이 함수는 더 이상 사용되지 않습니다. 대신 {@link SafeAreaInsets.get}를 사용해주세요.
|
|
311
|
+
*/
|
|
308
312
|
declare function getSafeAreaInsets(): {
|
|
309
313
|
top: number;
|
|
310
314
|
bottom: number;
|
|
315
|
+
left: number;
|
|
316
|
+
right: number;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* @public
|
|
321
|
+
* @name subscribeSafeAreaInsets
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* ### 화면 모드 변경 시 바뀌는 safe area 값 구독하기
|
|
325
|
+
* ```tsx
|
|
326
|
+
* import { SafeAreaInsets } from '@apps-in-toss/web-framework';
|
|
327
|
+
* import { useEffect, useState } from 'react';
|
|
328
|
+
*
|
|
329
|
+
* function Page() {
|
|
330
|
+
* const [safeAreaInsetsValue, setSafeAreaInsetsValue] = useState<SafeAreaInsets>(() => SafeAreaInsets.get())
|
|
331
|
+
* useEffect(() => {
|
|
332
|
+
* const cleanup = SafeAreaInsets.subscribe({
|
|
333
|
+
* onEvent: (insets) => {
|
|
334
|
+
* setSafeAreaInsetsValue(insets);
|
|
335
|
+
* }
|
|
336
|
+
* });
|
|
337
|
+
*
|
|
338
|
+
* return () => cleanup();
|
|
339
|
+
* }, []);
|
|
340
|
+
* }
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
declare function subscribeSafeAreaInsets({ onEvent }: {
|
|
344
|
+
onEvent: (data: SafeAreaInsets) => void;
|
|
345
|
+
}): () => void;
|
|
346
|
+
interface SafeAreaInsets {
|
|
347
|
+
top: number;
|
|
348
|
+
bottom: number;
|
|
349
|
+
left: number;
|
|
350
|
+
right: number;
|
|
351
|
+
}
|
|
352
|
+
declare const SafeAreaInsets: {
|
|
353
|
+
get: typeof getSafeAreaInsets;
|
|
354
|
+
subscribe: typeof subscribeSafeAreaInsets;
|
|
311
355
|
};
|
|
312
356
|
|
|
313
357
|
declare const GoogleAdMob: {
|
|
@@ -922,4 +966,4 @@ declare const startUpdateLocation: {
|
|
|
922
966
|
openPermissionDialog(): Promise<"denied" | "allowed">;
|
|
923
967
|
};
|
|
924
968
|
|
|
925
|
-
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
|
969
|
+
export { type AddAccessoryButtonOptions, type AppsInTossEvent, type AppsInTossGlobals, type CompletedOrRefundedOrdersResult, GoogleAdMob, type GraniteEvent, IAP, type IapCreateOneTimePurchaseOrderOptions, type IapProductListItem, SafeAreaInsets, Storage, type TdsEvent, appsInTossEvent, env, fetchAlbumPhotos, fetchContacts, getAppsInTossGlobals, getClipboardText, getCurrentLocation, getSafeAreaInsets, graniteEvent, isMinVersionSupported, openCamera, partner, setClipboardText, startUpdateLocation, tdsEvent };
|
package/built/index.js
CHANGED
|
@@ -332,12 +332,28 @@ var IAP = {
|
|
|
332
332
|
import { createConstantBridge as createConstantBridge2 } from "@apps-in-toss/bridge-core";
|
|
333
333
|
var getSafeAreaBottom = createConstantBridge2("getSafeAreaBottom");
|
|
334
334
|
var getSafeAreaTop = createConstantBridge2("getSafeAreaTop");
|
|
335
|
+
var getSafeAreaLeft = createConstantBridge2("getSafeAreaLeft");
|
|
336
|
+
var getSafeAreaRight = createConstantBridge2("getSafeAreaRight");
|
|
335
337
|
function getSafeAreaInsets() {
|
|
336
|
-
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom() };
|
|
338
|
+
return { top: getSafeAreaTop(), bottom: getSafeAreaBottom(), left: getSafeAreaLeft(), right: getSafeAreaRight() };
|
|
337
339
|
}
|
|
338
340
|
|
|
341
|
+
// src/safeAreaInsets.ts
|
|
342
|
+
import { createEventBridge as createEventBridge2 } from "@apps-in-toss/bridge-core";
|
|
343
|
+
function subscribeSafeAreaInsets({ onEvent }) {
|
|
344
|
+
return createEventBridge2("safeAreaInsetsChange")({
|
|
345
|
+
onEvent,
|
|
346
|
+
onError: () => {
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
var SafeAreaInsets = {
|
|
351
|
+
get: getSafeAreaInsets,
|
|
352
|
+
subscribe: subscribeSafeAreaInsets
|
|
353
|
+
};
|
|
354
|
+
|
|
339
355
|
// src/googleAdMob.ts
|
|
340
|
-
import { createConstantBridge as createConstantBridge3, createEventBridge as
|
|
356
|
+
import { createConstantBridge as createConstantBridge3, createEventBridge as createEventBridge3 } from "@apps-in-toss/bridge-core";
|
|
341
357
|
var GoogleAdMob = {
|
|
342
358
|
/**
|
|
343
359
|
* @public
|
|
@@ -388,7 +404,7 @@ var GoogleAdMob = {
|
|
|
388
404
|
* ```
|
|
389
405
|
*/
|
|
390
406
|
loadAdMobInterstitialAd: Object.assign(
|
|
391
|
-
|
|
407
|
+
createEventBridge3("loadAdMobInterstitialAd"),
|
|
392
408
|
{
|
|
393
409
|
isSupported: createConstantBridge3("loadAdMobInterstitialAd_isSupported")
|
|
394
410
|
}
|
|
@@ -463,7 +479,7 @@ var GoogleAdMob = {
|
|
|
463
479
|
* ```
|
|
464
480
|
*/
|
|
465
481
|
showAdMobInterstitialAd: Object.assign(
|
|
466
|
-
|
|
482
|
+
createEventBridge3("showAdMobInterstitialAd"),
|
|
467
483
|
{
|
|
468
484
|
isSupported: createConstantBridge3("showAdMobInterstitialAd_isSupported")
|
|
469
485
|
}
|
|
@@ -517,7 +533,7 @@ var GoogleAdMob = {
|
|
|
517
533
|
* ```
|
|
518
534
|
*/
|
|
519
535
|
loadAdMobRewardedAd: Object.assign(
|
|
520
|
-
|
|
536
|
+
createEventBridge3("loadAdMobRewardedAd"),
|
|
521
537
|
{
|
|
522
538
|
isSupported: createConstantBridge3("loadAdMobRewardedAd_isSupported")
|
|
523
539
|
}
|
|
@@ -592,7 +608,7 @@ var GoogleAdMob = {
|
|
|
592
608
|
* ```
|
|
593
609
|
*/
|
|
594
610
|
showAdMobRewardedAd: Object.assign(
|
|
595
|
-
|
|
611
|
+
createEventBridge3("showAdMobRewardedAd"),
|
|
596
612
|
{
|
|
597
613
|
isSupported: createConstantBridge3("showAdMobRewardedAd_isSupported")
|
|
598
614
|
}
|
|
@@ -651,7 +667,7 @@ var GoogleAdMob = {
|
|
|
651
667
|
* }
|
|
652
668
|
* ```
|
|
653
669
|
*/
|
|
654
|
-
loadAppsInTossAdMob: Object.assign(
|
|
670
|
+
loadAppsInTossAdMob: Object.assign(createEventBridge3("loadAppsInTossAdMob"), {
|
|
655
671
|
isSupported: createConstantBridge3("loadAppsInTossAdMob_isSupported")
|
|
656
672
|
}),
|
|
657
673
|
/**
|
|
@@ -729,19 +745,19 @@ var GoogleAdMob = {
|
|
|
729
745
|
* }
|
|
730
746
|
* ```
|
|
731
747
|
*/
|
|
732
|
-
showAppsInTossAdMob: Object.assign(
|
|
748
|
+
showAppsInTossAdMob: Object.assign(createEventBridge3("showAppsInTossAdMob"), {
|
|
733
749
|
isSupported: createConstantBridge3("showAppsInTossAdMob_isSupported")
|
|
734
750
|
})
|
|
735
751
|
};
|
|
736
752
|
|
|
737
753
|
// src/graniteEvent.ts
|
|
738
|
-
import { createEventBridge as
|
|
754
|
+
import { createEventBridge as createEventBridge4 } from "@apps-in-toss/bridge-core";
|
|
739
755
|
var graniteEvent = {
|
|
740
756
|
addEventListener: (event, {
|
|
741
757
|
onEvent,
|
|
742
758
|
onError,
|
|
743
759
|
options
|
|
744
|
-
}) =>
|
|
760
|
+
}) => createEventBridge4(event)({
|
|
745
761
|
onEvent,
|
|
746
762
|
onError: onError ?? (() => {
|
|
747
763
|
}),
|
|
@@ -750,13 +766,13 @@ var graniteEvent = {
|
|
|
750
766
|
};
|
|
751
767
|
|
|
752
768
|
// src/appsInTossEvent.ts
|
|
753
|
-
import { createEventBridge as
|
|
769
|
+
import { createEventBridge as createEventBridge5 } from "@apps-in-toss/bridge-core";
|
|
754
770
|
var appsInTossEvent = {
|
|
755
771
|
addEventListener: (event, {
|
|
756
772
|
onEvent,
|
|
757
773
|
onError,
|
|
758
774
|
options
|
|
759
|
-
}) =>
|
|
775
|
+
}) => createEventBridge5(event)({
|
|
760
776
|
onEvent,
|
|
761
777
|
onError: onError ?? (() => {
|
|
762
778
|
}),
|
|
@@ -788,7 +804,7 @@ var getAppsInTossGlobals = () => {
|
|
|
788
804
|
};
|
|
789
805
|
|
|
790
806
|
// src/tdsEvent.ts
|
|
791
|
-
import { createEventBridge as
|
|
807
|
+
import { createEventBridge as createEventBridge6 } from "@apps-in-toss/bridge-core";
|
|
792
808
|
var tdsEvent = {
|
|
793
809
|
/**
|
|
794
810
|
* @public
|
|
@@ -818,7 +834,7 @@ var tdsEvent = {
|
|
|
818
834
|
onEvent,
|
|
819
835
|
onError,
|
|
820
836
|
options
|
|
821
|
-
}) =>
|
|
837
|
+
}) => createEventBridge6(event)({
|
|
822
838
|
onEvent,
|
|
823
839
|
onError: onError ?? (() => {
|
|
824
840
|
}),
|
|
@@ -983,14 +999,14 @@ var getClipboardText = createPermissionFunction({
|
|
|
983
999
|
});
|
|
984
1000
|
|
|
985
1001
|
// src/permissions/startUpdateLocation.ts
|
|
986
|
-
import { createAsyncBridge as createAsyncBridge11, createEventBridge as
|
|
1002
|
+
import { createAsyncBridge as createAsyncBridge11, createEventBridge as createEventBridge7 } from "@apps-in-toss/bridge-core";
|
|
987
1003
|
import {
|
|
988
1004
|
StartUpdateLocationPermissionError
|
|
989
1005
|
} from "@apps-in-toss/types";
|
|
990
1006
|
var getPermission2 = createAsyncBridge11("getPermission");
|
|
991
1007
|
var openPermissionDialog2 = createAsyncBridge11("openPermissionDialog");
|
|
992
1008
|
var startUpdateLocation = (params) => {
|
|
993
|
-
return
|
|
1009
|
+
return createEventBridge7("updateLocationEvent")({
|
|
994
1010
|
...params,
|
|
995
1011
|
onError: (error) => {
|
|
996
1012
|
const locationError = new StartUpdateLocationPermissionError();
|
|
@@ -1009,6 +1025,7 @@ export * from "@apps-in-toss/types";
|
|
|
1009
1025
|
export {
|
|
1010
1026
|
GoogleAdMob,
|
|
1011
1027
|
IAP,
|
|
1028
|
+
SafeAreaInsets,
|
|
1012
1029
|
Storage,
|
|
1013
1030
|
appsInTossEvent,
|
|
1014
1031
|
env,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/web-bridge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.7",
|
|
5
5
|
"description": "Web Bridge for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"built"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@apps-in-toss/types": "1.4.
|
|
31
|
+
"@apps-in-toss/types": "1.4.7"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@apps-in-toss/bridge-core": "1.4.
|
|
35
|
-
"@apps-in-toss/framework": "1.4.
|
|
34
|
+
"@apps-in-toss/bridge-core": "1.4.7",
|
|
35
|
+
"@apps-in-toss/framework": "1.4.7",
|
|
36
36
|
"@swc/core": "^1.12.7",
|
|
37
37
|
"picocolors": "^1.1.1",
|
|
38
38
|
"ts-morph": "^26.0.0",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9c3df99aae50b27ef775840416e7cc912de13c6a"
|
|
50
50
|
}
|