sunpeak 0.3.7 → 0.4.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 (32) hide show
  1. package/README.md +28 -36
  2. package/dist/chatgpt/chatgpt-simulator.d.ts +13 -3
  3. package/dist/chatgpt/index.d.ts +1 -0
  4. package/dist/index.cjs +24 -6
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.js +24 -6
  7. package/dist/index.js.map +1 -1
  8. package/dist/style.css +179 -7
  9. package/package.json +1 -1
  10. package/template/README.md +2 -14
  11. package/template/data/albums.json +112 -0
  12. package/template/data/places.json +49 -0
  13. package/template/dev/main.tsx +2 -59
  14. package/template/index.html +1 -1
  15. package/template/mcp/server.ts +4 -50
  16. package/template/src/App.tsx +86 -37
  17. package/template/src/components/album/album-card.tsx +45 -0
  18. package/template/src/components/album/albums.tsx +77 -0
  19. package/template/src/components/album/film-strip.tsx +50 -0
  20. package/template/src/components/album/fullscreen-viewer.tsx +60 -0
  21. package/template/src/components/album/index.ts +4 -0
  22. package/template/src/components/{openai-card.test.tsx → card/card.test.tsx} +12 -12
  23. package/template/src/components/{openai-card.tsx → card/card.tsx} +8 -8
  24. package/template/src/components/card/index.ts +1 -0
  25. package/template/src/components/{openai-carousel.test.tsx → carousel/carousel.test.tsx} +10 -10
  26. package/template/src/components/{openai-carousel.tsx → carousel/carousel.tsx} +7 -7
  27. package/template/src/components/carousel/index.ts +1 -0
  28. package/template/src/components/index.ts +4 -2
  29. package/template/src/components/simulations/albums-simulation.tsx +20 -0
  30. package/template/src/components/simulations/app-simulation.tsx +13 -0
  31. package/template/src/components/simulations/carousel-simulation.tsx +63 -0
  32. package/template/src/components/simulations/index.tsx +14 -0
package/dist/index.js CHANGED
@@ -3608,13 +3608,18 @@ const DEFAULT_THEME = "dark";
3608
3608
  const DEFAULT_DISPLAY_MODE = "inline";
3609
3609
  function ChatGPTSimulator({
3610
3610
  children,
3611
- appName,
3612
- appIcon,
3613
- userMessage,
3614
- toolOutput = null,
3615
- widgetState = null
3611
+ simulations = []
3616
3612
  }) {
3617
3613
  const [screenWidth, setScreenWidth] = React.useState("full");
3614
+ const [selectedKey, setSelectedKey] = React.useState(
3615
+ simulations.length > 0 ? simulations[0].value : ""
3616
+ );
3617
+ const selectedSim = simulations.find((sim) => sim.value === selectedKey);
3618
+ const appName = selectedSim == null ? void 0 : selectedSim.appName;
3619
+ const appIcon = selectedSim == null ? void 0 : selectedSim.appIcon;
3620
+ const userMessage = selectedSim == null ? void 0 : selectedSim.userMessage;
3621
+ const toolOutput = (selectedSim == null ? void 0 : selectedSim.toolOutput) ?? null;
3622
+ const widgetState = (selectedSim == null ? void 0 : selectedSim.widgetState) ?? null;
3618
3623
  const mock = useMemo(
3619
3624
  () => initMockOpenAI({
3620
3625
  theme: DEFAULT_THEME,
@@ -3642,10 +3647,23 @@ function ChatGPTSimulator({
3642
3647
  }
3643
3648
  };
3644
3649
  }, []);
3650
+ const SelectedComponent = selectedSim == null ? void 0 : selectedSim.component;
3651
+ const content = SelectedComponent ? /* @__PURE__ */ jsx(SelectedComponent, {}) : children;
3645
3652
  return /* @__PURE__ */ jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsx(
3646
3653
  SimpleSidebar,
3647
3654
  {
3648
3655
  controls: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
3656
+ simulations.length > 0 && /* @__PURE__ */ jsx(SidebarControl, { label: "Simulation", children: /* @__PURE__ */ jsx(
3657
+ SidebarSelect,
3658
+ {
3659
+ value: selectedKey,
3660
+ onChange: (value) => setSelectedKey(value),
3661
+ options: simulations.map((sim) => ({
3662
+ value: sim.value,
3663
+ label: sim.label
3664
+ }))
3665
+ }
3666
+ ) }),
3649
3667
  /* @__PURE__ */ jsx(SidebarControl, { label: "Theme", children: /* @__PURE__ */ jsx(
3650
3668
  SidebarSelect,
3651
3669
  {
@@ -3690,7 +3708,7 @@ function ChatGPTSimulator({
3690
3708
  appName,
3691
3709
  appIcon,
3692
3710
  userMessage,
3693
- children
3711
+ children: content
3694
3712
  }
3695
3713
  )
3696
3714
  }