* fix(app): preserve native composer input semantics Native text was round-tripped through application state on every keystroke, which could overwrite an input method's in-flight edits. Keep native text ownership inside the input and reserve application-driven replacement for explicit draft mutations.\n\nRoute native clipboard images through the existing persisted attachment pipeline so keyboard and system paste actions behave like other image sources. * fix(nix): refresh dependency hash The native composer dependency changes the fixed npm dependency closure used by desktop builds. * fix(app): keep composer locked across image pastes Count concurrent native image persistence operations so submit remains disabled until every pasted image is attached. * fix(app): replace composer text through the DOM on web Web TextInput refs are DOM elements, so application-driven draft replacement must update their value and selection without native setNativeProps. * fix(app): preserve web IME composition Carry the Chinese IME fix from #2990 into the web composer input boundary. Co-authored-by: Jimmy Lee <jimersylee+github@gmail.com> --------- Co-authored-by: Jimmy Lee <jimersylee+github@gmail.com>
48 lines
1.7 KiB
TypeScript
48 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
const {
|
|
configurePasteInputAppDelegate,
|
|
configurePasteInputBridgingHeader,
|
|
configurePasteInputPodfile,
|
|
} = require("./with-paste-input");
|
|
|
|
describe("withPasteInput", () => {
|
|
it("registers the module after React Native starts", () => {
|
|
const source = [
|
|
"import ReactAppDependencyProvider",
|
|
"",
|
|
" bindReactNativeFactory(factory)",
|
|
" factory.startReactNative(",
|
|
' withModuleName: "main",',
|
|
" in: window,",
|
|
" launchOptions: launchOptions)",
|
|
"#endif",
|
|
].join("\n");
|
|
const configured = configurePasteInputAppDelegate(source);
|
|
|
|
expect(configured).toContain(
|
|
" launchOptions: launchOptions)\n PasteInputModule.setup(factory.rootViewFactory)\n#endif",
|
|
);
|
|
expect(configurePasteInputAppDelegate(configured)).toBe(configured);
|
|
});
|
|
|
|
it("exposes the Objective-C module to Swift through the bridging header", () => {
|
|
const source = "// Swift bridging header\n";
|
|
const configured = configurePasteInputBridgingHeader(source);
|
|
|
|
expect(configured).toContain("#import <react-native-paste-input/PasteInputModule.h>");
|
|
expect(configurePasteInputBridgingHeader(configured)).toBe(configured);
|
|
});
|
|
|
|
it("sets the new architecture environment before CocoaPods evaluates dependencies", () => {
|
|
const source =
|
|
"ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'";
|
|
const configured = configurePasteInputPodfile(source);
|
|
|
|
expect(configured).toContain(
|
|
"ENV['RCT_NEW_ARCH_ENABLED'] ||= '1' if podfile_properties['newArchEnabled'] == 'true'",
|
|
);
|
|
expect(configurePasteInputPodfile(configured)).toBe(configured);
|
|
});
|
|
});
|