reifyui 0.12.0 → 0.13.0
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/README.md +29 -0
- package/dist/chart.js +2 -0
- package/dist/chart.js.map +1 -1
- package/dist/chunk-EL2DHWOH.js +1710 -0
- package/dist/chunk-EL2DHWOH.js.map +1 -0
- package/dist/chunk-J633KV57.js +41 -0
- package/dist/chunk-J633KV57.js.map +1 -0
- package/dist/chunk-J7SECRIG.js +295 -0
- package/dist/chunk-J7SECRIG.js.map +1 -0
- package/dist/chunk-PIRPLH2Z.js +231 -0
- package/dist/chunk-PIRPLH2Z.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-UKG4Z6QK.js +130 -0
- package/dist/chunk-UKG4Z6QK.js.map +1 -0
- package/dist/chunk-ZYWE47EO.js +19 -0
- package/dist/chunk-ZYWE47EO.js.map +1 -0
- package/dist/collab.cjs +169 -0
- package/dist/collab.cjs.map +1 -0
- package/dist/collab.d.ts +30 -0
- package/dist/collab.js +18 -0
- package/dist/collab.js.map +1 -0
- package/dist/graph.cjs +2244 -0
- package/dist/graph.cjs.map +1 -0
- package/dist/graph.d.ts +41 -0
- package/dist/graph.js +1870 -0
- package/dist/graph.js.map +1 -0
- package/dist/harness.js +1 -0
- package/dist/harness.js.map +1 -1
- package/dist/index.cjs +1699 -817
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +680 -1769
- package/dist/index.js.map +1 -1
- package/dist/sheet-doc.cjs +235 -0
- package/dist/sheet-doc.cjs.map +1 -0
- package/dist/sheet-doc.d.ts +16 -0
- package/dist/sheet-doc.js +20 -0
- package/dist/sheet-doc.js.map +1 -0
- package/dist/sheet.cjs +2322 -0
- package/dist/sheet.cjs.map +1 -0
- package/dist/sheet.d.ts +23 -0
- package/dist/sheet.js +237 -0
- package/dist/sheet.js.map +1 -0
- package/dist/slides.js +2 -0
- package/dist/slides.js.map +1 -1
- package/package.json +34 -2
- package/src/auth/client.js +4 -2
- package/src/collab/colors.js +18 -0
- package/src/collab/index.d.ts +30 -0
- package/src/collab/index.js +8 -0
- package/src/collab/keepAlive.js +34 -0
- package/src/collab/useLiveDoc.js +76 -0
- package/src/components/CascadeMenu.jsx +9 -3
- package/src/components/Composer.jsx +37 -3
- package/src/components/resizable.jsx +82 -12
- package/src/graph/ConnectPane.jsx +634 -0
- package/src/graph/ConnectToolDetail.jsx +565 -0
- package/src/graph/LogsPane.jsx +328 -0
- package/src/graph/Skeleton.jsx +13 -0
- package/src/graph/draft.js +108 -0
- package/src/graph/format.js +37 -0
- package/src/graph/index.d.ts +41 -0
- package/src/graph/index.js +14 -0
- package/src/graph/useGraphCollab.js +299 -0
- package/src/graph/vgraph.js +215 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +4 -1
- package/src/mention/MentionInput.jsx +420 -0
- package/src/mention/mentionModel.js +177 -0
- package/src/sheet/RunStrip.jsx +57 -0
- package/src/sheet/SheetGrid.jsx +448 -423
- package/src/sheet/doc.d.ts +16 -0
- package/src/sheet/index.d.ts +23 -0
- package/src/sheet/index.js +10 -0
- package/src/sheet/sheetDoc.js +203 -0
- package/src/sheet/useSheetCollab.js +102 -0
- package/src/sheet/useSheetRun.js +80 -0
- package/styles/chat.css +2 -0
- package/styles/graph.css +395 -0
- package/styles/mention.css +79 -0
- package/styles/sheet.css +156 -112
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useOverlayEscape
|
|
3
|
+
} from "./chunk-J633KV57.js";
|
|
4
|
+
|
|
5
|
+
// src/components/icons.jsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Svg({ children, s = 16 }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"svg",
|
|
11
|
+
{
|
|
12
|
+
width: s,
|
|
13
|
+
height: s,
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
strokeWidth: "1.8",
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round",
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function Chevron({ dir, size = 16 }) {
|
|
25
|
+
const d = dir === "left" ? "M15 18l-6-6 6-6" : dir === "right" ? "M9 18l6-6-6-6" : "M6 9l6 6 6-6";
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
width: size,
|
|
30
|
+
height: size,
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeWidth: "2",
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeLinejoin: "round",
|
|
37
|
+
children: /* @__PURE__ */ jsx("path", { d })
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
var IcTool = () => /* @__PURE__ */ jsx(Svg, { s: 17, children: /* @__PURE__ */ jsx("path", { d: "M14.7 6.3a4 4 0 0 1-5.4 5.4L4 17v3h3l5.3-5.3a4 4 0 0 1 5.4-5.4l-2.3 2.3-1.7-1.7 2.3-2.3a4 4 0 0 0-1.6 0Z" }) });
|
|
42
|
+
var IcPlug = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
43
|
+
/* @__PURE__ */ jsx("path", { d: "M9 2v6M15 2v6M6 8h12v3a6 6 0 0 1-12 0z" }),
|
|
44
|
+
/* @__PURE__ */ jsx("path", { d: "M12 17v5" })
|
|
45
|
+
] });
|
|
46
|
+
var IcSkill = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
47
|
+
/* @__PURE__ */ jsx("path", { d: "M9 18h6M10 22h4" }),
|
|
48
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0 0 12 2z" })
|
|
49
|
+
] });
|
|
50
|
+
var IcTerminal = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
51
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
52
|
+
/* @__PURE__ */ jsx("path", { d: "M7 9l3 3-3 3M13 15h4" })
|
|
53
|
+
] });
|
|
54
|
+
var IcDoc = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
55
|
+
/* @__PURE__ */ jsx("path", { d: "M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" }),
|
|
56
|
+
/* @__PURE__ */ jsx("path", { d: "M14 3v6h6M8 13h8M8 17h6" })
|
|
57
|
+
] });
|
|
58
|
+
var IcList = () => /* @__PURE__ */ jsx(Svg, { s: 17, children: /* @__PURE__ */ jsx("path", { d: "M8 6h12M8 12h12M8 18h12M3.5 6h.01M3.5 12h.01M3.5 18h.01" }) });
|
|
59
|
+
var IcGlobe = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
60
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
61
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12h18M12 3a15 15 0 0 1 0 18a15 15 0 0 1 0-18z" })
|
|
62
|
+
] });
|
|
63
|
+
var IcSearch = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
64
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
65
|
+
/* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })
|
|
66
|
+
] });
|
|
67
|
+
var IcScroll = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
68
|
+
/* @__PURE__ */ jsx("path", { d: "M6 3h10a2 2 0 0 1 2 2v12a3 3 0 0 0 3 3H8a2 2 0 0 1-2-2V3z" }),
|
|
69
|
+
/* @__PURE__ */ jsx("path", { d: "M6 3a2 2 0 0 0-2 2v2h2M10 8h6M10 12h6" })
|
|
70
|
+
] });
|
|
71
|
+
var IcSpawn = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
72
|
+
/* @__PURE__ */ jsx("circle", { cx: "6", cy: "6", r: "3" }),
|
|
73
|
+
/* @__PURE__ */ jsx("circle", { cx: "18", cy: "18", r: "3" }),
|
|
74
|
+
/* @__PURE__ */ jsx("path", { d: "M6 9v3a3 3 0 0 0 3 3h6" })
|
|
75
|
+
] });
|
|
76
|
+
var IcCheck = () => /* @__PURE__ */ jsxs(Svg, { s: 17, children: [
|
|
77
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
78
|
+
/* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })
|
|
79
|
+
] });
|
|
80
|
+
var IcThink = () => /* @__PURE__ */ jsx(Svg, { s: 16, children: /* @__PURE__ */ jsx("path", { d: "M9.5 2a5.5 5.5 0 0 0-3 10.1V15a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2v-2.9A5.5 5.5 0 0 0 9.5 2zM9 20h4M10 22h2" }) });
|
|
81
|
+
var IcSend = () => /* @__PURE__ */ jsxs(Svg, { s: 16, children: [
|
|
82
|
+
/* @__PURE__ */ jsx("path", { d: "M12 19V5" }),
|
|
83
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12l7-7 7 7" })
|
|
84
|
+
] });
|
|
85
|
+
var IcX = ({ size = 14 }) => /* @__PURE__ */ jsx(Svg, { s: size, children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
86
|
+
var IcMic = ({ size = 15 }) => /* @__PURE__ */ jsxs(Svg, { s: size, children: [
|
|
87
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "2", width: "6", height: "12", rx: "3" }),
|
|
88
|
+
/* @__PURE__ */ jsx("path", { d: "M5 11a7 7 0 0 0 14 0M12 18v4M8 22h8" })
|
|
89
|
+
] });
|
|
90
|
+
var IcPaperclip = ({ size = 16 }) => /* @__PURE__ */ jsx(Svg, { s: size, children: /* @__PURE__ */ jsx("path", { d: "M21.4 11.1 12.2 20.3a5.5 5.5 0 0 1-7.8-7.8l9.2-9.2a3.7 3.7 0 0 1 5.2 5.2l-9.2 9.2a1.8 1.8 0 0 1-2.6-2.6l8.5-8.5" }) });
|
|
91
|
+
var IcPanelRight = ({ size = 17 }) => /* @__PURE__ */ jsxs(Svg, { s: size, children: [
|
|
92
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
93
|
+
/* @__PURE__ */ jsx("path", { d: "M15 4v16" })
|
|
94
|
+
] });
|
|
95
|
+
var IcDownload = ({ size = 16 }) => /* @__PURE__ */ jsxs(Svg, { s: size, children: [
|
|
96
|
+
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
97
|
+
/* @__PURE__ */ jsx("path", { d: "M7 10l5 5 5-5" }),
|
|
98
|
+
/* @__PURE__ */ jsx("path", { d: "M12 15V3" })
|
|
99
|
+
] });
|
|
100
|
+
var IcEye = ({ size = 15 }) => /* @__PURE__ */ jsxs(Svg, { s: size, children: [
|
|
101
|
+
/* @__PURE__ */ jsx("path", { d: "M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z" }),
|
|
102
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
103
|
+
] });
|
|
104
|
+
|
|
105
|
+
// src/components/CodeBlock.jsx
|
|
106
|
+
import React2 from "react";
|
|
107
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
108
|
+
var _hljsPromise = null;
|
|
109
|
+
function loadHljs() {
|
|
110
|
+
if (!_hljsPromise) {
|
|
111
|
+
_hljsPromise = import("highlight.js/lib/core").then((m) => m.default || m);
|
|
112
|
+
}
|
|
113
|
+
return _hljsPromise;
|
|
114
|
+
}
|
|
115
|
+
var GRAMMARS = {
|
|
116
|
+
javascript: () => import("highlight.js/lib/languages/javascript"),
|
|
117
|
+
typescript: () => import("highlight.js/lib/languages/typescript"),
|
|
118
|
+
python: () => import("highlight.js/lib/languages/python"),
|
|
119
|
+
json: () => import("highlight.js/lib/languages/json"),
|
|
120
|
+
bash: () => import("highlight.js/lib/languages/bash"),
|
|
121
|
+
sql: () => import("highlight.js/lib/languages/sql"),
|
|
122
|
+
java: () => import("highlight.js/lib/languages/java"),
|
|
123
|
+
go: () => import("highlight.js/lib/languages/go"),
|
|
124
|
+
rust: () => import("highlight.js/lib/languages/rust"),
|
|
125
|
+
xml: () => import("highlight.js/lib/languages/xml"),
|
|
126
|
+
css: () => import("highlight.js/lib/languages/css"),
|
|
127
|
+
yaml: () => import("highlight.js/lib/languages/yaml"),
|
|
128
|
+
groovy: () => import("highlight.js/lib/languages/groovy")
|
|
129
|
+
};
|
|
130
|
+
var ALIASES = {
|
|
131
|
+
js: "javascript",
|
|
132
|
+
jsx: "javascript",
|
|
133
|
+
mjs: "javascript",
|
|
134
|
+
cjs: "javascript",
|
|
135
|
+
node: "javascript",
|
|
136
|
+
ts: "typescript",
|
|
137
|
+
tsx: "typescript",
|
|
138
|
+
py: "python",
|
|
139
|
+
python3: "python",
|
|
140
|
+
sh: "bash",
|
|
141
|
+
shell: "bash",
|
|
142
|
+
zsh: "bash",
|
|
143
|
+
console: "bash",
|
|
144
|
+
html: "xml",
|
|
145
|
+
xhtml: "xml",
|
|
146
|
+
svg: "xml",
|
|
147
|
+
yml: "yaml",
|
|
148
|
+
golang: "go",
|
|
149
|
+
rs: "rust",
|
|
150
|
+
jsonc: "json",
|
|
151
|
+
postgres: "sql",
|
|
152
|
+
postgresql: "sql",
|
|
153
|
+
mysql: "sql",
|
|
154
|
+
plsql: "sql",
|
|
155
|
+
gremlin: "groovy"
|
|
156
|
+
};
|
|
157
|
+
function canonicalLang(tag) {
|
|
158
|
+
const t = String(tag || "").toLowerCase();
|
|
159
|
+
if (!t) return null;
|
|
160
|
+
const name = ALIASES[t] || t;
|
|
161
|
+
return GRAMMARS[name] ? name : null;
|
|
162
|
+
}
|
|
163
|
+
var _ready = /* @__PURE__ */ new Map();
|
|
164
|
+
function ensureLanguage(name) {
|
|
165
|
+
if (!_ready.has(name)) {
|
|
166
|
+
const p = Promise.all([loadHljs(), GRAMMARS[name]()]).then(([hljs, mod]) => {
|
|
167
|
+
if (!hljs.getLanguage(name)) hljs.registerLanguage(name, mod.default || mod);
|
|
168
|
+
return hljs;
|
|
169
|
+
}).catch(() => null);
|
|
170
|
+
_ready.set(name, p);
|
|
171
|
+
}
|
|
172
|
+
return _ready.get(name);
|
|
173
|
+
}
|
|
174
|
+
function CodeBlock(props) {
|
|
175
|
+
const { code, language, className } = props;
|
|
176
|
+
const src = String(code || "");
|
|
177
|
+
const lang = canonicalLang(language);
|
|
178
|
+
const [hl, setHl] = React2.useState(null);
|
|
179
|
+
React2.useEffect(() => {
|
|
180
|
+
if (!lang || !src) return void 0;
|
|
181
|
+
let cancelled = false;
|
|
182
|
+
const timer = setTimeout(() => {
|
|
183
|
+
ensureLanguage(lang).then((hljs) => {
|
|
184
|
+
if (!hljs || cancelled) return;
|
|
185
|
+
try {
|
|
186
|
+
const out = hljs.highlight(src, { language: lang, ignoreIllegals: true });
|
|
187
|
+
if (!cancelled) setHl({ src, html: out.value });
|
|
188
|
+
} catch {
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}, 200);
|
|
192
|
+
return () => {
|
|
193
|
+
cancelled = true;
|
|
194
|
+
clearTimeout(timer);
|
|
195
|
+
};
|
|
196
|
+
}, [src, lang]);
|
|
197
|
+
const html = hl && hl.src === src ? hl.html : null;
|
|
198
|
+
const label = String(language || "").toLowerCase();
|
|
199
|
+
return /* @__PURE__ */ jsxs2("pre", { className: "wbx-code" + (className ? " " + className : ""), children: [
|
|
200
|
+
label ? /* @__PURE__ */ jsx2("span", { className: "wbx-code-lang", "aria-hidden": "true", children: label }) : null,
|
|
201
|
+
html != null ? /* @__PURE__ */ jsx2("code", { className: "hljs language-" + label, dangerouslySetInnerHTML: { __html: html } }) : /* @__PURE__ */ jsx2("code", { className: label ? "language-" + label : void 0, children: src })
|
|
202
|
+
] });
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/components/Modal.jsx
|
|
206
|
+
import React3, { useCallback, useEffect, useId } from "react";
|
|
207
|
+
import { createPortal } from "react-dom";
|
|
208
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
209
|
+
function Modal(props) {
|
|
210
|
+
const {
|
|
211
|
+
open,
|
|
212
|
+
onClose,
|
|
213
|
+
title,
|
|
214
|
+
description,
|
|
215
|
+
actions,
|
|
216
|
+
size = "md",
|
|
217
|
+
width,
|
|
218
|
+
labelledBy,
|
|
219
|
+
children,
|
|
220
|
+
classNames = {}
|
|
221
|
+
} = props;
|
|
222
|
+
const titleId = useId();
|
|
223
|
+
const escape = useCallback(() => onClose?.(), [onClose]);
|
|
224
|
+
useOverlayEscape(open, escape);
|
|
225
|
+
useEffect(() => {
|
|
226
|
+
if (!open || typeof document === "undefined") return void 0;
|
|
227
|
+
const prev = document.body.style.overflow;
|
|
228
|
+
document.body.style.overflow = "hidden";
|
|
229
|
+
return () => {
|
|
230
|
+
document.body.style.overflow = prev;
|
|
231
|
+
};
|
|
232
|
+
}, [open]);
|
|
233
|
+
if (!open || typeof document === "undefined") return null;
|
|
234
|
+
const onBackdrop = (e) => {
|
|
235
|
+
if (e.target === e.currentTarget) onClose?.();
|
|
236
|
+
};
|
|
237
|
+
return createPortal(
|
|
238
|
+
/* @__PURE__ */ jsx3(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
className: ["uic-modal-backdrop", classNames.backdrop || ""].filter(Boolean).join(" "),
|
|
242
|
+
onMouseDown: onBackdrop,
|
|
243
|
+
children: /* @__PURE__ */ jsxs3(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: ["uic-modal", `is-${size}`, classNames.root || ""].filter(Boolean).join(" "),
|
|
247
|
+
style: width ? { width } : void 0,
|
|
248
|
+
role: "dialog",
|
|
249
|
+
"aria-modal": "true",
|
|
250
|
+
"aria-labelledby": labelledBy || (title ? titleId : void 0),
|
|
251
|
+
children: [
|
|
252
|
+
title || actions ? /* @__PURE__ */ jsxs3("div", { className: "uic-modal-h", children: [
|
|
253
|
+
/* @__PURE__ */ jsxs3("div", { className: "uic-modal-title", children: [
|
|
254
|
+
title ? /* @__PURE__ */ jsx3("h3", { id: titleId, children: title }) : null,
|
|
255
|
+
description ? /* @__PURE__ */ jsx3("p", { children: description }) : null
|
|
256
|
+
] }),
|
|
257
|
+
actions,
|
|
258
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "uic-modal-x", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsx3(IcX, { size: 18 }) })
|
|
259
|
+
] }) : null,
|
|
260
|
+
/* @__PURE__ */ jsx3("div", { className: ["uic-modal-b", classNames.body || ""].filter(Boolean).join(" "), children })
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
document.body
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export {
|
|
271
|
+
Svg,
|
|
272
|
+
Chevron,
|
|
273
|
+
IcTool,
|
|
274
|
+
IcPlug,
|
|
275
|
+
IcSkill,
|
|
276
|
+
IcTerminal,
|
|
277
|
+
IcDoc,
|
|
278
|
+
IcList,
|
|
279
|
+
IcGlobe,
|
|
280
|
+
IcSearch,
|
|
281
|
+
IcScroll,
|
|
282
|
+
IcSpawn,
|
|
283
|
+
IcCheck,
|
|
284
|
+
IcThink,
|
|
285
|
+
IcSend,
|
|
286
|
+
IcX,
|
|
287
|
+
IcMic,
|
|
288
|
+
IcPaperclip,
|
|
289
|
+
IcPanelRight,
|
|
290
|
+
IcDownload,
|
|
291
|
+
IcEye,
|
|
292
|
+
CodeBlock,
|
|
293
|
+
Modal
|
|
294
|
+
};
|
|
295
|
+
//# sourceMappingURL=chunk-J7SECRIG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/icons.jsx","../src/components/CodeBlock.jsx","../src/components/Modal.jsx"],"sourcesContent":["// Line-glyph icon set for the conversational surface (16-17px, currentColor stroke) —\n// extracted verbatim from HarnessRouter's workbench. Dependency-free (inline SVG only).\nimport React from 'react';\n\nexport function Svg({ children, s = 16 }) {\n return (\n <svg width={s} height={s} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\">{children}</svg>\n );\n}\n\nexport function Chevron({ dir, size = 16 }) {\n const d = dir === 'left' ? 'M15 18l-6-6 6-6' : dir === 'right' ? 'M9 18l6-6-6-6' : 'M6 9l6 6 6-6';\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\"\n strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d={d} /></svg>\n );\n}\n\n// ── tool-step icons (activity timeline) ──\nexport const IcTool = () => <Svg s={17}><path d=\"M14.7 6.3a4 4 0 0 1-5.4 5.4L4 17v3h3l5.3-5.3a4 4 0 0 1 5.4-5.4l-2.3 2.3-1.7-1.7 2.3-2.3a4 4 0 0 0-1.6 0Z\" /></Svg>;\nexport const IcPlug = () => <Svg s={17}><path d=\"M9 2v6M15 2v6M6 8h12v3a6 6 0 0 1-12 0z\" /><path d=\"M12 17v5\" /></Svg>;\nexport const IcSkill = () => <Svg s={17}><path d=\"M9 18h6M10 22h4\" /><path d=\"M12 2a7 7 0 0 0-4 12.7c.6.5 1 1.3 1 2.1V18h6v-1.2c0-.8.4-1.6 1-2.1A7 7 0 0 0 12 2z\" /></Svg>;\nexport const IcTerminal = () => <Svg s={17}><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" /><path d=\"M7 9l3 3-3 3M13 15h4\" /></Svg>;\nexport const IcDoc = () => <Svg s={17}><path d=\"M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z\" /><path d=\"M14 3v6h6M8 13h8M8 17h6\" /></Svg>;\nexport const IcList = () => <Svg s={17}><path d=\"M8 6h12M8 12h12M8 18h12M3.5 6h.01M3.5 12h.01M3.5 18h.01\" /></Svg>;\nexport const IcGlobe = () => <Svg s={17}><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M3 12h18M12 3a15 15 0 0 1 0 18a15 15 0 0 1 0-18z\" /></Svg>;\nexport const IcSearch = () => <Svg s={17}><circle cx=\"11\" cy=\"11\" r=\"7\" /><path d=\"m21 21-4.3-4.3\" /></Svg>;\nexport const IcScroll = () => <Svg s={17}><path d=\"M6 3h10a2 2 0 0 1 2 2v12a3 3 0 0 0 3 3H8a2 2 0 0 1-2-2V3z\" /><path d=\"M6 3a2 2 0 0 0-2 2v2h2M10 8h6M10 12h6\" /></Svg>;\nexport const IcSpawn = () => <Svg s={17}><circle cx=\"6\" cy=\"6\" r=\"3\" /><circle cx=\"18\" cy=\"18\" r=\"3\" /><path d=\"M6 9v3a3 3 0 0 0 3 3h6\" /></Svg>;\nexport const IcCheck = () => <Svg s={17}><circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"m9 12 2 2 4-4\" /></Svg>;\nexport const IcThink = () => <Svg s={16}><path d=\"M9.5 2a5.5 5.5 0 0 0-3 10.1V15a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2v-2.9A5.5 5.5 0 0 0 9.5 2zM9 20h4M10 22h2\" /></Svg>;\nexport const IcSend = () => <Svg s={16}><path d=\"M12 19V5\" /><path d=\"M5 12l7-7 7 7\" /></Svg>;\n\n// ── chrome glyphs (chat panel, chips, search) ──\n// The package draws its own so a consumer never inherits an icon-library dependency from a\n// component: four apps pull the same four glyphs out of lucide today purely to hand them to a\n// panel that could have drawn them itself.\nexport const IcX = ({ size = 14 }) => <Svg s={size}><path d=\"M18 6 6 18M6 6l12 12\" /></Svg>;\nexport const IcMic = ({ size = 15 }) => <Svg s={size}><rect x=\"9\" y=\"2\" width=\"6\" height=\"12\" rx=\"3\" /><path d=\"M5 11a7 7 0 0 0 14 0M12 18v4M8 22h8\" /></Svg>;\nexport const IcPaperclip = ({ size = 16 }) => <Svg s={size}><path d=\"M21.4 11.1 12.2 20.3a5.5 5.5 0 0 1-7.8-7.8l9.2-9.2a3.7 3.7 0 0 1 5.2 5.2l-9.2 9.2a1.8 1.8 0 0 1-2.6-2.6l8.5-8.5\" /></Svg>;\nexport const IcPanelRight = ({ size = 17 }) => <Svg s={size}><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\" /><path d=\"M15 4v16\" /></Svg>;\nexport const IcDownload = ({ size = 16 }) => <Svg s={size}><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" /><path d=\"M7 10l5 5 5-5\" /><path d=\"M12 15V3\" /></Svg>;\nexport const IcEye = ({ size = 15 }) => <Svg s={size}><path d=\"M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7-10-7-10-7z\" /><circle cx=\"12\" cy=\"12\" r=\"3\" /></Svg>;\n","// Fenced code block with language-aware syntax highlighting (highlight.js core).\n//\n// Consumers wire this into their markdown renderer's `pre` override (see the ChatPanel /\n// workbench MD_COMPONENTS): a ```mermaid fence keeps rendering as a diagram; every other fence\n// renders here. Design notes (same lazy pattern as the Mermaid block):\n// - highlight.js is LAZY-loaded (dynamic import) — the core plus exactly one small grammar\n// chunk per language actually used, never the full-language bundle. Until it loads the block\n// renders as plain <pre><code>, byte-identical geometry, so there is no layout shift.\n// - Highlighting is DEBOUNCED: while a fence is still streaming in token by token we render\n// plain text and re-arm the timer; the block highlights once it settles. hljs itself never\n// throws on partial input, the debounce just avoids re-lexing on every token.\n// - Unknown / missing language: NO auto-detect, render plain. Wrong-language colors are worse\n// than none.\n// - `gremlin` maps to the groovy grammar (Gremlin is a Groovy DSL — closest match).\n// - Colors are token-driven: .wbx-code maps hljs classes onto five --uic-code-* custom\n// properties (keyword/string/comment/number/function) with defaults tuned for the dark\n// code-block background. See styles/chat.css + README \"Theming\".\n// highlight.js must be a dependency of the CONSUMING app (the dynamic import resolves in its\n// bundler) — same rule as mermaid.\nimport React from 'react';\n\nlet _hljsPromise = null;\nfunction loadHljs() {\n if (!_hljsPromise) {\n _hljsPromise = import('highlight.js/lib/core').then((m) => m.default || m);\n }\n return _hljsPromise;\n}\n\n// One static dynamic-import per grammar so each becomes its own code-split chunk and only the\n// languages that actually appear in a conversation ever download.\nconst GRAMMARS = {\n javascript: () => import('highlight.js/lib/languages/javascript'),\n typescript: () => import('highlight.js/lib/languages/typescript'),\n python: () => import('highlight.js/lib/languages/python'),\n json: () => import('highlight.js/lib/languages/json'),\n bash: () => import('highlight.js/lib/languages/bash'),\n sql: () => import('highlight.js/lib/languages/sql'),\n java: () => import('highlight.js/lib/languages/java'),\n go: () => import('highlight.js/lib/languages/go'),\n rust: () => import('highlight.js/lib/languages/rust'),\n xml: () => import('highlight.js/lib/languages/xml'),\n css: () => import('highlight.js/lib/languages/css'),\n yaml: () => import('highlight.js/lib/languages/yaml'),\n groovy: () => import('highlight.js/lib/languages/groovy'),\n};\n\n// Fence-tag aliases → canonical grammar name.\nconst ALIASES = {\n js: 'javascript', jsx: 'javascript', mjs: 'javascript', cjs: 'javascript', node: 'javascript',\n ts: 'typescript', tsx: 'typescript',\n py: 'python', python3: 'python',\n sh: 'bash', shell: 'bash', zsh: 'bash', console: 'bash',\n html: 'xml', xhtml: 'xml', svg: 'xml',\n yml: 'yaml',\n golang: 'go',\n rs: 'rust',\n jsonc: 'json',\n postgres: 'sql', postgresql: 'sql', mysql: 'sql', plsql: 'sql',\n gremlin: 'groovy',\n};\n\nfunction canonicalLang(tag) {\n const t = String(tag || '').toLowerCase();\n if (!t) return null;\n const name = ALIASES[t] || t;\n return GRAMMARS[name] ? name : null;\n}\n\n// canonical name -> Promise<hljs | null> (null = load failed; stay plain forever, never retry-loop)\nconst _ready = new Map();\nfunction ensureLanguage(name) {\n if (!_ready.has(name)) {\n const p = Promise.all([loadHljs(), GRAMMARS[name]()])\n .then(([hljs, mod]) => {\n if (!hljs.getLanguage(name)) hljs.registerLanguage(name, mod.default || mod);\n return hljs;\n })\n .catch(() => null);\n _ready.set(name, p);\n }\n return _ready.get(name);\n}\n\nexport function CodeBlock(props) {\n const { code, language, className } = props;\n const src = String(code || '');\n const lang = canonicalLang(language);\n const [hl, setHl] = React.useState(null); // { src, html } — html valid only for exactly that src\n\n React.useEffect(() => {\n if (!lang || !src) return undefined;\n let cancelled = false;\n // Debounce: during streaming the fence grows every few ms — wait for a quiet gap, then\n // highlight the settled source. hljs output is fully HTML-escaped (safe to inject).\n const timer = setTimeout(() => {\n ensureLanguage(lang).then((hljs) => {\n if (!hljs || cancelled) return;\n try {\n const out = hljs.highlight(src, { language: lang, ignoreIllegals: true });\n if (!cancelled) setHl({ src, html: out.value });\n } catch {\n /* stay plain */\n }\n });\n }, 200);\n return () => { cancelled = true; clearTimeout(timer); };\n }, [src, lang]);\n\n const html = hl && hl.src === src ? hl.html : null;\n const label = String(language || '').toLowerCase();\n return (\n <pre className={'wbx-code' + (className ? ' ' + className : '')}>\n {label ? <span className=\"wbx-code-lang\" aria-hidden=\"true\">{label}</span> : null}\n {html != null\n ? <code className={'hljs language-' + label} dangerouslySetInnerHTML={{ __html: html }} />\n : <code className={label ? 'language-' + label : undefined}>{src}</code>}\n </pre>\n );\n}\n","// Modal — a dialog whose body is yours: a preview, a big form, a comparison.\n//\n// useDialog() answers a QUESTION and resolves to a value (confirm/prompt/alert). This is the\n// other half: a surface with arbitrary content that the caller opens and closes itself. Products\n// were re-implementing it per feature, each with its own backdrop mousedown handler and its own\n// document keydown listener.\n//\n// It shares the dialog host's Escape ordering through the package's overlay stack (components/\n// overlay.js), so a Modal opened on top of a confirm takes the key and the confirm does not, and\n// both sit at the same z-index layer (--uic-z-overlay). It does NOT render inside DialogHost's\n// portal: that root is created from the host's private state and only exists while a dialog is\n// open, so there is nothing to render into and no API to reach it with. One stack, two roots, is\n// the honest arrangement — and it means Modal works in an app that never mounted DialogHost.\nimport React, { useCallback, useEffect, useId } from 'react';\nimport { createPortal } from 'react-dom';\nimport { IcX } from './icons.jsx';\nimport { useOverlayEscape } from './overlay.js';\n\n/**\n * open render it\n * onClose Escape, the ✕, or a click on the backdrop itself\n * title the heading (string or node); also names the dialog for assistive tech\n * description one quiet line under the title\n * actions buttons in the header, before the ✕ (e.g. \"Use this template\")\n * size 'sm' | 'md' | 'lg' | 'full' — or pass `width` for an exact px/any CSS width\n * labelledBy id of your own heading, when `title` is not where the name lives\n */\nexport function Modal(props) {\n const { open, onClose, title, description, actions, size = 'md', width,\n labelledBy, children, classNames = {} } = props;\n const titleId = useId();\n\n const escape = useCallback(() => onClose?.(), [onClose]);\n useOverlayEscape(open, escape);\n\n // A modal that leaves the page scrolling behind it drifts under the reader's fingers on a\n // touch device and loses their place in the list they opened it from.\n useEffect(() => {\n if (!open || typeof document === 'undefined') return undefined;\n const prev = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => { document.body.style.overflow = prev; };\n }, [open]);\n\n if (!open || typeof document === 'undefined') return null;\n // mousedown, not click: a press that STARTED inside the card and ended on the backdrop (a drag\n // that overshot, a text selection) would otherwise close it out from under the person.\n const onBackdrop = (e) => { if (e.target === e.currentTarget) onClose?.(); };\n return createPortal(\n <div className={['uic-modal-backdrop', classNames.backdrop || ''].filter(Boolean).join(' ')}\n onMouseDown={onBackdrop}>\n <div className={['uic-modal', `is-${size}`, classNames.root || ''].filter(Boolean).join(' ')}\n style={width ? { width } : undefined}\n role=\"dialog\" aria-modal=\"true\"\n aria-labelledby={labelledBy || (title ? titleId : undefined)}>\n {(title || actions) ? (\n <div className=\"uic-modal-h\">\n <div className=\"uic-modal-title\">\n {title ? <h3 id={titleId}>{title}</h3> : null}\n {description ? <p>{description}</p> : null}\n </div>\n {actions}\n <button type=\"button\" className=\"uic-modal-x\" aria-label=\"Close\" onClick={onClose}>\n <IcX size={18} />\n </button>\n </div>\n ) : null}\n <div className={['uic-modal-b', classNames.body || ''].filter(Boolean).join(' ')}>\n {children}\n </div>\n </div>\n </div>,\n document.body,\n );\n}\n"],"mappings":";;;;;AAEA,OAAO,WAAW;AAId,cAewB,YAfxB;AAFG,SAAS,IAAI,EAAE,UAAU,IAAI,GAAG,GAAG;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MAAI,OAAO;AAAA,MAAG,QAAQ;AAAA,MAAG,SAAQ;AAAA,MAAY,MAAK;AAAA,MAAO,QAAO;AAAA,MAC/D,aAAY;AAAA,MAAM,eAAc;AAAA,MAAQ,gBAAe;AAAA,MAAS;AAAA;AAAA,EAAS;AAE/E;AAEO,SAAS,QAAQ,EAAE,KAAK,OAAO,GAAG,GAAG;AAC1C,QAAM,IAAI,QAAQ,SAAS,oBAAoB,QAAQ,UAAU,kBAAkB;AACnF,SACE;AAAA,IAAC;AAAA;AAAA,MAAI,OAAO;AAAA,MAAM,QAAQ;AAAA,MAAM,SAAQ;AAAA,MAAY,MAAK;AAAA,MAAO,QAAO;AAAA,MACrE,aAAY;AAAA,MAAI,eAAc;AAAA,MAAQ,gBAAe;AAAA,MAAQ,8BAAC,UAAK,GAAM;AAAA;AAAA,EAAE;AAEjF;AAGO,IAAM,SAAS,MAAM,oBAAC,OAAI,GAAG,IAAI,8BAAC,UAAK,GAAE,4GAA2G,GAAE;AACtJ,IAAM,SAAS,MAAM,qBAAC,OAAI,GAAG,IAAI;AAAA,sBAAC,UAAK,GAAE,0CAAyC;AAAA,EAAE,oBAAC,UAAK,GAAE,YAAW;AAAA,GAAE;AACzG,I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|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-PZ5AY32C.js";
|
|
4
|
+
|
|
5
|
+
// src/sheet/sheetDoc.js
|
|
6
|
+
var sheetDoc_exports = {};
|
|
7
|
+
__export(sheetDoc_exports, {
|
|
8
|
+
SHEET_PREFIX: () => SHEET_PREFIX,
|
|
9
|
+
apply: () => apply,
|
|
10
|
+
isSheetDoc: () => isSheetDoc,
|
|
11
|
+
orderOf: () => orderOf,
|
|
12
|
+
seed: () => seed,
|
|
13
|
+
sheetIdOf: () => sheetIdOf,
|
|
14
|
+
toJSON: () => toJSON
|
|
15
|
+
});
|
|
16
|
+
var SHEET_PREFIX = "cg-sheet:";
|
|
17
|
+
var isSheetDoc = (name) => typeof name === "string" && name.startsWith(SHEET_PREFIX);
|
|
18
|
+
var sheetIdOf = (name) => name.slice(SHEET_PREFIX.length);
|
|
19
|
+
var map = (doc, name) => doc.getMap(name);
|
|
20
|
+
var arr = (doc, name) => doc.getArray(name);
|
|
21
|
+
function orderOf(order, m) {
|
|
22
|
+
const seen = /* @__PURE__ */ new Set();
|
|
23
|
+
const out = [];
|
|
24
|
+
for (const id of order.toArray()) {
|
|
25
|
+
if (m.has(id) && !seen.has(id)) {
|
|
26
|
+
seen.add(id);
|
|
27
|
+
out.push(id);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (const id of m.keys()) if (!seen.has(id)) {
|
|
31
|
+
seen.add(id);
|
|
32
|
+
out.push(id);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
function clearMap(m) {
|
|
37
|
+
for (const k of [...m.keys()]) m.delete(k);
|
|
38
|
+
}
|
|
39
|
+
function clearArray(a) {
|
|
40
|
+
if (a.length) a.delete(0, a.length);
|
|
41
|
+
}
|
|
42
|
+
function removeFromOrder(order, id) {
|
|
43
|
+
const items = order.toArray();
|
|
44
|
+
for (let i = items.length - 1; i >= 0; i--) if (items[i] === id) order.delete(i, 1);
|
|
45
|
+
}
|
|
46
|
+
function placeInOrder(order, id, at) {
|
|
47
|
+
removeFromOrder(order, id);
|
|
48
|
+
const n = order.length;
|
|
49
|
+
const i = Number.isInteger(at) ? Math.max(0, Math.min(at, n)) : n;
|
|
50
|
+
order.insert(i, [id]);
|
|
51
|
+
}
|
|
52
|
+
function tabIds(doc) {
|
|
53
|
+
return orderOf(arr(doc, "taborder"), map(doc, "tabs"));
|
|
54
|
+
}
|
|
55
|
+
function clearTab(doc, tabId) {
|
|
56
|
+
clearMap(map(doc, `cols:${tabId}`));
|
|
57
|
+
clearArray(arr(doc, `colorder:${tabId}`));
|
|
58
|
+
clearMap(map(doc, `rows:${tabId}`));
|
|
59
|
+
clearArray(arr(doc, `roworder:${tabId}`));
|
|
60
|
+
clearMap(map(doc, `cells:${tabId}`));
|
|
61
|
+
}
|
|
62
|
+
function fillTab(doc, tab) {
|
|
63
|
+
const cols = map(doc, `cols:${tab.id}`), colorder = arr(doc, `colorder:${tab.id}`);
|
|
64
|
+
const rows = map(doc, `rows:${tab.id}`), roworder = arr(doc, `roworder:${tab.id}`);
|
|
65
|
+
const cells = map(doc, `cells:${tab.id}`);
|
|
66
|
+
for (const c of tab.columns || []) {
|
|
67
|
+
cols.set(c.id, c);
|
|
68
|
+
colorder.push([c.id]);
|
|
69
|
+
}
|
|
70
|
+
for (const r of tab.rows || []) {
|
|
71
|
+
rows.set(r.id, r);
|
|
72
|
+
roworder.push([r.id]);
|
|
73
|
+
}
|
|
74
|
+
for (const [k, v] of Object.entries(tab.cells || {})) if (v !== null && v !== void 0) cells.set(k, v);
|
|
75
|
+
}
|
|
76
|
+
function seed(doc, sheet, origin = "seed") {
|
|
77
|
+
doc.transact(() => {
|
|
78
|
+
for (const id of tabIds(doc)) clearTab(doc, id);
|
|
79
|
+
clearMap(map(doc, "tabs"));
|
|
80
|
+
clearArray(arr(doc, "taborder"));
|
|
81
|
+
const meta = map(doc, "meta");
|
|
82
|
+
meta.set("title", String((sheet.meta || {}).title || ""));
|
|
83
|
+
for (const tab of sheet.tabs || []) {
|
|
84
|
+
map(doc, "tabs").set(tab.id, { id: tab.id, name: tab.name });
|
|
85
|
+
arr(doc, "taborder").push([tab.id]);
|
|
86
|
+
fillTab(doc, tab);
|
|
87
|
+
}
|
|
88
|
+
}, origin);
|
|
89
|
+
}
|
|
90
|
+
function toJSON(doc) {
|
|
91
|
+
const meta = map(doc, "meta");
|
|
92
|
+
const tabs = tabIds(doc).map((id) => {
|
|
93
|
+
const t = map(doc, "tabs").get(id) || { id, name: "Sheet" };
|
|
94
|
+
const cols = map(doc, `cols:${id}`), rows = map(doc, `rows:${id}`), cells = map(doc, `cells:${id}`);
|
|
95
|
+
const columns = orderOf(arr(doc, `colorder:${id}`), cols).map((cid) => cols.get(cid));
|
|
96
|
+
const rowList = orderOf(arr(doc, `roworder:${id}`), rows).map((rid) => rows.get(rid));
|
|
97
|
+
const present = /* @__PURE__ */ new Set([...columns.map((c) => c.id)]);
|
|
98
|
+
const rowSet = new Set(rowList.map((r) => r.id));
|
|
99
|
+
const out = {};
|
|
100
|
+
for (const [k, v] of cells.entries()) {
|
|
101
|
+
const i = k.indexOf(":");
|
|
102
|
+
if (i > 0 && rowSet.has(k.slice(0, i)) && present.has(k.slice(i + 1))) out[k] = v;
|
|
103
|
+
}
|
|
104
|
+
return { id, name: t.name, columns, rows: rowList, cells: out };
|
|
105
|
+
});
|
|
106
|
+
return { meta: { title: meta.get("title") || "" }, tabs };
|
|
107
|
+
}
|
|
108
|
+
function apply(doc, ops, origin = "service") {
|
|
109
|
+
if (!Array.isArray(ops)) throw new Error("ops must be a list");
|
|
110
|
+
for (const op of ops) validateOp(op);
|
|
111
|
+
doc.transact(() => {
|
|
112
|
+
for (const op of ops) applyOne(doc, op);
|
|
113
|
+
}, origin);
|
|
114
|
+
}
|
|
115
|
+
var OPS = /* @__PURE__ */ new Set([
|
|
116
|
+
"set_cell",
|
|
117
|
+
"set_cells",
|
|
118
|
+
"set_column",
|
|
119
|
+
"delete_column",
|
|
120
|
+
"move_column",
|
|
121
|
+
"set_row",
|
|
122
|
+
"delete_row",
|
|
123
|
+
"move_row",
|
|
124
|
+
"set_tab",
|
|
125
|
+
"delete_tab",
|
|
126
|
+
"move_tab",
|
|
127
|
+
"set_meta",
|
|
128
|
+
"replace"
|
|
129
|
+
]);
|
|
130
|
+
function validateOp(op) {
|
|
131
|
+
if (!op || typeof op !== "object" || !OPS.has(op.op)) throw new Error(`unknown op ${op && op.op}`);
|
|
132
|
+
const needTab = !["set_tab", "delete_tab", "move_tab", "set_meta", "replace"].includes(op.op);
|
|
133
|
+
if (needTab && typeof op.tab !== "string") throw new Error(`${op.op}: tab required`);
|
|
134
|
+
if (op.op === "set_cell" && typeof op.key !== "string") throw new Error("set_cell: key required");
|
|
135
|
+
if (op.op === "set_cells" && (!op.cells || typeof op.cells !== "object")) throw new Error("set_cells: cells required");
|
|
136
|
+
if (op.op === "set_column" && !(op.column && typeof op.column.id === "string")) throw new Error("set_column: column.id required");
|
|
137
|
+
if (op.op === "set_row" && !(op.row && typeof op.row.id === "string")) throw new Error("set_row: row.id required");
|
|
138
|
+
if (op.op === "set_tab" && !(op.tab && typeof op.tab.id === "string")) throw new Error("set_tab: tab.id required");
|
|
139
|
+
if ((op.op === "delete_column" || op.op === "move_column" || op.op === "delete_row" || op.op === "move_row" || op.op === "delete_tab" || op.op === "move_tab") && typeof op.id !== "string") throw new Error(`${op.op}: id required`);
|
|
140
|
+
if (op.op === "set_meta" && typeof op.key !== "string") throw new Error("set_meta: key required");
|
|
141
|
+
if (op.op === "replace" && !(op.sheet && typeof op.sheet === "object")) throw new Error("replace: sheet required");
|
|
142
|
+
}
|
|
143
|
+
function applyOne(doc, op) {
|
|
144
|
+
switch (op.op) {
|
|
145
|
+
case "set_cell": {
|
|
146
|
+
const cells = map(doc, `cells:${op.tab}`);
|
|
147
|
+
if (op.cell === null || op.cell === void 0) cells.delete(op.key);
|
|
148
|
+
else cells.set(op.key, op.cell);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
case "set_cells": {
|
|
152
|
+
const cells = map(doc, `cells:${op.tab}`);
|
|
153
|
+
for (const [k, v] of Object.entries(op.cells)) {
|
|
154
|
+
if (v === null || v === void 0) cells.delete(k);
|
|
155
|
+
else cells.set(k, v);
|
|
156
|
+
}
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
case "set_column": {
|
|
160
|
+
map(doc, `cols:${op.tab}`).set(op.column.id, op.column);
|
|
161
|
+
const order = arr(doc, `colorder:${op.tab}`);
|
|
162
|
+
if (Number.isInteger(op.at) || !order.toArray().includes(op.column.id)) placeInOrder(order, op.column.id, op.at);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
case "delete_column": {
|
|
166
|
+
map(doc, `cols:${op.tab}`).delete(op.id);
|
|
167
|
+
removeFromOrder(arr(doc, `colorder:${op.tab}`), op.id);
|
|
168
|
+
const cells = map(doc, `cells:${op.tab}`);
|
|
169
|
+
for (const k of [...cells.keys()]) if (k.endsWith(`:${op.id}`)) cells.delete(k);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
case "move_column":
|
|
173
|
+
placeInOrder(arr(doc, `colorder:${op.tab}`), op.id, op.at);
|
|
174
|
+
return;
|
|
175
|
+
case "set_row": {
|
|
176
|
+
map(doc, `rows:${op.tab}`).set(op.row.id, op.row);
|
|
177
|
+
const order = arr(doc, `roworder:${op.tab}`);
|
|
178
|
+
if (Number.isInteger(op.at) || !order.toArray().includes(op.row.id)) placeInOrder(order, op.row.id, op.at);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
case "delete_row": {
|
|
182
|
+
map(doc, `rows:${op.tab}`).delete(op.id);
|
|
183
|
+
removeFromOrder(arr(doc, `roworder:${op.tab}`), op.id);
|
|
184
|
+
const cells = map(doc, `cells:${op.tab}`);
|
|
185
|
+
for (const k of [...cells.keys()]) if (k.startsWith(`${op.id}:`)) cells.delete(k);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
case "move_row":
|
|
189
|
+
placeInOrder(arr(doc, `roworder:${op.tab}`), op.id, op.at);
|
|
190
|
+
return;
|
|
191
|
+
case "set_tab": {
|
|
192
|
+
const t = op.tab;
|
|
193
|
+
map(doc, "tabs").set(t.id, { id: t.id, name: String(t.name || "Sheet") });
|
|
194
|
+
const order = arr(doc, "taborder");
|
|
195
|
+
if (Number.isInteger(op.at) || !order.toArray().includes(t.id)) placeInOrder(order, t.id, op.at);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
case "delete_tab": {
|
|
199
|
+
map(doc, "tabs").delete(op.id);
|
|
200
|
+
removeFromOrder(arr(doc, "taborder"), op.id);
|
|
201
|
+
clearTab(doc, op.id);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
case "move_tab":
|
|
205
|
+
placeInOrder(arr(doc, "taborder"), op.id, op.at);
|
|
206
|
+
return;
|
|
207
|
+
case "set_meta": {
|
|
208
|
+
const meta = map(doc, "meta");
|
|
209
|
+
if (op.value === null || op.value === void 0) meta.delete(op.key);
|
|
210
|
+
else meta.set(op.key, op.value);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
case "replace":
|
|
214
|
+
seed(doc, op.sheet, "service");
|
|
215
|
+
return;
|
|
216
|
+
default:
|
|
217
|
+
throw new Error(`unknown op ${op.op}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export {
|
|
222
|
+
SHEET_PREFIX,
|
|
223
|
+
isSheetDoc,
|
|
224
|
+
sheetIdOf,
|
|
225
|
+
orderOf,
|
|
226
|
+
seed,
|
|
227
|
+
toJSON,
|
|
228
|
+
apply,
|
|
229
|
+
sheetDoc_exports
|
|
230
|
+
};
|
|
231
|
+
//# sourceMappingURL=chunk-PIRPLH2Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/sheet/sheetDoc.js"],"sourcesContent":["// sheetDoc — the Sheet document family (\"cg-sheet:<sheetId>\"), ONE module\n// for the collab sidecar (backend/company_brain, which imports it by relative\n// path) and the browsers (ui-core). It takes no dependency of its own: the\n// functions work on Yjs shared types the caller hands in, so the same code\n// runs wherever a Y.Doc exists.\n//\n// The Yjs document IS the sheet while people edit it; the Sheets service's\n// JSON (sheets/<id>/sheet.json) is its materialization, written through the\n// store hook the way brain docs materialize markdown. Every writer, browser\n// grid, copilot tool or batch run, changes the document: browsers through\n// Yjs transactions, services through ops on /v1/cg/publish. Reads that must\n// be current (a run deciding a cell's dependencies) come from the document.\n//\n// Layout, all top-level shared types so a client subscribes to what it draws:\n// meta Y.Map service keys: title, run, copilot\n// taborder Y.Array tab ids in order\n// tabs Y.Map tabId -> {id, name}\n// cols:<tab> Y.Map colId -> column colorder:<tab> Y.Array colId\n// rows:<tab> Y.Map rowId -> row roworder:<tab> Y.Array rowId\n// cells:<tab> Y.Map \"rowId:colId\" -> cell\n// Maps hold the objects, arrays hold the order: two people inserting rows at\n// once both land, and a cell edit touches one key. Order arrays are read\n// through orderOf(), which drops ids no longer in the map and appends ids\n// the map holds but the order lost, so a concurrent move and delete can\n// never lose an item.\nexport const SHEET_PREFIX = 'cg-sheet:';\nexport const isSheetDoc = (name) => typeof name === 'string' && name.startsWith(SHEET_PREFIX);\nexport const sheetIdOf = (name) => name.slice(SHEET_PREFIX.length);\n\nconst map = (doc, name) => doc.getMap(name);\nconst arr = (doc, name) => doc.getArray(name);\n\n/** Ids in array order, deduplicated, only those the map holds, plus the\n * map's strays at the end (in insertion order). */\nexport function orderOf(order, m) {\n const seen = new Set();\n const out = [];\n for (const id of order.toArray()) {\n if (m.has(id) && !seen.has(id)) { seen.add(id); out.push(id); }\n }\n for (const id of m.keys()) if (!seen.has(id)) { seen.add(id); out.push(id); }\n return out;\n}\n\nfunction clearMap(m) { for (const k of [...m.keys()]) m.delete(k); }\nfunction clearArray(a) { if (a.length) a.delete(0, a.length); }\nfunction removeFromOrder(order, id) {\n const items = order.toArray();\n for (let i = items.length - 1; i >= 0; i--) if (items[i] === id) order.delete(i, 1);\n}\nfunction placeInOrder(order, id, at) {\n removeFromOrder(order, id);\n const n = order.length;\n const i = Number.isInteger(at) ? Math.max(0, Math.min(at, n)) : n;\n order.insert(i, [id]);\n}\n\nfunction tabIds(doc) {\n return orderOf(arr(doc, 'taborder'), map(doc, 'tabs'));\n}\n\nfunction clearTab(doc, tabId) {\n clearMap(map(doc, `cols:${tabId}`)); clearArray(arr(doc, `colorder:${tabId}`));\n clearMap(map(doc, `rows:${tabId}`)); clearArray(arr(doc, `roworder:${tabId}`));\n clearMap(map(doc, `cells:${tabId}`));\n}\n\nfunction fillTab(doc, tab) {\n const cols = map(doc, `cols:${tab.id}`), colorder = arr(doc, `colorder:${tab.id}`);\n const rows = map(doc, `rows:${tab.id}`), roworder = arr(doc, `roworder:${tab.id}`);\n const cells = map(doc, `cells:${tab.id}`);\n for (const c of tab.columns || []) { cols.set(c.id, c); colorder.push([c.id]); }\n for (const r of tab.rows || []) { rows.set(r.id, r); roworder.push([r.id]); }\n for (const [k, v] of Object.entries(tab.cells || {})) if (v !== null && v !== undefined) cells.set(k, v);\n}\n\n/** Replace the document's content with a sheet JSON (fresh open, or an\n * explicit replace). Runs inside one transaction. */\nexport function seed(doc, sheet, origin = 'seed') {\n doc.transact(() => {\n for (const id of tabIds(doc)) clearTab(doc, id);\n clearMap(map(doc, 'tabs')); clearArray(arr(doc, 'taborder'));\n const meta = map(doc, 'meta');\n meta.set('title', String((sheet.meta || {}).title || ''));\n for (const tab of sheet.tabs || []) {\n map(doc, 'tabs').set(tab.id, { id: tab.id, name: tab.name });\n arr(doc, 'taborder').push([tab.id]);\n fillTab(doc, tab);\n }\n }, origin);\n}\n\n/** The sheet JSON the document currently describes. */\nexport function toJSON(doc) {\n const meta = map(doc, 'meta');\n const tabs = tabIds(doc).map((id) => {\n const t = map(doc, 'tabs').get(id) || { id, name: 'Sheet' };\n const cols = map(doc, `cols:${id}`), rows = map(doc, `rows:${id}`), cells = map(doc, `cells:${id}`);\n const columns = orderOf(arr(doc, `colorder:${id}`), cols).map((cid) => cols.get(cid));\n const rowList = orderOf(arr(doc, `roworder:${id}`), rows).map((rid) => rows.get(rid));\n const present = new Set([...columns.map((c) => c.id)]);\n const rowSet = new Set(rowList.map((r) => r.id));\n const out = {};\n for (const [k, v] of cells.entries()) {\n const i = k.indexOf(':');\n if (i > 0 && rowSet.has(k.slice(0, i)) && present.has(k.slice(i + 1))) out[k] = v;\n }\n return { id, name: t.name, columns, rows: rowList, cells: out };\n });\n return { meta: { title: meta.get('title') || '' }, tabs };\n}\n\n/** Apply service ops in one transaction. Unknown ops throw; nothing is\n * applied then. */\nexport function apply(doc, ops, origin = 'service') {\n if (!Array.isArray(ops)) throw new Error('ops must be a list');\n for (const op of ops) validateOp(op);\n doc.transact(() => {\n for (const op of ops) applyOne(doc, op);\n }, origin);\n}\n\nconst OPS = new Set(['set_cell', 'set_cells', 'set_column', 'delete_column', 'move_column',\n 'set_row', 'delete_row', 'move_row', 'set_tab', 'delete_tab', 'move_tab', 'set_meta', 'replace']);\n\nfunction validateOp(op) {\n if (!op || typeof op !== 'object' || !OPS.has(op.op)) throw new Error(`unknown op ${op && op.op}`);\n const needTab = !['set_tab', 'delete_tab', 'move_tab', 'set_meta', 'replace'].includes(op.op);\n if (needTab && typeof op.tab !== 'string') throw new Error(`${op.op}: tab required`);\n if (op.op === 'set_cell' && typeof op.key !== 'string') throw new Error('set_cell: key required');\n if (op.op === 'set_cells' && (!op.cells || typeof op.cells !== 'object')) throw new Error('set_cells: cells required');\n if (op.op === 'set_column' && !(op.column && typeof op.column.id === 'string')) throw new Error('set_column: column.id required');\n if (op.op === 'set_row' && !(op.row && typeof op.row.id === 'string')) throw new Error('set_row: row.id required');\n if (op.op === 'set_tab' && !(op.tab && typeof op.tab.id === 'string')) throw new Error('set_tab: tab.id required');\n if ((op.op === 'delete_column' || op.op === 'move_column' || op.op === 'delete_row' || op.op === 'move_row'\n || op.op === 'delete_tab' || op.op === 'move_tab') && typeof op.id !== 'string') throw new Error(`${op.op}: id required`);\n if (op.op === 'set_meta' && typeof op.key !== 'string') throw new Error('set_meta: key required');\n if (op.op === 'replace' && !(op.sheet && typeof op.sheet === 'object')) throw new Error('replace: sheet required');\n}\n\nfunction applyOne(doc, op) {\n switch (op.op) {\n case 'set_cell': {\n const cells = map(doc, `cells:${op.tab}`);\n if (op.cell === null || op.cell === undefined) cells.delete(op.key); else cells.set(op.key, op.cell);\n return;\n }\n case 'set_cells': {\n const cells = map(doc, `cells:${op.tab}`);\n for (const [k, v] of Object.entries(op.cells)) { if (v === null || v === undefined) cells.delete(k); else cells.set(k, v); }\n return;\n }\n case 'set_column': {\n map(doc, `cols:${op.tab}`).set(op.column.id, op.column);\n const order = arr(doc, `colorder:${op.tab}`);\n if (Number.isInteger(op.at) || !order.toArray().includes(op.column.id)) placeInOrder(order, op.column.id, op.at);\n return;\n }\n case 'delete_column': {\n map(doc, `cols:${op.tab}`).delete(op.id);\n removeFromOrder(arr(doc, `colorder:${op.tab}`), op.id);\n const cells = map(doc, `cells:${op.tab}`);\n for (const k of [...cells.keys()]) if (k.endsWith(`:${op.id}`)) cells.delete(k);\n return;\n }\n case 'move_column': placeInOrder(arr(doc, `colorder:${op.tab}`), op.id, op.at); return;\n case 'set_row': {\n map(doc, `rows:${op.tab}`).set(op.row.id, op.row);\n const order = arr(doc, `roworder:${op.tab}`);\n if (Number.isInteger(op.at) || !order.toArray().includes(op.row.id)) placeInOrder(order, op.row.id, op.at);\n return;\n }\n case 'delete_row': {\n map(doc, `rows:${op.tab}`).delete(op.id);\n removeFromOrder(arr(doc, `roworder:${op.tab}`), op.id);\n const cells = map(doc, `cells:${op.tab}`);\n for (const k of [...cells.keys()]) if (k.startsWith(`${op.id}:`)) cells.delete(k);\n return;\n }\n case 'move_row': placeInOrder(arr(doc, `roworder:${op.tab}`), op.id, op.at); return;\n case 'set_tab': {\n const t = op.tab;\n map(doc, 'tabs').set(t.id, { id: t.id, name: String(t.name || 'Sheet') });\n const order = arr(doc, 'taborder');\n if (Number.isInteger(op.at) || !order.toArray().includes(t.id)) placeInOrder(order, t.id, op.at);\n return;\n }\n case 'delete_tab': {\n map(doc, 'tabs').delete(op.id);\n removeFromOrder(arr(doc, 'taborder'), op.id);\n clearTab(doc, op.id);\n return;\n }\n case 'move_tab': placeInOrder(arr(doc, 'taborder'), op.id, op.at); return;\n case 'set_meta': {\n const meta = map(doc, 'meta');\n if (op.value === null || op.value === undefined) meta.delete(op.key); else meta.set(op.key, op.value);\n return;\n }\n case 'replace': seed(doc, op.sheet, 'service'); return;\n default: throw new Error(`unknown op ${op.op}`);\n }\n}\n"],"mappings":";;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBO,IAAM,eAAe;AACrB,IAAM,aAAa,CAAC,SAAS,OAAO,SAAS,YAAY,KAAK,WAAW,YAAY;AACrF,IAAM,YAAY,CAAC,SAAS,KAAK,MAAM,aAAa,MAAM;AAEjE,IAAM,MAAM,CAAC,KAAK,SAAS,IAAI,OAAO,IAAI;AAC1C,IAAM,MAAM,CAAC,KAAK,SAAS,IAAI,SAAS,IAAI;AAIrC,SAAS,QAAQ,OAAO,GAAG;AAChC,QAAM,OAAO,oBAAI,IAAI;AACrB,QAAM,MAAM,CAAC;AACb,aAAW,MAAM,MAAM,QAAQ,GAAG;AAChC,QAAI,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE,GAAG;AAAE,WAAK,IAAI,EAAE;AAAG,UAAI,KAAK,EAAE;AAAA,IAAG;AAAA,EAChE;AACA,aAAW,MAAM,EAAE,KAAK,EAAG,KAAI,CAAC,KAAK,IAAI,EAAE,GAAG;AAAE,SAAK,IAAI,EAAE;AAAG,QAAI,KAAK,EAAE;AAAA,EAAG;AAC5E,SAAO;AACT;AAEA,SAAS,SAAS,GAAG;AAAE,aAAW,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAG,G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