@mcpjam/widget-react 0.1.3 → 0.1.4
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 +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3231,7 +3231,7 @@ function MCPAppsRendererSurface({
|
|
|
3231
3231
|
});
|
|
3232
3232
|
return { mode: granted };
|
|
3233
3233
|
}
|
|
3234
|
-
if (requestedMode !== "inline" && userPreferInlineRef.current) {
|
|
3234
|
+
if (requestedMode !== "inline" && policy === "user-initiated-only" && userPreferInlineRef.current) {
|
|
3235
3235
|
logWidgetDebug("ui-to-host", "ui/request-display-mode", {
|
|
3236
3236
|
requested: requestedMode,
|
|
3237
3237
|
granted: "inline",
|
|
@@ -3244,10 +3244,16 @@ function MCPAppsRendererSurface({
|
|
|
3244
3244
|
);
|
|
3245
3245
|
const isMobile = isPlaygroundActiveRef.current ? playgroundDeviceTypeRef.current === "mobile" || playgroundDeviceTypeRef.current === "tablet" : true;
|
|
3246
3246
|
const mobileAdjustedMode = isMobile && requestedMode === "pip" ? "fullscreen" : requestedMode;
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3247
|
+
if (!hostAvailableModes.includes(mobileAdjustedMode)) {
|
|
3248
|
+
const granted = effectiveDisplayModeRef.current;
|
|
3249
|
+
logWidgetDebug("ui-to-host", "ui/request-display-mode", {
|
|
3250
|
+
requested: requestedMode,
|
|
3251
|
+
granted,
|
|
3252
|
+
reason: "mode-unavailable"
|
|
3253
|
+
});
|
|
3254
|
+
return { mode: granted };
|
|
3255
|
+
}
|
|
3256
|
+
const actualMode = mobileAdjustedMode;
|
|
3251
3257
|
setDisplayModeRef.current(actualMode);
|
|
3252
3258
|
if (actualMode === "pip") {
|
|
3253
3259
|
onRequestPipRef.current?.(displayWidgetIdRef.current);
|