@marimo-team/islands 0.23.14-dev6 → 0.23.14-dev61

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 (171) hide show
  1. package/dist/{ConnectedDataExplorerComponent-Du3_nUzI.js → ConnectedDataExplorerComponent-CU4fZJzG.js} +4 -4
  2. package/dist/assets/__vite-browser-external-BQCLNwri.js +1 -0
  3. package/dist/assets/{worker-DEDLIQQV.js → worker-DAWRHcPq.js} +2 -2
  4. package/dist/{chat-ui-BZxLHwyD.js → chat-ui-DinOvbWu.js} +3248 -3044
  5. package/dist/{click-outside-container-BDd67_1U.js → click-outside-container-BLPjMamz.js} +141 -113
  6. package/dist/{code-visibility-C90Am97q.js → code-visibility-EvXXzjfW.js} +1169 -960
  7. package/dist/data-grid-overlay-editor-C6lxUJp-.js +136 -0
  8. package/dist/{dist-D_bzzWBm.js → dist-Bf9f8MuT.js} +3 -3
  9. package/dist/{formats-d6MhLuQ9.js → formats-Dzx4J_z1.js} +1 -1
  10. package/dist/{glide-data-editor-DkzAInWG.js → glide-data-editor-CjTu7ukN.js} +2084 -1889
  11. package/dist/{html-to-image-CGp_08St.js → html-to-image-_wGfk8V-.js} +2389 -2322
  12. package/dist/{input-CbEz_aj_.js → input-DtsN7xm-.js} +1 -1
  13. package/dist/main.js +3630 -1801
  14. package/dist/{mermaid-CJW9vIyO.js → mermaid-BYqXy_NE.js} +2 -2
  15. package/dist/{number-overlay-editor-D-a0qCT8.js → number-overlay-editor-BLJXvX9c.js} +1 -1
  16. package/dist/{process-output-R6JsYrv3.js → process-output-Mh4UrjwM.js} +1 -1
  17. package/dist/{reveal-component-C_u9FY4_.js → reveal-component-CKfV5wlk.js} +600 -596
  18. package/dist/{spec-Bv-XlYiv.js → spec-Cz-Bj1JI.js} +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/{toDate-D-l5s8nn.js → toDate-CWNNlFEX.js} +15 -7
  21. package/dist/{useAsyncData-1Dhzjfwf.js → useAsyncData-KfHB8wQR.js} +1 -1
  22. package/dist/{useDeepCompareMemoize-CDWT3BDz.js → useDeepCompareMemoize-nJMtxhm4.js} +1 -1
  23. package/dist/{useLifecycle-AHlswLw-.js → useLifecycle-DegSo0lV.js} +1 -1
  24. package/dist/{useTheme-BrYvK-_A.js → useTheme-6eZ3GOTS.js} +31 -26
  25. package/dist/{vega-component-Pk6lyc_a.js → vega-component-DzyyM9fc.js} +5 -5
  26. package/package.json +4 -4
  27. package/src/__mocks__/requests.ts +1 -0
  28. package/src/__tests__/CellStatus.test.tsx +1 -2
  29. package/src/components/app-config/user-config-form.tsx +52 -0
  30. package/src/components/chat/acp/agent-panel.tsx +35 -1
  31. package/src/components/chat/chat-panel.tsx +68 -29
  32. package/src/components/data-table/__tests__/column-explorer.test.tsx +25 -0
  33. package/src/components/data-table/__tests__/column-visibility-dropdown.test.tsx +60 -3
  34. package/src/components/data-table/charts/__tests__/altair-generator.test.ts +24 -0
  35. package/src/components/data-table/charts/__tests__/merge-index-fields.test.ts +33 -0
  36. package/src/components/data-table/charts/chart-spec/altair-generator.ts +4 -1
  37. package/src/components/data-table/charts/charts.tsx +23 -1
  38. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +33 -12
  39. package/src/components/data-table/column-visibility-dropdown.tsx +15 -0
  40. package/src/components/debugger/debugger-code.tsx +7 -2
  41. package/src/components/editor/actions/useNotebookActions.tsx +2 -2
  42. package/src/components/editor/cell/CellStatus.tsx +1 -20
  43. package/src/components/editor/cell/PendingDeleteConfirmation.tsx +1 -1
  44. package/src/components/editor/cell/cell-context-menu.tsx +2 -2
  45. package/src/components/editor/chrome/panels/snippets-panel.tsx +3 -3
  46. package/src/components/editor/chrome/wrapper/__tests__/useOpenAiAssistant.test.ts +36 -0
  47. package/src/components/editor/chrome/wrapper/footer-items/pyodide-status.tsx +6 -36
  48. package/src/components/editor/chrome/wrapper/useAiPanel.ts +3 -1
  49. package/src/components/editor/chrome/wrapper/useOpenAiAssistant.ts +88 -0
  50. package/src/components/editor/code/__tests__/readonly-python-code.test.tsx +79 -0
  51. package/src/components/editor/code/readonly-python-code.tsx +60 -33
  52. package/src/components/editor/errors/__tests__/auto-fix.test.ts +23 -0
  53. package/src/components/editor/errors/auto-fix.tsx +88 -34
  54. package/src/components/editor/errors/fix-mode.ts +1 -1
  55. package/src/components/editor/notebook-cell.tsx +7 -0
  56. package/src/components/editor/output/ImageOutput.tsx +20 -6
  57. package/src/components/editor/output/MarimoTracebackOutput.tsx +28 -2
  58. package/src/components/editor/output/__tests__/ImageOutput.test.tsx +53 -0
  59. package/src/components/editor/output/__tests__/traceback.test.tsx +14 -6
  60. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +7 -2
  61. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +7 -3
  62. package/src/components/lifecycle/ProgressiveBoundary.tsx +42 -0
  63. package/src/components/lifecycle/RuntimeStatusBadge.tsx +59 -0
  64. package/src/components/lifecycle/__tests__/ProgressiveBoundary.test.tsx +147 -0
  65. package/src/components/lifecycle/__tests__/RuntimeStatusBadge.test.tsx +72 -0
  66. package/src/components/slides/__tests__/slide.test.tsx +33 -0
  67. package/src/components/slides/minimap.tsx +7 -1
  68. package/src/components/slides/reveal-component.tsx +3 -0
  69. package/src/components/slides/slide-cell-view.tsx +10 -6
  70. package/src/components/slides/slide.tsx +16 -13
  71. package/src/components/tracing/tracing.tsx +2 -1
  72. package/src/core/ai/config.ts +2 -2
  73. package/src/core/ai/context/__tests__/registry.test.ts +133 -3
  74. package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -1
  75. package/src/core/ai/context/providers/__tests__/error.test.ts +200 -15
  76. package/src/core/ai/context/providers/datasource.ts +27 -2
  77. package/src/core/ai/context/providers/error.ts +226 -36
  78. package/src/core/ai/context/registry.ts +77 -43
  79. package/src/core/ai/state.ts +11 -0
  80. package/src/core/cells/__tests__/cell.test.ts +39 -0
  81. package/src/core/cells/__tests__/readonly-code-display.test.ts +46 -0
  82. package/src/core/cells/cell.ts +5 -3
  83. package/src/core/cells/readonly-code-display.ts +35 -0
  84. package/src/core/codemirror/__tests__/setup.test.ts +33 -1
  85. package/src/core/codemirror/ai/resources.ts +15 -10
  86. package/src/core/codemirror/cells/__tests__/debugger-decorations.test.ts +185 -0
  87. package/src/core/codemirror/cells/__tests__/debugger-state.test.ts +224 -0
  88. package/src/core/codemirror/cells/__tests__/line-timing-decorations.test.ts +126 -0
  89. package/src/core/codemirror/cells/debugger-decorations.ts +188 -0
  90. package/src/core/codemirror/cells/debugger-state.ts +133 -0
  91. package/src/core/codemirror/cells/extensions.ts +32 -4
  92. package/src/core/codemirror/cells/line-timing-decorations.ts +165 -0
  93. package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +75 -3
  94. package/src/core/codemirror/go-to-definition/extension.ts +3 -3
  95. package/src/core/codemirror/go-to-definition/underline.ts +5 -14
  96. package/src/core/codemirror/go-to-definition/utils.ts +49 -1
  97. package/src/core/codemirror/utils.ts +15 -0
  98. package/src/core/config/__tests__/config-schema.test.ts +17 -0
  99. package/src/core/config/config-schema.ts +1 -0
  100. package/src/core/config/config.ts +10 -0
  101. package/src/core/config/feature-flag.tsx +4 -0
  102. package/src/core/edit-app.tsx +8 -5
  103. package/src/core/errors/errors.ts +2 -1
  104. package/src/core/islands/bootstrap.ts +4 -3
  105. package/src/core/islands/bridge.ts +1 -0
  106. package/src/core/lifecycle/__tests__/render-policy.test.ts +247 -0
  107. package/src/core/lifecycle/render-policy.ts +125 -0
  108. package/src/core/mime.ts +11 -4
  109. package/src/core/network/__tests__/api.test.ts +17 -0
  110. package/src/core/network/__tests__/requests-toasting.test.tsx +46 -0
  111. package/src/core/network/api.ts +17 -6
  112. package/src/core/network/requests-lazy.ts +1 -0
  113. package/src/core/network/requests-network.ts +8 -0
  114. package/src/core/network/requests-static.ts +1 -0
  115. package/src/core/network/requests-toasting.tsx +10 -1
  116. package/src/core/network/types.ts +2 -0
  117. package/src/core/run-app.tsx +27 -23
  118. package/src/core/runtime/__tests__/adapter.test.ts +160 -0
  119. package/src/core/runtime/__tests__/runtime.test.ts +45 -0
  120. package/src/core/runtime/adapter.ts +182 -0
  121. package/src/core/runtime/runtime.ts +30 -16
  122. package/src/core/wasm/PyodideLoader.tsx +20 -62
  123. package/src/core/wasm/bridge.ts +13 -4
  124. package/src/core/wasm/state.ts +8 -19
  125. package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +4 -0
  126. package/src/core/websocket/__tests__/useWebSocket.test.ts +49 -0
  127. package/src/core/websocket/transports/__tests__/sse.test.ts +338 -0
  128. package/src/core/websocket/transports/sse.ts +308 -0
  129. package/src/core/websocket/useMarimoKernelConnection.tsx +58 -7
  130. package/src/core/websocket/useWebSocket.tsx +12 -2
  131. package/src/css/app/codemirror.css +14 -0
  132. package/src/hooks/__tests__/useDelayElapsed.test.tsx +55 -0
  133. package/src/hooks/useDelayElapsed.ts +27 -0
  134. package/src/mount.tsx +3 -3
  135. package/src/plugins/core/RenderHTML.tsx +35 -1
  136. package/src/plugins/core/__test__/RenderHTML.test.ts +44 -0
  137. package/src/plugins/impl/DataTablePlugin.tsx +1 -0
  138. package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +33 -254
  139. package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +116 -174
  140. package/src/plugins/impl/anywidget/__tests__/host.test.ts +313 -0
  141. package/src/plugins/impl/anywidget/__tests__/model-proxy.test.ts +158 -0
  142. package/src/plugins/impl/anywidget/__tests__/model.test.ts +8 -177
  143. package/src/plugins/impl/anywidget/__tests__/registry.test.ts +708 -0
  144. package/src/plugins/impl/anywidget/__tests__/resolve-widget.test.ts +132 -0
  145. package/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts +305 -133
  146. package/src/plugins/impl/anywidget/__tests__/widget-ref.test.ts +28 -0
  147. package/src/plugins/impl/anywidget/host.ts +54 -0
  148. package/src/plugins/impl/anywidget/model-proxy.ts +70 -0
  149. package/src/plugins/impl/anywidget/model.ts +59 -239
  150. package/src/plugins/impl/anywidget/registry.ts +268 -0
  151. package/src/plugins/impl/anywidget/resolve-widget.ts +138 -0
  152. package/src/plugins/impl/anywidget/runtime.ts +422 -0
  153. package/src/plugins/impl/anywidget/types.ts +14 -0
  154. package/src/plugins/impl/anywidget/widget-binding.ts +280 -119
  155. package/src/plugins/impl/anywidget/widget-ref.ts +29 -0
  156. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +187 -0
  157. package/src/plugins/impl/data-editor/glide-data-editor.tsx +6 -0
  158. package/src/plugins/impl/data-editor/glide-portal.tsx +73 -0
  159. package/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx +3 -2
  160. package/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx +16 -13
  161. package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +1 -1
  162. package/src/utils/errors.ts +15 -0
  163. package/src/utils/time.ts +20 -0
  164. package/dist/assets/__vite-browser-external-DAm_YW43.js +0 -1
  165. package/dist/data-grid-overlay-editor-mfEJ5475.js +0 -128
  166. package/src/components/editor/chrome/panels/__tests__/snippet-display.test.ts +0 -22
  167. package/src/components/editor/chrome/panels/snippet-display.ts +0 -27
  168. package/src/core/ai/context/providers/__tests__/__snapshots__/error.test.ts.snap +0 -3
  169. package/src/core/wasm/__tests__/PyodideLoader.test.ts +0 -72
  170. package/src/core/wasm/__tests__/state.test.ts +0 -124
  171. package/src/plugins/impl/anywidget/schemas.ts +0 -32
@@ -0,0 +1,136 @@
1
+ import { s as __toESM } from "./chunk-BNovOVIE.js";
2
+ import { t as require_react } from "./react-DA-nE2FX.js";
3
+ import { t as require_react_dom } from "./react-dom-BTJzcVJ9.js";
4
+ import { b as isObjectEditorCallbackResult, i as makeCSSStyle, n as ThemeContext, t as ClickOutsideContainer, v as isEditableGridCell, y as isInnerOnlyCell } from "./click-outside-container-BLPjMamz.js";
5
+ import { t as styled_default } from "./dist-Bf9f8MuT.js";
6
+ var import_react_dom = require_react_dom(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), _exp2 = () => (e) => e.targetX, _exp3 = () => (e) => e.targetY, _exp4 = () => (e) => e.targetWidth, _exp5 = () => (e) => e.targetHeight, _exp6 = () => (e) => e.targetY + 10, _exp7 = () => (e) => Math.max(0, (e.targetHeight - 28) / 2);
7
+ const DataGridOverlayEditorStyle = /* @__PURE__ */ styled_default("div")({
8
+ name: "DataGridOverlayEditorStyle",
9
+ class: "gdg-d19meir1",
10
+ propsAsIs: false,
11
+ vars: {
12
+ "d19meir1-0": [_exp3(), "px"],
13
+ "d19meir1-1": [_exp2(), "px"],
14
+ "d19meir1-2": [_exp4(), "px"],
15
+ "d19meir1-3": [_exp5(), "px"],
16
+ "d19meir1-4": [_exp6(), "px"],
17
+ "d19meir1-5": [_exp7(), "px"]
18
+ }
19
+ });
20
+ function useRefState() {
21
+ let [e, o] = import_react.useState();
22
+ return [e ?? void 0, o];
23
+ }
24
+ function useStayOnScreen() {
25
+ let [e, o] = useRefState(), [s, c] = import_react.useState(0), [l, u] = import_react.useState(true);
26
+ return import_react.useLayoutEffect(() => {
27
+ if (e === void 0 || !("IntersectionObserver" in window)) return;
28
+ let o2 = new IntersectionObserver((e2) => {
29
+ e2.length !== 0 && u(e2[0].isIntersecting);
30
+ }, { threshold: 1 });
31
+ return o2.observe(e), () => o2.disconnect();
32
+ }, [e]), import_react.useEffect(() => {
33
+ if (l || e === void 0) return;
34
+ let o2, s2 = () => {
35
+ let { right: l2 } = e.getBoundingClientRect();
36
+ c((e2) => Math.min(e2 + window.innerWidth - l2 - 10, 0)), o2 = requestAnimationFrame(s2);
37
+ };
38
+ return o2 = requestAnimationFrame(s2), () => {
39
+ o2 !== void 0 && cancelAnimationFrame(o2);
40
+ };
41
+ }, [e, l]), {
42
+ ref: o,
43
+ style: import_react.useMemo(() => ({ transform: `translateX(${s}px)` }), [s])
44
+ };
45
+ }
46
+ var data_grid_overlay_editor_default = (e) => {
47
+ let { target: o, content: s, onFinishEditing: d, forceEditMode: f, initialValue: p, imageEditorOverride: m, markdownDivCreateNode: h, highlight: g, className: _, theme: v, id: y, cell: b, bloom: x, portalElementRef: S, validateCell: C, getCellRenderer: w, provideEditor: T, isOutsideClick: E, customEventTarget: D, activation: O } = e, [k, A] = import_react.useState(f ? s : void 0), j = import_react.useRef(k ?? s);
48
+ j.current = k ?? s;
49
+ let [M, N] = import_react.useState(() => C === void 0 ? true : !(isEditableGridCell(s) && (C == null ? void 0 : C(b, s, j.current)) === false)), P = import_react.useCallback((e2, o2) => {
50
+ d(M ? e2 : void 0, o2);
51
+ }, [M, d]), F = import_react.useCallback((e2) => {
52
+ if (C !== void 0 && e2 !== void 0 && isEditableGridCell(e2)) {
53
+ let o2 = C(b, e2, j.current);
54
+ o2 === false ? N(false) : (typeof o2 == "object" && (e2 = o2), N(true));
55
+ }
56
+ A(e2);
57
+ }, [b, C]), I = import_react.useRef(false), L = import_react.useRef(void 0), R = import_react.useCallback(() => {
58
+ P(k, [0, 0]), I.current = true;
59
+ }, [k, P]), z = import_react.useCallback((e2, o2) => {
60
+ P(e2, o2 ?? L.current ?? [0, 0]), I.current = true;
61
+ }, [P]), B = import_react.useCallback(async (e2) => {
62
+ let o2 = false;
63
+ e2.key === "Escape" ? (e2.stopPropagation(), e2.preventDefault(), L.current = [0, 0]) : e2.key === "Enter" && !e2.shiftKey ? (e2.stopPropagation(), e2.preventDefault(), L.current = [0, 1], o2 = true) : e2.key === "Tab" && (e2.stopPropagation(), e2.preventDefault(), L.current = [e2.shiftKey ? -1 : 1, 0], o2 = true), window.setTimeout(() => {
64
+ !I.current && L.current !== void 0 && (P(o2 ? k : void 0, L.current), I.current = true);
65
+ }, 0);
66
+ }, [P, k]), V = k ?? s, [H, U] = import_react.useMemo(() => {
67
+ var _a, _b;
68
+ if (isInnerOnlyCell(s)) return [];
69
+ let e2 = {
70
+ ...s,
71
+ location: b,
72
+ activation: O
73
+ }, o2 = T == null ? void 0 : T(e2);
74
+ return o2 === void 0 ? [(_b = (_a = w(s)) == null ? void 0 : _a.provideEditor) == null ? void 0 : _b.call(_a, e2), false] : [o2, false];
75
+ }, [
76
+ b,
77
+ s,
78
+ w,
79
+ T,
80
+ O
81
+ ]), { ref: W, style: G } = useStayOnScreen(), K = true, q, J = true, Y;
82
+ if (H !== void 0) {
83
+ K = H.disablePadding !== true, J = H.disableStyling !== true;
84
+ let e2 = isObjectEditorCallbackResult(H);
85
+ e2 && (Y = H.styleOverride);
86
+ let s2 = e2 ? H.editor : H;
87
+ q = import_react.createElement(s2, {
88
+ portalElementRef: S,
89
+ isHighlighted: g,
90
+ activation: O,
91
+ onChange: F,
92
+ value: V,
93
+ initialValue: p,
94
+ onFinishedEditing: z,
95
+ validatedSelection: isEditableGridCell(V) ? V.selectionRange : void 0,
96
+ forceEditMode: f,
97
+ target: o,
98
+ imageEditorOverride: m,
99
+ markdownDivCreateNode: h,
100
+ isValid: M,
101
+ theme: v
102
+ });
103
+ }
104
+ Y = {
105
+ ...Y,
106
+ ...G
107
+ };
108
+ let X = (S == null ? void 0 : S.current) ?? document.getElementById("portal");
109
+ if (X === null) return console.error('Cannot open Data Grid overlay editor, because portal not found. Please, either provide a portalElementRef or add `<div id="portal" />` as the last child of your `<body>`.'), null;
110
+ let Z = J ? "gdg-style" : "gdg-unstyle";
111
+ M || (Z += " gdg-invalid"), K && (Z += " gdg-pad");
112
+ let Q = (x == null ? void 0 : x[0]) ?? 1, $ = (x == null ? void 0 : x[1]) ?? 1;
113
+ return (0, import_react_dom.createPortal)(import_react.createElement(ThemeContext.Provider, { value: v }, import_react.createElement(ClickOutsideContainer, {
114
+ style: makeCSSStyle(v),
115
+ className: _,
116
+ onClickOutside: R,
117
+ isOutsideClick: E,
118
+ customEventTarget: D
119
+ }, import_react.createElement(DataGridOverlayEditorStyle, {
120
+ ref: W,
121
+ id: y,
122
+ className: Z,
123
+ style: Y,
124
+ as: U === true ? "label" : void 0,
125
+ targetX: o.x - Q,
126
+ targetY: o.y - $,
127
+ targetWidth: o.width + Q * 2,
128
+ targetHeight: o.height + $ * 2
129
+ }, import_react.createElement("div", {
130
+ className: "gdg-clip-region",
131
+ onKeyDown: B
132
+ }, q)))), X);
133
+ };
134
+ export {
135
+ data_grid_overlay_editor_default as default
136
+ };
@@ -47,9 +47,9 @@ function styled(e) {
47
47
  e2[n2] = i[n2];
48
48
  }), u.style = e2;
49
49
  }
50
- return e.__linaria && e !== c ? (u.as = c, import_react.createElement(e, u)) : import_react.createElement(c, u);
51
- }, s = import_react.forwardRef ? import_react.forwardRef(r) : (e2) => r(omit(e2, ["innerRef"]), e2.innerRef);
52
- return s.displayName = n.name, s.__linaria = {
50
+ return e.__wyw_meta && e !== c ? (u.as = c, (0, import_react.createElement)(e, u)) : (0, import_react.createElement)(c, u);
51
+ }, s = import_react.forwardRef ? (0, import_react.forwardRef)(r) : ((e2) => r(omit(e2, ["innerRef"]), e2.innerRef));
52
+ return s.displayName = n.name, s.__wyw_meta = {
53
53
  className: n.class || "",
54
54
  extends: e
55
55
  }, s;
@@ -2,7 +2,7 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { g as cn, r as cva } from "./button-BacYv-bE.js";
3
3
  import { t as require_react } from "./react-DA-nE2FX.js";
4
4
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
5
- import { t as toDate } from "./toDate-D-l5s8nn.js";
5
+ import { t as toDate } from "./toDate-CWNNlFEX.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
7
7
  import { i as tableFromIPC } from "./loader-Boph2xIS.js";
8
8
  function isDate(e) {