@marimo-team/islands 0.20.5-dev11 → 0.20.5-dev16

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.
Files changed (150) hide show
  1. package/dist/{Combination-Du-o_hC9.js → Combination-DPrRlMyq.js} +1 -1
  2. package/dist/{ConnectedDataExplorerComponent-DUS-zJoR.js → ConnectedDataExplorerComponent-Bp9TusI-.js} +10 -10
  3. package/dist/{any-language-editor-BL9o7y0_.js → any-language-editor-BGcQxkAL.js} +19 -19
  4. package/dist/{architectureDiagram-VXUJARFQ-DrJeyFHq.js → architectureDiagram-VXUJARFQ-IZt4NuSd.js} +5 -5
  5. package/dist/{blockDiagram-VD42YOAC-BJrP6qKc.js → blockDiagram-VD42YOAC-mhFHC3Ty.js} +5 -5
  6. package/dist/{button-KYalaJYu.js → button-BJaX_M34.js} +8 -3
  7. package/dist/{c4Diagram-YG6GDRKO-Bo4gytQ5.js → c4Diagram-YG6GDRKO-BzStmvfT.js} +4 -4
  8. package/dist/{channel-IWLGkaBE.js → channel-CUFaIkTh.js} +1 -1
  9. package/dist/{check-C50jsehH.js → check-C9c-GtvX.js} +1 -1
  10. package/dist/{chunk-ABZYJK2D-CRwanrkd.js → chunk-ABZYJK2D-7QYXAAhe.js} +1 -1
  11. package/dist/{chunk-ATLVNIR6-CMMCMvOK.js → chunk-ATLVNIR6-pmHPAPSd.js} +1 -1
  12. package/dist/{chunk-B4BG7PRW-BNsHrGHG.js → chunk-B4BG7PRW-C9mfKT9i.js} +4 -4
  13. package/dist/{chunk-DI55MBZ5-DQeYbfMV.js → chunk-DI55MBZ5-IKrK49rX.js} +4 -4
  14. package/dist/{chunk-EXTU4WIE-CV_DQeaX.js → chunk-EXTU4WIE-BRFl4iNd.js} +1 -1
  15. package/dist/{chunk-JA3XYJ7Z-Cmt--e0q.js → chunk-JA3XYJ7Z-C9q_MXZQ.js} +2 -2
  16. package/dist/{chunk-JZLCHNYA-CkyMJnI9.js → chunk-JZLCHNYA-DVjoFib5.js} +4 -4
  17. package/dist/{chunk-N4CR4FBY-BJfHtJbD.js → chunk-N4CR4FBY-BYr5N5mX.js} +5 -5
  18. package/dist/{chunk-QN33PNHL-WOLIPUAJ.js → chunk-QN33PNHL-CXfJywHv.js} +1 -1
  19. package/dist/{chunk-QXUST7PY-DYuD50pU.js → chunk-QXUST7PY-YO0PM8b3.js} +5 -5
  20. package/dist/{chunk-S3R3BYOJ-CsnX6RKs.js → chunk-S3R3BYOJ-DgI4FlvW.js} +1 -1
  21. package/dist/{chunk-TZMSLE5B-B3eYTGCw.js → chunk-TZMSLE5B-DSfBOnzx.js} +1 -1
  22. package/dist/{classDiagram-2ON5EDUG-C7C-oefv.js → classDiagram-2ON5EDUG-CvpnTWzz.js} +10 -10
  23. package/dist/{classDiagram-v2-WZHVMYZB-UTw37Gg8.js → classDiagram-v2-WZHVMYZB-DEQrBHLI.js} +10 -10
  24. package/dist/{copy-oc-FcZzt.js → copy-DhB8Zxuz.js} +2 -2
  25. package/dist/{dagre-6UL2VRFP-BgsUhJrV.js → dagre-6UL2VRFP-DC-emrm5.js} +7 -7
  26. package/dist/{diagram-PSM6KHXK-BIUUOfKo.js → diagram-PSM6KHXK-BAgNlpL8.js} +6 -6
  27. package/dist/{diagram-QEK2KX5R-BFjolZQv.js → diagram-QEK2KX5R-BM7QE5WA.js} +4 -4
  28. package/dist/{diagram-S2PKOQOG-4jfkWoZw.js → diagram-S2PKOQOG-qs4mB1gW.js} +4 -4
  29. package/dist/dist-B4MxkKHf.js +8 -0
  30. package/dist/{dist-De9X_Des.js → dist-B9EjSb9T.js} +1 -1
  31. package/dist/{dist-IW_ARJ3S.js → dist-BFxYppVR.js} +4 -4
  32. package/dist/{dist-D7ZGWV_9.js → dist-BGZ7TWS9.js} +3 -3
  33. package/dist/{dist-CwtEWuFb.js → dist-BSfYc7vq.js} +2 -2
  34. package/dist/{dist-DMS81OrU.js → dist-BUrWeMEP.js} +1 -1
  35. package/dist/dist-BYghZv6b.js +5 -0
  36. package/dist/dist-Be-uQhz5.js +6 -0
  37. package/dist/{dist-Ch_JuCvc.js → dist-BpMlUdNO.js} +3 -3
  38. package/dist/{dist-C6z8U-ms.js → dist-Bq5eYK43.js} +2 -2
  39. package/dist/{dist-BFL9TlzD.js → dist-Bq9zYwJs.js} +5 -5
  40. package/dist/{dist-7ZF--V_D.js → dist-C4K7pumm.js} +2 -2
  41. package/dist/{dist-Qjf6pcqK.js → dist-CAKwXCWI.js} +2 -2
  42. package/dist/dist-CB_xf0ju.js +5 -0
  43. package/dist/{dist-BwQHkjA9.js → dist-CDHl2i1x.js} +4 -4
  44. package/dist/dist-CK0qFAbF.js +8 -0
  45. package/dist/{dist-C4XMUaob.js → dist-CPlGUbk-.js} +2 -2
  46. package/dist/{dist-BT6_J2eq.js → dist-CSEWGuDq.js} +7 -2
  47. package/dist/dist-CYEk-qrr.js +8 -0
  48. package/dist/{dist-CYo3w-nC.js → dist-Cl5iM8xL.js} +3 -3
  49. package/dist/dist-CmKoWpMk.js +5 -0
  50. package/dist/{dist-I8MQW60_.js → dist-CseYuPtL.js} +2 -2
  51. package/dist/dist-D1nf4IQl.js +5 -0
  52. package/dist/{dist-CsqiXw7J.js → dist-D4gcY469.js} +2 -2
  53. package/dist/{dist-DUxS2paD.js → dist-D5NMgbbv.js} +2 -2
  54. package/dist/{dist-UYm1IE5s.js → dist-DERtJN02.js} +2 -2
  55. package/dist/{dist-CFToYDWO.js → dist-DEj2X26M.js} +2 -2
  56. package/dist/{dist-BuapEdlD.js → dist-DOoqn-VL.js} +70 -67
  57. package/dist/{dist-BLThQiU4.js → dist-DUretbKK.js} +2 -2
  58. package/dist/{dist-DEFZ7dnD.js → dist-D_-CGmlh.js} +2 -2
  59. package/dist/dist-Df3AcKpt.js +6 -0
  60. package/dist/dist-DgaFHt_I.js +5 -0
  61. package/dist/dist-Dk10C3ui.js +5 -0
  62. package/dist/{dist-D0f6Yrrb.js → dist-DodLQWPg.js} +1 -1
  63. package/dist/{dist-B8Y11RWn.js → dist-DpeHj-vP.js} +2 -2
  64. package/dist/dist-DtyPVMHR.js +5 -0
  65. package/dist/{dist-Cb3cLT39.js → dist-HoZO6brh.js} +2 -2
  66. package/dist/{dist-Cqpjy6bK.js → dist-RNGn_-uD.js} +1 -1
  67. package/dist/{dist-BBcqvpvP.js → dist-Ux6dL_VB.js} +1 -1
  68. package/dist/{dist-CB6qhQ8K.js → dist-gc9KgJuA.js} +1 -1
  69. package/dist/{dist-ovDpXuSB.js → dist-i-ud9aCA.js} +1 -1
  70. package/dist/dist-ko7WnHAO.js +5 -0
  71. package/dist/{dist-BTQbjEKU.js → dist-lNe4i1Nm.js} +1 -1
  72. package/dist/dist-of7gLRFK.js +8 -0
  73. package/dist/{erDiagram-Q2GNP2WA-Cq5Bz5lG.js → erDiagram-Q2GNP2WA-Dh5nhgY3.js} +10 -10
  74. package/dist/{error-banner-D0tXnwl4.js → error-banner-CJWv_j2x.js} +2 -2
  75. package/dist/{esm-BxMbHo0y.js → esm-DxAOF89q.js} +29 -27
  76. package/dist/{flowDiagram-NV44I4VS-6WPJVFl7.js → flowDiagram-NV44I4VS-ChR1Vbmj.js} +10 -10
  77. package/dist/{ganttDiagram-JELNMOA3-AfDhh9CI.js → ganttDiagram-JELNMOA3-sK0z-5KM.js} +3 -3
  78. package/dist/{gitGraphDiagram-V2S2FVAM-BRSwuj0Q.js → gitGraphDiagram-V2S2FVAM-9S1VqQrL.js} +3 -3
  79. package/dist/{glide-data-editor-ByPNTNVG.js → glide-data-editor-C2dhh3XY.js} +6 -6
  80. package/dist/{infoDiagram-HS3SLOUP-Cmxo6jKx.js → infoDiagram-HS3SLOUP-C5A8b-2O.js} +3 -3
  81. package/dist/{journeyDiagram-XKPGCS4Q-CKYr8cSR.js → journeyDiagram-XKPGCS4Q-D5BIjS4N.js} +3 -3
  82. package/dist/{kanban-definition-3W4ZIXB7-DVvAZzQD.js → kanban-definition-3W4ZIXB7-C1vZZabj.js} +7 -7
  83. package/dist/{label-CV0KYhtH.js → label-kL_UbziI.js} +4 -4
  84. package/dist/{loader-eJCvvApN.js → loader-C6xHQhFz.js} +1 -1
  85. package/dist/main.js +153 -154
  86. package/dist/{mermaid-COOB_abB.js → mermaid-CzRLRASw.js} +41 -41
  87. package/dist/{mindmap-definition-VGOIOE7T-1ExmnvYy.js → mindmap-definition-VGOIOE7T-Cn9_H_5f.js} +9 -9
  88. package/dist/{pieDiagram-ADFJNKIX-CJlIsdsU.js → pieDiagram-ADFJNKIX-iA0mvRW9.js} +4 -4
  89. package/dist/{purify.es-CyOIw8ru.js → purify.es-DGenX2XH.js} +67 -67
  90. package/dist/{quadrantDiagram-AYHSOK5B-BU78RiaH.js → quadrantDiagram-AYHSOK5B-CAcVWXc-.js} +2 -2
  91. package/dist/{requirementDiagram-UZGBJVZJ-DACHtrFr.js → requirementDiagram-UZGBJVZJ-1HxQ6I5Z.js} +9 -9
  92. package/dist/{sankeyDiagram-TZEHDZUN-Bzg7_UWs.js → sankeyDiagram-TZEHDZUN-BVJnR4_b.js} +2 -2
  93. package/dist/{sequenceDiagram-WL72ISMW-agybEe9J.js → sequenceDiagram-WL72ISMW-ByirOtHb.js} +4 -4
  94. package/dist/{slides-component-B0yK5GXP.js → slides-component-D9AVSv2B.js} +2 -2
  95. package/dist/{spec-Dq_reDGM.js → spec-CXpiliig.js} +4 -4
  96. package/dist/{stateDiagram-FKZM4ZOC-DehQAt8g.js → stateDiagram-FKZM4ZOC-DrYNXdQr.js} +10 -10
  97. package/dist/{stateDiagram-v2-4FDKWEC3-8VzeREl9.js → stateDiagram-v2-4FDKWEC3-C9CFKCSr.js} +10 -10
  98. package/dist/style.css +1 -1
  99. package/dist/{timeline-definition-IT6M3QCI-CdCfdaCF.js → timeline-definition-IT6M3QCI-D8B3p7ID.js} +2 -2
  100. package/dist/{tooltip-CL8m4f9y.js → tooltip-CRsmtPeF.js} +3 -3
  101. package/dist/{types-BwnzGcE4.js → types-ChPKdlru.js} +6 -6
  102. package/dist/{useAsyncData-B4hMFGnF.js → useAsyncData-CHYjZCox.js} +1 -1
  103. package/dist/{useDeepCompareMemoize-DuPhOXzr.js → useDeepCompareMemoize-C1YH9SDF.js} +4 -4
  104. package/dist/{useIframeCapabilities-CAt6D2EI.js → useIframeCapabilities-Cc4UBysp.js} +1 -1
  105. package/dist/{useTheme-BNYQnvu-.js → useTheme-B-ZI3PUl.js} +2 -2
  106. package/dist/{vega-component-DouPy8AI.js → vega-component-BX_oDKB3.js} +8 -8
  107. package/dist/{xychartDiagram-PRI3JC2R-rEm_SIsC.js → xychartDiagram-PRI3JC2R-KuxgQuK9.js} +5 -5
  108. package/package.json +1 -1
  109. package/src/__mocks__/requests.ts +1 -0
  110. package/src/components/datasources/components.tsx +3 -6
  111. package/src/components/datasources/datasources.tsx +8 -21
  112. package/src/components/editor/actions/useNotebookActions.tsx +34 -2
  113. package/src/components/editor/controls/keyboard-shortcuts.tsx +3 -1
  114. package/src/components/editor/file-tree/file-explorer.tsx +48 -62
  115. package/src/components/editor/file-tree/file-icons.tsx +132 -0
  116. package/src/components/editor/file-tree/file-viewer.tsx +1 -1
  117. package/src/components/editor/file-tree/tree-actions.tsx +107 -0
  118. package/src/components/editor/file-tree/types.ts +2 -96
  119. package/src/components/editor/header/filename-input.tsx +4 -1
  120. package/src/components/pages/home-page.tsx +5 -5
  121. package/src/components/storage/components.tsx +0 -38
  122. package/src/components/storage/storage-file-viewer.tsx +1 -1
  123. package/src/components/storage/storage-inspector.tsx +28 -45
  124. package/src/core/hotkeys/__tests__/hotkeys.test.ts +64 -1
  125. package/src/core/hotkeys/hotkeys.ts +18 -2
  126. package/src/core/islands/bridge.ts +1 -0
  127. package/src/core/network/__tests__/requests-network.test.ts +17 -0
  128. package/src/core/network/requests-lazy.ts +1 -0
  129. package/src/core/network/requests-network.ts +9 -0
  130. package/src/core/network/requests-static.ts +1 -0
  131. package/src/core/network/requests-toasting.tsx +1 -0
  132. package/src/core/network/types.ts +1 -0
  133. package/src/core/wasm/bridge.ts +1 -0
  134. package/src/plugins/impl/FileBrowserPlugin.tsx +4 -4
  135. package/src/utils/__tests__/filenames.test.ts +7 -0
  136. package/src/utils/filenames.ts +3 -0
  137. package/dist/dist-BAeGo2rp.js +0 -5
  138. package/dist/dist-BqwCMSEa.js +0 -5
  139. package/dist/dist-Bum8FwTO.js +0 -6
  140. package/dist/dist-C0YiOwt_.js +0 -5
  141. package/dist/dist-C2uPv4iU.js +0 -5
  142. package/dist/dist-C5hOLsJN.js +0 -8
  143. package/dist/dist-C9NIAKMs.js +0 -8
  144. package/dist/dist-CCrzTtvk.js +0 -5
  145. package/dist/dist-CFS9i1rS.js +0 -8
  146. package/dist/dist-CyHZuhPH.js +0 -5
  147. package/dist/dist-CzcjWdIk.js +0 -6
  148. package/dist/dist-DaYyUSNC.js +0 -5
  149. package/dist/dist-DpDcJYNh.js +0 -8
  150. package/dist/dist-U_BfxcPn.js +0 -5
@@ -1,6 +1,12 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
  import { describe, expect, it } from "vitest";
3
- import { type Hotkey, type HotkeyAction, HotkeyProvider } from "../hotkeys";
3
+ import {
4
+ type Hotkey,
5
+ type HotkeyAction,
6
+ HotkeyProvider,
7
+ normalizeKeyString,
8
+ OverridingHotkeyProvider,
9
+ } from "../hotkeys";
4
10
 
5
11
  /**
6
12
  * Just a helper.
@@ -72,3 +78,60 @@ describe("HotkeyProvider platform separation", () => {
72
78
  expect(linux.getHotkey("cell.format").key).toBe("Ctrl-Shift-L");
73
79
  });
74
80
  });
81
+
82
+ describe("normalizeKeyString", () => {
83
+ it("should capitalize multi-character base key names", () => {
84
+ expect(normalizeKeyString("Shift-enter")).toBe("Shift-Enter");
85
+ expect(normalizeKeyString("Cmd-enter")).toBe("Cmd-Enter");
86
+ expect(normalizeKeyString("Ctrl-backspace")).toBe("Ctrl-Backspace");
87
+ expect(normalizeKeyString("Alt-tab")).toBe("Alt-Tab");
88
+ expect(normalizeKeyString("Cmd-Shift-arrowUp")).toBe("Cmd-Shift-ArrowUp");
89
+ });
90
+
91
+ it("should leave already-correct key names unchanged", () => {
92
+ expect(normalizeKeyString("Shift-Enter")).toBe("Shift-Enter");
93
+ expect(normalizeKeyString("Cmd-Enter")).toBe("Cmd-Enter");
94
+ expect(normalizeKeyString("Mod-Shift-Enter")).toBe("Mod-Shift-Enter");
95
+ });
96
+
97
+ it("should leave single-character keys unchanged", () => {
98
+ expect(normalizeKeyString("Cmd-a")).toBe("Cmd-a");
99
+ expect(normalizeKeyString("Ctrl-Shift-z")).toBe("Ctrl-Shift-z");
100
+ expect(normalizeKeyString("a")).toBe("a");
101
+ });
102
+
103
+ it("should handle keys without modifiers", () => {
104
+ expect(normalizeKeyString("enter")).toBe("Enter");
105
+ expect(normalizeKeyString("Escape")).toBe("Escape");
106
+ expect(normalizeKeyString("F12")).toBe("F12");
107
+ });
108
+ });
109
+
110
+ describe("OverridingHotkeyProvider", () => {
111
+ it("should normalize lowercase key overrides", () => {
112
+ const provider = new OverridingHotkeyProvider(
113
+ {
114
+ "cell.run": "Shift-enter",
115
+ "cell.runAndNewBelow": "Cmd-enter",
116
+ },
117
+ { platform: "mac" },
118
+ );
119
+
120
+ expect(provider.getHotkey("cell.run").key).toBe("Shift-Enter");
121
+ expect(provider.getHotkey("cell.runAndNewBelow").key).toBe("Cmd-Enter");
122
+ });
123
+
124
+ it("should return defaults when no override is set", () => {
125
+ const provider = new OverridingHotkeyProvider({}, { platform: "mac" });
126
+ expect(provider.getHotkey("cell.run").key).toBe("Cmd-Enter");
127
+ expect(provider.getHotkey("cell.runAndNewBelow").key).toBe("Shift-Enter");
128
+ });
129
+
130
+ it("should pass through correctly-cased overrides unchanged", () => {
131
+ const provider = new OverridingHotkeyProvider(
132
+ { "cell.run": "Shift-Enter" },
133
+ { platform: "mac" },
134
+ );
135
+ expect(provider.getHotkey("cell.run").key).toBe("Shift-Enter");
136
+ });
137
+ });
@@ -535,10 +535,26 @@ export class OverridingHotkeyProvider extends HotkeyProvider {
535
535
 
536
536
  override getHotkey(action: HotkeyAction): ResolvedHotkey {
537
537
  const base = super.getHotkey(action);
538
- const key = this.overrides[action] || base.key;
538
+ const override = this.overrides[action];
539
539
  return {
540
540
  name: base.name,
541
- key,
541
+ key: override ? normalizeKeyString(override) : base.key,
542
542
  };
543
543
  }
544
544
  }
545
+
546
+ const MODIFIER_RE = /^(cmd|ctrl|alt|shift|meta|mod)$/i;
547
+
548
+ /**
549
+ * Capitalize multi-character base key names so they match the
550
+ * casing that KeyboardEvent.key (and therefore CodeMirror) uses.
551
+ * e.g. "Shift-enter" → "Shift-Enter", "Cmd-backspace" → "Cmd-Backspace"
552
+ */
553
+ export function normalizeKeyString(key: string): string {
554
+ const parts = key.split("-");
555
+ const last = parts[parts.length - 1];
556
+ if (last.length > 1 && !MODIFIER_RE.test(last)) {
557
+ parts[parts.length - 1] = last.charAt(0).toUpperCase() + last.slice(1);
558
+ }
559
+ return parts.join("-");
560
+ }
@@ -181,6 +181,7 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
181
181
  sendFileDetails = throwNotImplemented;
182
182
  openTutorial = throwNotImplemented;
183
183
  exportAsHTML = throwNotImplemented;
184
+ exportAsIPYNB = throwNotImplemented;
184
185
  exportAsMarkdown = throwNotImplemented;
185
186
  exportAsPDF = throwNotImplemented;
186
187
  autoExportAsHTML = throwNotImplemented;
@@ -113,5 +113,22 @@ describe("createNetworkRequests", () => {
113
113
  }),
114
114
  );
115
115
  });
116
+
117
+ it("exportAsIPYNB should call the new endpoint as text", async () => {
118
+ const requests = createNetworkRequests();
119
+ await requests.exportAsIPYNB({
120
+ download: false,
121
+ } as any);
122
+
123
+ expect(mockClient.POST).toHaveBeenCalledWith(
124
+ "/api/export/ipynb",
125
+ expect.objectContaining({
126
+ body: expect.objectContaining({
127
+ download: false,
128
+ }),
129
+ parseAs: "text",
130
+ }),
131
+ );
132
+ });
116
133
  });
117
134
  });
@@ -49,6 +49,7 @@ const ACTIONS: Record<keyof AllRequests, Action> = {
49
49
 
50
50
  // Export operations start a connection
51
51
  exportAsHTML: "startConnection",
52
+ exportAsIPYNB: "startConnection",
52
53
  exportAsMarkdown: "startConnection",
53
54
  exportAsPDF: "startConnection",
54
55
  readCode: "startConnection",
@@ -381,6 +381,15 @@ export function createNetworkRequests(): EditRequests & RunRequests {
381
381
  })
382
382
  .then(handleResponse);
383
383
  },
384
+ exportAsIPYNB: async (request) => {
385
+ return getClient()
386
+ .POST("/api/export/ipynb", {
387
+ body: request,
388
+ parseAs: "text",
389
+ params: getParams(),
390
+ })
391
+ .then(handleResponse);
392
+ },
384
393
  exportAsPDF: async (request) => {
385
394
  return getClient()
386
395
  .POST("/api/export/pdf", {
@@ -75,6 +75,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
75
75
  getRunningNotebooks: throwNotInEditMode,
76
76
  shutdownSession: throwNotInEditMode,
77
77
  exportAsHTML: throwNotInEditMode,
78
+ exportAsIPYNB: throwNotInEditMode,
78
79
  exportAsMarkdown: throwNotInEditMode,
79
80
  exportAsPDF: throwNotInEditMode,
80
81
  autoExportAsHTML: throwNotInEditMode,
@@ -60,6 +60,7 @@ export function createErrorToastingRequests(
60
60
  getRunningNotebooks: "Failed to get running notebooks",
61
61
  shutdownSession: "Failed to shutdown session",
62
62
  exportAsHTML: "Failed to export HTML",
63
+ exportAsIPYNB: "Failed to export ipynb",
63
64
  exportAsMarkdown: "Failed to export Markdown",
64
65
  exportAsPDF: "Failed to export PDF",
65
66
  autoExportAsHTML: "", // No toast
@@ -180,6 +180,7 @@ export interface EditRequests {
180
180
  ) => Promise<RunningNotebooksResponse>;
181
181
  // Export requests
182
182
  exportAsHTML: (request: ExportAsHTMLRequest) => Promise<string>;
183
+ exportAsIPYNB: (request: ExportAsIPYNBRequest) => Promise<string>;
183
184
  exportAsMarkdown: (request: ExportAsMarkdownRequest) => Promise<string>;
184
185
  exportAsPDF: (request: ExportAsPDFRequest) => Promise<Blob>;
185
186
  autoExportAsHTML: (request: ExportAsHTMLRequest) => Promise<null>;
@@ -587,6 +587,7 @@ export class PyodideBridge implements RunRequests, EditRequests {
587
587
  getWorkspaceFiles = throwNotImplemented;
588
588
  getRunningNotebooks = throwNotImplemented;
589
589
  shutdownSession = throwNotImplemented;
590
+ exportAsIPYNB = throwNotImplemented;
590
591
  exportAsPDF = throwNotImplemented;
591
592
  autoExportAsHTML = throwNotImplemented;
592
593
  autoExportAsMarkdown = throwNotImplemented;
@@ -4,10 +4,10 @@ import { CornerLeftUp } from "lucide-react";
4
4
  import { type JSX, useEffect, useState } from "react";
5
5
  import { z } from "zod";
6
6
  import {
7
- FILE_TYPE_ICONS,
8
- type FileType,
9
- guessFileType,
10
- } from "@/components/editor/file-tree/types";
7
+ FILE_ICON as FILE_TYPE_ICONS,
8
+ type FileIconType as FileType,
9
+ guessFileIconType as guessFileType,
10
+ } from "@/components/editor/file-tree/file-icons";
11
11
  import { Spinner } from "@/components/icons/spinner";
12
12
  import { Button } from "@/components/ui/button";
13
13
  import { Checkbox } from "@/components/ui/checkbox";
@@ -23,6 +23,12 @@ describe("Filenames", () => {
23
23
  expect(Filenames.toPNG("test.foo.py")).toEqual("test.foo.png");
24
24
  });
25
25
 
26
+ it("should convert filename to ipynb", () => {
27
+ expect(Filenames.toIPYNB("test")).toEqual("test.ipynb");
28
+ expect(Filenames.toIPYNB("test.txt")).toEqual("test.ipynb");
29
+ expect(Filenames.toIPYNB("test.foo.py")).toEqual("test.foo.ipynb");
30
+ });
31
+
26
32
  it("should remove extension from filename", () => {
27
33
  expect(Filenames.withoutExtension("test")).toEqual("test");
28
34
  expect(Filenames.withoutExtension("test.txt")).toEqual("test");
@@ -39,6 +45,7 @@ describe("Filenames", () => {
39
45
  expect(Filenames.toHTML(filename)).toEqual(`${withoutExt}.html`);
40
46
  expect(Filenames.toPNG(filename)).toEqual(`${withoutExt}.png`);
41
47
  expect(Filenames.toPY(filename)).toEqual(`${withoutExt}.py`);
48
+ expect(Filenames.toIPYNB(filename)).toEqual(`${withoutExt}.ipynb`);
42
49
 
43
50
  // Ensure operations preserve unicode and special characters in base name
44
51
  expect(withoutExt).not.toEqual("");
@@ -15,6 +15,9 @@ export const Filenames = {
15
15
  toPY: (filename: string): string => {
16
16
  return Filenames.replace(filename, "py");
17
17
  },
18
+ toIPYNB: (filename: string): string => {
19
+ return Filenames.replace(filename, "ipynb");
20
+ },
18
21
  withoutExtension: (filename: string): string => {
19
22
  // Just remove the last extension
20
23
  const parts = filename.split(".");
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { i as pythonLanguage, n as localCompletionSource, r as python, t as globalCompletion } from "./dist-7ZF--V_D.js";
3
- export {
4
- python
5
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { n as rustLanguage, t as rust } from "./dist-ovDpXuSB.js";
3
- export {
4
- rust
5
- };
@@ -1,6 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import "./dist-BBcqvpvP.js";
3
- import { n as sassCompletionSource, r as sassLanguage, t as sass } from "./dist-Qjf6pcqK.js";
4
- export {
5
- sass
6
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { n as cppLanguage, t as cpp } from "./dist-BTQbjEKU.js";
3
- export {
4
- cpp
5
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { n as yamlLanguage, t as yaml } from "./dist-D0f6Yrrb.js";
3
- export {
4
- yaml
5
- };
@@ -1,8 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import "./dist-Ch_JuCvc.js";
3
- import "./dist-BBcqvpvP.js";
4
- import "./dist-CsqiXw7J.js";
5
- import { n as phpLanguage, t as php } from "./dist-CFToYDWO.js";
6
- export {
7
- php
8
- };
@@ -1,8 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import "./dist-Ch_JuCvc.js";
3
- import "./dist-BBcqvpvP.js";
4
- import "./dist-CsqiXw7J.js";
5
- import { i as jinjaLanguage, n as jinja, r as jinjaCompletionSource, t as closePercentBrace } from "./dist-I8MQW60_.js";
6
- export {
7
- jinja
8
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { i as defineCSSCompletionSource, n as cssCompletionSource, r as cssLanguage, t as css } from "./dist-BBcqvpvP.js";
3
- export {
4
- css
5
- };
@@ -1,8 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import "./dist-Ch_JuCvc.js";
3
- import "./dist-BBcqvpvP.js";
4
- import "./dist-CsqiXw7J.js";
5
- import { i as liquidLanguage, n as liquid, r as liquidCompletionSource, t as closePercentBrace } from "./dist-BLThQiU4.js";
6
- export {
7
- liquid
8
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { n as javaLanguage, t as java } from "./dist-De9X_Des.js";
3
- export {
4
- java
5
- };
@@ -1,6 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import "./dist-BBcqvpvP.js";
3
- import { n as lessCompletionSource, r as lessLanguage, t as less } from "./dist-DEFZ7dnD.js";
4
- export {
5
- less
6
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { n as wastLanguage, t as wast } from "./dist-Cqpjy6bK.js";
3
- export {
4
- wast
5
- };
@@ -1,8 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import "./dist-Ch_JuCvc.js";
3
- import "./dist-BBcqvpvP.js";
4
- import "./dist-CsqiXw7J.js";
5
- import { n as vueLanguage, t as vue } from "./dist-CYo3w-nC.js";
6
- export {
7
- vue
8
- };
@@ -1,5 +0,0 @@
1
- import "./dist-BuapEdlD.js";
2
- import { n as jsonLanguage, t as json } from "./dist-CB6qhQ8K.js";
3
- export {
4
- json
5
- };