sunpeak 0.16.24 → 0.16.28
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 +0 -1
- package/bin/commands/dev.mjs +98 -5
- package/bin/commands/start.mjs +3 -2
- package/bin/lib/live/browser-auth.mjs +53 -17
- package/bin/lib/live/global-setup.mjs +107 -99
- package/bin/lib/live/host-page.mjs +63 -11
- package/bin/lib/live/live-config.mjs +1 -1
- package/bin/lib/sandbox-server.mjs +304 -0
- package/dist/chatgpt/chatgpt-conversation.d.ts +3 -7
- package/dist/chatgpt/globals.css +28 -9
- package/dist/chatgpt/index.cjs +55 -24
- package/dist/chatgpt/index.cjs.map +1 -1
- package/dist/chatgpt/index.js +31 -25
- package/dist/chatgpt/index.js.map +1 -1
- package/dist/chunk-9hOWP6kD.cjs +64 -0
- package/dist/chunk-D6g4UhsZ.js +35 -0
- package/dist/claude/claude-conversation.d.ts +3 -2
- package/dist/claude/index.cjs +4 -4
- package/dist/claude/index.js +3 -5
- package/dist/discovery-BxKCIgG5.cjs +332 -0
- package/dist/discovery-BxKCIgG5.cjs.map +1 -0
- package/dist/discovery-Du4LHrih.js +261 -0
- package/dist/discovery-Du4LHrih.js.map +1 -0
- package/dist/host/chatgpt/index.cjs +171 -65
- package/dist/host/chatgpt/index.cjs.map +1 -1
- package/dist/host/chatgpt/index.js +170 -70
- package/dist/host/chatgpt/index.js.map +1 -1
- package/dist/host/index.cjs +47 -19
- package/dist/host/index.cjs.map +1 -1
- package/dist/host/index.js +47 -24
- package/dist/host/index.js.map +1 -1
- package/dist/index.cjs +3103 -3725
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3026 -3746
- package/dist/index.js.map +1 -1
- package/dist/lib/discovery-cli.cjs +117 -131
- package/dist/lib/discovery-cli.cjs.map +1 -1
- package/dist/lib/discovery-cli.js +107 -111
- package/dist/lib/discovery-cli.js.map +1 -1
- package/dist/mcp/favicon.d.ts +3 -1
- package/dist/mcp/index.cjs +9821 -10270
- package/dist/mcp/index.cjs.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +9801 -10268
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/production-server.d.ts +7 -1
- package/dist/mcp/types.d.ts +30 -1
- package/dist/protocol-DJmRaBzO.js +11080 -0
- package/dist/{protocol-DkDHRwOW.cjs.map → protocol-DJmRaBzO.js.map} +1 -1
- package/dist/protocol-jbxhzcnS.cjs +11493 -0
- package/dist/protocol-jbxhzcnS.cjs.map +1 -0
- package/dist/simulator/hosts.d.ts +11 -2
- package/dist/simulator/iframe-resource.d.ts +8 -1
- package/dist/simulator/index.cjs +79 -36
- package/dist/simulator/index.cjs.map +1 -1
- package/dist/simulator/index.js +43 -37
- package/dist/simulator/index.js.map +1 -1
- package/dist/simulator/mcp-app-host.d.ts +17 -0
- package/dist/simulator/sandbox-proxy.d.ts +38 -0
- package/dist/simulator/simulator.d.ts +7 -1
- package/dist/simulator/use-simulator-state.d.ts +2 -4
- package/dist/simulator-BYIH-xqQ.cjs +3701 -0
- package/dist/simulator-BYIH-xqQ.cjs.map +1 -0
- package/dist/simulator-CmgNnWBO.js +3575 -0
- package/dist/simulator-CmgNnWBO.js.map +1 -0
- package/dist/simulator-url-BDGD4vZD.cjs +69 -0
- package/dist/simulator-url-BDGD4vZD.cjs.map +1 -0
- package/dist/simulator-url-Bkxj43yT.js +64 -0
- package/dist/simulator-url-Bkxj43yT.js.map +1 -0
- package/dist/style.css +28 -9
- package/dist/use-app-D2h-aiyr.cjs +940 -0
- package/dist/use-app-D2h-aiyr.cjs.map +1 -0
- package/dist/use-app-X7JbGskk.js +598 -0
- package/dist/use-app-X7JbGskk.js.map +1 -0
- package/package.json +8 -8
- package/template/.sunpeak/dev.tsx +9 -3
- package/template/node_modules/.bin/vite +2 -2
- package/template/node_modules/.bin/vitest +2 -2
- package/template/package.json +5 -5
- package/template/playwright.config.ts +10 -5
- package/template/src/server.ts +16 -2
- package/template/src/tools/show-albums.ts +17 -0
- package/template/tests/e2e/albums.spec.ts +37 -5
- package/template/tests/e2e/carousel.spec.ts +6 -6
- package/template/tests/e2e/global-setup.ts +6 -21
- package/template/tests/e2e/map.spec.ts +11 -11
- package/template/tests/e2e/review.spec.ts +24 -24
- package/dist/claude/index.cjs.map +0 -1
- package/dist/claude/index.js.map +0 -1
- package/dist/discovery-BVqD-JsT.js +0 -224
- package/dist/discovery-BVqD-JsT.js.map +0 -1
- package/dist/discovery-D1gpaVz4.cjs +0 -223
- package/dist/discovery-D1gpaVz4.cjs.map +0 -1
- package/dist/index-B7Qw3Vhh.js +0 -29
- package/dist/index-B7Qw3Vhh.js.map +0 -1
- package/dist/index-BEHP_bM8.js +0 -41
- package/dist/index-BEHP_bM8.js.map +0 -1
- package/dist/index-SfudQ9Y_.cjs +0 -28
- package/dist/index-SfudQ9Y_.cjs.map +0 -1
- package/dist/index-XKHXfBiD.cjs +0 -40
- package/dist/index-XKHXfBiD.cjs.map +0 -1
- package/dist/protocol-DkDHRwOW.cjs +0 -12221
- package/dist/protocol-uge7qFev.js +0 -12223
- package/dist/protocol-uge7qFev.js.map +0 -1
- package/dist/simulator-BCq2iOT-.js +0 -3262
- package/dist/simulator-BCq2iOT-.js.map +0 -1
- package/dist/simulator-DRUsm6IZ.cjs +0 -3277
- package/dist/simulator-DRUsm6IZ.cjs.map +0 -1
- package/dist/simulator-url-DcSYRl-P.cjs +0 -53
- package/dist/simulator-url-DcSYRl-P.cjs.map +0 -1
- package/dist/simulator-url-j_XV3EoP.js +0 -54
- package/dist/simulator-url-j_XV3EoP.js.map +0 -1
- package/dist/use-app-C9gpzIQO.js +0 -349
- package/dist/use-app-C9gpzIQO.js.map +0 -1
- package/dist/use-app-D09O2swh.cjs +0 -348
- package/dist/use-app-D09O2swh.cjs.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region src/simulator/simulator-url.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a URL path with query parameters for the ChatGPT Simulator.
|
|
4
|
+
*
|
|
5
|
+
* @param params - The simulator parameters to encode
|
|
6
|
+
* @param basePath - The base path for the URL (default: '/')
|
|
7
|
+
* @returns A URL path string with encoded query parameters
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Basic usage
|
|
12
|
+
* createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })
|
|
13
|
+
* // Returns: '/?simulation=show-albums&theme=light'
|
|
14
|
+
*
|
|
15
|
+
* // With display mode
|
|
16
|
+
* createSimulatorUrl({
|
|
17
|
+
* simulation: 'review-diff',
|
|
18
|
+
* theme: 'dark',
|
|
19
|
+
* displayMode: 'fullscreen',
|
|
20
|
+
* })
|
|
21
|
+
* // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'
|
|
22
|
+
*
|
|
23
|
+
* // With device simulation
|
|
24
|
+
* createSimulatorUrl({
|
|
25
|
+
* simulation: 'show-map',
|
|
26
|
+
* deviceType: 'mobile',
|
|
27
|
+
* touch: true,
|
|
28
|
+
* hover: false,
|
|
29
|
+
* })
|
|
30
|
+
* // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'
|
|
31
|
+
*
|
|
32
|
+
* // With safe area insets (for notch simulation)
|
|
33
|
+
* createSimulatorUrl({
|
|
34
|
+
* simulation: 'show-carousel',
|
|
35
|
+
* safeAreaTop: 44,
|
|
36
|
+
* safeAreaBottom: 34,
|
|
37
|
+
* })
|
|
38
|
+
* // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function createSimulatorUrl(params, basePath = "/") {
|
|
42
|
+
const searchParams = new URLSearchParams();
|
|
43
|
+
if (params.simulation !== void 0) searchParams.set("simulation", params.simulation);
|
|
44
|
+
if (params.host !== void 0) searchParams.set("host", params.host);
|
|
45
|
+
if (params.theme !== void 0) searchParams.set("theme", params.theme);
|
|
46
|
+
if (params.displayMode !== void 0) searchParams.set("displayMode", params.displayMode);
|
|
47
|
+
if (params.locale !== void 0) searchParams.set("locale", params.locale);
|
|
48
|
+
if (params.maxHeight !== void 0) searchParams.set("maxHeight", String(params.maxHeight));
|
|
49
|
+
if (params.deviceType !== void 0) searchParams.set("deviceType", params.deviceType);
|
|
50
|
+
if (params.hover !== void 0) searchParams.set("hover", String(params.hover));
|
|
51
|
+
if (params.touch !== void 0) searchParams.set("touch", String(params.touch));
|
|
52
|
+
if (params.safeAreaTop !== void 0) searchParams.set("safeAreaTop", String(params.safeAreaTop));
|
|
53
|
+
if (params.safeAreaBottom !== void 0) searchParams.set("safeAreaBottom", String(params.safeAreaBottom));
|
|
54
|
+
if (params.safeAreaLeft !== void 0) searchParams.set("safeAreaLeft", String(params.safeAreaLeft));
|
|
55
|
+
if (params.safeAreaRight !== void 0) searchParams.set("safeAreaRight", String(params.safeAreaRight));
|
|
56
|
+
if (params.prodTools !== void 0) searchParams.set("prodTools", String(params.prodTools));
|
|
57
|
+
if (params.prodResources !== void 0) searchParams.set("prodResources", String(params.prodResources));
|
|
58
|
+
const queryString = searchParams.toString();
|
|
59
|
+
return queryString ? `${basePath}?${queryString}` : basePath;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
Object.defineProperty(exports, "createSimulatorUrl", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function() {
|
|
65
|
+
return createSimulatorUrl;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=simulator-url-BDGD4vZD.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator-url-BDGD4vZD.cjs","names":[],"sources":["../src/simulator/simulator-url.ts"],"sourcesContent":["import type { Theme, DisplayMode, DeviceType } from '../types/runtime';\n\n/**\n * Strongly-typed URL parameters for the Simulator.\n *\n * Use with `createSimulatorUrl()` to generate type-safe URL paths for e2e tests.\n *\n * @example\n * ```ts\n * import { createSimulatorUrl } from 'sunpeak/chatgpt';\n *\n * // In e2e tests:\n * await page.goto(createSimulatorUrl({\n * simulation: 'show-albums',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * host: 'claude',\n * }));\n * ```\n */\nexport interface SimulatorUrlParams {\n /**\n * The simulation name to load (e.g., 'show-albums', 'review-diff').\n * Corresponds to the simulation JSON filename without the `.json` extension.\n */\n simulation?: string;\n\n /**\n * The host shell to use (e.g., 'chatgpt', 'claude').\n * Switches conversation chrome, theming, and reported host info/capabilities.\n * @default 'chatgpt'\n */\n host?: string;\n\n /**\n * The color theme for the simulator.\n * @default 'dark'\n */\n theme?: Theme;\n\n /**\n * The display mode for the widget.\n * - 'inline': Embedded in the conversation\n * - 'pip': Picture-in-picture mode with max height\n * - 'fullscreen': Full screen overlay\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * The locale for the simulator (e.g., 'en-US', 'ja-JP').\n * @default 'en-US'\n */\n locale?: string;\n\n /**\n * Maximum height in pixels for PiP mode.\n * Only applicable when displayMode is 'pip'.\n */\n maxHeight?: number;\n\n /**\n * The device type to simulate.\n * Affects default hover/touch capabilities.\n */\n deviceType?: DeviceType;\n\n /**\n * Whether the device supports hover interactions.\n * @default true for desktop, false for mobile/tablet\n */\n hover?: boolean;\n\n /**\n * Whether the device supports touch interactions.\n * @default false for desktop, true for mobile/tablet\n */\n touch?: boolean;\n\n /**\n * Safe area inset from the top of the screen (in pixels).\n * Used for devices with notches or status bars.\n */\n safeAreaTop?: number;\n\n /**\n * Safe area inset from the bottom of the screen (in pixels).\n * Used for devices with home indicators.\n */\n safeAreaBottom?: number;\n\n /**\n * Safe area inset from the left of the screen (in pixels).\n */\n safeAreaLeft?: number;\n\n /**\n * Safe area inset from the right of the screen (in pixels).\n */\n safeAreaRight?: number;\n\n /**\n * Enable Prod Tools mode (real tool handlers instead of simulation mocks).\n */\n prodTools?: boolean;\n\n /**\n * Enable Prod Resources mode (production dist/ bundles instead of HMR).\n */\n prodResources?: boolean;\n}\n\n/**\n * Creates a URL path with query parameters for the ChatGPT Simulator.\n *\n * @param params - The simulator parameters to encode\n * @param basePath - The base path for the URL (default: '/')\n * @returns A URL path string with encoded query parameters\n *\n * @example\n * ```ts\n * // Basic usage\n * createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })\n * // Returns: '/?simulation=show-albums&theme=light'\n *\n * // With display mode\n * createSimulatorUrl({\n * simulation: 'review-diff',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * })\n * // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'\n *\n * // With device simulation\n * createSimulatorUrl({\n * simulation: 'show-map',\n * deviceType: 'mobile',\n * touch: true,\n * hover: false,\n * })\n * // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'\n *\n * // With safe area insets (for notch simulation)\n * createSimulatorUrl({\n * simulation: 'show-carousel',\n * safeAreaTop: 44,\n * safeAreaBottom: 34,\n * })\n * // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'\n * ```\n */\nexport function createSimulatorUrl(params: SimulatorUrlParams, basePath = '/'): string {\n const searchParams = new URLSearchParams();\n\n // Add each defined parameter\n if (params.simulation !== undefined) {\n searchParams.set('simulation', params.simulation);\n }\n if (params.host !== undefined) {\n searchParams.set('host', params.host);\n }\n if (params.theme !== undefined) {\n searchParams.set('theme', params.theme);\n }\n if (params.displayMode !== undefined) {\n searchParams.set('displayMode', params.displayMode);\n }\n if (params.locale !== undefined) {\n searchParams.set('locale', params.locale);\n }\n if (params.maxHeight !== undefined) {\n searchParams.set('maxHeight', String(params.maxHeight));\n }\n if (params.deviceType !== undefined) {\n searchParams.set('deviceType', params.deviceType);\n }\n if (params.hover !== undefined) {\n searchParams.set('hover', String(params.hover));\n }\n if (params.touch !== undefined) {\n searchParams.set('touch', String(params.touch));\n }\n if (params.safeAreaTop !== undefined) {\n searchParams.set('safeAreaTop', String(params.safeAreaTop));\n }\n if (params.safeAreaBottom !== undefined) {\n searchParams.set('safeAreaBottom', String(params.safeAreaBottom));\n }\n if (params.safeAreaLeft !== undefined) {\n searchParams.set('safeAreaLeft', String(params.safeAreaLeft));\n }\n if (params.safeAreaRight !== undefined) {\n searchParams.set('safeAreaRight', String(params.safeAreaRight));\n }\n if (params.prodTools !== undefined) {\n searchParams.set('prodTools', String(params.prodTools));\n }\n if (params.prodResources !== undefined) {\n searchParams.set('prodResources', String(params.prodResources));\n }\n const queryString = searchParams.toString();\n return queryString ? `${basePath}?${queryString}` : basePath;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,SAAgB,mBAAmB,QAA4B,WAAW,KAAa;CACrF,MAAM,eAAe,IAAI,iBAAiB;AAG1C,KAAI,OAAO,eAAe,KAAA,EACxB,cAAa,IAAI,cAAc,OAAO,WAAW;AAEnD,KAAI,OAAO,SAAS,KAAA,EAClB,cAAa,IAAI,QAAQ,OAAO,KAAK;AAEvC,KAAI,OAAO,UAAU,KAAA,EACnB,cAAa,IAAI,SAAS,OAAO,MAAM;AAEzC,KAAI,OAAO,gBAAgB,KAAA,EACzB,cAAa,IAAI,eAAe,OAAO,YAAY;AAErD,KAAI,OAAO,WAAW,KAAA,EACpB,cAAa,IAAI,UAAU,OAAO,OAAO;AAE3C,KAAI,OAAO,cAAc,KAAA,EACvB,cAAa,IAAI,aAAa,OAAO,OAAO,UAAU,CAAC;AAEzD,KAAI,OAAO,eAAe,KAAA,EACxB,cAAa,IAAI,cAAc,OAAO,WAAW;AAEnD,KAAI,OAAO,UAAU,KAAA,EACnB,cAAa,IAAI,SAAS,OAAO,OAAO,MAAM,CAAC;AAEjD,KAAI,OAAO,UAAU,KAAA,EACnB,cAAa,IAAI,SAAS,OAAO,OAAO,MAAM,CAAC;AAEjD,KAAI,OAAO,gBAAgB,KAAA,EACzB,cAAa,IAAI,eAAe,OAAO,OAAO,YAAY,CAAC;AAE7D,KAAI,OAAO,mBAAmB,KAAA,EAC5B,cAAa,IAAI,kBAAkB,OAAO,OAAO,eAAe,CAAC;AAEnE,KAAI,OAAO,iBAAiB,KAAA,EAC1B,cAAa,IAAI,gBAAgB,OAAO,OAAO,aAAa,CAAC;AAE/D,KAAI,OAAO,kBAAkB,KAAA,EAC3B,cAAa,IAAI,iBAAiB,OAAO,OAAO,cAAc,CAAC;AAEjE,KAAI,OAAO,cAAc,KAAA,EACvB,cAAa,IAAI,aAAa,OAAO,OAAO,UAAU,CAAC;AAEzD,KAAI,OAAO,kBAAkB,KAAA,EAC3B,cAAa,IAAI,iBAAiB,OAAO,OAAO,cAAc,CAAC;CAEjE,MAAM,cAAc,aAAa,UAAU;AAC3C,QAAO,cAAc,GAAG,SAAS,GAAG,gBAAgB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//#region src/simulator/simulator-url.ts
|
|
2
|
+
/**
|
|
3
|
+
* Creates a URL path with query parameters for the ChatGPT Simulator.
|
|
4
|
+
*
|
|
5
|
+
* @param params - The simulator parameters to encode
|
|
6
|
+
* @param basePath - The base path for the URL (default: '/')
|
|
7
|
+
* @returns A URL path string with encoded query parameters
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Basic usage
|
|
12
|
+
* createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })
|
|
13
|
+
* // Returns: '/?simulation=show-albums&theme=light'
|
|
14
|
+
*
|
|
15
|
+
* // With display mode
|
|
16
|
+
* createSimulatorUrl({
|
|
17
|
+
* simulation: 'review-diff',
|
|
18
|
+
* theme: 'dark',
|
|
19
|
+
* displayMode: 'fullscreen',
|
|
20
|
+
* })
|
|
21
|
+
* // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'
|
|
22
|
+
*
|
|
23
|
+
* // With device simulation
|
|
24
|
+
* createSimulatorUrl({
|
|
25
|
+
* simulation: 'show-map',
|
|
26
|
+
* deviceType: 'mobile',
|
|
27
|
+
* touch: true,
|
|
28
|
+
* hover: false,
|
|
29
|
+
* })
|
|
30
|
+
* // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'
|
|
31
|
+
*
|
|
32
|
+
* // With safe area insets (for notch simulation)
|
|
33
|
+
* createSimulatorUrl({
|
|
34
|
+
* simulation: 'show-carousel',
|
|
35
|
+
* safeAreaTop: 44,
|
|
36
|
+
* safeAreaBottom: 34,
|
|
37
|
+
* })
|
|
38
|
+
* // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function createSimulatorUrl(params, basePath = "/") {
|
|
42
|
+
const searchParams = new URLSearchParams();
|
|
43
|
+
if (params.simulation !== void 0) searchParams.set("simulation", params.simulation);
|
|
44
|
+
if (params.host !== void 0) searchParams.set("host", params.host);
|
|
45
|
+
if (params.theme !== void 0) searchParams.set("theme", params.theme);
|
|
46
|
+
if (params.displayMode !== void 0) searchParams.set("displayMode", params.displayMode);
|
|
47
|
+
if (params.locale !== void 0) searchParams.set("locale", params.locale);
|
|
48
|
+
if (params.maxHeight !== void 0) searchParams.set("maxHeight", String(params.maxHeight));
|
|
49
|
+
if (params.deviceType !== void 0) searchParams.set("deviceType", params.deviceType);
|
|
50
|
+
if (params.hover !== void 0) searchParams.set("hover", String(params.hover));
|
|
51
|
+
if (params.touch !== void 0) searchParams.set("touch", String(params.touch));
|
|
52
|
+
if (params.safeAreaTop !== void 0) searchParams.set("safeAreaTop", String(params.safeAreaTop));
|
|
53
|
+
if (params.safeAreaBottom !== void 0) searchParams.set("safeAreaBottom", String(params.safeAreaBottom));
|
|
54
|
+
if (params.safeAreaLeft !== void 0) searchParams.set("safeAreaLeft", String(params.safeAreaLeft));
|
|
55
|
+
if (params.safeAreaRight !== void 0) searchParams.set("safeAreaRight", String(params.safeAreaRight));
|
|
56
|
+
if (params.prodTools !== void 0) searchParams.set("prodTools", String(params.prodTools));
|
|
57
|
+
if (params.prodResources !== void 0) searchParams.set("prodResources", String(params.prodResources));
|
|
58
|
+
const queryString = searchParams.toString();
|
|
59
|
+
return queryString ? `${basePath}?${queryString}` : basePath;
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { createSimulatorUrl as t };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=simulator-url-Bkxj43yT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator-url-Bkxj43yT.js","names":[],"sources":["../src/simulator/simulator-url.ts"],"sourcesContent":["import type { Theme, DisplayMode, DeviceType } from '../types/runtime';\n\n/**\n * Strongly-typed URL parameters for the Simulator.\n *\n * Use with `createSimulatorUrl()` to generate type-safe URL paths for e2e tests.\n *\n * @example\n * ```ts\n * import { createSimulatorUrl } from 'sunpeak/chatgpt';\n *\n * // In e2e tests:\n * await page.goto(createSimulatorUrl({\n * simulation: 'show-albums',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * host: 'claude',\n * }));\n * ```\n */\nexport interface SimulatorUrlParams {\n /**\n * The simulation name to load (e.g., 'show-albums', 'review-diff').\n * Corresponds to the simulation JSON filename without the `.json` extension.\n */\n simulation?: string;\n\n /**\n * The host shell to use (e.g., 'chatgpt', 'claude').\n * Switches conversation chrome, theming, and reported host info/capabilities.\n * @default 'chatgpt'\n */\n host?: string;\n\n /**\n * The color theme for the simulator.\n * @default 'dark'\n */\n theme?: Theme;\n\n /**\n * The display mode for the widget.\n * - 'inline': Embedded in the conversation\n * - 'pip': Picture-in-picture mode with max height\n * - 'fullscreen': Full screen overlay\n * @default 'inline'\n */\n displayMode?: DisplayMode;\n\n /**\n * The locale for the simulator (e.g., 'en-US', 'ja-JP').\n * @default 'en-US'\n */\n locale?: string;\n\n /**\n * Maximum height in pixels for PiP mode.\n * Only applicable when displayMode is 'pip'.\n */\n maxHeight?: number;\n\n /**\n * The device type to simulate.\n * Affects default hover/touch capabilities.\n */\n deviceType?: DeviceType;\n\n /**\n * Whether the device supports hover interactions.\n * @default true for desktop, false for mobile/tablet\n */\n hover?: boolean;\n\n /**\n * Whether the device supports touch interactions.\n * @default false for desktop, true for mobile/tablet\n */\n touch?: boolean;\n\n /**\n * Safe area inset from the top of the screen (in pixels).\n * Used for devices with notches or status bars.\n */\n safeAreaTop?: number;\n\n /**\n * Safe area inset from the bottom of the screen (in pixels).\n * Used for devices with home indicators.\n */\n safeAreaBottom?: number;\n\n /**\n * Safe area inset from the left of the screen (in pixels).\n */\n safeAreaLeft?: number;\n\n /**\n * Safe area inset from the right of the screen (in pixels).\n */\n safeAreaRight?: number;\n\n /**\n * Enable Prod Tools mode (real tool handlers instead of simulation mocks).\n */\n prodTools?: boolean;\n\n /**\n * Enable Prod Resources mode (production dist/ bundles instead of HMR).\n */\n prodResources?: boolean;\n}\n\n/**\n * Creates a URL path with query parameters for the ChatGPT Simulator.\n *\n * @param params - The simulator parameters to encode\n * @param basePath - The base path for the URL (default: '/')\n * @returns A URL path string with encoded query parameters\n *\n * @example\n * ```ts\n * // Basic usage\n * createSimulatorUrl({ simulation: 'show-albums', theme: 'light' })\n * // Returns: '/?simulation=show-albums&theme=light'\n *\n * // With display mode\n * createSimulatorUrl({\n * simulation: 'review-diff',\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * })\n * // Returns: '/?simulation=review-diff&theme=dark&displayMode=fullscreen'\n *\n * // With device simulation\n * createSimulatorUrl({\n * simulation: 'show-map',\n * deviceType: 'mobile',\n * touch: true,\n * hover: false,\n * })\n * // Returns: '/?simulation=show-map&deviceType=mobile&touch=true&hover=false'\n *\n * // With safe area insets (for notch simulation)\n * createSimulatorUrl({\n * simulation: 'show-carousel',\n * safeAreaTop: 44,\n * safeAreaBottom: 34,\n * })\n * // Returns: '/?simulation=show-carousel&safeAreaTop=44&safeAreaBottom=34'\n * ```\n */\nexport function createSimulatorUrl(params: SimulatorUrlParams, basePath = '/'): string {\n const searchParams = new URLSearchParams();\n\n // Add each defined parameter\n if (params.simulation !== undefined) {\n searchParams.set('simulation', params.simulation);\n }\n if (params.host !== undefined) {\n searchParams.set('host', params.host);\n }\n if (params.theme !== undefined) {\n searchParams.set('theme', params.theme);\n }\n if (params.displayMode !== undefined) {\n searchParams.set('displayMode', params.displayMode);\n }\n if (params.locale !== undefined) {\n searchParams.set('locale', params.locale);\n }\n if (params.maxHeight !== undefined) {\n searchParams.set('maxHeight', String(params.maxHeight));\n }\n if (params.deviceType !== undefined) {\n searchParams.set('deviceType', params.deviceType);\n }\n if (params.hover !== undefined) {\n searchParams.set('hover', String(params.hover));\n }\n if (params.touch !== undefined) {\n searchParams.set('touch', String(params.touch));\n }\n if (params.safeAreaTop !== undefined) {\n searchParams.set('safeAreaTop', String(params.safeAreaTop));\n }\n if (params.safeAreaBottom !== undefined) {\n searchParams.set('safeAreaBottom', String(params.safeAreaBottom));\n }\n if (params.safeAreaLeft !== undefined) {\n searchParams.set('safeAreaLeft', String(params.safeAreaLeft));\n }\n if (params.safeAreaRight !== undefined) {\n searchParams.set('safeAreaRight', String(params.safeAreaRight));\n }\n if (params.prodTools !== undefined) {\n searchParams.set('prodTools', String(params.prodTools));\n }\n if (params.prodResources !== undefined) {\n searchParams.set('prodResources', String(params.prodResources));\n }\n const queryString = searchParams.toString();\n return queryString ? `${basePath}?${queryString}` : basePath;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,SAAgB,mBAAmB,QAA4B,WAAW,KAAa;CACrF,MAAM,eAAe,IAAI,iBAAiB;AAG1C,KAAI,OAAO,eAAe,KAAA,EACxB,cAAa,IAAI,cAAc,OAAO,WAAW;AAEnD,KAAI,OAAO,SAAS,KAAA,EAClB,cAAa,IAAI,QAAQ,OAAO,KAAK;AAEvC,KAAI,OAAO,UAAU,KAAA,EACnB,cAAa,IAAI,SAAS,OAAO,MAAM;AAEzC,KAAI,OAAO,gBAAgB,KAAA,EACzB,cAAa,IAAI,eAAe,OAAO,YAAY;AAErD,KAAI,OAAO,WAAW,KAAA,EACpB,cAAa,IAAI,UAAU,OAAO,OAAO;AAE3C,KAAI,OAAO,cAAc,KAAA,EACvB,cAAa,IAAI,aAAa,OAAO,OAAO,UAAU,CAAC;AAEzD,KAAI,OAAO,eAAe,KAAA,EACxB,cAAa,IAAI,cAAc,OAAO,WAAW;AAEnD,KAAI,OAAO,UAAU,KAAA,EACnB,cAAa,IAAI,SAAS,OAAO,OAAO,MAAM,CAAC;AAEjD,KAAI,OAAO,UAAU,KAAA,EACnB,cAAa,IAAI,SAAS,OAAO,OAAO,MAAM,CAAC;AAEjD,KAAI,OAAO,gBAAgB,KAAA,EACzB,cAAa,IAAI,eAAe,OAAO,OAAO,YAAY,CAAC;AAE7D,KAAI,OAAO,mBAAmB,KAAA,EAC5B,cAAa,IAAI,kBAAkB,OAAO,OAAO,eAAe,CAAC;AAEnE,KAAI,OAAO,iBAAiB,KAAA,EAC1B,cAAa,IAAI,gBAAgB,OAAO,OAAO,aAAa,CAAC;AAE/D,KAAI,OAAO,kBAAkB,KAAA,EAC3B,cAAa,IAAI,iBAAiB,OAAO,OAAO,cAAc,CAAC;AAEjE,KAAI,OAAO,cAAc,KAAA,EACvB,cAAa,IAAI,aAAa,OAAO,OAAO,UAAU,CAAC;AAEzD,KAAI,OAAO,kBAAkB,KAAA,EAC3B,cAAa,IAAI,iBAAiB,OAAO,OAAO,cAAc,CAAC;CAEjE,MAAM,cAAc,aAAa,UAAU;AAC3C,QAAO,cAAc,GAAG,SAAS,GAAG,gBAAgB"}
|
package/dist/style.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties {
|
|
3
3
|
@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))) {
|
|
4
4
|
*, :before, :after, ::backdrop {
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
--tw-backdrop-saturate: initial;
|
|
67
67
|
--tw-backdrop-sepia: initial;
|
|
68
68
|
--tw-duration: initial;
|
|
69
|
+
--tw-ease: initial;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
}
|
|
@@ -106,6 +107,7 @@
|
|
|
106
107
|
--shadow-sm: 0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;
|
|
107
108
|
--shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
|
|
108
109
|
--shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
|
|
110
|
+
--ease-out: cubic-bezier(0, 0, .2, 1);
|
|
109
111
|
--animate-spin: spin 1s linear infinite;
|
|
110
112
|
--blur-sm: 8px;
|
|
111
113
|
--default-transition-duration: .15s;
|
|
@@ -925,7 +927,7 @@
|
|
|
925
927
|
}
|
|
926
928
|
|
|
927
929
|
.transform {
|
|
928
|
-
transform: var(--tw-rotate-x,
|
|
930
|
+
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
929
931
|
}
|
|
930
932
|
|
|
931
933
|
.animate-spin {
|
|
@@ -942,7 +944,7 @@
|
|
|
942
944
|
|
|
943
945
|
.touch-pan-y {
|
|
944
946
|
--tw-pan-y: pan-y;
|
|
945
|
-
touch-action: var(--tw-pan-x,
|
|
947
|
+
touch-action: var(--tw-pan-x, ) var(--tw-pan-y, ) var(--tw-pinch-zoom, );
|
|
946
948
|
}
|
|
947
949
|
|
|
948
950
|
.resize {
|
|
@@ -1694,7 +1696,7 @@
|
|
|
1694
1696
|
}
|
|
1695
1697
|
|
|
1696
1698
|
.ring {
|
|
1697
|
-
--tw-ring-shadow: var(--tw-ring-inset,
|
|
1699
|
+
--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
1698
1700
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
1699
1701
|
}
|
|
1700
1702
|
|
|
@@ -1715,17 +1717,17 @@
|
|
|
1715
1717
|
|
|
1716
1718
|
.blur {
|
|
1717
1719
|
--tw-blur: blur(8px);
|
|
1718
|
-
filter: var(--tw-blur,
|
|
1720
|
+
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
|
|
1719
1721
|
}
|
|
1720
1722
|
|
|
1721
1723
|
.filter {
|
|
1722
|
-
filter: var(--tw-blur,
|
|
1724
|
+
filter: var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, );
|
|
1723
1725
|
}
|
|
1724
1726
|
|
|
1725
1727
|
.backdrop-blur-sm {
|
|
1726
1728
|
--tw-backdrop-blur: blur(var(--blur-sm));
|
|
1727
|
-
-webkit-backdrop-filter: var(--tw-backdrop-blur,
|
|
1728
|
-
backdrop-filter: var(--tw-backdrop-blur,
|
|
1729
|
+
-webkit-backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
1730
|
+
backdrop-filter: var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );
|
|
1729
1731
|
}
|
|
1730
1732
|
|
|
1731
1733
|
.transition {
|
|
@@ -1762,6 +1764,11 @@
|
|
|
1762
1764
|
transition-duration: .2s;
|
|
1763
1765
|
}
|
|
1764
1766
|
|
|
1767
|
+
.ease-out {
|
|
1768
|
+
--tw-ease: var(--ease-out);
|
|
1769
|
+
transition-timing-function: var(--ease-out);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1765
1772
|
.outline-none {
|
|
1766
1773
|
--tw-outline-style: none;
|
|
1767
1774
|
outline-style: none;
|
|
@@ -1952,6 +1959,12 @@
|
|
|
1952
1959
|
}
|
|
1953
1960
|
}
|
|
1954
1961
|
|
|
1962
|
+
@media (min-width: 1440px) {
|
|
1963
|
+
.min-\[1440px\]\:max-w-\[48rem\] {
|
|
1964
|
+
max-width: 48rem;
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1955
1968
|
@media (min-width: 40rem) {
|
|
1956
1969
|
.sm\:start-0 {
|
|
1957
1970
|
inset-inline-start: calc(var(--spacing) * 0);
|
|
@@ -2086,7 +2099,7 @@
|
|
|
2086
2099
|
}
|
|
2087
2100
|
|
|
2088
2101
|
.xl\:ring {
|
|
2089
|
-
--tw-ring-shadow: var(--tw-ring-inset,
|
|
2102
|
+
--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
|
|
2090
2103
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
2091
2104
|
}
|
|
2092
2105
|
}
|
|
@@ -2594,8 +2607,14 @@
|
|
|
2594
2607
|
inherits: false
|
|
2595
2608
|
}
|
|
2596
2609
|
|
|
2610
|
+
@property --tw-ease {
|
|
2611
|
+
syntax: "*";
|
|
2612
|
+
inherits: false
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2597
2615
|
@keyframes spin {
|
|
2598
2616
|
to {
|
|
2599
2617
|
transform: rotate(360deg);
|
|
2600
2618
|
}
|
|
2601
2619
|
}
|
|
2620
|
+
/*$vite$:1*/
|