@codeam/shared 2.76.42 → 2.76.44
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/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3266,8 +3266,10 @@ function pointPickerScript(opts) {
|
|
|
3266
3266
|
|
|
3267
3267
|
// Inside a React Native WebView the document is TOP-LEVEL (window.parent ===
|
|
3268
3268
|
// window), so the only way out is the bridge RN injects. It carries STRINGS.
|
|
3269
|
+
// Any mode may answer through it: the host app owns the WebView, there is no
|
|
3270
|
+
// third party to keep out \u2014 only the control API (the door below) needs
|
|
3271
|
+
// \`globalName\`, because a global turns the picker on with nobody's permission.
|
|
3269
3272
|
function rnBridge() {
|
|
3270
|
-
if (!GLOBAL) return null;
|
|
3271
3273
|
var rn = W.ReactNativeWebView;
|
|
3272
3274
|
return rn && typeof rn.postMessage === 'function' ? rn : null;
|
|
3273
3275
|
}
|
|
@@ -3278,13 +3280,17 @@ function pointPickerScript(opts) {
|
|
|
3278
3280
|
msg[FIELD] = CH;
|
|
3279
3281
|
msg.type = type;
|
|
3280
3282
|
if (extra) for (var k in extra) msg[k] = extra[k];
|
|
3283
|
+
// A parent window first (the feed framing the app; a host that installed
|
|
3284
|
+
// one); only a top-level document falls back to the React Native bridge
|
|
3285
|
+
// (2026-11-01: Remix's phone app got no \`on\` and no \`pick\` here).
|
|
3286
|
+
if (W.parent !== W) {
|
|
3287
|
+
try { W.parent.postMessage(msg, driver); } catch (e) {}
|
|
3288
|
+
return;
|
|
3289
|
+
}
|
|
3281
3290
|
var rn = rnBridge();
|
|
3282
3291
|
if (rn) {
|
|
3283
3292
|
try { rn.postMessage(JSON.stringify(msg)); } catch (e) {}
|
|
3284
|
-
return;
|
|
3285
3293
|
}
|
|
3286
|
-
if (W.parent === W) return;
|
|
3287
|
-
try { W.parent.postMessage(msg, driver); } catch (e) {}
|
|
3288
3294
|
}
|
|
3289
3295
|
|
|
3290
3296
|
function clip(s, max) { return s.length > max ? s.slice(0, max - 1) + '\\u2026' : s; }
|