sunpeak 0.5.39 → 0.6.1

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.
Files changed (42) hide show
  1. package/README.md +1 -0
  2. package/bin/commands/build.mjs +4 -4
  3. package/dist/chatgpt/globals.css +7 -0
  4. package/dist/chatgpt/mock-openai.d.ts +2 -2
  5. package/dist/chatgpt/simple-sidebar.d.ts +2 -1
  6. package/dist/hooks/use-max-height.d.ts +1 -1
  7. package/dist/index.cjs +235 -150
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +235 -150
  10. package/dist/index.js.map +1 -1
  11. package/dist/providers/openai/types.d.ts +1 -1
  12. package/dist/providers/types.d.ts +1 -1
  13. package/dist/style.css +201 -38
  14. package/package.json +1 -1
  15. package/template/.sunpeak/dev.tsx +2 -2
  16. package/template/README.md +3 -3
  17. package/template/dist/chatgpt/albums.js +11 -11
  18. package/template/dist/chatgpt/carousel.js +2 -2
  19. package/template/dist/chatgpt/counter.js +7 -7
  20. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js +2 -2
  21. package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +9 -9
  22. package/template/node_modules/.vite/deps/_metadata.json +22 -22
  23. package/template/node_modules/.vite/deps/{chunk-EVJ3DVH5.js → chunk-DQAZDQU3.js} +5 -5
  24. package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  25. package/template/src/components/album/albums.test.tsx +7 -2
  26. package/template/src/components/album/albums.tsx +1 -1
  27. package/template/src/components/album/fullscreen-viewer.test.tsx +12 -24
  28. package/template/src/components/album/fullscreen-viewer.tsx +30 -71
  29. package/template/src/components/carousel/carousel.tsx +1 -1
  30. package/template/src/components/index.ts +0 -1
  31. package/template/src/{components/resources → resources}/albums-resource.test.tsx +1 -1
  32. package/template/src/{components/resources → resources}/albums-resource.tsx +2 -1
  33. package/template/src/{components/resources → resources}/carousel-resource.test.tsx +2 -2
  34. package/template/src/{components/resources → resources}/carousel-resource.tsx +2 -2
  35. package/template/src/{components/resources → resources}/counter-resource.tsx +8 -0
  36. package/template/src/simulations/albums-simulation.ts +5 -1
  37. package/template/src/simulations/carousel-simulation.ts +5 -1
  38. package/template/src/simulations/counter-simulation.ts +6 -1
  39. package/template/src/simulations/widget-config.ts +42 -0
  40. /package/template/node_modules/.vite/deps/{chunk-EVJ3DVH5.js.map → chunk-DQAZDQU3.js.map} +0 -0
  41. /package/template/src/{components/resources → resources}/counter-resource.test.tsx +0 -0
  42. /package/template/src/{components/resources → resources}/index.ts +0 -0
package/dist/index.js CHANGED
@@ -5687,6 +5687,7 @@ const preventDefaultHandler = (evt) => {
5687
5687
  };
5688
5688
  const Check = (props) => jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: jsx("path", { fillRule: "evenodd", d: "M18.063 5.674a1 1 0 0 1 .263 1.39l-7.5 11a1 1 0 0 1-1.533.143l-4.5-4.5a1 1 0 1 1 1.414-1.414l3.647 3.647 6.82-10.003a1 1 0 0 1 1.39-.263Z", clipRule: "evenodd" }) });
5689
5689
  const ChevronDownVector = (props) => jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 16 9", fill: "currentColor", ...props, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.292893 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L8 6.58579L14.2929 0.292894C14.6834 -0.0976305 15.3166 -0.0976304 15.7071 0.292894C16.0976 0.683418 16.0976 1.31658 15.7071 1.70711L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z" }) });
5690
+ const ChevronRight = (props) => jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: jsx("path", { fillRule: "evenodd", d: "M8.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L14.586 12 8.293 5.707a1 1 0 0 1 0-1.414Z", clipRule: "evenodd" }) });
5690
5691
  const CloseBold = (props) => jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.83071 5.83077C6.33839 5.32309 7.16151 5.32309 7.66919 5.83077L12 10.1615L16.3307 5.83077C16.8384 5.32309 17.6615 5.32309 18.1692 5.83077C18.6769 6.33845 18.6769 7.16157 18.1692 7.66925L13.8384 12L18.1692 16.3308C18.6769 16.8385 18.6769 17.6616 18.1692 18.1693C17.6615 18.6769 16.8384 18.6769 16.3307 18.1693L12 13.8385L7.66919 18.1693C7.16151 18.6769 6.33839 18.6769 5.83071 18.1693C5.32303 17.6616 5.32303 16.8385 5.83071 16.3308L10.1615 12L5.83071 7.66925C5.32303 7.16157 5.32303 6.33845 5.83071 5.83077Z", fill: "currentColor" }) });
5691
5692
  const DropdownVector = (props) => jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 10 16", fill: "currentColor", ...props, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.34151 0.747423C4.71854 0.417526 5.28149 0.417526 5.65852 0.747423L9.65852 4.24742C10.0742 4.61111 10.1163 5.24287 9.75259 5.6585C9.38891 6.07414 8.75715 6.11626 8.34151 5.75258L5.00001 2.82877L1.65852 5.75258C1.24288 6.11626 0.61112 6.07414 0.247438 5.6585C-0.116244 5.24287 -0.0741267 4.61111 0.34151 4.24742L4.34151 0.747423ZM0.246065 10.3578C0.608879 9.94139 1.24055 9.89795 1.65695 10.2608L5.00001 13.1737L8.34308 10.2608C8.75948 9.89795 9.39115 9.94139 9.75396 10.3578C10.1168 10.7742 10.0733 11.4058 9.65695 11.7687L5.65695 15.2539C5.28043 15.582 4.7196 15.582 4.34308 15.2539L0.343082 11.7687C-0.0733128 11.4058 -0.116749 10.7742 0.246065 10.3578Z" }) });
5692
5693
  const Info = (props) => jsxs("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "currentColor", ...props, children: [jsx("path", { d: "M13 12a1 1 0 1 0-2 0v4a1 1 0 1 0 2 0v-4Zm-1-2.5A1.25 1.25 0 1 0 12 7a1.25 1.25 0 0 0 0 2.5Z" }), jsx("path", { fillRule: "evenodd", d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z", clipRule: "evenodd" })] });
@@ -7359,12 +7360,78 @@ const Segment = ({ children, ...restProps }) => {
7359
7360
  };
7360
7361
  SegmentedControl.Option = Segment;
7361
7362
  function SimpleSidebar({ children, controls }) {
7362
- return /* @__PURE__ */ jsxs("div", { className: "flex h-screen w-full overflow-hidden", children: [
7363
- /* @__PURE__ */ jsx("aside", { className: "max-md:hidden md:flex w-56 flex-col border-r border-subtle bg-sidebar overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto min-h-0 px-3 pb-3 pt-0", children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsxs("div", { children: [
7364
- /* @__PURE__ */ jsx("h2", { className: "text-xs font-semibold sticky top-0 bg-sidebar z-10 py-2", children: "Controls" }),
7365
- controls
7366
- ] }) }) }) }),
7367
- /* @__PURE__ */ jsx("main", { className: "flex-1 overflow-auto", children })
7363
+ const [isDrawerOpen, setIsDrawerOpen] = React.useState(false);
7364
+ return /* @__PURE__ */ jsxs("div", { className: "sunpeak-simulator-root flex h-screen w-full overflow-hidden relative", children: [
7365
+ isDrawerOpen && /* @__PURE__ */ jsx(
7366
+ "div",
7367
+ {
7368
+ className: "md:hidden fixed inset-0 bg-black/50 z-40 pointer-events-auto",
7369
+ onClick: (e) => {
7370
+ if (e.target === e.currentTarget) {
7371
+ setIsDrawerOpen(false);
7372
+ }
7373
+ }
7374
+ }
7375
+ ),
7376
+ /* @__PURE__ */ jsx(
7377
+ "aside",
7378
+ {
7379
+ className: `
7380
+ w-56 flex flex-col border-r border-subtle bg-sidebar
7381
+ md:relative md:z-auto
7382
+ max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-[100]
7383
+ max-md:transition-transform max-md:duration-300
7384
+ ${isDrawerOpen ? "max-md:translate-x-0" : "max-md:-translate-x-full"}
7385
+ `,
7386
+ children: /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto min-h-0 px-3 pb-3 pt-0", children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: /* @__PURE__ */ jsxs("div", { children: [
7387
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between sticky top-0 bg-sidebar z-10 py-2", children: [
7388
+ /* @__PURE__ */ jsx("h2", { className: "text-xs font-semibold", children: "Controls" }),
7389
+ /* @__PURE__ */ jsx(
7390
+ "button",
7391
+ {
7392
+ onClick: () => setIsDrawerOpen(false),
7393
+ className: "md:hidden text-secondary hover:text-primary transition-colors p-1",
7394
+ type: "button",
7395
+ "aria-label": "Close sidebar",
7396
+ children: /* @__PURE__ */ jsx(
7397
+ "svg",
7398
+ {
7399
+ width: "16",
7400
+ height: "16",
7401
+ viewBox: "0 0 16 16",
7402
+ fill: "none",
7403
+ xmlns: "http://www.w3.org/2000/svg",
7404
+ children: /* @__PURE__ */ jsx(
7405
+ "path",
7406
+ {
7407
+ d: "M12 4L4 12M4 4L12 12",
7408
+ stroke: "currentColor",
7409
+ strokeWidth: "2",
7410
+ strokeLinecap: "round"
7411
+ }
7412
+ )
7413
+ }
7414
+ )
7415
+ }
7416
+ )
7417
+ ] }),
7418
+ controls
7419
+ ] }) }) })
7420
+ }
7421
+ ),
7422
+ /* @__PURE__ */ jsxs("main", { className: "flex-1 overflow-auto relative", children: [
7423
+ /* @__PURE__ */ jsx(
7424
+ "button",
7425
+ {
7426
+ onClick: () => setIsDrawerOpen(true),
7427
+ className: "md:hidden fixed top-18 left-0 z-30 bg-sidebar border-r border-t border-b border-subtle rounded-r-md p-2 shadow-lg hover:bg-primary/10 transition-colors",
7428
+ type: "button",
7429
+ "aria-label": "Open sidebar",
7430
+ children: /* @__PURE__ */ jsx(ChevronRight, {})
7431
+ }
7432
+ ),
7433
+ children
7434
+ ] })
7368
7435
  ] });
7369
7436
  }
7370
7437
  function SidebarControl({ label, children }) {
@@ -7408,7 +7475,13 @@ function SidebarSelect({ value, onChange, options, placeholder }) {
7408
7475
  }
7409
7476
  );
7410
7477
  }
7411
- function SidebarInput({ value, onChange, placeholder, type = "text" }) {
7478
+ function SidebarInput({
7479
+ value,
7480
+ onChange,
7481
+ placeholder,
7482
+ type = "text",
7483
+ disabled = false
7484
+ }) {
7412
7485
  return /* @__PURE__ */ jsx(
7413
7486
  Input,
7414
7487
  {
@@ -7416,7 +7489,8 @@ function SidebarInput({ value, onChange, placeholder, type = "text" }) {
7416
7489
  value,
7417
7490
  onChange: (e) => onChange(e.target.value),
7418
7491
  placeholder,
7419
- size: "2xs"
7492
+ size: "2xs",
7493
+ disabled
7420
7494
  }
7421
7495
  );
7422
7496
  }
@@ -7492,144 +7566,148 @@ function Conversation({
7492
7566
  api.requestDisplayMode({ mode: "inline" });
7493
7567
  }
7494
7568
  };
7495
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col bg-surface w-full h-full flex-1 items-center", children: [
7496
- /* @__PURE__ */ jsxs(
7497
- "div",
7498
- {
7499
- className: "w-full border-subtle bg-surface z-10 grid h-12 grid-cols-[1fr_auto_1fr] border-b px-2",
7500
- style: { maxWidth: containerWidth },
7501
- children: [
7502
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-start gap-3", children: /* @__PURE__ */ jsx(
7503
- "button",
7504
- {
7505
- onClick: handleClose,
7506
- "aria-label": "Close",
7507
- className: "h-7 w-7 flex items-center justify-center hover:bg-subtle rounded-md transition-colors text-primary",
7508
- type: "button",
7509
- children: /* @__PURE__ */ jsx(CloseBold, {})
7510
- }
7511
- ) }),
7512
- /* @__PURE__ */ jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
7513
- /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end" })
7514
- ]
7515
- }
7516
- ),
7517
- /* @__PURE__ */ jsx(
7518
- "div",
7519
- {
7520
- className: "relative overflow-hidden flex-1 w-full",
7521
- style: { maxWidth: containerWidth },
7522
- children: /* @__PURE__ */ jsx("div", { className: "h-full w-full max-w-full overflow-auto", children })
7523
- }
7524
- ),
7525
- /* @__PURE__ */ jsx("footer", { className: "bg-surface w-full", style: { maxWidth: containerWidth }, children: /* @__PURE__ */ jsx("div", { className: "px-4 py-4", children: /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
7526
- "input",
7527
- {
7528
- type: "text",
7529
- name: "userInput",
7530
- disabled: true,
7531
- placeholder: "Message SimGPT",
7532
- className: "w-full bg-[var(--color-background-primary)] dark:bg-[#303030] text-secondary-foreground placeholder:text-muted-foreground rounded-3xl px-5 py-3 pr-12 shadow-md light:border border-[#0000000f]"
7533
- }
7534
- ) }) }) })
7535
- ] });
7536
- }
7537
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col bg-surface w-full h-full flex-1 items-center", children: [
7538
- /* @__PURE__ */ jsx(
7539
- "header",
7540
- {
7541
- className: "h-12 bg-surface flex items-center px-4 text-lg sticky top-0 z-40 w-full",
7542
- style: { maxWidth: containerWidth },
7543
- children: /* @__PURE__ */ jsx("span", { className: "text-primary", children: "SimGPT" })
7544
- }
7545
- ),
7546
- /* @__PURE__ */ jsxs(
7569
+ return /* @__PURE__ */ jsx(
7547
7570
  "div",
7548
7571
  {
7549
- className: "flex flex-col flex-1 w-full transition-all duration-200 overflow-hidden",
7550
- style: { maxWidth: containerWidth },
7551
- children: [
7552
- /* @__PURE__ */ jsxs("main", { className: "flex-1 overflow-y-auto overflow-x-hidden", children: [
7553
- /* @__PURE__ */ jsxs("article", { className: "text-primary w-full focus:outline-none", dir: "auto", "data-turn": "user", children: [
7554
- /* @__PURE__ */ jsx("h5", { className: "sr-only", children: "You said:" }),
7555
- /* @__PURE__ */ jsx("div", { className: "text-base my-auto mx-auto md:pt-8 px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex max-w-full flex-col grow", children: /* @__PURE__ */ jsx(
7556
- "div",
7572
+ className: "flex flex-col bg-surface w-full h-full flex-1 items-center relative",
7573
+ style: { transform: "translate(0)" },
7574
+ children: /* @__PURE__ */ jsxs(
7575
+ "div",
7576
+ {
7577
+ className: "no-scrollbar fixed start-0 end-0 top-0 bottom-0 z-50 mx-auto flex w-auto flex-col overflow-hidden",
7578
+ style: { maxWidth: containerWidth },
7579
+ children: [
7580
+ /* @__PURE__ */ jsxs("div", { className: "border-subtle bg-token-bg-primary sm:bg-token-bg-primary z-10 grid h-[3.25rem] grid-cols-[1fr_auto_1fr] border-b px-2", children: [
7581
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-start gap-3", children: /* @__PURE__ */ jsx(
7582
+ "button",
7583
+ {
7584
+ onClick: handleClose,
7585
+ "aria-label": "Close",
7586
+ className: "h-7 w-7 flex items-center justify-center hover:bg-subtle rounded-md transition-colors text-primary",
7587
+ type: "button",
7588
+ children: /* @__PURE__ */ jsx(CloseBold, {})
7589
+ }
7590
+ ) }),
7591
+ /* @__PURE__ */ jsx("div", { className: "text-primary flex items-center justify-center text-base", children: appName }),
7592
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end" })
7593
+ ] }),
7594
+ /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden flex-1 min-h-0", children: /* @__PURE__ */ jsx("div", { className: "h-full w-full max-w-full overflow-auto", children }) }),
7595
+ /* @__PURE__ */ jsx("footer", { className: "bg-surface", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto px-4 py-4", children: /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
7596
+ "input",
7557
7597
  {
7558
- "data-message-author-role": "user",
7559
- className: "min-h-8 relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal",
7560
- children: /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden items-end", children: /* @__PURE__ */ jsx("div", { className: "bg-[var(--color-background-primary-soft)] relative rounded-[18px] px-4 py-3 max-w-[70%]", children: /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap", children: userMessage }) }) })
7598
+ type: "text",
7599
+ name: "userInput",
7600
+ disabled: true,
7601
+ placeholder: "Message SimGPT",
7602
+ className: "w-full dark:bg-[#303030] text-secondary-foreground placeholder:text-muted-foreground rounded-3xl px-5 py-3 pr-12 shadow-md light:border border-[#0000000f]"
7561
7603
  }
7562
7604
  ) }) }) })
7563
- ] }),
7564
- /* @__PURE__ */ jsxs(
7565
- "article",
7566
- {
7567
- className: "text-primary w-full focus:outline-none",
7568
- dir: "auto",
7569
- "data-turn": "assistant",
7570
- children: [
7571
- /* @__PURE__ */ jsxs("h6", { className: "sr-only", children: [
7572
- appName,
7573
- " said:"
7574
- ] }),
7575
- /* @__PURE__ */ jsx("div", { className: "text-base my-auto mx-auto pb-10 px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "flex max-w-full flex-col grow", children: [
7576
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 my-3", children: [
7577
- appIcon ? /* @__PURE__ */ jsx("div", { className: "size-6 flex items-center justify-center text-base", children: appIcon }) : /* @__PURE__ */ jsx("div", { className: "size-6 rounded-full bg-primary flex items-center justify-center text-primary-foreground font-medium text-xs", children: "AI" }),
7578
- /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: appName })
7579
- ] }),
7580
- /* @__PURE__ */ jsx(
7581
- "div",
7582
- {
7583
- "data-message-author-role": "assistant",
7584
- className: "min-h-8 relative flex w-full flex-col items-start gap-2 text-start break-words whitespace-normal",
7585
- children: /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden", children: displayMode === "pip" ? /* @__PURE__ */ jsxs(
7605
+ ]
7606
+ }
7607
+ )
7608
+ }
7609
+ );
7610
+ }
7611
+ return /* @__PURE__ */ jsxs(
7612
+ "div",
7613
+ {
7614
+ className: "flex flex-col bg-surface w-full h-full flex-1 items-center relative",
7615
+ style: { transform: "translate(0)" },
7616
+ children: [
7617
+ /* @__PURE__ */ jsx(
7618
+ "header",
7619
+ {
7620
+ className: "h-12 bg-surface flex items-center px-4 text-lg sticky top-0 z-40 w-full",
7621
+ style: { maxWidth: containerWidth },
7622
+ children: /* @__PURE__ */ jsx("span", { className: "text-primary", children: "SimGPT" })
7623
+ }
7624
+ ),
7625
+ /* @__PURE__ */ jsxs(
7626
+ "div",
7627
+ {
7628
+ className: "flex flex-col flex-1 w-full transition-all duration-200 overflow-hidden",
7629
+ style: { maxWidth: containerWidth },
7630
+ children: [
7631
+ /* @__PURE__ */ jsxs("main", { className: "flex-1 overflow-y-auto overflow-x-hidden", children: [
7632
+ /* @__PURE__ */ jsxs("article", { className: "text-primary w-full focus:outline-none", dir: "auto", "data-turn": "user", children: [
7633
+ /* @__PURE__ */ jsx("h5", { className: "sr-only", children: "You said:" }),
7634
+ /* @__PURE__ */ jsx("div", { className: "text-base my-auto mx-auto md:pt-8 px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsx("div", { className: "flex max-w-full flex-col grow", children: /* @__PURE__ */ jsx(
7635
+ "div",
7636
+ {
7637
+ "data-message-author-role": "user",
7638
+ className: "min-h-8 relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal",
7639
+ children: /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden items-end", children: /* @__PURE__ */ jsx("div", { className: "bg-[var(--color-background-primary-soft)] relative rounded-[18px] px-4 py-3 max-w-[70%]", children: /* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap", children: userMessage }) }) })
7640
+ }
7641
+ ) }) }) })
7642
+ ] }),
7643
+ /* @__PURE__ */ jsxs(
7644
+ "article",
7645
+ {
7646
+ className: "text-primary w-full focus:outline-none",
7647
+ dir: "auto",
7648
+ "data-turn": "assistant",
7649
+ children: [
7650
+ /* @__PURE__ */ jsxs("h6", { className: "sr-only", children: [
7651
+ appName,
7652
+ " said:"
7653
+ ] }),
7654
+ /* @__PURE__ */ jsx("div", { className: "text-base my-auto mx-auto pb-10 px-4", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto flex-1 relative flex w-full min-w-0 flex-col", children: /* @__PURE__ */ jsxs("div", { className: "flex max-w-full flex-col grow", children: [
7655
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 my-3", children: [
7656
+ appIcon ? /* @__PURE__ */ jsx("div", { className: "size-6 flex items-center justify-center text-base", children: appIcon }) : /* @__PURE__ */ jsx("div", { className: "size-6 rounded-full bg-primary flex items-center justify-center text-primary-foreground font-medium text-xs", children: "AI" }),
7657
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: appName })
7658
+ ] }),
7659
+ /* @__PURE__ */ jsx(
7586
7660
  "div",
7587
7661
  {
7588
- 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)]",
7589
- style: {
7590
- maxHeight: "429px",
7591
- width: containerWidth
7592
- },
7593
- children: [
7594
- /* @__PURE__ */ jsx(
7595
- "button",
7596
- {
7597
- onClick: () => {
7598
- if (api == null ? void 0 : api.requestDisplayMode) {
7599
- api.requestDisplayMode({ mode: "inline" });
7662
+ "data-message-author-role": "assistant",
7663
+ className: "min-h-8 relative flex w-full flex-col items-start gap-2 text-start break-words whitespace-normal",
7664
+ children: /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-1 empty:hidden", children: displayMode === "pip" ? /* @__PURE__ */ jsxs(
7665
+ "div",
7666
+ {
7667
+ className: "no-scrollbar @w-xl/main:top-4 fixed start-4 end-4 top-12 z-50 mx-auto max-w-[40rem] lg:max-w-[48rem] sm:start-0 sm:end-0 sm:top-[3.25rem] sm:w-full overflow-visible",
7668
+ style: { maxHeight: "480px" },
7669
+ children: [
7670
+ /* @__PURE__ */ jsx(
7671
+ "button",
7672
+ {
7673
+ onClick: () => {
7674
+ if (api == null ? void 0 : api.requestDisplayMode) {
7675
+ api.requestDisplayMode({ mode: "inline" });
7676
+ }
7677
+ },
7678
+ className: "absolute -start-2 -top-1.5 z-10 rounded-full bg-[#3a3a3a] p-1.5 text-white shadow-[0px_0px_0px_1px_#fff3,0px_4px_12px_rgba(0,0,0,0.12)] hover:bg-[#6a6a6a]",
7679
+ "aria-label": "Close picture-in-picture",
7680
+ type: "button",
7681
+ children: /* @__PURE__ */ jsx(CloseBold, { className: "h-4 w-4" })
7600
7682
  }
7601
- },
7602
- className: "absolute -start-2 -top-1.5 z-10 rounded-full bg-[#3a3a3a] p-1.5 text-white shadow-[0px_0px_0px_1px_var(--border-heavy),0px_4px_12px_rgba(0,0,0,0.12)] hover:bg-[#6a6a6a]",
7603
- "aria-label": "Close picture-in-picture",
7604
- type: "button",
7605
- children: /* @__PURE__ */ jsx(CloseBold, { className: "h-4 w-4" })
7606
- }
7607
- ),
7608
- /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden h-full rounded-2xl sm:rounded-3xl shadow-[0px_0px_0px_1px_var(--border-heavy),0px_6px_20px_rgba(0,0,0,0.1)] border border-subtle", children: /* @__PURE__ */ jsx("div", { className: "h-full w-full max-w-full overflow-auto bg-surface", children }) })
7609
- ]
7683
+ ),
7684
+ /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden h-full rounded-2xl sm:rounded-3xl shadow-[0px_0px_0px_1px_#fff3,0px_6px_20px_rgba(0,0,0,0.1)] md:-mx-4", children: /* @__PURE__ */ jsx("div", { className: "h-full w-full max-w-full overflow-auto bg-white dark:bg-[#212121]", children }) })
7685
+ ]
7686
+ }
7687
+ ) : /* @__PURE__ */ jsx("div", { className: "no-scrollbar relative mb-2 @w-sm/main:w-full mx-0 max-sm:-mx-[1rem] max-sm:w-[100cqw] max-sm:overflow-hidden overflow-visible", children: /* @__PURE__ */ jsx("div", { className: "relative overflow-hidden h-full", children }) }) })
7610
7688
  }
7611
- ) : /* @__PURE__ */ jsx("div", { className: "w-full overflow-x-auto", children }) })
7612
- }
7613
- )
7614
- ] }) }) })
7615
- ]
7616
- }
7617
- )
7618
- ] }),
7619
- /* @__PURE__ */ jsx("footer", { className: "bg-surface", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto px-4 py-4", children: /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
7620
- "input",
7621
- {
7622
- type: "text",
7623
- name: "userInput",
7624
- disabled: true,
7625
- placeholder: "Message SimGPT",
7626
- className: "w-full bg-[var(--color-background-primary)] dark:bg-[#303030] text-secondary-foreground placeholder:text-muted-foreground rounded-3xl px-5 py-3 pr-12 shadow-md light:border border-[#0000000f]"
7627
- }
7628
- ) }) }) })
7629
- ]
7630
- }
7631
- )
7632
- ] });
7689
+ )
7690
+ ] }) }) })
7691
+ ]
7692
+ }
7693
+ )
7694
+ ] }),
7695
+ /* @__PURE__ */ jsx("footer", { className: "bg-surface", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto px-4 py-4", children: /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(
7696
+ "input",
7697
+ {
7698
+ type: "text",
7699
+ name: "userInput",
7700
+ disabled: true,
7701
+ placeholder: "Message SimGPT",
7702
+ className: "w-full dark:bg-[#303030] text-secondary-foreground placeholder:text-muted-foreground rounded-3xl px-5 py-3 pr-12 shadow-md light:border border-[#0000000f]"
7703
+ }
7704
+ ) }) }) })
7705
+ ]
7706
+ }
7707
+ )
7708
+ ]
7709
+ }
7710
+ );
7633
7711
  }
7634
7712
  class MockOpenAI {
7635
7713
  constructor() {
@@ -7642,7 +7720,7 @@ class MockOpenAI {
7642
7720
  }
7643
7721
  });
7644
7722
  __publicField(this, "locale", "en-US");
7645
- __publicField(this, "maxHeight", 600);
7723
+ __publicField(this, "maxHeight");
7646
7724
  __publicField(this, "displayMode", "inline");
7647
7725
  __publicField(this, "safeArea", {
7648
7726
  insets: {
@@ -7703,7 +7781,8 @@ class MockOpenAI {
7703
7781
  }
7704
7782
  setDisplayMode(displayMode) {
7705
7783
  this.displayMode = displayMode;
7706
- this.emitUpdate({ displayMode });
7784
+ this.maxHeight = displayMode === "pip" ? 480 : void 0;
7785
+ this.emitUpdate({ displayMode, maxHeight: this.maxHeight });
7707
7786
  }
7708
7787
  setSafeArea(safeArea) {
7709
7788
  this.safeArea = safeArea;
@@ -7838,7 +7917,7 @@ function ChatGPTSimulator({
7838
7917
  []
7839
7918
  );
7840
7919
  useEffect(() => {
7841
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
7920
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
7842
7921
  if (selectedSim) {
7843
7922
  if (((_a2 = selectedSim.simulationGlobals) == null ? void 0 : _a2.theme) !== void 0) {
7844
7923
  mock.theme = selectedSim.simulationGlobals.theme;
@@ -7852,12 +7931,13 @@ function ChatGPTSimulator({
7852
7931
  }
7853
7932
  mock.userAgent = ((_c = selectedSim.simulationGlobals) == null ? void 0 : _c.userAgent) ?? mock.userAgent;
7854
7933
  mock.locale = ((_d = selectedSim.simulationGlobals) == null ? void 0 : _d.locale) ?? "en-US";
7855
- mock.maxHeight = ((_e = selectedSim.simulationGlobals) == null ? void 0 : _e.maxHeight) ?? 600;
7856
- mock.safeArea = ((_f = selectedSim.simulationGlobals) == null ? void 0 : _f.safeArea) ?? mock.safeArea;
7857
- mock.view = ((_g = selectedSim.simulationGlobals) == null ? void 0 : _g.view) ?? null;
7858
- mock.toolInput = ((_h = selectedSim.simulationGlobals) == null ? void 0 : _h.toolInput) ?? {};
7859
- mock.widgetState = ((_i = selectedSim.simulationGlobals) == null ? void 0 : _i.widgetState) ?? null;
7860
- mock.toolOutput = ((_j = selectedSim.toolCall) == null ? void 0 : _j.structuredContent) ?? null;
7934
+ const currentDisplayMode = ((_e = selectedSim.simulationGlobals) == null ? void 0 : _e.displayMode) ?? DEFAULT_DISPLAY_MODE;
7935
+ mock.maxHeight = currentDisplayMode === "pip" ? ((_f = selectedSim.simulationGlobals) == null ? void 0 : _f.maxHeight) ?? 480 : void 0;
7936
+ mock.safeArea = ((_g = selectedSim.simulationGlobals) == null ? void 0 : _g.safeArea) ?? mock.safeArea;
7937
+ mock.view = ((_h = selectedSim.simulationGlobals) == null ? void 0 : _h.view) ?? null;
7938
+ mock.toolInput = ((_i = selectedSim.simulationGlobals) == null ? void 0 : _i.toolInput) ?? {};
7939
+ mock.widgetState = ((_j = selectedSim.simulationGlobals) == null ? void 0 : _j.widgetState) ?? null;
7940
+ mock.toolOutput = ((_k = selectedSim.toolCall) == null ? void 0 : _k.structuredContent) ?? null;
7861
7941
  }
7862
7942
  }, [selectedKey, selectedSim, mock]);
7863
7943
  const theme = useTheme() ?? DEFAULT_THEME;
@@ -8052,13 +8132,18 @@ function ChatGPTSimulator({
8052
8132
  placeholder: "e.g. en-US"
8053
8133
  }
8054
8134
  ) }),
8055
- /* @__PURE__ */ jsx(SidebarControl, { label: "Max Height", children: /* @__PURE__ */ jsx(
8135
+ /* @__PURE__ */ jsx(SidebarControl, { label: "Max Height (PiP)", children: /* @__PURE__ */ jsx(
8056
8136
  SidebarInput,
8057
8137
  {
8058
8138
  type: "number",
8059
- value: String(maxHeight),
8060
- onChange: (value) => mock.setMaxHeight(Number(value)),
8061
- placeholder: "600"
8139
+ value: displayMode === "pip" && maxHeight !== void 0 ? String(maxHeight) : "",
8140
+ onChange: (value) => {
8141
+ if (displayMode === "pip") {
8142
+ mock.setMaxHeight(value ? Number(value) : 480);
8143
+ }
8144
+ },
8145
+ placeholder: displayMode === "pip" ? "480" : "-",
8146
+ disabled: displayMode !== "pip"
8062
8147
  }
8063
8148
  ) })
8064
8149
  ] }),