peachsim 0.1.2723 → 0.1.2725

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.
Files changed (133) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +57 -36
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-F3M2TKUX.mjs → acorn-W726S2IA.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-Y77FZJW2.mjs → chunk-2MNFO56N.mjs} +49 -35
  28. package/dist-lib/esm-chunks/{chunk-7XGUQL4X.mjs → chunk-3GTV2LCM.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-CQJV4EVW.mjs → chunk-3TIJK5UZ.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-K3CU2YXT.mjs → chunk-76CDSQWP.mjs} +6 -6
  31. package/dist-lib/esm-chunks/{chunk-DZXB5BJN.mjs → chunk-7F5LC43J.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-ZQU5WPTG.mjs → chunk-AAQ2DFPN.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-AUTMC3QD.mjs → chunk-BTLEW436.mjs} +7 -8
  34. package/dist-lib/esm-chunks/{chunk-3IU4EP2Z.mjs → chunk-BWMTXR6G.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-SIULKQAK.mjs → chunk-D5RGF7UF.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-S3GS24G6.mjs → chunk-FV4DZWYD.mjs} +5 -5
  37. package/dist-lib/esm-chunks/{chunk-ZKW75WRX.mjs → chunk-H73GWF5E.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-LIC5LYQJ.mjs → chunk-HM2MXBOG.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-GVSWDVPL.mjs → chunk-HMROXN4Q.mjs} +3 -3
  40. package/dist-lib/esm-chunks/{chunk-N5UND445.mjs → chunk-JZDAJZBB.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-EYSRTHK7.mjs → chunk-LWQTRRI2.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-HA2OAZT5.mjs → chunk-MGH6TFFZ.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-BGHKJMLZ.mjs → chunk-MWBFM6BI.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-S7SEZPUJ.mjs → chunk-NRIEADO4.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-IAV5XLVR.mjs → chunk-QRILDJ7M.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-RHEMYORC.mjs → chunk-UQ2MSEVY.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-PHPSRPSE.mjs → chunk-WII6ZXAJ.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-TGO6L4RG.mjs → chunk-YCHKJV7N.mjs} +4 -4
  49. package/dist-lib/esm-chunks/{chunk-T7IPZWTL.mjs → chunk-YKJUNRZF.mjs} +2 -2
  50. package/dist-lib/esm-chunks/{chunk-G4DCGHYZ.mjs → chunk-YX5GEVDN.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-KDQ4RWIN.mjs → metro-layout-parser-5TW7JPFC.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-KBXU457K.mjs → swift-package-prebuilt-PQXBXXR2.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-23DEMHHZ.mjs → swift-sdk-app-module-6HBBAK2W.mjs} +33 -24
  54. package/dist-lib/esm-chunks/{swift-sdk-image-ER4ESBTD.mjs → swift-sdk-image-XGU4LD2J.mjs} +16 -18
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-FZRGEKOY.mjs → swift-sdk-image-producer-CMFC7NVM.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +57 -36
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +254 -48
  61. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +64 -64
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +254 -48
  95. package/dist-lib/swift-compile.cjs +54 -33
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +0 -2
  123. package/dist-types/packages/peach-engine/src/engine/native-text-measure.d.ts +3 -6
  124. package/dist-types/packages/peach-engine/src/engine/native-text-metric-policy.d.ts +1 -1
  125. package/dist-types/packages/peach-engine/src/engine/native-text-runtimeContract.d.ts +0 -5
  126. package/package.json +1 -1
  127. package/src/binaryen.lock.json +1 -1
  128. package/src/one-direct-host-source.ts +194 -10
  129. package/src/one-native-controls-package.ts +81 -36
  130. package/src/swift-compile.ts +35 -18
  131. package/src/swift-sdk-app-module.ts +22 -10
  132. package/src/swift-sdk-image.ts +1 -1
  133. package/src/swiftSdkLinkContract.ts +2 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2723 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2725 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -36019,7 +36019,7 @@ var init_swift_objc_sdk_tree = __esm({
36019
36019
 
36020
36020
  // src/swift-compiler-digest.ts
36021
36021
  function swiftArchiveCompilerDigestValue() {
36022
- return true ? "a5e00b0798f4f309d01d9e64e8aef4ce6ccb61c076e11617556a116eec890a6c" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
36022
+ return true ? "f104a6c94890ebd260039267b97161f7fa2e9d835e447a54dcc8f8603c9af43f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
36023
36023
  }
36024
36024
  var import_node_crypto11, import_node_fs27, import_node_path25, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
36025
36025
  var init_swift_compiler_digest = __esm({
@@ -36170,7 +36170,7 @@ var init_swift_standin_digest = __esm({
36170
36170
 
36171
36171
  // src/expo-native-compiler-digest.ts
36172
36172
  function expoNativeCompilerDigestValue() {
36173
- return true ? "dd83e9c30fee5c97e767ecb9f63c6bec77ad8438a8313718d1927d1a4f6fab43" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
36173
+ return true ? "37d83cb2b8c56fbb0e3999894956a5bd4fdd65e23a4734c4ae58fb86358d8f3a" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
36174
36174
  }
36175
36175
  var import_node_crypto13;
36176
36176
  var init_expo_native_compiler_digest = __esm({
@@ -59690,11 +59690,12 @@ var init_swift_sdk_image_map = __esm({
59690
59690
  });
59691
59691
 
59692
59692
  // src/swiftSdkLinkContract.ts
59693
- var SWIFT_SDK_FUNCTION_ADDRESS_PREFIX, OBJC_LOAD_FUNCTION;
59693
+ var SWIFT_SDK_FUNCTION_ADDRESS_PREFIX, SWIFT_SDK_APP_TABLE_BASE, OBJC_LOAD_FUNCTION;
59694
59694
  var init_swiftSdkLinkContract = __esm({
59695
59695
  "src/swiftSdkLinkContract.ts"() {
59696
59696
  "use strict";
59697
59697
  SWIFT_SDK_FUNCTION_ADDRESS_PREFIX = "__peach_sdk_function_address.";
59698
+ SWIFT_SDK_APP_TABLE_BASE = 524288;
59698
59699
  OBJC_LOAD_FUNCTION = ".objcv2_load_function";
59699
59700
  }
59700
59701
  });
@@ -67046,7 +67047,7 @@ var init_binaryen_lock = __esm({
67046
67047
  "darwin-arm64": {
67047
67048
  asset: "arm64-macos",
67048
67049
  upstreamSha256: "98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa",
67049
- sha256: "29342632a4fa52466c4feea846698fe5aa56ff46226a914d60b65b8735373d63"
67050
+ sha256: "2cadf6373604091be7784a1dde396ccbe67964e9a5ddb40be19bb52d65cb23b7"
67050
67051
  }
67051
67052
  }
67052
67053
  };
@@ -74341,7 +74342,6 @@ exit "$status"
74341
74342
  var swift_sdk_image_exports = {};
74342
74343
  __export(swift_sdk_image_exports, {
74343
74344
  SWIFT_SDK_APP_MEMORY_BASE: () => SWIFT_SDK_APP_MEMORY_BASE,
74344
- SWIFT_SDK_APP_TABLE_BASE: () => SWIFT_SDK_APP_TABLE_BASE,
74345
74345
  SWIFT_SDK_IMAGE_BUNDLE: () => SWIFT_SDK_IMAGE_BUNDLE,
74346
74346
  SWIFT_SDK_IMAGE_FILES: () => SWIFT_SDK_IMAGE_FILES,
74347
74347
  SWIFT_SDK_MEMORY_BASE: () => SWIFT_SDK_MEMORY_BASE,
@@ -75013,7 +75013,7 @@ function readSwiftSdkManifest(image) {
75013
75013
  }));
75014
75014
  return setBoundedCache(cachedSdkManifests, cacheKey, { manifest, block: block2, segments });
75015
75015
  }
75016
- var import_node_child_process39, import_node_crypto45, import_node_fs75, import_node_path73, import_node_util10, run5, SWIFT_SDK_APP_MEMORY_BASE, SWIFT_SDK_MEMORY_BASE, SWIFT_SDK_APP_TABLE_BASE, EMPTY_APP, IMAGE_TABLES, IMAGE_ENTRY, imageApp, IMAGE_FILE, IMAGE_DIGEST, swiftSdkImageFile, INTERFACE_FILE, MANIFEST_FILE, MANIFEST_DATA_FILE, SWIFT_SDK_IMAGE_FILES, SWIFT_SDK_IMAGE_BUNDLE, MAX_CACHED_SDK_IMAGES, cachedSdkInterfaces, cachedSdkManifestIndices, cachedSdkManifests, SWIFT_SDK_PIECE_FIELDS, MANIFEST_BLOCKS, isManifestBlock;
75016
+ var import_node_child_process39, import_node_crypto45, import_node_fs75, import_node_path73, import_node_util10, run5, SWIFT_SDK_APP_MEMORY_BASE, SWIFT_SDK_MEMORY_BASE, EMPTY_APP, IMAGE_TABLES, IMAGE_ENTRY, imageApp, IMAGE_FILE, IMAGE_DIGEST, swiftSdkImageFile, INTERFACE_FILE, MANIFEST_FILE, MANIFEST_DATA_FILE, SWIFT_SDK_IMAGE_FILES, SWIFT_SDK_IMAGE_BUNDLE, MAX_CACHED_SDK_IMAGES, cachedSdkInterfaces, cachedSdkManifestIndices, cachedSdkManifests, SWIFT_SDK_PIECE_FIELDS, MANIFEST_BLOCKS, isManifestBlock;
75017
75017
  var init_swift_sdk_image = __esm({
75018
75018
  "src/swift-sdk-image.ts"() {
75019
75019
  "use strict";
@@ -75034,12 +75034,12 @@ var init_swift_sdk_image = __esm({
75034
75034
  init_swift_sdk_image_wasm();
75035
75035
  init_swift_toolchain();
75036
75036
  init_swift_wasm_prune();
75037
+ init_swiftSdkLinkContract();
75037
75038
  init_swiftTargetContract();
75038
75039
  init_wasm_optimize();
75039
75040
  run5 = (0, import_node_util10.promisify)(import_node_child_process39.execFile);
75040
75041
  SWIFT_SDK_APP_MEMORY_BASE = 8372224;
75041
75042
  SWIFT_SDK_MEMORY_BASE = 128 * 1024 * 1024;
75042
- SWIFT_SDK_APP_TABLE_BASE = 524288;
75043
75043
  EMPTY_APP = `import SwiftUI
75044
75044
 
75045
75045
  @main
@@ -75300,7 +75300,6 @@ __export(swift_sdk_app_module_exports, {
75300
75300
  linkSwiftAppModule: () => linkSwiftAppModule,
75301
75301
  readSwiftSdkAppLink: () => readSwiftSdkAppLink,
75302
75302
  readSwiftSdkUsage: () => readSwiftSdkUsage,
75303
- selectSwiftSdkData: () => selectSwiftSdkData,
75304
75303
  swiftAppModuleInputs: () => swiftAppModuleInputs,
75305
75304
  swiftAppModuleThunkSection: () => swiftAppModuleThunkSection,
75306
75305
  swiftSdkProjectionSpans: () => swiftSdkProjectionSpans,
@@ -76295,12 +76294,11 @@ function readSwiftSdkAppLink(file) {
76295
76294
  return JSON.parse((0, import_node_zlib5.gunzipSync)((0, import_node_fs76.readFileSync)(file)).toString("utf8"));
76296
76295
  }
76297
76296
  function createSwiftSdkBinding(linkage, sdk2, usage, projection) {
76298
- const bytes = Buffer.concat([
76299
- bindSwiftAppModule(linkage, sdk2),
76300
- selectSwiftSdkData(sdk2, usage, linkage, projection)
76301
- ]);
76297
+ const binding = bindSwiftAppModule(linkage, sdk2);
76298
+ const { data, liveSlots } = selectSwiftSdkData(sdk2, usage, linkage, projection);
76299
+ const bytes = Buffer.concat([binding, data]);
76302
76300
  const sha2565 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto46.createHash)("sha256").update(bytes).digest("hex");
76303
- return { bytes, sha256: sha2565 };
76301
+ return { bytes, sha256: sha2565, liveSlots };
76304
76302
  }
76305
76303
  function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
76306
76304
  const map2 = readWasmLinkMap(mapFile, false);
@@ -76830,7 +76828,18 @@ function selectSwiftSdkData(sdk2, usage, linkage, projection) {
76830
76828
  blob.set(run18.bytes, at + 12);
76831
76829
  at += 12 + run18.bytes.length;
76832
76830
  }
76833
- return blob;
76831
+ const selected = new Set(boundSlots);
76832
+ slots.forEach((slot, index) => {
76833
+ if (slot && liveFunctions[index]) selected.add(slot);
76834
+ });
76835
+ const liveSlots = Buffer.alloc((selected.size + 1) * 4);
76836
+ liveSlots.writeUInt32LE(selected.size, 0);
76837
+ let slotOffset = 4;
76838
+ for (const slot of selected) {
76839
+ liveSlots.writeUInt32LE(slot, slotOffset);
76840
+ slotOffset += 4;
76841
+ }
76842
+ return { data: blob, liveSlots };
76834
76843
  }
76835
76844
  function partitionParent(section2) {
76836
76845
  return [
@@ -82494,14 +82503,17 @@ function readCompiledArtifact(directory2, hash) {
82494
82503
  return null;
82495
82504
  if (!("sdk" in receipt)) return null;
82496
82505
  const image = receipt.sdk;
82497
- if (!isRecord(image) || typeof image.key !== "string" || typeof image.sha256 !== "string" || typeof image.binding !== "string")
82506
+ if (!isRecord(image) || typeof image.key !== "string" || typeof image.sha256 !== "string" || typeof image.binding !== "string" || typeof image.liveSlots !== "string")
82498
82507
  return null;
82499
82508
  const binding = (0, import_node_fs84.readFileSync)(import_node_path84.default.join(directory2, "sdk-binding.bin"));
82500
82509
  if ((0, import_node_crypto51.createHash)("sha256").update(binding).digest("hex") !== image.binding) return null;
82510
+ const liveSlots = (0, import_node_fs84.readFileSync)(import_node_path84.default.join(directory2, "sdk-live-slots.bin"));
82511
+ if ((0, import_node_crypto51.createHash)("sha256").update(liveSlots).digest("hex") !== image.liveSlots)
82512
+ return null;
82501
82513
  const sdk2 = {
82502
82514
  key: image.key,
82503
82515
  sha256: image.sha256,
82504
- binding: { bytes: binding, sha256: image.binding }
82516
+ binding: { bytes: binding, sha256: image.binding, liveSlots }
82505
82517
  };
82506
82518
  return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 }, sdk: sdk2 };
82507
82519
  } catch (error) {
@@ -82517,8 +82529,13 @@ function saveCompiledArtifact(root, artifact) {
82517
82529
  try {
82518
82530
  (0, import_node_fs84.writeFileSync)(import_node_path84.default.join(pending2, "app.wasm"), artifact.bytes);
82519
82531
  (0, import_node_fs84.writeFileSync)(import_node_path84.default.join(pending2, "icu.gz"), artifact.icu.gzip);
82520
- if (artifact.sdk)
82532
+ if (artifact.sdk) {
82521
82533
  (0, import_node_fs84.writeFileSync)(import_node_path84.default.join(pending2, "sdk-binding.bin"), artifact.sdk.binding.bytes);
82534
+ (0, import_node_fs84.writeFileSync)(
82535
+ import_node_path84.default.join(pending2, "sdk-live-slots.bin"),
82536
+ artifact.sdk.binding.liveSlots
82537
+ );
82538
+ }
82522
82539
  (0, import_node_fs84.writeFileSync)(
82523
82540
  import_node_path84.default.join(pending2, "artifact.json"),
82524
82541
  JSON.stringify({
@@ -82528,12 +82545,13 @@ function saveCompiledArtifact(root, artifact) {
82528
82545
  sdk: artifact.sdk && {
82529
82546
  key: artifact.sdk.key,
82530
82547
  sha256: artifact.sdk.sha256,
82531
- binding: artifact.sdk.binding.sha256
82548
+ binding: artifact.sdk.binding.sha256,
82549
+ liveSlots: (0, import_node_crypto51.createHash)("sha256").update(artifact.sdk.binding.liveSlots).digest("hex")
82532
82550
  }
82533
82551
  })
82534
82552
  );
82535
82553
  const outputs = ["app.wasm", "icu.gz"];
82536
- if (artifact.sdk) outputs.push("sdk-binding.bin");
82554
+ if (artifact.sdk) outputs.push("sdk-binding.bin", "sdk-live-slots.bin");
82537
82555
  for (const file of [...outputs, "artifact.json"]) {
82538
82556
  (0, import_node_fs84.renameSync)(import_node_path84.default.join(pending2, file), import_node_path84.default.join(directory2, file));
82539
82557
  }
@@ -83457,10 +83475,7 @@ function stageFrameworkSource(moduleRoot, slot, frameworkKey, release) {
83457
83475
  import_node_path84.default.join(staged, "packages/peachsim/sdk/ios")
83458
83476
  );
83459
83477
  if (moduleRestructured || sdkRestructured || hadKey === null) {
83460
- (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, "release.yaml"), { force: true });
83461
- (0, import_node_fs84.rmSync)(import_node_path84.default.join(slot, WASM_TRIPLE, "release", "description.json"), {
83462
- force: true
83463
- });
83478
+ retireSwiftBuildPlan(slot);
83464
83479
  }
83465
83480
  for (const file of swiftModuleInputFiles(moduleRoot)) {
83466
83481
  if (!file.startsWith("../")) continue;
@@ -83525,7 +83540,12 @@ ${args.prebuilt.modules}
83525
83540
  ${statOf(import_node_path84.default.join(args.prebuilt.modules, entry))}`);
83526
83541
  return hash.digest("hex");
83527
83542
  }
83543
+ function retireSwiftBuildPlan(scratch2) {
83544
+ (0, import_node_fs84.rmSync)(import_node_path84.default.join(scratch2, "release.yaml"), { force: true });
83545
+ (0, import_node_fs84.rmSync)(import_node_path84.default.join(scratch2, WASM_TRIPLE, "release", "description.json"), { force: true });
83546
+ }
83528
83547
  function retireSwiftLinkTargets(retired) {
83548
+ retireSwiftBuildPlan(retired);
83529
83549
  for (const name3 of [
83530
83550
  "ModuleCache",
83531
83551
  "peach-product-checkpoints",
@@ -83557,20 +83577,21 @@ function retireStaleSwiftLink(root, baseStamp, stamp, preserveClangObjects = fal
83557
83577
  } catch (error) {
83558
83578
  if (!vanished(error)) throw error;
83559
83579
  }
83560
- (0, import_node_fs84.mkdirSync)(root, { recursive: true });
83561
83580
  const combined = `${baseStamp}
83562
- ${stamp}`;
83563
- (0, import_node_fs84.writeFileSync)(receipt, `${combined}
83564
- `);
83581
+ ${preserveClangObjects ? "swift-targets-v2\n" : ""}${stamp}`;
83582
+ if (previous === combined) return false;
83565
83583
  const retired = import_node_path84.default.join(root, ".build");
83566
- if (previous === combined || !(0, import_node_fs84.existsSync)(retired)) return false;
83584
+ const hadBuild = (0, import_node_fs84.existsSync)(retired);
83567
83585
  const [previousBase] = previous?.split("\n") ?? [];
83568
- if (preserveClangObjects && previousBase === baseStamp) {
83569
- retireSwiftLinkTargets(retired);
83570
- return true;
83586
+ if (hadBuild) {
83587
+ if (preserveClangObjects && previousBase === baseStamp)
83588
+ retireSwiftLinkTargets(retired);
83589
+ else (0, import_node_fs84.rmSync)(retired, { recursive: true, force: true });
83571
83590
  }
83572
- (0, import_node_fs84.rmSync)(retired, { recursive: true, force: true });
83573
- return true;
83591
+ (0, import_node_fs84.mkdirSync)(root, { recursive: true });
83592
+ (0, import_node_fs84.writeFileSync)(receipt, `${combined}
83593
+ `);
83594
+ return hadBuild;
83574
83595
  }
83575
83596
  async function compileSwiftProjectUnit(input, options2) {
83576
83597
  for (let attempt = 1; ; attempt++) {
@@ -84597,7 +84618,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
84597
84618
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
84598
84619
  MULTI_MANIFEST_VERSION = 76;
84599
84620
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
84600
- compilerSourceDigest = true ? "0f4683a0a52c52745cf2a25c5bb0d3b8d33c6c65616c018a0b91a1661ac1b6aa" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84621
+ compilerSourceDigest = true ? "65c18cf90c6d5327457dfe6ae7fe052f0acac7fb60d8df897cbd58095efd6c7f" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
84601
84622
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
84602
84623
  MODULE_MAP_RESPONSE_FILE_RUN = 16;
84603
84624
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
@@ -142781,6 +142802,110 @@ public final class PeachOneDirectStage: NSObject {
142781
142802
  }
142782
142803
  }
142783
142804
 
142805
+ @MainActor
142806
+ private final class PeachDirectSwipeConfiguration: ObservableObject {
142807
+ struct Action: Identifiable {
142808
+ let id: Int
142809
+ let title: String
142810
+ let symbol: String?
142811
+ let destructive: Bool
142812
+ let tint: UIColor?
142813
+ }
142814
+
142815
+ struct Edge {
142816
+ var actions: [Action] = []
142817
+ var fullSwipe = false
142818
+
142819
+ init(_ items: [[String: Any]] = [], fullSwipe: Bool = false) {
142820
+ self.fullSwipe = fullSwipe
142821
+ actions = items.enumerated().map { index, item in
142822
+ Action(id: index, title: item["title"] as? String ?? "", symbol: item["systemImage"] as? String,
142823
+ destructive: item["destructive"] as? Bool ?? false, tint: item["color"] as? UIColor)
142824
+ }
142825
+ }
142826
+ }
142827
+
142828
+ struct Edges {
142829
+ var leading = Edge()
142830
+ var trailing = Edge()
142831
+ }
142832
+
142833
+ @Published var edges = Edges()
142834
+ var emit: ((String, NSDictionary) -> Void)?
142835
+ }
142836
+
142837
+ @MainActor
142838
+ private struct PeachDirectSwipeRow: View {
142839
+ @ObservedObject var configuration: PeachDirectSwipeConfiguration
142840
+ @ObservedObject var children: OneNativeChildren
142841
+
142842
+ var body: some View {
142843
+ Group {
142844
+ ForEach(children.items) { child in child.content }
142845
+ }
142846
+ .swipeActions(edge: .leading, allowsFullSwipe: configuration.edges.leading.fullSwipe) {
142847
+ buttons(configuration.edges.leading, edge: "leading")
142848
+ }
142849
+ .swipeActions(edge: .trailing, allowsFullSwipe: configuration.edges.trailing.fullSwipe) {
142850
+ buttons(configuration.edges.trailing, edge: "trailing")
142851
+ }
142852
+ }
142853
+
142854
+ @ViewBuilder
142855
+ private func buttons(_ group: PeachDirectSwipeConfiguration.Edge, edge: String) -> some View {
142856
+ ForEach(group.actions) { action in
142857
+ let role: ButtonRole? = action.destructive ? .destructive : nil
142858
+ let activate: () -> Void = { configuration.emit?("action", ["edge": edge, "index": action.id]) }
142859
+ let tint = action.tint.map { Color(uiColor: $0) }
142860
+ if let symbol = action.symbol {
142861
+ Button(action.title, systemImage: symbol, role: role, action: activate).tint(tint)
142862
+ } else {
142863
+ Button(action.title, role: role, action: activate).tint(tint)
142864
+ }
142865
+ }
142866
+ }
142867
+ }
142868
+
142869
+ @MainActor
142870
+ @objc(PeachDirectSwipeActionsView)
142871
+ public final class PeachDirectSwipeActionsView: OneNativeContainerView {
142872
+ private let configuration: PeachDirectSwipeConfiguration
142873
+ private let slot: OneNativeContainerSlotView
142874
+
142875
+ @objc public init() {
142876
+ let configuration = PeachDirectSwipeConfiguration()
142877
+ self.configuration = configuration
142878
+ slot = OneNativeContainerSlotView(frame: .zero)
142879
+ super.init(wrap: { children, _ in
142880
+ AnyView(PeachDirectSwipeRow(configuration: configuration, children: children))
142881
+ })
142882
+ insertChild(slot, at: 0)
142883
+ }
142884
+
142885
+ required init?(coder: NSCoder) { fatalError("init(coder:) is unavailable") }
142886
+
142887
+ @objc(configureLeading:trailing:fullSwipe:emit:)
142888
+ public func configure(leading: [[String: Any]], trailing: [[String: Any]], fullSwipe: [String: Bool],
142889
+ emit: @escaping (String, NSDictionary) -> Void
142890
+ ) {
142891
+ configuration.emit = emit
142892
+ configuration.edges = .init(leading: .init(leading, fullSwipe: fullSwipe["leading"] == true),
142893
+ trailing: .init(trailing, fullSwipe: fullSwipe["trailing"] == true))
142894
+ }
142895
+
142896
+ @objc public func setRow(_ view: UIView?) {
142897
+ guard slot.content !== view else { return }
142898
+ slot.content?.removeFromSuperview()
142899
+ slot.content = view
142900
+ refreshRow(for: slot)
142901
+ }
142902
+
142903
+ public override func layoutSubviews() {
142904
+ slot.configure(height: bounds.height, width: 0)
142905
+ super.layoutSubviews()
142906
+ }
142907
+ }
142908
+
142784
142909
  @MainActor
142785
142910
  private final class PeachDirectTableView: UITableView {
142786
142911
  var onLayoutBounds: ((CGSize) -> Void)?
@@ -143914,26 +144039,28 @@ public struct OneDirectStageView: View {
143914
144039
  public init() {}
143915
144040
 
143916
144041
  public var body: some View {
143917
- OneDirectStageRepresentable(tick: tick)
144042
+ OneDirectStageRepresentable(tick: tick, onDirty: { tick &+= 1 })
143918
144043
  .frame(maxWidth: .infinity, maxHeight: .infinity)
143919
- .onAppear {
143920
- PeachOneDirectStage.shared.onStageDirty = {
143921
- tick &+= 1
143922
- }
143923
- }
143924
144044
  }
143925
144045
  }
143926
144046
 
143927
144047
  private struct OneDirectStageRepresentable: UIViewRepresentable {
143928
144048
  let tick: UInt64
144049
+ let onDirty: () -> Void
143929
144050
 
143930
144051
  func makeUIView(context: Context) -> UIView {
143931
- PeachOneDirectStage.shared.stageView
144052
+ let stage = PeachOneDirectStage.shared
144053
+ stage.onStageDirty = onDirty
144054
+ return stage.stageView
143932
144055
  }
143933
144056
 
143934
144057
  func updateUIView(_ uiView: UIView, context: Context) {
143935
144058
  _ = tick
143936
144059
  }
144060
+
144061
+ static func dismantleUIView(_ uiView: UIView, coordinator: ()) {
144062
+ PeachOneDirectStage.shared.onStageDirty = nil
144063
+ }
143937
144064
  }
143938
144065
  `;
143939
144066
  PEACH_ONE_HOST_SHIMS = {
@@ -144055,6 +144182,9 @@ uint32_t peach_one_node_css_color(uint32_t nodeLo, uint32_t nodeHi, const char*
144055
144182
  uint32_t sourceLen, double* rgbaOut);
144056
144183
  PEACH_ONE_GUEST_IMPORT("node_layout_size")
144057
144184
  uint32_t peach_one_node_layout_size(uint32_t nodeLo, uint32_t nodeHi, double* sizeOut);
144185
+ PEACH_ONE_GUEST_IMPORT("slot_content_frame")
144186
+ uint32_t peach_one_slot_content_frame(uint32_t ownerLo, uint32_t ownerHi,
144187
+ uint32_t contentLo, uint32_t contentHi, double x, double y, double width, double height);
144058
144188
  PEACH_ONE_GUEST_IMPORT("wake_stage")
144059
144189
  void peach_one_wake_stage(void);
144060
144190
  }
@@ -144113,6 +144243,61 @@ UIColor* PeachPlatformColor(NSString* keyword) {
144113
144243
  return keyword ? colors[keyword.lowercaseString] : nil;
144114
144244
  }
144115
144245
 
144246
+ @interface PeachDirectSwipeActionsContainer : NSObject <PeachContainer>
144247
+ @end
144248
+
144249
+ static NSArray<NSDictionary*>* SwiftSwipeActions(id items) {
144250
+ if (![items isKindOfClass:NSArray.class]) return @[];
144251
+ NSArray* entries = static_cast<NSArray*>(items);
144252
+ NSMutableArray* actions = [NSMutableArray arrayWithCapacity:entries.count];
144253
+ for (NSDictionary* item in entries) {
144254
+ if (![item isKindOfClass:NSDictionary.class]) return @[];
144255
+ NSMutableDictionary* action = [item mutableCopy];
144256
+ action[@"color"] = PeachProcessedColor(item[@"color"]);
144257
+ [actions addObject:action];
144258
+ }
144259
+ return actions;
144260
+ }
144261
+
144262
+ @implementation PeachDirectSwipeActionsContainer {
144263
+ PeachDirectSwipeActionsView* _view;
144264
+ peach_node _child;
144265
+ __weak UIView* _row;
144266
+ }
144267
+
144268
+ - (void)configure:(NSDictionary*)spec emit:(PeachContainerEmit)emit {
144269
+ if (!_view) _view = [PeachDirectSwipeActionsView new];
144270
+ NSDictionary* fullSwipe = [spec[@"fullSwipe"] isKindOfClass:NSDictionary.class] ? spec[@"fullSwipe"] : @{};
144271
+ [_view configureLeading:SwiftSwipeActions(spec[@"leading"])
144272
+ trailing:SwiftSwipeActions(spec[@"trailing"])
144273
+ fullSwipe:fullSwipe
144274
+ emit:emit];
144275
+ }
144276
+
144277
+ - (void)child:(peach_node)node { _child = node; }
144278
+
144279
+ - (void)mountIn:(UIView*)container views:(id<PeachViewLookup>)views {
144280
+ _row = _child ? [views viewForNode:_child] : nil;
144281
+ _child = 0;
144282
+ [_view setRow:_row];
144283
+ if (_view.superview != container) [container addSubview:_view];
144284
+ _view.frame = container.bounds;
144285
+ }
144286
+
144287
+ - (BOOL)ownsView:(UIView*)view { return view && view == _row; }
144288
+
144289
+ - (void)unmount {
144290
+ [_view setRow:nil];
144291
+ [_view removeFromSuperview];
144292
+ _row = nil;
144293
+ }
144294
+
144295
+ - (void)detach {
144296
+ [self unmount];
144297
+ _view = nil;
144298
+ }
144299
+ @end
144300
+
144116
144301
  @interface PeachDirectTableListContainer : NSObject <PeachContainer>
144117
144302
  - (void)refreshLayoutIn:(UIView*)container views:(id<PeachViewLookup>)views;
144118
144303
  @end
@@ -144264,11 +144449,24 @@ int32_t emitEventToHost(peach_node node, NSString* event, NSDictionary* payload)
144264
144449
  return peach_one_emit_container_event(nodeLo(node), nodeHi(node), evPtr, evLen, jsPtr, jsLen);
144265
144450
  }
144266
144451
 
144267
- id<PeachContainer> makeContainer(NSString* kind, peach_node node) {
144268
- if ([kind isEqualToString:@"swiftUI"]) return [PeachSwiftUI new];
144452
+ id<PeachContainer> makeContainer(NSString* kind, peach_node node, NSDictionary* spec) {
144453
+ if ([kind isEqualToString:@"swiftUI"]) {
144454
+ PeachSwiftUI* swift = [PeachSwiftUI new];
144455
+ NSString* control = spec[@"control"];
144456
+ if ([control isEqual:@"OneNativeContainerSlot"] || [control isEqual:@"OneNativeTab"]) {
144457
+ swift.slotContentLayout = ^(peach_node content, CGRect frame) {
144458
+ if (peach_one_slot_content_frame(nodeLo(node), nodeHi(node), nodeLo(content),
144459
+ nodeHi(content), frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)) {
144460
+ [PeachOneDirectStage.shared markDirty];
144461
+ }
144462
+ };
144463
+ }
144464
+ return swift;
144465
+ }
144269
144466
  if ([kind isEqualToString:@"sheet"]) return [PeachSheet new];
144270
144467
  if ([kind isEqualToString:@"menu"]) return [PeachMenu new];
144271
144468
  if ([kind isEqualToString:@"contextMenu"]) return [PeachContextMenu new];
144469
+ if ([kind isEqualToString:@"swipeActions"]) return [PeachDirectSwipeActionsContainer new];
144272
144470
  if ([kind isEqualToString:@"tableList"]) return [PeachDirectTableListContainer new];
144273
144471
  if ([kind isEqualToString:@"popover"]) {
144274
144472
  return [[PeachPopover alloc] initWithDismissRequest:^BOOL(NSInteger revision) {
@@ -144377,7 +144575,7 @@ uint32_t peach_one_container_configure(uint32_t targetLo, uint32_t targetHi, con
144377
144575
  }
144378
144576
  if (!record.container) {
144379
144577
  record.kind = kind;
144380
- record.container = makeContainer(kind, node);
144578
+ record.container = makeContainer(kind, node, spec);
144381
144579
  if (!record.container) return 0;
144382
144580
  }
144383
144581
  PeachContainerEmit emit = ^(NSString* event, NSDictionary* payload) {
@@ -144580,6 +144778,13 @@ void peach_one_container_command(uint32_t targetLo, uint32_t targetHi, const cha
144580
144778
  @autoreleasepool {
144581
144779
  const peach_node node = joinNode(targetLo, targetHi);
144582
144780
  NSString* name = nsStringFromBytes(namePtr, nameLen);
144781
+ NSString* prefix = @"contextMenuInteraction:";
144782
+ if (node && [name hasPrefix:prefix]) {
144783
+ NSString* event = [name substringFromIndex:prefix.length];
144784
+ NSString* action = [event isEqualToString:@"action"] ? nsStringFromBytes(jsonPtr, jsonLen) : nil;
144785
+ emitEventToHost(node, event, action ? @{@"id": action} : @{});
144786
+ return;
144787
+ }
144583
144788
  NSDictionary* payload = jsonDictFromBytes(jsonPtr, jsonLen);
144584
144789
  if (node == 0) {
144585
144790
  if ([name isEqualToString:@"completeAction"]) {
@@ -145916,7 +146121,7 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2) {
145916
146121
  watched.add(sourcePath);
145917
146122
  }
145918
146123
  files2.set("Sources/ControlsHost/ios/PeachOneDirectHost.mm", PEACH_ONE_DIRECT_HOST_MM);
145919
- files2.set("Sources/Controls/OneNativeControlsGuest.swift", GUEST_MAIN_SWIFT);
146124
+ files2.set(GUEST_ENTRY, GUEST_MAIN_SWIFT);
145920
146125
  if (bindings) {
145921
146126
  files2.set("Sources/One/One.swift", oneSDKModule);
145922
146127
  for (const relative7 of ONE_SDK_RUNTIME_SOURCES) {
@@ -146025,7 +146230,7 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2) {
146025
146230
  ...oneSDKShards.size ? { oneSDKShards } : {}
146026
146231
  };
146027
146232
  }
146028
- var import_node_crypto93, import_node_fs155, import_node_module22, import_node_path158, import_node_url8, ONE_SDK_DEFINES, BRIDGE_SWIFT, GUEST_MAIN_SWIFT, ONE_SDK_RUNTIME_SOURCES, ONE_NATIVE_STYLE_SHARDS, ONE_NATIVE_STYLE_SHARD_MIN_BYTES, DIRECT_HOST_SWIFT_SEEDS, DIRECT_HOST_IOS_FILES;
146233
+ var import_node_crypto93, import_node_fs155, import_node_module22, import_node_path158, import_node_url8, ONE_SDK_DEFINES, GUEST_ENTRY, BRIDGE_SWIFT, GUEST_MAIN_SWIFT, ONE_SDK_RUNTIME_SOURCES, ONE_NATIVE_STYLE_SHARDS, ONE_NATIVE_STYLE_SHARD_MIN_BYTES, DIRECT_HOST_SWIFT_SEEDS, DIRECT_HOST_IOS_FILES;
146029
146234
  var init_one_native_controls_package = __esm({
146030
146235
  "src/one-native-controls-package.ts"() {
146031
146236
  "use strict";
@@ -146048,6 +146253,7 @@ var init_one_native_controls_package = __esm({
146048
146253
  init_swift_submit();
146049
146254
  init_swift_toolchain();
146050
146255
  ONE_SDK_DEFINES = ["ONE_IOS_26_SDK", "ONE_IOS_27_SDK", "ONE_IOS_27_1_SDK"];
146256
+ GUEST_ENTRY = "Sources/Controls/OneNativeControlsGuest.swift";
146051
146257
  BRIDGE_SWIFT = `@_spi(Peach) import SwiftUI
146052
146258
  @_spi(Peach) import UIKit
146053
146259
  import PeachJSON
@@ -152372,7 +152578,7 @@ var init_nitro_superset = __esm({
152372
152578
  init_nitroContract();
152373
152579
  init_swift_standin_digest();
152374
152580
  NITRO_SUPERSET_ENTRY_NAME = "superset";
152375
- NITRO_COMPILER_DIGEST = true ? "2cc931ba112a51e34cbca543692c5cd5965c2fcc760351c9766eda8362cf2df8" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
152581
+ NITRO_COMPILER_DIGEST = true ? "3bb92dce458a79e08d4cfa92d7c065894bfc73a21379d325f3a4bb95ac8d1c4b" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
152376
152582
  nitroSupersetLock = parseLock(nitro_superset_lock_default);
152377
152583
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
152378
152584
  published3 = /* @__PURE__ */ new Map();