@marimo-team/islands 0.25.3-dev229 → 0.25.3-dev230

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 (77) hide show
  1. package/dist/{ConnectedDataExplorerComponent-D6RHJV8D.js → ConnectedDataExplorerComponent-BBihxHrr.js} +1 -1
  2. package/dist/{ErrorBoundary-rKC9yArn.js → ErrorBoundary-DZwEkAT6.js} +1 -1
  3. package/dist/_baseSet-BfI5FjBM.js +328 -0
  4. package/dist/{abnfDiagram-VCTEODGH-0q7Lbmii.js → abnfDiagram-VCTEODGH-DBcJVxYP.js} +2 -2
  5. package/dist/{architectureDiagram-5GKGNRK7-1PydKPmE.js → architectureDiagram-5GKGNRK7-BcHZXF4S.js} +1 -1
  6. package/dist/assets/__vite-browser-external-BKBpimif.js +1 -0
  7. package/dist/assets/worker-CgoMtD-_.js +113 -0
  8. package/dist/{blockDiagram-I7D4REHJ-Cg25UrxT.js → blockDiagram-I7D4REHJ-Dkhe6_PP.js} +1 -1
  9. package/dist/{chat-ui-B5pH_aXk.js → chat-ui-DljFsfWf.js} +7 -7
  10. package/dist/{chunk-IMKFNOWR-DEzZZ1Zc.js → chunk-IMKFNOWR-CTZlwBAA.js} +1 -1
  11. package/dist/{chunk-SHT3W25Y-CuHj-hnn.js → chunk-SHT3W25Y-53g_RZHm.js} +1 -1
  12. package/dist/{chunk-SVP7TREG-BPiZK2bA.js → chunk-SVP7TREG-P6abNGV_.js} +1 -1
  13. package/dist/{chunk-TICWLB2K-DF6XcIjM.js → chunk-TICWLB2K-BTJJqkyF.js} +1 -1
  14. package/dist/{classDiagram-ZZMXUADV-CMdR-cP4.js → classDiagram-ZZMXUADV-BUGqOrTm.js} +2 -2
  15. package/dist/{classDiagram-v2-VYDZK3BY-DRvc3_7Y.js → classDiagram-v2-VYDZK3BY-CXpQvO-s.js} +2 -2
  16. package/dist/{code-visibility-DnkuQH_A.js → code-visibility-BOmgV0Fh.js} +1 -1
  17. package/dist/{common-NO85mPjz.js → common-DdHcuklD.js} +5 -5
  18. package/dist/{cynefinDiagram-5FMLGOSQ-BkBjEY9l.js → cynefinDiagram-5FMLGOSQ-DOcnl8wW.js} +1 -1
  19. package/dist/{dagre-GXQ25YYZ-D-HEaW4I.js → dagre-GXQ25YYZ-CuHR9QfG.js} +3 -3
  20. package/dist/{dagre-BGSfXNEb.js → dagre-mqiMAsFY.js} +531 -680
  21. package/dist/{data-grid-overlay-editor-CNIWdzOi.js → data-grid-overlay-editor-Dxdsrndd.js} +1 -1
  22. package/dist/{debounce-C3jyATpc.js → debounce-DrhhziJv.js} +2 -2
  23. package/dist/{diagram-S7CK7UJ4-Bn-oF-rB.js → diagram-S7CK7UJ4-BPiG4kso.js} +1 -1
  24. package/dist/{diagram-UQ7AKVKN-BpzzXWBj.js → diagram-UQ7AKVKN-_piBOvOC.js} +1 -1
  25. package/dist/{diagram-VX7I27RA-COOtvfBP.js → diagram-VX7I27RA-DCzVeJ8M.js} +1 -1
  26. package/dist/{diagram-Z3DM3KII-K5cXvbrl.js → diagram-Z3DM3KII-D64CF1jQ.js} +1 -1
  27. package/dist/{dropdown-menu-CSNdPSnS.js → dropdown-menu-BRiE7Vnp.js} +1 -1
  28. package/dist/{ebnfDiagram-PWID7BFC-BI1ZmjVm.js → ebnfDiagram-PWID7BFC-BapQPML-.js} +2 -2
  29. package/dist/{erDiagram-RLTQ6QDP-BtWjj9xy.js → erDiagram-RLTQ6QDP-CNQvC2_Q.js} +1 -1
  30. package/dist/{feedback-button-DUaPYY5P.js → feedback-button-bkhTNCeV.js} +2 -2
  31. package/dist/{flowDiagram-HODETNUW-DQvZh96A.js → flowDiagram-HODETNUW-BBt6S6oe.js} +2 -2
  32. package/dist/{glide-data-editor-BEQyuNam.js → glide-data-editor-Cd5G4gkf.js} +5 -5
  33. package/dist/{globals-C7_yz0_W.js → globals-Cm5hDd9R.js} +1 -1
  34. package/dist/{graphlib-BmY_CCV9.js → graphlib-nlwT3Wvy.js} +177 -220
  35. package/dist/hasIn-C20JsQ2m.js +28 -0
  36. package/dist/{html-to-image-CgAnxFi8.js → html-to-image-0FooaKop.js} +3 -3
  37. package/dist/{infoDiagram-27XIBGKW-BdAObnc_.js → infoDiagram-27XIBGKW-Hd8Ifz82.js} +1 -1
  38. package/dist/isArrayLikeObject-B-HXCsex.js +626 -0
  39. package/dist/isEmpty-CdX7MTE1.js +14 -0
  40. package/dist/{ishikawaDiagram-5VMMS53U-DP-jE8dw.js → ishikawaDiagram-5VMMS53U-CP7hnHWx.js} +1 -1
  41. package/dist/{kanban-definition-UXKFOSKX-BkMgPjfm.js → kanban-definition-UXKFOSKX-CX91sa9b.js} +1 -1
  42. package/dist/main.js +4378 -4383
  43. package/dist/{mermaid-B-OFqheA.js → mermaid-Djb3Ni9t.js} +35 -35
  44. package/dist/{mindmap-definition-YA3MSWOX-Du7toAZX.js → mindmap-definition-YA3MSWOX-DgCNo07O.js} +1 -1
  45. package/dist/{now-jM8-M7IR.js → now-BKZCLE5P.js} +12 -13
  46. package/dist/{number-overlay-editor-CxD6RVI0.js → number-overlay-editor-BLCXOIUf.js} +1 -1
  47. package/dist/{pegDiagram-XKGWAZYB-CX_729j0.js → pegDiagram-XKGWAZYB-SGJhnIKo.js} +2 -2
  48. package/dist/pick-tCszMUbm.js +35 -0
  49. package/dist/{pieDiagram-E7YTZNPT-dtTFJcVI.js → pieDiagram-E7YTZNPT-1stXIWCQ.js} +1 -1
  50. package/dist/{process-output-Bmev5azU.js → process-output-BOvkTEDt.js} +1 -1
  51. package/dist/{railroadDiagram-O6MQD6OU-Dsc2Cf4c.js → railroadDiagram-O6MQD6OU-DY1mojzB.js} +2 -2
  52. package/dist/{requirementDiagram-BXWQKSXE-D3g0c60I.js → requirementDiagram-BXWQKSXE-gHzhUp0D.js} +1 -1
  53. package/dist/{reveal-component-B5nxUa8N.js → reveal-component-BcLwP52P.js} +3 -3
  54. package/dist/{sequenceDiagram-WJ2MYXX4-w1pWbIpk.js → sequenceDiagram-WJ2MYXX4-rjPtD9fB.js} +1 -1
  55. package/dist/{stateDiagram-D77RDMKH-BCv7kP4H.js → stateDiagram-D77RDMKH-DMNxjUxV.js} +4 -4
  56. package/dist/{stateDiagram-v2-MP3YSRHH-D1cTOt0x.js → stateDiagram-v2-MP3YSRHH-CumAaqGo.js} +2 -2
  57. package/dist/{swimlanes-42K2YHIH-DNO6jDnd.js → swimlanes-42K2YHIH-BU14_Tej.js} +1 -1
  58. package/dist/{swimlanesDiagram-VR7AAH4N-CkSWsxYJ.js → swimlanesDiagram-VR7AAH4N-CieAnPqJ.js} +2 -2
  59. package/dist/{timeline-definition-24CTP7MA-DQvqGFM9.js → timeline-definition-24CTP7MA-CrVj4E1K.js} +1 -1
  60. package/dist/useTheme-DgOLVISn.js +337 -0
  61. package/dist/{vega-component-9NOEITbg.js → vega-component-Bwg_Kuh-.js} +2 -2
  62. package/dist/{vennDiagram-4TSXK5OY-BfzXp4SH.js → vennDiagram-4TSXK5OY-ZLxQ8yhm.js} +1 -1
  63. package/dist/{wardleyDiagram-VM6X3IG4-CiqEE8eq.js → wardleyDiagram-VM6X3IG4-D88pcLY1.js} +1 -1
  64. package/dist/{xychartDiagram-S5SC5T6Z-BTIHCVOI.js → xychartDiagram-S5SC5T6Z-_13d4g8g.js} +1 -1
  65. package/package.json +1 -1
  66. package/src/core/config/__tests__/config-schema.test.ts +43 -0
  67. package/src/core/config/config-schema.ts +4 -0
  68. package/src/core/config/config.ts +39 -8
  69. package/dist/_baseMerge-BiGRwuqv.js +0 -165
  70. package/dist/assets/__vite-browser-external-CBRgnYY0.js +0 -1
  71. package/dist/assets/worker-DiPNP__U.js +0 -113
  72. package/dist/hasIn-o2Us0uVx.js +0 -132
  73. package/dist/isArrayLikeObject-BZl-15ir.js +0 -450
  74. package/dist/isEmpty-BSZ1LaUo.js +0 -35
  75. package/dist/isSymbol-kQcfYbNX.js +0 -8
  76. package/dist/pick-CJeoxYOS.js +0 -51
  77. package/dist/useTheme-B9C1JIy9.js +0 -307
@@ -0,0 +1,337 @@
1
+ import { g as e, i as t, o as n } from "./button-B6RjDKJx.js";
2
+ import { t as r } from "./compiler-runtime-CldRdSsv.js";
3
+ import { m as i } from "./isArrayLikeObject-B-HXCsex.js";
4
+ import { a, i as o, n as s, r as c, s as ee, t as l } from "./_baseSet-BfI5FjBM.js";
5
+ import { S as te, _ as ne, f as re, i as ie, l as u, s as d, t as f, w as p, x as m } from "./utils-DXkj82sK.js";
6
+ import { C as h, F as g, I as _, M as v, N as y, R as ae, S as b, k as x, v as S } from "./schemas-CdscWNy_.js";
7
+ //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/mergeWith.js
8
+ var C = ee(function(e, t, n, r) {
9
+ c(e, t, n, r);
10
+ });
11
+ //#endregion
12
+ //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/set.js
13
+ function w(e, t, n) {
14
+ return e == null ? e : l(e, t, n);
15
+ }
16
+ //#endregion
17
+ //#region src/core/config/config-schema.ts
18
+ var T = r(), oe = [
19
+ "pip",
20
+ "uv",
21
+ "rye",
22
+ "poetry",
23
+ "pixi"
24
+ ], E = [
25
+ "normal",
26
+ "compact",
27
+ "medium",
28
+ "full",
29
+ "columns"
30
+ ], D = [
31
+ "auto",
32
+ "native",
33
+ "polars",
34
+ "lazy-polars",
35
+ "pandas"
36
+ ], O = [
37
+ "html",
38
+ "markdown",
39
+ "ipynb"
40
+ ], k = ["off", "jedi"], A = [
41
+ "manual",
42
+ "ask",
43
+ "agent",
44
+ "code_mode"
45
+ ], j = y({
46
+ api_key: _().optional(),
47
+ base_url: _().optional(),
48
+ project: _().optional()
49
+ }).loose(), M = y({
50
+ chat_model: _().nullish(),
51
+ edit_model: _().nullish(),
52
+ autocomplete_model: _().nullish(),
53
+ displayed_models: b(_()).default([]),
54
+ custom_models: b(_()).default([])
55
+ }), N = x({
56
+ completion: y({
57
+ activate_on_typing: h().prefault(!0),
58
+ signature_hint_on_typing: h().prefault(!1),
59
+ auto_close_pairs: h().prefault(!0),
60
+ copilot: ae([h(), S([
61
+ "github",
62
+ "codeium",
63
+ "custom"
64
+ ])]).prefault(!1).transform((e) => e === !0 ? "github" : e),
65
+ codeium_api_key: _().nullish()
66
+ }).prefault({}),
67
+ save: x({
68
+ autosave: S(["off", "after_delay"]).prefault("after_delay"),
69
+ autosave_delay: v().nonnegative().transform((e) => Math.max(e, 1e3)).prefault(1e3),
70
+ format_on_save: h().prefault(!1)
71
+ }).prefault({}),
72
+ formatting: x({
73
+ line_length: v().nonnegative().prefault(79).transform((e) => Math.min(e, 1e3)),
74
+ infer_types: S(k).prefault("off")
75
+ }).prefault({}),
76
+ keymap: x({
77
+ preset: S(["default", "vim"]).prefault("default"),
78
+ overrides: g(_(), _()).prefault({}),
79
+ destructive_delete: h().prefault(!0)
80
+ }).prefault({}),
81
+ runtime: x({
82
+ auto_instantiate: h().prefault(!0),
83
+ on_cell_change: S(["lazy", "autorun"]).prefault("autorun"),
84
+ auto_reload: S([
85
+ "off",
86
+ "lazy",
87
+ "autorun"
88
+ ]).prefault("off"),
89
+ reactive_tests: h().prefault(!0),
90
+ watcher_on_save: S(["lazy", "autorun"]).prefault("lazy"),
91
+ sql_default_limit: v().int().nullable().optional(),
92
+ default_sql_output: S(D).prefault("auto"),
93
+ default_auto_download: b(S(O)).prefault([]),
94
+ show_tracebacks: h().prefault(!1)
95
+ }).prefault({}),
96
+ display: x({
97
+ theme: S([
98
+ "light",
99
+ "dark",
100
+ "system"
101
+ ]).prefault("light"),
102
+ code_editor_font_size: v().nonnegative().prefault(14),
103
+ cell_output: S(["above", "below"]).prefault("below"),
104
+ dataframes: S(["rich", "plain"]).prefault("rich"),
105
+ default_table_page_size: v().prefault(10),
106
+ default_table_max_columns: v().prefault(50),
107
+ default_width: S(E).prefault("medium").transform((e) => e === "normal" ? "compact" : e),
108
+ locale: _().nullable().optional(),
109
+ reference_highlighting: h().prefault(!0),
110
+ code_lens: h().prefault(!0)
111
+ }).prefault({}),
112
+ package_management: x({ manager: S(oe).prefault("pip") }).prefault({}),
113
+ ai: x({
114
+ enabled: h().prefault(!0),
115
+ rules: _().prefault(""),
116
+ max_tokens: v().int().positive().nullable().optional(),
117
+ mode: S(A).transform((e) => e === "manual" ? "ask" : e).prefault("ask"),
118
+ inline_tooltip: h().prefault(!1),
119
+ allow_provider_config: h().prefault(!0),
120
+ open_ai: j.optional(),
121
+ github: j.optional(),
122
+ anthropic: j.optional(),
123
+ google: j.optional(),
124
+ ollama: j.optional(),
125
+ openrouter: j.optional(),
126
+ wandb: j.optional(),
127
+ opencode_go: j.optional(),
128
+ open_ai_compatible: j.optional(),
129
+ azure: j.optional(),
130
+ bedrock: x({
131
+ region_name: _().optional(),
132
+ profile_name: _().optional(),
133
+ aws_access_key_id: _().optional(),
134
+ aws_secret_access_key: _().optional()
135
+ }).optional(),
136
+ custom_providers: g(_(), j).prefault({}),
137
+ models: M.prefault({
138
+ displayed_models: [],
139
+ custom_models: []
140
+ })
141
+ }).prefault({}),
142
+ experimental: x({ markdown: h().optional() }).prefault(() => ({})),
143
+ server: x({
144
+ skip_update_check: h().optional(),
145
+ session_cookie_secure: h().optional(),
146
+ session_secret: _().optional(),
147
+ disable_file_downloads: h().optional(),
148
+ transport: S(["websocket", "sse"]).optional()
149
+ }).prefault(() => ({})),
150
+ diagnostics: x({
151
+ enabled: h().optional(),
152
+ sql_linter: h().optional()
153
+ }).prefault(() => ({})),
154
+ file_browser: x({ folders: b(y({
155
+ path: _(),
156
+ name: _().optional()
157
+ })).optional() }).optional().prefault({}),
158
+ sharing: x({
159
+ html: h().optional(),
160
+ wasm: h().optional(),
161
+ molab: h().optional()
162
+ }).optional(),
163
+ mcp: x({ presets: b(S(["marimo", "context7"])).optional() }).optional().prefault({})
164
+ }).partial().prefault(() => ({
165
+ completion: {},
166
+ save: {},
167
+ formatting: {},
168
+ keymap: {},
169
+ runtime: {},
170
+ display: {},
171
+ diagnostics: {},
172
+ file_browser: {},
173
+ experimental: {},
174
+ server: {},
175
+ ai: {},
176
+ package_management: {},
177
+ mcp: {}
178
+ })), P = _(), F = S(D).prefault("auto"), I = y({
179
+ width: S(E).prefault("compact").transform((e) => e === "normal" ? "compact" : e),
180
+ app_title: P.nullish(),
181
+ css_file: _().nullish(),
182
+ html_head_file: _().nullish(),
183
+ auto_download: b(S(O)).prefault([]),
184
+ sql_output: F
185
+ }).prefault(() => ({
186
+ width: "compact",
187
+ auto_download: [],
188
+ sql_output: "auto"
189
+ }));
190
+ function L(t) {
191
+ try {
192
+ return I.parse(t);
193
+ } catch (t) {
194
+ return e.error(`Marimo got an unexpected value in the configuration file: ${t}`), I.parse({});
195
+ }
196
+ }
197
+ function R() {
198
+ return N.parse({
199
+ completion: {},
200
+ save: {},
201
+ formatting: {},
202
+ keymap: {},
203
+ runtime: {},
204
+ display: {},
205
+ diagnostics: {},
206
+ file_browser: {},
207
+ experimental: {},
208
+ server: {},
209
+ ai: {},
210
+ package_management: {},
211
+ mcp: {}
212
+ });
213
+ }
214
+ //#endregion
215
+ //#region src/core/config/config.ts
216
+ function z(...e) {
217
+ let t = {};
218
+ for (let n of e) {
219
+ let e = [
220
+ "keymap.overrides",
221
+ "ai.custom_providers",
222
+ "signing.trusted_signers"
223
+ ].filter((e) => s(n, e)).map((e) => {
224
+ let r = i(t, e), o = i(n, e);
225
+ return {
226
+ path: e,
227
+ value: e !== "keymap.overrides" && a(o) ? Object.fromEntries(Object.entries(o).map(([e, t]) => [e, a(r?.[e]) && a(t) ? {
228
+ ...r[e],
229
+ ...t
230
+ } : t])) : o
231
+ };
232
+ });
233
+ C(t, n, (e, t) => Array.isArray(t) ? [...t] : void 0);
234
+ for (let { path: n, value: r } of e) w(t, n, o(r));
235
+ }
236
+ return t;
237
+ }
238
+ var B = p(R()), V = p({}), H = p((e) => {
239
+ let t = e(V);
240
+ return z(e(B), t);
241
+ }), U = p((e) => e(H).runtime.auto_instantiate), se = p((e) => e(H).keymap.overrides ?? {}), W = p(n());
242
+ p((e) => {
243
+ let n = e(se), r = e(W);
244
+ return new t(n, { platform: r });
245
+ }), p((e) => e(H).save), p((e) => e(H).server.transport === "sse" ? "sse" : "websocket"), p((e) => e(H).ai), p((e) => e(H).completion), p((e) => e(H).keymap.preset);
246
+ function G() {
247
+ let e = (0, T.c)(3), t = m(H), n = te(B), r;
248
+ return e[0] !== t || e[1] !== n ? (r = [t, n], e[0] = t, e[1] = n, e[2] = r) : r = e[2], r;
249
+ }
250
+ function K() {
251
+ return u.get(H);
252
+ }
253
+ p((e) => q(e(H)));
254
+ var ce = p((e) => J(e(H))), le = p((e) => de(e(H)));
255
+ p((e) => e(H).display.code_editor_font_size);
256
+ var ue = p((e) => e(H).display.locale);
257
+ function q(e) {
258
+ return e.ai?.enabled !== !1;
259
+ }
260
+ function J(e) {
261
+ return !!e.ai?.models?.chat_model || !!e.ai?.models?.edit_model || !!e.ai?.models?.autocomplete_model;
262
+ }
263
+ function de(e) {
264
+ return q(e) && J(e);
265
+ }
266
+ var fe = p({}), pe = ne(p((e) => e(d)?.revision.app_config ?? e(fe)), (e) => e, re), Y = p((e) => L(e(pe)));
267
+ p((e) => e(Y).width), p((e) => {
268
+ let t = e(H), n = t.snippets?.custom_paths ?? [], r = t.snippets?.include_default_snippets;
269
+ return n.length > 0 || r === !0;
270
+ }), p((e) => e(H).server?.disable_file_downloads ?? !1);
271
+ //#endregion
272
+ //#region src/theme/useTheme.ts
273
+ var me = [
274
+ "light",
275
+ "dark",
276
+ "system"
277
+ ];
278
+ function he() {
279
+ if (typeof window > "u") return;
280
+ let e = new URLSearchParams(window.location.search).get(ie.theme);
281
+ return me.includes(e) ? e : void 0;
282
+ }
283
+ var ge = p((e) => {
284
+ if (f()) {
285
+ if (document.body.classList.contains("dark-mode") || document.body.classList.contains("dark") || document.body.dataset.theme === "dark" || document.body.dataset.mode === "dark" || Z() === "dark") return "dark";
286
+ let e = window.getComputedStyle(document.body), t = e.getPropertyValue("color-scheme").trim();
287
+ if (t) return t.includes("dark") ? "dark" : "light";
288
+ let n = e.getPropertyValue("background-color").match(/\d+/g);
289
+ if (n) {
290
+ let [e, t, r] = n.map(Number);
291
+ return (e * 299 + t * 587 + r * 114) / 1e3 < 128 ? "dark" : "light";
292
+ }
293
+ return "light";
294
+ }
295
+ return he() ?? e(H).display.theme;
296
+ }), X = p(!1);
297
+ function _e() {
298
+ if (typeof window > "u" || !window.matchMedia) return;
299
+ let e = window.matchMedia("(prefers-color-scheme: dark)");
300
+ u.set(X, e.matches), e.addEventListener("change", (e) => {
301
+ u.set(X, e.matches);
302
+ });
303
+ }
304
+ _e();
305
+ function Z() {
306
+ switch (document.body.dataset.vscodeThemeKind) {
307
+ case "vscode-dark": return "dark";
308
+ case "vscode-high-contrast": return "dark";
309
+ case "vscode-light": return "light";
310
+ }
311
+ }
312
+ var Q = p(Z());
313
+ function ve() {
314
+ let e = new MutationObserver(() => {
315
+ let e = Z();
316
+ u.set(Q, e);
317
+ });
318
+ return e.observe(document.body, {
319
+ attributes: !0,
320
+ attributeFilter: ["data-vscode-theme-kind"]
321
+ }), () => e.disconnect();
322
+ }
323
+ ve();
324
+ var $ = p((e) => {
325
+ let t = e(ge), n = e(Q);
326
+ if (n !== void 0) return n;
327
+ let r = e(X);
328
+ return t === "system" ? r ? "dark" : "light" : t;
329
+ });
330
+ function ye() {
331
+ let e = (0, T.c)(3), t;
332
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = { store: u }, e[0] = t) : t = e[0];
333
+ let n = m($, t), r;
334
+ return e[1] === n ? r = e[2] : (r = { theme: n }, e[1] = n, e[2] = r), r;
335
+ }
336
+ //#endregion
337
+ export { U as a, z as c, B as d, w as f, ce as i, H as l, ye as n, K as o, le as r, ue as s, $ as t, G as u };
@@ -6,8 +6,8 @@ import { t as s } from "./tooltip-C3UnvsRe.js";
6
6
  import { l as c, t as l } from "./config-DbjzjwxX.js";
7
7
  import { t as u } from "./jsx-runtime-3BD1kT0s.js";
8
8
  import { n as d } from "./error-banner-IsonnvA0.js";
9
- import { t as f } from "./debounce-C3jyATpc.js";
10
- import { n as p } from "./useTheme-B9C1JIy9.js";
9
+ import { t as f } from "./debounce-DrhhziJv.js";
10
+ import { n as p } from "./useTheme-DgOLVISn.js";
11
11
  import { D as ee } from "./utils-DXkj82sK.js";
12
12
  import { t as te } from "./objects-DCmMvZtn.js";
13
13
  import { a as ne, i as re, n as ie, t as m } from "./formats-BK4VefeF.js";
@@ -3,7 +3,7 @@ import { t } from "./src-CA_m4ONl.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { $ as r, H as i, K as a, U as o, a as s, b as c, c as l, et as u, f as d, nt as f, tt as p, v as m, w as h, y as g } from "./chunk-DU6HZSFF-BwiyaNpg.js";
5
5
  import { t as _ } from "./rough.esm-CtV9AnV1.js";
6
- import { p as v } from "./mermaid-B-OFqheA.js";
6
+ import { p as v } from "./mermaid-Djb3Ni9t.js";
7
7
  //#region ../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/transparentize.js
8
8
  var y = (e, t) => p(e, "a", -t), b = 1e-10;
9
9
  function x(e, t) {
@@ -2,7 +2,7 @@ import { i as e } from "./chunk-75Z2AOVW-D7gxIs2Q.js";
2
2
  import { n as t } from "./src-CA_m4ONl.js";
3
3
  import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
4
4
  import { D as r, H as i, K as a, U as o, a as s, b as c, c as l, v as u, w as d, x as f, y as p } from "./chunk-DU6HZSFF-BwiyaNpg.js";
5
- import { p as m } from "./mermaid-B-OFqheA.js";
5
+ import { p as m } from "./mermaid-Djb3Ni9t.js";
6
6
  import { n as h } from "./mermaid-parser.core-DxuSfYwJ.js";
7
7
  import { t as g } from "./chunk-JWPE2WC7-DJvv1t8U.js";
8
8
  //#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-VM6X3IG4.mjs
@@ -9,7 +9,7 @@ import { n as s } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
9
9
  import { D as c, H as l, K as u, U as d, a as f, b as p, c as m, f as h, v as g, w as _, y as v, z as y } from "./chunk-DU6HZSFF-BwiyaNpg.js";
10
10
  import "./chunk-PWAF6VOD-CQw5qATZ.js";
11
11
  import { t as b } from "./chunk-GMAD6QVW-BhaJx0X3.js";
12
- import { p as x } from "./mermaid-B-OFqheA.js";
12
+ import { p as x } from "./mermaid-Djb3Ni9t.js";
13
13
  //#region ../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js
14
14
  function S() {
15
15
  var e = t().unknown(void 0), r = e.domain, i = e.range, o = 0, s = 1, c, l, u = !1, d = 0, f = 0, p = .5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.25.3-dev229",
3
+ "version": "0.25.3-dev230",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -368,3 +368,46 @@ test("mergeConfig replaces arrays instead of merging by index", () => {
368
368
  },
369
369
  });
370
370
  });
371
+
372
+ test.each([{}, { "run-cell": "Alt-Enter" }])(
373
+ "mergeConfig replaces shortcut dictionaries with %j",
374
+ (overrides) => {
375
+ const original = {
376
+ keymap: {
377
+ preset: "vim",
378
+ overrides: { "run-all": "Ctrl-Enter" },
379
+ },
380
+ };
381
+ expect(mergeConfig(original, { keymap: { overrides } })).toEqual({
382
+ keymap: { preset: "vim", overrides },
383
+ });
384
+ expect(original.keymap.overrides).toEqual({ "run-all": "Ctrl-Enter" });
385
+ },
386
+ );
387
+
388
+ test.each(["ai.custom_providers", "signing.trusted_signers"])(
389
+ "mergeConfig replaces records at %s while preserving retained record fields",
390
+ (path) => {
391
+ const [section, name] = path.split(".");
392
+ const original = {
393
+ [section]: {
394
+ [name]: {
395
+ retained: { name: "before", api_key: "secret" },
396
+ removed: { name: "removed" },
397
+ },
398
+ },
399
+ };
400
+ expect(
401
+ mergeConfig(original, {
402
+ [section]: { [name]: { retained: { name: "after" } } },
403
+ }),
404
+ ).toEqual({
405
+ [section]: {
406
+ [name]: { retained: { name: "after", api_key: "secret" } },
407
+ },
408
+ });
409
+ expect(mergeConfig(original, { [section]: { [name]: {} } })).toEqual({
410
+ [section]: { [name]: {} },
411
+ });
412
+ },
413
+ );
@@ -131,6 +131,7 @@ export const UserConfigSchema = z
131
131
  auto_reload: z.enum(["off", "lazy", "autorun"]).prefault("off"),
132
132
  reactive_tests: z.boolean().prefault(true),
133
133
  watcher_on_save: z.enum(["lazy", "autorun"]).prefault("lazy"),
134
+ sql_default_limit: z.number().int().nullable().optional(),
134
135
  default_sql_output: z.enum(VALID_SQL_OUTPUT_FORMATS).prefault("auto"),
135
136
  default_auto_download: z
136
137
  .array(z.enum(AUTO_DOWNLOAD_FORMATS))
@@ -210,6 +211,9 @@ export const UserConfigSchema = z
210
211
  .prefault(() => ({})),
211
212
  server: z
212
213
  .looseObject({
214
+ skip_update_check: z.boolean().optional(),
215
+ session_cookie_secure: z.boolean().optional(),
216
+ session_secret: z.string().optional(),
213
217
  disable_file_downloads: z.boolean().optional(),
214
218
  transport: z.enum(["websocket", "sse"]).optional(),
215
219
  })
@@ -2,7 +2,7 @@
2
2
  import { dequal } from "dequal";
3
3
  import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
4
4
  import { selectAtom } from "jotai/vanilla/utils";
5
- import { mergeWith } from "lodash-es";
5
+ import { cloneDeep, get, has, isPlainObject, mergeWith, set } from "lodash-es";
6
6
  import { OverridingHotkeyProvider } from "../hotkeys/hotkeys";
7
7
  import { type Platform, resolvePlatform } from "../hotkeys/shortcuts";
8
8
  import { confirmedDocumentAtom } from "../session/active-notebook";
@@ -15,16 +15,47 @@ import {
15
15
  } from "./config-schema";
16
16
 
17
17
  /**
18
- * Deep-merge config objects, replacing arrays instead of merging them by
19
- * index. Lodash `merge` keeps leftover tail items. Python `deep_merge` replaces arrays.
18
+ * Combine configuration sources in priority order, with later sources winning.
19
+ * Arrays and shortcut maps replace earlier values so removed entries stay removed.
20
+ * Provider and signer maps replace their keys, while retained records inherit
21
+ * unspecified fields (for example, a provider's API key).
22
+ * These rules match backend resolution so the editor and kernel use the same settings.
20
23
  */
24
+ // TODO(MO-8400): Resolve configuration on the backend and send resolved values
25
+ // with provenance, instead of duplicating source merging in the frontend.
21
26
  export function mergeConfig<T extends object>(...sources: object[]): T {
22
- return mergeWith({}, ...sources, (_obj: unknown, src: unknown) => {
23
- if (Array.isArray(src)) {
24
- return [...src];
27
+ const result = {};
28
+ for (const source of sources) {
29
+ const replacements = [
30
+ "keymap.overrides",
31
+ "ai.custom_providers",
32
+ "signing.trusted_signers",
33
+ ]
34
+ .filter((path) => has(source, path))
35
+ .map((path) => {
36
+ const previous = get(result, path);
37
+ const incoming = get(source, path);
38
+ const value =
39
+ path !== "keymap.overrides" && isPlainObject(incoming)
40
+ ? Object.fromEntries(
41
+ Object.entries(incoming).map(([key, value]) => [
42
+ key,
43
+ isPlainObject(previous?.[key]) && isPlainObject(value)
44
+ ? { ...previous[key], ...(value as object) }
45
+ : value,
46
+ ]),
47
+ )
48
+ : incoming;
49
+ return { path, value };
50
+ });
51
+ mergeWith(result, source, (_obj: unknown, src: unknown) => {
52
+ return Array.isArray(src) ? [...src] : undefined;
53
+ });
54
+ for (const { path, value } of replacements) {
55
+ set(result, path, cloneDeep(value));
25
56
  }
26
- return undefined;
27
- }) as T;
57
+ }
58
+ return result as T;
28
59
  }
29
60
 
30
61
  /**
@@ -1,165 +0,0 @@
1
- import { A as e, E as t, N as n, O as r, S as i, _ as a, b as o, c as s, f as c, h as l, i as u, j as d, k as f, l as p, m, n as h, p as g, r as _, s as v, t as y, y as b } from "./isArrayLikeObject-BZl-15ir.js";
2
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js
3
- var x = Object.create, S = function() {
4
- function e() {}
5
- return function(t) {
6
- if (!r(t)) return {};
7
- if (x) return x(t);
8
- e.prototype = t;
9
- var n = new e();
10
- return e.prototype = void 0, n;
11
- };
12
- }();
13
- //#endregion
14
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js
15
- function C(e, t) {
16
- var n = -1, r = e.length;
17
- for (t ||= Array(r); ++n < r;) t[n] = e[n];
18
- return t;
19
- }
20
- //#endregion
21
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js
22
- function w(e, t, n) {
23
- t == "__proto__" && i ? i(e, t, {
24
- configurable: !0,
25
- enumerable: !0,
26
- value: n,
27
- writable: !0
28
- }) : e[t] = n;
29
- }
30
- //#endregion
31
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js
32
- var T = Object.prototype.hasOwnProperty;
33
- function E(e, t, n) {
34
- var r = e[t];
35
- (!(T.call(e, t) && b(r, n)) || n === void 0 && !(t in e)) && w(e, t, n);
36
- }
37
- //#endregion
38
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js
39
- function D(e, t, n, r) {
40
- var i = !n;
41
- n ||= {};
42
- for (var a = -1, o = t.length; ++a < o;) {
43
- var s = t[a], c = r ? r(n[s], e[s], s, n, e) : void 0;
44
- c === void 0 && (c = e[s]), i ? w(n, s, c) : E(n, s, c);
45
- }
46
- return n;
47
- }
48
- //#endregion
49
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js
50
- function O(e, t, n) {
51
- if (!r(n)) return !1;
52
- var i = typeof t;
53
- return (i == "number" ? l(n) && o(t, n.length) : i == "string" && t in n) ? b(n[t], e) : !1;
54
- }
55
- //#endregion
56
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_createAssigner.js
57
- function k(e) {
58
- return a(function(t, n) {
59
- var r = -1, i = n.length, a = i > 1 ? n[i - 1] : void 0, o = i > 2 ? n[2] : void 0;
60
- for (a = e.length > 3 && typeof a == "function" ? (i--, a) : void 0, o && O(n[0], n[1], o) && (a = i < 3 ? void 0 : a, i = 1), t = Object(t); ++r < i;) {
61
- var s = n[r];
62
- s && e(t, s, r, a);
63
- }
64
- return t;
65
- });
66
- }
67
- //#endregion
68
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js
69
- function A(e) {
70
- var t = [];
71
- if (e != null) for (var n in Object(e)) t.push(n);
72
- return t;
73
- }
74
- //#endregion
75
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js
76
- var j = Object.prototype.hasOwnProperty;
77
- function M(e) {
78
- if (!r(e)) return A(e);
79
- var t = m(e), n = [];
80
- for (var i in e) i == "constructor" && (t || !j.call(e, i)) || n.push(i);
81
- return n;
82
- }
83
- //#endregion
84
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js
85
- function N(e) {
86
- return l(e) ? s(e, !0) : M(e);
87
- }
88
- //#endregion
89
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js
90
- var P = v(Object.getPrototypeOf, Object), F = "[object Object]", I = Function.prototype, L = Object.prototype, R = I.toString, z = L.hasOwnProperty, B = R.call(Object);
91
- function V(t) {
92
- if (!e(t) || d(t) != F) return !1;
93
- var n = P(t);
94
- if (n === null) return !0;
95
- var r = z.call(n, "constructor") && n.constructor;
96
- return typeof r == "function" && r instanceof r && R.call(r) == B;
97
- }
98
- //#endregion
99
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js
100
- var H = typeof exports == "object" && exports && !exports.nodeType && exports, U = H && typeof module == "object" && module && !module.nodeType && module, W = U && U.exports === H ? n.Buffer : void 0, G = W ? W.allocUnsafe : void 0;
101
- function K(e, t) {
102
- if (t) return e.slice();
103
- var n = e.length, r = G ? G(n) : new e.constructor(n);
104
- return e.copy(r), r;
105
- }
106
- //#endregion
107
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js
108
- function q(e) {
109
- var t = new e.constructor(e.byteLength);
110
- return new _(t).set(new _(e)), t;
111
- }
112
- //#endregion
113
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js
114
- function J(e, t) {
115
- var n = t ? q(e.buffer) : e.buffer;
116
- return new e.constructor(n, e.byteOffset, e.length);
117
- }
118
- //#endregion
119
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js
120
- function Y(e) {
121
- return typeof e.constructor == "function" && !m(e) ? S(P(e)) : {};
122
- }
123
- //#endregion
124
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_assignMergeValue.js
125
- function X(e, t, n) {
126
- (n !== void 0 && !b(e[t], n) || n === void 0 && !(t in e)) && w(e, t, n);
127
- }
128
- //#endregion
129
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_safeGet.js
130
- function Z(e, t) {
131
- if ((t !== "constructor" || typeof e[t] != "function") && t != "__proto__") return e[t];
132
- }
133
- //#endregion
134
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/toPlainObject.js
135
- function Q(e) {
136
- return D(e, N(e));
137
- }
138
- //#endregion
139
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMergeDeep.js
140
- function ee(e, n, i, a, o, s, l) {
141
- var u = Z(e, i), d = Z(n, i), m = l.get(d);
142
- if (m) {
143
- X(e, i, m);
144
- return;
145
- }
146
- var h = s ? s(u, d, i + "", e, n, l) : void 0, _ = h === void 0;
147
- if (_) {
148
- var v = f(d), b = !v && c(d), x = !v && !b && p(d);
149
- h = d, v || b || x ? f(u) ? h = u : y(u) ? h = C(u) : b ? (_ = !1, h = K(d, !0)) : x ? (_ = !1, h = J(d, !0)) : h = [] : V(d) || g(d) ? (h = u, g(u) ? h = Q(u) : (!r(u) || t(u)) && (h = Y(d))) : _ = !1;
150
- }
151
- _ && (l.set(d, h), o(h, d, a, s, l), l.delete(d)), X(e, i, h);
152
- }
153
- //#endregion
154
- //#region ../node_modules/.pnpm/lodash-es@4.18.1/node_modules/lodash-es/_baseMerge.js
155
- function $(e, t, n, i, a) {
156
- e !== t && h(t, function(o, s) {
157
- if (a ||= new u(), r(o)) ee(e, t, s, n, $, i, a);
158
- else {
159
- var c = i ? i(Z(e, s), o, s + "", e, t, a) : void 0;
160
- c === void 0 && (c = o), X(e, s, c);
161
- }
162
- }, N);
163
- }
164
- //#endregion
165
- export { K as a, N as c, D as d, E as f, q as i, k as l, C as m, Y as n, V as o, w as p, J as r, P as s, $ as t, O as u };
@@ -1 +0,0 @@
1
- import{t as e}from"./worker-DiPNP__U.js";var t=e(((e,t)=>{t.exports={}}));export default t();