sunpeak 0.5.35 → 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/bin/commands/build.mjs +10 -0
- package/bin/commands/dev.mjs +13 -1
- package/dist/index.cjs +62 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -25
- package/dist/index.js.map +1 -1
- package/dist/style.css +86 -40
- package/package.json +1 -1
- package/template/dist/chatgpt/albums.js +14 -54
- package/template/dist/chatgpt/carousel.js +14 -54
- package/template/dist/chatgpt/counter.js +14 -54
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js +13 -858
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Button.js.map +4 -4
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js +33 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Checkbox.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Icon.js +4 -4
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Input.js +13 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js +103 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_SegmentedControl.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js +1019 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Select.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js +95 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_components_Textarea.js.map +7 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js +45 -0
- package/template/node_modules/.vite/deps/@openai_apps-sdk-ui_theme.js.map +7 -0
- package/template/node_modules/.vite/deps/_metadata.json +82 -25
- package/template/node_modules/.vite/deps/{chunk-TNWQ7JGO.js → chunk-4TLBUCVB.js} +2 -2
- package/template/node_modules/.vite/deps/chunk-BAG6OO6S.js +115 -0
- package/template/node_modules/.vite/deps/chunk-BAG6OO6S.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-CQ3GYAYB.js +112 -0
- package/template/node_modules/.vite/deps/chunk-CQ3GYAYB.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-EGRHWZRV.js +1 -0
- package/template/node_modules/.vite/deps/chunk-EGRHWZRV.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-EVJ3DVH5.js +628 -0
- package/template/node_modules/.vite/deps/chunk-EVJ3DVH5.js.map +7 -0
- package/template/node_modules/.vite/deps/{chunk-5WRI5ZAA.js → chunk-ILHRZGIS.js} +17 -2
- package/template/node_modules/.vite/deps/chunk-ILHRZGIS.js.map +7 -0
- package/template/node_modules/.vite/deps/{chunk-DUV225XW.js → chunk-KFGKZMLK.js} +3 -3
- package/template/node_modules/.vite/deps/{chunk-7IRBE5E4.js → chunk-PTVT3RFX.js} +3 -3
- package/template/node_modules/.vite/deps/chunk-QPJAV452.js +13 -0
- package/template/node_modules/.vite/deps/chunk-QPJAV452.js.map +7 -0
- package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js +15195 -0
- package/template/node_modules/.vite/deps/chunk-SGWD4VEU.js.map +7 -0
- package/template/node_modules/.vite/deps/{chunk-D3BYX6F4.js → chunk-XB525PXG.js} +3 -3
- package/template/node_modules/.vite/deps/chunk-YOJ6QPGS.js +231 -0
- package/template/node_modules/.vite/deps/chunk-YOJ6QPGS.js.map +7 -0
- package/template/node_modules/.vite/deps/clsx.js +1 -1
- package/template/node_modules/.vite/deps/embla-carousel-react.js +2 -2
- package/template/node_modules/.vite/deps/embla-carousel-wheel-gestures.js +1 -1
- package/template/node_modules/.vite/deps/react-dom.js +3 -3
- package/template/node_modules/.vite/deps/react-dom_client.js +3 -3
- package/template/node_modules/.vite/deps/react.js +2 -2
- package/template/node_modules/.vite/deps/react_jsx-dev-runtime.js +2 -2
- package/template/node_modules/.vite/deps/react_jsx-runtime.js +3 -3
- package/template/node_modules/.vite/deps/tailwind-merge.js +1 -1
- package/template/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/template/src/components/album/fullscreen-viewer.tsx +78 -16
- package/template/src/components/resources/counter-resource.test.tsx +4 -4
- package/template/src/components/resources/counter-resource.tsx +5 -5
- /package/template/node_modules/.vite/deps/{chunk-5WRI5ZAA.js.map → @openai_apps-sdk-ui_components_Input.js.map} +0 -0
- /package/template/node_modules/.vite/deps/{chunk-TNWQ7JGO.js.map → chunk-4TLBUCVB.js.map} +0 -0
- /package/template/node_modules/.vite/deps/{chunk-DUV225XW.js.map → chunk-KFGKZMLK.js.map} +0 -0
- /package/template/node_modules/.vite/deps/{chunk-7IRBE5E4.js.map → chunk-PTVT3RFX.js.map} +0 -0
- /package/template/node_modules/.vite/deps/{chunk-D3BYX6F4.js.map → chunk-XB525PXG.js.map} +0 -0
package/bin/commands/build.mjs
CHANGED
|
@@ -19,6 +19,10 @@ export async function build(projectRoot = process.cwd()) {
|
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// Check if we're in the sunpeak workspace (directory is named "template")
|
|
23
|
+
const isTemplate = path.basename(projectRoot) === 'template';
|
|
24
|
+
const parentSrc = path.resolve(projectRoot, '../src');
|
|
25
|
+
|
|
22
26
|
const distDir = path.join(projectRoot, 'dist/chatgpt');
|
|
23
27
|
const buildDir = path.join(projectRoot, 'dist/build-output');
|
|
24
28
|
const tempDir = path.join(projectRoot, '.tmp');
|
|
@@ -155,6 +159,12 @@ export async function build(projectRoot = process.cwd()) {
|
|
|
155
159
|
},
|
|
156
160
|
resolve: {
|
|
157
161
|
conditions: ['style', 'import', 'module', 'browser', 'default'],
|
|
162
|
+
alias: {
|
|
163
|
+
// In workspace dev mode, use local sunpeak source
|
|
164
|
+
...(isTemplate && {
|
|
165
|
+
sunpeak: parentSrc,
|
|
166
|
+
}),
|
|
167
|
+
},
|
|
158
168
|
},
|
|
159
169
|
build: {
|
|
160
170
|
target: 'es2020',
|
package/bin/commands/dev.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { createServer } from 'vite';
|
|
|
3
3
|
import react from '@vitejs/plugin-react';
|
|
4
4
|
import tailwindcss from '@tailwindcss/vite';
|
|
5
5
|
import { existsSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
6
|
+
import { join, resolve, basename } from 'path';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Start the Vite development server
|
|
@@ -27,10 +27,22 @@ export async function dev(projectRoot = process.cwd(), args = []) {
|
|
|
27
27
|
|
|
28
28
|
console.log(`Starting Vite dev server on port ${port}...`);
|
|
29
29
|
|
|
30
|
+
// Check if we're in the sunpeak workspace (directory is named "template")
|
|
31
|
+
const isTemplate = basename(projectRoot) === 'template';
|
|
32
|
+
const parentSrc = resolve(projectRoot, '../src');
|
|
33
|
+
|
|
30
34
|
// Create and start Vite dev server programmatically
|
|
31
35
|
const server = await createServer({
|
|
32
36
|
root: projectRoot,
|
|
33
37
|
plugins: [react(), tailwindcss()],
|
|
38
|
+
resolve: {
|
|
39
|
+
alias: {
|
|
40
|
+
// In workspace dev mode, use local sunpeak source
|
|
41
|
+
...(isTemplate && {
|
|
42
|
+
sunpeak: parentSrc,
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
34
46
|
server: {
|
|
35
47
|
port,
|
|
36
48
|
open: true,
|
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(
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
className: "
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
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(
|
|
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
|
|
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 pt-
|
|
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",
|
|
@@ -7571,7 +7592,7 @@ function Conversation({
|
|
|
7571
7592
|
" said:"
|
|
7572
7593
|
] }),
|
|
7573
7594
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base my-auto mx-auto pb-10 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.jsxs("div", { className: "flex max-w-full flex-col grow", children: [
|
|
7574
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2
|
|
7595
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 my-3", children: [
|
|
7575
7596
|
appIcon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-6 flex items-center justify-center text-base", children: appIcon }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-6 rounded-full bg-primary flex items-center justify-center text-primary-foreground font-medium text-xs", children: "AI" }),
|
|
7576
7597
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-sm", children: appName })
|
|
7577
7598
|
] }),
|
|
@@ -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
|
|
7587
|
-
style: {
|
|
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) =>
|
|
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" },
|