@marimo-team/islands 0.25.3-dev419 → 0.25.3-dev420

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 (78) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DU3_5kY8.js → ConnectedDataExplorerComponent-CoEU9snz.js} +9 -9
  2. package/dist/{ErrorBoundary-QucJ8UcH.js → ErrorBoundary-OkPCZwqd.js} +6 -6
  3. package/dist/{abnfDiagram-VCTEODGH-B8K0jAls.js → abnfDiagram-VCTEODGH-RbfxpmIE.js} +2 -2
  4. package/dist/{any-language-editor-B4_DB75O.js → any-language-editor-CvTbmCdJ.js} +2 -2
  5. package/dist/{architectureDiagram-5GKGNRK7-CvIQmetx.js → architectureDiagram-5GKGNRK7-DzzNVRo4.js} +1 -1
  6. package/dist/{assertNever-mSPR3shX.js → assertNever-ChGm2jYv.js} +13 -13
  7. package/dist/{chat-ui-B_RJOYcP.js → chat-ui-DxD-0lMF.js} +42 -42
  8. package/dist/{check-Cy7tgHcN.js → check-BHRB6N0I.js} +1 -1
  9. package/dist/{chunk-IMKFNOWR-BAjKQ-DW.js → chunk-IMKFNOWR-1Zy6M_oP.js} +1 -1
  10. package/dist/{chunk-SHT3W25Y-ZNgk9609.js → chunk-SHT3W25Y-yAttqZEk.js} +1 -1
  11. package/dist/{chunk-SVP7TREG-C-eCzAlq.js → chunk-SVP7TREG-MKJpuJHR.js} +1 -1
  12. package/dist/{chunk-TICWLB2K-B6K_lMGd.js → chunk-TICWLB2K-BOC0OebH.js} +1 -1
  13. package/dist/{classDiagram-ZZMXUADV-WvEzff6_.js → classDiagram-ZZMXUADV-BOlD7kH9.js} +2 -2
  14. package/dist/{classDiagram-v2-VYDZK3BY-C6jq882I.js → classDiagram-v2-VYDZK3BY-C3p3seuT.js} +2 -2
  15. package/dist/{code-visibility-DvjOxSCU.js → code-visibility-Cjmof3go.js} +18 -18
  16. package/dist/{common-KGFvhdv7.js → common-IWr3ajS6.js} +190 -190
  17. package/dist/{config-B8EcwkGB.js → config-EJnOxh0i.js} +15 -15
  18. package/dist/{copy-icon-BJpgGeTC.js → copy-icon-CeOpTht4.js} +2 -2
  19. package/dist/{createReducer-sm4RC5mJ.js → createReducer-BJJ0K5Tu.js} +5 -5
  20. package/dist/{cynefinDiagram-5FMLGOSQ-D803PUnc.js → cynefinDiagram-5FMLGOSQ-BKnxm64C.js} +1 -1
  21. package/dist/{dagre-GXQ25YYZ-C-aJg32d.js → dagre-GXQ25YYZ-COBTexAI.js} +1 -1
  22. package/dist/{data-grid-overlay-editor-7Dtv34Jd.js → data-grid-overlay-editor-CJ4s7ulW.js} +1 -1
  23. package/dist/{diagram-S7CK7UJ4-BLVxtHnY.js → diagram-S7CK7UJ4-Dyt3J6ek.js} +1 -1
  24. package/dist/{diagram-UQ7AKVKN-Beh5Pbg6.js → diagram-UQ7AKVKN-CJCsT4fA.js} +1 -1
  25. package/dist/{diagram-VX7I27RA-CULTkxM5.js → diagram-VX7I27RA-BboxCtbh.js} +1 -1
  26. package/dist/{diagram-Z3DM3KII-BMCLEP1m.js → diagram-Z3DM3KII-DfRWWQ5t.js} +1 -1
  27. package/dist/{dialog-B6nQQBnz.js → dialog-B8vU2hHC.js} +19 -19
  28. package/dist/{dropdown-menu-DjX80o4Y.js → dropdown-menu-DzhAnAhr.js} +710 -710
  29. package/dist/{ebnfDiagram-PWID7BFC-C1nrF9vr.js → ebnfDiagram-PWID7BFC-DYxwv-nl.js} +2 -2
  30. package/dist/{erDiagram-RLTQ6QDP-DdyMtJ9L.js → erDiagram-RLTQ6QDP-D9e5WUw7.js} +1 -1
  31. package/dist/{error-banner-B_inJFwt.js → error-banner-BRkKwvku.js} +58 -58
  32. package/dist/{error-entries-PI7-JXTO.js → error-entries-BNzYy3Ci.js} +199 -199
  33. package/dist/{feedback-button-K8GaXx54.js → feedback-button-CNlw0PFL.js} +7 -8
  34. package/dist/{flowDiagram-HODETNUW-bvV00CVg.js → flowDiagram-HODETNUW-tt7EepxX.js} +2 -2
  35. package/dist/{formats-CHMpl6QC.js → formats-HRSqKdFt.js} +1 -1
  36. package/dist/{glide-data-editor-DOTyVaei.js → glide-data-editor-SsDU5p2r.js} +11 -11
  37. package/dist/{glide-utils-BRuD_rZU.js → glide-utils-BzjESEmr.js} +2 -2
  38. package/dist/{globals-BXqXiOgm.js → globals-BET0Lqsh.js} +3 -3
  39. package/dist/{html-to-image-DRDPLn_a.js → html-to-image-CO_NVoKY.js} +4364 -4364
  40. package/dist/{infoDiagram-27XIBGKW-CJP3yC0n.js → infoDiagram-27XIBGKW-CpQH_joy.js} +1 -1
  41. package/dist/{ishikawaDiagram-5VMMS53U-C1pLHIdi.js → ishikawaDiagram-5VMMS53U-d-it4xqm.js} +1 -1
  42. package/dist/{kanban-definition-UXKFOSKX-NdrIJPqy.js → kanban-definition-UXKFOSKX-DItpqTFY.js} +1 -1
  43. package/dist/main.js +1303 -1303
  44. package/dist/{mermaid-BocCIdw6.js → mermaid-BugOVfeH.js} +34 -34
  45. package/dist/{mindmap-definition-YA3MSWOX-Vl1SDmoX.js → mindmap-definition-YA3MSWOX-D6IpF-_J.js} +1 -1
  46. package/dist/{number-overlay-editor-C5pRNGgM.js → number-overlay-editor-CQB7RHTl.js} +1 -1
  47. package/dist/{pegDiagram-XKGWAZYB-B8WAtwHg.js → pegDiagram-XKGWAZYB-CXUu3QwE.js} +2 -2
  48. package/dist/{pencil-DM3KeZSc.js → pencil-DWRFEz2B.js} +1 -1
  49. package/dist/{pieDiagram-E7YTZNPT-3UwTA4Ji.js → pieDiagram-E7YTZNPT-DoUJF0yj.js} +1 -1
  50. package/dist/{process-output-Dox_yeXz.js → process-output-CznNfcKe.js} +4 -4
  51. package/dist/{railroadDiagram-O6MQD6OU-C3w0QQqv.js → railroadDiagram-O6MQD6OU-BsGDhtLL.js} +2 -2
  52. package/dist/{requirementDiagram-BXWQKSXE-XfIlHoUh.js → requirementDiagram-BXWQKSXE-BHW0qW2Z.js} +1 -1
  53. package/dist/{reveal-component-CxH2xcwO.js → reveal-component-C1RY2hz7.js} +8 -8
  54. package/dist/{select-C9YSRW_M.js → select-Brvb-RwP.js} +114 -114
  55. package/dist/{sequenceDiagram-WJ2MYXX4-lwpyGn1v.js → sequenceDiagram-WJ2MYXX4-DpgYJzLl.js} +1 -1
  56. package/dist/{spec-VVUHPhhG.js → spec-BWpscSQi.js} +4 -4
  57. package/dist/{stateDiagram-D77RDMKH-DYBi4cqk.js → stateDiagram-D77RDMKH-Btf1jiYb.js} +2 -2
  58. package/dist/{stateDiagram-v2-MP3YSRHH-DNc3nkzs.js → stateDiagram-v2-MP3YSRHH-DN9FyEf3.js} +2 -2
  59. package/dist/static-state-BhCfPRoz.js +68 -0
  60. package/dist/{swimlanes-42K2YHIH-DhzVHdX1.js → swimlanes-42K2YHIH-2l_tR9qL.js} +1 -1
  61. package/dist/{swimlanesDiagram-VR7AAH4N-Cok6zuub.js → swimlanesDiagram-VR7AAH4N-BAkmv8kE.js} +2 -2
  62. package/dist/{timeline-definition-24CTP7MA-IlEStAoK.js → timeline-definition-24CTP7MA-AxSxEOhx.js} +1 -1
  63. package/dist/{toast-BP9h0yJZ.js → toast-DOWc3HtU.js} +106 -106
  64. package/dist/{tooltip-DY2U4Rke.js → tooltip-DsQZP310.js} +57 -57
  65. package/dist/{use-restore-focus-Mex26exl.js → use-restore-focus-CTa7IRP6.js} +584 -550
  66. package/dist/{useDateFormatter-L6M4ljVG.js → useDateFormatter-CRuBYwR6.js} +2 -2
  67. package/dist/{useDeepCompareMemoize-MdvXCwAP.js → useDeepCompareMemoize-B2RNcTmn.js} +1 -1
  68. package/dist/{useLifecycle-CDeB28JV.js → useLifecycle-Bw0JtmoB.js} +1 -1
  69. package/dist/{vega-component-CIkkx4lH.js → vega-component-BV9sYHhU.js} +6 -6
  70. package/dist/{vennDiagram-4TSXK5OY-3XmjJpX3.js → vennDiagram-4TSXK5OY-oHztO7MH.js} +1 -1
  71. package/dist/{wardleyDiagram-VM6X3IG4-CLQU2FaC.js → wardleyDiagram-VM6X3IG4-DWeEjZSc.js} +1 -1
  72. package/dist/{xychartDiagram-S5SC5T6Z-ZYCgWrwe.js → xychartDiagram-S5SC5T6Z-ESBlsY9i.js} +1 -1
  73. package/package.json +1 -1
  74. package/src/core/constants.ts +6 -0
  75. package/src/core/runtime/__tests__/runtime.test.ts +3 -1
  76. package/src/theme/__tests__/useTheme.test.ts +38 -9
  77. package/src/theme/useTheme.ts +16 -1
  78. package/dist/static-state-Ccv-89qp.js +0 -90
@@ -1,7 +1,7 @@
1
1
  import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
- import { h as n } from "./tooltip-DY2U4Rke.js";
4
- import { C as r } from "./select-C9YSRW_M.js";
3
+ import { h as n } from "./tooltip-DsQZP310.js";
4
+ import { C as r } from "./select-Brvb-RwP.js";
5
5
  var i = n("chart-pie", [["path", {
6
6
  d: "M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",
7
7
  key: "pzmjnu"
@@ -1,6 +1,6 @@
1
1
  import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
- import { jt as n } from "./use-restore-focus-Mex26exl.js";
3
+ import { Pt as n } from "./use-restore-focus-CTa7IRP6.js";
4
4
  //#region src/utils/semaphore.ts
5
5
  var r = class {
6
6
  maxPermits;
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { h as t, r as n } from "./button-qQhINE7z.js";
3
3
  import { t as r } from "./react-Bgs_wQh3.js";
4
4
  import { t as i } from "./compiler-runtime-C5KHtL5D.js";
5
- import { h as a } from "./tooltip-DY2U4Rke.js";
5
+ import { h as a } from "./tooltip-DsQZP310.js";
6
6
  import { t as o } from "./jsx-runtime-D8btoEHk.js";
7
7
  var s = a("calendar", [
8
8
  ["path", {
@@ -2,18 +2,18 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { g as t, h as n, m as r, s as i } from "./button-qQhINE7z.js";
3
3
  import { t as a } from "./react-Bgs_wQh3.js";
4
4
  import { t as o } from "./compiler-runtime-C5KHtL5D.js";
5
- import { t as s } from "./tooltip-DY2U4Rke.js";
6
- import { l as c, t as l } from "./config-B8EcwkGB.js";
5
+ import { t as s } from "./tooltip-DsQZP310.js";
6
+ import { l as c, t as l } from "./config-EJnOxh0i.js";
7
7
  import { t as u } from "./jsx-runtime-D8btoEHk.js";
8
- import { d } from "./use-restore-focus-Mex26exl.js";
9
- import { n as f } from "./error-banner-B_inJFwt.js";
8
+ import { d } from "./use-restore-focus-CTa7IRP6.js";
9
+ import { n as f } from "./error-banner-BRkKwvku.js";
10
10
  import { t as p } from "./debounce-DrhhziJv.js";
11
11
  import { t as ee } from "./objects-DCmMvZtn.js";
12
12
  import { t as te } from "./useEvent-BoN7U38T.js";
13
- import { a as ne, i as re, n as ie, t as m } from "./formats-CHMpl6QC.js";
13
+ import { a as ne, i as re, n as ie, t as m } from "./formats-HRSqKdFt.js";
14
14
  import { a as h, t as g } from "./arrays-DoQ-AILx.js";
15
15
  import { t as ae } from "./useAsyncData-P5-Oovhq.js";
16
- import { n as _, t as oe } from "./useDeepCompareMemoize-MdvXCwAP.js";
16
+ import { n as _, t as oe } from "./useDeepCompareMemoize-B2RNcTmn.js";
17
17
  import { W as se, n as ce } from "./vega-loader.browser-Co9gYE8Z.js";
18
18
  import { t as le } from "./react-vega-CGgQEf0O.js";
19
19
  import { a as ue, n as de } from "./loader-Bin_dutt.js";
@@ -3,7 +3,7 @@ import { t } from "./src-D5uZaZib.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-4SDIhUTY.js";
5
5
  import { t as _ } from "./rough.esm-CtV9AnV1.js";
6
- import { p as v } from "./mermaid-BocCIdw6.js";
6
+ import { p as v } from "./mermaid-BugOVfeH.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-76L6My3P.js";
2
2
  import { n as t } from "./src-D5uZaZib.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-4SDIhUTY.js";
5
- import { p as m } from "./mermaid-BocCIdw6.js";
5
+ import { p as m } from "./mermaid-BugOVfeH.js";
6
6
  import { n as h } from "./mermaid-parser.core-DtOnl7m4.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-4SDIhUTY.js";
10
10
  import "./chunk-PWAF6VOD-CRu_RGP2.js";
11
11
  import { t as b } from "./chunk-GMAD6QVW-BJGF8QZL.js";
12
- import { p as x } from "./mermaid-BocCIdw6.js";
12
+ import { p as x } from "./mermaid-BugOVfeH.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-dev419",
3
+ "version": "0.25.3-dev420",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -52,6 +52,12 @@ export const KnownQueryParams = {
52
52
  * If false, the chrome will be hidden.
53
53
  */
54
54
  showChrome: "show-chrome",
55
+ /**
56
+ * Override the display theme: `light`, `dark`, or `system`.
57
+ * Takes precedence over the notebook's saved `display.theme`.
58
+ * Ignored for embedded islands, which infer the theme from their host page.
59
+ */
60
+ theme: "theme",
55
61
  };
56
62
 
57
63
  /**
@@ -592,7 +592,7 @@ describe("RuntimeManager", () => {
592
592
  Object.defineProperty(window, "location", {
593
593
  value: {
594
594
  ...originalLocation,
595
- search: "?custom_param=value123&user_token=abc",
595
+ search: "?custom_param=value123&user_token=abc&theme=dark",
596
596
  },
597
597
  writable: true,
598
598
  });
@@ -621,9 +621,11 @@ describe("RuntimeManager", () => {
621
621
  base_param: "existing",
622
622
  custom_param: "value123",
623
623
  user_token: "abc",
624
+ theme: "dark",
624
625
  });
625
626
  expect(httpUrl.searchParams.get("custom_param")).toBe("value123");
626
627
  expect(httpUrl.searchParams.get("user_token")).toBe("abc");
628
+ expect(httpUrl.searchParams.get("theme")).toBe("dark");
627
629
 
628
630
  // Should also include session_id for WebSocket URLs
629
631
  expect(wsUrl.searchParams.get("session_id")).toBe("test");
@@ -5,7 +5,13 @@ import { configOverridesAtom, userConfigAtom } from "@/core/config/config";
5
5
  import { defaultUserConfig } from "@/core/config/config-schema";
6
6
  import { store } from "@/core/state/jotai";
7
7
  import type { Theme } from "../useTheme";
8
- import { resolvedThemeAtom } from "../useTheme";
8
+ import { resolvedThemeAtom, visibleForTesting } from "../useTheme";
9
+
10
+ const { themeFromQueryParam } = visibleForTesting;
11
+
12
+ function setQuery(search: string): void {
13
+ window.history.replaceState({}, "", search === "" ? "/" : `/?${search}`);
14
+ }
9
15
 
10
16
  function setConfigTheme(theme: Theme): void {
11
17
  const config = defaultUserConfig();
@@ -16,24 +22,47 @@ function setConfigTheme(theme: Theme): void {
16
22
  }
17
23
 
18
24
  afterEach(() => {
25
+ setQuery("");
19
26
  store.set(userConfigAtom, defaultUserConfig());
20
27
  store.set(configOverridesAtom, {});
21
28
  });
22
29
 
23
- describe("resolvedThemeAtom", () => {
24
- it("uses the saved config theme", () => {
30
+ describe("themeFromQueryParam", () => {
31
+ it.each(["light", "dark", "system"] as const)(
32
+ "returns the valid theme %s",
33
+ (theme) => {
34
+ setQuery(`theme=${theme}`);
35
+ expect(themeFromQueryParam()).toBe(theme);
36
+ },
37
+ );
38
+
39
+ it("returns undefined when the param is absent", () => {
40
+ setQuery("");
41
+ expect(themeFromQueryParam()).toBeUndefined();
42
+ });
43
+
44
+ it("returns undefined for an invalid value", () => {
45
+ setQuery("theme=blue");
46
+ expect(themeFromQueryParam()).toBeUndefined();
47
+ });
48
+ });
49
+
50
+ describe("resolvedThemeAtom with a theme query param", () => {
51
+ it("uses the saved config theme when no param is present", () => {
25
52
  setConfigTheme("dark");
53
+ setQuery("");
26
54
  expect(store.get(resolvedThemeAtom)).toBe("dark");
27
- setConfigTheme("light");
28
- expect(store.get(resolvedThemeAtom)).toBe("light");
29
55
  });
30
56
 
31
- it("uses resolved configuration overrides ahead of saved settings", () => {
57
+ it("lets the query param override the saved config theme", () => {
32
58
  setConfigTheme("light");
33
- store.set(configOverridesAtom, { display: { theme: "dark" } });
59
+ setQuery("theme=dark");
34
60
  expect(store.get(resolvedThemeAtom)).toBe("dark");
61
+ });
35
62
 
36
- store.set(configOverridesAtom, {});
37
- expect(store.get(resolvedThemeAtom)).toBe("light");
63
+ it("falls back to the config theme for an invalid param value", () => {
64
+ setConfigTheme("dark");
65
+ setQuery("theme=blue");
66
+ expect(store.get(resolvedThemeAtom)).toBe("dark");
38
67
  });
39
68
  });
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { atom, useAtomValue } from "jotai";
4
4
  import { resolvedMarimoConfigAtom } from "@/core/config/config";
5
+ import { KnownQueryParams } from "@/core/constants";
5
6
  import { isIslands } from "@/core/islands/utils";
6
7
  import { store } from "@/core/state/jotai";
7
8
 
@@ -10,6 +11,16 @@ export type ResolvedTheme = "light" | "dark";
10
11
 
11
12
  export const THEMES: Theme[] = ["light", "dark", "system"];
12
13
 
14
+ function themeFromQueryParam(): Theme | undefined {
15
+ if (typeof window === "undefined") {
16
+ return undefined;
17
+ }
18
+ const value = new URLSearchParams(window.location.search).get(
19
+ KnownQueryParams.theme,
20
+ );
21
+ return THEMES.includes(value as Theme) ? (value as Theme) : undefined;
22
+ }
23
+
13
24
  function getHostElements() {
14
25
  return [document.body, document.documentElement];
15
26
  }
@@ -86,7 +97,7 @@ const themeAtom = atom((get) => {
86
97
  if (isIslands()) {
87
98
  return get(hostThemeAtom) ?? getHostTheme();
88
99
  }
89
- return get(resolvedMarimoConfigAtom).display.theme;
100
+ return themeFromQueryParam() ?? get(resolvedMarimoConfigAtom).display.theme;
90
101
  });
91
102
 
92
103
  const prefersDarkModeAtom = atom(false);
@@ -152,3 +163,7 @@ export function useTheme(): { theme: ResolvedTheme } {
152
163
  const theme = useAtomValue(resolvedThemeAtom, { store });
153
164
  return { theme };
154
165
  }
166
+
167
+ export const visibleForTesting = {
168
+ themeFromQueryParam,
169
+ };
@@ -1,90 +0,0 @@
1
- import { t as e } from "./compiler-runtime-C5KHtL5D.js";
2
- import { Lt as t, Pt as n, f as r, vt as i } from "./use-restore-focus-Mex26exl.js";
3
- import { t as a } from "./invariant-DLmrl-hA.js";
4
- //#region src/core/wasm/utils.ts
5
- function o() {
6
- return typeof document < "u" && document.querySelector("marimo-wasm") !== null;
7
- }
8
- var s = 6048e5, c = 864e5, l = Symbol.for("constructDateFrom");
9
- //#endregion
10
- //#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js
11
- function u(e, t) {
12
- return typeof e == "function" ? e(t) : e && typeof e == "object" && l in e ? e[l](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
13
- }
14
- //#endregion
15
- //#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js
16
- function d(e, t) {
17
- return u(t || e, e);
18
- }
19
- //#endregion
20
- //#region src/core/constants.ts
21
- var f = e(), p = {
22
- githubPage: "https://github.com/marimo-team/marimo",
23
- releasesPage: "https://github.com/marimo-team/marimo/releases",
24
- issuesPage: "https://github.com/marimo-team/marimo/issues",
25
- bugReportUrl: "https://github.com/marimo-team/marimo/issues/new?template=bug_report.yaml",
26
- feedbackForm: "https://marimo.io/feedback",
27
- discordLink: "https://marimo.io/discord?ref=notebook",
28
- docsPage: "https://docs.marimo.io",
29
- youtube: "https://www.youtube.com/@marimo-team",
30
- molab: "https://molab.marimo.io"
31
- }, m = {
32
- showCode: "show-code",
33
- includeCode: "include-code",
34
- sessionId: "session_id",
35
- kiosk: "kiosk",
36
- vscode: "vscode",
37
- filePath: "file",
38
- accessToken: "access_token",
39
- viewAs: "view-as",
40
- showChrome: "show-chrome"
41
- }, h = { outputArea: "output-area" };
42
- //#endregion
43
- //#region src/utils/assertExists.ts
44
- function g(e, t) {
45
- if (e == null) throw Error(t || `Expected value but got ${e}`);
46
- }
47
- //#endregion
48
- //#region src/core/mode.ts
49
- function _() {
50
- let e = i.get(y);
51
- return g(e, "internal-error: initial mode not found"), a(e !== "present", "internal-error: initial mode cannot be 'present'"), e;
52
- }
53
- var v = t({
54
- mode: r() ? "read" : "not-set",
55
- cellAnchor: null
56
- }), y = t(void 0);
57
- function b() {
58
- let e = i.get(y);
59
- return e !== "home" && e !== "gallery";
60
- }
61
- var x = t(!1);
62
- function S() {
63
- let e = (0, f.c)(1), { mode: t } = n(v), r = n(x), i;
64
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = new URLSearchParams(window.location.search).get(m.kiosk), e[0] = i) : i = e[0], t !== "read" && !r && i !== "true";
65
- }
66
- //#endregion
67
- //#region src/core/static/static-state.ts
68
- function C(e) {
69
- if (typeof e != "object" || !e || Array.isArray(e)) return !1;
70
- for (let t of Object.values(e)) if (typeof t != "string") return !1;
71
- return !0;
72
- }
73
- function w(e) {
74
- if (typeof e != "object" || !e || Array.isArray(e)) return !1;
75
- let t = e;
76
- return !(!C(t.files) || t.modelNotifications !== void 0 && !Array.isArray(t.modelNotifications));
77
- }
78
- function T() {
79
- let e = typeof window > "u" ? void 0 : window.__MARIMO_STATIC__;
80
- return w(e) ? e : void 0;
81
- }
82
- function E() {
83
- return T() !== void 0;
84
- }
85
- function D() {
86
- let e = T();
87
- return a(e !== void 0, "Not a static notebook"), e.files;
88
- }
89
- //#endregion
90
- export { o as _, b as a, v as c, p as d, m as f, s as g, c as h, y as i, g as l, u as m, E as n, x as o, d as p, _ as r, S as s, D as t, h as u };