@marimo-team/islands 0.25.3-dev482 → 0.25.3-dev486

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 (108) hide show
  1. package/dist/{ConnectedDataExplorerComponent-LA5OtjAG.js → ConnectedDataExplorerComponent-BV2GFVYn.js} +9 -9
  2. package/dist/{ErrorBoundary-Tw4GGoit.js → ErrorBoundary-D--EtR81.js} +6 -6
  3. package/dist/{abnfDiagram-VCTEODGH-CBntFgCZ.js → abnfDiagram-VCTEODGH-1AWrWE-o.js} +2 -2
  4. package/dist/{any-language-editor-gzDRWdCH.js → any-language-editor-Dqpg95i0.js} +2 -2
  5. package/dist/{architectureDiagram-5GKGNRK7-Bz6ouXl-.js → architectureDiagram-5GKGNRK7-D0zM5fGn.js} +1 -1
  6. package/dist/{assertNever-DOTNJ2Y4.js → assertNever-BQEDS5Ew.js} +2 -2
  7. package/dist/assets/__vite-browser-external-DZv_7F5P.js +1 -0
  8. package/dist/assets/{worker-DFvnFhLF.js → worker-cHYZNFD4.js} +2 -2
  9. package/dist/{chat-ui-LeUI9zli.js → chat-ui-Blvl4-Kd.js} +16 -16
  10. package/dist/{check-CApwK1fD.js → check-BTnCP_6g.js} +1 -1
  11. package/dist/{chunk-IMKFNOWR-DK_M66Dt.js → chunk-IMKFNOWR-CTe-GyEo.js} +1 -1
  12. package/dist/{chunk-SHT3W25Y-C7Cg6zGL.js → chunk-SHT3W25Y-mDvz0_Bb.js} +1 -1
  13. package/dist/{chunk-SVP7TREG-K0lWia53.js → chunk-SVP7TREG-TQe5CTi-.js} +1 -1
  14. package/dist/{chunk-TICWLB2K-DiKpryGp.js → chunk-TICWLB2K-DueGZcaL.js} +1 -1
  15. package/dist/{classDiagram-ZZMXUADV-CXX5eaxi.js → classDiagram-ZZMXUADV-C80WtbRl.js} +2 -2
  16. package/dist/{classDiagram-v2-VYDZK3BY-Bjyy4iKL.js → classDiagram-v2-VYDZK3BY-BGUFGXB1.js} +2 -2
  17. package/dist/{code-visibility-CWrFAfrs.js → code-visibility-CKSt_AlX.js} +14 -14
  18. package/dist/{common-DZARFS07.js → common-B0U1M1ok.js} +30 -30
  19. package/dist/{config-C8TXSDmC.js → config-DbjezUyA.js} +3 -3
  20. package/dist/{copy-icon-CDvvlY90.js → copy-icon-7bY-OuK1.js} +2 -2
  21. package/dist/{createReducer-CXqSak4H.js → createReducer-BTiEYD5d.js} +1 -1
  22. package/dist/{cynefinDiagram-5FMLGOSQ-C-MlCYj4.js → cynefinDiagram-5FMLGOSQ-B1FxtX7q.js} +1 -1
  23. package/dist/{dagre-GXQ25YYZ-C6e9vEKZ.js → dagre-GXQ25YYZ-DsaxsLKR.js} +1 -1
  24. package/dist/{data-grid-overlay-editor-C1ZVcFjq.js → data-grid-overlay-editor-B1wgTm3e.js} +1 -1
  25. package/dist/{diagram-S7CK7UJ4-DgXNq_At.js → diagram-S7CK7UJ4-0_x8Q-Gz.js} +1 -1
  26. package/dist/{diagram-UQ7AKVKN-BG5NExCt.js → diagram-UQ7AKVKN-nvR7yqd-.js} +1 -1
  27. package/dist/{diagram-VX7I27RA-Da7VYCfC.js → diagram-VX7I27RA-BnEUU78X.js} +1 -1
  28. package/dist/{diagram-Z3DM3KII-DHk6GaR5.js → diagram-Z3DM3KII-BHX2x9ql.js} +1 -1
  29. package/dist/{dialog-rgayPemF.js → dialog-CBKdXrw9.js} +2 -2
  30. package/dist/{dropdown-menu-B12Nf3Zf.js → dropdown-menu-218IIk7S.js} +5 -5
  31. package/dist/{ebnfDiagram-PWID7BFC-DdSjinXr.js → ebnfDiagram-PWID7BFC-DYZD7-aw.js} +2 -2
  32. package/dist/{erDiagram-RLTQ6QDP-BgcwfZct.js → erDiagram-RLTQ6QDP-Bv-0tHzX.js} +1 -1
  33. package/dist/{error-banner-DXHIN-63.js → error-banner-cub3qDum.js} +1 -1
  34. package/dist/{error-entries--YT1ZOUW.js → error-entries-MZLN-feW.js} +92 -87
  35. package/dist/feedback-button-coih3loz.js +370 -0
  36. package/dist/{flowDiagram-HODETNUW-CVwzkmUF.js → flowDiagram-HODETNUW-BV2Dug--.js} +2 -2
  37. package/dist/{formats-BWuAsLfw.js → formats-CBWqzCiR.js} +1 -1
  38. package/dist/{glide-data-editor-BQHo_8OJ.js → glide-data-editor-BGlWbHIN.js} +11 -11
  39. package/dist/{glide-utils-D1McS0Pn.js → glide-utils-DlglW_uh.js} +2 -2
  40. package/dist/{globals-DQXC3L6D.js → globals-C08BeEBR.js} +3 -3
  41. package/dist/{html-to-image-BMt1erSy.js → html-to-image-D6h4lzXj.js} +79 -79
  42. package/dist/{infoDiagram-27XIBGKW-CHkU2P-8.js → infoDiagram-27XIBGKW-xekhSKlY.js} +1 -1
  43. package/dist/{ishikawaDiagram-5VMMS53U-B0k5UyY5.js → ishikawaDiagram-5VMMS53U-Coe7mUqv.js} +1 -1
  44. package/dist/{kanban-definition-UXKFOSKX-DwQvOV0x.js → kanban-definition-UXKFOSKX-Znywqtyi.js} +1 -1
  45. package/dist/main.js +8725 -8691
  46. package/dist/{mermaid-Bqy6f_NU.js → mermaid-DRT7MewO.js} +34 -34
  47. package/dist/{mindmap-definition-YA3MSWOX-CqvvAm8I.js → mindmap-definition-YA3MSWOX-Do_NrRXE.js} +1 -1
  48. package/dist/{number-overlay-editor-B6VKb3LS.js → number-overlay-editor-J2u2bfxK.js} +1 -1
  49. package/dist/{pegDiagram-XKGWAZYB-Befnx4Ry.js → pegDiagram-XKGWAZYB-CTuwofVH.js} +2 -2
  50. package/dist/{pencil-BC7pOv9g.js → pencil-qedVMD6q.js} +1 -1
  51. package/dist/{pieDiagram-E7YTZNPT-6rYFbF7p.js → pieDiagram-E7YTZNPT-CFHRBvha.js} +1 -1
  52. package/dist/{process-output-CNBGRz3r.js → process-output-MYh-Vr__.js} +4 -4
  53. package/dist/{railroadDiagram-O6MQD6OU-SSniwYC8.js → railroadDiagram-O6MQD6OU-BJBqS4A3.js} +2 -2
  54. package/dist/{requirementDiagram-BXWQKSXE-3L_xNfQr.js → requirementDiagram-BXWQKSXE-CoMoIh3b.js} +1 -1
  55. package/dist/{reveal-component-BlB1yXJU.js → reveal-component-CZLdWmre.js} +7 -7
  56. package/dist/{select-PQHWLm64.js → select-BcEi9lad.js} +4 -4
  57. package/dist/{sequenceDiagram-WJ2MYXX4-DvzIRlWu.js → sequenceDiagram-WJ2MYXX4-Cu7Mpp-z.js} +1 -1
  58. package/dist/{spec-6shN7lEe.js → spec-AxyC1vc5.js} +4 -4
  59. package/dist/{stateDiagram-D77RDMKH-VsHup-Ig.js → stateDiagram-D77RDMKH-DX7_Rnib.js} +2 -2
  60. package/dist/{stateDiagram-v2-MP3YSRHH-BwIIR8nk.js → stateDiagram-v2-MP3YSRHH-oFXVbGoo.js} +2 -2
  61. package/dist/{static-state-CWXd6dYX.js → static-state-CqzVppxA.js} +1 -1
  62. package/dist/{swimlanes-42K2YHIH-DhSDCIWI.js → swimlanes-42K2YHIH-CxzCGtVZ.js} +1 -1
  63. package/dist/{swimlanesDiagram-VR7AAH4N-C2WGVm-W.js → swimlanesDiagram-VR7AAH4N-1a1GRLNf.js} +2 -2
  64. package/dist/{timeline-definition-24CTP7MA-DhUhNinO.js → timeline-definition-24CTP7MA-Pfn2awsU.js} +1 -1
  65. package/dist/{toast-BGvv7tKS.js → toast-aYa8V5tR.js} +3 -3
  66. package/dist/{tooltip-CiJ919pg.js → tooltip-CwQmweEz.js} +1 -1
  67. package/dist/{use-restore-focus-BLj45Ibw.js → use-restore-focus-DlX1CSiq.js} +6 -1
  68. package/dist/{useDateFormatter-C659lkax.js → useDateFormatter-BAckjdIS.js} +2 -2
  69. package/dist/{useDeepCompareMemoize-CDhinwm7.js → useDeepCompareMemoize-C6mte0N8.js} +1 -1
  70. package/dist/{useLifecycle-mKiMNa4V.js → useLifecycle-XZ5KJAFU.js} +1 -1
  71. package/dist/{vega-component-CWvQ7wBJ.js → vega-component-_We1FoNw.js} +6 -6
  72. package/dist/{vennDiagram-4TSXK5OY-exvBF8P5.js → vennDiagram-4TSXK5OY-DrIqDugg.js} +1 -1
  73. package/dist/{wardleyDiagram-VM6X3IG4-BFhJmnXo.js → wardleyDiagram-VM6X3IG4-DBPVNfc3.js} +1 -1
  74. package/dist/{xychartDiagram-S5SC5T6Z-D_xAdG6u.js → xychartDiagram-S5SC5T6Z-64Isocef.js} +1 -1
  75. package/package.json +1 -1
  76. package/src/__mocks__/executions.ts +2 -0
  77. package/src/__tests__/CellStatus.test.tsx +3 -3
  78. package/src/components/dependency-graph/__tests__/elements.test.ts +20 -11
  79. package/src/components/dependency-graph/dependency-graph-tree.tsx +17 -3
  80. package/src/components/dependency-graph/elements.ts +12 -25
  81. package/src/components/editor/cell/CellStatus.tsx +23 -38
  82. package/src/components/editor/cell/ReusableDefinitionBadge.tsx +62 -0
  83. package/src/components/editor/notebook-cell.tsx +8 -67
  84. package/src/components/slides/slide-cell-view.tsx +1 -1
  85. package/src/core/cells/__tests__/cells.test.ts +0 -3
  86. package/src/core/cells/actions.ts +0 -1
  87. package/src/core/cells/cells.ts +0 -12
  88. package/src/core/cells/execution-console.ts +0 -2
  89. package/src/core/cells/reusable-definition.ts +25 -0
  90. package/src/core/cells/types.ts +1 -6
  91. package/src/core/executions/__tests__/atoms.test.ts +1 -41
  92. package/src/core/executions/__tests__/output-lifecycle.test.ts +1 -5
  93. package/src/core/executions/__tests__/select.test.ts +34 -2
  94. package/src/core/executions/atoms.ts +16 -31
  95. package/src/core/executions/hooks.ts +2 -3
  96. package/src/core/executions/index.ts +0 -1
  97. package/src/core/executions/select.ts +55 -2
  98. package/src/core/islands/bootstrap.ts +0 -16
  99. package/src/core/notebook/replica/replica.ts +50 -3
  100. package/src/core/notebook/replica/resources/analysis.ts +9 -0
  101. package/src/core/session/__tests__/backend.test.ts +3 -12
  102. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +84 -0
  103. package/src/core/session/active-notebook.ts +6 -0
  104. package/src/core/session/backend.ts +4 -4
  105. package/src/core/session/useNotebookSession.tsx +0 -17
  106. package/src/stories/cell-status.stories.tsx +6 -6
  107. package/dist/assets/__vite-browser-external-DoIBUY2I.js +0 -1
  108. package/dist/feedback-button-Cypq285l.js +0 -370
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { NotebookClient, StreamStopped } from "@marimo-team/client";
6
6
  import type { NotebookId } from "@marimo-team/client/protocol";
7
- import { EDITOR_EVENT_KINDS, type NotebookBackend } from "../notebook/replica";
7
+ import type { NotebookBackend } from "../notebook/replica";
8
8
  import { PyodideBridge } from "../wasm/bridge";
9
9
  import { isWasm } from "../wasm/utils";
10
10
  import { sessionSse, websocket, withHeaders } from "../transports/server";
@@ -59,9 +59,9 @@ function afterStartup({
59
59
  });
60
60
  }
61
61
  }
62
- const target = new URL(url());
63
- target.searchParams.set("kinds", EDITOR_EVENT_KINDS.join(","));
64
- return target;
62
+ // The replica filters locally. A host may reject a filter naming an
63
+ // experimental kind it does not implement.
64
+ return new URL(url());
65
65
  };
66
66
  }
67
67
 
@@ -58,7 +58,6 @@ import {
58
58
  } from "../kernel/session";
59
59
  import { cellError } from "../executions/output";
60
60
  import { getCellLogsForMessage } from "../cells/logs";
61
- import { setCellBlocked } from "../executions";
62
61
  import { initialRunCompletedAtom } from "../kernel/state";
63
62
  import { useLayoutActions } from "../layout/state";
64
63
  import { kioskModeAtom } from "../mode";
@@ -91,7 +90,6 @@ export function useNotebookSession(opts: { sessionId: SessionId }) {
91
90
  const store = useStore();
92
91
 
93
92
  const {
94
- setCellReusability,
95
93
  showCommandOutput,
96
94
  hideConsoleInputs,
97
95
  clearDebuggerOutput,
@@ -224,21 +222,6 @@ export function useNotebookSession(opts: { sessionId: SessionId }) {
224
222
  inputIds: msg.data.input_ids,
225
223
  });
226
224
  return;
227
- case "cell-op":
228
- if (msg.data.status != null) {
229
- setCellBlocked(
230
- store,
231
- msg.data.cell_id,
232
- msg.data.status === "disabled-transitively",
233
- );
234
- }
235
- if (msg.data.serialization !== undefined) {
236
- setCellReusability({
237
- cell_id: msg.data.cell_id,
238
- serialization: msg.data.serialization,
239
- });
240
- }
241
- return;
242
225
  case "callback-output":
243
226
  VirtualFileTracker.INSTANCE.trackCallbackOutput(msg.data);
244
227
  showCommandOutput(msg.data);
@@ -87,7 +87,7 @@ export const DisabledTransitively = Template.bind({});
87
87
  DisabledTransitively.args = {
88
88
  editing: true,
89
89
  status: "idle",
90
- blocked: true,
90
+ blocked: "current",
91
91
  freshness: { sourceChanged: false, inputsChanged: false },
92
92
  interrupted: false,
93
93
  disabled: false,
@@ -98,7 +98,7 @@ export const DisabledTransitivelyAndEdited = Template.bind({});
98
98
  DisabledTransitivelyAndEdited.args = {
99
99
  editing: true,
100
100
  status: "idle",
101
- blocked: true,
101
+ blocked: "current",
102
102
  freshness: { sourceChanged: true, inputsChanged: false },
103
103
  interrupted: false,
104
104
  disabled: false,
@@ -109,7 +109,7 @@ export const Stale = Template.bind({});
109
109
  Stale.args = {
110
110
  editing: true,
111
111
  status: "idle",
112
- blocked: true,
112
+ blocked: "current",
113
113
  freshness: { sourceChanged: false, inputsChanged: true },
114
114
  interrupted: false,
115
115
  disabled: false,
@@ -120,7 +120,7 @@ export const StaleAndDisabled = Template.bind({});
120
120
  StaleAndDisabled.args = {
121
121
  editing: true,
122
122
  status: "idle",
123
- blocked: true,
123
+ blocked: "current",
124
124
  freshness: { sourceChanged: false, inputsChanged: true },
125
125
  interrupted: false,
126
126
  disabled: true,
@@ -131,7 +131,7 @@ export const EditedStaleAndDisabled = Template.bind({});
131
131
  EditedStaleAndDisabled.args = {
132
132
  editing: true,
133
133
  status: "idle",
134
- blocked: true,
134
+ blocked: "current",
135
135
  freshness: { sourceChanged: false, inputsChanged: true },
136
136
  interrupted: false,
137
137
  disabled: true,
@@ -142,7 +142,7 @@ export const EditedAndStale = Template.bind({});
142
142
  EditedAndStale.args = {
143
143
  editing: true,
144
144
  status: "idle",
145
- blocked: true,
145
+ blocked: "current",
146
146
  freshness: { sourceChanged: true, inputsChanged: false },
147
147
  interrupted: false,
148
148
  disabled: false,
@@ -1 +0,0 @@
1
- import{t as e}from"./worker-DFvnFhLF.js";var t=/* @__PURE__ */ e(((e,t)=>{t.exports={}}));export default t();
@@ -1,370 +0,0 @@
1
- import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
- import { h as t, t as n } from "./button-qQhINE7z.js";
3
- import { t as r } from "./react-Bgs_wQh3.js";
4
- import { t as i } from "./compiler-runtime-C5KHtL5D.js";
5
- import { t as a } from "./copy-icon-CDvvlY90.js";
6
- import { D as o, I as s, K as c, O as l, P as u, an as d, en as f, i as p, n as m } from "./error-entries--YT1ZOUW.js";
7
- import { n as h, t as ee } from "./globals-DQXC3L6D.js";
8
- import { r as g } from "./assertNever-DOTNJ2Y4.js";
9
- import { t as _ } from "./jsx-runtime-D8btoEHk.js";
10
- import { Rt as te, St as ne, m as v } from "./use-restore-focus-BLj45Ibw.js";
11
- import { a as re, i as ie, n as ae, r as oe } from "./dialog-rgayPemF.js";
12
- import { t as se } from "./useAsyncData-P5-Oovhq.js";
13
- import { t as ce } from "./code-visibility-CWrFAfrs.js";
14
- //#region src/components/ui/skeleton.tsx
15
- var y = /* @__PURE__ */ e(r(), 1), b = i(), x = _(), le = (e) => {
16
- let n = (0, b.c)(8), r, i;
17
- n[0] === e ? (r = n[1], i = n[2]) : ({className: r, ...i} = e, n[0] = e, n[1] = r, n[2] = i);
18
- let a;
19
- n[3] === r ? a = n[4] : (a = t("animate-pulse rounded-md bg-muted", r), n[3] = r, n[4] = a);
20
- let o;
21
- return n[5] !== i || n[6] !== a ? (o = /* @__PURE__ */ (0, x.jsx)("div", {
22
- className: a,
23
- ...i
24
- }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
25
- };
26
- //#endregion
27
- //#region src/core/diagnostics/issue-details.ts
28
- function ue(e, t) {
29
- return {
30
- ...e,
31
- Binaries: {
32
- ...e.Binaries,
33
- Browser: t
34
- }
35
- };
36
- }
37
- function de(e, t, n, r) {
38
- return {
39
- marimo: e,
40
- Locale: n || void 0,
41
- Binaries: { Browser: t },
42
- "Environment Collection Error": r
43
- };
44
- }
45
- function S(e, t) {
46
- let n = Math.max(2, ...Array.from(t.matchAll(/`+/g), (e) => e[0].length)), r = "`".repeat(n + 1);
47
- return `${r}${e}\n${t}\n${r}`;
48
- }
49
- function fe(e, t) {
50
- let n = e.includes("?") ? "&" : "?", r = [], i = e, a = 0;
51
- for (let [e, o] of Object.entries(t)) {
52
- if (o.length === 0) continue;
53
- let t = `${e}=${encodeURIComponent(o)}`, s = `${i}${a === 0 ? n : "&"}${t}`;
54
- s.length > 6e3 ? r.push(e) : (i = s, a += 1);
55
- }
56
- return {
57
- url: i,
58
- omitted: r
59
- };
60
- }
61
- function C(e, t) {
62
- return [
63
- "<details>",
64
- `<summary>${g.htmlEscape(e) ?? ""}</summary>`,
65
- "",
66
- t,
67
- "",
68
- "</details>"
69
- ].join("\n");
70
- }
71
- function pe(e) {
72
- return C("Environment", S("json", JSON.stringify(e, null, 2)));
73
- }
74
- function me(e) {
75
- return C("Errors", S("text", e.map(m).join("\n\n---\n\n")));
76
- }
77
- function he(e) {
78
- return C("Code", S("python", e));
79
- }
80
- //#endregion
81
- //#region src/hooks/useLocalStorage.ts
82
- function ge(e, t) {
83
- let n = (0, b.c)(11), r;
84
- n[0] === t ? r = n[1] : (r = new u(t), n[0] = t, n[1] = r);
85
- let i = r, a;
86
- n[2] !== e || n[3] !== i ? (a = () => i.get(e), n[2] = e, n[3] = i, n[4] = a) : a = n[4];
87
- let [o, s] = (0, y.useState)(a), c;
88
- n[5] !== e || n[6] !== i ? (c = (t) => {
89
- s(t), i.set(e, t);
90
- }, n[5] = e, n[6] = i, n[7] = c) : c = n[7];
91
- let l = c, d;
92
- return n[8] !== l || n[9] !== o ? (d = [o, l], n[8] = l, n[9] = o, n[10] = d) : d = n[10], d;
93
- }
94
- var _e = (e) => {
95
- let r = (0, b.c)(16), { content: i } = e, [a, o] = (0, y.useState)(!1), s = !a && "max-h-24 overflow-hidden", c;
96
- r[0] === s ? c = r[1] : (c = t("text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap", s), r[0] = s, r[1] = c);
97
- let l;
98
- r[2] !== i || r[3] !== c ? (l = /* @__PURE__ */ (0, x.jsx)("pre", {
99
- className: c,
100
- children: i
101
- }), r[2] = i, r[3] = c, r[4] = l) : l = r[4];
102
- let u;
103
- r[5] === a ? u = r[6] : (u = !a && /* @__PURE__ */ (0, x.jsx)("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted" }), r[5] = a, r[6] = u);
104
- let d;
105
- r[7] !== l || r[8] !== u ? (d = /* @__PURE__ */ (0, x.jsxs)("div", {
106
- className: "relative",
107
- children: [l, u]
108
- }), r[7] = l, r[8] = u, r[9] = d) : d = r[9];
109
- let f;
110
- r[10] === Symbol.for("react.memo_cache_sentinel") ? (f = () => o(T), r[10] = f) : f = r[10];
111
- let p = a ? "Show less" : "Show more", m;
112
- r[11] === p ? m = r[12] : (m = /* @__PURE__ */ (0, x.jsx)(n, {
113
- type: "button",
114
- variant: "link",
115
- size: "xs",
116
- className: "self-start",
117
- onClick: f,
118
- children: p
119
- }), r[11] = p, r[12] = m);
120
- let h;
121
- return r[13] !== d || r[14] !== m ? (h = /* @__PURE__ */ (0, x.jsxs)("div", {
122
- className: "flex flex-col gap-1",
123
- children: [d, m]
124
- }), r[13] = d, r[14] = m, r[15] = h) : h = r[15], h;
125
- };
126
- function ve(e) {
127
- if (!e.hasRequestClient) return "Notebook source is unavailable.";
128
- if (e.filename === null) return "Save the notebook first.";
129
- if (!e.codeAvailable) return "Notebook source is hidden in this view.";
130
- if (e.connectionState !== f.OPEN) return "Connect the notebook to include its source.";
131
- }
132
- var w = () => {
133
- let e = (0, b.c)(56), t = te(c), r, i;
134
- e[0] === t ? (r = e[1], i = e[2]) : (r = async () => {
135
- if (t != null) return t.getEnvironmentInfo();
136
- }, i = [t], e[0] = t, e[1] = r, e[2] = i);
137
- let u = se(r, i), f = p(ne), g = ce(), _ = te(s), y = te(l), S = t != null, C;
138
- e[3] !== g || e[4] !== y.state || e[5] !== _ || e[6] !== S ? (C = ve({
139
- hasRequestClient: S,
140
- filename: _,
141
- codeAvailable: g,
142
- connectionState: y.state
143
- }), e[3] = g, e[4] = y.state, e[5] = _, e[6] = S, e[7] = C) : C = e[7];
144
- let w = C, T = w === void 0, [E, D] = ge("marimo:issue-report:include-errors", !1), [O, be] = ge("marimo:issue-report:include-code", !1), k = u.data ? ue(u.data, navigator.userAgent) : u.status === "error" || t == null ? de(ee(), navigator.userAgent, navigator.language, "Server environment information unavailable") : void 0, A, j;
145
- e[8] !== O || e[9] !== T || e[10] !== t ? (A = async () => {
146
- if (!O || !T || t == null) return;
147
- let { contents: e } = await t.readCode();
148
- return e;
149
- }, j = [
150
- O,
151
- T,
152
- t
153
- ], e[8] = O, e[9] = T, e[10] = t, e[11] = A, e[12] = j) : (A = e[11], j = e[12]);
154
- let M = se(A, j), xe = v.bugReportUrl, Se = [];
155
- if (k) {
156
- let e = { env: pe(k) };
157
- E && f.length > 0 && (e["bug-description"] = me(f)), O && M.data && (e["reproduction-code"] = he(M.data)), {url: xe, omitted: Se} = fe(v.bugReportUrl, e);
158
- }
159
- let Ce = Se.map(ye).join(", "), N;
160
- e[13] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ (0, x.jsxs)(ie, { children: [/* @__PURE__ */ (0, x.jsx)(re, { children: "Report an issue" }), /* @__PURE__ */ (0, x.jsx)(oe, { children: "Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting." })] }), e[13] = N) : N = e[13];
161
- let P;
162
- e[14] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ (0, x.jsx)(d, { className: "w-4 h-4 mr-2" }), e[14] = P) : P = e[14];
163
- let F = f.length === 0, I;
164
- e[15] === D ? I = e[16] : (I = (e) => D(e === !0), e[15] = D, e[16] = I);
165
- let L;
166
- e[17] !== E || e[18] !== F || e[19] !== I ? (L = /* @__PURE__ */ (0, x.jsx)(o, {
167
- id: "issue-include-errors",
168
- checked: E,
169
- disabled: F,
170
- onCheckedChange: I,
171
- "aria-label": "Include errors"
172
- }), e[17] = E, e[18] = F, e[19] = I, e[20] = L) : L = e[20];
173
- let R;
174
- e[21] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ (0, x.jsx)("label", {
175
- htmlFor: "issue-include-errors",
176
- children: "Include errors"
177
- }), e[21] = R) : R = e[21];
178
- let z;
179
- e[22] === L ? z = e[23] : (z = /* @__PURE__ */ (0, x.jsxs)("div", {
180
- className: "flex items-center gap-2 text-sm",
181
- children: [L, R]
182
- }), e[22] = L, e[23] = z);
183
- let B = !T, V;
184
- e[24] === be ? V = e[25] : (V = (e) => be(e === !0), e[24] = be, e[25] = V);
185
- let H;
186
- e[26] !== O || e[27] !== B || e[28] !== V ? (H = /* @__PURE__ */ (0, x.jsx)(o, {
187
- id: "issue-include-code",
188
- checked: O,
189
- disabled: B,
190
- onCheckedChange: V,
191
- "aria-label": "Include notebook code"
192
- }), e[26] = O, e[27] = B, e[28] = V, e[29] = H) : H = e[29];
193
- let U;
194
- e[30] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ (0, x.jsx)("label", {
195
- htmlFor: "issue-include-code",
196
- children: "Include notebook code"
197
- }), e[30] = U) : U = e[30];
198
- let W;
199
- e[31] === H ? W = e[32] : (W = /* @__PURE__ */ (0, x.jsxs)("div", {
200
- className: "flex items-center gap-2 text-sm",
201
- children: [H, U]
202
- }), e[31] = H, e[32] = W);
203
- let G;
204
- e[33] === w ? G = e[34] : (G = w && /* @__PURE__ */ (0, x.jsx)("span", {
205
- className: "text-xs text-muted-foreground ml-6",
206
- children: w
207
- }), e[33] = w, e[34] = G);
208
- let K;
209
- e[35] !== M || e[36] !== O ? (K = O && M.status === "error" && /* @__PURE__ */ (0, x.jsx)("span", {
210
- className: "text-xs text-(--red-11) ml-6",
211
- children: "Notebook source could not be loaded."
212
- }), e[35] = M, e[36] = O, e[37] = K) : K = e[37];
213
- let q;
214
- e[38] !== W || e[39] !== G || e[40] !== K ? (q = /* @__PURE__ */ (0, x.jsxs)("div", {
215
- className: "flex flex-col gap-1",
216
- children: [
217
- W,
218
- G,
219
- K
220
- ]
221
- }), e[38] = W, e[39] = G, e[40] = K, e[41] = q) : q = e[41];
222
- let J;
223
- e[42] !== z || e[43] !== q ? (J = /* @__PURE__ */ (0, x.jsxs)("div", {
224
- className: "flex flex-col gap-2",
225
- children: [z, q]
226
- }), e[42] = z, e[43] = q, e[44] = J) : J = e[44];
227
- let Y;
228
- e[45] !== u.status || e[46] !== t ? (Y = u.status === "pending" && t != null && /* @__PURE__ */ (0, x.jsxs)("div", {
229
- className: "flex flex-col gap-2",
230
- children: [
231
- /* @__PURE__ */ (0, x.jsx)("span", {
232
- className: "text-sm text-muted-foreground",
233
- children: "Loading environment details…"
234
- }),
235
- /* @__PURE__ */ (0, x.jsx)(le, { className: "h-4 w-full" }),
236
- /* @__PURE__ */ (0, x.jsx)(le, { className: "h-4 w-3/4" }),
237
- /* @__PURE__ */ (0, x.jsx)(le, { className: "h-4 w-1/2" })
238
- ]
239
- }), e[45] = u.status, e[46] = t, e[47] = Y) : Y = e[47];
240
- let X;
241
- e[48] !== u || e[49] !== t ? (X = (u.status === "error" || t == null) && /* @__PURE__ */ (0, x.jsxs)("div", {
242
- className: "flex items-center gap-2 text-sm",
243
- children: [
244
- /* @__PURE__ */ (0, x.jsx)(h, { className: "w-4 h-4 text-(--yellow-11) shrink-0" }),
245
- /* @__PURE__ */ (0, x.jsx)("span", { children: "Server environment information unavailable" }),
246
- t != null && /* @__PURE__ */ (0, x.jsx)(n, {
247
- type: "button",
248
- variant: "link",
249
- size: "xs",
250
- onClick: () => u.refetch(),
251
- children: "Retry"
252
- })
253
- ]
254
- }), e[48] = u, e[49] = t, e[50] = X) : X = e[50];
255
- let Z;
256
- e[51] !== k || e[52] !== f ? (Z = k && f.length === 0 && /* @__PURE__ */ (0, x.jsx)("span", {
257
- className: "text-sm text-muted-foreground",
258
- children: "No errors detected."
259
- }), e[51] = k, e[52] = f, e[53] = Z) : Z = e[53];
260
- let Q;
261
- e[54] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ (0, x.jsx)("a", {
262
- href: v.feedbackForm,
263
- target: "_blank",
264
- rel: "noreferrer",
265
- className: "underline",
266
- children: "two-minute survey"
267
- }), e[54] = Q) : Q = e[54];
268
- let $;
269
- return e[55] === Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ (0, x.jsx)("div", {
270
- className: "border-t pt-3",
271
- children: /* @__PURE__ */ (0, x.jsxs)("p", {
272
- className: "text-sm text-muted-foreground",
273
- children: [
274
- "Other feedback? Take our",
275
- " ",
276
- Q,
277
- " ",
278
- "or chat with us on",
279
- " ",
280
- /* @__PURE__ */ (0, x.jsx)("a", {
281
- href: v.discordLink,
282
- target: "_blank",
283
- rel: "noreferrer",
284
- className: "underline",
285
- children: "Discord"
286
- }),
287
- "."
288
- ]
289
- })
290
- }), e[55] = $) : $ = e[55], /* @__PURE__ */ (0, x.jsxs)(ae, {
291
- className: "w-[540px] max-w-[90vw]",
292
- children: [N, /* @__PURE__ */ (0, x.jsxs)("div", {
293
- className: "flex flex-col gap-4 max-h-[60vh] overflow-y-auto",
294
- children: [
295
- /* @__PURE__ */ (0, x.jsxs)("div", {
296
- className: "flex flex-col gap-3",
297
- children: [
298
- /* @__PURE__ */ (0, x.jsx)(n, {
299
- type: "button",
300
- variant: "default",
301
- size: "xs",
302
- asChild: !0,
303
- className: "self-start",
304
- children: /* @__PURE__ */ (0, x.jsxs)("a", {
305
- href: xe,
306
- target: "_blank",
307
- rel: "noreferrer",
308
- children: [P, "Open GitHub issue"]
309
- })
310
- }),
311
- J,
312
- Ce ? /* @__PURE__ */ (0, x.jsxs)("div", {
313
- className: "flex items-start gap-2 text-xs text-(--yellow-11)",
314
- children: [/* @__PURE__ */ (0, x.jsx)(h, { className: "w-3.5 h-3.5 shrink-0 mt-0.5" }), /* @__PURE__ */ (0, x.jsxs)("span", { children: [
315
- "Too large to prefill and left out of the link: ",
316
- Ce,
317
- ". Paste them into the issue manually."
318
- ] })]
319
- }) : /* @__PURE__ */ (0, x.jsx)("p", {
320
- className: "text-xs text-muted-foreground",
321
- children: "Your environment is always included."
322
- })
323
- ]
324
- }),
325
- Y,
326
- X,
327
- k && /* @__PURE__ */ (0, x.jsxs)("div", {
328
- className: "flex flex-col gap-1",
329
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
330
- className: "flex items-center justify-between",
331
- children: [/* @__PURE__ */ (0, x.jsx)("span", {
332
- className: "text-sm font-medium",
333
- children: "Environment details"
334
- }), /* @__PURE__ */ (0, x.jsx)(a, {
335
- className: "w-3.5 h-3.5",
336
- value: JSON.stringify(k, null, 2),
337
- ariaLabel: "Copy environment JSON",
338
- toastTitle: "Environment details copied"
339
- })]
340
- }), /* @__PURE__ */ (0, x.jsx)(_e, { content: JSON.stringify(k, null, 2) })]
341
- }),
342
- k && f.length > 0 && /* @__PURE__ */ (0, x.jsxs)("div", {
343
- className: "flex flex-col gap-1",
344
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
345
- className: "flex items-center justify-between",
346
- children: [/* @__PURE__ */ (0, x.jsx)("span", {
347
- className: "text-sm font-medium",
348
- children: "Errors"
349
- }), /* @__PURE__ */ (0, x.jsx)(a, {
350
- className: "w-3.5 h-3.5",
351
- value: me(f),
352
- ariaLabel: "Copy errors",
353
- toastTitle: "Errors copied"
354
- })]
355
- }), /* @__PURE__ */ (0, x.jsx)(_e, { content: f.map(m).join("\n\n---\n\n") })]
356
- }),
357
- Z,
358
- $
359
- ]
360
- })]
361
- });
362
- };
363
- function T(e) {
364
- return !e;
365
- }
366
- function ye(e) {
367
- return e === "bug-description" ? "errors" : e === "reproduction-code" ? "code" : e;
368
- }
369
- //#endregion
370
- export { w as FeedbackModal };