sunpeak 0.13.7 → 0.13.9
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/chatgpt/conversation.d.ts +7 -1
- package/dist/chatgpt/iframe-resource.d.ts +8 -1
- package/dist/chatgpt/index.cjs +1 -1
- package/dist/chatgpt/index.js +1 -1
- package/dist/{index-B9MMk69u.cjs → index-BhfrUoaZ.cjs} +23 -14
- package/dist/index-BhfrUoaZ.cjs.map +1 -0
- package/dist/{index-DqOCq5r8.js → index-D6Z9ZDNT.js} +22 -13
- package/dist/index-D6Z9ZDNT.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/template/.sunpeak/resource-loader.html +0 -13
- package/template/dist/albums/albums.json +1 -1
- package/template/dist/carousel/carousel.json +1 -1
- package/template/dist/map/map.json +1 -1
- package/template/dist/review/review.json +1 -1
- package/template/node_modules/.vite/deps/_metadata.json +25 -25
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/dist/index-B9MMk69u.cjs.map +0 -1
- package/dist/index-DqOCq5r8.js.map +0 -1
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@modelcontextprotocol_ext-apps.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@modelcontextprotocol_ext-apps.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@modelcontextprotocol_ext-apps_app-bridge.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@modelcontextprotocol_ext-apps_app-bridge.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@modelcontextprotocol_ext-apps_react.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@modelcontextprotocol_ext-apps_react.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Avatar.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Avatar.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Button.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Button.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Checkbox.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Checkbox.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Icon.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Icon.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Input.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Input.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_SegmentedControl.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_SegmentedControl.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Select.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Select.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Textarea.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_components_Textarea.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_theme.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/@openai_apps-sdk-ui_theme.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-3FUH6LFP.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-3FUH6LFP.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-4EQ7FTMQ.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-4EQ7FTMQ.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-4WVD247F.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-4WVD247F.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-ABGJ7IDC.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-ABGJ7IDC.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-DP4XHQAG.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-DP4XHQAG.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-EGRHWZRV.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-EGRHWZRV.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-EHI2XMPP.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-EHI2XMPP.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-JWMBYPFX.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-JWMBYPFX.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-PZDCUP6P.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-PZDCUP6P.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-Q2RBUOJ3.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-Q2RBUOJ3.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-SPDZ46BB.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-SPDZ46BB.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-WEIC4XKX.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-WEIC4XKX.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-WSHFT23M.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-WSHFT23M.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-XQARMNNG.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/chunk-XQARMNNG.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/clsx.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/clsx.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/embla-carousel-react.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/embla-carousel-react.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/embla-carousel-wheel-gestures.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/embla-carousel-wheel-gestures.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/mapbox-gl.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/mapbox-gl.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/package.json +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react-dom.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react-dom.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react-dom_client.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react-dom_client.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react_jsx-dev-runtime.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react_jsx-dev-runtime.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react_jsx-runtime.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/react_jsx-runtime.js.map +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/tailwind-merge.js +0 -0
- /package/template/node_modules/.vite-mcp/{deps_temp_78ab0da5 → deps_temp_5401a2b9}/tailwind-merge.js.map +0 -0
|
@@ -11,6 +11,12 @@ interface ConversationProps {
|
|
|
11
11
|
appName?: string;
|
|
12
12
|
appIcon?: string;
|
|
13
13
|
userMessage?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the content is transitioning between display modes.
|
|
16
|
+
* When true, the content area is hidden (opacity 0) to prevent the pip
|
|
17
|
+
* border from flashing at a stale height before the iframe resizes.
|
|
18
|
+
*/
|
|
19
|
+
isTransitioning?: boolean;
|
|
14
20
|
}
|
|
15
21
|
/**
|
|
16
22
|
* Conversation layout that renders children (iframe) at a stable tree position.
|
|
@@ -25,5 +31,5 @@ interface ConversationProps {
|
|
|
25
31
|
* - **fullscreen**: content wrapper becomes `position: fixed` covering the viewport;
|
|
26
32
|
* fullscreen chrome (header/footer) rendered as a separate fixed overlay
|
|
27
33
|
*/
|
|
28
|
-
export declare function Conversation({ children, screenWidth, displayMode, platform, onRequestDisplayMode, appName, appIcon, userMessage, }: ConversationProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function Conversation({ children, screenWidth, displayMode, platform, onRequestDisplayMode, appName, appIcon, userMessage, isTransitioning, }: ConversationProps): import("react/jsx-runtime").JSX.Element;
|
|
29
35
|
export {};
|
|
@@ -67,6 +67,13 @@ interface IframeResourceProps {
|
|
|
67
67
|
className?: string;
|
|
68
68
|
/** Optional style for the iframe */
|
|
69
69
|
style?: React.CSSProperties;
|
|
70
|
+
/**
|
|
71
|
+
* Called after the iframe has rendered following a display mode change.
|
|
72
|
+
* The callback receives the display mode that was confirmed.
|
|
73
|
+
* Used by the simulator to hide content during transitions and only
|
|
74
|
+
* reveal it once the app has committed its DOM for the new mode.
|
|
75
|
+
*/
|
|
76
|
+
onDisplayModeReady?: (mode: string) => void;
|
|
70
77
|
/**
|
|
71
78
|
* Debug: State to inject directly into the app's useAppState hook.
|
|
72
79
|
* This bypasses the normal MCP Apps protocol and is for simulator testing.
|
|
@@ -85,7 +92,7 @@ interface IframeResourceProps {
|
|
|
85
92
|
* connects via PostMessageTransport to window.parent. The parent side uses
|
|
86
93
|
* McpAppHost (wrapping AppBridge) to communicate.
|
|
87
94
|
*/
|
|
88
|
-
export declare function IframeResource({ src, scriptSrc, hostContext, toolInput, toolResult, hostOptions, csp, className, style, debugInjectState, }: IframeResourceProps): import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
export declare function IframeResource({ src, scriptSrc, hostContext, toolInput, toolResult, hostOptions, csp, className, style, onDisplayModeReady, debugInjectState, }: IframeResourceProps): import("react/jsx-runtime").JSX.Element;
|
|
89
96
|
export declare const _testExports: {
|
|
90
97
|
escapeHtml: typeof escapeHtml;
|
|
91
98
|
isAllowedUrl: typeof isAllowedUrl;
|
package/dist/chatgpt/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const chatgpt_index = require("../index-
|
|
3
|
+
const chatgpt_index = require("../index-BhfrUoaZ.cjs");
|
|
4
4
|
const discovery = require("../discovery-CRR3SlyI.cjs");
|
|
5
5
|
exports.ChatGPTSimulator = chatgpt_index.ChatGPTSimulator;
|
|
6
6
|
exports.IframeResource = chatgpt_index.IframeResource;
|
package/dist/chatgpt/index.js
CHANGED
|
@@ -5442,7 +5442,7 @@ const useEscCloseStack = (listening, cb) => {
|
|
|
5442
5442
|
}, [id, listening, latestCallback]);
|
|
5443
5443
|
};
|
|
5444
5444
|
const __vite_import_meta_env__ = { "DEV": false, "MODE": "production" };
|
|
5445
|
-
const META_ENV = typeof { url: typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index-
|
|
5445
|
+
const META_ENV = typeof { url: typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index-BhfrUoaZ.cjs", document.baseURI).href } !== "undefined" ? __vite_import_meta_env__ : void 0;
|
|
5446
5446
|
const NODE_ENV = typeof process !== "undefined" && process.env?.NODE_ENV ? process.env?.NODE_ENV : "production";
|
|
5447
5447
|
const isDev = NODE_ENV === "development" || !!META_ENV?.DEV;
|
|
5448
5448
|
const isJSDomLike = typeof navigator !== "undefined" && /(jsdom|happy-dom)/i.test(navigator.userAgent) || typeof globalThis.happyDOM === "object";
|
|
@@ -7545,7 +7545,8 @@ function Conversation({
|
|
|
7545
7545
|
onRequestDisplayMode,
|
|
7546
7546
|
appName = "Sunpeak",
|
|
7547
7547
|
appIcon,
|
|
7548
|
-
userMessage = "What have you got for me today?"
|
|
7548
|
+
userMessage = "What have you got for me today?",
|
|
7549
|
+
isTransitioning = false
|
|
7549
7550
|
}) {
|
|
7550
7551
|
const isDesktop = platform2 === "desktop";
|
|
7551
7552
|
const containerWidth = screenWidth === "full" ? "100%" : `${SCREEN_WIDTHS[screenWidth]}px`;
|
|
@@ -7667,6 +7668,12 @@ function Conversation({
|
|
|
7667
7668
|
"div",
|
|
7668
7669
|
{
|
|
7669
7670
|
className: isPip ? "h-full w-full max-w-full overflow-auto bg-white dark:bg-[#212121]" : isFullscreen ? "h-full w-full max-w-full overflow-auto bg-surface" : "h-full w-full max-w-full bg-transparent",
|
|
7671
|
+
style: {
|
|
7672
|
+
opacity: isTransitioning ? 0 : 1,
|
|
7673
|
+
// Only animate the reveal — the hide must be instant
|
|
7674
|
+
// to prevent old content from being visible in the new layout.
|
|
7675
|
+
transition: isTransitioning ? "none" : "opacity 100ms"
|
|
7676
|
+
},
|
|
7670
7677
|
children
|
|
7671
7678
|
}
|
|
7672
7679
|
)
|
|
@@ -14449,13 +14456,11 @@ function IframeResource({
|
|
|
14449
14456
|
csp,
|
|
14450
14457
|
className,
|
|
14451
14458
|
style,
|
|
14459
|
+
onDisplayModeReady,
|
|
14452
14460
|
debugInjectState
|
|
14453
14461
|
}) {
|
|
14454
14462
|
const iframeRef = React.useRef(null);
|
|
14455
14463
|
const hostRef = React.useRef(null);
|
|
14456
|
-
const [readyDisplayMode, setReadyDisplayMode] = React.useState(
|
|
14457
|
-
hostContext?.displayMode
|
|
14458
|
-
);
|
|
14459
14464
|
const resourceUrl = src ?? scriptSrc;
|
|
14460
14465
|
const hasReceivedSizeRef = React.useRef(false);
|
|
14461
14466
|
const host = React.useMemo(
|
|
@@ -14469,7 +14474,7 @@ function IframeResource({
|
|
|
14469
14474
|
iframeRef.current.style.height = `${params.height}px`;
|
|
14470
14475
|
}
|
|
14471
14476
|
},
|
|
14472
|
-
onDisplayModeReady: (mode) =>
|
|
14477
|
+
onDisplayModeReady: (mode) => onDisplayModeReady?.(mode)
|
|
14473
14478
|
}),
|
|
14474
14479
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14475
14480
|
[]
|
|
@@ -14528,7 +14533,6 @@ function IframeResource({
|
|
|
14528
14533
|
const theme = hostContext?.theme ?? "dark";
|
|
14529
14534
|
return generateScriptHtml(absoluteScriptSrc, theme, cspPolicy);
|
|
14530
14535
|
}, [scriptSrc, isValidUrl, csp, hostContext?.theme]);
|
|
14531
|
-
const isTransitioning = hostContext?.displayMode !== readyDisplayMode;
|
|
14532
14536
|
if (src) {
|
|
14533
14537
|
if (!isValidUrl) {
|
|
14534
14538
|
console.error("[IframeResource] URL not allowed:", src);
|
|
@@ -14552,10 +14556,6 @@ function IframeResource({
|
|
|
14552
14556
|
// Start with minHeight to prevent collapse, but allow auto-resize to set actual height.
|
|
14553
14557
|
// Don't use height: 100% as it requires explicit height in parent chain.
|
|
14554
14558
|
minHeight: "200px",
|
|
14555
|
-
// Hide during display mode transitions; reveal with a short fade once
|
|
14556
|
-
// the iframe has committed its DOM for the new mode.
|
|
14557
|
-
opacity: isTransitioning ? 0 : 1,
|
|
14558
|
-
transition: isTransitioning ? "none" : "opacity 100ms",
|
|
14559
14559
|
...style
|
|
14560
14560
|
},
|
|
14561
14561
|
title: "Resource Preview",
|
|
@@ -14579,8 +14579,6 @@ function IframeResource({
|
|
|
14579
14579
|
// Start with minHeight to prevent collapse, but allow auto-resize to set actual height.
|
|
14580
14580
|
// Don't use height: 100% as it requires explicit height in parent chain.
|
|
14581
14581
|
minHeight: "200px",
|
|
14582
|
-
opacity: isTransitioning ? 0 : 1,
|
|
14583
|
-
transition: isTransitioning ? "none" : "opacity 100ms",
|
|
14584
14582
|
...style
|
|
14585
14583
|
},
|
|
14586
14584
|
title: "Resource Preview",
|
|
@@ -14706,6 +14704,12 @@ function ChatGPTSimulator({
|
|
|
14706
14704
|
_setDisplayMode(mode);
|
|
14707
14705
|
}
|
|
14708
14706
|
};
|
|
14707
|
+
const [readyDisplayMode, setReadyDisplayMode] = React.useState(
|
|
14708
|
+
urlParams.displayMode ?? DEFAULT_DISPLAY_MODE
|
|
14709
|
+
);
|
|
14710
|
+
const handleDisplayModeReady = React.useCallback((mode) => {
|
|
14711
|
+
setReadyDisplayMode(mode);
|
|
14712
|
+
}, []);
|
|
14709
14713
|
const hostContext = React.useMemo(
|
|
14710
14714
|
() => ({
|
|
14711
14715
|
theme,
|
|
@@ -14797,6 +14801,8 @@ function ChatGPTSimulator({
|
|
|
14797
14801
|
const resourceUrl = selectedSim?.resourceUrl;
|
|
14798
14802
|
const resourceScript = selectedSim?.resourceScript;
|
|
14799
14803
|
const csp = selectedSim ? extractResourceCSP(selectedSim.resource) : void 0;
|
|
14804
|
+
const hasIframeContent = !!(resourceUrl || resourceScript);
|
|
14805
|
+
const isTransitioning = hasIframeContent && displayMode !== readyDisplayMode;
|
|
14800
14806
|
let content;
|
|
14801
14807
|
if (resourceUrl) {
|
|
14802
14808
|
content = /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14810,6 +14816,7 @@ function ChatGPTSimulator({
|
|
|
14810
14816
|
onDisplayModeChange: handleDisplayModeChange,
|
|
14811
14817
|
onUpdateModelContext: handleUpdateModelContext
|
|
14812
14818
|
},
|
|
14819
|
+
onDisplayModeReady: handleDisplayModeReady,
|
|
14813
14820
|
debugInjectState: modelContext,
|
|
14814
14821
|
className: "h-full w-full"
|
|
14815
14822
|
}
|
|
@@ -14827,6 +14834,7 @@ function ChatGPTSimulator({
|
|
|
14827
14834
|
onDisplayModeChange: handleDisplayModeChange,
|
|
14828
14835
|
onUpdateModelContext: handleUpdateModelContext
|
|
14829
14836
|
},
|
|
14837
|
+
onDisplayModeReady: handleDisplayModeReady,
|
|
14830
14838
|
debugInjectState: modelContext,
|
|
14831
14839
|
className: "h-full w-full"
|
|
14832
14840
|
}
|
|
@@ -15052,6 +15060,7 @@ function ChatGPTSimulator({
|
|
|
15052
15060
|
appName,
|
|
15053
15061
|
appIcon,
|
|
15054
15062
|
userMessage: selectedSim?.userMessage,
|
|
15063
|
+
isTransitioning,
|
|
15055
15064
|
children: content
|
|
15056
15065
|
},
|
|
15057
15066
|
selectedSimulationName
|
|
@@ -15134,4 +15143,4 @@ exports.createSimulatorUrl = createSimulatorUrl;
|
|
|
15134
15143
|
exports.extractResourceCSP = extractResourceCSP;
|
|
15135
15144
|
exports.index = index;
|
|
15136
15145
|
exports.useThemeContext = useThemeContext;
|
|
15137
|
-
//# sourceMappingURL=index-
|
|
15146
|
+
//# sourceMappingURL=index-BhfrUoaZ.cjs.map
|