@apps-in-toss/web-framework 0.0.0-dev.1742352748804 → 0.0.0-dev.1742869301025

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.
@@ -2,13 +2,13 @@
2
2
  {
3
3
  "platform": "ios",
4
4
  "totalModuleCount": 360,
5
- "duration": 406.2677080000003,
6
- "size": 130489
5
+ "duration": 406.4440420000003,
6
+ "size": 131150
7
7
  },
8
8
  {
9
9
  "platform": "android",
10
10
  "totalModuleCount": 360,
11
- "duration": 405.34916599999997,
12
- "size": 130235
11
+ "duration": 407.8593330000001,
12
+ "size": 130886
13
13
  }
14
14
  ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/web-framework",
3
3
  "type": "module",
4
- "version": "0.0.0-dev.1742352748804",
4
+ "version": "0.0.0-dev.1742869301025",
5
5
  "description": "Web Framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -50,7 +50,7 @@
50
50
  "config.d.ts"
51
51
  ],
52
52
  "devDependencies": {
53
- "@apps-in-toss/framework": "0.0.0-dev.1742352748804",
53
+ "@apps-in-toss/framework": "0.0.0-dev.1742869301025",
54
54
  "@babel/plugin-proposal-class-properties": "^7.16.7",
55
55
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
56
56
  "@babel/plugin-proposal-numeric-separator": "^7.16.7",
@@ -66,10 +66,10 @@
66
66
  "@babel/types": "^7.26.9",
67
67
  "@clack/prompts": "^0.10.0",
68
68
  "@hono/node-server": "^1.13.8",
69
- "@react-native-bedrock/bridgepack": "0.0.0-dev.1742352527199",
70
- "@react-native-bedrock/cli": "0.0.0-dev.1742352527199",
71
- "@react-native-bedrock/mpack-next": "0.0.0-dev.1742352527199",
72
- "@react-native-bedrock/native": "0.0.0-dev.1742352527199",
69
+ "@react-native-bedrock/bridgepack": "0.0.13",
70
+ "@react-native-bedrock/cli": "0.0.13",
71
+ "@react-native-bedrock/mpack-next": "0.0.13",
72
+ "@react-native-bedrock/native": "0.0.13",
73
73
  "@toss-design-system/react-native": "^0",
74
74
  "@types/babel__core": "^7.20.5",
75
75
  "@types/babel__traverse": "^7",
@@ -87,7 +87,7 @@
87
87
  "picocolors": "^1.1.1",
88
88
  "react": "18.2.0",
89
89
  "react-native": "0.72.6",
90
- "react-native-bedrock": "0.0.0-dev.1742352527199",
90
+ "react-native-bedrock": "0.0.13",
91
91
  "tsup": "^8.3.5",
92
92
  "typescript": "4.9.5",
93
93
  "uuidv7": "^1.0.2",
@@ -95,11 +95,11 @@
95
95
  "zod": "^3.24.1"
96
96
  },
97
97
  "dependencies": {
98
- "@apps-in-toss/cli": "0.0.0-dev.1742352748804",
98
+ "@apps-in-toss/cli": "0.0.0-dev.1742869301025",
99
99
  "@babel/core": "7.23.9"
100
100
  },
101
101
  "publishConfig": {
102
102
  "access": "public"
103
103
  },
104
- "gitHead": "ddb83b7938e852ecd5d08f076ac8bedfbf848a84"
104
+ "gitHead": "5020bc1db76712254d6219bb939301bf3bcb5e45"
105
105
  }
@@ -41,6 +41,8 @@ export interface FetchAlbumPhotosOptions {
41
41
  *
42
42
  * import { fetchAlbumPhotos } from '@apps-in-toss/web-framework';
43
43
  *
44
+ * const base64 = true;
45
+ *
44
46
  * // 앨범 사진 목록을 가져와 화면에 표시하는 컴포넌트
45
47
  * function AlbumPhotoList() {
46
48
  * const [albumPhotos, setAlbumPhotos] = useState([]);
@@ -48,7 +50,7 @@ export interface FetchAlbumPhotosOptions {
48
50
  * const handlePress = async () => {
49
51
  * try {
50
52
  * const response = await fetchAlbumPhotos({
51
- * base64: true,
53
+ * base64,
52
54
  * maxWidth: 360,
53
55
  * });
54
56
  * setAlbumPhotos((prev) => ([...prev, ...response]));
@@ -59,9 +61,12 @@ export interface FetchAlbumPhotosOptions {
59
61
  *
60
62
  * return (
61
63
  * <div>
62
- * {albumPhotos.map((image) => (
63
- * <img src={`data:image/jpeg;base64,${image.dataUri}`} key={image.id} />
64
- * ))}
64
+ * {albumPhotos.map((image) => {
65
+ * // base64 형식으로 반환된 이미지를 표시하려면 데이터 URL 스키마 Prefix를 붙여야해요.
66
+ * const imageUri = base64 ? 'data:image/jpeg;base64,' + image.dataUri : image.dataUri;
67
+ *
68
+ * return <Image source={{ uri: imageUri }} key={image.id} />;
69
+ * })}
65
70
  * <input type="button" value="앨범 가져오기" onClick={handlePress} />
66
71
  * </div>
67
72
  * );
@@ -22,17 +22,36 @@ export interface ContactEntity {
22
22
  * - `nextOffset`: 다음 호출에 사용할 오프셋 값이에요. 더 가져올 연락처가 없으면 `null`이에요.
23
23
  * - `done`: 모든 연락처를 다 가져왔는지 여부를 나타내요. 모두 가져왔다면 `true`예요.
24
24
  *
25
+ * @signature
26
+ * ```typescript
27
+ * function fetchContacts({ size, offset, query }: {
28
+ * size: number;
29
+ * offset: number;
30
+ * query?: {
31
+ * contains?: string;
32
+ * };
33
+ * }): Promise<{
34
+ * result: ContactEntity[];
35
+ * nextOffset: number | null;
36
+ * done: boolean;
37
+ * }>;
38
+ * ```
39
+ *
25
40
  * @example
26
41
  * ### 특정 문자열이 포함된 연락처 목록 가져오기
27
42
  *
28
43
  * ```tsx
29
44
  * import React, { useState } from 'react';
30
45
  *
31
- * import { fetchContacts } from '@apps-in-toss/web-framework';
46
+ * import { fetchContacts, ContactEntity } from '@apps-in-toss/web-framework';
32
47
  *
33
48
  * // 특정 문자열을 포함한 연락처 목록을 가져와 화면에 표시하는 컴포넌트
34
49
  * function ContactsList() {
35
- * const [contacts, setContacts] = useState({
50
+ * const [contacts, setContacts] = useState<{
51
+ * result: ContactEntity[];
52
+ * nextOffset: number | null;
53
+ * done: boolean;
54
+ * }>({
36
55
  * result: [],
37
56
  * nextOffset: null,
38
57
  * done: false,
@@ -48,7 +67,7 @@ export interface ContactEntity {
48
67
  * const response = await fetchContacts({
49
68
  * size: 10,
50
69
  * offset: contacts.nextOffset ?? 0,
51
- * query: { contains: '홍길동' },
70
+ * query: { contains: '' },
52
71
  * });
53
72
  * setContacts((prev) => ({
54
73
  * result: [...prev.result, ...response.result],
@@ -11,16 +11,23 @@
11
11
  *
12
12
  * @description
13
13
  * 현재 실행 중인 플랫폼을 확인하는 함수예요.
14
- * 이 함수는 `react-native`의 `Platform.OS` 값을 기반으로 동작하며, `ios` 또는 `android` 중 하나의 문자열을 반환해요.
14
+ * 이 함수는 `react-native`의 [`Platform.OS`](https://reactnative.dev/docs/0.72/platform#os) 값을 기반으로 동작하며, `ios` 또는 `android` 중 하나의 문자열을 반환해요.
15
15
  *
16
- * @returns 현재 플랫폼을 나타내는 문자열로, `'ios'` 또는 `'android'` 하나예요.
16
+ * @returns {'ios' | 'android'} 현재 실행 중인 플랫폼
17
17
  *
18
18
  * @example
19
- * ```typescript
19
+ *
20
+ * ### 현재 실행중인 OS 플랫폼 확인하기
21
+ *
22
+ * ```tsx
20
23
  * import { getPlatformOS } from '@apps-in-toss/web-framework';
24
+ * import { Text } 'react-native';
25
+ *
26
+ * function Page() {
27
+ * const platform = getPlatformOS();
21
28
  *
22
- * const platform = getPlatformOS();
23
- * console.log(`현재 플랫폼: ${platform}`);
29
+ * return <span>현재 플랫폼: {platform}</span>;
30
+ * }
24
31
  * ```
25
32
  */
26
33
  export declare function getPlatformOS(): "ios" | "android";
@@ -42,23 +42,28 @@ export interface OpenCameraOptions {
42
42
  *
43
43
  * import { openCamera } from '@apps-in-toss/web-framework';
44
44
  *
45
+ * const base64 = true;
46
+ *
45
47
  * // 카메라를 실행하고 촬영된 이미지를 화면에 표시하는 컴포넌트
46
48
  * function Camera() {
47
49
  * const [image, setImage] = useState(null);
48
50
  *
49
51
  * const handlePress = async () => {
50
52
  * try {
51
- * const response = await openCamera({ base64: true });
53
+ * const response = await openCamera({ base64 });
52
54
  * setImage(response);
53
55
  * } catch (error) {
54
56
  * console.error('사진을 가져오는 데 실패했어요:', error);
55
57
  * }
56
58
  * };
57
59
  *
60
+ * // base64 형식으로 반환된 이미지를 표시하려면 데이터 URL 스키마 Prefix를 붙여야해요.
61
+ * const imageUri = base64 ? 'data:image/jpeg;base64,' + image.dataUri : image.dataUri;
62
+ *
58
63
  * return (
59
64
  * <div>
60
65
  * {image ? (
61
- * <img src={`data:image/jpeg;base64,${image.dataUri}`} style={{ width: 200, height: 200 }} />
66
+ * <Image source={{ uri: imageUri }} style={{ width: 200, height: 200 }} />
62
67
  * ) : (
63
68
  * <span>사진이 없어요</span>
64
69
  * )}