@apps-in-toss/framework 0.0.26 → 0.0.27

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/dist/index.cjs CHANGED
@@ -53,6 +53,7 @@ __export(src_exports, {
53
53
  isMinVersionSupported: () => isMinVersionSupported,
54
54
  openCamera: () => openCamera,
55
55
  setClipboardText: () => setClipboardText,
56
+ setDeviceOrientation: () => setDeviceOrientation,
56
57
  startUpdateLocation: () => startUpdateLocation,
57
58
  useGeolocation: () => useGeolocation
58
59
  });
@@ -471,7 +472,8 @@ __export(async_bridges_exports, {
471
472
  getCurrentLocation: () => getCurrentLocation,
472
473
  getTossShareLink: () => getTossShareLink,
473
474
  openCamera: () => openCamera,
474
- setClipboardText: () => setClipboardText
475
+ setClipboardText: () => setClipboardText,
476
+ setDeviceOrientation: () => setDeviceOrientation
475
477
  });
476
478
 
477
479
  // src/native-modules/setClipboardText.ts
@@ -598,6 +600,18 @@ async function getTossShareLink(path) {
598
600
  return shareUrl.toString();
599
601
  }
600
602
 
603
+ // src/native-modules/setDeviceOrientation.ts
604
+ async function setDeviceOrientation(options) {
605
+ const isSupported = isMinVersionSupported({
606
+ android: "5.215.0",
607
+ ios: "5.215.0"
608
+ });
609
+ if (!isSupported) {
610
+ return;
611
+ }
612
+ return AppsInTossModule.setDeviceOrientation(options);
613
+ }
614
+
601
615
  // src/core/registerApp.tsx
602
616
  var import_jsx_runtime = require("react/jsx-runtime");
603
617
  function AppsInTossContainer(Container, { children, ...initialProps }) {
@@ -1346,6 +1360,7 @@ var Analytics2 = {
1346
1360
  isMinVersionSupported,
1347
1361
  openCamera,
1348
1362
  setClipboardText,
1363
+ setDeviceOrientation,
1349
1364
  startUpdateLocation,
1350
1365
  useGeolocation,
1351
1366
  ...require("@apps-in-toss/analytics")
package/dist/index.d.cts CHANGED
@@ -1652,6 +1652,70 @@ declare function eventLog(params: EventLogParams): Promise<void>;
1652
1652
  */
1653
1653
  declare function getTossShareLink(path: string): Promise<string>;
1654
1654
 
1655
+ /**
1656
+ * @public
1657
+ * @category 화면 제어
1658
+ * @kind function
1659
+ * @name setDeviceOrientation
1660
+ * @description
1661
+ * `setDeviceOrientation` 함수는 기기의 화면 방향을 설정하는 기능을 제공해요.
1662
+ * 이 기능은 특정 화면에서 가로 모드나 세로 모드를 강제로 지정해야 할 때 유용해요.
1663
+ *
1664
+ * `type` 옵션을 통해 원하는 화면 방향을 지정할 수 있어요. 특히, 이 함수는 앱 전체에 영향을 미치므로
1665
+ * 특정 화면에서만 사용하려면 화면을 벗어날 때 이전 상태로 복구하는 추가 작업이 필요해요.
1666
+ *
1667
+ * 예를 들어, 동영상 감상 화면에서는 가로 모드를 강제하고, 화면을 떠날 때 설정을 복구해서
1668
+ * 다른 화면들의 방향 설정에 영향을 주지 않도록 할 수 있어요.
1669
+ *
1670
+ * @param {object} options 화면 방향 설정 값이에요.
1671
+ * @param {string} options.type 화면 방향을 지정하는 옵션이에요.
1672
+ * 'portrait' | 'landscape' 중 하나를 선택할 수 있어요.
1673
+ *
1674
+ * @returns {Promise<void>} 화면 방향 설정이 완료되면 해결되는 Promise를 반환해요.
1675
+ *
1676
+ * @example
1677
+ * ### 화면 방향 설정하기
1678
+ *
1679
+ * ```tsx
1680
+ * import { Button } from 'react-native';
1681
+ * import { setDeviceOrientation } from '@apps-in-toss/framework';
1682
+ *
1683
+ * function SetDeviceOrientation() {
1684
+ * return (
1685
+ * <Button
1686
+ * title="가로 모드로 변경"
1687
+ * onPress={() => {
1688
+ * setDeviceOrientation({ type: 'landscape' });
1689
+ * }}
1690
+ * />
1691
+ * );
1692
+ * }
1693
+ * ```
1694
+ *
1695
+ * ### 화면 방향 복구하기
1696
+ * 특정 화면을 벗어날 때 이전 상태로 복구하려면 다음과 같이 `useEffect`를 사용하세요.
1697
+ *
1698
+ * ```tsx
1699
+ * import { useEffect } from 'react';
1700
+ * import { setDeviceOrientation } from '@apps-in-toss/framework';
1701
+ *
1702
+ * function VideoScreen() {
1703
+ * useEffect(() => {
1704
+ * setDeviceOrientation({ type: 'landscape' });
1705
+ *
1706
+ * return () => {
1707
+ * setDeviceOrientation({ type: 'portrait' }); // 설정을 이전 상태로 복구해요.
1708
+ * };
1709
+ * }, []);
1710
+ *
1711
+ * return <Text>동영상을 감상하는 화면</Text>;
1712
+ * }
1713
+ * ```
1714
+ */
1715
+ declare function setDeviceOrientation(options: {
1716
+ type: 'portrait' | 'landscape';
1717
+ }): Promise<void>;
1718
+
1655
1719
  /**
1656
1720
  * @public
1657
1721
  * @category 토스페이
@@ -1804,4 +1868,4 @@ declare const Analytics: {
1804
1868
  Area: ({ children, params: _params, ...props }: _apps_in_toss_analytics.LoggingAreaProps) => react_jsx_runtime.JSX.Element;
1805
1869
  };
1806
1870
 
1807
- export { Accuracy, Analytics, AppsInToss, type ContactEntity, type EventLogParams, type ExternalWebViewProps, type FetchAlbumPhotosOptions, type GameWebViewProps, type GetCurrentLocationOptions, GoogleAdMob, type ImageResponse, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type Location, type LocationCoords, type OpenCameraOptions, type PartnerWebViewProps, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, type StartUpdateLocationOptions$1 as StartUpdateLocationOptions, type StartUpdateLocationSubscription, Storage, TossPay, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, appsInTossEvent, env, eventLog, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, getDeviceId, getOperationalEnvironment, getTossAppVersion, getTossShareLink, isMinVersionSupported, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
1871
+ export { Accuracy, Analytics, AppsInToss, type ContactEntity, type EventLogParams, type ExternalWebViewProps, type FetchAlbumPhotosOptions, type GameWebViewProps, type GetCurrentLocationOptions, GoogleAdMob, type ImageResponse, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type Location, type LocationCoords, type OpenCameraOptions, type PartnerWebViewProps, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, type StartUpdateLocationOptions$1 as StartUpdateLocationOptions, type StartUpdateLocationSubscription, Storage, TossPay, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, appsInTossEvent, env, eventLog, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, getDeviceId, getOperationalEnvironment, getTossAppVersion, getTossShareLink, isMinVersionSupported, openCamera, setClipboardText, setDeviceOrientation, startUpdateLocation, useGeolocation };
package/dist/index.d.ts CHANGED
@@ -1652,6 +1652,70 @@ declare function eventLog(params: EventLogParams): Promise<void>;
1652
1652
  */
1653
1653
  declare function getTossShareLink(path: string): Promise<string>;
1654
1654
 
1655
+ /**
1656
+ * @public
1657
+ * @category 화면 제어
1658
+ * @kind function
1659
+ * @name setDeviceOrientation
1660
+ * @description
1661
+ * `setDeviceOrientation` 함수는 기기의 화면 방향을 설정하는 기능을 제공해요.
1662
+ * 이 기능은 특정 화면에서 가로 모드나 세로 모드를 강제로 지정해야 할 때 유용해요.
1663
+ *
1664
+ * `type` 옵션을 통해 원하는 화면 방향을 지정할 수 있어요. 특히, 이 함수는 앱 전체에 영향을 미치므로
1665
+ * 특정 화면에서만 사용하려면 화면을 벗어날 때 이전 상태로 복구하는 추가 작업이 필요해요.
1666
+ *
1667
+ * 예를 들어, 동영상 감상 화면에서는 가로 모드를 강제하고, 화면을 떠날 때 설정을 복구해서
1668
+ * 다른 화면들의 방향 설정에 영향을 주지 않도록 할 수 있어요.
1669
+ *
1670
+ * @param {object} options 화면 방향 설정 값이에요.
1671
+ * @param {string} options.type 화면 방향을 지정하는 옵션이에요.
1672
+ * 'portrait' | 'landscape' 중 하나를 선택할 수 있어요.
1673
+ *
1674
+ * @returns {Promise<void>} 화면 방향 설정이 완료되면 해결되는 Promise를 반환해요.
1675
+ *
1676
+ * @example
1677
+ * ### 화면 방향 설정하기
1678
+ *
1679
+ * ```tsx
1680
+ * import { Button } from 'react-native';
1681
+ * import { setDeviceOrientation } from '@apps-in-toss/framework';
1682
+ *
1683
+ * function SetDeviceOrientation() {
1684
+ * return (
1685
+ * <Button
1686
+ * title="가로 모드로 변경"
1687
+ * onPress={() => {
1688
+ * setDeviceOrientation({ type: 'landscape' });
1689
+ * }}
1690
+ * />
1691
+ * );
1692
+ * }
1693
+ * ```
1694
+ *
1695
+ * ### 화면 방향 복구하기
1696
+ * 특정 화면을 벗어날 때 이전 상태로 복구하려면 다음과 같이 `useEffect`를 사용하세요.
1697
+ *
1698
+ * ```tsx
1699
+ * import { useEffect } from 'react';
1700
+ * import { setDeviceOrientation } from '@apps-in-toss/framework';
1701
+ *
1702
+ * function VideoScreen() {
1703
+ * useEffect(() => {
1704
+ * setDeviceOrientation({ type: 'landscape' });
1705
+ *
1706
+ * return () => {
1707
+ * setDeviceOrientation({ type: 'portrait' }); // 설정을 이전 상태로 복구해요.
1708
+ * };
1709
+ * }, []);
1710
+ *
1711
+ * return <Text>동영상을 감상하는 화면</Text>;
1712
+ * }
1713
+ * ```
1714
+ */
1715
+ declare function setDeviceOrientation(options: {
1716
+ type: 'portrait' | 'landscape';
1717
+ }): Promise<void>;
1718
+
1655
1719
  /**
1656
1720
  * @public
1657
1721
  * @category 토스페이
@@ -1804,4 +1868,4 @@ declare const Analytics: {
1804
1868
  Area: ({ children, params: _params, ...props }: _apps_in_toss_analytics.LoggingAreaProps) => react_jsx_runtime.JSX.Element;
1805
1869
  };
1806
1870
 
1807
- export { Accuracy, Analytics, AppsInToss, type ContactEntity, type EventLogParams, type ExternalWebViewProps, type FetchAlbumPhotosOptions, type GameWebViewProps, type GetCurrentLocationOptions, GoogleAdMob, type ImageResponse, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type Location, type LocationCoords, type OpenCameraOptions, type PartnerWebViewProps, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, type StartUpdateLocationOptions$1 as StartUpdateLocationOptions, type StartUpdateLocationSubscription, Storage, TossPay, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, appsInTossEvent, env, eventLog, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, getDeviceId, getOperationalEnvironment, getTossAppVersion, getTossShareLink, isMinVersionSupported, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
1871
+ export { Accuracy, Analytics, AppsInToss, type ContactEntity, type EventLogParams, type ExternalWebViewProps, type FetchAlbumPhotosOptions, type GameWebViewProps, type GetCurrentLocationOptions, GoogleAdMob, type ImageResponse, type LoadAdMobInterstitialAdEvent, type LoadAdMobInterstitialAdOptions, type LoadAdMobRewardedAdEvent, type LoadAdMobRewardedAdOptions, type Location, type LocationCoords, type OpenCameraOptions, type PartnerWebViewProps, type ShowAdMobInterstitialAdEvent, type ShowAdMobInterstitialAdOptions, type ShowAdMobRewardedAdEvent, type ShowAdMobRewardedAdOptions, type StartUpdateLocationOptions$1 as StartUpdateLocationOptions, type StartUpdateLocationSubscription, Storage, TossPay, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, appsInTossEvent, env, eventLog, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, getDeviceId, getOperationalEnvironment, getTossAppVersion, getTossShareLink, isMinVersionSupported, openCamera, setClipboardText, setDeviceOrientation, startUpdateLocation, useGeolocation };
package/dist/index.js CHANGED
@@ -419,7 +419,8 @@ __export(async_bridges_exports, {
419
419
  getCurrentLocation: () => getCurrentLocation,
420
420
  getTossShareLink: () => getTossShareLink,
421
421
  openCamera: () => openCamera,
422
- setClipboardText: () => setClipboardText
422
+ setClipboardText: () => setClipboardText,
423
+ setDeviceOrientation: () => setDeviceOrientation
423
424
  });
424
425
 
425
426
  // src/native-modules/setClipboardText.ts
@@ -546,6 +547,18 @@ async function getTossShareLink(path) {
546
547
  return shareUrl.toString();
547
548
  }
548
549
 
550
+ // src/native-modules/setDeviceOrientation.ts
551
+ async function setDeviceOrientation(options) {
552
+ const isSupported = isMinVersionSupported({
553
+ android: "5.215.0",
554
+ ios: "5.215.0"
555
+ });
556
+ if (!isSupported) {
557
+ return;
558
+ }
559
+ return AppsInTossModule.setDeviceOrientation(options);
560
+ }
561
+
549
562
  // src/core/registerApp.tsx
550
563
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
551
564
  function AppsInTossContainer(Container, { children, ...initialProps }) {
@@ -1298,6 +1311,7 @@ export {
1298
1311
  isMinVersionSupported,
1299
1312
  openCamera,
1300
1313
  setClipboardText,
1314
+ setDeviceOrientation,
1301
1315
  startUpdateLocation,
1302
1316
  useGeolocation
1303
1317
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/framework",
3
3
  "type": "module",
4
- "version": "0.0.26",
4
+ "version": "0.0.27",
5
5
  "description": "The framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -57,16 +57,16 @@
57
57
  "ait": "./bin/ait.js"
58
58
  },
59
59
  "dependencies": {
60
- "@apps-in-toss/analytics": "0.0.26",
61
- "@apps-in-toss/cli": "0.0.26",
62
- "@apps-in-toss/plugins": "0.0.26",
60
+ "@apps-in-toss/analytics": "0.0.27",
61
+ "@apps-in-toss/cli": "0.0.27",
62
+ "@apps-in-toss/plugins": "0.0.27",
63
63
  "es-hangul": "^2.3.2"
64
64
  },
65
65
  "devDependencies": {
66
- "@react-native-bedrock/mpack-next": "0.0.24",
67
- "@react-native-bedrock/native": "0.0.24",
68
- "@react-native-bedrock/plugin-core": "0.0.24",
69
- "@react-native-bedrock/utils": "0.0.24",
66
+ "@react-native-bedrock/mpack-next": "0.0.27",
67
+ "@react-native-bedrock/native": "workspace:*",
68
+ "@react-native-bedrock/plugin-core": "0.0.27",
69
+ "@react-native-bedrock/utils": "0.0.27",
70
70
  "@toss-design-system/react-native": "^0.5.0",
71
71
  "@types/kill-port": "^2.0.1",
72
72
  "@types/react": "18.3.3",
@@ -76,7 +76,7 @@
76
76
  "kill-port": "^2.0.1",
77
77
  "react": "18.2.0",
78
78
  "react-native": "0.72.6",
79
- "react-native-bedrock": "0.0.24",
79
+ "react-native-bedrock": "0.0.27",
80
80
  "tsup": "^8.3.5",
81
81
  "typescript": "5.8.3",
82
82
  "vitest": "^3.0.3",
@@ -93,5 +93,5 @@
93
93
  "publishConfig": {
94
94
  "access": "public"
95
95
  },
96
- "gitHead": "8df951171a6a432852d863459d724224a0680e7d"
96
+ "gitHead": "a6434fe8de65a2b20fb395b7e1b2b700edc112d3"
97
97
  }
@@ -8,3 +8,4 @@ export * from './native-modules/appLogin';
8
8
  export * from './native-modules/checkoutPayment';
9
9
  export * from './native-modules/eventLog';
10
10
  export * from './native-modules/getTossShareLink';
11
+ export * from './native-modules/setDeviceOrientation';