sunpeak 0.5.36 → 0.5.39

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.cjs CHANGED
@@ -7511,23 +7511,37 @@ function Conversation({
7511
7511
  api.requestDisplayMode({ mode: "inline" });
7512
7512
  }
7513
7513
  };
7514
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col bg-surface w-full h-full flex-1", children: [
7515
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-subtle bg-surface z-10 grid h-12 grid-cols-[1fr_auto_1fr] border-b px-2", children: [
7516
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-start gap-3", children: /* @__PURE__ */ jsxRuntime.jsx(
7517
- "button",
7518
- {
7519
- onClick: handleClose,
7520
- "aria-label": "Close",
7521
- className: "h-7 w-7 flex items-center justify-center hover:bg-subtle rounded-md transition-colors text-primary",
7522
- type: "button",
7523
- children: /* @__PURE__ */ jsxRuntime.jsx(CloseBold, {})
7524
- }
7525
- ) }),
7526
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
7527
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end" })
7528
- ] }),
7529
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative overflow-hidden flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full w-full max-w-full overflow-auto", children }) }),
7530
- /* @__PURE__ */ jsxRuntime.jsx("footer", { className: "bg-surface", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto px-4 py-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
7514
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col bg-surface w-full h-full flex-1 items-center", children: [
7515
+ /* @__PURE__ */ jsxRuntime.jsxs(
7516
+ "div",
7517
+ {
7518
+ className: "w-full border-subtle bg-surface z-10 grid h-12 grid-cols-[1fr_auto_1fr] border-b px-2",
7519
+ style: { maxWidth: containerWidth },
7520
+ children: [
7521
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-start gap-3", children: /* @__PURE__ */ jsxRuntime.jsx(
7522
+ "button",
7523
+ {
7524
+ onClick: handleClose,
7525
+ "aria-label": "Close",
7526
+ className: "h-7 w-7 flex items-center justify-center hover:bg-subtle rounded-md transition-colors text-primary",
7527
+ type: "button",
7528
+ children: /* @__PURE__ */ jsxRuntime.jsx(CloseBold, {})
7529
+ }
7530
+ ) }),
7531
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
7532
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end" })
7533
+ ]
7534
+ }
7535
+ ),
7536
+ /* @__PURE__ */ jsxRuntime.jsx(
7537
+ "div",
7538
+ {
7539
+ className: "relative overflow-hidden flex-1 w-full",
7540
+ style: { maxWidth: containerWidth },
7541
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full w-full max-w-full overflow-auto", children })
7542
+ }
7543
+ ),
7544
+ /* @__PURE__ */ jsxRuntime.jsx("footer", { className: "bg-surface w-full", style: { maxWidth: containerWidth }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: /* @__PURE__ */ jsxRuntime.jsx(
7531
7545
  "input",
7532
7546
  {
7533
7547
  type: "text",
@@ -7539,18 +7553,25 @@ function Conversation({
7539
7553
  ) }) }) })
7540
7554
  ] });
7541
7555
  }
7542
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col bg-surface w-full h-full flex-1", children: [
7543
- /* @__PURE__ */ jsxRuntime.jsx("header", { className: "h-12 bg-surface flex items-center px-4 text-lg sticky top-0 z-40", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "SimGPT" }) }),
7556
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col bg-surface w-full h-full flex-1 items-center", children: [
7557
+ /* @__PURE__ */ jsxRuntime.jsx(
7558
+ "header",
7559
+ {
7560
+ className: "h-12 bg-surface flex items-center px-4 text-lg sticky top-0 z-40 w-full",
7561
+ style: { maxWidth: containerWidth },
7562
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "SimGPT" })
7563
+ }
7564
+ ),
7544
7565
  /* @__PURE__ */ jsxRuntime.jsxs(
7545
7566
  "div",
7546
7567
  {
7547
- className: "flex flex-col flex-1 mx-auto w-full transition-all duration-200 overflow-hidden",
7568
+ className: "flex flex-col flex-1 w-full transition-all duration-200 overflow-hidden",
7548
7569
  style: { maxWidth: containerWidth },
7549
7570
  children: [
7550
7571
  /* @__PURE__ */ jsxRuntime.jsxs("main", { className: "flex-1 overflow-y-auto overflow-x-hidden", children: [
7551
7572
  /* @__PURE__ */ jsxRuntime.jsxs("article", { className: "text-primary w-full focus:outline-none", dir: "auto", "data-turn": "user", children: [
7552
7573
  /* @__PURE__ */ jsxRuntime.jsx("h5", { className: "sr-only", children: "You said:" }),
7553
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base my-auto mx-auto md:pt-12 px-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex max-w-full flex-col grow", children: /* @__PURE__ */ jsxRuntime.jsx(
7574
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base my-auto mx-auto md:pt-8 px-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex max-w-full flex-col grow", children: /* @__PURE__ */ jsxRuntime.jsx(
7554
7575
  "div",
7555
7576
  {
7556
7577
  "data-message-author-role": "user",
@@ -7583,8 +7604,11 @@ function Conversation({
7583
7604
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden", children: displayMode === "pip" ? /* @__PURE__ */ jsxRuntime.jsxs(
7584
7605
  "div",
7585
7606
  {
7586
- className: "fixed start-4 end-4 top-14 z-50 mx-auto max-w-[48rem] md:start-60 md:end-4 sm:start-0 sm:end-0 sm:w-full overflow-visible",
7587
- style: { maxHeight: "429px" },
7607
+ className: "fixed top-14 z-50 overflow-visible left-1/2 md:left-[calc(50vw+7rem)] -translate-x-1/2 max-w-[calc(100vw-2rem)] md:max-w-[calc(100vw-16rem)]",
7608
+ style: {
7609
+ maxHeight: "429px",
7610
+ width: containerWidth
7611
+ },
7588
7612
  children: [
7589
7613
  /* @__PURE__ */ jsxRuntime.jsx(
7590
7614
  "button",
@@ -7818,6 +7842,7 @@ function ChatGPTSimulator({
7818
7842
  appIcon
7819
7843
  }) {
7820
7844
  const [screenWidth, setScreenWidth] = React__namespace.useState("full");
7845
+ const isMobileWidth = (width) => width === "mobile-s" || width === "mobile-l";
7821
7846
  const getSimulationKey = (sim) => `${sim.resource.name}-${sim.tool.name}`;
7822
7847
  const [selectedKey, setSelectedKey] = React__namespace.useState(
7823
7848
  simulations.length > 0 ? getSimulationKey(simulations[0]) : ""
@@ -7916,6 +7941,11 @@ function ChatGPTSimulator({
7916
7941
  }
7917
7942
  };
7918
7943
  }, []);
7944
+ React.useEffect(() => {
7945
+ if (isMobileWidth(screenWidth) && displayMode === "pip") {
7946
+ mock.setDisplayMode("fullscreen");
7947
+ }
7948
+ }, [screenWidth, displayMode, mock]);
7919
7949
  React.useEffect(() => {
7920
7950
  if (editingField !== "toolInput") {
7921
7951
  setToolInputJson(JSON.stringify(toolInput ?? {}, null, 2));
@@ -8017,7 +8047,14 @@ function ChatGPTSimulator({
8017
8047
  SidebarToggle,
8018
8048
  {
8019
8049
  value: displayMode,
8020
- onChange: (value) => mock.setDisplayMode(value),
8050
+ onChange: (value) => {
8051
+ const newMode = value;
8052
+ if (isMobileWidth(screenWidth) && newMode === "pip") {
8053
+ mock.setDisplayMode("fullscreen");
8054
+ } else {
8055
+ mock.setDisplayMode(newMode);
8056
+ }
8057
+ },
8021
8058
  options: [
8022
8059
  { value: "inline", label: "Inline" },
8023
8060
  { value: "pip", label: "PiP" },