@marimo-team/islands 0.23.11-dev2 → 0.23.11-dev21

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 (42) hide show
  1. package/dist/{ConnectedDataExplorerComponent-Z3RP7Vmm.js → ConnectedDataExplorerComponent-BnPKA-xR.js} +4 -4
  2. package/dist/assets/__vite-browser-external-DAm_YW43.js +1 -0
  3. package/dist/assets/{worker-CC0Oul9k.js → worker-DEDLIQQV.js} +2 -2
  4. package/dist/{chat-ui-c1FdlK-C.js → chat-ui-Bf2NICxi.js} +6 -6
  5. package/dist/{code-visibility-CdW8VWzm.js → code-visibility-DvrnpkbY.js} +8 -8
  6. package/dist/{formats-C4wO47tk.js → formats-BOYEeoL_.js} +1 -1
  7. package/dist/{glide-data-editor-BPkCPs7L.js → glide-data-editor-A_l7_PQZ.js} +2 -2
  8. package/dist/{html-to-image-D5-EpALB.js → html-to-image-BJbLjZyG.js} +6 -6
  9. package/dist/{input-OdWHkobi.js → input-Cn-SZdXY.js} +1 -1
  10. package/dist/main.js +18 -18
  11. package/dist/{mermaid-BotvIKg9.js → mermaid-Br973nIL.js} +2 -2
  12. package/dist/{process-output-WDZE0cyS.js → process-output-Dw_ngzH2.js} +1 -1
  13. package/dist/{reveal-component-cfStduPb.js → reveal-component-BsmfWYqg.js} +5 -5
  14. package/dist/{spec-X7FwLJni.js → spec-f8-xgaui.js} +1 -1
  15. package/dist/style.css +1 -1
  16. package/dist/{toDate-d8RCRrRd.js → toDate-B4-pUFYh.js} +1 -1
  17. package/dist/{useAsyncData-PonK__yh.js → useAsyncData-B3PfqrwD.js} +1 -1
  18. package/dist/{useDeepCompareMemoize-D3NGWke6.js → useDeepCompareMemoize-YInAvJP3.js} +1 -1
  19. package/dist/{useLifecycle-00mO3OSS.js → useLifecycle-B3NOEiY5.js} +1 -1
  20. package/dist/{useTheme-DEhDzATN.js → useTheme-BPeFKs1Q.js} +2 -1
  21. package/dist/{vega-component-DGPUhbDs.js → vega-component-CMicMpWX.js} +5 -5
  22. package/package.json +1 -1
  23. package/src/components/ai/ai-model-dropdown.tsx +6 -0
  24. package/src/components/app-config/ai-config.tsx +73 -55
  25. package/src/components/app-config/data-form.tsx +33 -43
  26. package/src/components/app-config/is-overridden.tsx +125 -58
  27. package/src/components/app-config/user-config-form.tsx +178 -227
  28. package/src/components/chat/chat-panel.tsx +17 -8
  29. package/src/components/datasources/__tests__/column-preview.test.tsx +97 -0
  30. package/src/components/datasources/__tests__/utils.test.ts +127 -2
  31. package/src/components/datasources/column-preview.tsx +2 -4
  32. package/src/components/datasources/datasources.tsx +44 -17
  33. package/src/components/datasources/utils.ts +45 -0
  34. package/src/components/editor/actions/useNotebookActions.tsx +35 -17
  35. package/src/components/editor/connections/components.tsx +13 -0
  36. package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +4 -4
  37. package/src/components/editor/connections/storage/as-code.ts +11 -4
  38. package/src/core/cells/__tests__/cells.test.ts +33 -0
  39. package/src/core/cells/cells.ts +1 -1
  40. package/src/core/config/config-schema.ts +6 -1
  41. package/src/css/md.css +12 -0
  42. package/dist/assets/__vite-browser-external-eshhtsgZ.js +0 -1
@@ -168,6 +168,10 @@ function generateGDriveCode(
168
168
  connection: Extract<StorageConnection, { type: "gdrive" }>,
169
169
  options: { secrets: SecretContainer; isEmbedded?: boolean },
170
170
  ): { imports: Set<string>; code: string } {
171
+ /**
172
+ * Skip instance cache True so you can create multiple connections which don't reference the same creds.
173
+ * Use listings cache False so we don't get stale reads.
174
+ */
171
175
  const { secrets, isEmbedded = false } = options;
172
176
  const imports = new Set(["from gdrive_fsspec import GoogleDriveFileSystem"]);
173
177
 
@@ -179,18 +183,21 @@ function generateGDriveCode(
179
183
  );
180
184
  const code = dedent(`
181
185
  _creds = json.loads("""${connection.credentials_json?.startsWith("ENV:") ? `{${creds}}` : connection.credentials_json}""")
182
- fs = GoogleDriveFileSystem(creds=_creds, token="service_account", use_listings_cache=False)
186
+ fs = GoogleDriveFileSystem(creds=_creds, token="service_account", use_listings_cache=False, skip_instance_cache=True)
183
187
  `);
184
188
  return { imports, code };
185
189
  }
186
190
 
191
+ // In the iframe (embedded) flow we authenticate via the console-based OOB
192
+ // flow, which prints an auth URL and reads the code from stdin. Clear the
193
+ // console afterwards so the (single-use) auth code doesn't linger.
187
194
  const code = isEmbedded
188
195
  ? dedent(`
189
- fs = GoogleDriveFileSystem(use_listings_cache=False, auth_kwargs={"use_local_webserver": False})
190
- print("Google Drive connected! Important: Run this cell again to clear the console")
196
+ fs = GoogleDriveFileSystem(use_listings_cache=False, skip_instance_cache=True, auth_kwargs={"use_local_webserver": False})
197
+ mo.output.clear_console()
191
198
  `)
192
199
  : dedent(`
193
- fs = GoogleDriveFileSystem(use_listings_cache=False)
200
+ fs = GoogleDriveFileSystem(use_listings_cache=False, skip_instance_cache=True)
194
201
  `);
195
202
  return { imports, code };
196
203
  }
@@ -2920,6 +2920,39 @@ describe("cell reducer", () => {
2920
2920
  expect(state.untouchedNewCells.has(newCellId)).toBe(true);
2921
2921
  });
2922
2922
 
2923
+ it("adds interactively-created hidden cell with boilerplate code to untouchedNewCells", () => {
2924
+ // Markdown cells are created with hideCode and non-empty default code
2925
+ // (e.g. `mo.md(r"""\n""")`). They are user-initiated, so their editor
2926
+ // should be shown until first blur.
2927
+ actions.createNewCell({
2928
+ cellId: "__end__",
2929
+ before: false,
2930
+ code: 'mo.md(r"""\n""")',
2931
+ hideCode: true,
2932
+ autoFocus: true,
2933
+ });
2934
+
2935
+ const newCellId =
2936
+ state.cellIds.inOrderIds[state.cellIds.inOrderIds.length - 1];
2937
+ expect(state.untouchedNewCells.has(newCellId)).toBe(true);
2938
+ });
2939
+
2940
+ it("does not add programmatically-created hidden cell with code to untouchedNewCells", () => {
2941
+ // Cells created by the kernel (e.g. via code_mode) carry code and
2942
+ // autoFocus=false; their hide_code must take effect immediately.
2943
+ actions.createNewCell({
2944
+ cellId: "__end__",
2945
+ before: false,
2946
+ code: "x = 1",
2947
+ hideCode: true,
2948
+ autoFocus: false,
2949
+ });
2950
+
2951
+ const newCellId =
2952
+ state.cellIds.inOrderIds[state.cellIds.inOrderIds.length - 1];
2953
+ expect(state.untouchedNewCells.has(newCellId)).toBe(false);
2954
+ });
2955
+
2923
2956
  it("does not add cell to untouchedNewCells when hideCode is false", () => {
2924
2957
  actions.createNewCell({
2925
2958
  cellId: "__end__",
@@ -276,7 +276,7 @@ const {
276
276
  },
277
277
  scrollKey: autoFocus ? newCellId : null,
278
278
  untouchedNewCells:
279
- hideCode && !code
279
+ hideCode && autoFocus
280
280
  ? new Set([...state.untouchedNewCells, newCellId])
281
281
  : state.untouchedNewCells,
282
282
  };
@@ -45,7 +45,12 @@ export const DEFAULT_AI_MODEL = "openai/gpt-4o";
45
45
  const AUTO_DOWNLOAD_FORMATS = ["html", "markdown", "ipynb"] as const;
46
46
 
47
47
  export type CopilotMode = NonNullable<schemas["AiConfig"]["mode"]>;
48
- export const COPILOT_MODES: CopilotMode[] = ["manual", "ask", "agent"];
48
+ export const COPILOT_MODES: CopilotMode[] = [
49
+ "manual",
50
+ "ask",
51
+ "agent",
52
+ "code_mode",
53
+ ];
49
54
 
50
55
  const AiConfigSchema = z
51
56
  .object({
package/src/css/md.css CHANGED
@@ -49,6 +49,18 @@
49
49
  .markdown h6 {
50
50
  font-weight: inherit;
51
51
  font-family: var(--heading-font);
52
+
53
+ /*
54
+ Anchor heading spacing to GitHub's markdown rhythm (Primer): a uniform
55
+ 24px top / 16px bottom margin and 1.25 line-height across every level,
56
+ letting font-size — not margin — carry the hierarchy. Tailwind Typography's
57
+ prose defaults scale heading margins per-level up to ~2em (≈48px on h2),
58
+ which is tuned for long-form articles and reads as too airy in a notebook.
59
+ Ref: https://github.com/sindresorhus/github-markdown-css
60
+ */
61
+ margin-top: 1.5rem;
62
+ margin-bottom: 1rem;
63
+ line-height: 1.25;
52
64
  }
53
65
 
54
66
  .markdown hr {
@@ -1 +0,0 @@
1
- import{t as e}from"./worker-CC0Oul9k.js";var t=e(((e,t)=>{t.exports={}}));export default t();