@shapesos/clay 0.16.0 → 0.18.0
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/ai-elements.cjs +3 -1
- package/dist/ai-elements.cjs.map +1 -1
- package/dist/ai-elements.js +4 -4
- package/dist/artifacts.cjs +976 -69
- package/dist/artifacts.cjs.map +1 -1
- package/dist/artifacts.d.cts +20 -3
- package/dist/artifacts.d.ts +20 -3
- package/dist/artifacts.js +13 -5
- package/dist/blocks.cjs +690 -85
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.css +1 -1
- package/dist/blocks.d.cts +3 -3
- package/dist/blocks.d.ts +3 -3
- package/dist/blocks.js +5 -5
- package/dist/button.cjs +3 -1
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +2 -2
- package/dist/capture.cjs +3 -1
- package/dist/capture.cjs.map +1 -1
- package/dist/capture.js +2 -2
- package/dist/chart.cjs +16 -36
- package/dist/chart.cjs.map +1 -1
- package/dist/chart.d.cts +3 -11
- package/dist/chart.d.ts +3 -11
- package/dist/chart.js +2 -2
- package/dist/chat.cjs +714 -109
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.d.cts +2 -2
- package/dist/chat.d.ts +2 -2
- package/dist/chat.js +6 -6
- package/dist/{chunk-UZKNSAAD.js → chunk-7MY4X4YL.js} +3 -3
- package/dist/chunk-BHHJOG5X.js +1 -0
- package/dist/{chunk-GAZRZZRF.js → chunk-CATIRDZP.js} +5 -5
- package/dist/{chunk-B4U37WIH.js → chunk-CFCLVJIO.js} +2 -2
- package/dist/{chunk-PYDVANWI.js → chunk-E36VI2HA.js} +2 -2
- package/dist/{chunk-U3IXCSV6.js → chunk-G4NXVFXU.js} +18 -40
- package/dist/chunk-G4NXVFXU.js.map +1 -0
- package/dist/{chunk-JAGNXEWK.js → chunk-GK4XW4BC.js} +2 -2
- package/dist/{chunk-4VE6ZXXW.js → chunk-MQP57DOP.js} +3 -3
- package/dist/{chunk-2YCBDSPK.js → chunk-QR4VBGK4.js} +673 -42
- package/dist/chunk-QR4VBGK4.js.map +1 -0
- package/dist/{chunk-JF3P66JF.js → chunk-SN3ORQSJ.js} +4 -2
- package/dist/{chunk-JF3P66JF.js.map → chunk-SN3ORQSJ.js.map} +1 -1
- package/dist/{chunk-PGR2MDDU.js → chunk-W66OJM55.js} +2 -2
- package/dist/{chunk-7OYIDM42.js → chunk-XKURJ72I.js} +2 -2
- package/dist/{dom-to-image-NATF3446.js → dom-to-image-QB7KMTAE.js} +3 -3
- package/dist/icon.cjs +3 -1
- package/dist/icon.cjs.map +1 -1
- package/dist/icon.js +2 -2
- package/dist/index.cjs +780 -167
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -11
- package/dist/keyboard-shortcut.cjs +3 -1
- package/dist/keyboard-shortcut.cjs.map +1 -1
- package/dist/keyboard-shortcut.js +2 -2
- package/dist/text-area.cjs +3 -1
- package/dist/text-area.cjs.map +1 -1
- package/dist/text-area.js +2 -2
- package/dist/tokens.cjs +3 -1
- package/dist/tokens.cjs.map +1 -1
- package/dist/tokens.d.cts +1 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +1 -1
- package/dist/{types-CW45GBXl.d.cts → types-BDYPVP2N.d.cts} +1 -1
- package/dist/{types-D1b8v7EY.d.ts → types-BMwa4bPW.d.ts} +1 -1
- package/dist/{types-GCkXbyFm.d.ts → types-C8JtnwNY.d.ts} +200 -4
- package/dist/{types-BzXPBy6s.d.cts → types-DTdDFU3O.d.cts} +200 -4
- package/package.json +1 -1
- package/dist/chunk-2YCBDSPK.js.map +0 -1
- package/dist/chunk-RSRNSWJN.js +0 -1
- package/dist/chunk-U3IXCSV6.js.map +0 -1
- /package/dist/{chunk-UZKNSAAD.js.map → chunk-7MY4X4YL.js.map} +0 -0
- /package/dist/{chunk-RSRNSWJN.js.map → chunk-BHHJOG5X.js.map} +0 -0
- /package/dist/{chunk-GAZRZZRF.js.map → chunk-CATIRDZP.js.map} +0 -0
- /package/dist/{chunk-B4U37WIH.js.map → chunk-CFCLVJIO.js.map} +0 -0
- /package/dist/{chunk-PYDVANWI.js.map → chunk-E36VI2HA.js.map} +0 -0
- /package/dist/{chunk-JAGNXEWK.js.map → chunk-GK4XW4BC.js.map} +0 -0
- /package/dist/{chunk-4VE6ZXXW.js.map → chunk-MQP57DOP.js.map} +0 -0
- /package/dist/{chunk-PGR2MDDU.js.map → chunk-W66OJM55.js.map} +0 -0
- /package/dist/{chunk-7OYIDM42.js.map → chunk-XKURJ72I.js.map} +0 -0
- /package/dist/{dom-to-image-NATF3446.js.map → dom-to-image-QB7KMTAE.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -122,7 +122,9 @@ var init_colors = __esm({
|
|
|
122
122
|
"red-200": "#FECACA",
|
|
123
123
|
"red-400": "#F7776C",
|
|
124
124
|
"red-500": "#EF4444",
|
|
125
|
-
"red-600": "#DC2626"
|
|
125
|
+
"red-600": "#DC2626",
|
|
126
|
+
// Deck
|
|
127
|
+
"deck-canvas": "#faf8f5"
|
|
126
128
|
};
|
|
127
129
|
}
|
|
128
130
|
});
|
|
@@ -16596,7 +16598,9 @@ __export(src_exports, {
|
|
|
16596
16598
|
ChatContext: () => ChatContext,
|
|
16597
16599
|
ChatMessage: () => ChatMessage,
|
|
16598
16600
|
DEFAULT_CHART_ARTIFACT_LABELS: () => DEFAULT_CHART_ARTIFACT_LABELS,
|
|
16601
|
+
DEFAULT_DECK_ARTIFACT_LABELS: () => DEFAULT_DECK_ARTIFACT_LABELS,
|
|
16599
16602
|
DEFAULT_TABLE_ARTIFACT_LABELS: () => DEFAULT_TABLE_ARTIFACT_LABELS,
|
|
16603
|
+
DeckArtifact: () => DeckArtifact,
|
|
16600
16604
|
ICON_POSITION: () => ICON_POSITION,
|
|
16601
16605
|
Icon: () => Icon,
|
|
16602
16606
|
IconButton: () => IconButton,
|
|
@@ -16622,6 +16626,8 @@ __export(src_exports, {
|
|
|
16622
16626
|
colors: () => colors,
|
|
16623
16627
|
convertTableToCSV: () => convertTableToCSV,
|
|
16624
16628
|
copyMessageText: () => copyMessageText,
|
|
16629
|
+
deckBlockTypes: () => deckBlockTypes,
|
|
16630
|
+
deckSlideKinds: () => deckSlideKinds,
|
|
16625
16631
|
escapeCsvField: () => escapeCsvField,
|
|
16626
16632
|
fontFamilies: () => fontFamilies,
|
|
16627
16633
|
isSafeDownloadUrl: () => isSafeDownloadUrl,
|
|
@@ -16954,7 +16960,8 @@ var blockTypes = {
|
|
|
16954
16960
|
// src/components/artifacts/artifact-base.ts
|
|
16955
16961
|
var artifactTypes = {
|
|
16956
16962
|
TABLE: "TABLE",
|
|
16957
|
-
CHART: "CHART"
|
|
16963
|
+
CHART: "CHART",
|
|
16964
|
+
DECK: "DECK"
|
|
16958
16965
|
};
|
|
16959
16966
|
|
|
16960
16967
|
// src/components/artifacts/chart-artifact/types.ts
|
|
@@ -16979,6 +16986,34 @@ var DEFAULT_TABLE_ARTIFACT_LABELS = {
|
|
|
16979
16986
|
empty: "No rows to display."
|
|
16980
16987
|
};
|
|
16981
16988
|
|
|
16989
|
+
// src/components/artifacts/deck-artifact/types.ts
|
|
16990
|
+
var deckBlockTypes = {
|
|
16991
|
+
TEXT: "TEXT",
|
|
16992
|
+
CHART: "CHART",
|
|
16993
|
+
TABLE: "TABLE"
|
|
16994
|
+
};
|
|
16995
|
+
var deckSlideKinds = {
|
|
16996
|
+
TITLE: "TITLE",
|
|
16997
|
+
AGENDA: "AGENDA",
|
|
16998
|
+
SECTION: "SECTION",
|
|
16999
|
+
CONTENT: "CONTENT",
|
|
17000
|
+
CLOSING: "CLOSING"
|
|
17001
|
+
};
|
|
17002
|
+
var DEFAULT_DECK_ARTIFACT_LABELS = {
|
|
17003
|
+
previous: "Previous slide",
|
|
17004
|
+
next: "Next slide",
|
|
17005
|
+
position: "Slide {current} of {total}",
|
|
17006
|
+
download: "Download",
|
|
17007
|
+
unavailable: "Deck content is unavailable.",
|
|
17008
|
+
enterFullscreen: "Fullscreen",
|
|
17009
|
+
exitFullscreen: "Exit fullscreen",
|
|
17010
|
+
thankYou: "Thank you",
|
|
17011
|
+
questions: "Questions?",
|
|
17012
|
+
agenda: "Agenda",
|
|
17013
|
+
chart: DEFAULT_CHART_ARTIFACT_LABELS,
|
|
17014
|
+
table: DEFAULT_TABLE_ARTIFACT_LABELS
|
|
17015
|
+
};
|
|
17016
|
+
|
|
16982
17017
|
// src/components/artifacts/chart-artifact/chart-artifact.tsx
|
|
16983
17018
|
var import_react13 = require("react");
|
|
16984
17019
|
|
|
@@ -17071,37 +17106,53 @@ var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
17071
17106
|
var __iconNode = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 8v4", "key": "svg-1" }], ["path", { "d": "M12 16h.01", "key": "svg-2" }]];
|
|
17072
17107
|
var IconAlertCircle = createReactComponent("outline", "alert-circle", "AlertCircle", __iconNode);
|
|
17073
17108
|
|
|
17109
|
+
// node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMaximize.mjs
|
|
17110
|
+
var __iconNode2 = [["path", { "d": "M16 4l4 0l0 4", "key": "svg-0" }], ["path", { "d": "M14 10l6 -6", "key": "svg-1" }], ["path", { "d": "M8 20l-4 0l0 -4", "key": "svg-2" }], ["path", { "d": "M4 20l6 -6", "key": "svg-3" }], ["path", { "d": "M16 20l4 0l0 -4", "key": "svg-4" }], ["path", { "d": "M14 14l6 6", "key": "svg-5" }], ["path", { "d": "M8 4l-4 0l0 4", "key": "svg-6" }], ["path", { "d": "M4 4l6 6", "key": "svg-7" }]];
|
|
17111
|
+
var IconArrowsMaximize = createReactComponent("outline", "arrows-maximize", "ArrowsMaximize", __iconNode2);
|
|
17112
|
+
|
|
17113
|
+
// node_modules/@tabler/icons-react/dist/esm/icons/IconArrowsMinimize.mjs
|
|
17114
|
+
var __iconNode3 = [["path", { "d": "M5 9l4 0l0 -4", "key": "svg-0" }], ["path", { "d": "M3 3l6 6", "key": "svg-1" }], ["path", { "d": "M5 15l4 0l0 4", "key": "svg-2" }], ["path", { "d": "M3 21l6 -6", "key": "svg-3" }], ["path", { "d": "M19 9l-4 0l0 -4", "key": "svg-4" }], ["path", { "d": "M15 9l6 -6", "key": "svg-5" }], ["path", { "d": "M19 15l-4 0l0 4", "key": "svg-6" }], ["path", { "d": "M15 15l6 6", "key": "svg-7" }]];
|
|
17115
|
+
var IconArrowsMinimize = createReactComponent("outline", "arrows-minimize", "ArrowsMinimize", __iconNode3);
|
|
17116
|
+
|
|
17074
17117
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconCheck.mjs
|
|
17075
|
-
var
|
|
17076
|
-
var IconCheck = createReactComponent("outline", "check", "Check",
|
|
17118
|
+
var __iconNode4 = [["path", { "d": "M5 12l5 5l10 -10", "key": "svg-0" }]];
|
|
17119
|
+
var IconCheck = createReactComponent("outline", "check", "Check", __iconNode4);
|
|
17120
|
+
|
|
17121
|
+
// node_modules/@tabler/icons-react/dist/esm/icons/IconChevronLeft.mjs
|
|
17122
|
+
var __iconNode5 = [["path", { "d": "M15 6l-6 6l6 6", "key": "svg-0" }]];
|
|
17123
|
+
var IconChevronLeft = createReactComponent("outline", "chevron-left", "ChevronLeft", __iconNode5);
|
|
17124
|
+
|
|
17125
|
+
// node_modules/@tabler/icons-react/dist/esm/icons/IconChevronRight.mjs
|
|
17126
|
+
var __iconNode6 = [["path", { "d": "M9 6l6 6l-6 6", "key": "svg-0" }]];
|
|
17127
|
+
var IconChevronRight = createReactComponent("outline", "chevron-right", "ChevronRight", __iconNode6);
|
|
17077
17128
|
|
|
17078
17129
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconCopy.mjs
|
|
17079
|
-
var
|
|
17080
|
-
var IconCopy = createReactComponent("outline", "copy", "Copy",
|
|
17130
|
+
var __iconNode7 = [["path", { "d": "M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666", "key": "svg-0" }], ["path", { "d": "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", "key": "svg-1" }]];
|
|
17131
|
+
var IconCopy = createReactComponent("outline", "copy", "Copy", __iconNode7);
|
|
17081
17132
|
|
|
17082
17133
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconDownload.mjs
|
|
17083
|
-
var
|
|
17084
|
-
var IconDownload = createReactComponent("outline", "download", "Download",
|
|
17134
|
+
var __iconNode8 = [["path", { "d": "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2", "key": "svg-0" }], ["path", { "d": "M7 11l5 5l5 -5", "key": "svg-1" }], ["path", { "d": "M12 4l0 12", "key": "svg-2" }]];
|
|
17135
|
+
var IconDownload = createReactComponent("outline", "download", "Download", __iconNode8);
|
|
17085
17136
|
|
|
17086
17137
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconFileSpreadsheet.mjs
|
|
17087
|
-
var
|
|
17088
|
-
var IconFileSpreadsheet = createReactComponent("outline", "file-spreadsheet", "FileSpreadsheet",
|
|
17138
|
+
var __iconNode9 = [["path", { "d": "M14 3v4a1 1 0 0 0 1 1h4", "key": "svg-0" }], ["path", { "d": "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2", "key": "svg-1" }], ["path", { "d": "M8 11h8v7h-8l0 -7", "key": "svg-2" }], ["path", { "d": "M8 15h8", "key": "svg-3" }], ["path", { "d": "M11 11v7", "key": "svg-4" }]];
|
|
17139
|
+
var IconFileSpreadsheet = createReactComponent("outline", "file-spreadsheet", "FileSpreadsheet", __iconNode9);
|
|
17089
17140
|
|
|
17090
17141
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconLoader2.mjs
|
|
17091
|
-
var
|
|
17092
|
-
var IconLoader2 = createReactComponent("outline", "loader-2", "Loader2",
|
|
17142
|
+
var __iconNode10 = [["path", { "d": "M12 3a9 9 0 1 0 9 9", "key": "svg-0" }]];
|
|
17143
|
+
var IconLoader2 = createReactComponent("outline", "loader-2", "Loader2", __iconNode10);
|
|
17093
17144
|
|
|
17094
17145
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconPhoto.mjs
|
|
17095
|
-
var
|
|
17096
|
-
var IconPhoto = createReactComponent("outline", "photo", "Photo",
|
|
17146
|
+
var __iconNode11 = [["path", { "d": "M15 8h.01", "key": "svg-0" }], ["path", { "d": "M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12", "key": "svg-1" }], ["path", { "d": "M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5", "key": "svg-2" }], ["path", { "d": "M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3", "key": "svg-3" }]];
|
|
17147
|
+
var IconPhoto = createReactComponent("outline", "photo", "Photo", __iconNode11);
|
|
17097
17148
|
|
|
17098
17149
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconThumbDown.mjs
|
|
17099
|
-
var
|
|
17100
|
-
var IconThumbDown = createReactComponent("outline", "thumb-down", "ThumbDown",
|
|
17150
|
+
var __iconNode12 = [["path", { "d": "M7 13v-8a1 1 0 0 0 -1 -1h-2a1 1 0 0 0 -1 1v7a1 1 0 0 0 1 1h3a4 4 0 0 1 4 4v1a2 2 0 0 0 4 0v-5h3a2 2 0 0 0 2 -2l-1 -5a2 3 0 0 0 -2 -2h-7a3 3 0 0 0 -3 3", "key": "svg-0" }]];
|
|
17151
|
+
var IconThumbDown = createReactComponent("outline", "thumb-down", "ThumbDown", __iconNode12);
|
|
17101
17152
|
|
|
17102
17153
|
// node_modules/@tabler/icons-react/dist/esm/icons/IconThumbUp.mjs
|
|
17103
|
-
var
|
|
17104
|
-
var IconThumbUp = createReactComponent("outline", "thumb-up", "ThumbUp",
|
|
17154
|
+
var __iconNode13 = [["path", { "d": "M7 11v8a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-7a1 1 0 0 1 1 -1h3a4 4 0 0 0 4 -4v-1a2 2 0 0 1 4 0v5h3a2 2 0 0 1 2 2l-1 5a2 3 0 0 1 -2 2h-7a3 3 0 0 1 -3 -3", "key": "svg-0" }]];
|
|
17155
|
+
var IconThumbUp = createReactComponent("outline", "thumb-up", "ThumbUp", __iconNode13);
|
|
17105
17156
|
|
|
17106
17157
|
// src/components/artifacts/artifact-copy-as-image-button/artifact-copy-as-image-button.tsx
|
|
17107
17158
|
var import_react6 = require("react");
|
|
@@ -17763,11 +17814,6 @@ function coerceNumericColumns(rows, numericKeys) {
|
|
|
17763
17814
|
|
|
17764
17815
|
// src/components/chart/bar-chart/bar-chart.tsx
|
|
17765
17816
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
17766
|
-
var STACK_TOTAL_KEY = "__stackTotal";
|
|
17767
|
-
var VALUE_LABEL_HEADROOM = 20;
|
|
17768
|
-
function sumSeries(row, keys) {
|
|
17769
|
-
return keys.reduce((sum2, key2) => sum2 + (Number(row[key2]) || 0), 0);
|
|
17770
|
-
}
|
|
17771
17817
|
function BarChart({
|
|
17772
17818
|
data: data2,
|
|
17773
17819
|
xKey,
|
|
@@ -17782,7 +17828,6 @@ function BarChart({
|
|
|
17782
17828
|
showGrid = true,
|
|
17783
17829
|
showXAxis = true,
|
|
17784
17830
|
showYAxis = true,
|
|
17785
|
-
showValueLabels,
|
|
17786
17831
|
xAxisInterval = 0,
|
|
17787
17832
|
xAxisAngle,
|
|
17788
17833
|
xAxisTickFormatter
|
|
@@ -17793,24 +17838,14 @@ function BarChart({
|
|
|
17793
17838
|
[data2, seriesKeys]
|
|
17794
17839
|
);
|
|
17795
17840
|
const resolvedShowLegend = showLegend ?? series.length > 1;
|
|
17796
|
-
const resolvedShowValueLabels = showValueLabels ?? true;
|
|
17797
|
-
const plotData = (0, import_react9.useMemo)(() => {
|
|
17798
|
-
if (!stacked || !resolvedShowValueLabels) return coercedData;
|
|
17799
|
-
return coercedData.map((row) => ({ ...row, [STACK_TOTAL_KEY]: sumSeries(row, seriesKeys) }));
|
|
17800
|
-
}, [coercedData, stacked, resolvedShowValueLabels, seriesKeys]);
|
|
17801
17841
|
const resolvedAngle = xAxisAngle ?? (coercedData.length >= 8 ? -30 : 0);
|
|
17802
17842
|
const resolvedTickFormatter = (0, import_react9.useMemo)(
|
|
17803
17843
|
() => xAxisTickFormatter ?? defaultBarTickFormatter(coercedData.length),
|
|
17804
17844
|
[xAxisTickFormatter, coercedData.length]
|
|
17805
17845
|
);
|
|
17806
17846
|
const angledLabelPad = resolvedAngle === 0 ? 0 : Math.min(Math.abs(resolvedAngle) * 0.7, 40);
|
|
17807
|
-
const
|
|
17808
|
-
|
|
17809
|
-
...CHART_MARGIN,
|
|
17810
|
-
top: CHART_MARGIN.top + valueLabelHeadroom,
|
|
17811
|
-
bottom: CHART_MARGIN.bottom + angledLabelPad
|
|
17812
|
-
};
|
|
17813
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartContainer, { height: height2, width: width2, className, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_recharts2.BarChart, { data: plotData, margin: chartMargin, barCategoryGap: "22%", children: [
|
|
17847
|
+
const chartMargin = { ...CHART_MARGIN, bottom: CHART_MARGIN.bottom + angledLabelPad };
|
|
17848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartContainer, { height: height2, width: width2, className, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_recharts2.BarChart, { data: coercedData, margin: chartMargin, barCategoryGap: "22%", children: [
|
|
17814
17849
|
showGrid ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts2.CartesianGrid, { ...CHART_GRID_PROPS }) : null,
|
|
17815
17850
|
showXAxis ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
17816
17851
|
import_recharts2.XAxis,
|
|
@@ -17837,23 +17872,17 @@ function BarChart({
|
|
|
17837
17872
|
content: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ChartLegendContent, { iconType: "square" })
|
|
17838
17873
|
}
|
|
17839
17874
|
) : null,
|
|
17840
|
-
series.map((s, i) =>
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17851
|
-
radius: barRadius(stacked, i, series.length),
|
|
17852
|
-
children: showLabel ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_recharts2.LabelList, { dataKey: labelDataKey, position: "top", style: CHART_VALUE_LABEL_STYLE }) : null
|
|
17853
|
-
},
|
|
17854
|
-
s.key
|
|
17855
|
-
);
|
|
17856
|
-
})
|
|
17875
|
+
series.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
17876
|
+
import_recharts2.Bar,
|
|
17877
|
+
{
|
|
17878
|
+
dataKey: s.key,
|
|
17879
|
+
name: s.label,
|
|
17880
|
+
fill: colorForSeriesIndex(i, palette),
|
|
17881
|
+
stackId: stacked ? "default" : s.key,
|
|
17882
|
+
radius: barRadius(stacked, i, series.length)
|
|
17883
|
+
},
|
|
17884
|
+
s.key
|
|
17885
|
+
))
|
|
17857
17886
|
] }) });
|
|
17858
17887
|
}
|
|
17859
17888
|
function barRadius(stacked, seriesIndex, seriesCount) {
|
|
@@ -18388,8 +18417,13 @@ var ChartArtifactService = {
|
|
|
18388
18417
|
toClipboardText: chartArtifactToClipboardText
|
|
18389
18418
|
};
|
|
18390
18419
|
|
|
18391
|
-
// src/components/artifacts/
|
|
18392
|
-
var
|
|
18420
|
+
// src/components/artifacts/deck-artifact/deck-artifact.tsx
|
|
18421
|
+
var import_react17 = require("react");
|
|
18422
|
+
var import_react_dom = require("react-dom");
|
|
18423
|
+
init_capture_exclude_attribute();
|
|
18424
|
+
|
|
18425
|
+
// src/components/artifacts/deck-artifact/deck-artifact-content.tsx
|
|
18426
|
+
var import_react16 = require("react");
|
|
18393
18427
|
|
|
18394
18428
|
// src/components/ui/table.tsx
|
|
18395
18429
|
var React3 = __toESM(require("react"), 1);
|
|
@@ -18536,9 +18570,333 @@ function renderEmptyRow(colSpan, emptyMessage) {
|
|
|
18536
18570
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TableCell, { colSpan, className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }) });
|
|
18537
18571
|
}
|
|
18538
18572
|
|
|
18539
|
-
// src/components/artifacts/
|
|
18540
|
-
|
|
18541
|
-
|
|
18573
|
+
// src/components/artifacts/deck-artifact/deck-markdown.tsx
|
|
18574
|
+
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
18575
|
+
var import_remark_breaks = __toESM(require("remark-breaks"), 1);
|
|
18576
|
+
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
18577
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
18578
|
+
function sanitize(text2) {
|
|
18579
|
+
return text2.split("\n").filter((line) => {
|
|
18580
|
+
const t = line.trim();
|
|
18581
|
+
return !(t.startsWith("<!-- table-title:") && t.endsWith("-->"));
|
|
18582
|
+
}).join("\n");
|
|
18583
|
+
}
|
|
18584
|
+
var MARKDOWN_COMPONENTS = {
|
|
18585
|
+
h1: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { className: "text-[30px] font-semibold leading-tight text-foreground mb-3", ...props }),
|
|
18586
|
+
h2: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "text-[26px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
18587
|
+
h3: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
18588
|
+
h4: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h4", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
18589
|
+
h5: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h5", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
18590
|
+
h6: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h6", { className: "text-[24px] font-semibold leading-tight text-foreground mb-2", ...props }),
|
|
18591
|
+
p: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-[22px] leading-relaxed text-foreground my-2", ...props }),
|
|
18592
|
+
ul: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ul", { className: "list-disc pl-7 text-[22px] leading-relaxed text-foreground my-2", ...props }),
|
|
18593
|
+
ol: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("ol", { className: "list-decimal pl-7 text-[22px] leading-relaxed text-foreground my-2", ...props }),
|
|
18594
|
+
// react-markdown injects list metadata (`ordered` / `index` / `checked`) that must not leak to the DOM.
|
|
18595
|
+
li: ({ node: _node, ordered: _ordered, index: _index, checked: _checked, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: "my-1", ...props }),
|
|
18596
|
+
strong: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("strong", { className: "font-semibold", ...props }),
|
|
18597
|
+
em: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("em", { className: "italic", ...props }),
|
|
18598
|
+
// Gate `<img src>` against an http(s) allowlist. react-markdown v8 percent-encodes the URL but
|
|
18599
|
+
// does NOT protocol-filter image src (unlike link href), so an LLM-authored
|
|
18600
|
+
// `` / `` or a tracking-pixel `` would otherwise render
|
|
18601
|
+
// with the raw URL. Unsafe src → render nothing.
|
|
18602
|
+
img: ({ node: _node, src, ...props }) => typeof src === "string" && isSafeDownloadUrl(src) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src, className: "max-w-full", ...props }) : null,
|
|
18603
|
+
a: ({ node: _node, ...props }) => (
|
|
18604
|
+
// `rel` is forced AFTER `{...props}` so it can't be overridden — if a consumer ever adds
|
|
18605
|
+
// `linkTarget="_blank"`, LLM-authored links still can't reach `window.opener`.
|
|
18606
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { className: "underline underline-offset-2", ...props, rel: "noopener noreferrer" })
|
|
18607
|
+
),
|
|
18608
|
+
// react-markdown passes `inline` to distinguish inline code from fenced blocks — strip it from the DOM.
|
|
18609
|
+
code: ({ node: _node, inline: _inline, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("code", { className: "rounded bg-muted px-1.5 py-0.5 font-mono text-[18px]", ...props }),
|
|
18610
|
+
blockquote: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("blockquote", { className: "border-l-2 border-brown-alpha-12 pl-4 text-[22px] text-muted-foreground", ...props }),
|
|
18611
|
+
hr: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("hr", { className: "my-4 border-brown-alpha-12", ...props }),
|
|
18612
|
+
table: ({ node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("table", { className: "w-full border-collapse text-[20px]", ...props }) }),
|
|
18613
|
+
// react-markdown passes `isHeader` to cell renderers — strip it so it never reaches the DOM.
|
|
18614
|
+
th: ({ node: _node, isHeader: _isHeader, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("th", { className: "border-b border-brown-alpha-12 px-3 py-1.5 text-left font-medium", ...props }),
|
|
18615
|
+
td: ({ node: _node, isHeader: _isHeader, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("td", { className: "border-b border-brown-alpha-12 px-3 py-1.5", ...props })
|
|
18616
|
+
};
|
|
18617
|
+
function DeckMarkdown({ markdown }) {
|
|
18618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_markdown.default, { remarkPlugins: [import_remark_gfm.default, import_remark_breaks.default], components: MARKDOWN_COMPONENTS, children: sanitize(markdown) });
|
|
18619
|
+
}
|
|
18620
|
+
|
|
18621
|
+
// src/components/artifacts/deck-artifact/slide-renderers.tsx
|
|
18622
|
+
var import_react15 = require("react");
|
|
18623
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
18624
|
+
function safeLogoUrl(meta) {
|
|
18625
|
+
return meta?.logoUrl && isSafeDownloadUrl(meta.logoUrl) ? meta.logoUrl : null;
|
|
18626
|
+
}
|
|
18627
|
+
var DESIGN_W = 1280;
|
|
18628
|
+
var DESIGN_H = 720;
|
|
18629
|
+
var EYEBROW_H = 84;
|
|
18630
|
+
var CANVAS_LOGO_MAX_H = 48;
|
|
18631
|
+
var ACCENT_FONT = { fontFamily: `"${fontFamilies.CRIMSON_PRO}", serif`, fontStyle: "italic" };
|
|
18632
|
+
function SlideFrame({ meta, children, accent = false, bare = false }) {
|
|
18633
|
+
const frameRef = (0, import_react15.useRef)(null);
|
|
18634
|
+
const [scale2, setScale] = (0, import_react15.useState)(null);
|
|
18635
|
+
(0, import_react15.useLayoutEffect)(() => {
|
|
18636
|
+
const el = frameRef.current;
|
|
18637
|
+
if (!el) return;
|
|
18638
|
+
const apply = (width2) => {
|
|
18639
|
+
if (width2 > 0) setScale(width2 / DESIGN_W);
|
|
18640
|
+
};
|
|
18641
|
+
apply(el.clientWidth);
|
|
18642
|
+
const ro = new ResizeObserver((entries) => apply(entries[0]?.contentRect.width ?? 0));
|
|
18643
|
+
ro.observe(el);
|
|
18644
|
+
return () => ro.disconnect();
|
|
18645
|
+
}, []);
|
|
18646
|
+
const bg = accent ? "bg-indigo-600" : "bg-deck-canvas";
|
|
18647
|
+
const eyebrowColor = accent ? "text-white/70" : "text-brown-60";
|
|
18648
|
+
const borderColor = accent ? "border-white/20" : "border-brown-alpha-12";
|
|
18649
|
+
const logoSrc = safeLogoUrl(meta);
|
|
18650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref: frameRef, className: `relative aspect-[16/9] w-full overflow-hidden rounded-lg ${bg}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
18651
|
+
"div",
|
|
18652
|
+
{
|
|
18653
|
+
className: "absolute left-0 top-0 origin-top-left",
|
|
18654
|
+
style: {
|
|
18655
|
+
width: DESIGN_W,
|
|
18656
|
+
height: DESIGN_H,
|
|
18657
|
+
transform: `scale(${scale2 ?? 0})`,
|
|
18658
|
+
visibility: scale2 === null ? "hidden" : "visible"
|
|
18659
|
+
},
|
|
18660
|
+
children: [
|
|
18661
|
+
!bare ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
18662
|
+
"div",
|
|
18663
|
+
{
|
|
18664
|
+
className: `absolute inset-x-0 top-0 flex items-center justify-between border-b px-16 ${borderColor}`,
|
|
18665
|
+
style: { height: EYEBROW_H },
|
|
18666
|
+
children: [
|
|
18667
|
+
meta?.eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: eyebrowColor, style: { ...ACCENT_FONT, fontSize: 22 }, children: meta.eyebrow }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", {}),
|
|
18668
|
+
logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("img", { src: logoSrc, alt: "", className: "object-contain", style: { maxHeight: CANVAS_LOGO_MAX_H } }) : null
|
|
18669
|
+
]
|
|
18670
|
+
}
|
|
18671
|
+
) : null,
|
|
18672
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute inset-x-0 bottom-0 overflow-hidden", style: { top: bare ? 0 : EYEBROW_H }, children })
|
|
18673
|
+
]
|
|
18674
|
+
}
|
|
18675
|
+
) });
|
|
18676
|
+
}
|
|
18677
|
+
function TitleSlide({ slide, meta }) {
|
|
18678
|
+
const logoSrc = safeLogoUrl(meta);
|
|
18679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SlideFrame, { meta, bare: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex h-full flex-col justify-center px-24 py-16", children: [
|
|
18680
|
+
logoSrc ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
18681
|
+
"img",
|
|
18682
|
+
{
|
|
18683
|
+
src: logoSrc,
|
|
18684
|
+
alt: "",
|
|
18685
|
+
className: "mb-16 object-contain object-left",
|
|
18686
|
+
style: { maxHeight: 56, maxWidth: 380 }
|
|
18687
|
+
}
|
|
18688
|
+
) : null,
|
|
18689
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
18690
|
+
"h1",
|
|
18691
|
+
{
|
|
18692
|
+
className: "font-bold tracking-tight text-brown-100",
|
|
18693
|
+
style: { fontSize: 92, lineHeight: 1.04, maxWidth: 1060 },
|
|
18694
|
+
children: slide.title
|
|
18695
|
+
}
|
|
18696
|
+
),
|
|
18697
|
+
slide.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mt-7 text-brown-70", style: { ...ACCENT_FONT, fontSize: 34 }, children: slide.subtitle }) : null,
|
|
18698
|
+
slide.description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mt-4 leading-relaxed text-brown-70", style: { fontSize: 24, maxWidth: 880 }, children: slide.description }) : null,
|
|
18699
|
+
meta?.date ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mt-10 text-brown-70", style: { ...ACCENT_FONT, fontSize: 30 }, children: meta.date }) : null
|
|
18700
|
+
] }) });
|
|
18701
|
+
}
|
|
18702
|
+
function AgendaSlide({ slide, meta, labels }) {
|
|
18703
|
+
const items = slide.items ?? [];
|
|
18704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "h-full px-24 py-14", children: [
|
|
18705
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "mb-10 font-bold text-brown-90", style: { fontSize: 40 }, children: slide.title || labels.agenda }),
|
|
18706
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "flex flex-col", children: items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-baseline gap-6 border-b border-brown-alpha-12 py-5", children: [
|
|
18707
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "shrink-0 text-indigo-600", style: { ...ACCENT_FONT, fontSize: 28, width: 64 }, children: String(i + 1).padStart(2, "0") }),
|
|
18708
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-brown-90", style: { fontSize: 28 }, children: item })
|
|
18709
|
+
] }, i)) })
|
|
18710
|
+
] }) });
|
|
18711
|
+
}
|
|
18712
|
+
function SectionSlide({ slide, meta }) {
|
|
18713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SlideFrame, { meta, accent: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex h-full flex-col justify-center gap-6 px-24", children: [
|
|
18714
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "font-bold text-white", style: { fontSize: 72, lineHeight: 1.05, maxWidth: 940 }, children: slide.title }),
|
|
18715
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "mt-2 bg-white/50", style: { width: 96, height: 5 } })
|
|
18716
|
+
] }) });
|
|
18717
|
+
}
|
|
18718
|
+
function ClosingSlide({ meta, labels }) {
|
|
18719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex h-full flex-col items-center justify-center gap-6 px-24 text-center", children: [
|
|
18720
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h1", { className: "font-bold text-brown-100", style: { fontSize: 72 }, children: labels.thankYou }),
|
|
18721
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-indigo-600", style: { ...ACCENT_FONT, fontSize: 36 }, children: labels.questions })
|
|
18722
|
+
] }) });
|
|
18723
|
+
}
|
|
18724
|
+
|
|
18725
|
+
// src/components/artifacts/deck-artifact/deck-artifact-content.tsx
|
|
18726
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
18727
|
+
var TABLE_BLOCK_MAX_SHIMMER_ROWS = 10;
|
|
18728
|
+
var TABLE_CHROME_RESERVE = 56;
|
|
18729
|
+
var VISUAL_FALLBACK_HEIGHT = 360;
|
|
18730
|
+
function DeckArtifactContent({
|
|
18731
|
+
slides,
|
|
18732
|
+
labels,
|
|
18733
|
+
onNavigate,
|
|
18734
|
+
meta,
|
|
18735
|
+
onDark = false,
|
|
18736
|
+
currentSlide,
|
|
18737
|
+
onSlideChange
|
|
18738
|
+
}) {
|
|
18739
|
+
const navBtnClass = onDark ? "[&_svg]:!text-white hover:!bg-white/20 disabled:opacity-40" : void 0;
|
|
18740
|
+
const navBtnSize = onDark ? "medium" : "small";
|
|
18741
|
+
const isControlled = currentSlide !== void 0;
|
|
18742
|
+
const [internalIndex, setInternalIndex] = (0, import_react16.useState)(0);
|
|
18743
|
+
const index2 = isControlled ? currentSlide : internalIndex;
|
|
18744
|
+
const current = Math.min(index2, slides.length - 1);
|
|
18745
|
+
const slide = slides[current];
|
|
18746
|
+
const goTo = (0, import_react16.useCallback)(
|
|
18747
|
+
(next) => {
|
|
18748
|
+
const clamped = Math.max(0, Math.min(next, slides.length - 1));
|
|
18749
|
+
if (isControlled) onSlideChange?.(clamped);
|
|
18750
|
+
else setInternalIndex(clamped);
|
|
18751
|
+
onNavigate?.(clamped);
|
|
18752
|
+
},
|
|
18753
|
+
[slides.length, onNavigate, isControlled, onSlideChange]
|
|
18754
|
+
);
|
|
18755
|
+
const position2 = labels.position.replace("{current}", String(current + 1)).replace("{total}", String(slides.length));
|
|
18756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-3 p-4", children: [
|
|
18757
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SlideDispatch, { slide, labels, meta }),
|
|
18758
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
18759
|
+
"div",
|
|
18760
|
+
{
|
|
18761
|
+
className: `flex items-center justify-between border-t pt-2 ${onDark ? "border-white/20" : "border-brown-alpha-12"}`,
|
|
18762
|
+
children: [
|
|
18763
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
18764
|
+
IconButton,
|
|
18765
|
+
{
|
|
18766
|
+
icon: IconChevronLeft,
|
|
18767
|
+
size: navBtnSize,
|
|
18768
|
+
className: navBtnClass,
|
|
18769
|
+
"aria-label": labels.previous,
|
|
18770
|
+
disabled: current === 0,
|
|
18771
|
+
onClick: () => goTo(current - 1)
|
|
18772
|
+
}
|
|
18773
|
+
),
|
|
18774
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: `text-xs font-medium ${onDark ? "text-white/70" : "text-brown-70"}`, children: position2 }),
|
|
18775
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
18776
|
+
IconButton,
|
|
18777
|
+
{
|
|
18778
|
+
icon: IconChevronRight,
|
|
18779
|
+
size: navBtnSize,
|
|
18780
|
+
className: navBtnClass,
|
|
18781
|
+
"aria-label": labels.next,
|
|
18782
|
+
disabled: current === slides.length - 1,
|
|
18783
|
+
onClick: () => goTo(current + 1)
|
|
18784
|
+
}
|
|
18785
|
+
)
|
|
18786
|
+
]
|
|
18787
|
+
}
|
|
18788
|
+
)
|
|
18789
|
+
] });
|
|
18790
|
+
}
|
|
18791
|
+
function SlideDispatch({ slide, labels, meta }) {
|
|
18792
|
+
const kind = slide.kind ?? deckSlideKinds.CONTENT;
|
|
18793
|
+
switch (kind) {
|
|
18794
|
+
case deckSlideKinds.TITLE:
|
|
18795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TitleSlide, { slide, meta });
|
|
18796
|
+
case deckSlideKinds.AGENDA:
|
|
18797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AgendaSlide, { slide, meta, labels });
|
|
18798
|
+
case deckSlideKinds.SECTION:
|
|
18799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SectionSlide, { slide, meta });
|
|
18800
|
+
case deckSlideKinds.CLOSING:
|
|
18801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ClosingSlide, { meta, labels });
|
|
18802
|
+
case deckSlideKinds.CONTENT:
|
|
18803
|
+
default:
|
|
18804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ContentSlide, { slide, meta, labels });
|
|
18805
|
+
}
|
|
18806
|
+
}
|
|
18807
|
+
function isVisualBlock(block) {
|
|
18808
|
+
return block.type === deckBlockTypes.CHART || block.type === deckBlockTypes.TABLE;
|
|
18809
|
+
}
|
|
18810
|
+
function ContentSlide({ slide, meta, labels }) {
|
|
18811
|
+
const content2 = slide.content ?? [];
|
|
18812
|
+
const visuals = content2.filter(isVisualBlock);
|
|
18813
|
+
const texts = content2.filter(
|
|
18814
|
+
(b) => b.type === deckBlockTypes.TEXT
|
|
18815
|
+
);
|
|
18816
|
+
if (visuals.length === 1 && texts.length > 0) {
|
|
18817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-full items-stretch gap-12 px-16 py-12", children: [
|
|
18818
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex w-[42%] shrink-0 flex-col overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AutoFit, { children: [
|
|
18819
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "mb-5 font-bold leading-tight text-foreground", style: { fontSize: 34 }, children: slide.title }),
|
|
18820
|
+
texts.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DeckMarkdown, { markdown: block.markdown }, i))
|
|
18821
|
+
] }) }),
|
|
18822
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "min-h-0 min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FillVisual, { block: visuals[0], labels }) })
|
|
18823
|
+
] }) });
|
|
18824
|
+
}
|
|
18825
|
+
if (visuals.length > 0) {
|
|
18826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex h-full flex-col gap-5 px-16 py-10", children: [
|
|
18827
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "shrink-0 font-bold leading-tight text-foreground", style: { fontSize: 32 }, children: slide.title }),
|
|
18828
|
+
content2.map(
|
|
18829
|
+
(block, i) => isVisualBlock(block) ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "min-h-0 min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FillVisual, { block, labels }) }, i) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "shrink-0 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DeckMarkdown, { markdown: block.markdown }) }, i)
|
|
18830
|
+
)
|
|
18831
|
+
] }) });
|
|
18832
|
+
}
|
|
18833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SlideFrame, { meta, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full px-24 py-12", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(AutoFit, { children: [
|
|
18834
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "mb-6 font-bold leading-tight text-foreground", style: { fontSize: 38 }, children: slide.title }),
|
|
18835
|
+
texts.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DeckMarkdown, { markdown: block.markdown }, i))
|
|
18836
|
+
] }) }) });
|
|
18837
|
+
}
|
|
18838
|
+
function AutoFit({ children }) {
|
|
18839
|
+
const boxRef = (0, import_react16.useRef)(null);
|
|
18840
|
+
const contentRef = (0, import_react16.useRef)(null);
|
|
18841
|
+
const [fit, setFit] = (0, import_react16.useState)({ scale: 1, height: 0 });
|
|
18842
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
18843
|
+
const boxEl = boxRef.current;
|
|
18844
|
+
const contentEl = contentRef.current;
|
|
18845
|
+
if (!boxEl || !contentEl) return;
|
|
18846
|
+
const measure = () => {
|
|
18847
|
+
const avail = boxEl.clientHeight;
|
|
18848
|
+
const natural = contentEl.offsetHeight;
|
|
18849
|
+
const scale2 = avail > 0 && natural > avail ? avail / natural : 1;
|
|
18850
|
+
setFit({ scale: scale2, height: natural * scale2 });
|
|
18851
|
+
};
|
|
18852
|
+
measure();
|
|
18853
|
+
const ro = new ResizeObserver(measure);
|
|
18854
|
+
ro.observe(boxEl);
|
|
18855
|
+
ro.observe(contentEl);
|
|
18856
|
+
return () => ro.disconnect();
|
|
18857
|
+
}, []);
|
|
18858
|
+
const scaled = fit.scale < 1;
|
|
18859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref: boxRef, className: "flex h-full min-h-0 w-full flex-col justify-center overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: scaled ? { height: fit.height } : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
18860
|
+
"div",
|
|
18861
|
+
{
|
|
18862
|
+
ref: contentRef,
|
|
18863
|
+
className: "w-full origin-top-left",
|
|
18864
|
+
style: scaled ? { transform: `scale(${fit.scale})` } : void 0,
|
|
18865
|
+
children
|
|
18866
|
+
}
|
|
18867
|
+
) }) });
|
|
18868
|
+
}
|
|
18869
|
+
function FillVisual({ block, labels }) {
|
|
18870
|
+
const ref = (0, import_react16.useRef)(null);
|
|
18871
|
+
const [height2, setHeight] = (0, import_react16.useState)(VISUAL_FALLBACK_HEIGHT);
|
|
18872
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
18873
|
+
const el = ref.current;
|
|
18874
|
+
if (!el) return;
|
|
18875
|
+
const apply = (h) => {
|
|
18876
|
+
if (h > 0) setHeight(h);
|
|
18877
|
+
};
|
|
18878
|
+
apply(el.clientHeight);
|
|
18879
|
+
const ro = new ResizeObserver((entries) => apply(entries[0]?.contentRect.height ?? 0));
|
|
18880
|
+
ro.observe(el);
|
|
18881
|
+
return () => ro.disconnect();
|
|
18882
|
+
}, []);
|
|
18883
|
+
const chartLabels = labels.chart ?? DEFAULT_CHART_ARTIFACT_LABELS;
|
|
18884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ref, className: "h-full min-h-0 w-full overflow-hidden", children: block.type === deckBlockTypes.CHART ? (
|
|
18885
|
+
// ChartArtifactContent assumes a non-empty rowset (the standalone ChartArtifact guards
|
|
18886
|
+
// `rows.length > 0` upstream); mirror that guard here so an empty inline chart shows the
|
|
18887
|
+
// localized empty status instead of a blank chart area.
|
|
18888
|
+
block.rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(StatusMessage, { $tone: "info", children: chartLabels.empty }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { height: height2 }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChartArtifactContent, { config: block.config, rows: block.rows, labels: chartLabels }) })
|
|
18889
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
18890
|
+
TableArtifactContent,
|
|
18891
|
+
{
|
|
18892
|
+
columns: block.config.columns,
|
|
18893
|
+
data: { status: "ready", rows: block.rows, error: null },
|
|
18894
|
+
knownRowCount: block.config.stats?.rowCount ?? block.rows.length,
|
|
18895
|
+
maxShimmerRows: TABLE_BLOCK_MAX_SHIMMER_ROWS,
|
|
18896
|
+
maxBodyHeight: Math.max(0, height2 - TABLE_CHROME_RESERVE),
|
|
18897
|
+
labels: labels.table ?? DEFAULT_TABLE_ARTIFACT_LABELS
|
|
18898
|
+
}
|
|
18899
|
+
) });
|
|
18542
18900
|
}
|
|
18543
18901
|
|
|
18544
18902
|
// src/components/artifacts/table-artifact/validate.ts
|
|
@@ -18557,19 +18915,265 @@ function isValidTableColumn(column) {
|
|
|
18557
18915
|
return true;
|
|
18558
18916
|
}
|
|
18559
18917
|
|
|
18560
|
-
// src/components/artifacts/
|
|
18561
|
-
|
|
18918
|
+
// src/components/artifacts/deck-artifact/validate.ts
|
|
18919
|
+
function isValidDeckConfig(config) {
|
|
18920
|
+
if (!config || typeof config !== "object") return false;
|
|
18921
|
+
const candidate = config;
|
|
18922
|
+
if (!Array.isArray(candidate.slides)) return false;
|
|
18923
|
+
if (candidate.slides.length === 0) return false;
|
|
18924
|
+
return candidate.slides.every(isValidDeckSlide);
|
|
18925
|
+
}
|
|
18926
|
+
function isValidDeckSlide(slide) {
|
|
18927
|
+
if (!slide || typeof slide !== "object") return false;
|
|
18928
|
+
const candidate = slide;
|
|
18929
|
+
if (typeof candidate.title !== "string") return false;
|
|
18930
|
+
const kind = typeof candidate.kind === "string" ? candidate.kind : deckSlideKinds.CONTENT;
|
|
18931
|
+
if (kind === deckSlideKinds.CONTENT && !Array.isArray(candidate.content)) return false;
|
|
18932
|
+
const content2 = Array.isArray(candidate.content) ? candidate.content : [];
|
|
18933
|
+
if (candidate.items != null) {
|
|
18934
|
+
if (!Array.isArray(candidate.items)) return false;
|
|
18935
|
+
if (!candidate.items.every((item) => typeof item === "string")) return false;
|
|
18936
|
+
}
|
|
18937
|
+
return content2.every(isValidDeckBlock);
|
|
18938
|
+
}
|
|
18939
|
+
function isValidDeckBlock(block) {
|
|
18940
|
+
if (!block || typeof block !== "object") return false;
|
|
18941
|
+
const candidate = block;
|
|
18942
|
+
switch (candidate.type) {
|
|
18943
|
+
case deckBlockTypes.TEXT:
|
|
18944
|
+
return typeof candidate.markdown === "string";
|
|
18945
|
+
case deckBlockTypes.CHART:
|
|
18946
|
+
return isValidChartConfig(candidate.config) && Array.isArray(candidate.rows);
|
|
18947
|
+
case deckBlockTypes.TABLE:
|
|
18948
|
+
return isValidTableConfig(candidate.config) && Array.isArray(candidate.rows);
|
|
18949
|
+
default:
|
|
18950
|
+
return false;
|
|
18951
|
+
}
|
|
18952
|
+
}
|
|
18953
|
+
|
|
18954
|
+
// src/components/artifacts/deck-artifact/deck-artifact.tsx
|
|
18955
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
18562
18956
|
var TITLE_CLASSES2 = "text-sm font-semibold text-foreground";
|
|
18957
|
+
function DeckArtifact({ artifact, labels, callbacks }) {
|
|
18958
|
+
const validConfig = isValidDeckConfig(artifact.config);
|
|
18959
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react17.useState)(false);
|
|
18960
|
+
const [currentSlide, setCurrentSlide] = (0, import_react17.useState)(0);
|
|
18961
|
+
(0, import_react17.useEffect)(() => {
|
|
18962
|
+
if (validConfig) return;
|
|
18963
|
+
console.warn("[clay] DeckArtifact: malformed `config` \u2014 skipping render.");
|
|
18964
|
+
}, [validConfig]);
|
|
18965
|
+
(0, import_react17.useEffect)(() => {
|
|
18966
|
+
if (!isFullscreen) return;
|
|
18967
|
+
const handleKey = (e) => {
|
|
18968
|
+
if (e.key === "Escape") setIsFullscreen(false);
|
|
18969
|
+
};
|
|
18970
|
+
document.addEventListener("keydown", handleKey);
|
|
18971
|
+
const previousOverflow = document.documentElement.style.overflow;
|
|
18972
|
+
document.documentElement.style.overflow = "hidden";
|
|
18973
|
+
return () => {
|
|
18974
|
+
document.removeEventListener("keydown", handleKey);
|
|
18975
|
+
document.documentElement.style.overflow = previousOverflow;
|
|
18976
|
+
};
|
|
18977
|
+
}, [isFullscreen]);
|
|
18978
|
+
const resolvedLabels = (0, import_react17.useMemo)(
|
|
18979
|
+
() => ({
|
|
18980
|
+
...DEFAULT_DECK_ARTIFACT_LABELS,
|
|
18981
|
+
...labels ?? {},
|
|
18982
|
+
chart: { ...DEFAULT_CHART_ARTIFACT_LABELS, ...labels?.chart ?? {} },
|
|
18983
|
+
table: { ...DEFAULT_TABLE_ARTIFACT_LABELS, ...labels?.table ?? {} }
|
|
18984
|
+
}),
|
|
18985
|
+
[labels]
|
|
18986
|
+
);
|
|
18987
|
+
const onNavigate = callbacks?.onNavigate;
|
|
18988
|
+
const handleNavigate = onNavigate ? (slideIndex) => onNavigate(artifact, slideIndex) : void 0;
|
|
18989
|
+
const onDownload = callbacks?.onDownload;
|
|
18990
|
+
const handleDownload = onDownload ? () => onDownload(artifact) : void 0;
|
|
18991
|
+
const presignedUrl = artifact.protectedAsset?.presignedUrl ?? null;
|
|
18992
|
+
const showDownload = presignedUrl !== null && isSafeDownloadUrl(presignedUrl);
|
|
18993
|
+
const meta = artifact.config?.meta;
|
|
18994
|
+
const handleOpenFullscreen = () => setIsFullscreen(true);
|
|
18995
|
+
const handleCloseFullscreen = () => setIsFullscreen(false);
|
|
18996
|
+
const actions = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(ArtifactActions, { ...{ [CAPTURE_EXCLUDE_ATTRIBUTE]: "" }, children: [
|
|
18997
|
+
showDownload ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArtifactDownloadButton, { href: presignedUrl ?? "", label: resolvedLabels.download, onClick: handleDownload }) : null,
|
|
18998
|
+
validConfig ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
18999
|
+
IconButton,
|
|
19000
|
+
{
|
|
19001
|
+
icon: IconArrowsMaximize,
|
|
19002
|
+
size: "small",
|
|
19003
|
+
"aria-label": resolvedLabels.enterFullscreen,
|
|
19004
|
+
onClick: handleOpenFullscreen
|
|
19005
|
+
}
|
|
19006
|
+
) : null
|
|
19007
|
+
] });
|
|
19008
|
+
if (!validConfig) {
|
|
19009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
19010
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
19011
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArtifactTitle, { className: TITLE_CLASSES2, children: artifact.title }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", {}),
|
|
19012
|
+
actions
|
|
19013
|
+
] }),
|
|
19014
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArtifactContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(StatusMessage, { $tone: "info", children: resolvedLabels.unavailable }) })
|
|
19015
|
+
] });
|
|
19016
|
+
}
|
|
19017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
19018
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
19019
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
19020
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArtifactTitle, { className: TITLE_CLASSES2, children: artifact.title }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", {}),
|
|
19021
|
+
actions
|
|
19022
|
+
] }),
|
|
19023
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ArtifactContent, { className: "p-0", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
19024
|
+
DeckArtifactContent,
|
|
19025
|
+
{
|
|
19026
|
+
slides: artifact.config.slides,
|
|
19027
|
+
labels: resolvedLabels,
|
|
19028
|
+
onNavigate: handleNavigate,
|
|
19029
|
+
meta,
|
|
19030
|
+
currentSlide,
|
|
19031
|
+
onSlideChange: setCurrentSlide
|
|
19032
|
+
}
|
|
19033
|
+
) })
|
|
19034
|
+
] }),
|
|
19035
|
+
isFullscreen && (0, import_react_dom.createPortal)(
|
|
19036
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
19037
|
+
FullscreenOverlay,
|
|
19038
|
+
{
|
|
19039
|
+
artifact,
|
|
19040
|
+
resolvedLabels,
|
|
19041
|
+
onNavigate: handleNavigate,
|
|
19042
|
+
currentSlide,
|
|
19043
|
+
onSlideChange: setCurrentSlide,
|
|
19044
|
+
onClose: handleCloseFullscreen
|
|
19045
|
+
}
|
|
19046
|
+
),
|
|
19047
|
+
document.body
|
|
19048
|
+
)
|
|
19049
|
+
] });
|
|
19050
|
+
}
|
|
19051
|
+
function FullscreenOverlay({
|
|
19052
|
+
artifact,
|
|
19053
|
+
resolvedLabels,
|
|
19054
|
+
onNavigate,
|
|
19055
|
+
currentSlide,
|
|
19056
|
+
onSlideChange,
|
|
19057
|
+
onClose
|
|
19058
|
+
}) {
|
|
19059
|
+
const meta = artifact.config?.meta;
|
|
19060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
19061
|
+
"div",
|
|
19062
|
+
{
|
|
19063
|
+
className: "fixed inset-0 z-[2147483647] flex items-center justify-center bg-black/80",
|
|
19064
|
+
role: "dialog",
|
|
19065
|
+
"aria-modal": "true",
|
|
19066
|
+
"aria-label": resolvedLabels.exitFullscreen,
|
|
19067
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "relative", style: { width: "min(94vw, calc(82vh * 16 / 9))" }, children: [
|
|
19068
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
19069
|
+
DeckArtifactContent,
|
|
19070
|
+
{
|
|
19071
|
+
slides: artifact.config.slides,
|
|
19072
|
+
labels: resolvedLabels,
|
|
19073
|
+
onNavigate,
|
|
19074
|
+
meta,
|
|
19075
|
+
currentSlide,
|
|
19076
|
+
onSlideChange,
|
|
19077
|
+
onDark: true
|
|
19078
|
+
}
|
|
19079
|
+
),
|
|
19080
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
19081
|
+
"button",
|
|
19082
|
+
{
|
|
19083
|
+
className: "absolute -top-10 right-6 flex items-center gap-1.5 text-sm text-white/80 hover:text-white",
|
|
19084
|
+
"aria-label": resolvedLabels.exitFullscreen,
|
|
19085
|
+
onClick: onClose,
|
|
19086
|
+
children: [
|
|
19087
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(IconArrowsMinimize, { size: 16 }),
|
|
19088
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: resolvedLabels.exitFullscreen })
|
|
19089
|
+
]
|
|
19090
|
+
}
|
|
19091
|
+
)
|
|
19092
|
+
] })
|
|
19093
|
+
}
|
|
19094
|
+
);
|
|
19095
|
+
}
|
|
19096
|
+
|
|
19097
|
+
// src/components/artifacts/deck-artifact/to-clipboard-text.ts
|
|
19098
|
+
function deckArtifactToClipboardText(artifact) {
|
|
19099
|
+
const header = artifact.title?.trim() || "Deck";
|
|
19100
|
+
const slides = artifact.config?.slides ?? [];
|
|
19101
|
+
const body = slides.map((slide, i) => slideToText(slide, i)).join("\n\n");
|
|
19102
|
+
return body ? `${header}
|
|
19103
|
+
|
|
19104
|
+
${body}` : header;
|
|
19105
|
+
}
|
|
19106
|
+
function slideToText(slide, index2) {
|
|
19107
|
+
const kind = slide.kind ?? deckSlideKinds.CONTENT;
|
|
19108
|
+
const prefix = `Slide ${index2 + 1}: `;
|
|
19109
|
+
switch (kind) {
|
|
19110
|
+
case deckSlideKinds.TITLE: {
|
|
19111
|
+
const parts = [slide.title];
|
|
19112
|
+
if (slide.subtitle) parts.push(slide.subtitle);
|
|
19113
|
+
if (slide.description) parts.push(slide.description);
|
|
19114
|
+
return `${prefix}${parts.join(" \u2014 ")}`.trim();
|
|
19115
|
+
}
|
|
19116
|
+
case deckSlideKinds.AGENDA: {
|
|
19117
|
+
const items = (slide.items ?? []).map((item, i) => ` ${String(i + 1).padStart(2, "0")}. ${item}`).join("\n");
|
|
19118
|
+
return `${prefix}${slide.title || "Agenda"}${items ? `
|
|
19119
|
+
${items}` : ""}`.trim();
|
|
19120
|
+
}
|
|
19121
|
+
case deckSlideKinds.SECTION:
|
|
19122
|
+
return `${prefix}${slide.title}`.trim();
|
|
19123
|
+
case deckSlideKinds.CLOSING:
|
|
19124
|
+
return `${prefix}Thank you`.trim();
|
|
19125
|
+
case deckSlideKinds.CONTENT:
|
|
19126
|
+
default: {
|
|
19127
|
+
const blocks = (slide.content ?? []).map(blockToText).filter(Boolean).join("\n\n");
|
|
19128
|
+
return `${prefix}${slide.title}${blocks ? `
|
|
19129
|
+
${blocks}` : ""}`.trim();
|
|
19130
|
+
}
|
|
19131
|
+
}
|
|
19132
|
+
}
|
|
19133
|
+
function blockToText(block) {
|
|
19134
|
+
switch (block.type) {
|
|
19135
|
+
case deckBlockTypes.TEXT:
|
|
19136
|
+
return block.markdown.trim();
|
|
19137
|
+
case deckBlockTypes.CHART:
|
|
19138
|
+
return `[Chart: ${block.config.variant}]`;
|
|
19139
|
+
case deckBlockTypes.TABLE: {
|
|
19140
|
+
const columnCount = block.config.columns.length;
|
|
19141
|
+
const rowCount = block.rows.length;
|
|
19142
|
+
return `[Table: ${columnCount} column${columnCount === 1 ? "" : "s"} \xD7 ${rowCount} row${rowCount === 1 ? "" : "s"}]`;
|
|
19143
|
+
}
|
|
19144
|
+
default:
|
|
19145
|
+
return "";
|
|
19146
|
+
}
|
|
19147
|
+
}
|
|
19148
|
+
|
|
19149
|
+
// src/components/artifacts/artifact-services/deck-artifact-service.ts
|
|
19150
|
+
var DeckArtifactService = {
|
|
19151
|
+
type: artifactTypes.DECK,
|
|
19152
|
+
Component: DeckArtifact,
|
|
19153
|
+
toClipboardText: deckArtifactToClipboardText
|
|
19154
|
+
};
|
|
19155
|
+
|
|
19156
|
+
// src/components/artifacts/table-artifact/table-artifact.tsx
|
|
19157
|
+
var import_react18 = require("react");
|
|
19158
|
+
|
|
19159
|
+
// src/components/artifacts/table-artifact/use-table-artifact-data.ts
|
|
19160
|
+
function useTableArtifactData(presignedUrl, columns) {
|
|
19161
|
+
return useRowsArtifactData(presignedUrl, columns, parseCsv);
|
|
19162
|
+
}
|
|
19163
|
+
|
|
19164
|
+
// src/components/artifacts/table-artifact/table-artifact.tsx
|
|
19165
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
19166
|
+
var TITLE_CLASSES3 = "text-sm font-semibold text-foreground";
|
|
18563
19167
|
var TABLE_MAX_BODY_HEIGHT = 480;
|
|
18564
19168
|
var MAX_SHIMMER_ROWS = 10;
|
|
18565
19169
|
function TableArtifact({ artifact, labels, callbacks }) {
|
|
18566
19170
|
const validConfig = isValidTableConfig(artifact.config);
|
|
18567
19171
|
const validColumns = validConfig ? artifact.config.columns : null;
|
|
18568
|
-
(0,
|
|
19172
|
+
(0, import_react18.useEffect)(() => {
|
|
18569
19173
|
if (validConfig) return;
|
|
18570
19174
|
console.warn("[clay] TableArtifact: malformed `config` \u2014 skipping render.");
|
|
18571
19175
|
}, [validConfig]);
|
|
18572
|
-
const resolvedLabels = (0,
|
|
19176
|
+
const resolvedLabels = (0, import_react18.useMemo)(
|
|
18573
19177
|
() => ({ ...DEFAULT_TABLE_ARTIFACT_LABELS, ...labels ?? {} }),
|
|
18574
19178
|
[labels]
|
|
18575
19179
|
);
|
|
@@ -18581,10 +19185,10 @@ function TableArtifact({ artifact, labels, callbacks }) {
|
|
|
18581
19185
|
const onDownload = callbacks?.onDownload;
|
|
18582
19186
|
const handleDownloadClick = onDownload ? () => onDownload(artifact) : void 0;
|
|
18583
19187
|
if (!validConfig || !validColumns) {
|
|
18584
|
-
return /* @__PURE__ */ (0,
|
|
18585
|
-
/* @__PURE__ */ (0,
|
|
18586
|
-
artifact.title ? /* @__PURE__ */ (0,
|
|
18587
|
-
presignedUrl ? /* @__PURE__ */ (0,
|
|
19188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
19189
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
19190
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArtifactTitle, { className: TITLE_CLASSES3, children: artifact.title }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {}),
|
|
19191
|
+
presignedUrl ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArtifactActions, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
18588
19192
|
ArtifactDownloadButton,
|
|
18589
19193
|
{
|
|
18590
19194
|
href: presignedUrl,
|
|
@@ -18593,17 +19197,17 @@ function TableArtifact({ artifact, labels, callbacks }) {
|
|
|
18593
19197
|
}
|
|
18594
19198
|
) }) : null
|
|
18595
19199
|
] }),
|
|
18596
|
-
/* @__PURE__ */ (0,
|
|
19200
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArtifactContent, { className: "p-0 overflow-auto", style: { maxHeight: TABLE_MAX_BODY_HEIGHT }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StatusMessage, { $tone: "info", children: resolvedLabels.unavailable }) })
|
|
18597
19201
|
] });
|
|
18598
19202
|
}
|
|
18599
19203
|
return (
|
|
18600
19204
|
// The table body owns its own scroll container (`ArtifactTable` inside `TableArtifactContent`).
|
|
18601
19205
|
// Disable the outer overflow container so only one scroll context exists — this prevents
|
|
18602
19206
|
// double-scroll nesting and lets `useScrollShadow` find the correct scroll ancestor.
|
|
18603
|
-
/* @__PURE__ */ (0,
|
|
18604
|
-
/* @__PURE__ */ (0,
|
|
18605
|
-
artifact.title ? /* @__PURE__ */ (0,
|
|
18606
|
-
/* @__PURE__ */ (0,
|
|
19207
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Artifact, { className: "shadow-none w-full rounded-2xl bg-background/70", children: [
|
|
19208
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(ArtifactHeader, { className: "bg-background/70", children: [
|
|
19209
|
+
artifact.title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArtifactTitle, { className: TITLE_CLASSES3, children: artifact.title }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", {}),
|
|
19210
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArtifactActions, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
18607
19211
|
ArtifactDownloadButton,
|
|
18608
19212
|
{
|
|
18609
19213
|
href: presignedUrl ?? "",
|
|
@@ -18612,7 +19216,7 @@ function TableArtifact({ artifact, labels, callbacks }) {
|
|
|
18612
19216
|
}
|
|
18613
19217
|
) })
|
|
18614
19218
|
] }),
|
|
18615
|
-
/* @__PURE__ */ (0,
|
|
19219
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ArtifactContent, { className: "p-0 overflow-visible", style: { maxHeight: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
18616
19220
|
TableArtifactContent,
|
|
18617
19221
|
{
|
|
18618
19222
|
columns: validColumns,
|
|
@@ -18643,7 +19247,8 @@ var TableArtifactService = {
|
|
|
18643
19247
|
// src/components/artifacts/artifact-services/index.ts
|
|
18644
19248
|
var ArtifactServices = {
|
|
18645
19249
|
[artifactTypes.TABLE]: TableArtifactService,
|
|
18646
|
-
[artifactTypes.CHART]: ChartArtifactService
|
|
19250
|
+
[artifactTypes.CHART]: ChartArtifactService,
|
|
19251
|
+
[artifactTypes.DECK]: DeckArtifactService
|
|
18647
19252
|
};
|
|
18648
19253
|
function artifactToClipboardText(artifact) {
|
|
18649
19254
|
const entry = ArtifactServices[artifact.type];
|
|
@@ -18654,13 +19259,13 @@ function artifactToClipboardText(artifact) {
|
|
|
18654
19259
|
}
|
|
18655
19260
|
|
|
18656
19261
|
// src/components/blocks/artifact-ref-block/artifact-ref-block.tsx
|
|
18657
|
-
var
|
|
19262
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
18658
19263
|
function ArtifactRefBlock({ block }) {
|
|
18659
19264
|
const { artifact, labels, callbacks } = block.payload;
|
|
18660
19265
|
const entry = ArtifactServices[artifact.type];
|
|
18661
19266
|
if (!entry) return null;
|
|
18662
19267
|
const Component = entry.Component;
|
|
18663
|
-
return /* @__PURE__ */ (0,
|
|
19268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Component, { artifact, labels, callbacks });
|
|
18664
19269
|
}
|
|
18665
19270
|
|
|
18666
19271
|
// src/components/blocks/block-services/artifact-ref-block-service.ts
|
|
@@ -18695,9 +19300,9 @@ function markdownToPlainText(markdown) {
|
|
|
18695
19300
|
}
|
|
18696
19301
|
|
|
18697
19302
|
// src/components/blocks/text-block/text-block.tsx
|
|
18698
|
-
var
|
|
18699
|
-
var
|
|
18700
|
-
var
|
|
19303
|
+
var import_react_markdown2 = __toESM(require("react-markdown"), 1);
|
|
19304
|
+
var import_remark_breaks2 = __toESM(require("remark-breaks"), 1);
|
|
19305
|
+
var import_remark_gfm2 = __toESM(require("remark-gfm"), 1);
|
|
18701
19306
|
|
|
18702
19307
|
// src/components/blocks/scrollable-table/scrollable-table-styles.ts
|
|
18703
19308
|
var import_styled_components3 = __toESM(require("styled-components"), 1);
|
|
@@ -18712,13 +19317,13 @@ var TableScroll = import_styled_components3.default.div`
|
|
|
18712
19317
|
`;
|
|
18713
19318
|
|
|
18714
19319
|
// src/components/blocks/scrollable-table/scrollable-table.tsx
|
|
18715
|
-
var
|
|
19320
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
18716
19321
|
function ScrollableTable({ node: _node, ...props }) {
|
|
18717
|
-
return /* @__PURE__ */ (0,
|
|
19322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableContainer, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TableScroll, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("table", { ...props }) }) });
|
|
18718
19323
|
}
|
|
18719
19324
|
|
|
18720
19325
|
// src/components/blocks/text-block/sanitize.ts
|
|
18721
|
-
function
|
|
19326
|
+
function sanitize2(text2) {
|
|
18722
19327
|
return text2.split("\n").filter((line) => {
|
|
18723
19328
|
const t = line.trim();
|
|
18724
19329
|
return !(t.startsWith("<!-- table-title:") && t.endsWith("-->"));
|
|
@@ -18858,12 +19463,12 @@ var TextBlockWrapper = import_styled_components4.default.div`
|
|
|
18858
19463
|
`;
|
|
18859
19464
|
|
|
18860
19465
|
// src/components/blocks/text-block/text-block.tsx
|
|
18861
|
-
var
|
|
19466
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
18862
19467
|
var markdownComponents = {
|
|
18863
|
-
table: ((tableProps) => /* @__PURE__ */ (0,
|
|
19468
|
+
table: ((tableProps) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ScrollableTable, { ...tableProps }))
|
|
18864
19469
|
};
|
|
18865
19470
|
function TextBlock({ block }) {
|
|
18866
|
-
return /* @__PURE__ */ (0,
|
|
19471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TextBlockWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_markdown2.default, { remarkPlugins: [import_remark_gfm2.default, import_remark_breaks2.default], components: markdownComponents, children: sanitize2(block.payload.text) }) });
|
|
18867
19472
|
}
|
|
18868
19473
|
|
|
18869
19474
|
// src/components/blocks/block-services/text-block-service.ts
|
|
@@ -18885,26 +19490,26 @@ var BlockServices = {
|
|
|
18885
19490
|
};
|
|
18886
19491
|
|
|
18887
19492
|
// src/components/blocks/block/block.tsx
|
|
18888
|
-
var
|
|
19493
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
18889
19494
|
function Block({ block }) {
|
|
18890
19495
|
const service = BlockServices[block.type];
|
|
18891
19496
|
if (!service) return null;
|
|
18892
19497
|
const { Component } = service;
|
|
18893
|
-
return /* @__PURE__ */ (0,
|
|
19498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Component, { block });
|
|
18894
19499
|
}
|
|
18895
19500
|
|
|
18896
19501
|
// src/components/blocks/block-context/block-context.tsx
|
|
18897
|
-
var
|
|
18898
|
-
var BlockContext = (0,
|
|
19502
|
+
var import_react19 = require("react");
|
|
19503
|
+
var BlockContext = (0, import_react19.createContext)(null);
|
|
18899
19504
|
function useBlockContext() {
|
|
18900
|
-
return (0,
|
|
19505
|
+
return (0, import_react19.useContext)(BlockContext) ?? {};
|
|
18901
19506
|
}
|
|
18902
19507
|
|
|
18903
19508
|
// src/components/ai-elements/prompt-input/prompt-input.tsx
|
|
18904
|
-
var
|
|
19509
|
+
var import_react22 = require("react");
|
|
18905
19510
|
|
|
18906
19511
|
// src/components/button/button.tsx
|
|
18907
|
-
var
|
|
19512
|
+
var import_react20 = require("react");
|
|
18908
19513
|
|
|
18909
19514
|
// src/components/button/button-styles.ts
|
|
18910
19515
|
var import_styled_components5 = __toESM(require("styled-components"), 1);
|
|
@@ -19027,8 +19632,8 @@ var StyledButton = import_styled_components5.default.button`
|
|
|
19027
19632
|
`;
|
|
19028
19633
|
|
|
19029
19634
|
// src/components/button/button.tsx
|
|
19030
|
-
var
|
|
19031
|
-
var Button2 = (0,
|
|
19635
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
19636
|
+
var Button2 = (0, import_react20.forwardRef)(function Button3({
|
|
19032
19637
|
children,
|
|
19033
19638
|
variant = BUTTON_VARIANT.SOLID,
|
|
19034
19639
|
intent = BUTTON_INTENT.PRIMARY,
|
|
@@ -19040,8 +19645,8 @@ var Button2 = (0, import_react17.forwardRef)(function Button3({
|
|
|
19040
19645
|
className,
|
|
19041
19646
|
"aria-label": ariaLabel
|
|
19042
19647
|
}, ref) {
|
|
19043
|
-
const iconElement = icon ? /* @__PURE__ */ (0,
|
|
19044
|
-
return /* @__PURE__ */ (0,
|
|
19648
|
+
const iconElement = icon ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { icon, size: 16 }) : null;
|
|
19649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
19045
19650
|
StyledButton,
|
|
19046
19651
|
{
|
|
19047
19652
|
ref,
|
|
@@ -19055,7 +19660,7 @@ var Button2 = (0, import_react17.forwardRef)(function Button3({
|
|
|
19055
19660
|
"aria-label": ariaLabel,
|
|
19056
19661
|
children: [
|
|
19057
19662
|
iconPosition === ICON_POSITION.LEADING && iconElement,
|
|
19058
|
-
/* @__PURE__ */ (0,
|
|
19663
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children }),
|
|
19059
19664
|
iconPosition === ICON_POSITION.TRAILING && iconElement
|
|
19060
19665
|
]
|
|
19061
19666
|
}
|
|
@@ -19063,7 +19668,7 @@ var Button2 = (0, import_react17.forwardRef)(function Button3({
|
|
|
19063
19668
|
});
|
|
19064
19669
|
|
|
19065
19670
|
// src/components/text-area/text-area.tsx
|
|
19066
|
-
var
|
|
19671
|
+
var import_react21 = require("react");
|
|
19067
19672
|
|
|
19068
19673
|
// src/utils/merge-refs.ts
|
|
19069
19674
|
function mergeRefs(...refs) {
|
|
@@ -19104,23 +19709,23 @@ var StyledTextArea = import_styled_components6.default.textarea`
|
|
|
19104
19709
|
`;
|
|
19105
19710
|
|
|
19106
19711
|
// src/components/text-area/text-area.tsx
|
|
19107
|
-
var
|
|
19108
|
-
var TextArea = (0,
|
|
19109
|
-
const internalRef = (0,
|
|
19110
|
-
(0,
|
|
19712
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
19713
|
+
var TextArea = (0, import_react21.forwardRef)(function TextArea2({ value: value2, onChange, placeholder, maxHeight, rows = 1, autoFocus, onKeyDown, disabled, className }, externalRef) {
|
|
19714
|
+
const internalRef = (0, import_react21.useRef)(null);
|
|
19715
|
+
(0, import_react21.useLayoutEffect)(() => {
|
|
19111
19716
|
const el = internalRef.current;
|
|
19112
19717
|
if (el) {
|
|
19113
19718
|
el.style.height = "auto";
|
|
19114
19719
|
el.style.height = `${el.scrollHeight}px`;
|
|
19115
19720
|
}
|
|
19116
19721
|
}, [value2]);
|
|
19117
|
-
const handleChange = (0,
|
|
19722
|
+
const handleChange = (0, import_react21.useCallback)(
|
|
19118
19723
|
(e) => {
|
|
19119
19724
|
onChange(e.target.value);
|
|
19120
19725
|
},
|
|
19121
19726
|
[onChange]
|
|
19122
19727
|
);
|
|
19123
|
-
return /* @__PURE__ */ (0,
|
|
19728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
19124
19729
|
StyledTextArea,
|
|
19125
19730
|
{
|
|
19126
19731
|
ref: mergeRefs(internalRef, externalRef),
|
|
@@ -19146,9 +19751,9 @@ var CHAT_STATUS = {
|
|
|
19146
19751
|
};
|
|
19147
19752
|
|
|
19148
19753
|
// src/components/ai-elements/prompt-input/prompt-input.tsx
|
|
19149
|
-
var
|
|
19754
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
19150
19755
|
var PromptInput = ({ className, onSubmit, disabled, children, ...props }) => {
|
|
19151
|
-
const handleSubmit = (0,
|
|
19756
|
+
const handleSubmit = (0, import_react22.useCallback)(
|
|
19152
19757
|
(event) => {
|
|
19153
19758
|
event.preventDefault();
|
|
19154
19759
|
if (disabled) {
|
|
@@ -19163,7 +19768,7 @@ var PromptInput = ({ className, onSubmit, disabled, children, ...props }) => {
|
|
|
19163
19768
|
},
|
|
19164
19769
|
[disabled, onSubmit]
|
|
19165
19770
|
);
|
|
19166
|
-
return /* @__PURE__ */ (0,
|
|
19771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
19167
19772
|
"form",
|
|
19168
19773
|
{
|
|
19169
19774
|
className: cn(
|
|
@@ -19176,9 +19781,9 @@ var PromptInput = ({ className, onSubmit, disabled, children, ...props }) => {
|
|
|
19176
19781
|
}
|
|
19177
19782
|
);
|
|
19178
19783
|
};
|
|
19179
|
-
var PromptInputTextarea = (0,
|
|
19784
|
+
var PromptInputTextarea = (0, import_react22.forwardRef)(
|
|
19180
19785
|
function PromptInputTextarea2({ className, onKeyDown, placeholder = "What would you like to know?", ...props }, ref) {
|
|
19181
|
-
const handleKeyDown = (0,
|
|
19786
|
+
const handleKeyDown = (0, import_react22.useCallback)(
|
|
19182
19787
|
(event) => {
|
|
19183
19788
|
onKeyDown?.(event);
|
|
19184
19789
|
if (event.defaultPrevented) {
|
|
@@ -19191,21 +19796,21 @@ var PromptInputTextarea = (0, import_react19.forwardRef)(
|
|
|
19191
19796
|
},
|
|
19192
19797
|
[onKeyDown]
|
|
19193
19798
|
);
|
|
19194
|
-
return /* @__PURE__ */ (0,
|
|
19799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("py-3", className), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TextArea, { ref, className: "px-4", onKeyDown: handleKeyDown, placeholder, ...props }) });
|
|
19195
19800
|
}
|
|
19196
19801
|
);
|
|
19197
|
-
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
19198
|
-
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
19802
|
+
var PromptInputFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex items-center justify-between gap-1 px-4 pb-3", className), ...props });
|
|
19803
|
+
var PromptInputTools = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: cn("flex min-w-0 items-center gap-1", className), ...props });
|
|
19199
19804
|
var PromptInputSubmit = ({
|
|
19200
19805
|
label = "Submit",
|
|
19201
19806
|
status = CHAT_STATUS.READY,
|
|
19202
19807
|
disabled,
|
|
19203
19808
|
className
|
|
19204
19809
|
}) => {
|
|
19205
|
-
const handleClick = (0,
|
|
19810
|
+
const handleClick = (0, import_react22.useCallback)((event) => {
|
|
19206
19811
|
event.currentTarget.form?.requestSubmit();
|
|
19207
19812
|
}, []);
|
|
19208
|
-
return /* @__PURE__ */ (0,
|
|
19813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
19209
19814
|
Button2,
|
|
19210
19815
|
{
|
|
19211
19816
|
intent: status === CHAT_STATUS.ERROR ? BUTTON_INTENT.ERROR : BUTTON_INTENT.PRIMARY,
|
|
@@ -19219,7 +19824,7 @@ var PromptInputSubmit = ({
|
|
|
19219
19824
|
};
|
|
19220
19825
|
|
|
19221
19826
|
// src/components/ai-elements/mouse-grid/mouse-grid.tsx
|
|
19222
|
-
var
|
|
19827
|
+
var import_react23 = require("react");
|
|
19223
19828
|
|
|
19224
19829
|
// src/utils/prefers-reduced-motion.ts
|
|
19225
19830
|
function prefersReducedMotion() {
|
|
@@ -19227,11 +19832,11 @@ function prefersReducedMotion() {
|
|
|
19227
19832
|
}
|
|
19228
19833
|
|
|
19229
19834
|
// src/components/ai-elements/mouse-grid/mouse-grid.tsx
|
|
19230
|
-
var
|
|
19835
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
19231
19836
|
function MouseGrid({ glowColor, colorCycleMs = 4e3, autoDrift = false } = {}) {
|
|
19232
|
-
const layerRef = (0,
|
|
19233
|
-
const glowRef = (0,
|
|
19234
|
-
(0,
|
|
19837
|
+
const layerRef = (0, import_react23.useRef)(null);
|
|
19838
|
+
const glowRef = (0, import_react23.useRef)(null);
|
|
19839
|
+
(0, import_react23.useEffect)(() => {
|
|
19235
19840
|
const driftEnabled = autoDrift && !prefersReducedMotion();
|
|
19236
19841
|
let raf = 0;
|
|
19237
19842
|
let driftRaf = 0;
|
|
@@ -19332,7 +19937,7 @@ function MouseGrid({ glowColor, colorCycleMs = 4e3, autoDrift = false } = {}) {
|
|
|
19332
19937
|
}, [autoDrift]);
|
|
19333
19938
|
const colorList = Array.isArray(glowColor) ? glowColor : glowColor != null ? [glowColor] : [];
|
|
19334
19939
|
const glowColorsKey = JSON.stringify(colorList);
|
|
19335
|
-
(0,
|
|
19940
|
+
(0, import_react23.useEffect)(() => {
|
|
19336
19941
|
const glow = glowRef.current;
|
|
19337
19942
|
if (!glow) {
|
|
19338
19943
|
return;
|
|
@@ -19359,19 +19964,19 @@ function MouseGrid({ glowColor, colorCycleMs = 4e3, autoDrift = false } = {}) {
|
|
|
19359
19964
|
clearColor();
|
|
19360
19965
|
};
|
|
19361
19966
|
}, [glowColorsKey, colorCycleMs]);
|
|
19362
|
-
return /* @__PURE__ */ (0,
|
|
19363
|
-
/* @__PURE__ */ (0,
|
|
19364
|
-
/* @__PURE__ */ (0,
|
|
19967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { ref: layerRef, "aria-hidden": "true", className: "vibe-mouse-grid-layer", children: [
|
|
19968
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "vibe-mouse-grid" }),
|
|
19969
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: glowRef, className: "vibe-mouse-glow" })
|
|
19365
19970
|
] });
|
|
19366
19971
|
}
|
|
19367
19972
|
|
|
19368
19973
|
// src/components/ai-elements/suggestion/suggestion.tsx
|
|
19369
|
-
var
|
|
19370
|
-
var
|
|
19371
|
-
var Suggestions = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
19974
|
+
var import_react24 = require("react");
|
|
19975
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
19976
|
+
var Suggestions = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn("flex flex-wrap items-center justify-center gap-3", className), ...props });
|
|
19372
19977
|
var Suggestion = ({ suggestion, onClick, className, children, ...props }) => {
|
|
19373
|
-
const handleClick = (0,
|
|
19374
|
-
return /* @__PURE__ */ (0,
|
|
19978
|
+
const handleClick = (0, import_react24.useCallback)(() => onClick?.(suggestion), [onClick, suggestion]);
|
|
19979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
19375
19980
|
"button",
|
|
19376
19981
|
{
|
|
19377
19982
|
type: "button",
|
|
@@ -19387,7 +19992,7 @@ var Suggestion = ({ suggestion, onClick, className, children, ...props }) => {
|
|
|
19387
19992
|
};
|
|
19388
19993
|
|
|
19389
19994
|
// src/components/chat/chat-message/chat-message.tsx
|
|
19390
|
-
var
|
|
19995
|
+
var import_react28 = require("react");
|
|
19391
19996
|
|
|
19392
19997
|
// src/components/chat/hooks/copy-message-text.ts
|
|
19393
19998
|
function copyMessageText(message) {
|
|
@@ -19404,13 +20009,13 @@ function copyMessageText(message) {
|
|
|
19404
20009
|
}
|
|
19405
20010
|
|
|
19406
20011
|
// src/components/chat/chat-message-actions/chat-message-actions.tsx
|
|
19407
|
-
var
|
|
20012
|
+
var import_react27 = require("react");
|
|
19408
20013
|
|
|
19409
20014
|
// src/components/chat/chat-context/chat-context.ts
|
|
19410
|
-
var
|
|
19411
|
-
var ChatContext = (0,
|
|
20015
|
+
var import_react25 = require("react");
|
|
20016
|
+
var ChatContext = (0, import_react25.createContext)(null);
|
|
19412
20017
|
function useChatContext() {
|
|
19413
|
-
const context = (0,
|
|
20018
|
+
const context = (0, import_react25.useContext)(ChatContext);
|
|
19414
20019
|
if (!context) {
|
|
19415
20020
|
throw new Error("useChatContext must be used within a Chat.Root component");
|
|
19416
20021
|
}
|
|
@@ -19418,7 +20023,7 @@ function useChatContext() {
|
|
|
19418
20023
|
}
|
|
19419
20024
|
|
|
19420
20025
|
// src/components/chat/hooks/use-copy-to-clipboard.ts
|
|
19421
|
-
var
|
|
20026
|
+
var import_react26 = require("react");
|
|
19422
20027
|
|
|
19423
20028
|
// src/utils/clipboard.ts
|
|
19424
20029
|
function copyToClipboard(text2, options) {
|
|
@@ -19431,14 +20036,14 @@ function copyToClipboard(text2, options) {
|
|
|
19431
20036
|
// src/components/chat/hooks/use-copy-to-clipboard.ts
|
|
19432
20037
|
var RESET_DELAY_MS = 2e3;
|
|
19433
20038
|
function useCopyToClipboard() {
|
|
19434
|
-
const [isCopied, setIsCopied] = (0,
|
|
19435
|
-
const timeoutRef = (0,
|
|
19436
|
-
(0,
|
|
20039
|
+
const [isCopied, setIsCopied] = (0, import_react26.useState)(false);
|
|
20040
|
+
const timeoutRef = (0, import_react26.useRef)(null);
|
|
20041
|
+
(0, import_react26.useEffect)(() => {
|
|
19437
20042
|
return () => {
|
|
19438
20043
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
19439
20044
|
};
|
|
19440
20045
|
}, []);
|
|
19441
|
-
const copy = (0,
|
|
20046
|
+
const copy = (0, import_react26.useCallback)((text2) => {
|
|
19442
20047
|
copyToClipboard(text2, {
|
|
19443
20048
|
onSuccess: () => {
|
|
19444
20049
|
setIsCopied(true);
|
|
@@ -19478,24 +20083,24 @@ var AnimatedAction = import_styled_components7.default.div`
|
|
|
19478
20083
|
`;
|
|
19479
20084
|
|
|
19480
20085
|
// src/components/chat/chat-message-actions/chat-message-actions.tsx
|
|
19481
|
-
var
|
|
20086
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
19482
20087
|
function ChatMessageActions({ className, messageId, content: content2, role, isHelpful }) {
|
|
19483
20088
|
const { onCopyMessage, onThumbUpClick, onThumbDownClick } = useChatContext();
|
|
19484
20089
|
const { isCopied, copy } = useCopyToClipboard();
|
|
19485
|
-
const handleCopy = (0,
|
|
20090
|
+
const handleCopy = (0, import_react27.useCallback)(() => {
|
|
19486
20091
|
copy(content2);
|
|
19487
20092
|
onCopyMessage?.(messageId);
|
|
19488
20093
|
}, [content2, messageId, copy, onCopyMessage]);
|
|
19489
|
-
const handleThumbUp = (0,
|
|
20094
|
+
const handleThumbUp = (0, import_react27.useCallback)(() => {
|
|
19490
20095
|
onThumbUpClick?.(messageId, isHelpful === true ? null : true);
|
|
19491
20096
|
}, [messageId, isHelpful, onThumbUpClick]);
|
|
19492
|
-
const handleThumbDown = (0,
|
|
20097
|
+
const handleThumbDown = (0, import_react27.useCallback)(() => {
|
|
19493
20098
|
onThumbDownClick?.(messageId, isHelpful === false ? null : false);
|
|
19494
20099
|
}, [messageId, isHelpful, onThumbDownClick]);
|
|
19495
20100
|
const isAssistant = role === MESSAGE_ROLE.ASSISTANT;
|
|
19496
20101
|
const hasFeedback = isAssistant && (onThumbUpClick || onThumbDownClick);
|
|
19497
|
-
return /* @__PURE__ */ (0,
|
|
19498
|
-
/* @__PURE__ */ (0,
|
|
20102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ActionsContainer, { $role: role, className, children: [
|
|
20103
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
19499
20104
|
IconButton,
|
|
19500
20105
|
{
|
|
19501
20106
|
icon: isCopied ? IconCheck : IconCopy,
|
|
@@ -19503,7 +20108,7 @@ function ChatMessageActions({ className, messageId, content: content2, role, isH
|
|
|
19503
20108
|
"aria-label": isCopied ? "Copied" : "Copy message"
|
|
19504
20109
|
}
|
|
19505
20110
|
),
|
|
19506
|
-
hasFeedback && /* @__PURE__ */ (0,
|
|
20111
|
+
hasFeedback && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AnimatedAction, { $visible: isHelpful !== false, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
19507
20112
|
IconButton,
|
|
19508
20113
|
{
|
|
19509
20114
|
icon: IconThumbUp,
|
|
@@ -19512,7 +20117,7 @@ function ChatMessageActions({ className, messageId, content: content2, role, isH
|
|
|
19512
20117
|
"aria-label": "Good response"
|
|
19513
20118
|
}
|
|
19514
20119
|
) }),
|
|
19515
|
-
hasFeedback && /* @__PURE__ */ (0,
|
|
20120
|
+
hasFeedback && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(AnimatedAction, { $visible: isHelpful !== true, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
19516
20121
|
IconButton,
|
|
19517
20122
|
{
|
|
19518
20123
|
icon: IconThumbDown,
|
|
@@ -19563,12 +20168,12 @@ var MessageBubble = import_styled_components8.default.div`
|
|
|
19563
20168
|
`;
|
|
19564
20169
|
|
|
19565
20170
|
// src/components/chat/chat-message/chat-message.tsx
|
|
19566
|
-
var
|
|
20171
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
19567
20172
|
function ChatMessage({ message }) {
|
|
19568
|
-
const clipboardText = (0,
|
|
19569
|
-
return /* @__PURE__ */ (0,
|
|
19570
|
-
/* @__PURE__ */ (0,
|
|
19571
|
-
/* @__PURE__ */ (0,
|
|
20173
|
+
const clipboardText = (0, import_react28.useMemo)(() => copyMessageText(message), [message]);
|
|
20174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MessageRow, { $role: message.role, role: "article", "aria-label": `${message.role} message`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(MessageContainer, { $role: message.role, children: [
|
|
20175
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MessageBubble, { $role: message.role, "data-testid": "message-bubble", children: message.blocks.map((block, index2) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Block, { block }, index2)) }),
|
|
20176
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
19572
20177
|
ChatMessageActions,
|
|
19573
20178
|
{
|
|
19574
20179
|
messageId: message.id,
|
|
@@ -19628,21 +20233,21 @@ var Key = import_styled_components9.default.kbd`
|
|
|
19628
20233
|
`;
|
|
19629
20234
|
|
|
19630
20235
|
// src/components/keyboard-shortcut/keyboard-shortcut.tsx
|
|
19631
|
-
var
|
|
20236
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
19632
20237
|
function KeyboardShortcut({
|
|
19633
20238
|
keys,
|
|
19634
20239
|
variant = KEYBOARD_SHORTCUT_VARIANTS.OUTLINED,
|
|
19635
20240
|
adaptive = false,
|
|
19636
20241
|
className
|
|
19637
20242
|
}) {
|
|
19638
|
-
return /* @__PURE__ */ (0,
|
|
20243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Wrapper, { className, children: keys.map((KeyComponent, index2) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Key, { $variant: variant, $adaptive: adaptive, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon, { icon: KeyComponent, size: 12 }) }, index2)) });
|
|
19639
20244
|
}
|
|
19640
20245
|
|
|
19641
20246
|
// src/components/keyboard-shortcut/icons/icon-ctrl.tsx
|
|
19642
|
-
var
|
|
20247
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
19643
20248
|
function IconCtrl(props) {
|
|
19644
20249
|
const { width: width2 = 24, height: height2 = 24, ...rest } = props;
|
|
19645
|
-
return /* @__PURE__ */ (0,
|
|
20250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: width2, height: height2, fill: "none", ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
19646
20251
|
"text",
|
|
19647
20252
|
{
|
|
19648
20253
|
x: "50%",
|
|
@@ -19659,7 +20264,7 @@ function IconCtrl(props) {
|
|
|
19659
20264
|
}
|
|
19660
20265
|
|
|
19661
20266
|
// src/components/lottie/lottie.tsx
|
|
19662
|
-
var
|
|
20267
|
+
var import_react30 = require("react");
|
|
19663
20268
|
|
|
19664
20269
|
// src/components/lottie/lottie-styles.ts
|
|
19665
20270
|
var import_styled_components10 = __toESM(require("styled-components"), 1);
|
|
@@ -19675,7 +20280,7 @@ var LottieContainer = import_styled_components10.default.div`
|
|
|
19675
20280
|
`;
|
|
19676
20281
|
|
|
19677
20282
|
// src/components/lottie/use-lottie.ts
|
|
19678
|
-
var
|
|
20283
|
+
var import_react29 = require("react");
|
|
19679
20284
|
var import_lottie_web = __toESM(require_lottie(), 1);
|
|
19680
20285
|
function useLottie({
|
|
19681
20286
|
animationData: animationData2,
|
|
@@ -19690,17 +20295,17 @@ function useLottie({
|
|
|
19690
20295
|
onLoopComplete,
|
|
19691
20296
|
onEnterFrame
|
|
19692
20297
|
}) {
|
|
19693
|
-
const containerRef = (0,
|
|
19694
|
-
const animationRef = (0,
|
|
19695
|
-
const onAnimationLoadedRef = (0,
|
|
19696
|
-
const onCompleteRef = (0,
|
|
19697
|
-
const onLoopCompleteRef = (0,
|
|
19698
|
-
const onEnterFrameRef = (0,
|
|
20298
|
+
const containerRef = (0, import_react29.useRef)(null);
|
|
20299
|
+
const animationRef = (0, import_react29.useRef)(null);
|
|
20300
|
+
const onAnimationLoadedRef = (0, import_react29.useRef)(onAnimationLoaded);
|
|
20301
|
+
const onCompleteRef = (0, import_react29.useRef)(onComplete);
|
|
20302
|
+
const onLoopCompleteRef = (0, import_react29.useRef)(onLoopComplete);
|
|
20303
|
+
const onEnterFrameRef = (0, import_react29.useRef)(onEnterFrame);
|
|
19699
20304
|
onAnimationLoadedRef.current = onAnimationLoaded;
|
|
19700
20305
|
onCompleteRef.current = onComplete;
|
|
19701
20306
|
onLoopCompleteRef.current = onLoopComplete;
|
|
19702
20307
|
onEnterFrameRef.current = onEnterFrame;
|
|
19703
|
-
(0,
|
|
20308
|
+
(0, import_react29.useEffect)(() => {
|
|
19704
20309
|
if (!containerRef.current) return;
|
|
19705
20310
|
const anim = import_lottie_web.default.loadAnimation({
|
|
19706
20311
|
container: containerRef.current,
|
|
@@ -19792,8 +20397,8 @@ function createLottieRef(animationRef) {
|
|
|
19792
20397
|
}
|
|
19793
20398
|
|
|
19794
20399
|
// src/components/lottie/lottie.tsx
|
|
19795
|
-
var
|
|
19796
|
-
var Lottie = (0,
|
|
20400
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
20401
|
+
var Lottie = (0, import_react30.forwardRef)(function Lottie2({
|
|
19797
20402
|
animationData: animationData2,
|
|
19798
20403
|
autoplay,
|
|
19799
20404
|
loop,
|
|
@@ -19823,8 +20428,8 @@ var Lottie = (0, import_react27.forwardRef)(function Lottie2({
|
|
|
19823
20428
|
onLoopComplete,
|
|
19824
20429
|
onEnterFrame
|
|
19825
20430
|
});
|
|
19826
|
-
(0,
|
|
19827
|
-
return /* @__PURE__ */ (0,
|
|
20431
|
+
(0, import_react30.useImperativeHandle)(ref, () => createLottieRef(animationRef), [animationRef]);
|
|
20432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
19828
20433
|
LottieContainer,
|
|
19829
20434
|
{
|
|
19830
20435
|
ref: containerRef,
|
|
@@ -19927,7 +20532,9 @@ function convertTableToCSV(table) {
|
|
|
19927
20532
|
ChatContext,
|
|
19928
20533
|
ChatMessage,
|
|
19929
20534
|
DEFAULT_CHART_ARTIFACT_LABELS,
|
|
20535
|
+
DEFAULT_DECK_ARTIFACT_LABELS,
|
|
19930
20536
|
DEFAULT_TABLE_ARTIFACT_LABELS,
|
|
20537
|
+
DeckArtifact,
|
|
19931
20538
|
ICON_POSITION,
|
|
19932
20539
|
Icon,
|
|
19933
20540
|
IconButton,
|
|
@@ -19953,6 +20560,8 @@ function convertTableToCSV(table) {
|
|
|
19953
20560
|
colors,
|
|
19954
20561
|
convertTableToCSV,
|
|
19955
20562
|
copyMessageText,
|
|
20563
|
+
deckBlockTypes,
|
|
20564
|
+
deckSlideKinds,
|
|
19956
20565
|
escapeCsvField,
|
|
19957
20566
|
fontFamilies,
|
|
19958
20567
|
isSafeDownloadUrl,
|
|
@@ -19981,7 +20590,11 @@ lottie-web/build/player/lottie.js:
|
|
|
19981
20590
|
@tabler/icons-react/dist/esm/defaultAttributes.mjs:
|
|
19982
20591
|
@tabler/icons-react/dist/esm/createReactComponent.mjs:
|
|
19983
20592
|
@tabler/icons-react/dist/esm/icons/IconAlertCircle.mjs:
|
|
20593
|
+
@tabler/icons-react/dist/esm/icons/IconArrowsMaximize.mjs:
|
|
20594
|
+
@tabler/icons-react/dist/esm/icons/IconArrowsMinimize.mjs:
|
|
19984
20595
|
@tabler/icons-react/dist/esm/icons/IconCheck.mjs:
|
|
20596
|
+
@tabler/icons-react/dist/esm/icons/IconChevronLeft.mjs:
|
|
20597
|
+
@tabler/icons-react/dist/esm/icons/IconChevronRight.mjs:
|
|
19985
20598
|
@tabler/icons-react/dist/esm/icons/IconCopy.mjs:
|
|
19986
20599
|
@tabler/icons-react/dist/esm/icons/IconDownload.mjs:
|
|
19987
20600
|
@tabler/icons-react/dist/esm/icons/IconFileSpreadsheet.mjs:
|