@apps-in-toss/web-framework 0.0.10 → 0.0.12
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/cli/index.js +17 -29
- package/dist/config/index.d.ts +44 -2
- package/dist/config/index.js +52 -7
- package/dist/prebuilt/dev.android.js +449 -422
- package/dist/prebuilt/dev.ios.js +450 -423
- package/dist/prebuilt/prod.android.js +1 -1
- package/dist/prebuilt/prod.ios.js +1 -1
- package/dist/prebuilt/prod.json +6 -6
- package/package.json +9 -9
- package/src-web/fetchAlbumPhotos.d.ts +9 -4
- package/src-web/fetchContacts.d.ts +22 -3
- package/src-web/getPlatformOS.d.ts +12 -5
- package/src-web/openCamera.d.ts +7 -2
- package/dist/chunk-CH3CIAIW.js +0 -7688
- package/dist/chunk-DI2VGQ6M.js +0 -53
- package/dist/chunk-HL7M3JLX.js +0 -53
- package/dist/chunk-I3ZDGLIW.js +0 -19
- package/dist/chunk-LJBVSTWE.js +0 -7687
- package/dist/chunk-TZCMTMV7.js +0 -38
- package/dist/cli/index.cjs +0 -644
- package/dist/cli/index.d.cts +0 -2
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli.cjs +0 -560
- package/dist/cli.d.cts +0 -2
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -509
- package/dist/closeView.d.ts +0 -24
- package/dist/config/index.cjs +0 -7976
- package/dist/config/index.d.cts +0 -73
- package/dist/fetchAlbumPhotos.d.ts +0 -75
- package/dist/fetchContacts.d.ts +0 -92
- package/dist/generateHapticFeedback.d.ts +0 -52
- package/dist/getClipboardText.d.ts +0 -42
- package/dist/getCurrentLocation.d.ts +0 -109
- package/dist/getDeviceId.d.ts +0 -32
- package/dist/getLocale.d.ts +0 -31
- package/dist/getNetworkStatus.d.ts +0 -55
- package/dist/getSchemeUri.d.ts +0 -26
- package/dist/index.cjs +0 -18
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -16
- package/dist/index.js +0 -1
- package/dist/openCamera.d.ts +0 -75
- package/dist/plugins/index.cjs +0 -7682
- package/dist/plugins/index.d.cts +0 -15
- package/dist/plugins/index.d.ts +0 -15
- package/dist/plugins/index.js +0 -11
- package/dist/setClipboardText.d.ts +0 -34
- package/dist/setScreenAwakeMode.d.ts +0 -69
- package/dist/setSecureScreen.d.ts +0 -34
- package/dist/share.d.ts +0 -37
- package/dist/startUpdateLocation.d.ts +0 -151
package/dist/cli/index.js
CHANGED
|
@@ -93980,9 +93980,8 @@ async function resolvePlugins(plugins) {
|
|
|
93980
93980
|
|
|
93981
93981
|
// src/runPrebuildToBuild.ts
|
|
93982
93982
|
async function babelBuild({
|
|
93983
|
-
appName,
|
|
93984
|
-
outdir,
|
|
93985
93983
|
platform: platform3,
|
|
93984
|
+
config,
|
|
93986
93985
|
buildNumber,
|
|
93987
93986
|
deploymentId
|
|
93988
93987
|
}) {
|
|
@@ -93995,11 +93994,12 @@ async function babelBuild({
|
|
|
93995
93994
|
babelJsonReplacementPlugin,
|
|
93996
93995
|
{
|
|
93997
93996
|
json: {
|
|
93998
|
-
appName,
|
|
93997
|
+
appName: config.appName,
|
|
93999
93998
|
webPort: "NOOP",
|
|
94000
93999
|
webHost: "NOOP",
|
|
94001
94000
|
buildNumber,
|
|
94002
|
-
deploymentId
|
|
94001
|
+
deploymentId,
|
|
94002
|
+
...config.webViewProps
|
|
94003
94003
|
},
|
|
94004
94004
|
identifierName: "Ait"
|
|
94005
94005
|
}
|
|
@@ -94009,8 +94009,8 @@ async function babelBuild({
|
|
|
94009
94009
|
if (!result?.code) {
|
|
94010
94010
|
throw new Error(`Failed to build ${platform3}`);
|
|
94011
94011
|
}
|
|
94012
|
-
await fs8.promises.mkdir(path20.join(packageRoot, outdir), { recursive: true });
|
|
94013
|
-
await fs8.promises.writeFile(path20.join(packageRoot, outdir, `${appName}.${platform3}.js`), result.code);
|
|
94012
|
+
await fs8.promises.mkdir(path20.join(packageRoot, config.outdir), { recursive: true });
|
|
94013
|
+
await fs8.promises.writeFile(path20.join(packageRoot, config.outdir, `${config.appName}.${platform3}.js`), result.code);
|
|
94014
94014
|
}
|
|
94015
94015
|
function getBuildNumber() {
|
|
94016
94016
|
const date = /* @__PURE__ */ new Date();
|
|
@@ -94025,7 +94025,6 @@ function getBuildNumber() {
|
|
|
94025
94025
|
async function runPrebuildToBuild(cwd, config) {
|
|
94026
94026
|
const buildNumber = getBuildNumber();
|
|
94027
94027
|
const deploymentId = uuidv7();
|
|
94028
|
-
const { outdir = "dist" } = config;
|
|
94029
94028
|
const resolvedPlugins = await resolvePlugins([
|
|
94030
94029
|
appsInTossWeb(deploymentId, {
|
|
94031
94030
|
commands: config.web.commands,
|
|
@@ -94038,7 +94037,7 @@ async function runPrebuildToBuild(cwd, config) {
|
|
|
94038
94037
|
cwd,
|
|
94039
94038
|
entryFile: "",
|
|
94040
94039
|
appName: config.appName,
|
|
94041
|
-
outdir,
|
|
94040
|
+
outdir: config.outdir,
|
|
94042
94041
|
buildResults: []
|
|
94043
94042
|
});
|
|
94044
94043
|
}
|
|
@@ -94047,8 +94046,7 @@ async function runPrebuildToBuild(cwd, config) {
|
|
|
94047
94046
|
title: `Building ${platform3}`,
|
|
94048
94047
|
task: async () => {
|
|
94049
94048
|
await babelBuild({
|
|
94050
|
-
|
|
94051
|
-
outdir,
|
|
94049
|
+
config,
|
|
94052
94050
|
platform: platform3,
|
|
94053
94051
|
buildNumber,
|
|
94054
94052
|
deploymentId
|
|
@@ -94069,28 +94067,30 @@ async function runPrebuildToBuild(cwd, config) {
|
|
|
94069
94067
|
cwd,
|
|
94070
94068
|
entryFile: "",
|
|
94071
94069
|
appName: config.appName,
|
|
94072
|
-
outdir,
|
|
94070
|
+
outdir: config.outdir,
|
|
94073
94071
|
buildResults: [
|
|
94074
94072
|
{
|
|
94075
94073
|
errors: [],
|
|
94076
94074
|
warnings: [],
|
|
94077
94075
|
tag: `${config.appName}-ios`,
|
|
94078
|
-
outfile: path20.join(cwd, outdir, `${config.appName}.ios.js`),
|
|
94076
|
+
outfile: path20.join(cwd, config.outdir, `${config.appName}.ios.js`),
|
|
94079
94077
|
extra: {},
|
|
94080
94078
|
outputFiles: [],
|
|
94081
94079
|
metafile: { inputs: {}, outputs: {} },
|
|
94082
94080
|
mangleCache: {},
|
|
94081
|
+
bundle: {},
|
|
94083
94082
|
...prodIos
|
|
94084
94083
|
},
|
|
94085
94084
|
{
|
|
94086
94085
|
errors: [],
|
|
94087
94086
|
warnings: [],
|
|
94088
94087
|
tag: `${config.appName}-android`,
|
|
94089
|
-
outfile: path20.join(cwd, outdir, `${config.appName}.android.js`),
|
|
94088
|
+
outfile: path20.join(cwd, config.outdir, `${config.appName}.android.js`),
|
|
94090
94089
|
extra: {},
|
|
94091
94090
|
outputFiles: [],
|
|
94092
94091
|
metafile: { inputs: {}, outputs: {} },
|
|
94093
94092
|
mangleCache: {},
|
|
94093
|
+
bundle: {},
|
|
94094
94094
|
...prodAndroid
|
|
94095
94095
|
}
|
|
94096
94096
|
]
|
|
@@ -96206,12 +96206,7 @@ function parsePermissions(permissions) {
|
|
|
96206
96206
|
}
|
|
96207
96207
|
return Array.from(permissionMap.entries()).map(([name, accesses]) => `${name}:${Array.from(accesses).sort().join("")}`).sort().join(",");
|
|
96208
96208
|
}
|
|
96209
|
-
var createApp = ({
|
|
96210
|
-
appName,
|
|
96211
|
-
web,
|
|
96212
|
-
oauth,
|
|
96213
|
-
permissions
|
|
96214
|
-
}) => {
|
|
96209
|
+
var createApp = ({ appName, web, oauth, permissions, webViewProps }) => {
|
|
96215
96210
|
const app = new Hono2();
|
|
96216
96211
|
app.get("/status", (c5) => {
|
|
96217
96212
|
c5.header("X-React-Native-Project-Root", path21.resolve(__dirname, "..", "react-native"));
|
|
@@ -96241,7 +96236,8 @@ var createApp = ({
|
|
|
96241
96236
|
json: {
|
|
96242
96237
|
appName,
|
|
96243
96238
|
webPort: web.port,
|
|
96244
|
-
webHost: web.host
|
|
96239
|
+
webHost: web.host,
|
|
96240
|
+
...webViewProps
|
|
96245
96241
|
},
|
|
96246
96242
|
identifierName: "Ait"
|
|
96247
96243
|
}
|
|
@@ -96289,15 +96285,7 @@ var DevCommand = class extends Command {
|
|
|
96289
96285
|
async execute() {
|
|
96290
96286
|
const packageRoot = getPackageRoot();
|
|
96291
96287
|
const config = await loadConfig();
|
|
96292
|
-
const app = createApp(
|
|
96293
|
-
appName: config.appName,
|
|
96294
|
-
web: {
|
|
96295
|
-
port: config.web.port,
|
|
96296
|
-
host: config.web.host ?? "localhost"
|
|
96297
|
-
},
|
|
96298
|
-
oauth: config.oauth,
|
|
96299
|
-
permissions: config.permissions
|
|
96300
|
-
});
|
|
96288
|
+
const app = createApp(config);
|
|
96301
96289
|
serve(
|
|
96302
96290
|
{
|
|
96303
96291
|
hostname: "0.0.0.0",
|
package/dist/config/index.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
type NotNill<T> = T extends null | undefined ? never : T;
|
|
2
|
+
type Primitive = undefined | null | boolean | string | number;
|
|
3
|
+
type DeepRequired<T> = T extends Primitive ? NotNill<T> : T extends Array<infer U> ? Array<DeepRequired<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepRequired<U>> : {
|
|
4
|
+
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
type PermissionReadWrite = 'read' | 'write';
|
|
2
8
|
type PermissionAccess = 'access';
|
|
3
9
|
type ClipboardPermission = {
|
|
@@ -46,6 +52,41 @@ interface AppsInTossWebConfig {
|
|
|
46
52
|
build: string;
|
|
47
53
|
};
|
|
48
54
|
};
|
|
55
|
+
webViewProps?: {
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
* @platform — ios
|
|
60
|
+
*
|
|
61
|
+
* Boolean that determines whether HTML5 videos play inline or use the native full-screen controller. The default value is false.
|
|
62
|
+
* NOTE : In order for video to play inline, not only does this property need to be set to true, but the video element in the HTML document must also include the webkit-playsinline attribute.
|
|
63
|
+
*/
|
|
64
|
+
allowsInlineMediaPlayback?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* @default true
|
|
67
|
+
* @platform — ios
|
|
68
|
+
*
|
|
69
|
+
* Boolean value that determines whether the web view bounces when it reaches the edge of the content.
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
bounces?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @default true
|
|
76
|
+
* @platform - ios
|
|
77
|
+
* Boolean value that determines whether a pull to refresh gesture is available in the WebView. The default value is false. If true, sets bounces automatically to true
|
|
78
|
+
*/
|
|
79
|
+
pullToRefreshEnabled?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* https://developer.android.com/reference/android/view/View#OVER_SCROLL_NEVER Sets the overScrollMode. Possible values are:
|
|
82
|
+
* 'always' (default)
|
|
83
|
+
* 'content'
|
|
84
|
+
* 'never'
|
|
85
|
+
* @platform — android
|
|
86
|
+
* @default 'always'
|
|
87
|
+
*/
|
|
88
|
+
overScrollMode?: 'never' | 'always' | 'auto';
|
|
89
|
+
};
|
|
49
90
|
permissions: Permission[];
|
|
50
91
|
oauth: {
|
|
51
92
|
scopes: OAuthScope[];
|
|
@@ -55,6 +96,7 @@ interface AppsInTossWebConfig {
|
|
|
55
96
|
*/
|
|
56
97
|
outdir?: string;
|
|
57
98
|
}
|
|
58
|
-
|
|
99
|
+
type AppsInTossWebConfigResponse = DeepRequired<AppsInTossWebConfig>;
|
|
100
|
+
declare const defineConfig: (config: AppsInTossWebConfig) => AppsInTossWebConfigResponse;
|
|
59
101
|
|
|
60
|
-
export { type AppsInTossWebConfig, defineConfig };
|
|
102
|
+
export { type AppsInTossWebConfig, type AppsInTossWebConfigResponse, defineConfig };
|
package/dist/config/index.js
CHANGED
|
@@ -1,12 +1,57 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
if (!
|
|
4
|
-
|
|
1
|
+
// ../../.yarn/cache/es-toolkit-npm-1.32.0-019fc7c155-56ba965570.zip/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
if (!value || typeof value !== "object") {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const proto = Object.getPrototypeOf(value);
|
|
7
|
+
const hasObjectPrototype = proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null;
|
|
8
|
+
if (!hasObjectPrototype) {
|
|
9
|
+
return false;
|
|
5
10
|
}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ../../.yarn/cache/es-toolkit-npm-1.32.0-019fc7c155-56ba965570.zip/node_modules/es-toolkit/dist/object/merge.mjs
|
|
15
|
+
function merge(target, source) {
|
|
16
|
+
const sourceKeys = Object.keys(source);
|
|
17
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
18
|
+
const key = sourceKeys[i];
|
|
19
|
+
const sourceValue = source[key];
|
|
20
|
+
const targetValue = target[key];
|
|
21
|
+
if (Array.isArray(sourceValue)) {
|
|
22
|
+
if (Array.isArray(targetValue)) {
|
|
23
|
+
target[key] = merge(targetValue, sourceValue);
|
|
24
|
+
} else {
|
|
25
|
+
target[key] = merge([], sourceValue);
|
|
26
|
+
}
|
|
27
|
+
} else if (isPlainObject(sourceValue)) {
|
|
28
|
+
if (isPlainObject(targetValue)) {
|
|
29
|
+
target[key] = merge(targetValue, sourceValue);
|
|
30
|
+
} else {
|
|
31
|
+
target[key] = merge({}, sourceValue);
|
|
32
|
+
}
|
|
33
|
+
} else if (targetValue === void 0 || sourceValue !== void 0) {
|
|
34
|
+
target[key] = sourceValue;
|
|
35
|
+
}
|
|
8
36
|
}
|
|
9
|
-
return
|
|
37
|
+
return target;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// src/config/defineConfig.ts
|
|
41
|
+
var defineConfig = (config) => {
|
|
42
|
+
const defaultConfig = {
|
|
43
|
+
outdir: "dist",
|
|
44
|
+
web: {
|
|
45
|
+
host: "localhost"
|
|
46
|
+
},
|
|
47
|
+
webViewProps: {
|
|
48
|
+
allowsInlineMediaPlayback: false,
|
|
49
|
+
bounces: true,
|
|
50
|
+
pullToRefreshEnabled: true,
|
|
51
|
+
overScrollMode: "always"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return merge(defaultConfig, config);
|
|
10
55
|
};
|
|
11
56
|
export {
|
|
12
57
|
defineConfig
|