@apps-in-toss/framework 1.0.3 → 1.1.0

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
@@ -1247,8 +1247,9 @@ function useBridgeHandler({
1247
1247
  `);
1248
1248
  };
1249
1249
  const createHandleOnError = (functionName, eventId) => (error) => {
1250
+ const serializedError = serializeError(error);
1250
1251
  ref.current?.injectJavaScript(`
1251
- window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
1252
+ window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
1252
1253
  `);
1253
1254
  };
1254
1255
  const $onMessage = (0, import_react13.useCallback)(
@@ -1628,8 +1629,16 @@ function WebView({ type, local, onMessage, ...props }) {
1628
1629
  },
1629
1630
  addAccessoryButton: async (params) => topNavigation.addAccessoryButton(params),
1630
1631
  removeAccessoryButton: async () => topNavigation.removeAccessoryButton(),
1631
- /** internal */
1632
- openPermissionDialog: import_native_modules17.AppsInTossModule.openPermissionDialog,
1632
+ /** permissions */
1633
+ requestPermission: appsInTossAsyncBridges.requestPermission,
1634
+ openPermissionDialog: appsInTossAsyncBridges.openPermissionDialog,
1635
+ getPermission: appsInTossAsyncBridges.getPermission,
1636
+ getClipboardText: appsInTossAsyncBridges.getClipboardText,
1637
+ setClipboardText: appsInTossAsyncBridges.setClipboardText,
1638
+ fetchAlbumPhotos: appsInTossAsyncBridges.fetchAlbumPhotos,
1639
+ fetchContacts: appsInTossAsyncBridges.fetchContacts,
1640
+ getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
1641
+ openCamera: appsInTossAsyncBridges.openCamera,
1633
1642
  /** Storage */
1634
1643
  getStorageItem: import_native_modules17.Storage.getItem,
1635
1644
  setStorageItem: import_native_modules17.Storage.setItem,
@@ -1725,6 +1734,7 @@ function WebView({ type, local, onMessage, ...props }) {
1725
1734
  __reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
1726
1735
  var import_private6 = require("@toss-design-system/react-native/private");
1727
1736
  __reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
1737
+ __reExport(src_exports, require("@apps-in-toss/types"), module.exports);
1728
1738
  var Analytics2 = {
1729
1739
  init: import_analytics2.Analytics.init,
1730
1740
  Impression: import_analytics2.Analytics.Impression,
@@ -1742,5 +1752,6 @@ var Analytics2 = {
1742
1752
  useGeolocation,
1743
1753
  useTopNavigation,
1744
1754
  ...require("@apps-in-toss/analytics"),
1745
- ...require("@apps-in-toss/native-modules")
1755
+ ...require("@apps-in-toss/native-modules"),
1756
+ ...require("@apps-in-toss/types")
1746
1757
  });
package/dist/index.d.cts CHANGED
@@ -6,7 +6,9 @@ export * from '@apps-in-toss/analytics';
6
6
  import { InitialProps, GraniteProps } from '@granite-js/react-native';
7
7
  import { WebViewProps as WebViewProps$1 } from '@granite-js/native/react-native-webview';
8
8
  import { ExternalWebViewScreenProps } from '@toss-design-system/react-native';
9
- import { StartUpdateLocationOptions, Location, onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
9
+ import { StartUpdateLocationOptions, Location } from '@apps-in-toss/types';
10
+ export * from '@apps-in-toss/types';
11
+ import { onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
10
12
  export * from '@apps-in-toss/native-modules';
11
13
  export { useTopNavigation } from '@toss-design-system/react-native/private';
12
14
 
package/dist/index.d.ts CHANGED
@@ -6,7 +6,9 @@ export * from '@apps-in-toss/analytics';
6
6
  import { InitialProps, GraniteProps } from '@granite-js/react-native';
7
7
  import { WebViewProps as WebViewProps$1 } from '@granite-js/native/react-native-webview';
8
8
  import { ExternalWebViewScreenProps } from '@toss-design-system/react-native';
9
- import { StartUpdateLocationOptions, Location, onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
9
+ import { StartUpdateLocationOptions, Location } from '@apps-in-toss/types';
10
+ export * from '@apps-in-toss/types';
11
+ import { onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
10
12
  export * from '@apps-in-toss/native-modules';
11
13
  export { useTopNavigation } from '@toss-design-system/react-native/private';
12
14
 
package/dist/index.js CHANGED
@@ -1209,8 +1209,9 @@ function useBridgeHandler({
1209
1209
  `);
1210
1210
  };
1211
1211
  const createHandleOnError = (functionName, eventId) => (error) => {
1212
+ const serializedError = serializeError(error);
1212
1213
  ref.current?.injectJavaScript(`
1213
- window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${JSON.stringify(error, null, 0)});
1214
+ window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
1214
1215
  `);
1215
1216
  };
1216
1217
  const $onMessage = useCallback5(
@@ -1422,7 +1423,7 @@ function useCreateUserAgent({
1422
1423
  // src/hooks/useGeolocation.ts
1423
1424
  import { startUpdateLocation } from "@apps-in-toss/native-modules";
1424
1425
  import { useVisibility as useVisibility3 } from "@granite-js/react-native";
1425
- import { useState as useState4, useEffect as useEffect9 } from "react";
1426
+ import { useEffect as useEffect9, useState as useState4 } from "react";
1426
1427
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
1427
1428
  const isVisible = useVisibility3();
1428
1429
  const [location, setLocation] = useState4(null);
@@ -1590,8 +1591,16 @@ function WebView({ type, local, onMessage, ...props }) {
1590
1591
  },
1591
1592
  addAccessoryButton: async (params) => topNavigation.addAccessoryButton(params),
1592
1593
  removeAccessoryButton: async () => topNavigation.removeAccessoryButton(),
1593
- /** internal */
1594
- openPermissionDialog: AppsInTossModule.openPermissionDialog,
1594
+ /** permissions */
1595
+ requestPermission: appsInTossAsyncBridges.requestPermission,
1596
+ openPermissionDialog: appsInTossAsyncBridges.openPermissionDialog,
1597
+ getPermission: appsInTossAsyncBridges.getPermission,
1598
+ getClipboardText: appsInTossAsyncBridges.getClipboardText,
1599
+ setClipboardText: appsInTossAsyncBridges.setClipboardText,
1600
+ fetchAlbumPhotos: appsInTossAsyncBridges.fetchAlbumPhotos,
1601
+ fetchContacts: appsInTossAsyncBridges.fetchContacts,
1602
+ getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
1603
+ openCamera: appsInTossAsyncBridges.openCamera,
1595
1604
  /** Storage */
1596
1605
  getStorageItem: Storage.getItem,
1597
1606
  setStorageItem: Storage.setItem,
@@ -1687,6 +1696,7 @@ function WebView({ type, local, onMessage, ...props }) {
1687
1696
  export * from "@apps-in-toss/analytics";
1688
1697
  import { useTopNavigation as useTopNavigation2 } from "@toss-design-system/react-native/private";
1689
1698
  export * from "@apps-in-toss/native-modules";
1699
+ export * from "@apps-in-toss/types";
1690
1700
  var Analytics2 = {
1691
1701
  init: InternalAnalytics.init,
1692
1702
  Impression: InternalAnalytics.Impression,
package/dist/types.cjs ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/types.ts
18
+ var types_exports = {};
19
+ module.exports = __toCommonJS(types_exports);
20
+ __reExport(types_exports, require("@apps-in-toss/types"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("@apps-in-toss/types")
24
+ });
@@ -0,0 +1 @@
1
+ export * from '@apps-in-toss/types';
@@ -0,0 +1 @@
1
+ export * from '@apps-in-toss/types';
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ // src/types.ts
2
+ export * from "@apps-in-toss/types";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/framework",
3
3
  "type": "module",
4
- "version": "1.0.3",
4
+ "version": "1.1.0",
5
5
  "description": "The framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -56,10 +56,11 @@
56
56
  "ait": "./bin/ait.js"
57
57
  },
58
58
  "dependencies": {
59
- "@apps-in-toss/analytics": "1.0.3",
60
- "@apps-in-toss/cli": "1.0.3",
61
- "@apps-in-toss/native-modules": "1.0.3",
62
- "@apps-in-toss/plugins": "1.0.3",
59
+ "@apps-in-toss/analytics": "1.1.0",
60
+ "@apps-in-toss/cli": "1.1.0",
61
+ "@apps-in-toss/native-modules": "1.1.0",
62
+ "@apps-in-toss/plugins": "1.1.0",
63
+ "@apps-in-toss/types": "1.1.0",
63
64
  "es-hangul": "^2.3.2"
64
65
  },
65
66
  "devDependencies": {
@@ -95,5 +96,5 @@
95
96
  "publishConfig": {
96
97
  "access": "public"
97
98
  },
98
- "gitHead": "380ad5f697a176bcc6adae409153fa43e700d053"
99
+ "gitHead": "614cfd1ee039b44cd6efeb94cefac18ed3c0e6c3"
99
100
  }