@apps-in-toss/framework 0.0.0-dev.1741599933429 → 0.0.0-dev.1741675190621
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 +674 -202
- package/README.md +4 -5
- package/{bin.js → bin/ait.js} +0 -1
- package/dist/index.cjs +38 -10
- package/dist/index.d.cts +59 -12
- package/dist/index.d.ts +59 -12
- package/dist/index.js +29 -2
- package/dist/jest/index.cjs +24 -0
- package/dist/jest/index.d.cts +1 -0
- package/dist/jest/index.d.ts +1 -0
- package/dist/jest/index.js +4 -0
- package/dist/plugins/index.cjs +24 -61
- package/dist/plugins/index.d.cts +1 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +24 -61
- package/jest.d.ts +1 -0
- package/package.json +18 -11
package/README.md
CHANGED
|
@@ -4,21 +4,20 @@ Hub package for Apps In Toss
|
|
|
4
4
|
|
|
5
5
|
## License
|
|
6
6
|
|
|
7
|
-
This software is licensed under the [
|
|
7
|
+
This software is licensed under the [GPL, Version 3.0](LICENSE), quoted below.
|
|
8
8
|
|
|
9
9
|
```
|
|
10
|
-
Copyright 2025 Viva Republica, Inc
|
|
10
|
+
Copyright 2025 Viva Republica, Inc.
|
|
11
11
|
|
|
12
|
-
Licensed under the
|
|
12
|
+
Licensed under the GPL, Version 3.0 (the "License");
|
|
13
13
|
you may not use this file except in compliance with the License.
|
|
14
14
|
You may obtain a copy of the License at:
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
https://www.gnu.org/licenses/gpl-3.0.html
|
|
17
17
|
|
|
18
18
|
Unless required by applicable law or agreed to in writing, software
|
|
19
19
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
20
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
21
|
See the License for the specific language governing permissions and
|
|
22
22
|
limitations under the License.
|
|
23
|
-
|
|
24
23
|
```
|
package/{bin.js → bin/ait.js}
RENAMED
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
33
|
Accuracy: () => Accuracy2,
|
|
34
|
+
AppsInToss: () => AppsInToss,
|
|
34
35
|
WebView: () => WebView,
|
|
35
36
|
appLogin: () => appLogin,
|
|
36
37
|
env: () => env,
|
|
@@ -45,6 +46,32 @@ __export(src_exports, {
|
|
|
45
46
|
});
|
|
46
47
|
module.exports = __toCommonJS(src_exports);
|
|
47
48
|
|
|
49
|
+
// src/core/registerApp.tsx
|
|
50
|
+
var import_react_native_bedrock = require("react-native-bedrock");
|
|
51
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
+
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Container, { ...initialProps, children });
|
|
54
|
+
}
|
|
55
|
+
function registerApp(container, { context }) {
|
|
56
|
+
return import_react_native_bedrock.Bedrock.registerApp(AppsInTossContainer.bind(null, container), {
|
|
57
|
+
appName: getAppName(),
|
|
58
|
+
context
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function getAppName() {
|
|
62
|
+
try {
|
|
63
|
+
return global.__bedrock.app.name;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error("unexpected error occurred while getting app name");
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/core/index.ts
|
|
71
|
+
var AppsInToss = {
|
|
72
|
+
registerApp
|
|
73
|
+
};
|
|
74
|
+
|
|
48
75
|
// src/native-event-emitter/index.ts
|
|
49
76
|
var native_event_emitter_exports = {};
|
|
50
77
|
__export(native_event_emitter_exports, {
|
|
@@ -52,10 +79,10 @@ __export(native_event_emitter_exports, {
|
|
|
52
79
|
});
|
|
53
80
|
|
|
54
81
|
// src/native-event-emitter/bedrock-event.ts
|
|
55
|
-
var
|
|
82
|
+
var import_react_native_bedrock3 = require("react-native-bedrock");
|
|
56
83
|
|
|
57
84
|
// src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
58
|
-
var
|
|
85
|
+
var import_react_native_bedrock2 = require("react-native-bedrock");
|
|
59
86
|
|
|
60
87
|
// src/native-modules/AppsInTossModule.ts
|
|
61
88
|
var import_react_native = require("react-native");
|
|
@@ -89,7 +116,7 @@ var import_react_native2 = require("react-native");
|
|
|
89
116
|
var nativeEventEmitter = new import_react_native2.NativeEventEmitter(AppsInTossModuleInstance);
|
|
90
117
|
|
|
91
118
|
// src/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
92
|
-
var UpdateLocationEvent = class extends
|
|
119
|
+
var UpdateLocationEvent = class extends import_react_native_bedrock2.BedrockEventDefinition {
|
|
93
120
|
name = "updateLocationEvent";
|
|
94
121
|
subscriptionCount = 0;
|
|
95
122
|
ref = {
|
|
@@ -117,7 +144,7 @@ var UpdateLocationEvent = class extends import_react_native_bedrock.BedrockEvent
|
|
|
117
144
|
};
|
|
118
145
|
|
|
119
146
|
// src/native-event-emitter/bedrock-event.ts
|
|
120
|
-
var appsInTossEvent = new
|
|
147
|
+
var appsInTossEvent = new import_react_native_bedrock3.BedrockEvent([new UpdateLocationEvent()]);
|
|
121
148
|
|
|
122
149
|
// src/native-event-emitter/startUpdateLocation.ts
|
|
123
150
|
function startUpdateLocation(eventParams) {
|
|
@@ -220,10 +247,10 @@ async function appLogin() {
|
|
|
220
247
|
// src/components/WebView.tsx
|
|
221
248
|
var import_react_native_webview = require("@react-native-bedrock/native/react-native-webview");
|
|
222
249
|
var import_react = require("react");
|
|
223
|
-
var
|
|
250
|
+
var import_react_native_bedrock4 = require("react-native-bedrock");
|
|
224
251
|
var bridges = __toESM(require("react-native-bedrock/bridges"), 1);
|
|
225
252
|
var constantBridges = __toESM(require("react-native-bedrock/constants"), 1);
|
|
226
|
-
var
|
|
253
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
227
254
|
function WebView({ localhostPort = 5173, onMessage, ...props }) {
|
|
228
255
|
const uri = (0, import_react.useMemo)(() => {
|
|
229
256
|
if (__DEV__) {
|
|
@@ -231,7 +258,7 @@ function WebView({ localhostPort = 5173, onMessage, ...props }) {
|
|
|
231
258
|
}
|
|
232
259
|
return AppsInTossModule.getWebBundleURL({}).url;
|
|
233
260
|
}, [localhostPort]);
|
|
234
|
-
const handler = (0,
|
|
261
|
+
const handler = (0, import_react_native_bedrock4.useBridgeHandler)({
|
|
235
262
|
onMessage,
|
|
236
263
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
237
264
|
eventListenerMap: native_event_emitter_exports,
|
|
@@ -245,7 +272,7 @@ function WebView({ localhostPort = 5173, onMessage, ...props }) {
|
|
|
245
272
|
...native_modules_exports
|
|
246
273
|
}
|
|
247
274
|
});
|
|
248
|
-
return /* @__PURE__ */ (0,
|
|
275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
249
276
|
import_react_native_webview.WebView,
|
|
250
277
|
{
|
|
251
278
|
ref: handler.ref,
|
|
@@ -262,9 +289,9 @@ function WebView({ localhostPort = 5173, onMessage, ...props }) {
|
|
|
262
289
|
|
|
263
290
|
// src/hooks/useGeolocation.ts
|
|
264
291
|
var import_react2 = require("react");
|
|
265
|
-
var
|
|
292
|
+
var import_react_native_bedrock5 = require("react-native-bedrock");
|
|
266
293
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
267
|
-
const isVisible = (0,
|
|
294
|
+
const isVisible = (0, import_react_native_bedrock5.useVisibility)();
|
|
268
295
|
const [location, setLocation] = (0, import_react2.useState)(null);
|
|
269
296
|
(0, import_react2.useEffect)(() => {
|
|
270
297
|
if (!isVisible) {
|
|
@@ -301,6 +328,7 @@ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
|
|
|
301
328
|
// Annotate the CommonJS export names for ESM import in node:
|
|
302
329
|
0 && (module.exports = {
|
|
303
330
|
Accuracy,
|
|
331
|
+
AppsInToss,
|
|
304
332
|
WebView,
|
|
305
333
|
appLogin,
|
|
306
334
|
env,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
import { ComponentType, PropsWithChildren } from 'react';
|
|
2
|
+
import { InitialProps, BedrockProps } from 'react-native-bedrock';
|
|
1
3
|
import { EmitterSubscription } from 'react-native';
|
|
2
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
5
|
import { WebViewProps as WebViewProps$1 } from '@react-native-bedrock/native/react-native-webview';
|
|
4
6
|
|
|
7
|
+
type AppsInTossProps = Pick<BedrockProps, 'context'>;
|
|
8
|
+
declare function registerApp(container: ComponentType<PropsWithChildren<InitialProps>>, { context }: AppsInTossProps): (initialProps: InitialProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
declare const AppsInToss: {
|
|
11
|
+
registerApp: typeof registerApp;
|
|
12
|
+
};
|
|
13
|
+
|
|
5
14
|
interface EventEmitterSchema<K extends string, P extends unknown[]> {
|
|
6
15
|
name: K;
|
|
7
16
|
params: P;
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
20
|
+
* @public
|
|
21
|
+
* @category Types
|
|
22
|
+
* @name Accuracy
|
|
23
|
+
* @description 위치 정확도 옵션이에요.
|
|
12
24
|
*/
|
|
13
25
|
declare enum Accuracy {
|
|
14
26
|
/**
|
|
@@ -36,6 +48,12 @@ declare enum Accuracy {
|
|
|
36
48
|
*/
|
|
37
49
|
BestForNavigation = 6
|
|
38
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @public
|
|
53
|
+
* @category Types
|
|
54
|
+
* @name Location
|
|
55
|
+
* @description 위치 정보를 나타내는 객체예요.
|
|
56
|
+
*/
|
|
39
57
|
interface Location {
|
|
40
58
|
/**
|
|
41
59
|
* Android에서만 지원하는 옵션이에요.
|
|
@@ -50,14 +68,42 @@ interface Location {
|
|
|
50
68
|
* 위치가 업데이트된 시점의 유닉스 타임스탬프예요.
|
|
51
69
|
*/
|
|
52
70
|
timestamp: number;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/reference/framework/Types/LocationCoords.html)을 참고해주세요.
|
|
73
|
+
*/
|
|
74
|
+
coords: LocationCoords;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @public
|
|
78
|
+
* @category Types
|
|
79
|
+
* @name LocationCoords
|
|
80
|
+
* @description 세부 위치 정보를 나타내는 객체예요.
|
|
81
|
+
*/
|
|
82
|
+
interface LocationCoords {
|
|
83
|
+
/**
|
|
84
|
+
* 위도
|
|
85
|
+
*/
|
|
86
|
+
latitude: number;
|
|
87
|
+
/**
|
|
88
|
+
* 경도
|
|
89
|
+
*/
|
|
90
|
+
longitude: number;
|
|
91
|
+
/**
|
|
92
|
+
* 높이
|
|
93
|
+
*/
|
|
94
|
+
altitude: number;
|
|
95
|
+
/**
|
|
96
|
+
* 위치 정확도
|
|
97
|
+
*/
|
|
98
|
+
accuracy: number;
|
|
99
|
+
/**
|
|
100
|
+
* 고도 정확도
|
|
101
|
+
*/
|
|
102
|
+
altitudeAccuracy: number;
|
|
103
|
+
/**
|
|
104
|
+
* 방향
|
|
105
|
+
*/
|
|
106
|
+
heading: number;
|
|
61
107
|
}
|
|
62
108
|
/**
|
|
63
109
|
* 사진 조회 결과를 나타내는 타입이에요.
|
|
@@ -109,7 +155,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
|
|
|
109
155
|
* @param {number} [options.accuracy] 위치 정확도를 설정해요.
|
|
110
156
|
* @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
|
|
111
157
|
* @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
|
|
112
|
-
* @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요.
|
|
158
|
+
* @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
|
|
113
159
|
*
|
|
114
160
|
* @example
|
|
115
161
|
* ### 위치 정보 변경 감지하기
|
|
@@ -410,7 +456,7 @@ interface GetCurrentLocationOptions {
|
|
|
410
456
|
*
|
|
411
457
|
* @param {GetCurrentLocationOptions} options 위치 정보를 가져올 때 사용하는 옵션 객체예요.
|
|
412
458
|
* @param {Accuracy} [options.accuracy] 위치 정보의 정확도 수준이에요. 정확도는 `Accuracy` 타입으로 설정돼요.
|
|
413
|
-
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요.
|
|
459
|
+
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
|
|
414
460
|
*
|
|
415
461
|
* @example
|
|
416
462
|
* ### 디바이스의 현재 위치 정보 가져오기
|
|
@@ -564,6 +610,7 @@ type UseGeolocationOptions = Omit<StartUpdateLocationOptions, 'callback'>;
|
|
|
564
610
|
* @param {Accuracy} [options.accuracy] 위치 정확도를 설정해요. `Accuracy.Lowest`: 오차범위 3KM 이내, `Accuracy.Low`: 오차범위 1KM 이내, `Accuracy.Balanced`: 오차범위 몇 백미터 이내, `Accuracy.High`: 오차범위 10M 이내, `Accuracy.Highest`: 가장 높은 정확도, `Accuracy.BestForNavigation`: 네비게이션을 위한 최고 정확도
|
|
565
611
|
* @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
|
|
566
612
|
* @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
|
|
613
|
+
* @returns {Location | null} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
|
|
567
614
|
*
|
|
568
615
|
* @example
|
|
569
616
|
* ### 위치 정보 변경 감지하기
|
|
@@ -599,4 +646,4 @@ declare const env: {
|
|
|
599
646
|
getDeploymentId: () => string | undefined;
|
|
600
647
|
};
|
|
601
648
|
|
|
602
|
-
export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
|
|
649
|
+
export { Accuracy, AppsInToss, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type LocationCoords, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
import { ComponentType, PropsWithChildren } from 'react';
|
|
2
|
+
import { InitialProps, BedrockProps } from 'react-native-bedrock';
|
|
1
3
|
import { EmitterSubscription } from 'react-native';
|
|
2
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
5
|
import { WebViewProps as WebViewProps$1 } from '@react-native-bedrock/native/react-native-webview';
|
|
4
6
|
|
|
7
|
+
type AppsInTossProps = Pick<BedrockProps, 'context'>;
|
|
8
|
+
declare function registerApp(container: ComponentType<PropsWithChildren<InitialProps>>, { context }: AppsInTossProps): (initialProps: InitialProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
declare const AppsInToss: {
|
|
11
|
+
registerApp: typeof registerApp;
|
|
12
|
+
};
|
|
13
|
+
|
|
5
14
|
interface EventEmitterSchema<K extends string, P extends unknown[]> {
|
|
6
15
|
name: K;
|
|
7
16
|
params: P;
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
20
|
+
* @public
|
|
21
|
+
* @category Types
|
|
22
|
+
* @name Accuracy
|
|
23
|
+
* @description 위치 정확도 옵션이에요.
|
|
12
24
|
*/
|
|
13
25
|
declare enum Accuracy {
|
|
14
26
|
/**
|
|
@@ -36,6 +48,12 @@ declare enum Accuracy {
|
|
|
36
48
|
*/
|
|
37
49
|
BestForNavigation = 6
|
|
38
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @public
|
|
53
|
+
* @category Types
|
|
54
|
+
* @name Location
|
|
55
|
+
* @description 위치 정보를 나타내는 객체예요.
|
|
56
|
+
*/
|
|
39
57
|
interface Location {
|
|
40
58
|
/**
|
|
41
59
|
* Android에서만 지원하는 옵션이에요.
|
|
@@ -50,14 +68,42 @@ interface Location {
|
|
|
50
68
|
* 위치가 업데이트된 시점의 유닉스 타임스탬프예요.
|
|
51
69
|
*/
|
|
52
70
|
timestamp: number;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @description 위치 정보를 나타내는 객체예요. 자세한 내용은 [LocationCoords](/reference/framework/Types/LocationCoords.html)을 참고해주세요.
|
|
73
|
+
*/
|
|
74
|
+
coords: LocationCoords;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* @public
|
|
78
|
+
* @category Types
|
|
79
|
+
* @name LocationCoords
|
|
80
|
+
* @description 세부 위치 정보를 나타내는 객체예요.
|
|
81
|
+
*/
|
|
82
|
+
interface LocationCoords {
|
|
83
|
+
/**
|
|
84
|
+
* 위도
|
|
85
|
+
*/
|
|
86
|
+
latitude: number;
|
|
87
|
+
/**
|
|
88
|
+
* 경도
|
|
89
|
+
*/
|
|
90
|
+
longitude: number;
|
|
91
|
+
/**
|
|
92
|
+
* 높이
|
|
93
|
+
*/
|
|
94
|
+
altitude: number;
|
|
95
|
+
/**
|
|
96
|
+
* 위치 정확도
|
|
97
|
+
*/
|
|
98
|
+
accuracy: number;
|
|
99
|
+
/**
|
|
100
|
+
* 고도 정확도
|
|
101
|
+
*/
|
|
102
|
+
altitudeAccuracy: number;
|
|
103
|
+
/**
|
|
104
|
+
* 방향
|
|
105
|
+
*/
|
|
106
|
+
heading: number;
|
|
61
107
|
}
|
|
62
108
|
/**
|
|
63
109
|
* 사진 조회 결과를 나타내는 타입이에요.
|
|
@@ -109,7 +155,7 @@ interface UpdateLocationEventEmitter extends EventEmitterSchema<'updateLocation'
|
|
|
109
155
|
* @param {number} [options.accuracy] 위치 정확도를 설정해요.
|
|
110
156
|
* @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
|
|
111
157
|
* @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
|
|
112
|
-
* @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요.
|
|
158
|
+
* @param {(location: Location) => void} [options.callback] 위치 정보가 변경될 때 호출되는 콜백 함수예요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
|
|
113
159
|
*
|
|
114
160
|
* @example
|
|
115
161
|
* ### 위치 정보 변경 감지하기
|
|
@@ -410,7 +456,7 @@ interface GetCurrentLocationOptions {
|
|
|
410
456
|
*
|
|
411
457
|
* @param {GetCurrentLocationOptions} options 위치 정보를 가져올 때 사용하는 옵션 객체예요.
|
|
412
458
|
* @param {Accuracy} [options.accuracy] 위치 정보의 정확도 수준이에요. 정확도는 `Accuracy` 타입으로 설정돼요.
|
|
413
|
-
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요.
|
|
459
|
+
* @returns {Promise<Location>} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
|
|
414
460
|
*
|
|
415
461
|
* @example
|
|
416
462
|
* ### 디바이스의 현재 위치 정보 가져오기
|
|
@@ -564,6 +610,7 @@ type UseGeolocationOptions = Omit<StartUpdateLocationOptions, 'callback'>;
|
|
|
564
610
|
* @param {Accuracy} [options.accuracy] 위치 정확도를 설정해요. `Accuracy.Lowest`: 오차범위 3KM 이내, `Accuracy.Low`: 오차범위 1KM 이내, `Accuracy.Balanced`: 오차범위 몇 백미터 이내, `Accuracy.High`: 오차범위 10M 이내, `Accuracy.Highest`: 가장 높은 정확도, `Accuracy.BestForNavigation`: 네비게이션을 위한 최고 정확도
|
|
565
611
|
* @param {number} [options.timeInterval] 위치 정보를 업데이트하는 최소 주기로, 단위는 밀리초(ms)예요. 이 값은 위치 업데이트가 발생하는 가장 짧은 간격을 설정하지만, 시스템이나 환경의 영향을 받아 지정한 주기보다 더 긴 간격으로 업데이트될 수 있어요.
|
|
566
612
|
* @param {number} [options.distanceInterval] 위치 변경 거리를 미터(m) 단위로 설정해요.
|
|
613
|
+
* @returns {Location | null} 디바이스의 위치 정보가 담긴 객체를 반환해요. 자세한 내용은 [Location](/reference/framework/Types/Location.html)을 참고해주세요.
|
|
567
614
|
*
|
|
568
615
|
* @example
|
|
569
616
|
* ### 위치 정보 변경 감지하기
|
|
@@ -599,4 +646,4 @@ declare const env: {
|
|
|
599
646
|
getDeploymentId: () => string | undefined;
|
|
600
647
|
};
|
|
601
648
|
|
|
602
|
-
export { Accuracy, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
|
|
649
|
+
export { Accuracy, AppsInToss, type ContactEntity, type FetchAlbumPhotosOptions, type GetCurrentLocationOptions, type ImageResponse, type Location, type LocationCoords, type OpenCameraOptions, type StartUpdateLocationOptions, type StartUpdateLocationSubscription, type UpdateLocationEventEmitter, type UseGeolocationOptions, WebView, type WebViewProps, appLogin, env, fetchAlbumPhotos, fetchContacts, getClipboardText, getCurrentLocation, openCamera, setClipboardText, startUpdateLocation, useGeolocation };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,32 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
+
// src/core/registerApp.tsx
|
|
8
|
+
import { Bedrock } from "react-native-bedrock";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Container, { ...initialProps, children });
|
|
12
|
+
}
|
|
13
|
+
function registerApp(container, { context }) {
|
|
14
|
+
return Bedrock.registerApp(AppsInTossContainer.bind(null, container), {
|
|
15
|
+
appName: getAppName(),
|
|
16
|
+
context
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function getAppName() {
|
|
20
|
+
try {
|
|
21
|
+
return global.__bedrock.app.name;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
console.error("unexpected error occurred while getting app name");
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/core/index.ts
|
|
29
|
+
var AppsInToss = {
|
|
30
|
+
registerApp
|
|
31
|
+
};
|
|
32
|
+
|
|
7
33
|
// src/native-event-emitter/index.ts
|
|
8
34
|
var native_event_emitter_exports = {};
|
|
9
35
|
__export(native_event_emitter_exports, {
|
|
@@ -184,7 +210,7 @@ import { useMemo } from "react";
|
|
|
184
210
|
import { useBridgeHandler } from "react-native-bedrock";
|
|
185
211
|
import * as bridges from "react-native-bedrock/bridges";
|
|
186
212
|
import * as constantBridges from "react-native-bedrock/constants";
|
|
187
|
-
import { jsx } from "react/jsx-runtime";
|
|
213
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
188
214
|
function WebView({ localhostPort = 5173, onMessage, ...props }) {
|
|
189
215
|
const uri = useMemo(() => {
|
|
190
216
|
if (__DEV__) {
|
|
@@ -206,7 +232,7 @@ function WebView({ localhostPort = 5173, onMessage, ...props }) {
|
|
|
206
232
|
...native_modules_exports
|
|
207
233
|
}
|
|
208
234
|
});
|
|
209
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ jsx2(
|
|
210
236
|
OriginalWebView,
|
|
211
237
|
{
|
|
212
238
|
ref: handler.ref,
|
|
@@ -261,6 +287,7 @@ var Accuracy2 = /* @__PURE__ */ ((Accuracy3) => {
|
|
|
261
287
|
})(Accuracy2 || {});
|
|
262
288
|
export {
|
|
263
289
|
Accuracy2 as Accuracy,
|
|
290
|
+
AppsInToss,
|
|
264
291
|
WebView,
|
|
265
292
|
appLogin,
|
|
266
293
|
env,
|
|
@@ -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/jest/index.ts
|
|
18
|
+
var jest_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(jest_exports);
|
|
20
|
+
__reExport(jest_exports, require("react-native-bedrock/jest"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("react-native-bedrock/jest")
|
|
24
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'react-native-bedrock/jest';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'react-native-bedrock/jest';
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -14233,7 +14233,7 @@ var require_isPlainObject = __commonJS({
|
|
|
14233
14233
|
var funcToString = funcProto.toString;
|
|
14234
14234
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
14235
14235
|
var objectCtorString = funcToString.call(Object);
|
|
14236
|
-
function
|
|
14236
|
+
function isPlainObject2(value) {
|
|
14237
14237
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
14238
14238
|
return false;
|
|
14239
14239
|
}
|
|
@@ -14244,7 +14244,7 @@ var require_isPlainObject = __commonJS({
|
|
|
14244
14244
|
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
14245
14245
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
14246
14246
|
}
|
|
14247
|
-
module2.exports =
|
|
14247
|
+
module2.exports = isPlainObject2;
|
|
14248
14248
|
}
|
|
14249
14249
|
});
|
|
14250
14250
|
|
|
@@ -20880,7 +20880,7 @@ var require_file = __commonJS({
|
|
|
20880
20880
|
var flatten = require_flatten();
|
|
20881
20881
|
var difference = require_difference();
|
|
20882
20882
|
var union = require_union();
|
|
20883
|
-
var
|
|
20883
|
+
var isPlainObject2 = require_isPlainObject();
|
|
20884
20884
|
var glob = require_commonjs5();
|
|
20885
20885
|
var file = module2.exports = {};
|
|
20886
20886
|
var pathSeparatorRe = /[\/\\]/g;
|
|
@@ -20905,7 +20905,7 @@ var require_file = __commonJS({
|
|
|
20905
20905
|
return fs6.existsSync(filepath);
|
|
20906
20906
|
};
|
|
20907
20907
|
file.expand = function(...args) {
|
|
20908
|
-
var options =
|
|
20908
|
+
var options = isPlainObject2(args[0]) ? args.shift() : {};
|
|
20909
20909
|
var patterns = Array.isArray(args[0]) ? args[0] : args;
|
|
20910
20910
|
if (patterns.length === 0) {
|
|
20911
20911
|
return [];
|
|
@@ -25652,6 +25652,7 @@ var import_picocolors = __toESM(require_picocolors(), 1);
|
|
|
25652
25652
|
|
|
25653
25653
|
// src/plugins/constants.ts
|
|
25654
25654
|
init_cjs_shims();
|
|
25655
|
+
var REACT_NATIVE_VERSION = "0_72_6";
|
|
25655
25656
|
var APP_MANIFEST_NAME = "app.json";
|
|
25656
25657
|
|
|
25657
25658
|
// src/plugins/utils/compileHbc.ts
|
|
@@ -32705,50 +32706,6 @@ init_cjs_shims();
|
|
|
32705
32706
|
var fs4 = __toESM(require("fs/promises"), 1);
|
|
32706
32707
|
var path10 = __toESM(require("path"), 1);
|
|
32707
32708
|
|
|
32708
|
-
// ../../.yarn/cache/es-toolkit-npm-1.33.0-f181eedbc7-4c8dea3167.zip/node_modules/es-toolkit/dist/index.mjs
|
|
32709
|
-
init_cjs_shims();
|
|
32710
|
-
|
|
32711
|
-
// ../../.yarn/cache/es-toolkit-npm-1.33.0-f181eedbc7-4c8dea3167.zip/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
32712
|
-
init_cjs_shims();
|
|
32713
|
-
function isPlainObject2(value) {
|
|
32714
|
-
if (!value || typeof value !== "object") {
|
|
32715
|
-
return false;
|
|
32716
|
-
}
|
|
32717
|
-
const proto = Object.getPrototypeOf(value);
|
|
32718
|
-
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
32719
|
-
if (!hasObjectPrototype) {
|
|
32720
|
-
return false;
|
|
32721
|
-
}
|
|
32722
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
32723
|
-
}
|
|
32724
|
-
|
|
32725
|
-
// ../../.yarn/cache/es-toolkit-npm-1.33.0-f181eedbc7-4c8dea3167.zip/node_modules/es-toolkit/dist/object/merge.mjs
|
|
32726
|
-
init_cjs_shims();
|
|
32727
|
-
function merge(target, source) {
|
|
32728
|
-
const sourceKeys = Object.keys(source);
|
|
32729
|
-
for (let i2 = 0; i2 < sourceKeys.length; i2++) {
|
|
32730
|
-
const key = sourceKeys[i2];
|
|
32731
|
-
const sourceValue = source[key];
|
|
32732
|
-
const targetValue = target[key];
|
|
32733
|
-
if (Array.isArray(sourceValue)) {
|
|
32734
|
-
if (Array.isArray(targetValue)) {
|
|
32735
|
-
target[key] = merge(targetValue, sourceValue);
|
|
32736
|
-
} else {
|
|
32737
|
-
target[key] = merge([], sourceValue);
|
|
32738
|
-
}
|
|
32739
|
-
} else if (isPlainObject2(sourceValue)) {
|
|
32740
|
-
if (isPlainObject2(targetValue)) {
|
|
32741
|
-
target[key] = merge(targetValue, sourceValue);
|
|
32742
|
-
} else {
|
|
32743
|
-
target[key] = merge({}, sourceValue);
|
|
32744
|
-
}
|
|
32745
|
-
} else if (targetValue === void 0 || sourceValue !== void 0) {
|
|
32746
|
-
target[key] = sourceValue;
|
|
32747
|
-
}
|
|
32748
|
-
}
|
|
32749
|
-
return target;
|
|
32750
|
-
}
|
|
32751
|
-
|
|
32752
32709
|
// src/plugins/utils/getPackageRoot.ts
|
|
32753
32710
|
init_cjs_shims();
|
|
32754
32711
|
var import_fs2 = __toESM(require("fs"), 1);
|
|
@@ -32772,26 +32729,29 @@ async function resolveAppManifestPath() {
|
|
|
32772
32729
|
await fs4.access(appManifestPath, fs4.constants.F_OK);
|
|
32773
32730
|
return appManifestPath;
|
|
32774
32731
|
}
|
|
32732
|
+
async function readAppJson(appJsonPath) {
|
|
32733
|
+
const appJson = await fs4.readFile(appJsonPath, "utf8");
|
|
32734
|
+
return JSON.parse(appJson);
|
|
32735
|
+
}
|
|
32736
|
+
async function writeAppJson(appJsonPath, content) {
|
|
32737
|
+
await fs4.writeFile(appJsonPath, JSON.stringify(content));
|
|
32738
|
+
}
|
|
32775
32739
|
async function updateAppJsonMetadata(metadata) {
|
|
32776
32740
|
const appJsonPath = await resolveAppManifestPath();
|
|
32777
|
-
const appJson = await
|
|
32778
|
-
await
|
|
32779
|
-
|
|
32780
|
-
|
|
32781
|
-
|
|
32782
|
-
_metadata: metadata
|
|
32783
|
-
})
|
|
32784
|
-
)
|
|
32785
|
-
);
|
|
32741
|
+
const appJson = await readAppJson(appJsonPath);
|
|
32742
|
+
await writeAppJson(appJsonPath, {
|
|
32743
|
+
...appJson,
|
|
32744
|
+
_metadata: metadata
|
|
32745
|
+
});
|
|
32786
32746
|
}
|
|
32787
32747
|
|
|
32788
32748
|
// src/plugins/utils/createArtifact.ts
|
|
32789
32749
|
async function createArtifact(options, deps) {
|
|
32790
|
-
const { inputJsFiles, outfile, appJsonPath } = options;
|
|
32750
|
+
const { inputJsFiles, outfile, appJsonPath, reactNativeVersion } = options;
|
|
32791
32751
|
const bundleFiles = await Promise.all(
|
|
32792
32752
|
inputJsFiles.map(async (result) => {
|
|
32793
32753
|
const { compressed } = await createCompressedBytecode(result.path, import_path3.default.dirname(outfile), deps);
|
|
32794
|
-
return { path: compressed, name: `bundle.${result.platform}.hbc.gz` };
|
|
32754
|
+
return { path: compressed, name: `bundle.${result.platform}.${reactNativeVersion}.hbc.gz` };
|
|
32795
32755
|
})
|
|
32796
32756
|
);
|
|
32797
32757
|
await updateAppJsonMetadata({
|
|
@@ -33210,6 +33170,7 @@ function appsInTossCreateArtifact(deploymentId) {
|
|
|
33210
33170
|
handler: async ({ buildResults, appName, cwd }) => {
|
|
33211
33171
|
const artifactOutfile = await createArtifact(
|
|
33212
33172
|
{
|
|
33173
|
+
reactNativeVersion: REACT_NATIVE_VERSION,
|
|
33213
33174
|
deploymentId,
|
|
33214
33175
|
inputJsFiles: buildResults.map((buildResult) => ({
|
|
33215
33176
|
path: buildResult.outfile,
|
|
@@ -33266,11 +33227,13 @@ function appsInTossDevServer(options) {
|
|
|
33266
33227
|
config: {
|
|
33267
33228
|
mpack: {
|
|
33268
33229
|
devServer: {
|
|
33269
|
-
enableRouterGen: false,
|
|
33270
33230
|
middlewares: [
|
|
33271
33231
|
createServerPermissionsMiddleware(options.permissions),
|
|
33272
33232
|
createServerOAuthMiddleware(options.oauth)
|
|
33273
|
-
]
|
|
33233
|
+
],
|
|
33234
|
+
routegen: {
|
|
33235
|
+
enabled: false
|
|
33236
|
+
}
|
|
33274
33237
|
}
|
|
33275
33238
|
}
|
|
33276
33239
|
}
|
package/dist/plugins/index.d.cts
CHANGED