@marimo-team/islands 0.20.4-dev2 → 0.20.5-dev0

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/main.js CHANGED
@@ -70357,7 +70357,7 @@ Image URL: ${r.imageUrl}`)), contextToXml({
70357
70357
  return Logger.warn("Failed to get version from mount config"), null;
70358
70358
  }
70359
70359
  }
70360
- const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.20.4-dev2"), showCodeInRunModeAtom = atom(true);
70360
+ const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.20.5-dev0"), showCodeInRunModeAtom = atom(true);
70361
70361
  atom(null);
70362
70362
  var import_compiler_runtime$88 = require_compiler_runtime();
70363
70363
  function useKeydownOnElement(e, r) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.20.4-dev2",
3
+ "version": "0.20.5-dev0",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -184,6 +184,21 @@ export function useNotebookActions() {
184
184
  await withLoadingToast(title, runDownload);
185
185
  };
186
186
 
187
+ const handleDocumentPDF = async () => {
188
+ if (serverSidePdfEnabled) {
189
+ await downloadServerSidePDF({
190
+ preset: "document",
191
+ title: "Downloading Document PDF...",
192
+ });
193
+ return;
194
+ }
195
+ const beforeprint = new Event("export-beforeprint");
196
+ const afterprint = new Event("export-afterprint");
197
+ window.dispatchEvent(beforeprint);
198
+ setTimeout(() => window.print(), 0);
199
+ setTimeout(() => window.dispatchEvent(afterprint), 0);
200
+ };
201
+
187
202
  const actions: ActionButton[] = [
188
203
  {
189
204
  icon: <DownloadIcon size={14} strokeWidth={1.5} />,
@@ -261,49 +276,38 @@ export function useNotebookActions() {
261
276
  });
262
277
  },
263
278
  },
264
- {
265
- divider: true,
266
- icon: <FileIcon size={14} strokeWidth={1.5} />,
267
- label: "Download as PDF",
268
- handle: NOOP_HANDLER,
269
- dropdown: [
270
- {
279
+ isSlidesLayout
280
+ ? {
281
+ divider: true,
271
282
  icon: <FileIcon size={14} strokeWidth={1.5} />,
272
- label: "Document Layout",
273
- rightElement: renderRecommendedElement(!isSlidesLayout),
274
- handle: async () => {
275
- if (serverSidePdfEnabled) {
276
- await downloadServerSidePDF({
277
- preset: "document",
278
- title: "Downloading Document PDF...",
279
- });
280
- return;
281
- }
282
-
283
- const beforeprint = new Event("export-beforeprint");
284
- const afterprint = new Event("export-afterprint");
285
- function print() {
286
- window.dispatchEvent(beforeprint);
287
- setTimeout(() => window.print(), 0);
288
- setTimeout(() => window.dispatchEvent(afterprint), 0);
289
- }
290
- print();
291
- },
292
- },
293
- {
283
+ label: "Download as PDF",
284
+ handle: NOOP_HANDLER,
285
+ dropdown: [
286
+ {
287
+ icon: <FileIcon size={14} strokeWidth={1.5} />,
288
+ label: "Document Layout",
289
+ handle: handleDocumentPDF,
290
+ },
291
+ {
292
+ icon: <FileIcon size={14} strokeWidth={1.5} />,
293
+ label: "Slides Layout",
294
+ rightElement: renderRecommendedElement(true),
295
+ hidden: !serverSidePdfEnabled,
296
+ handle: async () => {
297
+ await downloadServerSidePDF({
298
+ preset: "slides",
299
+ title: "Downloading Slides PDF...",
300
+ });
301
+ },
302
+ },
303
+ ],
304
+ }
305
+ : {
306
+ divider: true,
294
307
  icon: <FileIcon size={14} strokeWidth={1.5} />,
295
- label: "Slides Layout",
296
- rightElement: renderRecommendedElement(isSlidesLayout),
297
- hidden: !serverSidePdfEnabled,
298
- handle: async () => {
299
- await downloadServerSidePDF({
300
- preset: "slides",
301
- title: "Downloading Slides PDF...",
302
- });
303
- },
308
+ label: "Download as PDF",
309
+ handle: handleDocumentPDF,
304
310
  },
305
- ],
306
- },
307
311
  ],
308
312
  },
309
313