@marimo-team/islands 0.25.3-dev192 → 0.25.3-dev193

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 (154) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BBbOElk3.js → ConnectedDataExplorerComponent-BRuwLOIx.js} +9 -9
  2. package/dist/{ErrorBoundary-Dw6uRKVk.js → ErrorBoundary-BVu_xT-p.js} +2 -2
  3. package/dist/{abnfDiagram-VCTEODGH-DhMT6Uhd.js → abnfDiagram-VCTEODGH-LlJTOOU_.js} +2 -2
  4. package/dist/{architectureDiagram-5GKGNRK7-BVbEiJLq.js → architectureDiagram-5GKGNRK7-9PQtGLLZ.js} +1 -1
  5. package/dist/{arrays-R6JsImiT.js → arrays-DA6KkLfq.js} +6 -12
  6. package/dist/assets/__vite-browser-external-BCJsx8QS.js +1 -0
  7. package/dist/assets/{worker-C6e9ERyd.js → worker-DodjWT_Z.js} +2 -2
  8. package/dist/{capabilities-CI4xUPsp.js → capabilities-CvWU-ey_.js} +1 -1
  9. package/dist/{chat-ui-BguxTQEL.js → chat-ui-Bl2euMBD.js} +93 -93
  10. package/dist/{chunk-IMKFNOWR-By5hSbJJ.js → chunk-IMKFNOWR-DcXv-BD5.js} +1 -1
  11. package/dist/{chunk-SHT3W25Y-DFrEYG54.js → chunk-SHT3W25Y-VwnELN23.js} +1 -1
  12. package/dist/{chunk-SVP7TREG-DFXGc9ew.js → chunk-SVP7TREG-DgQpI5Zi.js} +1 -1
  13. package/dist/{chunk-TICWLB2K-DZdNIpoZ.js → chunk-TICWLB2K-CTg6VTJT.js} +1 -1
  14. package/dist/{classDiagram-ZZMXUADV-Cgj_eEQA.js → classDiagram-ZZMXUADV-UzmcFrnW.js} +2 -2
  15. package/dist/{classDiagram-v2-VYDZK3BY-DLAUrSqj.js → classDiagram-v2-VYDZK3BY-DhjiI6IQ.js} +2 -2
  16. package/dist/{code-visibility-v_7ijLtx.js → code-visibility-BTVimCUw.js} +38 -42
  17. package/dist/{common-BUwWHpnK.js → common-fTgq7gO-.js} +849 -849
  18. package/dist/{cynefinDiagram-5FMLGOSQ-Cikf9AKa.js → cynefinDiagram-5FMLGOSQ-O4ShIbJX.js} +1 -1
  19. package/dist/{dagre-GXQ25YYZ-C5KEi5_l.js → dagre-GXQ25YYZ-dtHhhcPu.js} +1 -1
  20. package/dist/{data-grid-overlay-editor-4IZymnXZ.js → data-grid-overlay-editor-DAZZkLWg.js} +1 -1
  21. package/dist/{diagram-S7CK7UJ4-BaoBTQjR.js → diagram-S7CK7UJ4-ppPYVZ6W.js} +1 -1
  22. package/dist/{diagram-UQ7AKVKN-DDufBsUA.js → diagram-UQ7AKVKN-CMZDf--k.js} +1 -1
  23. package/dist/{diagram-VX7I27RA-CY6RALJ8.js → diagram-VX7I27RA-CFvJdx-C.js} +1 -1
  24. package/dist/{diagram-Z3DM3KII-Bc-LHsD6.js → diagram-Z3DM3KII-Dt6_uFbv.js} +1 -1
  25. package/dist/{dropdown-menu-drDjxJyV.js → dropdown-menu-CeaOsjWZ.js} +2 -2
  26. package/dist/{ebnfDiagram-PWID7BFC-Cz0J-tcC.js → ebnfDiagram-PWID7BFC-DpRFrKK-.js} +2 -2
  27. package/dist/{erDiagram-RLTQ6QDP-DTXTDgFu.js → erDiagram-RLTQ6QDP-CqAU4b0u.js} +1 -1
  28. package/dist/{error-entries-CZ1NQ6Kv.js → error-entries-CYGwr5-O.js} +5596 -6012
  29. package/dist/feedback-button-DzFFn-n4.js +374 -0
  30. package/dist/{flowDiagram-HODETNUW-RbwWf2zc.js → flowDiagram-HODETNUW-i8-Gw8HO.js} +2 -2
  31. package/dist/{formats-DbXnijtH.js → formats-BtoHHy42.js} +1 -1
  32. package/dist/{glide-data-editor-DU8_EDG5.js → glide-data-editor-DFsqVbWR.js} +5 -5
  33. package/dist/{globals-BeBDOk22.js → globals-Dr0MRANu.js} +2 -2
  34. package/dist/{html-to-image-D_4_hQ8U.js → html-to-image-Cy5UDpQJ.js} +56 -56
  35. package/dist/{infoDiagram-27XIBGKW-DlmzZjmI.js → infoDiagram-27XIBGKW-DpfOKdLL.js} +1 -1
  36. package/dist/{ishikawaDiagram-5VMMS53U-EN3TYP_q.js → ishikawaDiagram-5VMMS53U-Dg7mrMG7.js} +1 -1
  37. package/dist/{kanban-definition-UXKFOSKX-CK_-Ru7Q.js → kanban-definition-UXKFOSKX-QB6e3Jrj.js} +1 -1
  38. package/dist/main.js +5875 -5876
  39. package/dist/{mermaid-DU9ZRmkG.js → mermaid-CeWG4Egr.js} +48 -48
  40. package/dist/{mindmap-definition-YA3MSWOX-C-hqgUvF.js → mindmap-definition-YA3MSWOX-BTz3uTGe.js} +1 -1
  41. package/dist/{number-overlay-editor-BoIkyh6H.js → number-overlay-editor-DupOSYHx.js} +1 -1
  42. package/dist/{once-eG8Vmvjd.js → once-DWGO2mQ2.js} +1 -1
  43. package/dist/{pegDiagram-XKGWAZYB-BiMejYPB.js → pegDiagram-XKGWAZYB-3ZIEa3mB.js} +2 -2
  44. package/dist/{pieDiagram-E7YTZNPT-B1zCZ1eq.js → pieDiagram-E7YTZNPT-BJAlk046.js} +1 -1
  45. package/dist/{process-output-DxSCHBWp.js → process-output-q9MTAIMX.js} +2 -2
  46. package/dist/{railroadDiagram-O6MQD6OU-BLcfaASl.js → railroadDiagram-O6MQD6OU-Dn3bsSRa.js} +2 -2
  47. package/dist/{requirementDiagram-BXWQKSXE-DtBOf52-.js → requirementDiagram-BXWQKSXE-wcOmQQCL.js} +1 -1
  48. package/dist/{reveal-component-5M3a2rpj.js → reveal-component-Bg8rP_Uo.js} +17 -17
  49. package/dist/{sequenceDiagram-WJ2MYXX4-DIwF19_n.js → sequenceDiagram-WJ2MYXX4-DSh_qxoF.js} +1 -1
  50. package/dist/{spec-DZDnnlgT.js → spec-C7Fos-If.js} +1 -1
  51. package/dist/{stateDiagram-D77RDMKH-sWk1AdYL.js → stateDiagram-D77RDMKH-DH_H8NMH.js} +2 -2
  52. package/dist/{stateDiagram-v2-MP3YSRHH-CiNo-OI7.js → stateDiagram-v2-MP3YSRHH-D_JM7MEK.js} +2 -2
  53. package/dist/style.css +1 -1
  54. package/dist/{swimlanes-42K2YHIH-Bj3hiOY5.js → swimlanes-42K2YHIH-CfoTJO-9.js} +1 -1
  55. package/dist/{swimlanesDiagram-VR7AAH4N-BzEo2r_N.js → swimlanesDiagram-VR7AAH4N-Z_QhvK0G.js} +2 -2
  56. package/dist/{swiper-component-BkCm-kLg.js → swiper-component-D2geL1Ku.js} +1 -1
  57. package/dist/{timeline-definition-24CTP7MA-CrPQk42H.js → timeline-definition-24CTP7MA-BFtdScaL.js} +1 -1
  58. package/dist/{toDate-Cu2pIZcC.js → toDate-CQAFSwos.js} +24 -24
  59. package/dist/{useAsyncData-DEhLdRIu.js → useAsyncData-BeyZyjso.js} +1 -1
  60. package/dist/{useDeepCompareMemoize-RjZGVhBV.js → useDeepCompareMemoize-DOQgae0W.js} +1 -1
  61. package/dist/{useIframeCapabilities-CSdWn6NP.js → useIframeCapabilities-DNvaj9wM.js} +1 -1
  62. package/dist/{useLifecycle-DtcB2s1z.js → useLifecycle-n2lnCFS8.js} +1 -1
  63. package/dist/{useTheme-CoEtr4mK.js → useTheme-CY777LXN.js} +303 -99
  64. package/dist/{vega-component-BhjTrP9-.js → vega-component-0nQzA-I8.js} +6 -6
  65. package/dist/{vennDiagram-4TSXK5OY-BaYMoIpj.js → vennDiagram-4TSXK5OY-BXY8IGCA.js} +1 -1
  66. package/dist/{wardleyDiagram-VM6X3IG4-DjHeuj8p.js → wardleyDiagram-VM6X3IG4-D0tFe6eC.js} +1 -1
  67. package/dist/{xychartDiagram-S5SC5T6Z-Bc_hcuXS.js → xychartDiagram-S5SC5T6Z-Dx8wFM-y.js} +1 -1
  68. package/package.json +1 -1
  69. package/src/__mocks__/notebook.ts +0 -1
  70. package/src/__mocks__/partial.ts +26 -0
  71. package/src/__tests__/main.test.tsx +24 -1
  72. package/src/components/app-config/app-config-form.tsx +5 -9
  73. package/src/components/editor/__tests__/data-attributes.test.tsx +0 -1
  74. package/src/components/editor/__tests__/output-persistence.test.tsx +0 -1
  75. package/src/components/editor/actions/useCellActionButton.tsx +6 -5
  76. package/src/components/editor/actions/useConfigActions.tsx +3 -4
  77. package/src/components/editor/actions/useNotebookActions.tsx +5 -4
  78. package/src/components/editor/cell/code/cell-editor.tsx +13 -6
  79. package/src/components/editor/cell/collapse.tsx +6 -1
  80. package/src/components/editor/chrome/components/feedback-button.tsx +1 -7
  81. package/src/components/editor/controls/Controls.tsx +1 -1
  82. package/src/components/editor/errors/__tests__/send-error-report-button.test.tsx +8 -6
  83. package/src/components/editor/navigation/__tests__/navigation.test.ts +15 -15
  84. package/src/components/editor/navigation/__tests__/selection.test.ts +44 -21
  85. package/src/components/editor/navigation/focus-utils.ts +19 -0
  86. package/src/components/editor/navigation/multi-cell-action-toolbar.tsx +6 -13
  87. package/src/components/editor/navigation/navigation.ts +52 -43
  88. package/src/components/editor/navigation/selection.ts +30 -29
  89. package/src/components/editor/notebook-cell.tsx +10 -18
  90. package/src/components/editor/renderers/cell-array.tsx +6 -5
  91. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
  92. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -1
  93. package/src/components/pages/edit-page.tsx +0 -13
  94. package/src/components/scratchpad/scratchpad.tsx +0 -1
  95. package/src/components/slides/reveal-component.tsx +1 -1
  96. package/src/components/slides/slide-cell-view.tsx +0 -1
  97. package/src/components/sort/SortableCellsProvider.tsx +6 -5
  98. package/src/core/MarimoApp.tsx +1 -1
  99. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -37
  100. package/src/core/cells/__tests__/actions.test.ts +190 -80
  101. package/src/core/cells/__tests__/arrange.test.ts +263 -0
  102. package/src/core/cells/__tests__/cells.test.ts +11 -1101
  103. package/src/core/cells/__tests__/document.test.ts +3 -32
  104. package/src/core/cells/__tests__/editor.test.ts +57 -0
  105. package/src/core/cells/__tests__/harness.ts +82 -0
  106. package/src/core/cells/__tests__/layout.test.ts +189 -0
  107. package/src/core/cells/__tests__/notebook-outline.test.ts +7 -1
  108. package/src/core/cells/__tests__/session.test.ts +329 -174
  109. package/src/core/cells/__tests__/utils.test.ts +0 -1
  110. package/src/core/cells/actions.ts +247 -82
  111. package/src/core/cells/arrange.ts +341 -0
  112. package/src/core/cells/cells.ts +27 -516
  113. package/src/core/cells/document.ts +6 -5
  114. package/src/core/cells/edit.ts +30 -0
  115. package/src/core/cells/editor.ts +82 -0
  116. package/src/core/cells/layout.ts +152 -0
  117. package/src/core/cells/session.ts +75 -52
  118. package/src/core/cells/types.ts +0 -5
  119. package/src/core/cells/utils.ts +6 -4
  120. package/src/core/config/__tests__/app-config.test.ts +64 -0
  121. package/src/core/config/__tests__/config-schema.test.ts +1 -1
  122. package/src/core/config/config-schema.ts +6 -2
  123. package/src/core/config/config.ts +26 -12
  124. package/src/core/islands/bootstrap.ts +0 -1
  125. package/src/core/kernel/handlers.ts +1 -13
  126. package/src/core/meta/__tests__/code-visibility.test.tsx +78 -70
  127. package/src/core/meta/code-visibility.ts +18 -9
  128. package/src/core/notebook/__tests__/operations.test.ts +51 -0
  129. package/src/core/notebook/document/__tests__/codemirror.test.ts +15 -0
  130. package/src/core/notebook/index.ts +2 -1
  131. package/src/core/notebook/operations.ts +30 -0
  132. package/src/core/saving/__tests__/state.test.ts +111 -0
  133. package/src/core/saving/save-component.tsx +19 -33
  134. package/src/core/saving/state.ts +38 -39
  135. package/src/core/saving/useAutoSave.ts +8 -35
  136. package/src/core/session/__tests__/backend.test.ts +1 -0
  137. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +1 -0
  138. package/src/core/session/active-notebook.ts +11 -0
  139. package/src/core/session/backend.ts +17 -19
  140. package/src/core/session/embedded.ts +7 -0
  141. package/src/core/session/useNotebookReplica.ts +3 -1
  142. package/src/core/session/useNotebookSession.tsx +7 -8
  143. package/src/core/transports/__tests__/static.test.ts +139 -8
  144. package/src/core/transports/static.ts +98 -16
  145. package/src/core/wasm/__tests__/bridge.test.ts +1 -0
  146. package/src/mount.tsx +19 -10
  147. package/src/stories/cell.stories.tsx +0 -2
  148. package/src/stories/layout/vertical/one-column.stories.tsx +0 -2
  149. package/src/utils/__tests__/id-tree.test.ts +20 -1548
  150. package/src/utils/id-tree.tsx +12 -537
  151. package/dist/assets/__vite-browser-external-C8gQho07.js +0 -1
  152. package/dist/feedback-button-MpeoIn1D.js +0 -379
  153. package/src/components/editor/navigation/__tests__/state.test.ts +0 -81
  154. package/src/components/editor/navigation/state.ts +0 -65
@@ -1,379 +0,0 @@
1
- import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
- import { h as t, t as n } from "./button-BQRdqQi1.js";
3
- import { t as r } from "./react-sHtZdjeP.js";
4
- import { t as i } from "./compiler-runtime-CldRdSsv.js";
5
- import { t as a } from "./copy-icon-De584pZ4.js";
6
- import { Bt as o, H as s, J as c, K as l, Rt as u, i as d, kt as f, m as p, n as m, pn as h } from "./error-entries-CZ1NQ6Kv.js";
7
- import { b as g } from "./select-2KOiReNY.js";
8
- import { n as ee, t as te } from "./globals-BeBDOk22.js";
9
- import { t as _ } from "./jsx-runtime-3BD1kT0s.js";
10
- import { _ as ne, i as v, w as y } from "./useTheme-CoEtr4mK.js";
11
- import { a as re, i as ie, n as ae, r as oe } from "./dialog-DVRfQuhD.js";
12
- import { t as se } from "./useAsyncData-DEhLdRIu.js";
13
- import { t as ce } from "./code-visibility-v_7ijLtx.js";
14
- //#region src/components/ui/skeleton.tsx
15
- var b = /* @__PURE__ */ e(r(), 1), x = i(), S = _(), le = (e) => {
16
- let n = (0, x.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, S.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 C(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
- if (s.length > 6e3) {
55
- r.push(e);
56
- continue;
57
- }
58
- i = s, a += 1;
59
- }
60
- return {
61
- url: i,
62
- omitted: r
63
- };
64
- }
65
- function w(e, t) {
66
- return [
67
- "<details>",
68
- `<summary>${g.htmlEscape(e) ?? ""}</summary>`,
69
- "",
70
- t,
71
- "",
72
- "</details>"
73
- ].join("\n");
74
- }
75
- function pe(e) {
76
- return w("Environment", C("json", JSON.stringify(e, null, 2)));
77
- }
78
- function me(e) {
79
- return w("Errors", C("text", e.map(m).join("\n\n---\n\n")));
80
- }
81
- function he(e) {
82
- return w("Code", C("python", e));
83
- }
84
- //#endregion
85
- //#region src/hooks/useLocalStorage.ts
86
- function ge(e, t) {
87
- let n = (0, x.c)(11), r;
88
- n[0] === t ? r = n[1] : (r = new u(t), n[0] = t, n[1] = r);
89
- let i = r, a;
90
- n[2] !== e || n[3] !== i ? (a = () => i.get(e), n[2] = e, n[3] = i, n[4] = a) : a = n[4];
91
- let [o, s] = (0, b.useState)(a), c;
92
- n[5] !== e || n[6] !== i ? (c = (t) => {
93
- s(t), i.set(e, t);
94
- }, n[5] = e, n[6] = i, n[7] = c) : c = n[7];
95
- let l = c, d;
96
- return n[8] !== l || n[9] !== o ? (d = [o, l], n[8] = l, n[9] = o, n[10] = d) : d = n[10], d;
97
- }
98
- var _e = (e) => {
99
- let r = (0, x.c)(16), { content: i } = e, [a, o] = (0, b.useState)(!1), s = !a && "max-h-24 overflow-hidden", c;
100
- 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);
101
- let l;
102
- r[2] !== i || r[3] !== c ? (l = /* @__PURE__ */ (0, S.jsx)("pre", {
103
- className: c,
104
- children: i
105
- }), r[2] = i, r[3] = c, r[4] = l) : l = r[4];
106
- let u;
107
- r[5] === a ? u = r[6] : (u = !a && /* @__PURE__ */ (0, S.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);
108
- let d;
109
- r[7] !== l || r[8] !== u ? (d = /* @__PURE__ */ (0, S.jsxs)("div", {
110
- className: "relative",
111
- children: [l, u]
112
- }), r[7] = l, r[8] = u, r[9] = d) : d = r[9];
113
- let f;
114
- r[10] === Symbol.for("react.memo_cache_sentinel") ? (f = () => o(E), r[10] = f) : f = r[10];
115
- let p = a ? "Show less" : "Show more", m;
116
- r[11] === p ? m = r[12] : (m = /* @__PURE__ */ (0, S.jsx)(n, {
117
- type: "button",
118
- variant: "link",
119
- size: "xs",
120
- className: "self-start",
121
- onClick: f,
122
- children: p
123
- }), r[11] = p, r[12] = m);
124
- let h;
125
- return r[13] !== d || r[14] !== m ? (h = /* @__PURE__ */ (0, S.jsxs)("div", {
126
- className: "flex flex-col gap-1",
127
- children: [d, m]
128
- }), r[13] = d, r[14] = m, r[15] = h) : h = r[15], h;
129
- };
130
- function ve(e) {
131
- if (!e.hasRequestClient) return "Notebook source is unavailable.";
132
- if (e.filename === null) return "Save the notebook first.";
133
- if (!e.codeAvailable) return "Notebook source is hidden in this view.";
134
- if (e.connectionState !== c.OPEN) return "Connect the notebook to include its source.";
135
- }
136
- var T = () => {
137
- let e = (0, x.c)(61), t = y(f), r, i;
138
- e[0] === t ? (r = e[1], i = e[2]) : (r = async () => {
139
- if (t != null) return t.getEnvironmentInfo();
140
- }, i = [t], e[0] = t, e[1] = r, e[2] = i);
141
- let c = se(r, i), u = y(p), g = d(ne), _;
142
- if (e[3] !== u.cellData || e[4] !== u.cellIds.inOrderIds) {
143
- let t;
144
- e[6] === u.cellData ? t = e[7] : (t = (e) => u.cellData[e], e[6] = u.cellData, e[7] = t), _ = u.cellIds.inOrderIds.map(t), e[3] = u.cellData, e[4] = u.cellIds.inOrderIds, e[5] = _;
145
- } else _ = e[5];
146
- let b = ce(_), C = y(o), w = y(l), T = t != null, E;
147
- e[8] !== b || e[9] !== w.state || e[10] !== C || e[11] !== T ? (E = ve({
148
- hasRequestClient: T,
149
- filename: C,
150
- codeAvailable: b,
151
- connectionState: w.state
152
- }), e[8] = b, e[9] = w.state, e[10] = C, e[11] = T, e[12] = E) : E = e[12];
153
- let D = E, O = D === void 0, [k, be] = ge("marimo:issue-report:include-errors", !1), [A, xe] = ge("marimo:issue-report:include-code", !1), j = c.data ? ue(c.data, navigator.userAgent) : c.status === "error" || t == null ? de(te(), navigator.userAgent, navigator.language, "Server environment information unavailable") : void 0, M, N;
154
- e[13] !== A || e[14] !== O || e[15] !== t ? (M = async () => {
155
- if (!A || !O || t == null) return;
156
- let { contents: e } = await t.readCode();
157
- return e;
158
- }, N = [
159
- A,
160
- O,
161
- t
162
- ], e[13] = A, e[14] = O, e[15] = t, e[16] = M, e[17] = N) : (M = e[16], N = e[17]);
163
- let P = se(M, N), Se = v.bugReportUrl, Ce = [];
164
- if (j) {
165
- let e = { env: pe(j) };
166
- k && g.length > 0 && (e["bug-description"] = me(g)), A && P.data && (e["reproduction-code"] = he(P.data)), {url: Se, omitted: Ce} = fe(v.bugReportUrl, e);
167
- }
168
- let we = Ce.map(ye).join(", "), F;
169
- e[18] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ (0, S.jsxs)(ie, { children: [/* @__PURE__ */ (0, S.jsx)(re, { children: "Report an issue" }), /* @__PURE__ */ (0, S.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[18] = F) : F = e[18];
170
- let I;
171
- e[19] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ (0, S.jsx)(h, { className: "w-4 h-4 mr-2" }), e[19] = I) : I = e[19];
172
- let Te = g.length === 0, L;
173
- e[20] === be ? L = e[21] : (L = (e) => be(e === !0), e[20] = be, e[21] = L);
174
- let R;
175
- e[22] !== k || e[23] !== L || e[24] !== Te ? (R = /* @__PURE__ */ (0, S.jsx)(s, {
176
- id: "issue-include-errors",
177
- checked: k,
178
- disabled: Te,
179
- onCheckedChange: L,
180
- "aria-label": "Include errors"
181
- }), e[22] = k, e[23] = L, e[24] = Te, e[25] = R) : R = e[25];
182
- let z;
183
- e[26] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ (0, S.jsx)("label", {
184
- htmlFor: "issue-include-errors",
185
- children: "Include errors"
186
- }), e[26] = z) : z = e[26];
187
- let B;
188
- e[27] === R ? B = e[28] : (B = /* @__PURE__ */ (0, S.jsxs)("div", {
189
- className: "flex items-center gap-2 text-sm",
190
- children: [R, z]
191
- }), e[27] = R, e[28] = B);
192
- let Ee = !O, V;
193
- e[29] === xe ? V = e[30] : (V = (e) => xe(e === !0), e[29] = xe, e[30] = V);
194
- let H;
195
- e[31] !== A || e[32] !== Ee || e[33] !== V ? (H = /* @__PURE__ */ (0, S.jsx)(s, {
196
- id: "issue-include-code",
197
- checked: A,
198
- disabled: Ee,
199
- onCheckedChange: V,
200
- "aria-label": "Include notebook code"
201
- }), e[31] = A, e[32] = Ee, e[33] = V, e[34] = H) : H = e[34];
202
- let U;
203
- e[35] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ (0, S.jsx)("label", {
204
- htmlFor: "issue-include-code",
205
- children: "Include notebook code"
206
- }), e[35] = U) : U = e[35];
207
- let W;
208
- e[36] === H ? W = e[37] : (W = /* @__PURE__ */ (0, S.jsxs)("div", {
209
- className: "flex items-center gap-2 text-sm",
210
- children: [H, U]
211
- }), e[36] = H, e[37] = W);
212
- let G;
213
- e[38] === D ? G = e[39] : (G = D && /* @__PURE__ */ (0, S.jsx)("span", {
214
- className: "text-xs text-muted-foreground ml-6",
215
- children: D
216
- }), e[38] = D, e[39] = G);
217
- let K;
218
- e[40] !== P || e[41] !== A ? (K = A && P.status === "error" && /* @__PURE__ */ (0, S.jsx)("span", {
219
- className: "text-xs text-(--red-11) ml-6",
220
- children: "Notebook source could not be loaded."
221
- }), e[40] = P, e[41] = A, e[42] = K) : K = e[42];
222
- let q;
223
- e[43] !== W || e[44] !== G || e[45] !== K ? (q = /* @__PURE__ */ (0, S.jsxs)("div", {
224
- className: "flex flex-col gap-1",
225
- children: [
226
- W,
227
- G,
228
- K
229
- ]
230
- }), e[43] = W, e[44] = G, e[45] = K, e[46] = q) : q = e[46];
231
- let J;
232
- e[47] !== B || e[48] !== q ? (J = /* @__PURE__ */ (0, S.jsxs)("div", {
233
- className: "flex flex-col gap-2",
234
- children: [B, q]
235
- }), e[47] = B, e[48] = q, e[49] = J) : J = e[49];
236
- let Y;
237
- e[50] !== c.status || e[51] !== t ? (Y = c.status === "pending" && t != null && /* @__PURE__ */ (0, S.jsxs)("div", {
238
- className: "flex flex-col gap-2",
239
- children: [
240
- /* @__PURE__ */ (0, S.jsx)("span", {
241
- className: "text-sm text-muted-foreground",
242
- children: "Loading environment details…"
243
- }),
244
- /* @__PURE__ */ (0, S.jsx)(le, { className: "h-4 w-full" }),
245
- /* @__PURE__ */ (0, S.jsx)(le, { className: "h-4 w-3/4" }),
246
- /* @__PURE__ */ (0, S.jsx)(le, { className: "h-4 w-1/2" })
247
- ]
248
- }), e[50] = c.status, e[51] = t, e[52] = Y) : Y = e[52];
249
- let X;
250
- e[53] !== c || e[54] !== t ? (X = (c.status === "error" || t == null) && /* @__PURE__ */ (0, S.jsxs)("div", {
251
- className: "flex items-center gap-2 text-sm",
252
- children: [
253
- /* @__PURE__ */ (0, S.jsx)(ee, { className: "w-4 h-4 text-(--yellow-11) shrink-0" }),
254
- /* @__PURE__ */ (0, S.jsx)("span", { children: "Server environment information unavailable" }),
255
- t != null && /* @__PURE__ */ (0, S.jsx)(n, {
256
- type: "button",
257
- variant: "link",
258
- size: "xs",
259
- onClick: () => c.refetch(),
260
- children: "Retry"
261
- })
262
- ]
263
- }), e[53] = c, e[54] = t, e[55] = X) : X = e[55];
264
- let Z;
265
- e[56] !== j || e[57] !== g ? (Z = j && g.length === 0 && /* @__PURE__ */ (0, S.jsx)("span", {
266
- className: "text-sm text-muted-foreground",
267
- children: "No errors detected."
268
- }), e[56] = j, e[57] = g, e[58] = Z) : Z = e[58];
269
- let Q;
270
- e[59] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ (0, S.jsx)("a", {
271
- href: v.feedbackForm,
272
- target: "_blank",
273
- rel: "noreferrer",
274
- className: "underline",
275
- children: "two-minute survey"
276
- }), e[59] = Q) : Q = e[59];
277
- let $;
278
- return e[60] === Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ (0, S.jsx)("div", {
279
- className: "border-t pt-3",
280
- children: /* @__PURE__ */ (0, S.jsxs)("p", {
281
- className: "text-sm text-muted-foreground",
282
- children: [
283
- "Other feedback? Take our",
284
- " ",
285
- Q,
286
- " ",
287
- "or chat with us on",
288
- " ",
289
- /* @__PURE__ */ (0, S.jsx)("a", {
290
- href: v.discordLink,
291
- target: "_blank",
292
- rel: "noreferrer",
293
- className: "underline",
294
- children: "Discord"
295
- }),
296
- "."
297
- ]
298
- })
299
- }), e[60] = $) : $ = e[60], /* @__PURE__ */ (0, S.jsxs)(ae, {
300
- className: "w-[540px] max-w-[90vw]",
301
- children: [F, /* @__PURE__ */ (0, S.jsxs)("div", {
302
- className: "flex flex-col gap-4 max-h-[60vh] overflow-y-auto",
303
- children: [
304
- /* @__PURE__ */ (0, S.jsxs)("div", {
305
- className: "flex flex-col gap-3",
306
- children: [
307
- /* @__PURE__ */ (0, S.jsx)(n, {
308
- type: "button",
309
- variant: "default",
310
- size: "xs",
311
- asChild: !0,
312
- className: "self-start",
313
- children: /* @__PURE__ */ (0, S.jsxs)("a", {
314
- href: Se,
315
- target: "_blank",
316
- rel: "noreferrer",
317
- children: [I, "Open GitHub issue"]
318
- })
319
- }),
320
- J,
321
- we ? /* @__PURE__ */ (0, S.jsxs)("div", {
322
- className: "flex items-start gap-2 text-xs text-(--yellow-11)",
323
- children: [/* @__PURE__ */ (0, S.jsx)(ee, { className: "w-3.5 h-3.5 shrink-0 mt-0.5" }), /* @__PURE__ */ (0, S.jsxs)("span", { children: [
324
- "Too large to prefill and left out of the link: ",
325
- we,
326
- ". Paste them into the issue manually."
327
- ] })]
328
- }) : /* @__PURE__ */ (0, S.jsx)("p", {
329
- className: "text-xs text-muted-foreground",
330
- children: "Your environment is always included."
331
- })
332
- ]
333
- }),
334
- Y,
335
- X,
336
- j && /* @__PURE__ */ (0, S.jsxs)("div", {
337
- className: "flex flex-col gap-1",
338
- children: [/* @__PURE__ */ (0, S.jsxs)("div", {
339
- className: "flex items-center justify-between",
340
- children: [/* @__PURE__ */ (0, S.jsx)("span", {
341
- className: "text-sm font-medium",
342
- children: "Environment details"
343
- }), /* @__PURE__ */ (0, S.jsx)(a, {
344
- className: "w-3.5 h-3.5",
345
- value: JSON.stringify(j, null, 2),
346
- ariaLabel: "Copy environment JSON",
347
- toastTitle: "Environment details copied"
348
- })]
349
- }), /* @__PURE__ */ (0, S.jsx)(_e, { content: JSON.stringify(j, null, 2) })]
350
- }),
351
- j && g.length > 0 && /* @__PURE__ */ (0, S.jsxs)("div", {
352
- className: "flex flex-col gap-1",
353
- children: [/* @__PURE__ */ (0, S.jsxs)("div", {
354
- className: "flex items-center justify-between",
355
- children: [/* @__PURE__ */ (0, S.jsx)("span", {
356
- className: "text-sm font-medium",
357
- children: "Errors"
358
- }), /* @__PURE__ */ (0, S.jsx)(a, {
359
- className: "w-3.5 h-3.5",
360
- value: me(g),
361
- ariaLabel: "Copy errors",
362
- toastTitle: "Errors copied"
363
- })]
364
- }), /* @__PURE__ */ (0, S.jsx)(_e, { content: g.map(m).join("\n\n---\n\n") })]
365
- }),
366
- Z,
367
- $
368
- ]
369
- })]
370
- });
371
- };
372
- function E(e) {
373
- return !e;
374
- }
375
- function ye(e) {
376
- return e === "bug-description" ? "errors" : e === "reproduction-code" ? "code" : e;
377
- }
378
- //#endregion
379
- export { T as FeedbackModal };
@@ -1,81 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
- import { cellId } from "@/__tests__/branded";
5
- import { type CellId, HTMLCellId } from "@/core/cells/ids";
6
-
7
- const mockScrollCellIntoView = vi.fn();
8
- const mockRaf2 = vi.fn((callback: () => void) => callback());
9
-
10
- vi.mock("../focus-utils", () => ({
11
- scrollCellIntoView: mockScrollCellIntoView,
12
- raf2: mockRaf2,
13
- }));
14
-
15
- type TemporarilyShownCodeState = Set<CellId>;
16
-
17
- describe("temporarilyShownCodeActions", () => {
18
- const cid = cellId("cell-1");
19
- let cellElement: HTMLElement;
20
-
21
- beforeEach(() => {
22
- cellElement = document.createElement("div");
23
- cellElement.id = HTMLCellId.create(cid);
24
- document.body.append(cellElement);
25
- cellElement.focus();
26
-
27
- vi.spyOn(HTMLCellId, "findElementThroughShadowDOMs").mockReturnValue(
28
- cellElement as HTMLElement & { id: HTMLCellId },
29
- );
30
-
31
- mockScrollCellIntoView.mockClear();
32
- mockRaf2.mockClear();
33
- });
34
-
35
- afterEach(() => {
36
- cellElement.remove();
37
- vi.restoreAllMocks();
38
- });
39
-
40
- it("should scroll cell into view when removing cell causes layout shift", () => {
41
- const state = new Set<CellId>([cid]);
42
- removeCell(state, cid);
43
-
44
- expect(mockScrollCellIntoView).toHaveBeenCalledWith(cid);
45
- });
46
-
47
- it("should not scroll when focused cell is not found", () => {
48
- vi.spyOn(HTMLCellId, "findElementThroughShadowDOMs").mockReturnValue(null);
49
-
50
- const state = new Set<CellId>([cid]);
51
- removeCell(state, cid);
52
-
53
- expect(mockScrollCellIntoView).not.toHaveBeenCalled();
54
- });
55
- });
56
-
57
- // Helper function that replicates the remove reducer logic
58
- function removeCell(
59
- state: TemporarilyShownCodeState,
60
- cellId: CellId,
61
- ): TemporarilyShownCodeState {
62
- if (!state.has(cellId)) {
63
- return state;
64
- }
65
- const newState = new Set(state);
66
- newState.delete(cellId);
67
-
68
- mockRaf2(() => {
69
- const activeElement = document.activeElement;
70
- if (!activeElement) {
71
- return;
72
- }
73
- const focusedCell = HTMLCellId.findElementThroughShadowDOMs(activeElement);
74
- if (!focusedCell) {
75
- return;
76
- }
77
- mockScrollCellIntoView(HTMLCellId.parse(focusedCell.id));
78
- });
79
-
80
- return newState;
81
- }
@@ -1,65 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { atom, useAtomValue } from "jotai";
4
- import { useMemo } from "react";
5
- import { type CellId, HTMLCellId } from "@/core/cells/ids";
6
- import { scrollCellIntoView } from "@/core/cells/scrollCellIntoView";
7
- import { createReducerAndAtoms } from "@/utils/createReducer";
8
- import { raf2 } from "./focus-utils";
9
-
10
- type TemporarilyShownCodeState = Set<CellId>;
11
-
12
- // This previously used jotai-scope, but unfortunately this bug creates unnecessary work:
13
- // https://github.com/jotaijs/jotai-scope/issues/25
14
-
15
- const {
16
- valueAtom: temporarilyShownCodeAtom,
17
- useActions: useTemporarilyShownCodeActions,
18
- } = createReducerAndAtoms(() => new Set<CellId>(), {
19
- add: (state: TemporarilyShownCodeState, cellId: CellId) => {
20
- if (state.has(cellId)) {
21
- // no-op
22
- return state;
23
- }
24
- const newState = new Set(state);
25
- newState.add(cellId);
26
- return newState;
27
- },
28
- remove: (state: TemporarilyShownCodeState, cellId: CellId) => {
29
- if (!state.has(cellId)) {
30
- // no-op
31
- return state;
32
- }
33
- const newState = new Set(state);
34
- newState.delete(cellId);
35
-
36
- // If we are hiding the code, this will cause a layout shift
37
- // so we need to scroll cursor/activeElement into view.
38
- raf2(() => {
39
- // Get the active
40
- const activeElement = document.activeElement;
41
- if (!activeElement) {
42
- return;
43
- }
44
- // Get the current focused cell id
45
- const focusedCell =
46
- HTMLCellId.findElementThroughShadowDOMs(activeElement);
47
- if (!focusedCell) {
48
- return;
49
- }
50
- scrollCellIntoView(HTMLCellId.parse(focusedCell.id));
51
- });
52
-
53
- return newState;
54
- },
55
- });
56
-
57
- const createTemporarilyShownCodeAtom = (cellId: CellId) =>
58
- atom((get) => get(temporarilyShownCodeAtom).has(cellId));
59
-
60
- export function useTemporarilyShownCode(cellId: CellId) {
61
- const atom = useMemo(() => createTemporarilyShownCodeAtom(cellId), [cellId]);
62
- return useAtomValue(atom);
63
- }
64
-
65
- export { temporarilyShownCodeAtom, useTemporarilyShownCodeActions };