peachsim 0.1.666 → 0.1.668
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-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-identity.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +9 -3
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +4 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +1 -1
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +22 -19
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +1 -1
- package/dist-lib/vite.cjs +1 -1
- package/kotlin/AppSources/dev/peach/app/PeachApp.kt +15 -3
- package/kotlin/ComposeSources/PeachComposeHost.kt +200 -0
- package/kotlin/Sources/org/json/JSON.kt +13 -0
- package/kotlin/fixtures/kotlin-app-variants/Anim.kt +62 -0
- package/kotlin/fixtures/kotlin-app-variants/Controls.kt +62 -0
- package/kotlin/fixtures/kotlin-app-variants/Drag.kt +56 -0
- package/kotlin/fixtures/kotlin-app-variants/Draw.kt +74 -0
- package/kotlin/fixtures/kotlin-app-variants/Form.kt +47 -0
- package/kotlin/fixtures/kotlin-app-variants/Ime.kt +51 -0
- package/kotlin/fixtures/kotlin-app-variants/Note.kt +40 -0
- package/package.json +1 -1
- package/src/expo-swift-host.ts +6 -2
- package/src/kotlin-host.ts +3 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
package dev.contrast.kotlinapp
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.layout.Column
|
|
5
|
+
import androidx.compose.foundation.layout.Spacer
|
|
6
|
+
import androidx.compose.foundation.layout.WindowInsets
|
|
7
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
8
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
9
|
+
import androidx.compose.foundation.layout.ime
|
|
10
|
+
import androidx.compose.foundation.layout.padding
|
|
11
|
+
import androidx.compose.foundation.layout.safeDrawingPadding
|
|
12
|
+
import androidx.compose.material3.OutlinedTextField
|
|
13
|
+
import androidx.compose.material3.Text
|
|
14
|
+
import androidx.compose.runtime.Composable
|
|
15
|
+
import androidx.compose.runtime.getValue
|
|
16
|
+
import androidx.compose.runtime.mutableStateOf
|
|
17
|
+
import androidx.compose.runtime.remember
|
|
18
|
+
import androidx.compose.runtime.setValue
|
|
19
|
+
import androidx.compose.ui.Modifier
|
|
20
|
+
import androidx.compose.ui.graphics.Color
|
|
21
|
+
import androidx.compose.ui.layout.onSizeChanged
|
|
22
|
+
import androidx.compose.ui.platform.LocalDensity
|
|
23
|
+
import androidx.compose.ui.unit.dp
|
|
24
|
+
|
|
25
|
+
// safe drawing padding holds a bottom bar above the keyboard, which the IME
|
|
26
|
+
// inset moves as the keyboard opens and closes. a window that fits system
|
|
27
|
+
// windows takes no IME inset, and lifted reports whether its content shrank
|
|
28
|
+
@Composable
|
|
29
|
+
fun Ime() {
|
|
30
|
+
var note by remember { mutableStateOf("") }
|
|
31
|
+
var height by remember { mutableStateOf(0) }
|
|
32
|
+
var tallest by remember { mutableStateOf(0) }
|
|
33
|
+
val shown = WindowInsets.ime.getBottom(LocalDensity.current) > 0
|
|
34
|
+
Column(
|
|
35
|
+
Modifier.fillMaxSize()
|
|
36
|
+
.onSizeChanged { height = it.height; tallest = maxOf(tallest, it.height) }
|
|
37
|
+
.background(Color(0xFFE8EEF8))
|
|
38
|
+
.safeDrawingPadding()
|
|
39
|
+
.padding(16.dp),
|
|
40
|
+
) {
|
|
41
|
+
Text("Ime: ${if (shown) "shown" else "hidden"} lifted ${height < tallest}")
|
|
42
|
+
OutlinedTextField(
|
|
43
|
+
value = note,
|
|
44
|
+
onValueChange = { note = it },
|
|
45
|
+
label = { Text("Note") },
|
|
46
|
+
modifier = Modifier.fillMaxWidth().padding(top = 12.dp),
|
|
47
|
+
)
|
|
48
|
+
Spacer(Modifier.weight(1f))
|
|
49
|
+
Text("Bottom bar", Modifier.fillMaxWidth().background(Color(0xFF3F51B5)).padding(16.dp), color = Color.White)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
package dev.contrast.kotlinapp
|
|
2
|
+
|
|
3
|
+
import androidx.compose.foundation.background
|
|
4
|
+
import androidx.compose.foundation.layout.Arrangement
|
|
5
|
+
import androidx.compose.foundation.layout.Column
|
|
6
|
+
import androidx.compose.foundation.layout.fillMaxSize
|
|
7
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
8
|
+
import androidx.compose.foundation.layout.padding
|
|
9
|
+
import androidx.compose.foundation.layout.safeDrawingPadding
|
|
10
|
+
import androidx.compose.material3.OutlinedTextField
|
|
11
|
+
import androidx.compose.material3.Text
|
|
12
|
+
import androidx.compose.runtime.Composable
|
|
13
|
+
import androidx.compose.runtime.getValue
|
|
14
|
+
import androidx.compose.runtime.mutableStateOf
|
|
15
|
+
import androidx.compose.runtime.remember
|
|
16
|
+
import androidx.compose.runtime.setValue
|
|
17
|
+
import androidx.compose.ui.Modifier
|
|
18
|
+
import androidx.compose.ui.focus.onFocusChanged
|
|
19
|
+
import androidx.compose.ui.graphics.Color
|
|
20
|
+
import androidx.compose.ui.unit.dp
|
|
21
|
+
|
|
22
|
+
// a multi line field with default keyboard options: enter inserts a newline
|
|
23
|
+
// and delete removes what it typed
|
|
24
|
+
@Composable
|
|
25
|
+
fun Note() {
|
|
26
|
+
var note by remember { mutableStateOf("") }
|
|
27
|
+
var focused by remember { mutableStateOf(false) }
|
|
28
|
+
Column(
|
|
29
|
+
Modifier.fillMaxSize().background(Color(0xFFE8EEF8)).safeDrawingPadding().padding(16.dp),
|
|
30
|
+
verticalArrangement = Arrangement.spacedBy(12.dp),
|
|
31
|
+
) {
|
|
32
|
+
Text("Note: ${note.ifEmpty { "empty" }.replace('\n', '|')} focus $focused")
|
|
33
|
+
OutlinedTextField(
|
|
34
|
+
value = note,
|
|
35
|
+
onValueChange = { note = it },
|
|
36
|
+
label = { Text("Note") },
|
|
37
|
+
modifier = Modifier.fillMaxWidth().onFocusChanged { focused = it.isFocused },
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
}
|
package/package.json
CHANGED
package/src/expo-swift-host.ts
CHANGED
|
@@ -7,12 +7,16 @@ import { createRequire } from 'node:module'
|
|
|
7
7
|
import os from 'node:os'
|
|
8
8
|
import path from 'node:path'
|
|
9
9
|
import { promisify } from 'node:util'
|
|
10
|
+
import { RNX_FORKED_SCRIPT_ENV } from '../cli/internal-child'
|
|
10
11
|
import { isLoopbackHost } from './backend-origin'
|
|
11
12
|
import { artifactFor, icuUrl, projectFor, serveSwiftPackageAsset } from './swift-host'
|
|
12
13
|
import { MAX_SWIFT_COMPILE_FILES, MAX_SWIFT_COMPILE_SOURCE_BYTES } from './swift-submit'
|
|
13
14
|
import type { IncomingMessage, ServerResponse } from 'node:http'
|
|
14
15
|
|
|
15
16
|
const run = promisify(execFile)
|
|
17
|
+
// the compiled CLI's execPath is peach itself, which runs a forked `.js` as a
|
|
18
|
+
// script only with this set; node and bun ignore it.
|
|
19
|
+
const scriptEnv = { ...process.env, [RNX_FORKED_SCRIPT_ENV]: '1' }
|
|
16
20
|
export const EXPO_SWIFT_ROUTE = '/__peach/expo-swift'
|
|
17
21
|
export const EXPO_SWIFT_ENTRY = 'Sources/PeachExpoApp/PeachExpoEntry.swift'
|
|
18
22
|
|
|
@@ -44,7 +48,7 @@ export async function collectExpoSwiftSources(
|
|
|
44
48
|
appRoot,
|
|
45
49
|
'--json',
|
|
46
50
|
],
|
|
47
|
-
{ timeout: 30_000, maxBuffer: 8 * 1024 * 1024 },
|
|
51
|
+
{ timeout: 30_000, maxBuffer: 8 * 1024 * 1024, env: scriptEnv },
|
|
48
52
|
)
|
|
49
53
|
const search: unknown = JSON.parse(stdout)
|
|
50
54
|
if (!search || typeof search !== 'object' || Array.isArray(search))
|
|
@@ -60,7 +64,7 @@ export async function collectExpoSwiftSources(
|
|
|
60
64
|
appRoot,
|
|
61
65
|
'--json',
|
|
62
66
|
],
|
|
63
|
-
{ timeout: 30_000, maxBuffer: 8 * 1024 * 1024 },
|
|
67
|
+
{ timeout: 30_000, maxBuffer: 8 * 1024 * 1024, env: scriptEnv },
|
|
64
68
|
)
|
|
65
69
|
const resolved: unknown = JSON.parse(resolvedText)
|
|
66
70
|
const resolutions =
|
package/src/kotlin-host.ts
CHANGED
|
@@ -401,6 +401,9 @@ export async function kotlinAppArtifact(
|
|
|
401
401
|
'@JsExport',
|
|
402
402
|
'fun peachAppNight(night: Boolean) = dev.peach.app.peachAppNight(night)',
|
|
403
403
|
'',
|
|
404
|
+
'@JsExport',
|
|
405
|
+
'fun peachAppIme(bottom: Int) = dev.peach.app.peachAppIme(bottom)',
|
|
406
|
+
'',
|
|
404
407
|
].join('\n')
|
|
405
408
|
const generated: Record<string, string> = {
|
|
406
409
|
'PeachEntry.kt': entrySource([]),
|