@marimo-team/islands 0.23.10-dev1 → 0.23.10-dev13
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/{any-language-editor-DfdpyDv_.js → any-language-editor-CiES2a2h.js} +2 -2
- package/dist/{chat-ui-ChD4VvCo.js → chat-ui-BD7DNRSw.js} +5 -5
- package/dist/{code-visibility-B3oOX_TK.js → code-visibility-Db0yh3sI.js} +1036 -882
- package/dist/{copy-BuQpJEzp.js → copy-5jQ_kGE1.js} +32 -32
- package/dist/{esm-BfhQmZjp.js → esm-CCuYCd3R.js} +1 -1
- package/dist/{extends-BgdxCfYu.js → extends-CkydH1Q5.js} +1 -1
- package/dist/{glide-data-editor-BOmK9ETQ.js → glide-data-editor-CgIxTzAP.js} +1 -1
- package/dist/{html-to-image-BHv7CEU_.js → html-to-image-DU8Qw0nX.js} +2165 -2133
- package/dist/main.js +10 -10
- package/dist/{process-output-BvySRgli.js → process-output-Bxz3AalF.js} +1 -1
- package/dist/{reveal-component-Dj4x14QX.js → reveal-component-CrJz4IhC.js} +2 -2
- package/package.json +2 -2
- package/src/components/data-table/__tests__/data-table.test.tsx +154 -12
- package/src/components/data-table/hover-tooltip/__tests__/content.test.ts +60 -0
- package/src/components/data-table/hover-tooltip/content.ts +44 -0
- package/src/components/data-table/hover-tooltip/hover-tooltip.tsx +55 -0
- package/src/components/data-table/hover-tooltip/use-table-hover-tooltip.ts +159 -0
- package/src/components/data-table/renderers.tsx +27 -43
- package/src/components/editor/cell/cell-context-menu.tsx +15 -2
- package/src/components/ui/__tests__/use-toast.test.ts +75 -0
- package/src/components/ui/use-toast.ts +33 -13
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -28
- package/src/core/cells/__tests__/cell.test.ts +29 -2
- package/src/core/cells/__tests__/document-changes.test.ts +201 -2
- package/src/core/cells/cell.ts +5 -1
- package/src/core/cells/document-changes.ts +61 -3
- package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +37 -0
- package/src/core/codemirror/go-to-definition/commands.ts +17 -9
- package/src/core/codemirror/go-to-definition/utils.ts +1 -0
- package/src/core/codemirror/language/languages/sql/utils.ts +3 -1
- package/src/core/network/__tests__/requests-static.test.ts +30 -0
- package/src/core/network/requests-static.ts +14 -10
- package/src/plugins/layout/DownloadPlugin.tsx +1 -1
|
@@ -8,61 +8,61 @@ var TOAST_LIMIT = 1, TOAST_REMOVE_DELAY = 1e4, count = 0;
|
|
|
8
8
|
function genId() {
|
|
9
9
|
return count = (count + 1) % Number.MAX_VALUE, count.toString();
|
|
10
10
|
}
|
|
11
|
-
var toastTimeouts = /* @__PURE__ */ new Map(), addToRemoveQueue = (e) => {
|
|
11
|
+
var toastTimeouts = /* @__PURE__ */ new Map(), shownOnceKeys = /* @__PURE__ */ new Set(), addToRemoveQueue = (e) => {
|
|
12
12
|
if (toastTimeouts.has(e)) return;
|
|
13
|
-
let
|
|
13
|
+
let d = setTimeout(() => {
|
|
14
14
|
toastTimeouts.delete(e), dispatch({
|
|
15
15
|
type: "REMOVE_TOAST",
|
|
16
16
|
toastId: e
|
|
17
17
|
});
|
|
18
18
|
}, TOAST_REMOVE_DELAY);
|
|
19
|
-
toastTimeouts.set(e,
|
|
19
|
+
toastTimeouts.set(e, d);
|
|
20
20
|
};
|
|
21
|
-
const reducer = (e,
|
|
22
|
-
switch (
|
|
21
|
+
const reducer = (e, d) => {
|
|
22
|
+
switch (d.type) {
|
|
23
23
|
case "ADD_TOAST":
|
|
24
24
|
return {
|
|
25
25
|
...e,
|
|
26
|
-
toasts: [
|
|
26
|
+
toasts: [d.toast, ...e.toasts].slice(0, TOAST_LIMIT)
|
|
27
27
|
};
|
|
28
28
|
case "UPDATE_TOAST":
|
|
29
29
|
return {
|
|
30
30
|
...e,
|
|
31
|
-
toasts: e.toasts.map((e2) => e2.id ===
|
|
31
|
+
toasts: e.toasts.map((e2) => e2.id === d.toast.id ? {
|
|
32
32
|
...e2,
|
|
33
|
-
...
|
|
33
|
+
...d.toast
|
|
34
34
|
} : e2)
|
|
35
35
|
};
|
|
36
36
|
case "DISMISS_TOAST": {
|
|
37
|
-
let { toastId:
|
|
38
|
-
return
|
|
37
|
+
let { toastId: f } = d;
|
|
38
|
+
return f ? addToRemoveQueue(f) : e.toasts.forEach((e2) => {
|
|
39
39
|
addToRemoveQueue(e2.id);
|
|
40
40
|
}), {
|
|
41
41
|
...e,
|
|
42
|
-
toasts: e.toasts.map((e2) => e2.id ===
|
|
42
|
+
toasts: e.toasts.map((e2) => e2.id === f || f === void 0 ? {
|
|
43
43
|
...e2,
|
|
44
44
|
open: false
|
|
45
45
|
} : e2)
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
case "REMOVE_TOAST":
|
|
49
|
-
return
|
|
49
|
+
return d.toastId === void 0 ? {
|
|
50
50
|
...e,
|
|
51
51
|
toasts: []
|
|
52
52
|
} : {
|
|
53
53
|
...e,
|
|
54
|
-
toasts: e.toasts.filter((e2) => e2.id !==
|
|
54
|
+
toasts: e.toasts.filter((e2) => e2.id !== d.toastId)
|
|
55
55
|
};
|
|
56
56
|
case "UPSERT_TOAST":
|
|
57
|
-
return e.toasts.findIndex((e2) => e2.id ===
|
|
57
|
+
return e.toasts.findIndex((e2) => e2.id === d.toast.id) > -1 ? {
|
|
58
58
|
...e,
|
|
59
|
-
toasts: e.toasts.map((e2) => e2.id ===
|
|
59
|
+
toasts: e.toasts.map((e2) => e2.id === d.toast.id ? {
|
|
60
60
|
...e2,
|
|
61
|
-
...
|
|
61
|
+
...d.toast
|
|
62
62
|
} : e2)
|
|
63
63
|
} : {
|
|
64
64
|
...e,
|
|
65
|
-
toasts: [
|
|
65
|
+
toasts: [d.toast, ...e.toasts].slice(0, TOAST_LIMIT)
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
};
|
|
@@ -72,39 +72,39 @@ function dispatch(e) {
|
|
|
72
72
|
e2(memoryState);
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
function toast({ id: e, ...
|
|
76
|
-
let
|
|
75
|
+
function toast({ id: e, once: d, ...f }) {
|
|
76
|
+
let p = e || genId(), m = d === true && e !== void 0, h = (e2) => dispatch({
|
|
77
77
|
type: "UPDATE_TOAST",
|
|
78
78
|
toast: {
|
|
79
79
|
...e2,
|
|
80
|
-
id:
|
|
80
|
+
id: p
|
|
81
81
|
}
|
|
82
82
|
}), g = () => dispatch({
|
|
83
83
|
type: "DISMISS_TOAST",
|
|
84
|
-
toastId:
|
|
84
|
+
toastId: p
|
|
85
85
|
}), _ = (e2) => dispatch({
|
|
86
86
|
type: "UPSERT_TOAST",
|
|
87
87
|
toast: {
|
|
88
88
|
...e2,
|
|
89
|
-
id:
|
|
89
|
+
id: p,
|
|
90
90
|
open: true,
|
|
91
91
|
onOpenChange: (e3) => {
|
|
92
92
|
e3 || g();
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
});
|
|
96
|
-
return dispatch({
|
|
95
|
+
}), v = m && shownOnceKeys.has(p);
|
|
96
|
+
return m && shownOnceKeys.add(p), v || dispatch({
|
|
97
97
|
type: "ADD_TOAST",
|
|
98
98
|
toast: {
|
|
99
|
-
...
|
|
100
|
-
id:
|
|
99
|
+
...f,
|
|
100
|
+
id: p,
|
|
101
101
|
open: true,
|
|
102
102
|
onOpenChange: (e2) => {
|
|
103
103
|
e2 || g();
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}), {
|
|
107
|
-
id:
|
|
107
|
+
id: p,
|
|
108
108
|
dismiss: g,
|
|
109
109
|
update: h,
|
|
110
110
|
upsert: _
|
|
@@ -122,17 +122,17 @@ 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, f) {
|
|
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
|
-
if (
|
|
131
|
-
let
|
|
132
|
-
"text/html": new Blob([
|
|
130
|
+
if (f && navigator.clipboard.write) try {
|
|
131
|
+
let d = new ClipboardItem({
|
|
132
|
+
"text/html": new Blob([f], { type: "text/html" }),
|
|
133
133
|
"text/plain": new Blob([e], { type: "text/plain" })
|
|
134
134
|
});
|
|
135
|
-
await navigator.clipboard.write([
|
|
135
|
+
await navigator.clipboard.write([d]);
|
|
136
136
|
return;
|
|
137
137
|
} catch {
|
|
138
138
|
Logger.warn("Failed to write rich text, falling back to plain text");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
3
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
4
|
-
import { l as historyKeymap, o as defaultKeymap, r as lintKeymap, s as history, t as _extends, u as indentWithTab } from "./extends-
|
|
4
|
+
import { l as historyKeymap, o as defaultKeymap, r as lintKeymap, s as history, t as _extends, u as indentWithTab } from "./extends-CkydH1Q5.js";
|
|
5
5
|
import { $ as ViewPlugin, At as Prec, B as tags, Bt as combineConfig, C as foldKeymap, Dt as EditorState, Et as EditorSelection, F as syntaxHighlighting, Ft as StateField, Ht as findClusterBreak, Mt as RangeSetBuilder, Ot as Facet, Pt as StateEffect, Rt as codePointAt, Ut as fromCodePoint, Y as Decoration, Z as EditorView, _t as showDialog, a as HighlightStyle, bt as crelt, ct as highlightActiveLineGutter, dt as keymap, ft as lineNumbers, g as defaultHighlightStyle, gt as runScopeHandlers, ht as rectangularSelection, it as getPanel, j as indentUnit, k as indentOnInput, lt as highlightSpecialChars, mt as placeholder, nt as drawSelection, p as bracketMatching, rt as dropCursor, st as highlightActiveLine, tt as crosshairCursor, vt as showPanel, wt as CharCategory, x as foldGutter, xt as Annotation, zt as codePointSize } from "./dist-DNdhYsgW.js";
|
|
6
6
|
import { a as closeBracketsKeymap, c as completionKeymap, i as closeBrackets, r as autocompletion } from "./dist-DhHh0jLg.js";
|
|
7
7
|
var basicNormalize = typeof String.prototype.normalize == "function" ? (e2) => e2.normalize("NFKD") : (e2) => e2, SearchCursor = class {
|
|
@@ -2,7 +2,7 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
2
2
|
import { g as cn, h as Events } from "./button-C5K9fIPF.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 { n as Copy, r as toast, t as copyToClipboard } from "./copy-
|
|
5
|
+
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-5jQ_kGE1.js";
|
|
6
6
|
import { t as Check } from "./check-DTbrK0zt.js";
|
|
7
7
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
8
8
|
import { t as Tooltip } from "./tooltip-C5FYOpQc.js";
|
|
@@ -5,7 +5,7 @@ import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
|
|
|
5
5
|
import { _ as Logger, h as Events, t as Button } from "./button-C5K9fIPF.js";
|
|
6
6
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
7
7
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
8
|
-
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-
|
|
8
|
+
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-5jQ_kGE1.js";
|
|
9
9
|
import { S as logNever, i as SelectContent, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, u as SelectValue } from "./strings-Bu3vlb6W.js";
|
|
10
10
|
import { G as marked, W as useNonce, _ as DropdownMenuSub, d as DropdownMenuContent, g as DropdownMenuSeparator, h as DropdownMenuPortal, p as DropdownMenuItem, r as Input, u as DropdownMenu, v as DropdownMenuSubContent, y as DropdownMenuSubTrigger } from "./input-_2sjvfne.js";
|
|
11
11
|
import { n as Trash, r as Pencil, t as BulkEdit } from "./types-CVvp1fKr.js";
|