peachsim 0.1.2608 → 0.1.2610
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/cli/commands/perf-native.ts +120 -6
- package/cli/drivers/playwright-provisioning.ts +4 -1
- 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 +60485 -60177
- 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-4QDEL7IO.mjs → acorn-L2SFCOHG.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-4C57RZXG.mjs → chunk-2LJTZ2KG.mjs} +17 -328
- package/dist-lib/esm-chunks/{chunk-X6CONUT6.mjs → chunk-42NDD4R7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F724FZHJ.mjs → chunk-73NIGS7D.mjs} +1490 -3950
- package/dist-lib/esm-chunks/{chunk-KNCWQQZG.mjs → chunk-CUBTZPSZ.mjs} +1 -1
- package/dist-lib/esm-chunks/chunk-EU5WMP5O.mjs +322 -0
- package/dist-lib/esm-chunks/{chunk-NXG27NGU.mjs → chunk-EYSNLE5V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IKFFQXJN.mjs → chunk-FP447MCW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JIW4PICV.mjs → chunk-HMTSU22Q.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7KU5ROOE.mjs → chunk-KTAGV5U6.mjs} +14 -12
- package/dist-lib/esm-chunks/{chunk-3DUFAH5J.mjs → chunk-MJP4WOSX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-H3QASOKR.mjs → chunk-MK4DOEDN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZFI5OF6U.mjs → chunk-N3M5KT33.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F2FHFORX.mjs → chunk-N7XU2WWO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UHYHEJ3N.mjs → chunk-RN73P2DY.mjs} +34 -28
- package/dist-lib/esm-chunks/{chunk-VICI67J5.mjs → chunk-VDLPNJ6P.mjs} +1 -1
- package/dist-lib/esm-chunks/chunk-W3LNUIUA.mjs +2655 -0
- package/dist-lib/esm-chunks/{chunk-R25MOOFS.mjs → chunk-WBQFHIGS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YBMBAXAZ.mjs → chunk-WZHEW7Z7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RTXAZMTP.mjs → chunk-X74N3K5N.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-IJX7PBNG.mjs → chunk-XN74REO2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RZLGVWHK.mjs → chunk-YLUD2UET.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BEWJL2LY.mjs → chunk-YVLXYLNV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W5EHCHDD.mjs → chunk-YYGSN3BN.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-GPPOU5DO.mjs → chunk-ZZB2LFYV.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-YWPJI3L6.mjs → metro-layout-parser-VDPXJ7LW.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-MWTLCMQD.mjs → swift-package-prebuilt-HRPDLN2P.mjs} +14 -11
- package/dist-lib/esm-chunks/{swift-sdk-app-module-PF5QMK5X.mjs → swift-sdk-app-module-5DOGMU3M.mjs} +16 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-5IMAACRF.mjs → swift-sdk-image-W3UU4H4L.mjs} +16 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-JPIJI25U.mjs → swift-sdk-image-producer-OJWD6ZOH.mjs} +8 -6
- package/dist-lib/expo-swift-bundle.cjs +42524 -42216
- 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 +43716 -43244
- package/dist-lib/host/fetch-proxy-handler.cjs +670 -645
- 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 +1499 -2889
- package/dist-lib/native-app-identity-project.mjs +317 -339
- 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 +166 -154
- package/dist-lib/public-origins-lib.json +141 -198
- 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 +38979 -38507
- package/dist-lib/swift-compile.cjs +12239 -12121
- package/dist-lib/swift-compile.mjs +36 -33
- 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/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.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/ios/apps/canvas-map-data.d.ts +13 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +3 -0
- package/package.json +1 -1
- package/src/agent-prompt.ts +15 -2
- package/src/binaryen.lock.json +3 -3
- package/src/genrule-archives.ts +5 -2
- package/src/native-framework-compiler.ts +1 -1
- package/src/native-static-libraries.ts +2 -3
- package/src/native-swift-slices.ts +1 -1
- package/src/nitro-dependencies.ts +3 -7
- package/src/one-native-controls-package.ts +165 -11
- package/src/oneNativeControlsContract.ts +1 -0
- package/src/rive-runtime-dependencies.ts +1 -2
- package/src/swift-compile.ts +165 -1796
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-distribution.ts +39 -15
- package/src/swift-objc-compile.ts +194 -32
- package/src/swift-package-manifest.ts +6 -29
- package/src/swift-packages.ts +6 -14
- package/src/swift-sdk-surface.ts +1811 -0
- package/src/swift-standin-digest.ts +28 -5
- package/src/swift-standins.ts +16 -19
- package/src/swift-wasm-archive.ts +200 -0
- package/src/swift-wasm-prune.ts +3 -93
- package/src/swift-wasm64-native-source.ts +4 -2
- package/src/swiftWasm64ConfigContract.ts +10 -0
- package/src/wasm-optimize.ts +18 -14
- package/src/xcode-project.ts +2 -4
|
@@ -8,6 +8,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
8
8
|
import { swiftGuestControls } from '../../peach-globals/build/one-swift-control-source'
|
|
9
9
|
import { oneSDKHost, oneSDKModule, oneSDKTransport } from './one-sdk/source'
|
|
10
10
|
import {
|
|
11
|
+
ONE_NATIVE_CONTROLS_CONTAINER_VIEWS,
|
|
11
12
|
ONE_NATIVE_CONTROLS_CONTRACT,
|
|
12
13
|
ONE_NATIVE_CONTROLS_TAB_VIEW,
|
|
13
14
|
ONE_NATIVE_CONTROLS_NAVIGATION_SPLIT_VIEW,
|
|
@@ -209,6 +210,35 @@ private final class DeferredControl {
|
|
|
209
210
|
}
|
|
210
211
|
}
|
|
211
212
|
|
|
213
|
+
private final class ControlSyncState {
|
|
214
|
+
private static let states = NSMapTable<NSNumber, ControlSyncState>.strongToWeakObjects()
|
|
215
|
+
let id: Int32
|
|
216
|
+
private var revision: Int
|
|
217
|
+
|
|
218
|
+
private init(value: NSObject, revision: Int) {
|
|
219
|
+
self.id = OneNativeSyncRegistry.create(value)
|
|
220
|
+
self.revision = revision
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
deinit { OneNativeSyncRegistry.destroy(id) }
|
|
224
|
+
|
|
225
|
+
static func receive(_ hostID: Int, value: NSObject, revision: Int) -> ControlSyncState {
|
|
226
|
+
let key = NSNumber(value: hostID)
|
|
227
|
+
if let state = states.object(forKey: key) {
|
|
228
|
+
if revision > state.revision {
|
|
229
|
+
state.revision = revision
|
|
230
|
+
if OneNativeSyncRegistry.get(state.id)?.isEqual(value) != true {
|
|
231
|
+
OneNativeSyncRegistry.set(state.id, value: value)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return state
|
|
235
|
+
}
|
|
236
|
+
let state = ControlSyncState(value: value, revision: revision)
|
|
237
|
+
states.setObject(state, forKey: key)
|
|
238
|
+
return state
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
212
242
|
private class ControlComposition {
|
|
213
243
|
private static let reconciledContainers: Set<String> = [
|
|
214
244
|
"OneNativeLazyVStack", "OneNativeLazyHStack", "OneNativeLazyVGrid", "OneNativeLazyHGrid",
|
|
@@ -219,13 +249,17 @@ private class ControlComposition {
|
|
|
219
249
|
var specs: [String: Spec] = [:]
|
|
220
250
|
var children: [String: [UIView]] = [:]
|
|
221
251
|
var slots: [String: UIView] = [:]
|
|
252
|
+
var syncStates: [String: ControlSyncState] = [:]
|
|
253
|
+
var scrollRequestSequences: [String: Int] = [:]
|
|
222
254
|
var emit: ((String, String) -> Void)?
|
|
223
255
|
private var leafMeasure: UIHostingController<AnyView>?
|
|
224
256
|
private var measuredRoot: NSDictionary?
|
|
225
257
|
private var intrinsicWidth: CGFloat?
|
|
226
258
|
|
|
227
|
-
func send(_ id: String, _ event: String, _ fields: Spec) {
|
|
228
|
-
|
|
259
|
+
func send(_ id: String, _ event: String, _ fields: Spec, syncStateID: Int? = nil) {
|
|
260
|
+
var args: [Any] = [id, event, fields]
|
|
261
|
+
if let syncStateID { args.append(syncStateID) }
|
|
262
|
+
let payload = try! JSONSerialization.data(withJSONObject: args)
|
|
229
263
|
emit?("dispatch", String(decoding: payload, as: UTF8.self))
|
|
230
264
|
}
|
|
231
265
|
|
|
@@ -313,12 +347,54 @@ private class ControlComposition {
|
|
|
313
347
|
view = slot
|
|
314
348
|
default:
|
|
315
349
|
guard let mount = guestControls[control] else { preconditionFailure("unsupported One control \\(control)") }
|
|
316
|
-
|
|
317
|
-
|
|
350
|
+
let previous = specs[id]
|
|
351
|
+
if let existing = views[id], let previous, (previous as NSDictionary).isEqual(to: spec) {
|
|
352
|
+
view = existing
|
|
353
|
+
} else {
|
|
354
|
+
var guestSpec = spec
|
|
355
|
+
var syncStateID: Int?
|
|
356
|
+
if let hostID = spec["syncStateId"] as? Int, hostID != 0,
|
|
357
|
+
let snapshot = spec["syncState"] as? Spec,
|
|
358
|
+
let value = snapshot["value"] as? NSObject,
|
|
359
|
+
let revision = snapshot["revision"] as? Int {
|
|
360
|
+
let state = ControlSyncState.receive(hostID, value: value, revision: revision)
|
|
361
|
+
syncStates[id] = state
|
|
362
|
+
guestSpec["syncStateId"] = Int(state.id)
|
|
363
|
+
guestSpec["value"] = OneNativeSyncRegistry.get(state.id)
|
|
364
|
+
syncStateID = hostID
|
|
365
|
+
} else {
|
|
366
|
+
syncStates.removeValue(forKey: id)
|
|
367
|
+
guestSpec.removeValue(forKey: "syncStateId")
|
|
368
|
+
}
|
|
369
|
+
view = mount(views[id], guestSpec, previous, style) { [weak self] event, fields, sync in
|
|
370
|
+
self?.send(id, event, fields, syncStateID: sync ? syncStateID : nil)
|
|
371
|
+
}
|
|
372
|
+
specs[id] = spec
|
|
373
|
+
}
|
|
318
374
|
}
|
|
319
375
|
views[id] = view
|
|
376
|
+
if let host = node["contentHost"] as? String {
|
|
377
|
+
let slot = slots[id] ?? UIView(frame: .zero)
|
|
378
|
+
slot._peachReactContentHost = host
|
|
379
|
+
let layout: (CGRect) -> Void = { [weak self] frame in
|
|
380
|
+
self?.send(id, "onNativeLayout", ["x": frame.minX, "y": frame.minY, "width": frame.width, "height": frame.height])
|
|
381
|
+
}
|
|
382
|
+
if let sheet = view as? OneNativeSheetView {
|
|
383
|
+
if slots[id] == nil { sheet.mountContent(slot, onLayout: layout) }
|
|
384
|
+
sheet.setMeasuredHeight(spec["measuredHeight"] as? CGFloat ?? 0)
|
|
385
|
+
}
|
|
386
|
+
if let popover = view as? OneNativePopoverView {
|
|
387
|
+
if slots[id] == nil { popover.mountContent(slot, onLayout: layout) }
|
|
388
|
+
let measured = spec["contentSize"] as? Spec
|
|
389
|
+
popover.setMeasuredSize(CGSize(
|
|
390
|
+
width: measured?["width"] as? CGFloat ?? 0,
|
|
391
|
+
height: measured?["height"] as? CGFloat ?? 0
|
|
392
|
+
))
|
|
393
|
+
}
|
|
394
|
+
slots[id] = slot
|
|
395
|
+
}
|
|
320
396
|
if let container = view as? OneNativeContainerView {
|
|
321
|
-
container.configureSwiftStyle(style)
|
|
397
|
+
if !(container is OneNativePopoverView) { container.configureSwiftStyle(style) }
|
|
322
398
|
container.onSwiftStyleEvent = visit
|
|
323
399
|
let nodes = node["children"] as? [Spec] ?? []
|
|
324
400
|
if Self.reconciledContainers.contains(control) {
|
|
@@ -344,6 +420,22 @@ private class ControlComposition {
|
|
|
344
420
|
} else if let container = view as? OneGuestIncrementalContainer {
|
|
345
421
|
placeIncrementally(node, id: id, visited: &visited, remove: container.removeChild, insert: container.insertChild)
|
|
346
422
|
}
|
|
423
|
+
if let reader = view as? OneNativeScrollViewReaderView,
|
|
424
|
+
let requests = spec["scrollRequests"] as? [Spec], !requests.isEmpty {
|
|
425
|
+
let previous = scrollRequestSequences[id] ?? 0
|
|
426
|
+
var latest = previous
|
|
427
|
+
for request in requests {
|
|
428
|
+
let sequence = request["sequence"] as! Int
|
|
429
|
+
if sequence <= latest { continue }
|
|
430
|
+
reader.scrollTo(request["id"] as! String, hasAnchor: request["hasAnchor"] as! Bool,
|
|
431
|
+
anchorX: request["x"] as! Double, anchorY: request["y"] as! Double)
|
|
432
|
+
latest = sequence
|
|
433
|
+
}
|
|
434
|
+
if latest != previous {
|
|
435
|
+
scrollRequestSequences[id] = latest
|
|
436
|
+
send(id, "scrollRequestsConsumed", ["sequence": latest])
|
|
437
|
+
}
|
|
438
|
+
}
|
|
347
439
|
return view
|
|
348
440
|
}
|
|
349
441
|
|
|
@@ -377,26 +469,42 @@ private class ControlComposition {
|
|
|
377
469
|
for (id, view) in views where !visited.contains(id) {
|
|
378
470
|
if let container = view as? OneNativeContainerView { container.reset() }
|
|
379
471
|
if let container = view as? OneGuestIncrementalContainer { container.reset() }
|
|
472
|
+
if let sheet = view as? OneNativeSheetView {
|
|
473
|
+
if let slot = slots[id] { sheet.unmountContent(slot) }
|
|
474
|
+
sheet.reset()
|
|
475
|
+
}
|
|
476
|
+
if let alert = view as? OneNativeAlertView { alert.reset() }
|
|
380
477
|
views.removeValue(forKey: id)
|
|
381
478
|
specs.removeValue(forKey: id)
|
|
382
479
|
children.removeValue(forKey: id)
|
|
383
480
|
slots.removeValue(forKey: id)
|
|
481
|
+
syncStates.removeValue(forKey: id)
|
|
482
|
+
scrollRequestSequences.removeValue(forKey: id)
|
|
384
483
|
}
|
|
385
484
|
}
|
|
386
485
|
}
|
|
387
486
|
|
|
388
487
|
private struct ControlBridge: UIViewRepresentable {
|
|
389
488
|
let root: Spec
|
|
489
|
+
let source: String
|
|
390
490
|
let emit: (String, String) -> Void
|
|
391
491
|
let measureWidth: Bool
|
|
392
492
|
|
|
393
|
-
|
|
493
|
+
final class Coordinator: ControlComposition {
|
|
494
|
+
var source: String?
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
func makeCoordinator() -> Coordinator { Coordinator() }
|
|
394
498
|
|
|
395
499
|
func makeUIView(context: Context) -> UIView { UIView(frame: .zero) }
|
|
396
500
|
|
|
501
|
+
// the composition is a function of the props alone; a render of the root
|
|
502
|
+
// for state below it reconfigures nothing
|
|
397
503
|
func updateUIView(_ host: UIView, context: Context) {
|
|
398
504
|
let state = context.coordinator
|
|
399
505
|
state.emit = emit
|
|
506
|
+
guard state.source != source else { return }
|
|
507
|
+
state.source = source
|
|
400
508
|
var visited = Set<String>()
|
|
401
509
|
let control = state.render(root, visited: &visited)
|
|
402
510
|
if measureWidth { state.measureLeafWidth(control, root: root) }
|
|
@@ -409,7 +517,7 @@ private struct ControlBridge: UIViewRepresentable {
|
|
|
409
517
|
state.prune(keeping: visited)
|
|
410
518
|
}
|
|
411
519
|
|
|
412
|
-
static func dismantleUIView(_ host: UIView, coordinator:
|
|
520
|
+
static func dismantleUIView(_ host: UIView, coordinator: Coordinator) {
|
|
413
521
|
host.subviews.forEach { $0.removeFromSuperview() }
|
|
414
522
|
coordinator.prune(keeping: [])
|
|
415
523
|
coordinator.emit = nil
|
|
@@ -785,6 +893,23 @@ private func frameFields(_ frame: CGRect) -> Spec {
|
|
|
785
893
|
["x": frame.minX, "y": frame.minY, "width": frame.width, "height": frame.height]
|
|
786
894
|
}
|
|
787
895
|
|
|
896
|
+
// every render of a root rebuilds its typed view from the props text it
|
|
897
|
+
// mounted, so each distinct text parses once while the cache stays in budget
|
|
898
|
+
@MainActor private var parsedProps: [String: Spec] = [:]
|
|
899
|
+
@MainActor private var parsedPropsBytes = 0
|
|
900
|
+
|
|
901
|
+
@MainActor private func controlProps(_ text: String) -> Spec {
|
|
902
|
+
if let spec = parsedProps[text] { return spec }
|
|
903
|
+
if parsedPropsBytes + text.utf8.count > 16 << 20 {
|
|
904
|
+
parsedProps.removeAll()
|
|
905
|
+
parsedPropsBytes = 0
|
|
906
|
+
}
|
|
907
|
+
let spec = try! JSONSerialization.jsonObject(with: Data(text.utf8)) as! Spec
|
|
908
|
+
parsedProps[text] = spec
|
|
909
|
+
parsedPropsBytes += text.utf8.count
|
|
910
|
+
return spec
|
|
911
|
+
}
|
|
912
|
+
|
|
788
913
|
@_expose(wasm, "peach_register_views")
|
|
789
914
|
@_cdecl("peach_register_views")
|
|
790
915
|
@MainActor public func peach_register_views() {
|
|
@@ -793,7 +918,7 @@ private func frameFields(_ frame: CGRect) -> Spec {
|
|
|
793
918
|
contract == "${ONE_NATIVE_CONTROLS_CONTRACT}",
|
|
794
919
|
"unexpected compiled One control request \\(view) / \\(contract)"
|
|
795
920
|
)
|
|
796
|
-
let spec =
|
|
921
|
+
let spec = controlProps(props)
|
|
797
922
|
switch view {
|
|
798
923
|
case "${ONE_NATIVE_CONTROLS_NAVIGATION_STACK_VIEW}":
|
|
799
924
|
return AnyView(NavigationStackBridge(spec: spec, emit: emit)
|
|
@@ -809,7 +934,7 @@ private func frameFields(_ frame: CGRect) -> Spec {
|
|
|
809
934
|
default:
|
|
810
935
|
let root = spec["root"] as! Spec
|
|
811
936
|
precondition((root["spec"] as? Spec)?["control"] as? String == view)
|
|
812
|
-
let bridge = ControlBridge(root: root, emit: emit, measureWidth: spec["measureWidth"] as? Bool == true)
|
|
937
|
+
let bridge = ControlBridge(root: root, source: props, emit: emit, measureWidth: spec["measureWidth"] as? Bool == true)
|
|
813
938
|
.frame(minWidth: 0, maxWidth: .infinity, maxHeight: .infinity)
|
|
814
939
|
let height = (spec["height"] as? Double).map { CGFloat($0) }
|
|
815
940
|
return AnyView(bridge.frame(height: height))
|
|
@@ -1013,10 +1138,39 @@ export async function oneNativeControlsPackage(
|
|
|
1013
1138
|
'OneNativeText',
|
|
1014
1139
|
'OneNativeImage',
|
|
1015
1140
|
...ONE_NATIVE_CONTROLS_VISUAL_VIEWS,
|
|
1016
|
-
'
|
|
1141
|
+
'OneNativeChart',
|
|
1017
1142
|
'OneNativeProgressView',
|
|
1143
|
+
'OneNativeGauge',
|
|
1144
|
+
'OneNativeCanvas',
|
|
1145
|
+
...ONE_NATIVE_CONTROLS_CONTAINER_VIEWS,
|
|
1146
|
+
'OneNativeSection',
|
|
1147
|
+
'OneNativeLabeledContent',
|
|
1148
|
+
'OneNativeDisclosureGroup',
|
|
1149
|
+
'OneNativePicker',
|
|
1150
|
+
'OneNativeToggle',
|
|
1151
|
+
'OneNativeTextField',
|
|
1152
|
+
'OneNativeSecureField',
|
|
1153
|
+
'OneNativeTextEditor',
|
|
1154
|
+
'OneNativeSlider',
|
|
1155
|
+
'OneNativeStepper',
|
|
1156
|
+
'OneNativeDatePicker',
|
|
1157
|
+
'OneNativeColorPicker',
|
|
1158
|
+
'OneNativeMultiDatePicker',
|
|
1159
|
+
'OneNativeSwipeActions',
|
|
1160
|
+
'OneNativeSwipeActionsActions',
|
|
1161
|
+
'OneNativeOverlay',
|
|
1162
|
+
'OneNativeOverlayContent',
|
|
1018
1163
|
'OneNativeSpacer',
|
|
1019
|
-
'
|
|
1164
|
+
'OneNativeRectangle',
|
|
1165
|
+
'OneNativeRoundedRectangle',
|
|
1166
|
+
'OneNativeCapsule',
|
|
1167
|
+
'OneNativeEmptyView',
|
|
1168
|
+
'OneNativeLazyVGrid',
|
|
1169
|
+
'OneNativeLazyHGrid',
|
|
1170
|
+
'OneNativeContentUnavailableView',
|
|
1171
|
+
'OneNativeSheet',
|
|
1172
|
+
'OneNativePopover',
|
|
1173
|
+
'OneNativeAlert',
|
|
1020
1174
|
],
|
|
1021
1175
|
linkedGroups,
|
|
1022
1176
|
)
|
|
@@ -6,10 +6,9 @@ import path from 'node:path'
|
|
|
6
6
|
import { setTimeout as sleep } from 'node:timers/promises'
|
|
7
7
|
import { cacheDir } from './home-paths'
|
|
8
8
|
import { tryAcquireNumberedLock } from './numbered-lock'
|
|
9
|
-
import { swiftSdkPaths } from './swift-compile'
|
|
10
|
-
import { swiftModuleToolchain } from './swift-distribution'
|
|
11
9
|
import { swiftObjCRuntimeFlags } from './swift-objc-runtime'
|
|
12
10
|
import { objcSdkIntakeFlags } from './swift-objc-standin'
|
|
11
|
+
import { swiftModuleToolchain, swiftSdkPaths } from './swift-sdk-surface'
|
|
13
12
|
import { SWIFT_WASM_TRIPLE, wasmThreadFlags } from './swiftTargetContract'
|
|
14
13
|
|
|
15
14
|
const RECIPE = 'rive-runtime-sim-2'
|