@shapesos/clay 0.19.0 → 0.19.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.
- package/dist/artifacts.cjs +175 -128
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.js +3 -1
- package/dist/blocks.cjs +172 -163
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.js +4 -4
- package/dist/chat.cjs +172 -163
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.js +5 -5
- package/dist/{chunk-DC5KYT2G.js → chunk-63AGNGKG.js} +17 -3
- package/dist/chunk-63AGNGKG.js.map +1 -0
- package/dist/{chunk-JMHE3Q5K.js → chunk-PISZYS2H.js} +5 -5
- package/dist/{chunk-FCSYVF4Z.js → chunk-PWSEEUVL.js} +2 -2
- package/dist/index.cjs +172 -163
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-DC5KYT2G.js.map +0 -1
- /package/dist/{chunk-JMHE3Q5K.js.map → chunk-PISZYS2H.js.map} +0 -0
- /package/dist/{chunk-FCSYVF4Z.js.map → chunk-PWSEEUVL.js.map} +0 -0
package/dist/blocks.cjs
CHANGED
|
@@ -2061,6 +2061,41 @@ var ChartArtifactService = {
|
|
|
2061
2061
|
// src/components/artifacts/deck-artifact/deck-artifact.tsx
|
|
2062
2062
|
var import_react17 = require("react");
|
|
2063
2063
|
var import_react_dom = require("react-dom");
|
|
2064
|
+
|
|
2065
|
+
// src/components/badge/badge.tsx
|
|
2066
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2067
|
+
var BASE = "inline-flex items-center whitespace-nowrap rounded-full";
|
|
2068
|
+
var SIZES = {
|
|
2069
|
+
// `sm` is a uniform scale-down of `md` (text 10/12 of caption): padding and line-height keep
|
|
2070
|
+
// md's proportions (caption is 12px text on a 16px line = 1.333 ratio) so the pill shape matches.
|
|
2071
|
+
md: "px-2.5 py-0.5 text-geist-label-caption-medium",
|
|
2072
|
+
sm: "px-2 py-0.5 text-[11px]/[1.333] font-medium"
|
|
2073
|
+
};
|
|
2074
|
+
var SUBTLE = {
|
|
2075
|
+
neutral: "bg-brown-20 text-brown-70",
|
|
2076
|
+
warning: "bg-orange-50 text-orange-600",
|
|
2077
|
+
violet: "bg-violet-50 text-violet-600"
|
|
2078
|
+
};
|
|
2079
|
+
var OUTLINE = {
|
|
2080
|
+
neutral: "border border-brown-30 bg-white text-brown-100",
|
|
2081
|
+
warning: "border border-orange-200 bg-white text-orange-600",
|
|
2082
|
+
violet: "border border-violet-400 bg-white text-violet-600"
|
|
2083
|
+
};
|
|
2084
|
+
var VARIANTS = {
|
|
2085
|
+
subtle: SUBTLE,
|
|
2086
|
+
outline: OUTLINE
|
|
2087
|
+
};
|
|
2088
|
+
function Badge({
|
|
2089
|
+
variant = "subtle",
|
|
2090
|
+
tone = "neutral",
|
|
2091
|
+
size = "md",
|
|
2092
|
+
className,
|
|
2093
|
+
children
|
|
2094
|
+
}) {
|
|
2095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: cn(BASE, SIZES[size], VARIANTS[variant][tone], className), children });
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
// src/components/artifacts/deck-artifact/deck-artifact.tsx
|
|
2064
2099
|
init_capture_exclude_attribute();
|
|
2065
2100
|
|
|
2066
2101
|
// src/components/artifacts/deck-artifact/deck-artifact-content.tsx
|
|
@@ -2068,23 +2103,23 @@ var import_react16 = require("react");
|
|
|
2068
2103
|
|
|
2069
2104
|
// src/components/ui/table.tsx
|
|
2070
2105
|
var React3 = __toESM(require("react"), 1);
|
|
2071
|
-
var
|
|
2072
|
-
var Table = React3.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2106
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2107
|
+
var Table = React3.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("relative w-full overflow-auto", containerClassName), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("table", { ref, className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
2073
2108
|
Table.displayName = "Table";
|
|
2074
2109
|
var TableHeader = React3.forwardRef(
|
|
2075
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2110
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { ref, className: cn("[&_tr]:border-b", className), ...props })
|
|
2076
2111
|
);
|
|
2077
2112
|
TableHeader.displayName = "TableHeader";
|
|
2078
2113
|
var TableBody = React3.forwardRef(
|
|
2079
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2114
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props })
|
|
2080
2115
|
);
|
|
2081
2116
|
TableBody.displayName = "TableBody";
|
|
2082
2117
|
var TableFooter = React3.forwardRef(
|
|
2083
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2118
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tfoot", { ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props })
|
|
2084
2119
|
);
|
|
2085
2120
|
TableFooter.displayName = "TableFooter";
|
|
2086
2121
|
var TableRow = React3.forwardRef(
|
|
2087
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2122
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2088
2123
|
"tr",
|
|
2089
2124
|
{
|
|
2090
2125
|
ref,
|
|
@@ -2095,7 +2130,7 @@ var TableRow = React3.forwardRef(
|
|
|
2095
2130
|
);
|
|
2096
2131
|
TableRow.displayName = "TableRow";
|
|
2097
2132
|
var TableHead = React3.forwardRef(
|
|
2098
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2133
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2099
2134
|
"th",
|
|
2100
2135
|
{
|
|
2101
2136
|
ref,
|
|
@@ -2109,11 +2144,11 @@ var TableHead = React3.forwardRef(
|
|
|
2109
2144
|
);
|
|
2110
2145
|
TableHead.displayName = "TableHead";
|
|
2111
2146
|
var TableCell = React3.forwardRef(
|
|
2112
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2147
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className), ...props })
|
|
2113
2148
|
);
|
|
2114
2149
|
TableCell.displayName = "TableCell";
|
|
2115
2150
|
var TableCaption = React3.forwardRef(
|
|
2116
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2151
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props })
|
|
2117
2152
|
);
|
|
2118
2153
|
TableCaption.displayName = "TableCaption";
|
|
2119
2154
|
|
|
@@ -2144,21 +2179,21 @@ function useScrollShadow() {
|
|
|
2144
2179
|
}
|
|
2145
2180
|
|
|
2146
2181
|
// src/components/table/data-table.tsx
|
|
2147
|
-
var
|
|
2182
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2148
2183
|
var DATA_TABLE_HEAD_CLASS = "h-auto py-2 px-4 text-xs font-medium text-foreground whitespace-nowrap text-left";
|
|
2149
2184
|
var DATA_TABLE_CELL_CLASS = "p-4 text-sm font-normal text-foreground align-top min-w-[150px] text-left";
|
|
2150
2185
|
var DATA_TABLE_ROW_CLASS = "border-b-brown-30 bg-background/70 hover:bg-secondary";
|
|
2151
2186
|
var DATA_TABLE_SCROLL_SHADOW = "0 1px 2px rgb(0 0 0 / 0.01), 0 6px 12px -2px rgb(0 0 0 / 0.03)";
|
|
2152
2187
|
function DataTable({ header, children, maxBodyHeight, className }) {
|
|
2153
2188
|
const { targetRef, isScrolled } = useScrollShadow();
|
|
2154
|
-
return /* @__PURE__ */ (0,
|
|
2189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2155
2190
|
"div",
|
|
2156
2191
|
{
|
|
2157
2192
|
ref: targetRef,
|
|
2158
2193
|
className: cn("overscroll-none", className),
|
|
2159
2194
|
style: maxBodyHeight !== void 0 ? { maxHeight: maxBodyHeight, overflowY: "auto" } : void 0,
|
|
2160
|
-
children: /* @__PURE__ */ (0,
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Table, { containerClassName: "overflow-visible", children: [
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2162
2197
|
TableHeader,
|
|
2163
2198
|
{
|
|
2164
2199
|
"data-scrolled": isScrolled ? "true" : void 0,
|
|
@@ -2167,7 +2202,7 @@ function DataTable({ header, children, maxBodyHeight, className }) {
|
|
|
2167
2202
|
children: header
|
|
2168
2203
|
}
|
|
2169
2204
|
),
|
|
2170
|
-
/* @__PURE__ */ (0,
|
|
2205
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TableBody, { children })
|
|
2171
2206
|
] })
|
|
2172
2207
|
}
|
|
2173
2208
|
);
|
|
@@ -2188,7 +2223,7 @@ function formatCell(row, column) {
|
|
|
2188
2223
|
var DATA_ROW_CLASSES = `${DATA_TABLE_ROW_CLASS} animate-in fade-in duration-300`;
|
|
2189
2224
|
|
|
2190
2225
|
// src/components/artifacts/table-artifact/table-artifact-content.tsx
|
|
2191
|
-
var
|
|
2226
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2192
2227
|
function TableArtifactContent({
|
|
2193
2228
|
columns,
|
|
2194
2229
|
data,
|
|
@@ -2198,45 +2233,45 @@ function TableArtifactContent({
|
|
|
2198
2233
|
labels
|
|
2199
2234
|
}) {
|
|
2200
2235
|
if (data.status === TABLE_STATUS.ERROR) {
|
|
2201
|
-
return /* @__PURE__ */ (0,
|
|
2236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StatusMessage, { $tone: "error", children: labels.loadError });
|
|
2202
2237
|
}
|
|
2203
2238
|
if (data.status === TABLE_STATUS.UNAVAILABLE) {
|
|
2204
|
-
return /* @__PURE__ */ (0,
|
|
2239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StatusMessage, { $tone: "info", children: labels.unavailable });
|
|
2205
2240
|
}
|
|
2206
2241
|
if (data.status === TABLE_STATUS.LOADING) {
|
|
2207
2242
|
if (typeof knownRowCount === "number" && knownRowCount > 0) {
|
|
2208
2243
|
const shimmerCount = Math.min(knownRowCount, maxShimmerRows);
|
|
2209
|
-
return /* @__PURE__ */ (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArtifactTable, { columns, maxBodyHeight, children: renderShimmerRows(columns, shimmerCount) });
|
|
2210
2245
|
}
|
|
2211
|
-
return /* @__PURE__ */ (0,
|
|
2246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(StatusMessage, { $tone: "info", children: labels.loading });
|
|
2212
2247
|
}
|
|
2213
|
-
return /* @__PURE__ */ (0,
|
|
2248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArtifactTable, { columns, maxBodyHeight, children: data.rows.length === 0 ? renderEmptyRow(columns.length, labels.empty) : renderDataRows(columns, data.rows) });
|
|
2214
2249
|
}
|
|
2215
2250
|
function ArtifactTable({ columns, maxBodyHeight, children }) {
|
|
2216
|
-
return /* @__PURE__ */ (0,
|
|
2251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2217
2252
|
DataTable,
|
|
2218
2253
|
{
|
|
2219
2254
|
maxBodyHeight,
|
|
2220
|
-
header: /* @__PURE__ */ (0,
|
|
2255
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableRow, { className: "hover:bg-transparent", children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableHead, { scope: "col", className: DATA_TABLE_HEAD_CLASS, children: column.label }, column.key)) }),
|
|
2221
2256
|
children
|
|
2222
2257
|
}
|
|
2223
2258
|
);
|
|
2224
2259
|
}
|
|
2225
2260
|
function renderShimmerRows(columns, count) {
|
|
2226
|
-
return Array.from({ length: count }).map((_, index) => /* @__PURE__ */ (0,
|
|
2261
|
+
return Array.from({ length: count }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableRow, { className: DATA_TABLE_ROW_CLASS, "aria-hidden": "true", children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableCell, { className: DATA_TABLE_CELL_CLASS, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "block h-3 w-3/4 animate-pulse rounded bg-muted-foreground/20" }) }, column.key)) }, `shimmer-${index}`));
|
|
2227
2262
|
}
|
|
2228
2263
|
function renderDataRows(columns, rows) {
|
|
2229
|
-
return rows.map((row, index) => /* @__PURE__ */ (0,
|
|
2264
|
+
return rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableRow, { className: DATA_ROW_CLASSES, children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableCell, { className: DATA_TABLE_CELL_CLASS, children: formatCell(row, column) }, column.key)) }, index));
|
|
2230
2265
|
}
|
|
2231
2266
|
function renderEmptyRow(colSpan, emptyMessage) {
|
|
2232
|
-
return /* @__PURE__ */ (0,
|
|
2267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TableCell, { colSpan, className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }) });
|
|
2233
2268
|
}
|
|
2234
2269
|
|
|
2235
2270
|
// src/components/artifacts/deck-artifact/deck-markdown.tsx
|
|
2236
2271
|
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
2237
2272
|
var import_remark_breaks = __toESM(require("remark-breaks"), 1);
|
|
2238
2273
|
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
2239
|
-
var
|
|
2274
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2240
2275
|
function sanitize(text) {
|
|
2241
2276
|
return text.split("\n").filter((line) => {
|
|
2242
2277
|
const t = line.trim();
|
|
@@ -2244,45 +2279,45 @@ function sanitize(text) {
|
|
|
2244
2279
|
}).join("\n");
|
|
2245
2280
|
}
|
|
2246
2281
|
var MARKDOWN_COMPONENTS = {
|
|
2247
|
-
h1: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2248
|
-
h2: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2249
|
-
h3: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2250
|
-
h4: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2251
|
-
h5: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2252
|
-
h6: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2253
|
-
p: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2254
|
-
ul: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2255
|
-
ol: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2282
|
+
h1: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h1", { className: "text-[30px] font-semibold leading-tight text-foreground mb-3", ...props }),
|
|
2283
|
+
h2: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "text-[26px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
2284
|
+
h3: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
2285
|
+
h4: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
2286
|
+
h5: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h5", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
2287
|
+
h6: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h6", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
2288
|
+
p: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-[22px] leading-relaxed text-foreground my-2", ...props }),
|
|
2289
|
+
ul: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", { className: "list-disc pl-7 text-[22px] leading-relaxed text-foreground my-2", ...props }),
|
|
2290
|
+
ol: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ol", { className: "list-decimal pl-7 text-[22px] leading-relaxed text-foreground my-2", ...props }),
|
|
2256
2291
|
// react-markdown injects list metadata (`ordered` / `index` / `checked`) that must not leak to the DOM.
|
|
2257
|
-
li: ({ node: _node, ordered: _ordered, index: _index, checked: _checked, ...props }) => /* @__PURE__ */ (0,
|
|
2258
|
-
strong: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2259
|
-
em: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2292
|
+
li: ({ node: _node, ordered: _ordered, index: _index, checked: _checked, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", { className: "my-1", ...props }),
|
|
2293
|
+
strong: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("strong", { className: "font-semibold", ...props }),
|
|
2294
|
+
em: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("em", { className: "italic", ...props }),
|
|
2260
2295
|
// Gate `<img src>` against an http(s) allowlist. react-markdown v8 percent-encodes the URL but
|
|
2261
2296
|
// does NOT protocol-filter image src (unlike link href), so an LLM-authored
|
|
2262
2297
|
// `` / `` or a tracking-pixel `` would otherwise render
|
|
2263
2298
|
// with the raw URL. Unsafe src → render nothing.
|
|
2264
|
-
img: ({ node: _node, src, ...props }) => typeof src === "string" && isSafeDownloadUrl(src) ? /* @__PURE__ */ (0,
|
|
2299
|
+
img: ({ node: _node, src, ...props }) => typeof src === "string" && isSafeDownloadUrl(src) ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("img", { src, className: "max-w-full", ...props }) : null,
|
|
2265
2300
|
a: ({ node: _node, ...props }) => (
|
|
2266
2301
|
// `rel` is forced AFTER `{...props}` so it can't be overridden — if a consumer ever adds
|
|
2267
2302
|
// `linkTarget="_blank"`, LLM-authored links still can't reach `window.opener`.
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("a", { className: "underline underline-offset-2", ...props, rel: "noopener noreferrer" })
|
|
2269
2304
|
),
|
|
2270
2305
|
// react-markdown passes `inline` to distinguish inline code from fenced blocks — strip it from the DOM.
|
|
2271
|
-
code: ({ node: _node, inline: _inline, ...props }) => /* @__PURE__ */ (0,
|
|
2272
|
-
blockquote: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2273
|
-
hr: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2274
|
-
table: ({ node: _node, ...props }) => /* @__PURE__ */ (0,
|
|
2306
|
+
code: ({ node: _node, inline: _inline, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { className: "rounded bg-muted px-1.5 py-0.5 font-mono text-[18px]", ...props }),
|
|
2307
|
+
blockquote: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("blockquote", { className: "border-l-2 border-brown-alpha-12 pl-4 text-[22px] text-muted-foreground", ...props }),
|
|
2308
|
+
hr: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("hr", { className: "my-4 border-brown-alpha-12", ...props }),
|
|
2309
|
+
table: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("table", { className: "w-full border-collapse text-[20px]", ...props }) }),
|
|
2275
2310
|
// react-markdown passes `isHeader` to cell renderers — strip it so it never reaches the DOM.
|
|
2276
|
-
th: ({ node: _node, isHeader: _isHeader, ...props }) => /* @__PURE__ */ (0,
|
|
2277
|
-
td: ({ node: _node, isHeader: _isHeader, ...props }) => /* @__PURE__ */ (0,
|
|
2311
|
+
th: ({ node: _node, isHeader: _isHeader, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "border-b border-brown-alpha-12 px-3 py-1.5 text-left font-medium", ...props }),
|
|
2312
|
+
td: ({ node: _node, isHeader: _isHeader, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "border-b border-brown-alpha-12 px-3 py-1.5", ...props })
|
|
2278
2313
|
};
|
|
2279
2314
|
function DeckMarkdown({ markdown }) {
|
|
2280
|
-
return /* @__PURE__ */ (0,
|
|
2315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_markdown.default, { remarkPlugins: [import_remark_gfm.default, import_remark_breaks.default], components: MARKDOWN_COMPONENTS, children: sanitize(markdown) });
|
|
2281
2316
|
}
|
|
2282
2317
|
|
|
2283
2318
|
// src/components/artifacts/deck-artifact/slide-renderers.tsx
|
|
2284
2319
|
var import_react15 = require("react");
|
|
2285
|
-
var
|
|
2320
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2286
2321
|
function safeLogoUrl(meta) {
|
|
2287
2322
|
return meta?.logoUrl && isSafeDownloadUrl(meta.logoUrl) ? meta.logoUrl : null;
|
|
2288
2323
|
}
|
|
@@ -2309,7 +2344,7 @@ function SlideFrame({ meta, children, accent = false, bare = false }) {
|
|
|
2309
2344
|
const eyebrowColor = accent ? "text-white/70" : "text-brown-60";
|
|
2310
2345
|
const borderColor = accent ? "border-white/20" : "border-brown-alpha-12";
|
|
2311
2346
|
const logoSrc = safeLogoUrl(meta);
|
|
2312
|
-
return /* @__PURE__ */ (0,
|
|
2347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: frameRef, className: `relative aspect-[16/9] w-full overflow-hidden rounded-lg ${bg}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2313
2348
|
"div",
|
|
2314
2349
|
{
|
|
2315
2350
|
className: "absolute left-0 top-0 origin-top-left",
|
|
@@ -2320,26 +2355,26 @@ function SlideFrame({ meta, children, accent = false, bare = false }) {
|
|
|
2320
2355
|
visibility: scale === null ? "hidden" : "visible"
|
|
2321
2356
|
},
|
|
2322
2357
|
children: [
|
|
2323
|
-
!bare ? /* @__PURE__ */ (0,
|
|
2358
|
+
!bare ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2324
2359
|
"div",
|
|
2325
2360
|
{
|
|
2326
2361
|
className: `absolute inset-x-0 top-0 flex items-center justify-between border-b px-16 ${borderColor}`,
|
|
2327
2362
|
style: { height: EYEBROW_H },
|
|
2328
2363
|
children: [
|
|
2329
|
-
meta?.eyebrow ? /* @__PURE__ */ (0,
|
|
2330
|
-
logoSrc ? /* @__PURE__ */ (0,
|
|
2364
|
+
meta?.eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: eyebrowColor, style: { ...ACCENT_FONT, fontSize: 22 }, children: meta.eyebrow }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", {}),
|
|
2365
|
+
logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: logoSrc, alt: "", className: "object-contain", style: { maxHeight: CANVAS_LOGO_MAX_H } }) : null
|
|
2331
2366
|
]
|
|
2332
2367
|
}
|
|
2333
2368
|
) : null,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2369
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute inset-x-0 bottom-0 overflow-hidden", style: { top: bare ? 0 : EYEBROW_H }, children })
|
|
2335
2370
|
]
|
|
2336
2371
|
}
|
|
2337
2372
|
) });
|
|
2338
2373
|
}
|
|
2339
2374
|
function TitleSlide({ slide, meta }) {
|
|
2340
2375
|
const logoSrc = safeLogoUrl(meta);
|
|
2341
|
-
return /* @__PURE__ */ (0,
|
|
2342
|
-
logoSrc ? /* @__PURE__ */ (0,
|
|
2376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SlideFrame, { meta, bare: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex h-full flex-col justify-center px-24 py-16", children: [
|
|
2377
|
+
logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2343
2378
|
"img",
|
|
2344
2379
|
{
|
|
2345
2380
|
src: logoSrc,
|
|
@@ -2348,7 +2383,7 @@ function TitleSlide({ slide, meta }) {
|
|
|
2348
2383
|
style: { maxHeight: 56, maxWidth: 380 }
|
|
2349
2384
|
}
|
|
2350
2385
|
) : null,
|
|
2351
|
-
/* @__PURE__ */ (0,
|
|
2386
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2352
2387
|
"h1",
|
|
2353
2388
|
{
|
|
2354
2389
|
className: "font-bold tracking-tight text-brown-100",
|
|
@@ -2356,36 +2391,36 @@ function TitleSlide({ slide, meta }) {
|
|
|
2356
2391
|
children: slide.title
|
|
2357
2392
|
}
|
|
2358
2393
|
),
|
|
2359
|
-
slide.subtitle ? /* @__PURE__ */ (0,
|
|
2360
|
-
slide.description ? /* @__PURE__ */ (0,
|
|
2361
|
-
meta?.date ? /* @__PURE__ */ (0,
|
|
2394
|
+
slide.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-7 text-brown-70", style: { ...ACCENT_FONT, fontSize: 34 }, children: slide.subtitle }) : null,
|
|
2395
|
+
slide.description ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-4 leading-relaxed text-brown-70", style: { fontSize: 24, maxWidth: 880 }, children: slide.description }) : null,
|
|
2396
|
+
meta?.date ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-10 text-brown-70", style: { ...ACCENT_FONT, fontSize: 30 }, children: meta.date }) : null
|
|
2362
2397
|
] }) });
|
|
2363
2398
|
}
|
|
2364
2399
|
function AgendaSlide({ slide, meta, labels }) {
|
|
2365
2400
|
const items = slide.items ?? [];
|
|
2366
|
-
return /* @__PURE__ */ (0,
|
|
2367
|
-
/* @__PURE__ */ (0,
|
|
2368
|
-
/* @__PURE__ */ (0,
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "h-full px-24 py-14", children: [
|
|
2402
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "mb-10 font-bold text-brown-90", style: { fontSize: 40 }, children: slide.title || labels.agenda }),
|
|
2403
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-baseline gap-6 border-b border-brown-alpha-12 py-5", children: [
|
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "shrink-0 text-indigo-600", style: { ...ACCENT_FONT, fontSize: 28, width: 64 }, children: String(i + 1).padStart(2, "0") }),
|
|
2405
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-brown-90", style: { fontSize: 28 }, children: item })
|
|
2371
2406
|
] }, i)) })
|
|
2372
2407
|
] }) });
|
|
2373
2408
|
}
|
|
2374
2409
|
function SectionSlide({ slide, meta }) {
|
|
2375
|
-
return /* @__PURE__ */ (0,
|
|
2376
|
-
/* @__PURE__ */ (0,
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SlideFrame, { meta, accent: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex h-full flex-col justify-center gap-6 px-24", children: [
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "font-bold text-white", style: { fontSize: 72, lineHeight: 1.05, maxWidth: 940 }, children: slide.title }),
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "mt-2 bg-white/50", style: { width: 96, height: 5 } })
|
|
2378
2413
|
] }) });
|
|
2379
2414
|
}
|
|
2380
2415
|
function ClosingSlide({ meta, labels }) {
|
|
2381
|
-
return /* @__PURE__ */ (0,
|
|
2382
|
-
/* @__PURE__ */ (0,
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-6 px-24 text-center", children: [
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h1", { className: "font-bold text-brown-100", style: { fontSize: 72 }, children: labels.thankYou }),
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-indigo-600", style: { ...ACCENT_FONT, fontSize: 36 }, children: labels.questions })
|
|
2384
2419
|
] }) });
|
|
2385
2420
|
}
|
|
2386
2421
|
|
|
2387
2422
|
// src/components/artifacts/deck-artifact/deck-artifact-content.tsx
|
|
2388
|
-
var
|
|
2423
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2389
2424
|
var TABLE_BLOCK_MAX_SHIMMER_ROWS = 10;
|
|
2390
2425
|
var TABLE_CHROME_RESERVE = 56;
|
|
2391
2426
|
var VISUAL_FALLBACK_HEIGHT = 360;
|
|
@@ -2415,14 +2450,14 @@ function DeckArtifactContent({
|
|
|
2415
2450
|
[slides.length, onNavigate, isControlled, onSlideChange]
|
|
2416
2451
|
);
|
|
2417
2452
|
const position = labels.position.replace("{current}", String(current + 1)).replace("{total}", String(slides.length));
|
|
2418
|
-
return /* @__PURE__ */ (0,
|
|
2419
|
-
/* @__PURE__ */ (0,
|
|
2420
|
-
/* @__PURE__ */ (0,
|
|
2453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col gap-3 p-4", children: [
|
|
2454
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SlideDispatch, { slide, labels, meta }),
|
|
2455
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2421
2456
|
"div",
|
|
2422
2457
|
{
|
|
2423
2458
|
className: `flex items-center justify-between border-t pt-2 ${onDark ? "border-white/20" : "border-brown-alpha-12"}`,
|
|
2424
2459
|
children: [
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2460
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2426
2461
|
IconButton,
|
|
2427
2462
|
{
|
|
2428
2463
|
icon: IconChevronLeft,
|
|
@@ -2433,8 +2468,8 @@ function DeckArtifactContent({
|
|
|
2433
2468
|
onClick: () => goTo(current - 1)
|
|
2434
2469
|
}
|
|
2435
2470
|
),
|
|
2436
|
-
/* @__PURE__ */ (0,
|
|
2437
|
-
/* @__PURE__ */ (0,
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `text-xs font-medium ${onDark ? "text-white/70" : "text-brown-70"}`, children: position }),
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2438
2473
|
IconButton,
|
|
2439
2474
|
{
|
|
2440
2475
|
icon: IconChevronRight,
|
|
@@ -2454,16 +2489,16 @@ function SlideDispatch({ slide, labels, meta }) {
|
|
|
2454
2489
|
const kind = slide.kind ?? deckSlideKinds.CONTENT;
|
|
2455
2490
|
switch (kind) {
|
|
2456
2491
|
case deckSlideKinds.TITLE:
|
|
2457
|
-
return /* @__PURE__ */ (0,
|
|
2492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TitleSlide, { slide, meta });
|
|
2458
2493
|
case deckSlideKinds.AGENDA:
|
|
2459
|
-
return /* @__PURE__ */ (0,
|
|
2494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AgendaSlide, { slide, meta, labels });
|
|
2460
2495
|
case deckSlideKinds.SECTION:
|
|
2461
|
-
return /* @__PURE__ */ (0,
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SectionSlide, { slide, meta });
|
|
2462
2497
|
case deckSlideKinds.CLOSING:
|
|
2463
|
-
return /* @__PURE__ */ (0,
|
|
2498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ClosingSlide, { meta, labels });
|
|
2464
2499
|
case deckSlideKinds.CONTENT:
|
|
2465
2500
|
default:
|
|
2466
|
-
return /* @__PURE__ */ (0,
|
|
2501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ContentSlide, { slide, meta, labels });
|
|
2467
2502
|
}
|
|
2468
2503
|
}
|
|
2469
2504
|
function isVisualBlock(block) {
|
|
@@ -2476,25 +2511,25 @@ function ContentSlide({ slide, meta, labels }) {
|
|
|
2476
2511
|
(b) => b.type === deckBlockTypes.TEXT
|
|
2477
2512
|
);
|
|
2478
2513
|
if (visuals.length === 1 && texts.length > 0) {
|
|
2479
|
-
return /* @__PURE__ */ (0,
|
|
2480
|
-
/* @__PURE__ */ (0,
|
|
2481
|
-
/* @__PURE__ */ (0,
|
|
2482
|
-
texts.map((block, i) => /* @__PURE__ */ (0,
|
|
2514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex h-full items-stretch gap-12 px-16 py-12", children: [
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex w-[42%] shrink-0 flex-col overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AutoFit, { children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "mb-5 font-bold leading-tight text-foreground", style: { fontSize: 34 }, children: slide.title }),
|
|
2517
|
+
texts.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DeckMarkdown, { markdown: block.markdown }, i))
|
|
2483
2518
|
] }) }),
|
|
2484
|
-
/* @__PURE__ */ (0,
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "min-h-0 min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FillVisual, { block: visuals[0], labels }) })
|
|
2485
2520
|
] }) });
|
|
2486
2521
|
}
|
|
2487
2522
|
if (visuals.length > 0) {
|
|
2488
|
-
return /* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex h-full flex-col gap-5 px-16 py-10", children: [
|
|
2524
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "shrink-0 font-bold leading-tight text-foreground", style: { fontSize: 32 }, children: slide.title }),
|
|
2490
2525
|
content.map(
|
|
2491
|
-
(block, i) => isVisualBlock(block) ? /* @__PURE__ */ (0,
|
|
2526
|
+
(block, i) => isVisualBlock(block) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "min-h-0 min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FillVisual, { block, labels }) }, i) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "shrink-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DeckMarkdown, { markdown: block.markdown }) }, i)
|
|
2492
2527
|
)
|
|
2493
2528
|
] }) });
|
|
2494
2529
|
}
|
|
2495
|
-
return /* @__PURE__ */ (0,
|
|
2496
|
-
/* @__PURE__ */ (0,
|
|
2497
|
-
texts.map((block, i) => /* @__PURE__ */ (0,
|
|
2530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "h-full px-24 py-12", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(AutoFit, { children: [
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "mb-6 font-bold leading-tight text-foreground", style: { fontSize: 38 }, children: slide.title }),
|
|
2532
|
+
texts.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DeckMarkdown, { markdown: block.markdown }, i))
|
|
2498
2533
|
] }) }) });
|
|
2499
2534
|
}
|
|
2500
2535
|
function AutoFit({ children }) {
|
|
@@ -2518,7 +2553,7 @@ function AutoFit({ children }) {
|
|
|
2518
2553
|
return () => ro.disconnect();
|
|
2519
2554
|
}, []);
|
|
2520
2555
|
const scaled = fit.scale < 1;
|
|
2521
|
-
return /* @__PURE__ */ (0,
|
|
2556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref: boxRef, className: "flex h-full min-h-0 w-full flex-col justify-center overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: scaled ? { height: fit.height } : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2522
2557
|
"div",
|
|
2523
2558
|
{
|
|
2524
2559
|
ref: contentRef,
|
|
@@ -2543,12 +2578,12 @@ function FillVisual({ block, labels }) {
|
|
|
2543
2578
|
return () => ro.disconnect();
|
|
2544
2579
|
}, []);
|
|
2545
2580
|
const chartLabels = labels.chart ?? DEFAULT_CHART_ARTIFACT_LABELS;
|
|
2546
|
-
return /* @__PURE__ */ (0,
|
|
2581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, className: "h-full min-h-0 w-full overflow-hidden", children: block.type === deckBlockTypes.CHART ? (
|
|
2547
2582
|
// ChartArtifactContent assumes a non-empty rowset (the standalone ChartArtifact guards
|
|
2548
2583
|
// `rows.length > 0` upstream); mirror that guard here so an empty inline chart shows the
|
|
2549
2584
|
// localized empty status instead of a blank chart area.
|
|
2550
|
-
block.rows.length === 0 ? /* @__PURE__ */ (0,
|
|
2551
|
-
) : /* @__PURE__ */ (0,
|
|
2585
|
+
block.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StatusMessage, { $tone: "info", children: chartLabels.empty }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ChartArtifactContent, { config: block.config, rows: block.rows, labels: chartLabels }) })
|
|
2586
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2552
2587
|
TableArtifactContent,
|
|
2553
2588
|
{
|
|
2554
2589
|
columns: block.config.columns,
|
|
@@ -2614,7 +2649,7 @@ function isValidDeckBlock(block) {
|
|
|
2614
2649
|
}
|
|
2615
2650
|
|
|
2616
2651
|
// src/components/artifacts/deck-artifact/deck-artifact.tsx
|
|
2617
|
-
var
|
|
2652
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2618
2653
|
var TITLE_CLASSES2 = "text-sm font-semibold text-foreground";
|
|
2619
2654
|
function DeckArtifact({ artifact, labels, callbacks }) {
|
|
2620
2655
|
const validConfig = isValidDeckConfig(artifact.config);
|
|
@@ -2655,9 +2690,9 @@ function DeckArtifact({ artifact, labels, callbacks }) {
|
|
|
2655
2690
|
const meta = artifact.config?.meta;
|
|
2656
2691
|
const handleOpenFullscreen = () => setIsFullscreen(true);
|
|
2657
2692
|
const handleCloseFullscreen = () => setIsFullscreen(false);
|
|
2658
|
-
const actions = /* @__PURE__ */ (0,
|
|
2659
|
-
showDownload ? /* @__PURE__ */ (0,
|
|
2660
|
-
validConfig ? /* @__PURE__ */ (0,
|
|
2693
|
+
const actions = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ArtifactActions, { ...{ [CAPTURE_EXCLUDE_ATTRIBUTE]: "" }, children: [
|
|
2694
|
+
showDownload ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArtifactDownloadButton, { href: presignedUrl ?? "", label: resolvedLabels.download, onClick: handleDownload }) : null,
|
|
2695
|
+
validConfig ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2661
2696
|
IconButton,
|
|
2662
2697
|
{
|
|
2663
2698
|
icon: IconArrowsMaximize,
|
|
@@ -2667,22 +2702,29 @@ function DeckArtifact({ artifact, labels, callbacks }) {
|
|
|
2667
2702
|
}
|
|
2668
2703
|
) : null
|
|
2669
2704
|
] });
|
|
2705
|
+
const heading = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2706
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArtifactTitle, { className: TITLE_CLASSES2, children: artifact.title }) : null,
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Badge, { tone: "violet", variant: "subtle", size: "sm", className: "gap-1 py-1", children: [
|
|
2708
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { icon: IconFlask2Filled, size: 12 }),
|
|
2709
|
+
"Labs"
|
|
2710
|
+
] })
|
|
2711
|
+
] });
|
|
2670
2712
|
if (!validConfig) {
|
|
2671
|
-
return /* @__PURE__ */ (0,
|
|
2672
|
-
/* @__PURE__ */ (0,
|
|
2673
|
-
|
|
2713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
2714
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
2715
|
+
heading,
|
|
2674
2716
|
actions
|
|
2675
2717
|
] }),
|
|
2676
|
-
/* @__PURE__ */ (0,
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArtifactContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(StatusMessage, { $tone: "info", children: resolvedLabels.unavailable }) })
|
|
2677
2719
|
] });
|
|
2678
2720
|
}
|
|
2679
|
-
return /* @__PURE__ */ (0,
|
|
2680
|
-
/* @__PURE__ */ (0,
|
|
2681
|
-
/* @__PURE__ */ (0,
|
|
2682
|
-
|
|
2721
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
2722
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
2723
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
2724
|
+
heading,
|
|
2683
2725
|
actions
|
|
2684
2726
|
] }),
|
|
2685
|
-
/* @__PURE__ */ (0,
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ArtifactContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2686
2728
|
DeckArtifactContent,
|
|
2687
2729
|
{
|
|
2688
2730
|
slides: artifact.config.slides,
|
|
@@ -2695,7 +2737,7 @@ function DeckArtifact({ artifact, labels, callbacks }) {
|
|
|
2695
2737
|
) })
|
|
2696
2738
|
] }),
|
|
2697
2739
|
isFullscreen && (0, import_react_dom.createPortal)(
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2740
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2699
2741
|
FullscreenOverlay,
|
|
2700
2742
|
{
|
|
2701
2743
|
artifact,
|
|
@@ -2719,15 +2761,15 @@ function FullscreenOverlay({
|
|
|
2719
2761
|
onClose
|
|
2720
2762
|
}) {
|
|
2721
2763
|
const meta = artifact.config?.meta;
|
|
2722
|
-
return /* @__PURE__ */ (0,
|
|
2764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2723
2765
|
"div",
|
|
2724
2766
|
{
|
|
2725
2767
|
className: "fixed inset-0 z-[2147483647] flex items-center justify-center bg-black/80",
|
|
2726
2768
|
role: "dialog",
|
|
2727
2769
|
"aria-modal": "true",
|
|
2728
2770
|
"aria-label": resolvedLabels.exitFullscreen,
|
|
2729
|
-
children: /* @__PURE__ */ (0,
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative", style: { width: "min(94vw, calc(82vh * 16 / 9))" }, children: [
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2731
2773
|
DeckArtifactContent,
|
|
2732
2774
|
{
|
|
2733
2775
|
slides: artifact.config.slides,
|
|
@@ -2739,15 +2781,15 @@ function FullscreenOverlay({
|
|
|
2739
2781
|
onDark: true
|
|
2740
2782
|
}
|
|
2741
2783
|
),
|
|
2742
|
-
/* @__PURE__ */ (0,
|
|
2784
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2743
2785
|
"button",
|
|
2744
2786
|
{
|
|
2745
2787
|
className: "absolute -top-10 right-6 flex items-center gap-1.5 text-sm text-white/80 hover:text-white",
|
|
2746
2788
|
"aria-label": resolvedLabels.exitFullscreen,
|
|
2747
2789
|
onClick: onClose,
|
|
2748
2790
|
children: [
|
|
2749
|
-
/* @__PURE__ */ (0,
|
|
2750
|
-
/* @__PURE__ */ (0,
|
|
2791
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconArrowsMinimize, { size: 16 }),
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: resolvedLabels.exitFullscreen })
|
|
2751
2793
|
]
|
|
2752
2794
|
}
|
|
2753
2795
|
)
|
|
@@ -2824,7 +2866,7 @@ function useTableArtifactData(presignedUrl, columns) {
|
|
|
2824
2866
|
}
|
|
2825
2867
|
|
|
2826
2868
|
// src/components/artifacts/table-artifact/table-artifact.tsx
|
|
2827
|
-
var
|
|
2869
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2828
2870
|
var TITLE_CLASSES3 = "text-sm font-semibold text-foreground";
|
|
2829
2871
|
var TABLE_MAX_BODY_HEIGHT = 480;
|
|
2830
2872
|
var MAX_SHIMMER_ROWS = 10;
|
|
@@ -2847,10 +2889,10 @@ function TableArtifact({ artifact, labels, callbacks }) {
|
|
|
2847
2889
|
const onDownload = callbacks?.onDownload;
|
|
2848
2890
|
const handleDownloadClick = onDownload ? () => onDownload(artifact) : void 0;
|
|
2849
2891
|
if (!validConfig || !validColumns) {
|
|
2850
|
-
return /* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2852
|
-
artifact.title ? /* @__PURE__ */ (0,
|
|
2853
|
-
presignedUrl ? /* @__PURE__ */ (0,
|
|
2892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
2894
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArtifactTitle, { className: TITLE_CLASSES3, children: artifact.title }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", {}),
|
|
2895
|
+
presignedUrl ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArtifactActions, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2854
2896
|
ArtifactDownloadButton,
|
|
2855
2897
|
{
|
|
2856
2898
|
href: presignedUrl,
|
|
@@ -2859,17 +2901,17 @@ function TableArtifact({ artifact, labels, callbacks }) {
|
|
|
2859
2901
|
}
|
|
2860
2902
|
) }) : null
|
|
2861
2903
|
] }),
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArtifactContent, { className: "p-0 overflow-auto", style: { maxHeight: TABLE_MAX_BODY_HEIGHT }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(StatusMessage, { $tone: "info", children: resolvedLabels.unavailable }) })
|
|
2863
2905
|
] });
|
|
2864
2906
|
}
|
|
2865
2907
|
return (
|
|
2866
2908
|
// The table body owns its own scroll container (`ArtifactTable` inside `TableArtifactContent`).
|
|
2867
2909
|
// Disable the outer overflow container so only one scroll context exists — this prevents
|
|
2868
2910
|
// double-scroll nesting and lets `useScrollShadow` find the correct scroll ancestor.
|
|
2869
|
-
/* @__PURE__ */ (0,
|
|
2870
|
-
/* @__PURE__ */ (0,
|
|
2871
|
-
artifact.title ? /* @__PURE__ */ (0,
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
2911
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
2913
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArtifactTitle, { className: TITLE_CLASSES3, children: artifact.title }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", {}),
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArtifactActions, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2873
2915
|
ArtifactDownloadButton,
|
|
2874
2916
|
{
|
|
2875
2917
|
href: presignedUrl ?? "",
|
|
@@ -2878,7 +2920,7 @@ function TableArtifact({ artifact, labels, callbacks }) {
|
|
|
2878
2920
|
}
|
|
2879
2921
|
) })
|
|
2880
2922
|
] }),
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ArtifactContent, { className: "p-0 overflow-visible", style: { maxHeight: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2882
2924
|
TableArtifactContent,
|
|
2883
2925
|
{
|
|
2884
2926
|
columns: validColumns,
|
|
@@ -2921,13 +2963,13 @@ function artifactToClipboardText(artifact) {
|
|
|
2921
2963
|
}
|
|
2922
2964
|
|
|
2923
2965
|
// src/components/blocks/artifact-ref-block/artifact-ref-block.tsx
|
|
2924
|
-
var
|
|
2966
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2925
2967
|
function ArtifactRefBlock({ block }) {
|
|
2926
2968
|
const { artifact, labels, callbacks } = block.payload;
|
|
2927
2969
|
const entry = ArtifactServices[artifact.type];
|
|
2928
2970
|
if (!entry) return null;
|
|
2929
2971
|
const Component = entry.Component;
|
|
2930
|
-
return /* @__PURE__ */ (0,
|
|
2972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Component, { artifact, labels, callbacks });
|
|
2931
2973
|
}
|
|
2932
2974
|
|
|
2933
2975
|
// src/components/blocks/block-services/artifact-ref-block-service.ts
|
|
@@ -2945,39 +2987,6 @@ var ArtifactRefBlockService = {
|
|
|
2945
2987
|
// src/components/blocks/notification-draft-block/notification-draft-block.tsx
|
|
2946
2988
|
var import_react20 = require("react");
|
|
2947
2989
|
|
|
2948
|
-
// src/components/badge/badge.tsx
|
|
2949
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2950
|
-
var BASE = "inline-flex items-center whitespace-nowrap rounded-full";
|
|
2951
|
-
var SIZES = {
|
|
2952
|
-
// `sm` is a uniform scale-down of `md` (text 10/12 of caption): padding and line-height keep
|
|
2953
|
-
// md's proportions (caption is 12px text on a 16px line = 1.333 ratio) so the pill shape matches.
|
|
2954
|
-
md: "px-2.5 py-0.5 text-geist-label-caption-medium",
|
|
2955
|
-
sm: "px-2 py-0.5 text-[11px]/[1.333] font-medium"
|
|
2956
|
-
};
|
|
2957
|
-
var SUBTLE = {
|
|
2958
|
-
neutral: "bg-brown-20 text-brown-70",
|
|
2959
|
-
warning: "bg-orange-50 text-orange-600",
|
|
2960
|
-
violet: "bg-violet-50 text-violet-600"
|
|
2961
|
-
};
|
|
2962
|
-
var OUTLINE = {
|
|
2963
|
-
neutral: "border border-brown-30 bg-white text-brown-100",
|
|
2964
|
-
warning: "border border-orange-200 bg-white text-orange-600",
|
|
2965
|
-
violet: "border border-violet-400 bg-white text-violet-600"
|
|
2966
|
-
};
|
|
2967
|
-
var VARIANTS = {
|
|
2968
|
-
subtle: SUBTLE,
|
|
2969
|
-
outline: OUTLINE
|
|
2970
|
-
};
|
|
2971
|
-
function Badge({
|
|
2972
|
-
variant = "subtle",
|
|
2973
|
-
tone = "neutral",
|
|
2974
|
-
size = "md",
|
|
2975
|
-
className,
|
|
2976
|
-
children
|
|
2977
|
-
}) {
|
|
2978
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: cn(BASE, SIZES[size], VARIANTS[variant][tone], className), children });
|
|
2979
|
-
}
|
|
2980
|
-
|
|
2981
2990
|
// src/components/chat/hooks/use-copy-to-clipboard.ts
|
|
2982
2991
|
var import_react19 = require("react");
|
|
2983
2992
|
|