sunpeak 0.16.7 → 0.16.10

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