@marimo-team/islands 0.23.16-dev29 → 0.23.16-dev31

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.
@@ -36344,7 +36344,7 @@ ${d}`,
36344
36344
  return Logger.warn("Failed to get version from mount config"), null;
36345
36345
  }
36346
36346
  }
36347
- marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.16-dev29");
36347
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.16-dev31");
36348
36348
  showCodeInRunModeAtom = atom(true);
36349
36349
  atom(null);
36350
36350
  var import_compiler_runtime = require_compiler_runtime();
package/dist/main.js CHANGED
@@ -26,7 +26,7 @@ import { $ as notebookOutline, A as ChevronDownIcon, Bn as Eye, Bt as DATA_TYPE_
26
26
  import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-B9WoXK1R.js";
27
27
  import { o as useSize, s as Root$1, u as createLucideIcon } from "./dist-DIlxLFXG.js";
28
28
  import { A as SquareFunction, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, O as TIME_UNIT_DESCRIPTIONS, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as ChartColumn, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-CQKL_D3i.js";
29
- import { $ as CommandSeparator, $t as Kbd, A as ErrorState, At as getPageIndexForRow, B as ContextMenuTrigger, Bt as dateToLocalISODate, C as downloadHTMLAsImage, Ct as inferFieldTypes, D as ColumnName, Dt as DelayMount, E as downloadSizeLimitAtom, Et as ColumnChartSpecModel, F as getUserColumnVisibilityCounts, Ft as TOO_MANY_ROWS, G as DateRangePicker, Gt as TabsList, H as useSelectList, Ht as dateToLocalISOTime, I as ContextMenu, It as toFieldTypes, J as Command, Jt as ChartInfoState, K as Combobox, Kt as TabsTrigger, L as ContextMenuContent, Lt as getMimeValues, M as prettifyRowColumnCount, Mt as loadTableData, N as prettifyRowCount, Nt as INDEX_COLUMN_NAME, O as ColumnPreviewContainer, Ot as useIntersectionObserver, P as getColumnCountForDisplay, Pt as SELECT_COLUMN_ID, Q as CommandList, Qt as RenderTextWithLinks, R as ContextMenuItem, Rt as isNullishFilter, S as downloadExportedFile, St as generateColumns, T as Filenames, Tt as ColumnChartContext, U as CompactChipRow, Ut as Tabs, V as useInternalStateWithSync, Vt as dateToLocalISODateTime, W as DatePicker, Wt as TabsContent, X as CommandInput, Xt as LazyVegaEmbed, Y as CommandEmpty, Yt as ChartLoadingState, Z as CommandItem, Zt as useOverflowDetection, _ as DataTable, _n as ChevronsLeft, _t as TableCell, an as $fae977aafc393c5c$export$588937bcd60ade55, at as contextAwarePanelType, b as downloadBlob, bn as ArrowDownWideNarrow, bt as TableRow, c as SLIDE_TYPE_OPTIONS_BY_VALUE, cn as GripHorizontal, ct as slotsController, d as Switch, en as HtmlOutput, et as smartMatch, f as RadioGroup, fn as Ellipsis, g as OutputRenderer, gn as ChevronsRight, gt as TableBody, h as OutputArea, hn as ChevronsUpDown, ht as Table, i as showCodeInRunModeAtom, in as isRecord, it as contextAwarePanelOwner, j as LoadingState, jt as loadTableAndRawData, k as EmptyState, kt as usePrevious$1, ln as Funnel, lt as Toggle, m as JsonOutput, mn as Code, mt as Provider$1, n as useNotebookCodeAvailable, nn as safeLocale, nt as PANEL_TYPES, on as $fae977aafc393c5c$export$6b862160d295c8e, ot as isCellAwareAtom, p as RadioGroupItem, pn as Download, pt as Fill, q as ComboboxItem, qt as ChartErrorState, r as marimoVersionAtom, rn as hasFunctionProperty, rt as contextAwarePanelOpen, sn as TextWrap, st as SlotNames, t as cellDomProps, tn as EmotionCacheProvider, tt as ContextAwarePanelItem, u as Slide, un as EyeOff, v as InstallPackageButton, vn as ChevronsDownUp, vt as TableHead, w as Progress, wt as renderCellValue, x as downloadByURL, xt as NAMELESS_COLUMN_PREFIX, y as ADD_PRINTING_CLASS, yn as ChevronLeft, yt as TableHeader, z as ContextMenuSeparator, zt as Maps, __tla as __tla_2 } from "./common-CozjhRem.js";
29
+ import { $ as CommandSeparator, $t as Kbd, A as ErrorState, At as getPageIndexForRow, B as ContextMenuTrigger, Bt as dateToLocalISODate, C as downloadHTMLAsImage, Ct as inferFieldTypes, D as ColumnName, Dt as DelayMount, E as downloadSizeLimitAtom, Et as ColumnChartSpecModel, F as getUserColumnVisibilityCounts, Ft as TOO_MANY_ROWS, G as DateRangePicker, Gt as TabsList, H as useSelectList, Ht as dateToLocalISOTime, I as ContextMenu, It as toFieldTypes, J as Command, Jt as ChartInfoState, K as Combobox, Kt as TabsTrigger, L as ContextMenuContent, Lt as getMimeValues, M as prettifyRowColumnCount, Mt as loadTableData, N as prettifyRowCount, Nt as INDEX_COLUMN_NAME, O as ColumnPreviewContainer, Ot as useIntersectionObserver, P as getColumnCountForDisplay, Pt as SELECT_COLUMN_ID, Q as CommandList, Qt as RenderTextWithLinks, R as ContextMenuItem, Rt as isNullishFilter, S as downloadExportedFile, St as generateColumns, T as Filenames, Tt as ColumnChartContext, U as CompactChipRow, Ut as Tabs, V as useInternalStateWithSync, Vt as dateToLocalISODateTime, W as DatePicker, Wt as TabsContent, X as CommandInput, Xt as LazyVegaEmbed, Y as CommandEmpty, Yt as ChartLoadingState, Z as CommandItem, Zt as useOverflowDetection, _ as DataTable, _n as ChevronsLeft, _t as TableCell, an as $fae977aafc393c5c$export$588937bcd60ade55, at as contextAwarePanelType, b as downloadBlob, bn as ArrowDownWideNarrow, bt as TableRow, c as SLIDE_TYPE_OPTIONS_BY_VALUE, cn as GripHorizontal, ct as slotsController, d as Switch, en as HtmlOutput, et as smartMatch, f as RadioGroup, fn as Ellipsis, g as OutputRenderer, gn as ChevronsRight, gt as TableBody, h as OutputArea, hn as ChevronsUpDown, ht as Table, i as showCodeInRunModeAtom, in as isRecord, it as contextAwarePanelOwner, j as LoadingState, jt as loadTableAndRawData, k as EmptyState, kt as usePrevious$1, ln as Funnel, lt as Toggle, m as JsonOutput, mn as Code, mt as Provider$1, n as useNotebookCodeAvailable, nn as safeLocale, nt as PANEL_TYPES, on as $fae977aafc393c5c$export$6b862160d295c8e, ot as isCellAwareAtom, p as RadioGroupItem, pn as Download, pt as Fill, q as ComboboxItem, qt as ChartErrorState, r as marimoVersionAtom, rn as hasFunctionProperty, rt as contextAwarePanelOpen, sn as TextWrap, st as SlotNames, t as cellDomProps, tn as EmotionCacheProvider, tt as ContextAwarePanelItem, u as Slide, un as EyeOff, v as InstallPackageButton, vn as ChevronsDownUp, vt as TableHead, w as Progress, wt as renderCellValue, x as downloadByURL, xt as NAMELESS_COLUMN_PREFIX, y as ADD_PRINTING_CLASS, yn as ChevronLeft, yt as TableHeader, z as ContextMenuSeparator, zt as Maps, __tla as __tla_2 } from "./common-DF6Pmj89.js";
30
30
  import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-CMJGqBaY.js";
31
31
  import { t as Check } from "./check-DP7U0H0G.js";
32
32
  import { A as Icon, C as logNever, D as $18f2051aff69b9bf$export$a54013f0d02a8f82, E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, F as createCollection, I as X, M as clamp$2, N as usePrevious$2, P as useDirection, R as ChevronDown, S as assertNever, a as SelectGroup, c as SelectSeparator, d as NativeSelect, i as SelectContent, j as Trigger$1, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, w as $a916eb452884faea$export$b7a616150fdb9f44 } from "./strings-DIy9NAmg.js";
@@ -38147,7 +38147,7 @@ ${c}
38147
38147
  function _temp2$2(e) {
38148
38148
  e.target === e.currentTarget && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), e.currentTarget.click());
38149
38149
  }
38150
- var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BaMyGKAw.js"));
38150
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-Cjz1dhi5.js"));
38151
38151
  const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
38152
38152
  var _a5;
38153
38153
  let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { slideCells: h, skippedIds: g, noOutputIds: _, slideTypes: v, startCellIndex: y } = (0, import_react.useMemo)(() => computeSlideCellsInfo(c, e), [
@@ -40285,6 +40285,7 @@ ${c}
40285
40285
  __publicField(this, "sendUpdateFile", throwNotImplemented);
40286
40286
  __publicField(this, "sendFileDetails", throwNotImplemented);
40287
40287
  __publicField(this, "openTutorial", throwNotImplemented);
40288
+ __publicField(this, "getExportAvailability", throwNotImplemented);
40288
40289
  __publicField(this, "exportAsHTML", throwNotImplemented);
40289
40290
  __publicField(this, "exportAsIPYNB", throwNotImplemented);
40290
40291
  __publicField(this, "exportAsMarkdown", throwNotImplemented);
@@ -9,7 +9,7 @@ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
9
9
  import { ut as outputIsStale } from "./html-to-image-Bza3T2dl.js";
10
10
  import "./chunk-5FQGJX7Z-B9WoXK1R.js";
11
11
  import { u as createLucideIcon } from "./dist-DIlxLFXG.js";
12
- import { a as DEFAULT_DECK_TRANSITION, dn as Expand, dt as PanelGroup, ft as PanelResizeHandle, l as SlideSidebar, mn as Code, n as useNotebookCodeAvailable, o as DEFAULT_DECK_VERTICAL_ALIGN, s as DEFAULT_SLIDE_TYPE, t as cellDomProps, u as Slide, un as EyeOff, ut as Panel } from "./common-CozjhRem.js";
12
+ import { a as DEFAULT_DECK_TRANSITION, dn as Expand, dt as PanelGroup, ft as PanelResizeHandle, l as SlideSidebar, mn as Code, n as useNotebookCodeAvailable, o as DEFAULT_DECK_VERTICAL_ALIGN, s as DEFAULT_SLIDE_TYPE, t as cellDomProps, u as Slide, un as EyeOff, ut as Panel } from "./common-DF6Pmj89.js";
13
13
  import { R as ChevronDown } from "./strings-DIy9NAmg.js";
14
14
  import { X as useDebouncedCallback } from "./input-C5K4VBvB.js";
15
15
  import { v as kioskModeAtom } from "./toDate-CqhBWjvO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.23.16-dev29",
3
+ "version": "0.23.16-dev31",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -64,6 +64,31 @@ export const MockRequestClient = {
64
64
  getWorkspaceFiles: vi.fn().mockResolvedValue({ files: [] }),
65
65
  getRunningNotebooks: vi.fn().mockResolvedValue({ files: [] }),
66
66
  shutdownSession: vi.fn().mockResolvedValue({}),
67
+ getExportAvailability: vi.fn().mockResolvedValue({
68
+ source: "server",
69
+ formats: [
70
+ {
71
+ format: "html",
72
+ dependenciesAvailable: true,
73
+ missingPackages: [],
74
+ },
75
+ {
76
+ format: "markdown",
77
+ dependenciesAvailable: true,
78
+ missingPackages: [],
79
+ },
80
+ {
81
+ format: "ipynb",
82
+ dependenciesAvailable: true,
83
+ missingPackages: [],
84
+ },
85
+ {
86
+ format: "pdf",
87
+ dependenciesAvailable: true,
88
+ missingPackages: [],
89
+ },
90
+ ],
91
+ }),
67
92
  exportAsHTML: vi.fn().mockResolvedValue({
68
93
  contents: "",
69
94
  filename: "notebook.html",
@@ -354,6 +354,7 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
354
354
  sendUpdateFile = throwNotImplemented;
355
355
  sendFileDetails = throwNotImplemented;
356
356
  openTutorial = throwNotImplemented;
357
+ getExportAvailability = throwNotImplemented;
357
358
  exportAsHTML = throwNotImplemented;
358
359
  exportAsIPYNB = throwNotImplemented;
359
360
  exportAsMarkdown = throwNotImplemented;
@@ -4,7 +4,11 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
4
4
  import { cellId, requestId, uiElementId } from "@/__tests__/branded";
5
5
  import type { RuntimeManager } from "../../runtime/runtime";
6
6
  import { createLazyRequests } from "../requests-lazy";
7
- import type { EditRequests, RunRequests } from "../types";
7
+ import type {
8
+ EditRequests,
9
+ ExportAvailabilityResponse,
10
+ RunRequests,
11
+ } from "../types";
8
12
 
9
13
  // Mock the connection module
10
14
  vi.mock("../connection", async () => {
@@ -72,6 +76,33 @@ describe("createLazyRequests", () => {
72
76
  expect(mockDelegate.getEnvironmentInfo).toHaveBeenCalledOnce();
73
77
  });
74
78
 
79
+ it("gets export availability without starting a kernel", async () => {
80
+ const availability: ExportAvailabilityResponse = {
81
+ source: "server",
82
+ formats: [
83
+ {
84
+ format: "ipynb",
85
+ dependenciesAvailable: false,
86
+ missingPackages: ["nbformat"],
87
+ },
88
+ ],
89
+ };
90
+ mockDelegate.getExportAvailability = vi
91
+ .fn()
92
+ .mockResolvedValue(availability) as EditRequests["getExportAvailability"];
93
+
94
+ const lazyRequests = createLazyRequests(
95
+ mockDelegate,
96
+ mockGetRuntimeManager,
97
+ );
98
+
99
+ await expect(lazyRequests.getExportAvailability()).resolves.toEqual(
100
+ availability,
101
+ );
102
+ expect(mockInit).not.toHaveBeenCalled();
103
+ expect(mockDelegate.getExportAvailability).toHaveBeenCalledOnce();
104
+ });
105
+
75
106
  it("should call init once before first request", async () => {
76
107
  const lazyRequests = createLazyRequests(
77
108
  mockDelegate,
@@ -123,6 +123,13 @@ describe("createNetworkRequests", () => {
123
123
  expect(mockClient.GET).toHaveBeenCalledWith("/api/environment");
124
124
  });
125
125
 
126
+ it("getExportAvailability should GET /api/export/availability", async () => {
127
+ const requests = createNetworkRequests();
128
+ await requests.getExportAvailability();
129
+
130
+ expect(mockClient.GET).toHaveBeenCalledWith("/api/export/availability");
131
+ });
132
+
126
133
  it("getPackageList should not require a kernel connection", async () => {
127
134
  const { waitForConnectionOpen, waitForConnectionOpenIfNotebook } =
128
135
  await import("../connection");
@@ -103,6 +103,7 @@ const ACTIONS: Record<keyof AllRequests, Action> = {
103
103
 
104
104
  // Served by the marimo server without a kernel session
105
105
  getEnvironmentInfo: "serverOnly",
106
+ getExportAvailability: "serverOnly",
106
107
 
107
108
  // Home operations throw errors
108
109
  getRecentFiles: "startConnection",
@@ -402,6 +402,9 @@ export function createNetworkRequests(): EditRequests & RunRequests {
402
402
  })
403
403
  .then(handleResponse);
404
404
  },
405
+ getExportAvailability: () => {
406
+ return getClient().GET("/api/export/availability").then(handleResponse);
407
+ },
405
408
  exportAsHTML: async (request) => {
406
409
  if (
407
410
  process.env.NODE_ENV === "development" ||
@@ -82,6 +82,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
82
82
  getWorkspaceFiles: throwNotInEditMode,
83
83
  getRunningNotebooks: throwNotInEditMode,
84
84
  shutdownSession: throwNotInEditMode,
85
+ getExportAvailability: throwNotInEditMode,
85
86
  exportAsHTML: throwNotInEditMode,
86
87
  exportAsIPYNB: throwNotInEditMode,
87
88
  exportAsMarkdown: throwNotInEditMode,
@@ -63,6 +63,7 @@ export function createErrorToastingRequests(
63
63
  getWorkspaceFiles: "Failed to get workspace files",
64
64
  getRunningNotebooks: "Failed to get running notebooks",
65
65
  shutdownSession: "Failed to shutdown session",
66
+ getExportAvailability: "", // No toast
66
67
  exportAsHTML: "Failed to export HTML",
67
68
  exportAsIPYNB: "Failed to export ipynb",
68
69
  exportAsMarkdown: "Failed to export Markdown",
@@ -17,6 +17,7 @@ export type CellConfig = schemas["CellConfig"];
17
17
  export type RuntimeState = schemas["CellNotification"]["status"];
18
18
  export type CodeCompletionRequest = schemas["CodeCompletionRequest"];
19
19
  export type DeleteCellRequest = schemas["DeleteCellRequest"];
20
+ export type AutoExportAsIPYNBRequest = schemas["AutoExportAsIPYNBRequest"];
20
21
  export type AutoExportAsMarkdownRequest =
21
22
  schemas["AutoExportAsMarkdownRequest"];
22
23
  export type ExportAsHTMLRequest = schemas["ExportAsHTMLRequest"];
@@ -24,6 +25,7 @@ export type ExportAsMarkdownRequest = schemas["ExportAsMarkdownRequest"];
24
25
  export type ExportAsIPYNBRequest = schemas["ExportAsIPYNBRequest"];
25
26
  export type ExportAsScriptRequest = schemas["ExportAsScriptRequest"];
26
27
  export type ExportAsPDFRequest = schemas["ExportAsPDFRequest"];
28
+ export type ExportAvailabilityResponse = schemas["ExportAvailabilityResponse"];
27
29
  export type UpdateCellOutputsRequest = schemas["UpdateCellOutputsRequest"];
28
30
 
29
31
  export interface ExportedFile<T extends BlobPart = BlobPart> {
@@ -214,6 +216,7 @@ export interface EditRequests {
214
216
  request: ShutdownSessionRequest,
215
217
  ) => Promise<RunningNotebooksResponse>;
216
218
  // Export requests
219
+ getExportAvailability: () => Promise<ExportAvailabilityResponse>;
217
220
  exportAsHTML: (request: ExportAsHTMLRequest) => Promise<ExportedFile<string>>;
218
221
  exportAsIPYNB: (
219
222
  request: ExportAsIPYNBRequest,
@@ -224,7 +227,7 @@ export interface EditRequests {
224
227
  exportAsPDF: (request: ExportAsPDFRequest) => Promise<ExportedFile<Blob>>;
225
228
  autoExportAsHTML: (request: ExportAsHTMLRequest) => Promise<null>;
226
229
  autoExportAsMarkdown: (request: AutoExportAsMarkdownRequest) => Promise<null>;
227
- autoExportAsIPYNB: (request: ExportAsIPYNBRequest) => Promise<null>;
230
+ autoExportAsIPYNB: (request: AutoExportAsIPYNBRequest) => Promise<null>;
228
231
  updateCellOutputs: (request: UpdateCellOutputsRequest) => Promise<null>;
229
232
  // Package requests
230
233
  getPackageList: () => Promise<ListPackagesResponse>;
@@ -643,6 +643,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
643
643
  getWorkspaceFiles = throwNotImplemented;
644
644
  getRunningNotebooks = throwNotImplemented;
645
645
  shutdownSession = throwNotImplemented;
646
+ getExportAvailability = throwNotImplemented;
646
647
  exportAsIPYNB = throwNotImplemented;
647
648
  exportAsPDF = throwNotImplemented;
648
649
  autoExportAsHTML = throwNotImplemented;