sunpeak 0.16.5 → 0.16.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.
@@ -7562,7 +7562,11 @@ function IframeResource({
7562
7562
  }) {
7563
7563
  const iframeRef = React.useRef(null);
7564
7564
  const hostRef = React.useRef(null);
7565
+ const [loaded, setLoaded] = React.useState(false);
7565
7566
  const resourceUrl = src ?? scriptSrc;
7567
+ React.useEffect(() => {
7568
+ setLoaded(false);
7569
+ }, [resourceUrl]);
7566
7570
  const hasReceivedSizeRef = React.useRef(false);
7567
7571
  const displayModeRef = React.useRef(hostContext?.displayMode);
7568
7572
  displayModeRef.current = hostContext?.displayMode;
@@ -7609,6 +7613,7 @@ function IframeResource({
7609
7613
  } catch {
7610
7614
  }
7611
7615
  }
7616
+ setLoaded(true);
7612
7617
  }, [src, injectOpenAIRuntime]);
7613
7618
  React.useEffect(() => {
7614
7619
  if (hostContext) {
@@ -7682,6 +7687,8 @@ function IframeResource({
7682
7687
  ...borderStyle,
7683
7688
  background: "transparent",
7684
7689
  colorScheme: hostContext?.theme === "light" ? "light dark" : "dark light",
7690
+ opacity: loaded ? 1 : 0,
7691
+ transition: loaded ? "opacity 100ms" : "none",
7685
7692
  width: "100%",
7686
7693
  // Start with minHeight to prevent collapse, but allow auto-resize to set actual height.
7687
7694
  // Don't use height: 100% as it requires explicit height in parent chain.
@@ -7705,6 +7712,8 @@ function IframeResource({
7705
7712
  ...borderStyle,
7706
7713
  background: "transparent",
7707
7714
  colorScheme: hostContext?.theme === "light" ? "light dark" : "dark light",
7715
+ opacity: loaded ? 1 : 0,
7716
+ transition: loaded ? "opacity 100ms" : "none",
7708
7717
  width: "100%",
7709
7718
  // Start with minHeight to prevent collapse, but allow auto-resize to set actual height.
7710
7719
  // Don't use height: 100% as it requires explicit height in parent chain.
@@ -8782,4 +8791,4 @@ exports.getRegisteredHosts = getRegisteredHosts;
8782
8791
  exports.registerHostShell = registerHostShell;
8783
8792
  exports.useSimulatorState = useSimulatorState;
8784
8793
  exports.useThemeContext = useThemeContext;
8785
- //# sourceMappingURL=simulator-DjZNa1MI.cjs.map
8794
+ //# sourceMappingURL=simulator-DYM74GCT.cjs.map