@omercnet/paseo-shared-browser 4.1.9 → 4.1.10-next.475.1
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.
|
@@ -111,3 +111,117 @@ describe("web canvas keyboard adapter cancellation", () => {
|
|
|
111
111
|
expect(dom.events).toHaveLength(1);
|
|
112
112
|
});
|
|
113
113
|
});
|
|
114
|
+
|
|
115
|
+
/** Android Chrome reports soft-keyboard edits as keydown 229 / "Unidentified". */
|
|
116
|
+
const ime = { ...key, key: "Unidentified", code: "", keyCode: 229 };
|
|
117
|
+
const texts = (dom: ReturnType<typeof bind>) =>
|
|
118
|
+
dom.events.flatMap((event) => (event.kind === "text" ? [event.text] : []));
|
|
119
|
+
|
|
120
|
+
/** Gboard-style composition of one word, ending with compositionend. */
|
|
121
|
+
function composeWord(dom: ReturnType<typeof bind>, word: string) {
|
|
122
|
+
dom.fire("sink", "keydown", ime);
|
|
123
|
+
dom.fire("sink", "compositionstart", { data: "" });
|
|
124
|
+
for (let index = 1; index <= word.length; index += 1) {
|
|
125
|
+
if (index > 1) dom.fire("sink", "keydown", { ...ime, isComposing: true });
|
|
126
|
+
dom.fire("sink", "beforeinput", {
|
|
127
|
+
inputType: "insertCompositionText",
|
|
128
|
+
data: word.slice(0, index),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
dom.fire("sink", "compositionend", { data: word });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
describe("web canvas keyboard adapter Android IME sequences", () => {
|
|
135
|
+
it("commits a composed word exactly once", () => {
|
|
136
|
+
const dom = bind();
|
|
137
|
+
composeWord(dom, "hello");
|
|
138
|
+
expect(texts(dom)).toEqual(["hello"]);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("commits text an IME inserts outside a composition (space after a word)", () => {
|
|
142
|
+
const dom = bind();
|
|
143
|
+
composeWord(dom, "hello");
|
|
144
|
+
dom.fire("sink", "keydown", ime);
|
|
145
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: " " });
|
|
146
|
+
composeWord(dom, "world");
|
|
147
|
+
expect(texts(dom).join("")).toBe("hello world");
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it("commits insertText that shares the composing keydown of a batched IME edit", () => {
|
|
151
|
+
const dom = bind();
|
|
152
|
+
dom.fire("sink", "keydown", ime);
|
|
153
|
+
dom.fire("sink", "compositionstart", { data: "" });
|
|
154
|
+
dom.fire("sink", "beforeinput", { inputType: "insertCompositionText", data: "hi" });
|
|
155
|
+
dom.fire("sink", "keydown", { ...ime, isComposing: true });
|
|
156
|
+
dom.fire("sink", "compositionend", { data: "hi" });
|
|
157
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "." });
|
|
158
|
+
expect(texts(dom)).toEqual(["hi", "."]);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it("commits keyboards that send every character as insertText without composition", () => {
|
|
162
|
+
const dom = bind();
|
|
163
|
+
for (const character of "abc123") {
|
|
164
|
+
dom.fire("sink", "keydown", ime);
|
|
165
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: character });
|
|
166
|
+
}
|
|
167
|
+
expect(texts(dom).join("")).toBe("abc123");
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it("keeps only the final composition after deleteContentBackward and IME correction", () => {
|
|
171
|
+
const dom = bind();
|
|
172
|
+
dom.fire("sink", "keydown", ime);
|
|
173
|
+
dom.fire("sink", "compositionstart", { data: "" });
|
|
174
|
+
dom.fire("sink", "beforeinput", { inputType: "insertCompositionText", data: "teh" });
|
|
175
|
+
dom.fire("sink", "beforeinput", { inputType: "deleteContentBackward", data: null });
|
|
176
|
+
dom.fire("sink", "beforeinput", { inputType: "insertCompositionText", data: "the" });
|
|
177
|
+
dom.fire("sink", "compositionend", { data: "the" });
|
|
178
|
+
expect(texts(dom)).toEqual(["the"]);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("commits Korean syllable compositions exactly once", () => {
|
|
182
|
+
const dom = bind();
|
|
183
|
+
composeWord(dom, "한");
|
|
184
|
+
composeWord(dom, "글");
|
|
185
|
+
expect(texts(dom).join("")).toBe("한글");
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
it("does not commit insertText after a physical key the adapter consumed or blocked", () => {
|
|
189
|
+
const dom = bind();
|
|
190
|
+
dom.fire("sink", "keydown", key);
|
|
191
|
+
dom.binding.reset();
|
|
192
|
+
// A held key blocked by reset reaches the browser default insertion.
|
|
193
|
+
dom.fire("sink", "keydown", { ...key, repeat: true });
|
|
194
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "a" });
|
|
195
|
+
// A non-IME keydown also disarms an earlier IME edge.
|
|
196
|
+
dom.fire("sink", "keydown", ime);
|
|
197
|
+
dom.fire("sink", "keydown", { ...key, repeat: true });
|
|
198
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "a" });
|
|
199
|
+
expect(texts(dom)).toEqual([]);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
it("drops IME insertText once reset or not in control", () => {
|
|
203
|
+
const dom = bind();
|
|
204
|
+
dom.fire("sink", "keydown", ime);
|
|
205
|
+
dom.binding.reset();
|
|
206
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "x" });
|
|
207
|
+
expect(texts(dom)).toEqual([]);
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
it("commits every insertText of one IME keydown until the next keydown", () => {
|
|
211
|
+
const dom = bind();
|
|
212
|
+
dom.fire("sink", "keydown", ime);
|
|
213
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "a" });
|
|
214
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "b" });
|
|
215
|
+
expect(texts(dom)).toEqual(["a", "b"]);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it.each([
|
|
219
|
+
["Unidentified", { ...key, key: "Unidentified", code: "" }],
|
|
220
|
+
["Process", { ...key, key: "Process", code: "" }],
|
|
221
|
+
])("treats a %s keydown without keyCode 229 as an IME edge", (_name, edge) => {
|
|
222
|
+
const dom = bind();
|
|
223
|
+
dom.fire("sink", "keydown", edge);
|
|
224
|
+
dom.fire("sink", "beforeinput", { inputType: "insertText", data: "x" });
|
|
225
|
+
expect(texts(dom)).toEqual(["x"]);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
@@ -83,6 +83,11 @@ export function bindBrowserCanvasKeyboard(node: KeyboardCanvasNode, options: Bin
|
|
|
83
83
|
let composing = false;
|
|
84
84
|
let compositionAdmitted = false;
|
|
85
85
|
let altTextPending: string | null = null;
|
|
86
|
+
// Soft keyboards (Android Chrome) report committed text outside a composition,
|
|
87
|
+
// such as a space after a word or every key on non-predictive keyboards, as
|
|
88
|
+
// keydown 229/"Unidentified" followed by beforeinput insertText. That keydown
|
|
89
|
+
// carries no key to forward, so the insertion itself is the only text source.
|
|
90
|
+
let imeTextPending = false;
|
|
86
91
|
const focused = () => document.activeElement === sink || document.activeElement === node;
|
|
87
92
|
const keyboard = createBrowserCanvasKeyboard({
|
|
88
93
|
...options,
|
|
@@ -97,6 +102,7 @@ export function bindBrowserCanvasKeyboard(node: KeyboardCanvasNode, options: Bin
|
|
|
97
102
|
compositionAdmitted = false;
|
|
98
103
|
composing = false;
|
|
99
104
|
altTextPending = null;
|
|
105
|
+
imeTextPending = false;
|
|
100
106
|
sink.value = "";
|
|
101
107
|
};
|
|
102
108
|
const cancel = () => {
|
|
@@ -112,6 +118,8 @@ export function bindBrowserCanvasKeyboard(node: KeyboardCanvasNode, options: Bin
|
|
|
112
118
|
if (!focused()) {
|
|
113
119
|
return;
|
|
114
120
|
}
|
|
121
|
+
imeTextPending =
|
|
122
|
+
event.keyCode === 229 || event.key === "Process" || event.key === "Unidentified";
|
|
115
123
|
// Local paste supplies clipboard bytes separately. Sending Ctrl/Meta+V would
|
|
116
124
|
// additionally paste an unrelated remote clipboard and duplicate the action.
|
|
117
125
|
const pasteShortcut =
|
|
@@ -174,7 +182,11 @@ export function bindBrowserCanvasKeyboard(node: KeyboardCanvasNode, options: Bin
|
|
|
174
182
|
const beforeInput = (event: KeyboardDomEvent) => {
|
|
175
183
|
if (!composing && options.enabled() && focused()) {
|
|
176
184
|
consume(event);
|
|
177
|
-
if (
|
|
185
|
+
if (
|
|
186
|
+
event.inputType === "insertText" &&
|
|
187
|
+
event.data &&
|
|
188
|
+
(imeTextPending || event.data === altTextPending)
|
|
189
|
+
) {
|
|
178
190
|
commitText(event.data);
|
|
179
191
|
}
|
|
180
192
|
altTextPending = null;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-shared-browser",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@omercnet/paseo-shared-browser",
|
|
9
|
-
"version": "4.1.
|
|
9
|
+
"version": "4.1.10",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@getpaseo/plugin": "0.16.0-beta.
|
|
11
|
+
"@getpaseo/plugin": "0.16.0-beta.2",
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
13
13
|
"agent-browser": "0.41.2",
|
|
14
14
|
"esbuild": "0.28.2",
|
|
@@ -441,22 +441,22 @@
|
|
|
441
441
|
}
|
|
442
442
|
},
|
|
443
443
|
"node_modules/@getpaseo/client": {
|
|
444
|
-
"version": "0.16.0-beta.
|
|
445
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/client/-/client-0.16.0-beta.
|
|
446
|
-
"integrity": "sha512-
|
|
444
|
+
"version": "0.16.0-beta.2",
|
|
445
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/client/-/client-0.16.0-beta.2.tgz",
|
|
446
|
+
"integrity": "sha512-T7NInK3/731BzDOn+8Wdl7kYSJ+/CVqbW9EMjXhtZSZy2TSPni42Ag4tv1t5b9tw7Lu4uJP7jpXvUKN2hYZxTw==",
|
|
447
447
|
"license": "Apache-2.0",
|
|
448
448
|
"peer": true,
|
|
449
449
|
"dependencies": {
|
|
450
|
-
"@getpaseo/protocol": "0.16.0-beta.
|
|
451
|
-
"@getpaseo/relay": "0.16.0-beta.
|
|
450
|
+
"@getpaseo/protocol": "0.16.0-beta.2",
|
|
451
|
+
"@getpaseo/relay": "0.16.0-beta.2",
|
|
452
452
|
"ws": "^8.20.0",
|
|
453
453
|
"zod": "^4.4.3"
|
|
454
454
|
}
|
|
455
455
|
},
|
|
456
456
|
"node_modules/@getpaseo/plugin": {
|
|
457
|
-
"version": "0.16.0-beta.
|
|
458
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/plugin/-/plugin-0.16.0-beta.
|
|
459
|
-
"integrity": "sha512-
|
|
457
|
+
"version": "0.16.0-beta.2",
|
|
458
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/plugin/-/plugin-0.16.0-beta.2.tgz",
|
|
459
|
+
"integrity": "sha512-rJL1cOD0nV1wGWJo6dgGVMkIygce5RWwO40n3FYffvDYl/x4ir6xF2ieYLCkYhW/5V4KyDZKFmZ4fQ/Ajh9xvg==",
|
|
460
460
|
"license": "Apache-2.0",
|
|
461
461
|
"dependencies": {
|
|
462
462
|
"@agentclientprotocol/sdk": "^1.4.0",
|
|
@@ -464,8 +464,8 @@
|
|
|
464
464
|
"use-sync-external-store": "^1.6.0"
|
|
465
465
|
},
|
|
466
466
|
"peerDependencies": {
|
|
467
|
-
"@getpaseo/client": "0.16.0-beta.
|
|
468
|
-
"@getpaseo/protocol": "0.16.0-beta.
|
|
467
|
+
"@getpaseo/client": "0.16.0-beta.2",
|
|
468
|
+
"@getpaseo/protocol": "0.16.0-beta.2",
|
|
469
469
|
"react": ">=19.1.0 <20",
|
|
470
470
|
"react-native": ">=0.81.5",
|
|
471
471
|
"zod": "^4.4.3"
|
|
@@ -477,9 +477,9 @@
|
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
479
|
"node_modules/@getpaseo/protocol": {
|
|
480
|
-
"version": "0.16.0-beta.
|
|
481
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/protocol/-/protocol-0.16.0-beta.
|
|
482
|
-
"integrity": "sha512-
|
|
480
|
+
"version": "0.16.0-beta.2",
|
|
481
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/protocol/-/protocol-0.16.0-beta.2.tgz",
|
|
482
|
+
"integrity": "sha512-w3LynGf+Q0mT9XlKVHnXlNeH/wCpaZcBATYJMh61kiQMNsjKrf61x1kOp9Vutst3nyts0iABVAYVHd+DnUxESQ==",
|
|
483
483
|
"license": "Apache-2.0",
|
|
484
484
|
"peer": true,
|
|
485
485
|
"dependencies": {
|
|
@@ -488,9 +488,9 @@
|
|
|
488
488
|
}
|
|
489
489
|
},
|
|
490
490
|
"node_modules/@getpaseo/relay": {
|
|
491
|
-
"version": "0.16.0-beta.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/relay/-/relay-0.16.0-beta.
|
|
493
|
-
"integrity": "sha512-
|
|
491
|
+
"version": "0.16.0-beta.2",
|
|
492
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/relay/-/relay-0.16.0-beta.2.tgz",
|
|
493
|
+
"integrity": "sha512-U9asFRYeo72+6DuNGqdtsMjFi9HrowDrEJw+LKMU8958iYM1SzohB9nm1uAZv7KStxgD5naqgEUdbw9x84yuuA==",
|
|
494
494
|
"license": "Apache-2.0",
|
|
495
495
|
"peer": true,
|
|
496
496
|
"dependencies": {
|
|
@@ -503,9 +503,9 @@
|
|
|
503
503
|
}
|
|
504
504
|
},
|
|
505
505
|
"node_modules/@hono/node-server": {
|
|
506
|
-
"version": "2.1.
|
|
507
|
-
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.
|
|
508
|
-
"integrity": "sha512-
|
|
506
|
+
"version": "2.1.7",
|
|
507
|
+
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.7.tgz",
|
|
508
|
+
"integrity": "sha512-Wr0E6S+v2Bw9FkpGNP5BQ5QbJvclUa06UVehd65WFZe6XeJwbrKQQ5wPDevc0IC+QyzbO7v3Llh5uo45IZcSnA==",
|
|
509
509
|
"license": "MIT",
|
|
510
510
|
"engines": {
|
|
511
511
|
"node": ">=20"
|
|
@@ -870,9 +870,9 @@
|
|
|
870
870
|
"license": "MIT"
|
|
871
871
|
},
|
|
872
872
|
"node_modules/encodeurl": {
|
|
873
|
-
"version": "2.0.
|
|
874
|
-
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.
|
|
875
|
-
"integrity": "sha512-
|
|
873
|
+
"version": "2.0.2",
|
|
874
|
+
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.2.tgz",
|
|
875
|
+
"integrity": "sha512-ddmxiyS6ETq/v5/+mdA4fykK7JgEmqcShrGmQFTaKf5o43tL8XLuMzNLLsspuIC3/qGupS7Ci2TF+feJRkYY0w==",
|
|
876
876
|
"license": "MIT",
|
|
877
877
|
"engines": {
|
|
878
878
|
"node": ">= 0.8"
|
|
@@ -1208,9 +1208,9 @@
|
|
|
1208
1208
|
}
|
|
1209
1209
|
},
|
|
1210
1210
|
"node_modules/hono": {
|
|
1211
|
-
"version": "4.13.
|
|
1212
|
-
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.
|
|
1213
|
-
"integrity": "sha512-
|
|
1211
|
+
"version": "4.13.18",
|
|
1212
|
+
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
|
|
1213
|
+
"integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
|
|
1214
1214
|
"license": "MIT",
|
|
1215
1215
|
"engines": {
|
|
1216
1216
|
"node": ">=16.9.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-shared-browser",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10-next.475.1",
|
|
4
4
|
"description": "One real Chromium session per Paseo workspace, shared live across every connected client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"test:video": "vitest run tests/video.smoke.test.ts --testTimeout=30000"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@getpaseo/plugin": "0.16.0-beta.
|
|
59
|
+
"@getpaseo/plugin": "0.16.0-beta.2",
|
|
60
60
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
61
61
|
"agent-browser": "0.41.2",
|
|
62
62
|
"esbuild": "0.28.2",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@biomejs/biome": "^2.5.10",
|
|
67
|
-
"@getpaseo/server": "0.16.0-beta.
|
|
67
|
+
"@getpaseo/server": "0.16.0-beta.2",
|
|
68
68
|
"@tanstack/react-query": "^5.102.3",
|
|
69
69
|
"@types/node": "^24.10.1",
|
|
70
70
|
"@types/react": "^19.2.18",
|