@marimo-team/frontend 0.23.7-dev75 → 0.23.7-dev78
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/assets/{JsonOutput-BEbyS3oG.js → JsonOutput-05-R3eil.js} +1 -1
- package/dist/assets/{add-connection-dialog-Cw6_iYno.js → add-connection-dialog-CzxRpS5F.js} +1 -1
- package/dist/assets/{agent-panel-StLA6gDR.js → agent-panel-zPhlhkYL.js} +1 -1
- package/dist/assets/{cell-editor-j6uI2lbb.js → cell-editor-ODyJXDT8.js} +1 -1
- package/dist/assets/{column-preview-DA6nf5_Q.js → column-preview-BLIWbdOX.js} +1 -1
- package/dist/assets/{command-palette-C1ZQoRKK.js → command-palette-CeDe63_W.js} +1 -1
- package/dist/assets/{dependency-graph-panel-69vKwEHr.js → dependency-graph-panel-D-QLNUZN.js} +1 -1
- package/dist/assets/{download-BO6T2USS.js → download-B1QFVDP-.js} +1 -1
- package/dist/assets/{edit-page--m-g7sJd.js → edit-page-D_MrFGP2.js} +4 -4
- package/dist/assets/{file-explorer-panel-_77UepGi.js → file-explorer-panel-BVBKF1SH.js} +1 -1
- package/dist/assets/{form-CM8vYbSt.js → form-BjUJP6PJ.js} +1 -1
- package/dist/assets/{hooks-DmXpnB4Q.js → hooks-jWLD3t7P.js} +1 -1
- package/dist/assets/{index-DKsz6MdI.js → index-CA2sQKnW.js} +14 -14
- package/dist/assets/layout-DEU6lX-9.js +9 -0
- package/dist/assets/{panels-C2AdFHca.js → panels-DWhhEgv4.js} +1 -1
- package/dist/assets/{reveal-component-NyMxWg7l.js → reveal-component-DNpBzX6F.js} +1 -1
- package/dist/assets/{run-page-CL5_8cl2.js → run-page-CO2X6wso.js} +1 -1
- package/dist/assets/{scratchpad-panel-CAdNGYeJ.js → scratchpad-panel-CWfddArs.js} +1 -1
- package/dist/assets/{session-panel-jVcSUURP.js → session-panel-BP0QxaoM.js} +1 -1
- package/dist/assets/{useCellActionButton-CpNJthj4.js → useCellActionButton-QaDO24oW.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BNbEyT1o.js → useDependencyPanelTab-BB_XeSAg.js} +1 -1
- package/dist/assets/{useNotebookActions-BoiZcX-N.js → useNotebookActions-CJEicFed.js} +1 -1
- package/dist/index.html +5 -5
- package/package.json +1 -1
- package/src/components/editor/notebook-cell.tsx +2 -0
- package/src/components/editor/output/console/ConsoleOutput.tsx +23 -5
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +114 -0
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -0
- package/src/components/scratchpad/scratchpad.tsx +1 -0
- package/src/plugins/layout/DownloadPlugin.tsx +9 -7
- package/src/utils/download.ts +4 -2
- package/dist/assets/layout-DSscq2Li.js +0 -9
|
@@ -80,22 +80,26 @@ const DownloadButton = ({
|
|
|
80
80
|
const [isLoading, setIsLoading] = useState(false);
|
|
81
81
|
|
|
82
82
|
const handleClick = async (e: React.MouseEvent) => {
|
|
83
|
-
if (
|
|
83
|
+
if (data.disabled) {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
e.stopPropagation();
|
|
84
86
|
return;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
|
|
91
|
+
if (!data.lazy) {
|
|
92
|
+
downloadByURL(data.data, data.filename ?? undefined);
|
|
88
93
|
return;
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
e.preventDefault();
|
|
92
96
|
setIsLoading(true);
|
|
93
97
|
|
|
94
98
|
try {
|
|
95
99
|
const loadedData = await load({});
|
|
96
100
|
downloadByURL(
|
|
97
101
|
loadedData.data,
|
|
98
|
-
loadedData.filename
|
|
102
|
+
loadedData.filename ?? data.filename ?? undefined,
|
|
99
103
|
);
|
|
100
104
|
} catch (error) {
|
|
101
105
|
toast({
|
|
@@ -114,9 +118,7 @@ const DownloadButton = ({
|
|
|
114
118
|
return (
|
|
115
119
|
<a
|
|
116
120
|
href={data.data}
|
|
117
|
-
download={data.filename
|
|
118
|
-
target="_blank"
|
|
119
|
-
rel="noopener noreferrer"
|
|
121
|
+
download={data.filename ?? ""}
|
|
120
122
|
onClick={handleClick}
|
|
121
123
|
className={buttonVariants({
|
|
122
124
|
variant: "secondary",
|
package/src/utils/download.ts
CHANGED
|
@@ -175,10 +175,12 @@ export async function downloadHTMLAsImage(opts: {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
export function downloadByURL(url: string, filename
|
|
178
|
+
export function downloadByURL(url: string, filename?: string) {
|
|
179
179
|
const a = document.createElement("a");
|
|
180
180
|
a.href = url;
|
|
181
|
-
|
|
181
|
+
if (filename) {
|
|
182
|
+
a.download = filename;
|
|
183
|
+
}
|
|
182
184
|
a.click();
|
|
183
185
|
a.remove();
|
|
184
186
|
}
|