peachsim 0.1.2664 → 0.1.2666
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 +207 -70
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-3U6EU7PO.mjs → acorn-PNTLNBTA.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-ERGD3KKN.mjs → chunk-2JG7Y5DA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6PEAK5M5.mjs → chunk-5HZMRPZT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MKUIWBJN.mjs → chunk-6I74FZC6.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HDUQW4GQ.mjs → chunk-BU4YLDQW.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-2LFY365I.mjs → chunk-C4XXXBD5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BOHFFNGU.mjs → chunk-COOGIJXF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CFJZS5CE.mjs → chunk-CVOZD2XG.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-66KK3MIG.mjs → chunk-EFXLPDDZ.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-XRVX2ZRS.mjs → chunk-ETATV252.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NBRFPXHI.mjs → chunk-F57EOGPC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NZL67K66.mjs → chunk-HEDPVBHA.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-KXGHURRU.mjs → chunk-HZFAKEYY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-K2IPDHF4.mjs → chunk-K3IKKG2I.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-ZPGI2MXX.mjs → chunk-M4Q5C23L.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7IPHJM2I.mjs → chunk-ONR3YOTC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JLQGBHPP.mjs → chunk-QPW4OH73.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HZ2MRRBP.mjs → chunk-R4EXMC3C.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XKY7FRVJ.mjs → chunk-RY6JI3XR.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-2HO57LUD.mjs → chunk-SYOGZX55.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JUAYA5J7.mjs → chunk-WSGBYXP2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FML4O4LG.mjs → chunk-WTQUIDPZ.mjs} +14 -14
- package/dist-lib/esm-chunks/{chunk-UKAH2MGN.mjs → chunk-ZIULCB6R.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QZJ5VH7F.mjs → chunk-ZQDBFNSQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EZBQ6ZK5.mjs → chunk-ZU6LSMDO.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-2VDVNNSP.mjs → metro-layout-parser-YGB3P5A5.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-4COK4ZLX.mjs → swift-package-prebuilt-GJ7ST7WE.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-FDCK65JN.mjs → swift-sdk-app-module-UAK2NDAI.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-PVTKL5U5.mjs → swift-sdk-image-TEAM72UD.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-IHDGAN67.mjs → swift-sdk-image-producer-VIE2CP6M.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +206 -69
- 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 +207 -70
- package/dist-lib/host/fetch-proxy-handler.cjs +22 -5
- 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 +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- 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 +85 -85
- package/dist-lib/public-origins-lib.json +64 -64
- 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 +207 -70
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +12 -12
- 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/engine/animationGraphContract.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/engine/scroll-physics-native.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-anim-mirror-item.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/nativeAnimMirrorContract.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/pod-lockfile.ts +29 -5
- package/src/pod-sources.ts +46 -4
- package/src/podfile-cocoapods.ts +70 -13
- package/src/pods-install.ts +72 -44
- package/src/turbo-source.ts +34 -4
package/src/pods-install.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { isDict, list, parseOpenStepPlist, str, type PlistDict } from './openste
|
|
|
9
9
|
import { PbxTable, serializePbxproj } from './pbx-table'
|
|
10
10
|
import { POD_GRAPH_SPECIFICATIONS } from './pod-graph-specifications'
|
|
11
11
|
import { podPrepareEnvironment } from './pod-prepare-toolchain'
|
|
12
|
-
import { cleanInstalledPod, podSourceRoot } from './pod-sources'
|
|
12
|
+
import { cleanInstalledPod, podSourceRoot, preparePodSource } from './pod-sources'
|
|
13
13
|
import { evaluatePodfile, resolvePodfile } from './podfile-cocoapods'
|
|
14
14
|
import { analyzePods, type UserTargetInspection } from './pods-analysis'
|
|
15
15
|
import { PodsBuildSettings } from './pods-build-settings'
|
|
@@ -60,6 +60,7 @@ lambda do |podfile, sandbox, resolver|
|
|
|
60
60
|
'DEPENDENCIES' => podfile.dependencies.map(&:to_s),
|
|
61
61
|
'SPEC REPOS' => repos,
|
|
62
62
|
'EXTERNAL SOURCES' => podfile.dependencies.select(&:external?).each_with_object({}) { |dep, result| result[dep.root_name] = dep.external_source },
|
|
63
|
+
'CHECKOUT OPTIONS' => sandbox.checkout_sources,
|
|
63
64
|
'SPEC CHECKSUMS' => specs.select(&:defined_in_file).each_with_object({}) { |spec, result| result[spec.root.name] = spec.checksum },
|
|
64
65
|
'PODFILE CHECKSUM' => podfile.checksum,
|
|
65
66
|
'COCOAPODS' => '${COCOAPODS_VERSION}',
|
|
@@ -350,6 +351,7 @@ function yaml(
|
|
|
350
351
|
}
|
|
351
352
|
if (value instanceof RString) return yamlString(value.s).trim()
|
|
352
353
|
if (value instanceof RSymbol) return `:${value.name}`
|
|
354
|
+
if (typeof value === 'boolean') return String(value)
|
|
353
355
|
throw new Error(
|
|
354
356
|
`the lockfile holds ${interp.toS(value)}, which YAMLHelper does not write`,
|
|
355
357
|
)
|
|
@@ -394,6 +396,72 @@ function writeWorkspace(workspace: string, projects: string[]) {
|
|
|
394
396
|
)
|
|
395
397
|
}
|
|
396
398
|
|
|
399
|
+
async function preparePodInstallation(
|
|
400
|
+
app: string,
|
|
401
|
+
prepareEnv: NodeJS.ProcessEnv,
|
|
402
|
+
workspace: string,
|
|
403
|
+
lap: (label: string) => void,
|
|
404
|
+
) {
|
|
405
|
+
const evaluated = evaluatePodfile(app, prepareEnv, workspace)
|
|
406
|
+
const iosRoot = path.dirname(evaluated.file)
|
|
407
|
+
const staging = fs.mkdtempSync(path.join(iosRoot, '.peach-pod-checkouts-'))
|
|
408
|
+
try {
|
|
409
|
+
const resolved = await resolvePodfile(evaluated, staging)
|
|
410
|
+
const { interp, file, podfile, sandbox: rubySandbox, resolver } = resolved
|
|
411
|
+
const call = (source: string, label: string) =>
|
|
412
|
+
rubyFailures(file, () =>
|
|
413
|
+
interp.callMethod(
|
|
414
|
+
interp.evalString(source, label),
|
|
415
|
+
'call',
|
|
416
|
+
[podfile, rubySandbox, resolver],
|
|
417
|
+
null,
|
|
418
|
+
null,
|
|
419
|
+
null,
|
|
420
|
+
null,
|
|
421
|
+
),
|
|
422
|
+
)
|
|
423
|
+
const inputs = toJson(interp, call(INSTALL_INPUTS, 'peach/install-inputs'))
|
|
424
|
+
if (!isInstallInputs(inputs))
|
|
425
|
+
throw new Error(`${file}: the Podfile's install inputs are malformed`)
|
|
426
|
+
const lock = lockfileYaml(interp, call(LOCKFILE, 'cocoapods-core/lockfile'))
|
|
427
|
+
lap('resolve')
|
|
428
|
+
|
|
429
|
+
const podsRoot = path.join(iosRoot, 'Pods')
|
|
430
|
+
fs.rmSync(podsRoot, { recursive: true, force: true })
|
|
431
|
+
fs.mkdirSync(podsRoot, { recursive: true })
|
|
432
|
+
const downloaded = new Map<string, Record<string, unknown>>()
|
|
433
|
+
const copies = await Promise.allSettled(
|
|
434
|
+
inputs.downloads.map(async ([name, json]) => {
|
|
435
|
+
const spec: unknown = JSON.parse(json)
|
|
436
|
+
if (!isRecord(spec))
|
|
437
|
+
throw new Error(`${name}: the specification is no JSON object`)
|
|
438
|
+
downloaded.set(name, spec)
|
|
439
|
+
const checkout = resolved.gitCheckouts.get(name)
|
|
440
|
+
const destination = path.join(podsRoot, name)
|
|
441
|
+
fs.cpSync(
|
|
442
|
+
checkout?.root ?? (await podSourceRoot(spec, prepareEnv)),
|
|
443
|
+
destination,
|
|
444
|
+
{
|
|
445
|
+
recursive: true,
|
|
446
|
+
mode: fs.constants.COPYFILE_FICLONE,
|
|
447
|
+
verbatimSymlinks: true,
|
|
448
|
+
},
|
|
449
|
+
)
|
|
450
|
+
if (checkout) await preparePodSource(spec, destination, prepareEnv)
|
|
451
|
+
}),
|
|
452
|
+
)
|
|
453
|
+
for (const copy of copies) if (copy.status === 'rejected') throw copy.reason
|
|
454
|
+
fs.writeFileSync(
|
|
455
|
+
path.join(podsRoot, POD_GRAPH_SPECIFICATIONS),
|
|
456
|
+
JSON.stringify(Object.fromEntries(inputs.stored)),
|
|
457
|
+
)
|
|
458
|
+
lap('download')
|
|
459
|
+
return { resolved, inputs, lock, downloaded, iosRoot, podsRoot }
|
|
460
|
+
} finally {
|
|
461
|
+
fs.rmSync(staging, { recursive: true, force: true })
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
397
465
|
/** installs the pods of `app`'s ios/Podfile as `pod install` does, with `env` as the Podfile's ENV. */
|
|
398
466
|
export async function installPods(
|
|
399
467
|
app: string,
|
|
@@ -408,49 +476,9 @@ export async function installPods(
|
|
|
408
476
|
started = now
|
|
409
477
|
}
|
|
410
478
|
const prepareEnv = await podPrepareEnvironment({ ...process.env, ...env })
|
|
411
|
-
const resolved
|
|
412
|
-
|
|
413
|
-
const
|
|
414
|
-
const call = (source: string, label: string) =>
|
|
415
|
-
rubyFailures(file, () =>
|
|
416
|
-
interp.callMethod(
|
|
417
|
-
interp.evalString(source, label),
|
|
418
|
-
'call',
|
|
419
|
-
[podfile, rubySandbox, resolver],
|
|
420
|
-
null,
|
|
421
|
-
null,
|
|
422
|
-
null,
|
|
423
|
-
null,
|
|
424
|
-
),
|
|
425
|
-
)
|
|
426
|
-
const inputs = toJson(interp, call(INSTALL_INPUTS, 'peach/install-inputs'))
|
|
427
|
-
if (!isInstallInputs(inputs))
|
|
428
|
-
throw new Error(`${file}: the Podfile's install inputs are malformed`)
|
|
429
|
-
const lock = lockfileYaml(interp, call(LOCKFILE, 'cocoapods-core/lockfile'))
|
|
430
|
-
lap('resolve')
|
|
431
|
-
|
|
432
|
-
const podsRoot = path.join(iosRoot, 'Pods')
|
|
433
|
-
fs.rmSync(podsRoot, { recursive: true, force: true })
|
|
434
|
-
fs.mkdirSync(podsRoot, { recursive: true })
|
|
435
|
-
const downloaded = new Map<string, Record<string, unknown>>()
|
|
436
|
-
await Promise.all(
|
|
437
|
-
inputs.downloads.map(async ([name, json]) => {
|
|
438
|
-
const spec: unknown = JSON.parse(json)
|
|
439
|
-
if (!isRecord(spec)) throw new Error(`${name}: the specification is no JSON object`)
|
|
440
|
-
downloaded.set(name, spec)
|
|
441
|
-
fs.cpSync(await podSourceRoot(spec, prepareEnv), path.join(podsRoot, name), {
|
|
442
|
-
recursive: true,
|
|
443
|
-
mode: fs.constants.COPYFILE_FICLONE,
|
|
444
|
-
verbatimSymlinks: true,
|
|
445
|
-
})
|
|
446
|
-
}),
|
|
447
|
-
)
|
|
448
|
-
fs.writeFileSync(
|
|
449
|
-
path.join(podsRoot, POD_GRAPH_SPECIFICATIONS),
|
|
450
|
-
JSON.stringify(Object.fromEntries(inputs.stored)),
|
|
451
|
-
)
|
|
452
|
-
lap('download')
|
|
453
|
-
|
|
479
|
+
const { resolved, inputs, lock, downloaded, iosRoot, podsRoot } =
|
|
480
|
+
await preparePodInstallation(app, prepareEnv, workspace, lap)
|
|
481
|
+
const { interp, file } = resolved
|
|
454
482
|
const userProjects = new Map<string, { table: ProjectTable; ruby: RObject }>()
|
|
455
483
|
const inspected = inputs.definitions.map((definition) => {
|
|
456
484
|
const projectPath = userProjectPath(iosRoot, definition)
|
package/src/turbo-source.ts
CHANGED
|
@@ -4469,7 +4469,10 @@ react::ShadowView fabricShadow(UIView *view) {
|
|
|
4469
4469
|
}
|
|
4470
4470
|
int nextFabricView = 1;
|
|
4471
4471
|
UITextField *fabricFocusField = nil;
|
|
4472
|
+
id fabricFocusObserver = nil;
|
|
4473
|
+
std::optional<jsi::Function> fabricFocusEndHandler;
|
|
4472
4474
|
bool fabricFocusActive = false;
|
|
4475
|
+
bool fabricFocusPending = false;
|
|
4473
4476
|
int fabricFocusParentTag = 0;
|
|
4474
4477
|
CGRect fabricFocusWindowRect = CGRectZero;
|
|
4475
4478
|
const char *fabricCodegenNames = ${JSON.stringify(views.map(({ name }) => name).join('\n'))};
|
|
@@ -4548,14 +4551,26 @@ void applyFabricFocus() {
|
|
|
4548
4551
|
fabricFocusField.opaque = NO;
|
|
4549
4552
|
// the browser already owns and draws the guest text editor.
|
|
4550
4553
|
fabricFocusField.hidden = YES;
|
|
4554
|
+
fabricFocusObserver = [NSNotificationCenter.defaultCenter
|
|
4555
|
+
addObserverForName:UITextFieldTextDidEndEditingNotification object:fabricFocusField
|
|
4556
|
+
queue:nil usingBlock:^(NSNotification *) {
|
|
4557
|
+
if (!fabricFocusActive || !fabricFocusEndHandler) return;
|
|
4558
|
+
std::weak_ptr<const void> owner = fabricOwner;
|
|
4559
|
+
fabricInvoker->invokeAsync([owner](jsi::Runtime &rt) {
|
|
4560
|
+
if (!owner.lock() || !fabricFocusActive || !fabricFocusEndHandler ||
|
|
4561
|
+
!fabricFocusField.superview || fabricFocusField.isFirstResponder) return;
|
|
4562
|
+
fabricFocusActive = false;
|
|
4563
|
+
fabricFocusEndHandler->call(rt);
|
|
4564
|
+
});
|
|
4565
|
+
}];
|
|
4551
4566
|
}
|
|
4552
4567
|
if (fabricFocusField.superview != container) {
|
|
4553
4568
|
[container addSubview:fabricFocusField];
|
|
4554
4569
|
}
|
|
4555
4570
|
if (container.window != nil) {
|
|
4556
4571
|
fabricFocusField.frame = [container convertRect:fabricFocusWindowRect fromView:container.window];
|
|
4557
|
-
if (
|
|
4558
|
-
|
|
4572
|
+
if (fabricFocusPending && [fabricFocusField becomeFirstResponder]) {
|
|
4573
|
+
fabricFocusPending = false;
|
|
4559
4574
|
}
|
|
4560
4575
|
} else if (fabricFocusParentTag > 0) {
|
|
4561
4576
|
auto found = fabricViews.find(fabricFocusParentTag);
|
|
@@ -5091,6 +5106,7 @@ ${
|
|
|
5091
5106
|
auto &view = fabricView(tag);
|
|
5092
5107
|
if (fabricFocusParentTag == tag) {
|
|
5093
5108
|
fabricFocusParentTag = 0;
|
|
5109
|
+
fabricFocusPending = fabricFocusActive;
|
|
5094
5110
|
if (fabricFocusField) {
|
|
5095
5111
|
[fabricFocusField resignFirstResponder];
|
|
5096
5112
|
[fabricFocusField removeFromSuperview];
|
|
@@ -5276,8 +5292,12 @@ ${
|
|
|
5276
5292
|
return jsi::Value::undefined();
|
|
5277
5293
|
});
|
|
5278
5294
|
method("syncFocus", 6, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
5279
|
-
|
|
5280
|
-
|
|
5295
|
+
const bool focused = args[0].isBool() ? args[0].getBool() : (args[0].asNumber() != 0);
|
|
5296
|
+
const int parentTag = static_cast<int>(args[1].asNumber());
|
|
5297
|
+
fabricFocusPending = focused &&
|
|
5298
|
+
(fabricFocusPending || !fabricFocusActive || fabricFocusParentTag != parentTag);
|
|
5299
|
+
fabricFocusActive = focused;
|
|
5300
|
+
fabricFocusParentTag = parentTag;
|
|
5281
5301
|
fabricFocusWindowRect = CGRectMake(args[2].asNumber(), args[3].asNumber(), args[4].asNumber(), args[5].asNumber());
|
|
5282
5302
|
applyFabricFocus();
|
|
5283
5303
|
return jsi::Value::undefined();
|
|
@@ -5355,17 +5375,27 @@ ${
|
|
|
5355
5375
|
fabricEventHandler = args[0].asObject(rt).asFunction(rt);
|
|
5356
5376
|
return jsi::Value::undefined();
|
|
5357
5377
|
});
|
|
5378
|
+
method("setFocusEndHandler", 1, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
5379
|
+
fabricFocusEndHandler = args[0].asObject(rt).asFunction(rt);
|
|
5380
|
+
return jsi::Value::undefined();
|
|
5381
|
+
});
|
|
5358
5382
|
rt.global().setProperty(rt, "peachFabricViews", std::move(views));
|
|
5359
5383
|
}
|
|
5360
5384
|
|
|
5361
5385
|
// the runtime's functions go before the runtime does
|
|
5362
5386
|
void peachTeardownFabricViews() {
|
|
5387
|
+
if (fabricFocusObserver) {
|
|
5388
|
+
[NSNotificationCenter.defaultCenter removeObserver:fabricFocusObserver];
|
|
5389
|
+
fabricFocusObserver = nil;
|
|
5390
|
+
}
|
|
5391
|
+
fabricFocusEndHandler.reset();
|
|
5363
5392
|
if (fabricFocusField) {
|
|
5364
5393
|
[fabricFocusField resignFirstResponder];
|
|
5365
5394
|
[fabricFocusField removeFromSuperview];
|
|
5366
5395
|
fabricFocusField = nil;
|
|
5367
5396
|
}
|
|
5368
5397
|
fabricFocusActive = false;
|
|
5398
|
+
fabricFocusPending = false;
|
|
5369
5399
|
fabricFocusParentTag = 0;
|
|
5370
5400
|
fabricOwner.reset();
|
|
5371
5401
|
fabricEventHandler.reset();
|