peachsim 0.1.2594 → 0.1.2596
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/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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +18 -13
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-M67PRRGJ.mjs → acorn-WGTQK4JN.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-NN73CP4F.mjs → chunk-3C2YVQZH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QSPPJOT6.mjs → chunk-4MMPS5YL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QUMKCF67.mjs → chunk-4PMXT2UO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-X242Y5KS.mjs → chunk-4UUWP6NP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-Z6E7GAQS.mjs → chunk-5NZPSLS4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FFHDCOXF.mjs → chunk-BAEOHCN5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RESE3ERA.mjs → chunk-BNXCKF2B.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3VEDDAPT.mjs → chunk-C3C5OJG4.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-YGDCMWUX.mjs → chunk-DY6PUVXF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6MZ5FKMK.mjs → chunk-FDMS7FWE.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-QHYHKB3J.mjs → chunk-HZPXGVY4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EDBGKIQ2.mjs → chunk-IGMABYTC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SBHXHWKH.mjs → chunk-ISZE675P.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PESI6OUB.mjs → chunk-LZF4BVEY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4AOZYVB2.mjs → chunk-QEGUUPRI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-INOLFCG5.mjs → chunk-SPKD6UYK.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-GER2Z6BI.mjs → chunk-SYCOZ2CT.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-IUDVBSA4.mjs → chunk-TILPABC4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SV76NV36.mjs → chunk-TNZG7SFG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XM3OLATO.mjs → chunk-UCIOSXXU.mjs} +17 -14
- package/dist-lib/esm-chunks/{chunk-UAEIMMNH.mjs → chunk-WPX7HLFR.mjs} +14 -12
- package/dist-lib/esm-chunks/{chunk-HJJI36KV.mjs → chunk-ZVBBDMPW.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-ZJUAU4C3.mjs → metro-layout-parser-QNM3HYV7.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-2FFVA7SB.mjs → swift-package-prebuilt-BXXQB7Q2.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-A2ZJMCBX.mjs → swift-sdk-app-module-FKL3X2ZC.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-HJLWK2B6.mjs → swift-sdk-image-CCVWDFHB.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-7EM7U2LR.mjs → swift-sdk-image-producer-OTMZVBDN.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +17 -12
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +62 -16
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- 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/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +16 -16
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +81 -81
- package/dist-lib/public-origins-lib.json +69 -69
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.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 +8 -8
- package/dist-lib/skills.cjs +62 -16
- package/dist-lib/swift-compile.cjs +15 -10
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/engine/native-scroll-controller.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/canvaskit-worker-init.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-sab.d.ts +1 -0
- package/package.json +1 -1
- package/src/one-native-controls-package.ts +40 -2
- package/src/oneNativeControlsContract.ts +1 -0
- package/src/swift-guest-link.ts +4 -3
- package/src/swift-sdk-image.ts +11 -8
|
@@ -5,6 +5,7 @@ import type { CanvasKitInitOptions } from 'canvaskit-wasm';
|
|
|
5
5
|
export interface SharedCanvasKitInitOptions {
|
|
6
6
|
locateFile(file: string): string;
|
|
7
7
|
canvasKitWasmModule: WebAssembly.Module;
|
|
8
|
+
workletMemory?: WebAssembly.Memory;
|
|
8
9
|
onWasmInstance?: (instance: WebAssembly.Instance) => void;
|
|
9
10
|
nativeResources: NativeResourceSuppliers;
|
|
10
11
|
reportSite?: boolean;
|
|
@@ -186,6 +186,7 @@ export type HostToWorker = WorkerStorageSyncMessage | {
|
|
|
186
186
|
backgroundWarm?: BackgroundWarm;
|
|
187
187
|
verboseWorkerLogs?: boolean;
|
|
188
188
|
workletSAB?: SharedArrayBuffer;
|
|
189
|
+
workletMemory?: WebAssembly.Memory;
|
|
189
190
|
synchronizableArenas?: SynchronizableArenas;
|
|
190
191
|
uiRpcMailboxes?: UiRpcMailboxes;
|
|
191
192
|
namedRuntimePort?: MessagePort;
|
|
@@ -17,6 +17,7 @@ export interface UiRpcMailboxes {
|
|
|
17
17
|
}
|
|
18
18
|
export declare function allocateWorkletPeerEpoch(): WorkletPeerEpoch;
|
|
19
19
|
export declare function getOrCreateWorkletSAB(): SharedArrayBuffer | null;
|
|
20
|
+
export declare function getOrCreateWorkletMemory(): WebAssembly.Memory | null;
|
|
20
21
|
export declare function getOrCreateSynchronizableArenas(): SynchronizableArenas | null;
|
|
21
22
|
export declare function getOrCreateUiRpcMailboxes(): UiRpcMailboxes | null;
|
|
22
23
|
export declare function getOrCreateLayoutSAB(): SharedArrayBuffer | null;
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
ONE_NATIVE_CONTROLS_NAVIGATION_SPLIT_VIEW,
|
|
13
13
|
ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW,
|
|
14
14
|
ONE_NATIVE_CONTROLS_PACKAGE,
|
|
15
|
+
ONE_NATIVE_CONTROLS_VISUAL_VIEWS,
|
|
15
16
|
} from './oneNativeControlsContract'
|
|
16
17
|
import { swiftCodeMask, syncSwiftTree } from './swift-compile'
|
|
17
18
|
import { projectFor, swiftPackageAssets, swiftPackageMetadata } from './swift-host'
|
|
@@ -197,12 +198,37 @@ private class ControlComposition {
|
|
|
197
198
|
var children: [String: [UIView]] = [:]
|
|
198
199
|
var slots: [String: UIView] = [:]
|
|
199
200
|
var emit: ((String, String) -> Void)?
|
|
201
|
+
private var leafMeasure: UIHostingController<AnyView>?
|
|
202
|
+
private var measuredRoot: NSDictionary?
|
|
203
|
+
private var intrinsicWidth: CGFloat?
|
|
200
204
|
|
|
201
205
|
func send(_ id: String, _ event: String, _ fields: Spec) {
|
|
202
206
|
let payload = try! JSONSerialization.data(withJSONObject: [id, event, fields])
|
|
203
207
|
emit?("dispatch", String(decoding: payload, as: UTF8.self))
|
|
204
208
|
}
|
|
205
209
|
|
|
210
|
+
func measureLeafWidth(_ view: UIView, root: Spec) {
|
|
211
|
+
let spec = root as NSDictionary
|
|
212
|
+
guard measuredRoot != spec else { return }
|
|
213
|
+
measuredRoot = spec
|
|
214
|
+
let unconstrained = CGFloat.greatestFiniteMagnitude
|
|
215
|
+
let proposal = CGSize(width: unconstrained, height: unconstrained)
|
|
216
|
+
let width: CGFloat
|
|
217
|
+
if let size = (view as? OneNativeDirectMeasure)?.directSizeThatFits(proposal) {
|
|
218
|
+
width = size.width
|
|
219
|
+
} else {
|
|
220
|
+
guard let content = view as? OneNativeComposable else { return }
|
|
221
|
+
let host = leafMeasure ?? UIHostingController(rootView: content.compositionContent())
|
|
222
|
+
host.safeAreaRegions = []
|
|
223
|
+
leafMeasure = host
|
|
224
|
+
width = host.sizeThatFits(in: proposal).width
|
|
225
|
+
}
|
|
226
|
+
guard width.isFinite, width >= 0,
|
|
227
|
+
intrinsicWidth.map({ abs(width - $0) >= 0.1 }) ?? true else { return }
|
|
228
|
+
intrinsicWidth = width
|
|
229
|
+
send(root["id"] as! String, "intrinsicWidth", ["width": width])
|
|
230
|
+
}
|
|
231
|
+
|
|
206
232
|
func reconcile(
|
|
207
233
|
_ next: [UIView],
|
|
208
234
|
previous: [UIView],
|
|
@@ -340,6 +366,7 @@ private class ControlComposition {
|
|
|
340
366
|
private struct ControlBridge: UIViewRepresentable {
|
|
341
367
|
let root: Spec
|
|
342
368
|
let emit: (String, String) -> Void
|
|
369
|
+
let measureWidth: Bool
|
|
343
370
|
|
|
344
371
|
func makeCoordinator() -> ControlComposition { ControlComposition() }
|
|
345
372
|
|
|
@@ -350,6 +377,7 @@ private struct ControlBridge: UIViewRepresentable {
|
|
|
350
377
|
state.emit = emit
|
|
351
378
|
var visited = Set<String>()
|
|
352
379
|
let control = state.render(root, visited: &visited)
|
|
380
|
+
if measureWidth { state.measureLeafWidth(control, root: root) }
|
|
353
381
|
if control.superview !== host {
|
|
354
382
|
host.subviews.forEach { $0.removeFromSuperview() }
|
|
355
383
|
control.frame = host.bounds
|
|
@@ -639,7 +667,7 @@ private struct NavigationSplitViewBridge: UIViewRepresentable {
|
|
|
639
667
|
default:
|
|
640
668
|
let root = spec["root"] as! Spec
|
|
641
669
|
precondition((root["spec"] as? Spec)?["control"] as? String == view)
|
|
642
|
-
let bridge = ControlBridge(root: root, emit: emit)
|
|
670
|
+
let bridge = ControlBridge(root: root, emit: emit, measureWidth: spec["measureWidth"] as? Bool == true)
|
|
643
671
|
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: .infinity)
|
|
644
672
|
let height = (spec["height"] as? Double).map { CGFloat($0) }
|
|
645
673
|
return AnyView(bridge.frame(height: height))
|
|
@@ -837,7 +865,17 @@ export async function oneNativeControlsPackage(
|
|
|
837
865
|
const iosDir = resolveOneNativeAppleIosDir(appRoot)
|
|
838
866
|
const generated = swiftGuestControls(
|
|
839
867
|
path.dirname(iosDir),
|
|
840
|
-
[
|
|
868
|
+
[
|
|
869
|
+
'OneNativeButton',
|
|
870
|
+
'OneNativeLabel',
|
|
871
|
+
'OneNativeText',
|
|
872
|
+
'OneNativeImage',
|
|
873
|
+
...ONE_NATIVE_CONTROLS_VISUAL_VIEWS,
|
|
874
|
+
'OneNativeHStack',
|
|
875
|
+
'OneNativeProgressView',
|
|
876
|
+
'OneNativeSpacer',
|
|
877
|
+
'OneNativeVStack',
|
|
878
|
+
],
|
|
841
879
|
linkedGroups,
|
|
842
880
|
)
|
|
843
881
|
const sources: Record<string, string> = {}
|
package/src/swift-guest-link.ts
CHANGED
|
@@ -661,9 +661,10 @@ export function linkGuestImages(
|
|
|
661
661
|
}
|
|
662
662
|
const members = archives.get(artifact.path)
|
|
663
663
|
if (!members) continue
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
const listing = execFileSync(llvmAr, ['t', artifact.path], {
|
|
665
|
+
encoding: 'utf8',
|
|
666
|
+
}).trimEnd()
|
|
667
|
+
const listed = listing ? listing.split('\n') : []
|
|
667
668
|
if (
|
|
668
669
|
listed.length !== members.length ||
|
|
669
670
|
new Set(listed).size !== listed.length ||
|
package/src/swift-sdk-image.ts
CHANGED
|
@@ -242,30 +242,33 @@ function setBoundedCache<T>(cache: Map<string, T>, key: string, value: T): T {
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
function cached(directory: string, key: string): SwiftSdkImage | undefined {
|
|
245
|
-
const sdkInterfacePath = path.join(directory, INTERFACE_FILE)
|
|
246
|
-
const image = path.join(directory, IMAGE_FILE)
|
|
247
245
|
const address = path.join(directory, IMAGE_DIGEST)
|
|
248
246
|
if (
|
|
249
|
-
!existsSync(
|
|
247
|
+
!existsSync(path.join(directory, IMAGE_FILE)) ||
|
|
250
248
|
!existsSync(address) ||
|
|
251
|
-
!existsSync(
|
|
249
|
+
!existsSync(path.join(directory, INTERFACE_FILE)) ||
|
|
252
250
|
!existsSync(path.join(directory, MANIFEST_FILE)) ||
|
|
253
251
|
!existsSync(path.join(directory, MANIFEST_DATA_FILE))
|
|
254
252
|
)
|
|
255
253
|
return undefined
|
|
256
|
-
|
|
254
|
+
return sdkImageAt(directory, key, readFileSync(address, 'utf8'))
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function sdkImageAt(directory: string, key: string, sha256: string): SwiftSdkImage {
|
|
257
258
|
const cacheKey = `${directory}\0${sha256}`
|
|
258
259
|
let loadedInterface: SwiftSdkInterface | undefined
|
|
259
260
|
return {
|
|
260
261
|
key,
|
|
261
262
|
directory,
|
|
262
|
-
image,
|
|
263
|
+
image: path.join(directory, IMAGE_FILE),
|
|
263
264
|
sha256,
|
|
264
265
|
get sdkInterface(): SwiftSdkInterface {
|
|
265
266
|
if (loadedInterface) return loadedInterface
|
|
266
267
|
const memo = cachedSdkInterfaces.get(cacheKey)
|
|
267
268
|
if (memo) return (loadedInterface = memo)
|
|
268
|
-
const parsed: SwiftSdkInterface = JSON.parse(
|
|
269
|
+
const parsed: SwiftSdkInterface = JSON.parse(
|
|
270
|
+
readFileSync(path.join(directory, INTERFACE_FILE), 'utf8'),
|
|
271
|
+
)
|
|
269
272
|
return (loadedInterface = setBoundedCache(cachedSdkInterfaces, cacheKey, parsed))
|
|
270
273
|
},
|
|
271
274
|
}
|
|
@@ -337,7 +340,7 @@ export async function buildSwiftSdkImage(
|
|
|
337
340
|
throw new Error(`invalid published Swift SDK image ${key}`)
|
|
338
341
|
rmSync(directory, { recursive: true, force: true })
|
|
339
342
|
renameSync(stage, directory)
|
|
340
|
-
return
|
|
343
|
+
return sdkImageAt(directory, key, image.sha256)
|
|
341
344
|
} finally {
|
|
342
345
|
rmSync(stage, { recursive: true, force: true })
|
|
343
346
|
}
|