sunpeak 0.16.21 → 0.16.24
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/README.md +4 -3
- package/bin/commands/dev.mjs +22 -3
- package/bin/commands/new.mjs +6 -2
- package/bin/commands/start.mjs +4 -0
- package/bin/lib/get-port.mjs +60 -0
- package/bin/lib/live/browser-auth.mjs +125 -0
- package/bin/lib/live/chatgpt-config.d.mts +5 -0
- package/bin/lib/live/chatgpt-config.mjs +12 -0
- package/bin/lib/live/chatgpt-fixtures.d.mts +12 -0
- package/bin/lib/live/chatgpt-fixtures.mjs +25 -0
- package/bin/lib/live/chatgpt-page.mjs +210 -0
- package/bin/lib/live/global-setup.mjs +150 -0
- package/bin/lib/live/host-fixtures.mjs +61 -0
- package/bin/lib/live/host-page.mjs +242 -0
- package/bin/lib/live/live-config.d.mts +38 -0
- package/bin/lib/live/live-config.mjs +98 -0
- package/bin/lib/live/live-fixtures.d.mts +11 -0
- package/bin/lib/live/live-fixtures.mjs +102 -0
- package/bin/lib/live/test-config.d.mts +10 -0
- package/bin/lib/live/test-config.mjs +35 -0
- package/bin/lib/live/types.d.mts +54 -0
- package/bin/lib/live/utils.mjs +70 -0
- package/bin/sunpeak.js +1 -1
- package/dist/chatgpt/index.cjs +1 -1
- package/dist/chatgpt/index.js +1 -1
- package/dist/claude/index.cjs +1 -1
- package/dist/claude/index.js +1 -1
- package/dist/{index-CX6Z4bED.js → index-B7Qw3Vhh.js} +2 -2
- package/dist/index-B7Qw3Vhh.js.map +1 -0
- package/dist/{index-B4aC3vjH.js → index-BEHP_bM8.js} +2 -2
- package/dist/index-BEHP_bM8.js.map +1 -0
- package/dist/{index-bKBBCBK6.cjs → index-SfudQ9Y_.cjs} +2 -2
- package/dist/index-SfudQ9Y_.cjs.map +1 -0
- package/dist/{index-CKabCJyV.cjs → index-XKHXfBiD.cjs} +2 -2
- package/dist/index-XKHXfBiD.cjs.map +1 -0
- package/dist/index.cjs +13 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.cjs +38 -13
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.js +38 -13
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/types.d.ts +2 -0
- package/dist/simulator/index.cjs +1 -1
- package/dist/simulator/index.js +1 -1
- package/dist/simulator/simple-sidebar.d.ts +3 -1
- package/dist/{simulator-D8t-r7HH.js → simulator-BCq2iOT-.js} +67 -27
- package/dist/simulator-BCq2iOT-.js.map +1 -0
- package/dist/{simulator-FFNttkqL.cjs → simulator-DRUsm6IZ.cjs} +67 -27
- package/dist/simulator-DRUsm6IZ.cjs.map +1 -0
- package/package.json +25 -1
- package/template/README.md +24 -2
- package/template/_gitignore +1 -0
- package/template/package.json +3 -2
- package/template/playwright.config.ts +24 -1
- package/template/tests/live/albums.spec.ts +53 -0
- package/template/tests/live/carousel.spec.ts +52 -0
- package/template/tests/live/map.spec.ts +31 -0
- package/template/tests/live/playwright.config.ts +3 -0
- package/template/tests/live/review.spec.ts +54 -0
- package/template/vitest.config.ts +1 -1
- package/dist/index-B4aC3vjH.js.map +0 -1
- package/dist/index-CKabCJyV.cjs.map +0 -1
- package/dist/index-CX6Z4bED.js.map +0 -1
- package/dist/index-bKBBCBK6.cjs.map +0 -1
- package/dist/simulator-D8t-r7HH.js.map +0 -1
- package/dist/simulator-FFNttkqL.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { u as useApp, F as FQ, T as TQ, P as PQ } from "./use-app-C9gpzIQO.js";
|
|
2
2
|
import { C, A, h, a, e, s, L, m, S, J, B, _, x, U, q, b, c, w, R, E, d, O, G, f, W, g, i, j, V, k, l, N, z, n, o, I, p, r, t, v, y, D, K, H, M, Q, X, Y, Z, $, a0, a1, a2 } from "./use-app-C9gpzIQO.js";
|
|
3
3
|
import { detectHost, detectPlatform, isChatGPT, isClaude } from "./host/index.js";
|
|
4
|
-
import { i as i2 } from "./index-
|
|
5
|
-
import { i as i3 } from "./index-
|
|
4
|
+
import { i as i2 } from "./index-BEHP_bM8.js";
|
|
5
|
+
import { i as i3 } from "./index-B7Qw3Vhh.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { useEffect, useState, useRef, useCallback, useSyncExternalStore, useMemo, forwardRef } from "react";
|
|
9
|
-
import { D as DEFAULT_STYLE_VARIABLES } from "./simulator-
|
|
9
|
+
import { D as DEFAULT_STYLE_VARIABLES } from "./simulator-BCq2iOT-.js";
|
|
10
10
|
import { a as a3, d as d2 } from "./discovery-BVqD-JsT.js";
|
|
11
11
|
import { u as union, l as literal, r as record, s as string, _ as _undefined, o as object, b as boolean, a as array, n as number, c as unknown, E as EmbeddedResourceSchema, R as ResourceLinkSchema, j as ContentBlockSchema, C as CallToolResultSchema, T as ToolSchema, d as RequestIdSchema, I as ImplementationSchema } from "./protocol-uge7qFev.js";
|
|
12
12
|
var m2 = union([literal("light"), literal("dark")]).describe("Color theme preference for the host environment."), L2 = union([literal("inline"), literal("fullscreen"), literal("pip")]).describe("Display mode for UI presentation."), _J = union([literal("--color-background-primary"), literal("--color-background-secondary"), literal("--color-background-tertiary"), literal("--color-background-inverse"), literal("--color-background-ghost"), literal("--color-background-info"), literal("--color-background-danger"), literal("--color-background-success"), literal("--color-background-warning"), literal("--color-background-disabled"), literal("--color-text-primary"), literal("--color-text-secondary"), literal("--color-text-tertiary"), literal("--color-text-inverse"), literal("--color-text-ghost"), literal("--color-text-info"), literal("--color-text-danger"), literal("--color-text-success"), literal("--color-text-warning"), literal("--color-text-disabled"), literal("--color-border-primary"), literal("--color-border-secondary"), literal("--color-border-tertiary"), literal("--color-border-inverse"), literal("--color-border-ghost"), literal("--color-border-info"), literal("--color-border-danger"), literal("--color-border-success"), literal("--color-border-warning"), literal("--color-border-disabled"), literal("--color-ring-primary"), literal("--color-ring-secondary"), literal("--color-ring-inverse"), literal("--color-ring-info"), literal("--color-ring-danger"), literal("--color-ring-success"), literal("--color-ring-warning"), literal("--font-sans"), literal("--font-mono"), literal("--font-weight-normal"), literal("--font-weight-medium"), literal("--font-weight-semibold"), literal("--font-weight-bold"), literal("--font-text-xs-size"), literal("--font-text-sm-size"), literal("--font-text-md-size"), literal("--font-text-lg-size"), literal("--font-heading-xs-size"), literal("--font-heading-sm-size"), literal("--font-heading-md-size"), literal("--font-heading-lg-size"), literal("--font-heading-xl-size"), literal("--font-heading-2xl-size"), literal("--font-heading-3xl-size"), literal("--font-text-xs-line-height"), literal("--font-text-sm-line-height"), literal("--font-text-md-line-height"), literal("--font-text-lg-line-height"), literal("--font-heading-xs-line-height"), literal("--font-heading-sm-line-height"), literal("--font-heading-md-line-height"), literal("--font-heading-lg-line-height"), literal("--font-heading-xl-line-height"), literal("--font-heading-2xl-line-height"), literal("--font-heading-3xl-line-height"), literal("--border-radius-xs"), literal("--border-radius-sm"), literal("--border-radius-md"), literal("--border-radius-lg"), literal("--border-radius-xl"), literal("--border-radius-full"), literal("--border-width-regular"), literal("--shadow-hairline"), literal("--shadow-sm"), literal("--shadow-md"), literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."), OJ = record(_J.describe(`Style variables for theming MCP apps.
|
|
@@ -160,6 +160,7 @@ function getRegistry$1(app) {
|
|
|
160
160
|
if (ctx?.styles?.css?.fonts) {
|
|
161
161
|
TQ(ctx.styles.css.fonts);
|
|
162
162
|
}
|
|
163
|
+
let debounceTimer = null;
|
|
163
164
|
app.onhostcontextchanged = () => {
|
|
164
165
|
const ctx2 = app.getHostContext();
|
|
165
166
|
if (ctx2?.theme) {
|
|
@@ -169,7 +170,11 @@ function getRegistry$1(app) {
|
|
|
169
170
|
if (ctx2?.styles?.css?.fonts) {
|
|
170
171
|
TQ(ctx2.styles.css.fonts);
|
|
171
172
|
}
|
|
172
|
-
|
|
173
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
174
|
+
debounceTimer = setTimeout(() => {
|
|
175
|
+
debounceTimer = null;
|
|
176
|
+
for (const fn of subs) fn();
|
|
177
|
+
}, 50);
|
|
173
178
|
};
|
|
174
179
|
}
|
|
175
180
|
return subs;
|
|
@@ -356,7 +361,7 @@ const SafeArea = forwardRef(function SafeArea2({ children, style, ...props }, re
|
|
|
356
361
|
const viewport = useViewport();
|
|
357
362
|
const displayMode = useDisplayMode();
|
|
358
363
|
const isFullscreen = displayMode === "fullscreen";
|
|
359
|
-
const height = viewport?.height ??
|
|
364
|
+
const height = isFullscreen ? viewport?.height ?? "100dvh" : void 0;
|
|
360
365
|
return /* @__PURE__ */ jsx(
|
|
361
366
|
"div",
|
|
362
367
|
{
|
|
@@ -369,7 +374,10 @@ const SafeArea = forwardRef(function SafeArea2({ children, style, ...props }, re
|
|
|
369
374
|
paddingLeft: safeArea.left || void 0,
|
|
370
375
|
paddingRight: safeArea.right || void 0,
|
|
371
376
|
height,
|
|
377
|
+
// overflow:hidden ensures content doesn't escape the maxHeight boundary,
|
|
378
|
+
// which also lets apps fill the space with their own scrollable container.
|
|
372
379
|
maxHeight: viewport?.maxHeight,
|
|
380
|
+
overflow: viewport?.maxHeight != null ? "hidden" : void 0,
|
|
373
381
|
width: viewport?.width,
|
|
374
382
|
maxWidth: viewport?.maxWidth,
|
|
375
383
|
...style
|