mcp-use 1.4.1 → 1.5.0-canary.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 (44) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{chunk-RE7EYFDV.js → chunk-5XVM4A23.js} +446 -964
  3. package/dist/{chunk-35A6O3YH.js → chunk-MCF5P6GJ.js} +1 -1
  4. package/dist/{display-LIYVTGEU.js → display-YIYC6WJE.js} +77 -6
  5. package/dist/index.cjs +572 -1004
  6. package/dist/index.js +33 -12
  7. package/dist/src/agents/display.d.ts +5 -1
  8. package/dist/src/agents/display.d.ts.map +1 -1
  9. package/dist/src/agents/index.cjs +77 -6
  10. package/dist/src/agents/index.js +1 -1
  11. package/dist/src/browser.cjs +77 -6
  12. package/dist/src/browser.js +1 -1
  13. package/dist/src/client/codeExecutor.d.ts +1 -1
  14. package/dist/src/client/codeExecutor.d.ts.map +1 -1
  15. package/dist/src/client/executors/base.d.ts +10 -1
  16. package/dist/src/client/executors/base.d.ts.map +1 -1
  17. package/dist/src/client.d.ts +1 -1
  18. package/dist/src/client.d.ts.map +1 -1
  19. package/dist/src/react/ErrorBoundary.d.ts +24 -0
  20. package/dist/src/react/ErrorBoundary.d.ts.map +1 -0
  21. package/dist/src/react/Image.d.ts +11 -0
  22. package/dist/src/react/Image.d.ts.map +1 -0
  23. package/dist/src/react/McpUseProvider.d.ts +46 -0
  24. package/dist/src/react/McpUseProvider.d.ts.map +1 -0
  25. package/dist/src/react/ThemeProvider.d.ts +14 -0
  26. package/dist/src/react/ThemeProvider.d.ts.map +1 -0
  27. package/dist/src/react/WidgetControls.d.ts +44 -0
  28. package/dist/src/react/WidgetControls.d.ts.map +1 -0
  29. package/dist/src/react/index.cjs +474 -992
  30. package/dist/src/react/index.d.ts +9 -6
  31. package/dist/src/react/index.d.ts.map +1 -1
  32. package/dist/src/react/index.js +11 -5
  33. package/dist/src/react/useWidget.d.ts.map +1 -1
  34. package/dist/src/react/widget-types.d.ts +6 -0
  35. package/dist/src/react/widget-types.d.ts.map +1 -1
  36. package/dist/src/server/connect-adapter.d.ts.map +1 -1
  37. package/dist/src/server/index.cjs +232 -21
  38. package/dist/src/server/index.js +232 -21
  39. package/dist/src/server/mcp-server.d.ts.map +1 -1
  40. package/package.json +6 -4
  41. package/dist/src/react/WidgetDebugger.d.ts +0 -31
  42. package/dist/src/react/WidgetDebugger.d.ts.map +0 -1
  43. package/dist/src/react/WidgetFullscreenWrapper.d.ts +0 -32
  44. package/dist/src/react/WidgetFullscreenWrapper.d.ts.map +0 -1
@@ -192,7 +192,7 @@ async function adaptConnectMiddleware(connectMiddleware, middlewarePath) {
192
192
  const mockRequest = createRequest({
193
193
  method: request.method.toUpperCase(),
194
194
  url: middlewarePathname + parsedURL.search,
195
- headers: Object.fromEntries(request.headers.entries()),
195
+ headers: request.headers && typeof request.headers.entries === "function" ? Object.fromEntries(request.headers.entries()) : request.headers,
196
196
  query,
197
197
  ...request.body && { body: request.body }
198
198
  });
@@ -1099,10 +1099,34 @@ var McpServer = class {
1099
1099
  );
1100
1100
  return;
1101
1101
  }
1102
- let entries = [];
1102
+ const entries = [];
1103
1103
  try {
1104
- const files = await fs.readdir(srcDir);
1105
- entries = files.filter((f) => f.endsWith(".tsx") || f.endsWith(".ts")).map((f) => pathHelpers.join(srcDir, f));
1104
+ const files = await fs.readdir(srcDir, { withFileTypes: true });
1105
+ for (const dirent of files) {
1106
+ if (dirent.name.startsWith("._") || dirent.name.startsWith(".DS_Store")) {
1107
+ continue;
1108
+ }
1109
+ if (dirent.isFile() && (dirent.name.endsWith(".tsx") || dirent.name.endsWith(".ts"))) {
1110
+ entries.push({
1111
+ name: dirent.name.replace(/\.tsx?$/, ""),
1112
+ path: pathHelpers.join(srcDir, dirent.name)
1113
+ });
1114
+ } else if (dirent.isDirectory()) {
1115
+ const widgetPath = pathHelpers.join(
1116
+ srcDir,
1117
+ dirent.name,
1118
+ "widget.tsx"
1119
+ );
1120
+ try {
1121
+ await fs.access(widgetPath);
1122
+ entries.push({
1123
+ name: dirent.name,
1124
+ path: widgetPath
1125
+ });
1126
+ } catch {
1127
+ }
1128
+ }
1129
+ }
1106
1130
  } catch (error) {
1107
1131
  console.log(`[WIDGETS] No widgets found in ${resourcesDir}/ directory`);
1108
1132
  return;
@@ -1138,12 +1162,10 @@ var McpServer = class {
1138
1162
  return;
1139
1163
  }
1140
1164
  const widgets = entries.map((entry) => {
1141
- const baseName = entry.split("/").pop()?.replace(/\.tsx?$/, "") || "widget";
1142
- const widgetName = baseName;
1143
1165
  return {
1144
- name: widgetName,
1145
- description: `Widget: ${widgetName}`,
1146
- entry
1166
+ name: entry.name,
1167
+ description: `Widget: ${entry.name}`,
1168
+ entry: entry.path
1147
1169
  };
1148
1170
  });
1149
1171
  for (const widget of widgets) {
@@ -1199,10 +1221,34 @@ if (container && Component) {
1199
1221
  console.log(
1200
1222
  `[WIDGETS] Serving ${entries.length} widget(s) with shared Vite dev server and HMR`
1201
1223
  );
1224
+ const ssrCssPlugin = {
1225
+ name: "ssr-css-handler",
1226
+ enforce: "pre",
1227
+ resolveId(id, importer, options2) {
1228
+ if (options2 && options2.ssr === true && (id.endsWith(".css") || id.endsWith(".module.css"))) {
1229
+ return "\0ssr-css:" + id;
1230
+ }
1231
+ return null;
1232
+ },
1233
+ load(id, options2) {
1234
+ if (options2 && options2.ssr === true && id.startsWith("\0ssr-css:")) {
1235
+ return "export default {}";
1236
+ }
1237
+ return null;
1238
+ }
1239
+ };
1240
+ const watchResourcesPlugin = {
1241
+ name: "watch-resources",
1242
+ configureServer(server) {
1243
+ const resourcesPath = pathHelpers.join(getCwd(), resourcesDir);
1244
+ server.watcher.add(resourcesPath);
1245
+ console.log(`[WIDGETS] Watching resources directory: ${resourcesPath}`);
1246
+ }
1247
+ };
1202
1248
  const viteServer = await createServer({
1203
1249
  root: tempDir,
1204
1250
  base: baseRoute + "/",
1205
- plugins: [tailwindcss(), react()],
1251
+ plugins: [ssrCssPlugin, watchResourcesPlugin, tailwindcss(), react()],
1206
1252
  resolve: {
1207
1253
  alias: {
1208
1254
  "@": pathHelpers.join(getCwd(), resourcesDir)
@@ -1210,7 +1256,35 @@ if (container && Component) {
1210
1256
  },
1211
1257
  server: {
1212
1258
  middlewareMode: true,
1213
- origin: serverOrigin
1259
+ origin: serverOrigin,
1260
+ watch: {
1261
+ // Watch the resources directory for HMR to work
1262
+ // This ensures changes to widget source files trigger hot reload
1263
+ ignored: ["**/node_modules/**", "**/.git/**"],
1264
+ // Include the resources directory in watch list
1265
+ // Vite will watch files imported from outside root
1266
+ usePolling: false
1267
+ }
1268
+ },
1269
+ // Explicitly tell Vite to watch files outside root
1270
+ // This is needed because widget entry files import from resources directory
1271
+ optimizeDeps: {
1272
+ // Don't optimize dependencies that might change
1273
+ exclude: []
1274
+ },
1275
+ ssr: {
1276
+ // Force Vite to transform these packages in SSR instead of using external requires
1277
+ noExternal: ["@openai/apps-sdk-ui", "react-router"]
1278
+ },
1279
+ define: {
1280
+ // Define process.env for SSR context
1281
+ "process.env.NODE_ENV": JSON.stringify(
1282
+ process.env.NODE_ENV || "development"
1283
+ ),
1284
+ "import.meta.env.DEV": true,
1285
+ "import.meta.env.PROD": false,
1286
+ "import.meta.env.MODE": JSON.stringify("development"),
1287
+ "import.meta.env.SSR": true
1214
1288
  }
1215
1289
  });
1216
1290
  this.app.use(`${baseRoute}/*`, async (c, next) => {
@@ -1245,6 +1319,32 @@ if (container && Component) {
1245
1319
  `${baseRoute}/*`
1246
1320
  );
1247
1321
  this.app.use(`${baseRoute}/*`, viteMiddleware);
1322
+ this.app.get("/mcp-use/public/*", async (c) => {
1323
+ const filePath = c.req.path.replace("/mcp-use/public/", "");
1324
+ const fullPath = pathHelpers.join(getCwd(), "public", filePath);
1325
+ try {
1326
+ if (await fsHelpers.existsSync(fullPath)) {
1327
+ const content = await fsHelpers.readFile(fullPath);
1328
+ const ext = filePath.split(".").pop()?.toLowerCase();
1329
+ const contentType = ext === "js" ? "application/javascript" : ext === "css" ? "text/css" : ext === "png" ? "image/png" : ext === "jpg" || ext === "jpeg" ? "image/jpeg" : ext === "svg" ? "image/svg+xml" : ext === "gif" ? "image/gif" : ext === "webp" ? "image/webp" : ext === "ico" ? "image/x-icon" : ext === "woff" || ext === "woff2" ? "font/woff" + (ext === "woff2" ? "2" : "") : ext === "ttf" ? "font/ttf" : ext === "otf" ? "font/otf" : ext === "json" ? "application/json" : ext === "pdf" ? "application/pdf" : "application/octet-stream";
1330
+ return new Response(content, {
1331
+ status: 200,
1332
+ headers: { "Content-Type": contentType }
1333
+ });
1334
+ }
1335
+ return c.notFound();
1336
+ } catch {
1337
+ return c.notFound();
1338
+ }
1339
+ });
1340
+ this.app.use(`${baseRoute}/*`, async (c) => {
1341
+ const url = new URL(c.req.url);
1342
+ const isAsset = url.pathname.match(
1343
+ /\.(js|css|png|jpg|jpeg|svg|json|ico|woff2?|tsx?)$/i
1344
+ );
1345
+ const message = isAsset ? "Widget asset not found" : "Widget not found";
1346
+ return c.text(message, 404);
1347
+ });
1248
1348
  widgets.forEach((widget) => {
1249
1349
  console.log(
1250
1350
  `[WIDGET] ${widget.name} mounted at ${baseRoute}/${widget.name}`
@@ -1318,7 +1418,7 @@ if (container && Component) {
1318
1418
  html = html.replace(
1319
1419
  /<head[^>]*>/i,
1320
1420
  `<head>
1321
- <script>window.__getFile = (filename) => { return "${baseUrl}/mcp-use/widgets/${widget.name}/"+filename }</script>`
1421
+ <script>window.__getFile = (filename) => { return "${baseUrl}/mcp-use/widgets/${widget.name}/"+filename }; window.__mcpPublicUrl = "${baseUrl}/mcp-use/public";</script>`
1322
1422
  );
1323
1423
  } catch (error) {
1324
1424
  console.error(
@@ -1480,7 +1580,7 @@ if (container && Component) {
1480
1580
  html = html.replace(
1481
1581
  /<head[^>]*>/i,
1482
1582
  `<head>
1483
- <script>window.__getFile = (filename) => { return "${baseUrl}/mcp-use/widgets/${widgetName}/"+filename }</script>`
1583
+ <script>window.__getFile = (filename) => { return "${baseUrl}/mcp-use/widgets/${widgetName}/"+filename }; window.__mcpPublicUrl = "${baseUrl}/mcp-use/public";</script>`
1484
1584
  );
1485
1585
  }
1486
1586
  } catch (error) {
@@ -1604,7 +1704,7 @@ if (container && Component) {
1604
1704
  query: Object.fromEntries(new URL(req.url).searchParams),
1605
1705
  params: {},
1606
1706
  body: {},
1607
- headers: Object.fromEntries(req.headers.entries()),
1707
+ headers: req.headers && typeof req.headers.entries === "function" ? Object.fromEntries(req.headers.entries()) : req.headers,
1608
1708
  method: req.method
1609
1709
  };
1610
1710
  const expressRes = {
@@ -1725,7 +1825,6 @@ if (container && Component) {
1725
1825
  return c.text("", 200);
1726
1826
  });
1727
1827
  this.app.get(endpoint, async (c) => {
1728
- const { expressReq, expressRes, getResponse } = createExpressLikeObjects(c);
1729
1828
  const transport = new StreamableHTTPServerTransport({
1730
1829
  sessionIdGenerator: void 0,
1731
1830
  enableJsonResponse: true
@@ -1733,13 +1832,107 @@ if (container && Component) {
1733
1832
  c.req.raw.signal?.addEventListener("abort", () => {
1734
1833
  transport.close();
1735
1834
  });
1835
+ const { readable, writable } = new globalThis.TransformStream();
1836
+ const writer = writable.getWriter();
1837
+ const encoder = new TextEncoder();
1838
+ let resolveResponse;
1839
+ const responsePromise = new Promise((resolve) => {
1840
+ resolveResponse = resolve;
1841
+ });
1842
+ let headersSent = false;
1843
+ const headers = {};
1844
+ let statusCode = 200;
1845
+ const expressRes = {
1846
+ statusCode: 200,
1847
+ headersSent: false,
1848
+ status: /* @__PURE__ */ __name((code) => {
1849
+ statusCode = code;
1850
+ expressRes.statusCode = code;
1851
+ return expressRes;
1852
+ }, "status"),
1853
+ setHeader: /* @__PURE__ */ __name((name, value) => {
1854
+ if (!headersSent) {
1855
+ headers[name] = Array.isArray(value) ? value.join(", ") : value;
1856
+ }
1857
+ }, "setHeader"),
1858
+ getHeader: /* @__PURE__ */ __name((name) => headers[name], "getHeader"),
1859
+ write: /* @__PURE__ */ __name((chunk) => {
1860
+ if (!headersSent) {
1861
+ headersSent = true;
1862
+ resolveResponse(
1863
+ new Response(readable, {
1864
+ status: statusCode,
1865
+ headers
1866
+ })
1867
+ );
1868
+ }
1869
+ const data = typeof chunk === "string" ? encoder.encode(chunk) : chunk instanceof Uint8Array ? chunk : Buffer.from(chunk);
1870
+ writer.write(data);
1871
+ return true;
1872
+ }, "write"),
1873
+ end: /* @__PURE__ */ __name((chunk) => {
1874
+ if (chunk) {
1875
+ expressRes.write(chunk);
1876
+ }
1877
+ if (!headersSent) {
1878
+ headersSent = true;
1879
+ resolveResponse(
1880
+ new Response(null, {
1881
+ status: statusCode,
1882
+ headers
1883
+ })
1884
+ );
1885
+ writer.close();
1886
+ } else {
1887
+ writer.close();
1888
+ }
1889
+ }, "end"),
1890
+ on: /* @__PURE__ */ __name((event, handler) => {
1891
+ if (event === "close") {
1892
+ expressRes._closeHandler = handler;
1893
+ }
1894
+ }, "on"),
1895
+ once: /* @__PURE__ */ __name(() => {
1896
+ }, "once"),
1897
+ removeListener: /* @__PURE__ */ __name(() => {
1898
+ }, "removeListener"),
1899
+ writeHead: /* @__PURE__ */ __name((code, _headers) => {
1900
+ statusCode = code;
1901
+ expressRes.statusCode = code;
1902
+ if (_headers) {
1903
+ Object.assign(headers, _headers);
1904
+ }
1905
+ if (!headersSent) {
1906
+ headersSent = true;
1907
+ resolveResponse(
1908
+ new Response(readable, {
1909
+ status: statusCode,
1910
+ headers
1911
+ })
1912
+ );
1913
+ }
1914
+ return expressRes;
1915
+ }, "writeHead"),
1916
+ flushHeaders: /* @__PURE__ */ __name(() => {
1917
+ }, "flushHeaders")
1918
+ };
1919
+ const expressReq = {
1920
+ ...c.req.raw,
1921
+ url: new URL(c.req.url).pathname + new URL(c.req.url).search,
1922
+ path: new URL(c.req.url).pathname,
1923
+ query: Object.fromEntries(new URL(c.req.url).searchParams),
1924
+ headers: c.req.header(),
1925
+ method: c.req.method
1926
+ };
1736
1927
  await this.server.connect(transport);
1737
- await this.waitForRequestComplete(transport, expressReq, expressRes);
1738
- const response = getResponse();
1739
- if (response) {
1740
- return response;
1741
- }
1742
- return c.text("", 200);
1928
+ transport.handleRequest(expressReq, expressRes).catch((err) => {
1929
+ console.error("MCP Transport error:", err);
1930
+ try {
1931
+ writer.close();
1932
+ } catch {
1933
+ }
1934
+ });
1935
+ return responsePromise;
1743
1936
  });
1744
1937
  this.app.delete(endpoint, async (c) => {
1745
1938
  const { expressReq, expressRes, getResponse } = createExpressLikeObjects(c);
@@ -2121,6 +2314,24 @@ if (container && Component) {
2121
2314
  return c.notFound();
2122
2315
  }
2123
2316
  });
2317
+ this.app.get("/mcp-use/public/*", async (c) => {
2318
+ const filePath = c.req.path.replace("/mcp-use/public/", "");
2319
+ const fullPath = pathHelpers.join(getCwd(), "dist", "public", filePath);
2320
+ try {
2321
+ if (await fsHelpers.existsSync(fullPath)) {
2322
+ const content = await fsHelpers.readFile(fullPath);
2323
+ const ext = filePath.split(".").pop()?.toLowerCase();
2324
+ const contentType = ext === "js" ? "application/javascript" : ext === "css" ? "text/css" : ext === "png" ? "image/png" : ext === "jpg" || ext === "jpeg" ? "image/jpeg" : ext === "svg" ? "image/svg+xml" : ext === "gif" ? "image/gif" : ext === "webp" ? "image/webp" : ext === "ico" ? "image/x-icon" : ext === "woff" || ext === "woff2" ? "font/woff" + (ext === "woff2" ? "2" : "") : ext === "ttf" ? "font/ttf" : ext === "otf" ? "font/otf" : ext === "json" ? "application/json" : ext === "pdf" ? "application/pdf" : "application/octet-stream";
2325
+ return new Response(content, {
2326
+ status: 200,
2327
+ headers: { "Content-Type": contentType }
2328
+ });
2329
+ }
2330
+ return c.notFound();
2331
+ } catch {
2332
+ return c.notFound();
2333
+ }
2334
+ });
2124
2335
  }
2125
2336
  /**
2126
2337
  * Create input schema for resource templates
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../src/server/mcp-server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,IAAI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G;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,iBAAiB,CASnB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-use",
3
3
  "type": "module",
4
- "version": "1.4.1",
4
+ "version": "1.5.0-canary.1",
5
5
  "description": "Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents and Clients + MCP Servers with support for MCP-UI.",
6
6
  "author": "mcp-use, Inc.",
7
7
  "license": "MIT",
@@ -68,7 +68,8 @@
68
68
  "@langchain/openai": "^1.0.0",
69
69
  "langfuse": "^3.38.6",
70
70
  "langfuse-langchain": "^3.38.6",
71
- "react": "^18.0.0 || ^19.0.0"
71
+ "react": "^18.0.0 || ^19.0.0",
72
+ "react-router-dom": "^7.0.0"
72
73
  },
73
74
  "peerDependenciesMeta": {
74
75
  "@e2b/code-interpreter": {
@@ -114,8 +115,8 @@
114
115
  "ws": "^8.18.2",
115
116
  "zod": "^3.25.48",
116
117
  "zod-to-json-schema": "^3.24.6",
117
- "@mcp-use/cli": "2.2.5",
118
- "@mcp-use/inspector": "0.6.1"
118
+ "@mcp-use/cli": "2.3.0-canary.1",
119
+ "@mcp-use/inspector": "0.7.0-canary.1"
119
120
  },
120
121
  "optionalDependencies": {
121
122
  "@tailwindcss/vite": "^4.1.15",
@@ -141,6 +142,7 @@
141
142
  "husky": "^9.1.7",
142
143
  "lint-staged": "^15.2.11",
143
144
  "react": "^19.2.0",
145
+ "react-router-dom": "^7.9.5",
144
146
  "typescript": "^5.8.3",
145
147
  "vitest": "^3.2.4"
146
148
  },
@@ -1,31 +0,0 @@
1
- /**
2
- * Wrapper component that adds a debug button to display widget debug information.
3
- * Shows a bug icon button that opens a minimal overlay with debug data in table format.
4
- */
5
- import React from "react";
6
- type Position = "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
7
- interface WidgetDebuggerProps {
8
- children: React.ReactNode;
9
- className?: string;
10
- position?: Position;
11
- attachTo?: HTMLElement | null;
12
- showLabels?: boolean;
13
- }
14
- /**
15
- * Wrapper component that adds a debug button to display widget debug information.
16
- * The button shows a bug icon and opens an overlay with debug data in a minimal table format.
17
- *
18
- * @example
19
- * ```tsx
20
- * const MyWidget: React.FC = () => {
21
- * return (
22
- * <WidgetDebugger position="top-right">
23
- * <div>My widget content</div>
24
- * </WidgetDebugger>
25
- * );
26
- * };
27
- * ```
28
- */
29
- export declare function WidgetDebugger({ children, className, position, attachTo, showLabels, }: WidgetDebuggerProps): React.JSX.Element;
30
- export {};
31
- //# sourceMappingURL=WidgetDebugger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WidgetDebugger.d.ts","sourceRoot":"","sources":["../../../src/react/WidgetDebugger.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,KAAK,QAAQ,GACT,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,SAAc,EACd,QAAsB,EACtB,QAAQ,EACR,UAAiB,GAClB,EAAE,mBAAmB,qBA2+BrB"}
@@ -1,32 +0,0 @@
1
- /**
2
- * Wrapper component that automatically adds a close button when widget is in fullscreen mode.
3
- * This ensures users can exit fullscreen without needing to add their own close button,
4
- * which would conflict with ChatGPT's own controls when deployed.
5
- */
6
- import React from "react";
7
- type Position = "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right";
8
- interface WidgetFullscreenWrapperProps {
9
- children: React.ReactNode;
10
- className?: string;
11
- position?: Position;
12
- attachTo?: HTMLElement | null;
13
- showLabels?: boolean;
14
- }
15
- /**
16
- * Wrapper component that adds icon buttons for fullscreen and pip modes.
17
- * Icons are only visible on hover with smooth opacity transitions.
18
- *
19
- * @example
20
- * ```tsx
21
- * const MyWidget: React.FC = () => {
22
- * return (
23
- * <WidgetFullscreenWrapper position="top-right" showLabels>
24
- * <div>My widget content</div>
25
- * </WidgetFullscreenWrapper>
26
- * );
27
- * };
28
- * ```
29
- */
30
- export declare function WidgetFullscreenWrapper({ children, className, position, attachTo, showLabels, }: WidgetFullscreenWrapperProps): React.JSX.Element;
31
- export {};
32
- //# sourceMappingURL=WidgetFullscreenWrapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WidgetFullscreenWrapper.d.ts","sourceRoot":"","sources":["../../../src/react/WidgetFullscreenWrapper.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,KAAK,QAAQ,GACT,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,CAAC;AAEnB,UAAU,4BAA4B;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,SAAc,EACd,QAAsB,EACtB,QAAQ,EACR,UAAiB,GAClB,EAAE,4BAA4B,qBA4T9B"}