@marimo-team/islands 0.22.5-dev12 → 0.22.5-dev14
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.
- package/dist/{chat-ui-DfR3sT9K.js → chat-ui-X5KPeHrU.js} +123 -123
- package/dist/main.js +444 -363
- package/dist/{process-output-BvkX_OeE.js → process-output-C0tmJosY.js} +85 -84
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/data-table/__tests__/columns.test.tsx +92 -13
- package/src/components/data-table/column-header.tsx +81 -56
- package/src/components/data-table/columns.tsx +25 -32
- package/src/components/data-table/data-table.tsx +8 -1
- package/src/components/data-table/renderers.tsx +19 -6
- package/src/components/data-table/types.ts +4 -0
- package/src/components/editor/actions/useNotebookActions.tsx +2 -2
- package/src/components/editor/errors/traceback-modal.tsx +6 -5
- package/src/components/editor/output/MarimoErrorOutput.tsx +7 -14
- package/src/components/editor/output/MarimoTracebackOutput.tsx +4 -3
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +22 -0
- package/src/plugins/impl/plotly/selection.ts +1 -0
|
@@ -34,6 +34,7 @@ import { getRequestClient } from "@/core/network/requests";
|
|
|
34
34
|
import { isStaticNotebook } from "@/core/static/static-state";
|
|
35
35
|
import { isWasm } from "@/core/wasm/utils";
|
|
36
36
|
import { renderHTML } from "@/plugins/core/RenderHTML";
|
|
37
|
+
import { sanitizeHtml } from "@/plugins/core/sanitize-html";
|
|
37
38
|
import { copyToClipboard } from "@/utils/copy";
|
|
38
39
|
import {
|
|
39
40
|
elementContainsMarimoCellFile,
|
|
@@ -173,9 +174,9 @@ export const MarimoTracebackOutput = ({
|
|
|
173
174
|
</DropdownMenuItem>
|
|
174
175
|
<DropdownMenuItem
|
|
175
176
|
onClick={() => {
|
|
176
|
-
// Strip HTML from the traceback
|
|
177
|
+
// Strip HTML from the traceback (sanitize first to prevent XSS)
|
|
177
178
|
const div = document.createElement("div");
|
|
178
|
-
div.innerHTML = traceback;
|
|
179
|
+
div.innerHTML = sanitizeHtml(traceback);
|
|
179
180
|
const textContent = div.textContent || "";
|
|
180
181
|
copyToClipboard(textContent);
|
|
181
182
|
}}
|
|
@@ -193,7 +194,7 @@ export const MarimoTracebackOutput = ({
|
|
|
193
194
|
|
|
194
195
|
function lastLine(text: string): string {
|
|
195
196
|
const el = document.createElement("div");
|
|
196
|
-
el.innerHTML = text;
|
|
197
|
+
el.innerHTML = sanitizeHtml(text);
|
|
197
198
|
const lines = el.textContent?.split("\n").filter(Boolean);
|
|
198
199
|
return lines?.at(-1) || "";
|
|
199
200
|
}
|
|
@@ -117,6 +117,14 @@ describe("shouldHandleClickSelection", () => {
|
|
|
117
117
|
expect(shouldHandleClickSelection([linePoint])).toBe(true);
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
+
it("accepts waterfall clicks", () => {
|
|
121
|
+
const waterfallPoint = createPlotDatum({
|
|
122
|
+
data: { type: "waterfall" },
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
expect(shouldHandleClickSelection([waterfallPoint])).toBe(true);
|
|
126
|
+
});
|
|
127
|
+
|
|
120
128
|
it("rejects non-line scatter marker clicks", () => {
|
|
121
129
|
const markerPoint = createPlotDatum({
|
|
122
130
|
data: { type: "scatter", mode: "markers" },
|
|
@@ -196,4 +204,18 @@ describe("extractPoints", () => {
|
|
|
196
204
|
|
|
197
205
|
expect(extractPoints([point])).toEqual([{ x: 1, y: 2, z: 3 }]);
|
|
198
206
|
});
|
|
207
|
+
|
|
208
|
+
it("returns x/y/pointIndex for waterfall clicks", () => {
|
|
209
|
+
const point = createPlotDatum({
|
|
210
|
+
x: "Revenue",
|
|
211
|
+
y: 400,
|
|
212
|
+
pointIndex: 1,
|
|
213
|
+
curveNumber: 0,
|
|
214
|
+
data: { type: "waterfall" },
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
expect(extractPoints([point])).toEqual([
|
|
218
|
+
{ x: "Revenue", y: 400, pointIndex: 1, curveNumber: 0 },
|
|
219
|
+
]);
|
|
220
|
+
});
|
|
199
221
|
});
|