@marimo-team/islands 0.21.2-dev5 → 0.21.2-dev53

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 (109) hide show
  1. package/dist/{any-language-editor-DlsjUw_l.js → any-language-editor-BRpxklRq.js} +1 -1
  2. package/dist/{copy-DIK6DiIA.js → copy-BjkXCUxP.js} +12 -2
  3. package/dist/{esm-BLobyqMs.js → esm-No_6eSQS.js} +1 -1
  4. package/dist/{glide-data-editor-pZyd9UJ_.js → glide-data-editor-858wsVkd.js} +1 -1
  5. package/dist/main.js +579 -402
  6. package/dist/style.css +1 -1
  7. package/package.json +1 -1
  8. package/src/__mocks__/notebook.ts +9 -9
  9. package/src/__tests__/branded.ts +20 -0
  10. package/src/components/app-config/user-config-form.tsx +5 -4
  11. package/src/components/data-table/__tests__/utils.test.ts +138 -1
  12. package/src/components/data-table/charts/__tests__/storage.test.ts +7 -7
  13. package/src/components/data-table/context-menu.tsx +9 -5
  14. package/src/components/data-table/data-table.tsx +3 -0
  15. package/src/components/data-table/range-focus/__tests__/atoms.test.ts +8 -2
  16. package/src/components/data-table/range-focus/__tests__/test-utils.ts +2 -0
  17. package/src/components/data-table/range-focus/__tests__/utils.test.ts +82 -8
  18. package/src/components/data-table/range-focus/atoms.ts +2 -2
  19. package/src/components/data-table/range-focus/utils.ts +50 -12
  20. package/src/components/data-table/types.ts +7 -0
  21. package/src/components/data-table/utils.ts +87 -0
  22. package/src/components/editor/__tests__/data-attributes.test.tsx +8 -8
  23. package/src/components/editor/ai/__tests__/completion-utils.test.ts +15 -15
  24. package/src/components/editor/navigation/__tests__/clipboard.test.ts +2 -2
  25. package/src/components/editor/navigation/__tests__/selection.test.ts +7 -6
  26. package/src/components/editor/navigation/__tests__/state.test.ts +8 -7
  27. package/src/components/editor/output/MarimoErrorOutput.tsx +7 -7
  28. package/src/components/editor/output/__tests__/traceback.test.tsx +4 -4
  29. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +4 -4
  30. package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +8 -1
  31. package/src/components/storage/storage-file-viewer.tsx +35 -1
  32. package/src/components/storage/storage-inspector.tsx +9 -4
  33. package/src/components/storage/storage-snippets.ts +3 -3
  34. package/src/components/tracing/tracing.tsx +3 -1
  35. package/src/components/ui/range-slider.tsx +108 -1
  36. package/src/core/ai/__tests__/staged-cells.test.ts +9 -8
  37. package/src/core/ai/context/providers/__tests__/cell-output.test.ts +31 -31
  38. package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -3
  39. package/src/core/ai/context/providers/__tests__/tables.test.ts +3 -2
  40. package/src/core/ai/context/providers/__tests__/variable.test.ts +84 -63
  41. package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +10 -9
  42. package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +6 -6
  43. package/src/core/ai/tools/edit-notebook-tool.ts +3 -3
  44. package/src/core/cells/__tests__/add-missing-import.test.ts +3 -3
  45. package/src/core/cells/__tests__/cells.test.ts +192 -135
  46. package/src/core/cells/__tests__/focus.test.ts +5 -4
  47. package/src/core/cells/__tests__/logs.test.ts +13 -12
  48. package/src/core/cells/__tests__/pending-delete-service.test.tsx +3 -3
  49. package/src/core/cells/__tests__/runs.test.ts +22 -21
  50. package/src/core/cells/__tests__/scrollCellIntoView.test.ts +8 -7
  51. package/src/core/cells/__tests__/session.test.ts +23 -22
  52. package/src/core/cells/cells.ts +1 -1
  53. package/src/core/cells/ids.ts +5 -5
  54. package/src/core/cells/logs.ts +2 -2
  55. package/src/core/cells/runs.ts +6 -8
  56. package/src/core/codemirror/__tests__/format.test.ts +34 -36
  57. package/src/core/codemirror/__tests__/setup.test.ts +2 -2
  58. package/src/core/codemirror/cells/__tests__/extensions.test.ts +114 -0
  59. package/src/core/codemirror/cells/__tests__/traceback-decorations.test.ts +33 -32
  60. package/src/core/codemirror/cells/extensions.ts +66 -23
  61. package/src/core/codemirror/completion/__tests__/keymap.test.ts +15 -35
  62. package/src/core/codemirror/completion/keymap.ts +14 -4
  63. package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +12 -13
  64. package/src/core/codemirror/language/__tests__/utils.test.ts +3 -3
  65. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +7 -8
  66. package/src/core/codemirror/language/languages/python.ts +4 -0
  67. package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +4 -3
  68. package/src/core/codemirror/lsp/notebook-lsp.ts +28 -2
  69. package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +7 -6
  70. package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
  71. package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +52 -0
  72. package/src/core/codemirror/rtc/loro/sync.ts +1 -0
  73. package/src/core/datasets/__tests__/data-source.test.ts +5 -6
  74. package/src/core/datasets/state.ts +1 -1
  75. package/src/core/errors/__tests__/errors.test.ts +2 -1
  76. package/src/core/export/__tests__/hooks.test.ts +37 -36
  77. package/src/core/islands/main.ts +2 -7
  78. package/src/core/kernel/__tests__/handlers.test.ts +5 -4
  79. package/src/core/kernel/handlers.ts +7 -4
  80. package/src/core/network/DeferredRequestRegistry.ts +2 -2
  81. package/src/core/network/__tests__/CachingRequestRegistry.test.ts +9 -10
  82. package/src/core/network/__tests__/DeferredRequestRegistry.test.ts +4 -6
  83. package/src/core/static/__tests__/virtual-file-tracker.test.ts +8 -8
  84. package/src/core/static/virtual-file-tracker.ts +1 -1
  85. package/src/core/storage/__tests__/state.test.ts +31 -21
  86. package/src/core/storage/state.ts +1 -1
  87. package/src/core/variables/__tests__/state.test.ts +6 -6
  88. package/src/core/variables/types.ts +2 -2
  89. package/src/core/wasm/__tests__/state.test.ts +8 -8
  90. package/src/core/websocket/useMarimoKernelConnection.tsx +12 -15
  91. package/src/css/md-tooltip.css +4 -39
  92. package/src/css/md.css +7 -0
  93. package/src/plugins/core/RenderHTML.tsx +17 -0
  94. package/src/plugins/core/__test__/RenderHTML.test.ts +45 -0
  95. package/src/plugins/core/sanitize-html.ts +25 -18
  96. package/src/plugins/impl/DataTablePlugin.tsx +23 -2
  97. package/src/plugins/impl/SliderPlugin.tsx +1 -3
  98. package/src/plugins/impl/__tests__/SliderPlugin.test.tsx +120 -0
  99. package/src/plugins/impl/anywidget/model.ts +1 -2
  100. package/src/stories/cell.stories.tsx +8 -8
  101. package/src/stories/layout/vertical/one-column.stories.tsx +9 -8
  102. package/src/stories/log-viewer.stories.tsx +8 -8
  103. package/src/stories/variables.stories.tsx +2 -2
  104. package/src/utils/__tests__/download.test.tsx +21 -20
  105. package/src/utils/copy.ts +18 -5
  106. package/src/utils/download.ts +4 -3
  107. package/src/utils/html-to-image.ts +6 -0
  108. package/src/utils/json/base64.ts +3 -3
  109. package/src/utils/traceback.ts +5 -3
@@ -5,7 +5,7 @@ import { g as Logger } from "./button-BKkuUpZh.js";
5
5
  import "./Combination-BBPQRrDo.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
7
7
  import "./react-dom-CqtLRVZP.js";
8
- import { f as CopyClipboardIcon, n as loadLanguage, r as esm_default, t as langs } from "./esm-BLobyqMs.js";
8
+ import { f as CopyClipboardIcon, n as loadLanguage, r as esm_default, t as langs } from "./esm-No_6eSQS.js";
9
9
  import "./dist-DOoqn-VL.js";
10
10
  import "./dist-BGZ7TWS9.js";
11
11
  import "./dist-BpMlUdNO.js";
@@ -122,12 +122,22 @@ var Copy = createLucideIcon("copy", [["rect", {
122
122
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
123
123
  key: "zix9uf"
124
124
  }]]);
125
- async function copyToClipboard(e) {
125
+ async function copyToClipboard(e, p) {
126
126
  if (navigator.clipboard === void 0) {
127
127
  Logger.warn("navigator.clipboard is not supported"), window.prompt("Copy to clipboard: Ctrl+C, Enter", e);
128
128
  return;
129
129
  }
130
- await navigator.clipboard.writeText(e).catch(async () => {
130
+ if (p && navigator.clipboard.write) try {
131
+ let m = new ClipboardItem({
132
+ "text/html": new Blob([p], { type: "text/html" }),
133
+ "text/plain": new Blob([e], { type: "text/plain" })
134
+ });
135
+ await navigator.clipboard.write([m]);
136
+ return;
137
+ } catch {
138
+ Logger.warn("Failed to write rich text, falling back to plain text");
139
+ }
140
+ await navigator.clipboard.writeText(e).catch(() => {
131
141
  Logger.warn("Failed to copy to clipboard using navigator.clipboard"), window.prompt("Copy to clipboard: Ctrl+C, Enter", e);
132
142
  });
133
143
  }
@@ -1,7 +1,7 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_react } from "./react-Bs6Z0kvn.js";
3
3
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
4
- import { n as Copy, r as toast, t as copyToClipboard } from "./copy-DIK6DiIA.js";
4
+ import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BjkXCUxP.js";
5
5
  import { t as Check } from "./check-Diwc5emq.js";
6
6
  import { h as Events, y as cn } from "./button-BKkuUpZh.js";
7
7
  import { t as require_jsx_runtime } from "./jsx-runtime-CTBg5pdT.js";
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
5
5
  import { t as require_react } from "./react-Bs6Z0kvn.js";
6
6
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
7
- import { n as Copy, r as toast, t as copyToClipboard } from "./copy-DIK6DiIA.js";
7
+ import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BjkXCUxP.js";
8
8
  import { O as logNever, i as SelectContent, l as SelectTrigger, o as SelectItem, r as Select, t as Label, u as SelectValue } from "./label-BbpGrh4j.js";
9
9
  import { H as ErrorBoundary, U as require_prop_types, _ as DropdownMenuSeparator, _n as Plus, _t as capitalize_default, b as DropdownMenuSubTrigger, d as DropdownMenu, f as DropdownMenuContent, g as DropdownMenuPortal, hn as Trash, i as Input, m as DropdownMenuItem, mt as marked, pt as useNonce, t as BulkEdit, v as DropdownMenuSub, vn as Pencil, y as DropdownMenuSubContent } from "./types-CGc7peZV.js";
10
10
  import { g as Logger, h as Events, t as Button } from "./button-BKkuUpZh.js";