@marimo-team/frontend 0.23.3-dev45 → 0.23.3-dev48
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/assets/{JsonOutput-BDnY09YR.js → JsonOutput-DXnOS_Hk.js} +11 -11
- package/dist/assets/{add-connection-dialog-B_v0AeoU.js → add-connection-dialog-HCShSlr3.js} +1 -1
- package/dist/assets/{agent-panel-BMpsP2zw.js → agent-panel-CoBHxHpJ.js} +1 -1
- package/dist/assets/{cell-editor-CV2Fuwfi.js → cell-editor-BMjfXh0J.js} +1 -1
- package/dist/assets/{column-preview-DsiFOTwu.js → column-preview-DzN2QumC.js} +1 -1
- package/dist/assets/{command-palette-Clusi1pH.js → command-palette-DSSR50KF.js} +1 -1
- package/dist/assets/{edit-page-Baqw-oBh.js → edit-page-Bxa5DWoE.js} +3 -3
- package/dist/assets/{file-explorer-panel-D2qvZtGv.js → file-explorer-panel-D7-d0Puf.js} +1 -1
- package/dist/assets/{form-BxYohyDn.js → form-CPDlIjdV.js} +1 -1
- package/dist/assets/{hooks-CXZf4ceF.js → hooks-b3J1eFE-.js} +1 -1
- package/dist/assets/{index-CyvM_FCk.js → index-BjiE1T38.js} +3 -3
- package/dist/assets/{layout-2bm2yV7z.js → layout-lxwMDUgI.js} +3 -3
- package/dist/assets/{panels-C5qZNX9N.js → panels-BPzk3EbR.js} +1 -1
- package/dist/assets/{reveal-component-BivIY7FY.js → reveal-component-BamXsTkr.js} +1 -1
- package/dist/assets/{run-page-Cr_c3nx1.js → run-page-C5cZvltI.js} +1 -1
- package/dist/assets/{scratchpad-panel-Dbt1i218.js → scratchpad-panel-PMFH4Ktp.js} +1 -1
- package/dist/assets/{session-panel-BfXD_M_P.js → session-panel-CUTSr9rt.js} +1 -1
- package/dist/assets/{slide-form-D1Sy7XQE.js → slide-form-Bi8ZYBHP.js} +1 -1
- package/dist/assets/{state-CzDhMoLb.js → state-DHlRrwyY.js} +1 -1
- package/dist/assets/{useNotebookActions-DMvTIk3W.js → useNotebookActions-Dga3qEHF.js} +1 -1
- package/dist/index.html +5 -5
- package/package.json +1 -1
- package/src/components/editor/output/JsonOutput.tsx +42 -12
- package/src/components/editor/output/__tests__/json-output.test.ts +38 -0
|
@@ -417,6 +417,44 @@ describe("getCopyValue with encoded non-string keys", () => {
|
|
|
417
417
|
`);
|
|
418
418
|
});
|
|
419
419
|
|
|
420
|
+
it("parses tuple/frozenset payloads containing bare NaN/Infinity", () => {
|
|
421
|
+
// Python's json.dumps emits bare `NaN`/`Infinity` inside the embedded
|
|
422
|
+
// tuple/frozenset payload strings (JSON spec violation, but ECMA-262-
|
|
423
|
+
// friendly via the fallback in jsonParseWithSpecialChar). The outer
|
|
424
|
+
// JSON stays strict because those tokens live inside a JSON string
|
|
425
|
+
// key/value. Regression for tuple-key payloads that previously broke
|
|
426
|
+
// the frontend's `JSON.parse` and threw.
|
|
427
|
+
const value = {
|
|
428
|
+
"text/plain+tuple:[NaN]": "tn",
|
|
429
|
+
"text/plain+tuple:[Infinity, -Infinity]": "ti",
|
|
430
|
+
k: "text/plain+frozenset:[Infinity, 1]",
|
|
431
|
+
};
|
|
432
|
+
expect(getCopyValue(value)).toMatchInlineSnapshot(`
|
|
433
|
+
"{
|
|
434
|
+
(float('nan'),): "tn",
|
|
435
|
+
(float('inf'), -float('inf')): "ti",
|
|
436
|
+
"k": frozenset({float('inf'), 1})
|
|
437
|
+
}"
|
|
438
|
+
`);
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it("falls back to the raw payload for malformed tuple/frozenset", () => {
|
|
442
|
+
// `jsonParseWithSpecialChar` returns `{}` on parse failure rather
|
|
443
|
+
// than throwing; without an `Array.isArray` guard, the formatters
|
|
444
|
+
// would crash on `.length`/`.map`. Pass the raw payload through so
|
|
445
|
+
// a malformed wire form doesn't break the whole render.
|
|
446
|
+
const value = {
|
|
447
|
+
"text/plain+tuple:not a json list": "t",
|
|
448
|
+
k: "text/plain+frozenset:also broken",
|
|
449
|
+
};
|
|
450
|
+
expect(getCopyValue(value)).toMatchInlineSnapshot(`
|
|
451
|
+
"{
|
|
452
|
+
not a json list: "t",
|
|
453
|
+
"k": also broken
|
|
454
|
+
}"
|
|
455
|
+
`);
|
|
456
|
+
});
|
|
457
|
+
|
|
420
458
|
it("unescapes string keys that looked encoded", () => {
|
|
421
459
|
const value = {
|
|
422
460
|
"text/plain+str:text/plain+int:2": "hello",
|