@gridsheet/react-dev 3.0.0-rc.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/dist/index.d.ts +2 -0
- package/dist/index.js +459 -0
- package/dist/index.js.map +1 -0
- package/dist/react-dev/src/Debugger.d.ts +8 -0
- package/dist/react-dev/src/Debugger.d.ts.map +1 -0
- package/dist/react-dev/src/index.d.ts +3 -0
- package/dist/react-dev/src/index.d.ts.map +1 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { a2p, x2c, Lexer, FormulaParser } from "@gridsheet/react-core";
|
|
4
|
+
const Debugger = ({ hub, intervalMs = 500 }) => {
|
|
5
|
+
const { wire } = hub;
|
|
6
|
+
const [snapshot, setSnapshot] = useState({});
|
|
7
|
+
const [activeTabId, setActiveTabId] = useState(null);
|
|
8
|
+
const [topHeight, setTopHeight] = useState(() => {
|
|
9
|
+
const saved = sessionStorage.getItem("debugger_top_height");
|
|
10
|
+
return saved ? Number(saved) : 200;
|
|
11
|
+
});
|
|
12
|
+
const [bottomHeight, setBottomHeight] = useState(() => {
|
|
13
|
+
const saved = sessionStorage.getItem("debugger_bottom_height");
|
|
14
|
+
return saved ? Number(saved) : 200;
|
|
15
|
+
});
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const updateSnapshot = () => {
|
|
18
|
+
if (!wire) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const {
|
|
22
|
+
choosingAddress,
|
|
23
|
+
choosingSheetId,
|
|
24
|
+
editingAddress,
|
|
25
|
+
editingSheetId,
|
|
26
|
+
ready,
|
|
27
|
+
sheetIdsByName,
|
|
28
|
+
sheetHead,
|
|
29
|
+
cellHead,
|
|
30
|
+
paletteBySheetName,
|
|
31
|
+
solvedCaches,
|
|
32
|
+
copyingSheetId,
|
|
33
|
+
copyingZone,
|
|
34
|
+
cutting,
|
|
35
|
+
historyIndex,
|
|
36
|
+
historyLimit,
|
|
37
|
+
histories,
|
|
38
|
+
asyncPending,
|
|
39
|
+
asyncInflight
|
|
40
|
+
} = wire;
|
|
41
|
+
setSnapshot({
|
|
42
|
+
asyncPending,
|
|
43
|
+
asyncInflight,
|
|
44
|
+
ready,
|
|
45
|
+
sheetIdsByName,
|
|
46
|
+
sheetHead,
|
|
47
|
+
cellHead,
|
|
48
|
+
paletteBySheetName,
|
|
49
|
+
solvedCaches,
|
|
50
|
+
choosingAddress,
|
|
51
|
+
choosingSheetId,
|
|
52
|
+
editingAddress,
|
|
53
|
+
editingSheetId,
|
|
54
|
+
copyingSheetId,
|
|
55
|
+
copyingZone,
|
|
56
|
+
cutting,
|
|
57
|
+
historyIndex,
|
|
58
|
+
historyLimit,
|
|
59
|
+
histories
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
updateSnapshot();
|
|
63
|
+
const intervalId = setInterval(updateSnapshot, intervalMs);
|
|
64
|
+
return () => clearInterval(intervalId);
|
|
65
|
+
}, [wire, intervalMs]);
|
|
66
|
+
const sheets = snapshot.sheetIdsByName ? Object.entries(snapshot.sheetIdsByName).map(([name, id]) => ({ id, name })).sort((a, b) => a.id - b.id) : [];
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (activeTabId === null && sheets.length > 0) {
|
|
69
|
+
setActiveTabId(sheets[0].id);
|
|
70
|
+
}
|
|
71
|
+
}, [sheets.length, activeTabId]);
|
|
72
|
+
let activeStoreData = null;
|
|
73
|
+
let activeTableData = null;
|
|
74
|
+
let wireCellData = null;
|
|
75
|
+
let wireCellAddress = (wire == null ? void 0 : wire.choosingAddress) || "";
|
|
76
|
+
let wireCellSheetName = "";
|
|
77
|
+
let wireFormulaExpr = null;
|
|
78
|
+
let wireFormulaTokens = null;
|
|
79
|
+
if (wire && activeTabId !== null) {
|
|
80
|
+
const { contextsBySheetId } = wire;
|
|
81
|
+
const context = contextsBySheetId[activeTabId];
|
|
82
|
+
if (context) {
|
|
83
|
+
activeStoreData = context.store;
|
|
84
|
+
const table = context.store.tableReactive.current;
|
|
85
|
+
if (table) {
|
|
86
|
+
activeTableData = table;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (wire && wire.choosingSheetId != null) {
|
|
91
|
+
const { contextsBySheetId } = wire;
|
|
92
|
+
const choosingContext = contextsBySheetId[wire.choosingSheetId];
|
|
93
|
+
if (wire.sheetIdsByName) {
|
|
94
|
+
const entry = Object.entries(wire.sheetIdsByName).find(([, id]) => id === wire.choosingSheetId);
|
|
95
|
+
if (entry) {
|
|
96
|
+
wireCellSheetName = entry[0];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (choosingContext) {
|
|
100
|
+
const table = choosingContext.store.tableReactive.current;
|
|
101
|
+
const store = choosingContext.store;
|
|
102
|
+
if (table) {
|
|
103
|
+
const rawTable = table.__raw__ || table;
|
|
104
|
+
const idMatrix = rawTable.idMatrix;
|
|
105
|
+
const isTopHeaderSelecting = store.topHeaderSelecting;
|
|
106
|
+
const isLeftHeaderSelecting = store.leftHeaderSelecting;
|
|
107
|
+
const pos = isTopHeaderSelecting ? { y: 0, x: store.choosing.x } : isLeftHeaderSelecting ? { y: store.choosing.y, x: 0 } : a2p(wire.choosingAddress);
|
|
108
|
+
if (isTopHeaderSelecting) {
|
|
109
|
+
wireCellAddress = `header:${x2c(store.choosing.x)}`;
|
|
110
|
+
} else if (isLeftHeaderSelecting) {
|
|
111
|
+
wireCellAddress = `header:${store.choosing.y}`;
|
|
112
|
+
}
|
|
113
|
+
if (pos && idMatrix[pos.y]) {
|
|
114
|
+
const id = idMatrix[pos.y][pos.x];
|
|
115
|
+
if (id) {
|
|
116
|
+
wireCellData = wire.data[id];
|
|
117
|
+
const text = wireCellData == null ? void 0 : wireCellData.value;
|
|
118
|
+
if (typeof text === "string" && text.startsWith("=")) {
|
|
119
|
+
try {
|
|
120
|
+
const lexer = new Lexer(text.substring(1));
|
|
121
|
+
lexer.tokenize();
|
|
122
|
+
wireFormulaTokens = lexer.tokens;
|
|
123
|
+
const parser = new FormulaParser(lexer.tokens);
|
|
124
|
+
wireFormulaExpr = parser.build();
|
|
125
|
+
} catch (e) {
|
|
126
|
+
wireFormulaExpr = { error: String(e) };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const jsonReplacer = (key, value) => {
|
|
135
|
+
if (key === "wire" || key === "__raw__" || value && typeof value === "object" && "current" in value && Object.keys(value).length === 1) {
|
|
136
|
+
return void 0;
|
|
137
|
+
}
|
|
138
|
+
if (value instanceof Map) {
|
|
139
|
+
return Object.fromEntries(value.entries());
|
|
140
|
+
}
|
|
141
|
+
if (value instanceof Set) {
|
|
142
|
+
return Array.from(value);
|
|
143
|
+
}
|
|
144
|
+
return value;
|
|
145
|
+
};
|
|
146
|
+
const startDrag = (e) => {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
const startY = e.clientY;
|
|
149
|
+
const startHeight = topHeight;
|
|
150
|
+
const onMouseMove = (moveEvent) => {
|
|
151
|
+
const h = Math.max(100, startHeight + moveEvent.clientY - startY);
|
|
152
|
+
setTopHeight(h);
|
|
153
|
+
sessionStorage.setItem("debugger_top_height", String(h));
|
|
154
|
+
};
|
|
155
|
+
const onMouseUp = () => {
|
|
156
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
157
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
158
|
+
};
|
|
159
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
160
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
161
|
+
};
|
|
162
|
+
const startDragBottom = (e) => {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
const startY = e.clientY;
|
|
165
|
+
const startHeight = bottomHeight;
|
|
166
|
+
const onMouseMove = (moveEvent) => {
|
|
167
|
+
const h = Math.max(100, startHeight + moveEvent.clientY - startY);
|
|
168
|
+
setBottomHeight(h);
|
|
169
|
+
sessionStorage.setItem("debugger_bottom_height", String(h));
|
|
170
|
+
};
|
|
171
|
+
const onMouseUp = () => {
|
|
172
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
173
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
174
|
+
};
|
|
175
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
176
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ jsxs(
|
|
179
|
+
"div",
|
|
180
|
+
{
|
|
181
|
+
style: {
|
|
182
|
+
display: "flex",
|
|
183
|
+
flexDirection: "column",
|
|
184
|
+
fontFamily: "monospace",
|
|
185
|
+
fontSize: "12px",
|
|
186
|
+
color: "#212529",
|
|
187
|
+
border: "1px solid #dee2e6",
|
|
188
|
+
borderRadius: "6px",
|
|
189
|
+
overflow: "hidden"
|
|
190
|
+
},
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ jsxs(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
style: {
|
|
196
|
+
display: "flex",
|
|
197
|
+
flexDirection: "row",
|
|
198
|
+
height: `${topHeight}px`,
|
|
199
|
+
overflow: "hidden"
|
|
200
|
+
},
|
|
201
|
+
children: [
|
|
202
|
+
/* @__PURE__ */ jsxs(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
style: {
|
|
206
|
+
flex: 1,
|
|
207
|
+
borderRight: "1px solid #dee2e6",
|
|
208
|
+
backgroundColor: "#fafafa",
|
|
209
|
+
overflow: "auto",
|
|
210
|
+
position: "relative"
|
|
211
|
+
},
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ jsx(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
style: {
|
|
217
|
+
position: "sticky",
|
|
218
|
+
top: 0,
|
|
219
|
+
background: "#fafafa",
|
|
220
|
+
zIndex: 1,
|
|
221
|
+
padding: "8px 12px",
|
|
222
|
+
fontWeight: "bold",
|
|
223
|
+
borderBottom: "2px solid #ccc"
|
|
224
|
+
},
|
|
225
|
+
children: "Wire State"
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx("pre", { style: { margin: 0, padding: "12px" }, children: JSON.stringify(snapshot, jsonReplacer, 2) })
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ jsxs(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
style: {
|
|
236
|
+
flex: 1,
|
|
237
|
+
borderRight: "1px solid #dee2e6",
|
|
238
|
+
overflow: "auto",
|
|
239
|
+
backgroundColor: "#f0f8f0",
|
|
240
|
+
position: "relative"
|
|
241
|
+
},
|
|
242
|
+
children: [
|
|
243
|
+
/* @__PURE__ */ jsxs(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
style: {
|
|
247
|
+
position: "sticky",
|
|
248
|
+
top: 0,
|
|
249
|
+
background: "#f0f8f0",
|
|
250
|
+
zIndex: 1,
|
|
251
|
+
padding: "8px 12px",
|
|
252
|
+
fontWeight: "bold",
|
|
253
|
+
borderBottom: "2px solid #ccc"
|
|
254
|
+
},
|
|
255
|
+
children: [
|
|
256
|
+
"Cell: ",
|
|
257
|
+
wireCellSheetName && `${wireCellSheetName}!`,
|
|
258
|
+
wireCellAddress,
|
|
259
|
+
" ",
|
|
260
|
+
(wire == null ? void 0 : wire.choosingSheetId) != null && `(SheetID: ${wire.choosingSheetId})`
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
wireCellData ? /* @__PURE__ */ jsx("pre", { style: { margin: 0, padding: "12px" }, children: JSON.stringify(wireCellData, null, 2) }) : /* @__PURE__ */ jsx("div", { style: { fontStyle: "italic", color: "#6c757d", padding: "12px" }, children: "No cell data" })
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsxs(
|
|
269
|
+
"div",
|
|
270
|
+
{
|
|
271
|
+
style: {
|
|
272
|
+
flex: 1,
|
|
273
|
+
borderRight: "1px solid #dee2e6",
|
|
274
|
+
overflow: "auto",
|
|
275
|
+
backgroundColor: "#fffbf0",
|
|
276
|
+
position: "relative"
|
|
277
|
+
},
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ jsx(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
style: {
|
|
283
|
+
position: "sticky",
|
|
284
|
+
top: 0,
|
|
285
|
+
background: "#fffbf0",
|
|
286
|
+
zIndex: 1,
|
|
287
|
+
padding: "8px 12px",
|
|
288
|
+
fontWeight: "bold",
|
|
289
|
+
borderBottom: "2px solid #ccc"
|
|
290
|
+
},
|
|
291
|
+
children: "Formula Expressions"
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
wireFormulaExpr ? /* @__PURE__ */ jsx("pre", { style: { margin: 0, padding: "12px" }, children: JSON.stringify(wireFormulaExpr, null, 2) }) : /* @__PURE__ */ jsx("div", { style: { fontStyle: "italic", color: "#6c757d", padding: "12px" }, children: wireCellData ? "Not a formula" : "No cell selected" })
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, overflow: "auto", backgroundColor: "#f5f0ff", position: "relative" }, children: [
|
|
299
|
+
/* @__PURE__ */ jsx(
|
|
300
|
+
"div",
|
|
301
|
+
{
|
|
302
|
+
style: {
|
|
303
|
+
position: "sticky",
|
|
304
|
+
top: 0,
|
|
305
|
+
background: "#f5f0ff",
|
|
306
|
+
zIndex: 1,
|
|
307
|
+
padding: "8px 12px",
|
|
308
|
+
fontWeight: "bold",
|
|
309
|
+
borderBottom: "2px solid #ccc"
|
|
310
|
+
},
|
|
311
|
+
children: "Formula Tokens"
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
wireFormulaTokens ? /* @__PURE__ */ jsx("pre", { style: { margin: 0, padding: "12px" }, children: JSON.stringify(wireFormulaTokens, null, 2) }) : /* @__PURE__ */ jsx("div", { style: { fontStyle: "italic", color: "#6c757d", padding: "12px" }, children: wireCellData ? "Not a formula" : "No cell selected" })
|
|
315
|
+
] })
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
/* @__PURE__ */ jsx(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
onMouseDown: startDrag,
|
|
323
|
+
style: {
|
|
324
|
+
height: "6px",
|
|
325
|
+
backgroundColor: "#dee2e6",
|
|
326
|
+
cursor: "row-resize",
|
|
327
|
+
transition: "background-color 0.2s",
|
|
328
|
+
zIndex: 10
|
|
329
|
+
},
|
|
330
|
+
onMouseEnter: (e) => {
|
|
331
|
+
e.currentTarget.style.backgroundColor = "#adb5bd";
|
|
332
|
+
},
|
|
333
|
+
onMouseLeave: (e) => {
|
|
334
|
+
e.currentTarget.style.backgroundColor = "#dee2e6";
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
),
|
|
338
|
+
/* @__PURE__ */ jsxs(
|
|
339
|
+
"div",
|
|
340
|
+
{
|
|
341
|
+
style: {
|
|
342
|
+
display: "flex",
|
|
343
|
+
borderBottom: "1px solid #dee2e6",
|
|
344
|
+
borderTop: "1px solid #dee2e6",
|
|
345
|
+
backgroundColor: "#f8f9fa"
|
|
346
|
+
},
|
|
347
|
+
children: [
|
|
348
|
+
sheets.map((sheet) => /* @__PURE__ */ jsxs(
|
|
349
|
+
"div",
|
|
350
|
+
{
|
|
351
|
+
onClick: () => setActiveTabId(sheet.id),
|
|
352
|
+
style: {
|
|
353
|
+
padding: "8px 16px",
|
|
354
|
+
cursor: "pointer",
|
|
355
|
+
fontWeight: "bold",
|
|
356
|
+
borderBottom: activeTabId === sheet.id ? "2px solid #0d6efd" : "2px solid transparent",
|
|
357
|
+
color: activeTabId === sheet.id ? "#0d6efd" : "#495057"
|
|
358
|
+
},
|
|
359
|
+
children: [
|
|
360
|
+
sheet.name,
|
|
361
|
+
" (ID: ",
|
|
362
|
+
sheet.id,
|
|
363
|
+
")"
|
|
364
|
+
]
|
|
365
|
+
},
|
|
366
|
+
sheet.id
|
|
367
|
+
)),
|
|
368
|
+
sheets.length === 0 && /* @__PURE__ */ jsx("div", { style: { padding: "8px 16px", color: "#6c757d" }, children: "No sheets detected" })
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ jsxs(
|
|
373
|
+
"div",
|
|
374
|
+
{
|
|
375
|
+
style: {
|
|
376
|
+
display: "flex",
|
|
377
|
+
flexDirection: "row",
|
|
378
|
+
height: `${bottomHeight}px`,
|
|
379
|
+
backgroundColor: "#fff",
|
|
380
|
+
overflow: "hidden"
|
|
381
|
+
},
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, borderRight: "1px solid #dee2e6", overflow: "auto", position: "relative" }, children: [
|
|
384
|
+
/* @__PURE__ */ jsx(
|
|
385
|
+
"div",
|
|
386
|
+
{
|
|
387
|
+
style: {
|
|
388
|
+
position: "sticky",
|
|
389
|
+
top: 0,
|
|
390
|
+
background: "#fff",
|
|
391
|
+
zIndex: 1,
|
|
392
|
+
padding: "8px 12px",
|
|
393
|
+
fontWeight: "bold",
|
|
394
|
+
borderBottom: "2px solid #ccc"
|
|
395
|
+
},
|
|
396
|
+
children: "Table Data"
|
|
397
|
+
}
|
|
398
|
+
),
|
|
399
|
+
activeTableData ? /* @__PURE__ */ jsx("pre", { style: { margin: 0, padding: "12px" }, children: JSON.stringify(activeTableData, jsonReplacer, 2) }) : /* @__PURE__ */ jsx("div", { style: { fontStyle: "italic", color: "#6c757d", padding: "12px" }, children: "Table instance not found" })
|
|
400
|
+
] }),
|
|
401
|
+
/* @__PURE__ */ jsxs(
|
|
402
|
+
"div",
|
|
403
|
+
{
|
|
404
|
+
style: {
|
|
405
|
+
flex: 1,
|
|
406
|
+
overflow: "auto",
|
|
407
|
+
backgroundColor: "#fdfdfe",
|
|
408
|
+
position: "relative"
|
|
409
|
+
},
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
style: {
|
|
415
|
+
position: "sticky",
|
|
416
|
+
top: 0,
|
|
417
|
+
background: "#fdfdfe",
|
|
418
|
+
zIndex: 1,
|
|
419
|
+
padding: "8px 12px",
|
|
420
|
+
fontWeight: "bold",
|
|
421
|
+
borderBottom: "2px solid #ccc"
|
|
422
|
+
},
|
|
423
|
+
children: "Store Data"
|
|
424
|
+
}
|
|
425
|
+
),
|
|
426
|
+
activeStoreData ? /* @__PURE__ */ jsx("pre", { style: { margin: 0, padding: "12px" }, children: JSON.stringify(activeStoreData, jsonReplacer, 2) }) : /* @__PURE__ */ jsx("div", { style: { fontStyle: "italic", color: "#6c757d", padding: "12px" }, children: "Store state not found" })
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
)
|
|
430
|
+
]
|
|
431
|
+
}
|
|
432
|
+
),
|
|
433
|
+
/* @__PURE__ */ jsx(
|
|
434
|
+
"div",
|
|
435
|
+
{
|
|
436
|
+
onMouseDown: startDragBottom,
|
|
437
|
+
style: {
|
|
438
|
+
height: "6px",
|
|
439
|
+
backgroundColor: "#dee2e6",
|
|
440
|
+
cursor: "row-resize",
|
|
441
|
+
transition: "background-color 0.2s",
|
|
442
|
+
zIndex: 10
|
|
443
|
+
},
|
|
444
|
+
onMouseEnter: (e) => {
|
|
445
|
+
e.currentTarget.style.backgroundColor = "#adb5bd";
|
|
446
|
+
},
|
|
447
|
+
onMouseLeave: (e) => {
|
|
448
|
+
e.currentTarget.style.backgroundColor = "#dee2e6";
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
]
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
};
|
|
456
|
+
export {
|
|
457
|
+
Debugger
|
|
458
|
+
};
|
|
459
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/Debugger.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport type { HubType } from '@gridsheet/react-core';\nimport { a2p, x2c, Lexer, FormulaParser } from '@gridsheet/react-core';\n\nexport type DebuggerProps = {\n hub: HubType;\n intervalMs?: number;\n};\n\nexport const Debugger: React.FC<DebuggerProps> = ({ hub, intervalMs = 500 }) => {\n const { wire } = hub;\n const [snapshot, setSnapshot] = useState<any>({});\n const [activeTabId, setActiveTabId] = useState<number | null>(null);\n const [topHeight, setTopHeight] = useState<number>(() => {\n const saved = sessionStorage.getItem('debugger_top_height');\n return saved ? Number(saved) : 200;\n });\n const [bottomHeight, setBottomHeight] = useState<number>(() => {\n const saved = sessionStorage.getItem('debugger_bottom_height');\n return saved ? Number(saved) : 200;\n });\n\n useEffect(() => {\n const updateSnapshot = () => {\n if (!wire) {\n return;\n }\n\n const {\n choosingAddress,\n choosingSheetId,\n editingAddress,\n editingSheetId,\n ready,\n sheetIdsByName,\n sheetHead,\n cellHead,\n paletteBySheetName,\n solvedCaches,\n copyingSheetId,\n copyingZone,\n cutting,\n historyIndex,\n historyLimit,\n histories,\n asyncPending,\n asyncInflight,\n } = wire;\n\n setSnapshot({\n asyncPending,\n asyncInflight,\n ready,\n sheetIdsByName,\n sheetHead,\n cellHead,\n paletteBySheetName,\n solvedCaches,\n choosingAddress,\n choosingSheetId,\n editingAddress,\n editingSheetId,\n copyingSheetId,\n copyingZone,\n cutting,\n historyIndex,\n historyLimit,\n histories,\n });\n };\n\n updateSnapshot();\n\n const intervalId = setInterval(updateSnapshot, intervalMs);\n return () => clearInterval(intervalId);\n }, [wire, intervalMs]);\n\n const sheets = snapshot.sheetIdsByName\n ? Object.entries(snapshot.sheetIdsByName)\n .map(([name, id]) => ({ id: id as number, name }))\n .sort((a, b) => a.id - b.id)\n : [];\n\n useEffect(() => {\n if (activeTabId === null && sheets.length > 0) {\n setActiveTabId(sheets[0].id);\n }\n }, [sheets.length, activeTabId]);\n\n let activeStoreData = null;\n let activeTableData = null;\n\n // Cell data for wire.choosingSheetId / choosingAddress\n let wireCellData = null;\n let wireCellAddress = wire?.choosingAddress || '';\n let wireCellSheetName = '';\n let wireFormulaExpr = null;\n let wireFormulaTokens = null;\n\n if (wire && activeTabId !== null) {\n const { contextsBySheetId } = wire;\n const context = contextsBySheetId[activeTabId];\n\n if (context) {\n activeStoreData = context.store;\n\n const table = context.store.tableReactive.current;\n if (table) {\n activeTableData = table;\n }\n }\n }\n\n // Resolve cell data for wire.choosingSheetId / choosingAddress\n if (wire && wire.choosingSheetId != null) {\n const { contextsBySheetId } = wire;\n const choosingContext = contextsBySheetId[wire.choosingSheetId];\n\n // Resolve sheet name\n if (wire.sheetIdsByName) {\n const entry = Object.entries(wire.sheetIdsByName).find(([, id]) => id === wire.choosingSheetId);\n if (entry) {\n wireCellSheetName = entry[0];\n }\n }\n\n if (choosingContext) {\n const table = choosingContext.store.tableReactive.current;\n const store = choosingContext.store;\n if (table) {\n const rawTable = (table as any).__raw__ || table;\n const idMatrix = rawTable.idMatrix;\n\n // When a header is selected, refer to y=0 (top) or x=0 (left) header cell\n const isTopHeaderSelecting = store.topHeaderSelecting;\n const isLeftHeaderSelecting = store.leftHeaderSelecting;\n const pos = isTopHeaderSelecting\n ? { y: 0, x: store.choosing.x }\n : isLeftHeaderSelecting\n ? { y: store.choosing.y, x: 0 }\n : a2p(wire.choosingAddress);\n\n if (isTopHeaderSelecting) {\n wireCellAddress = `header:${x2c(store.choosing.x)}`;\n } else if (isLeftHeaderSelecting) {\n wireCellAddress = `header:${store.choosing.y}`;\n }\n\n if (pos && idMatrix[pos.y]) {\n const id = idMatrix[pos.y][pos.x];\n if (id) {\n wireCellData = wire.data[id];\n\n // Parse formula\n const text = wireCellData?.value;\n if (typeof text === 'string' && text.startsWith('=')) {\n try {\n const lexer = new Lexer(text.substring(1));\n lexer.tokenize();\n wireFormulaTokens = lexer.tokens;\n const parser = new FormulaParser(lexer.tokens);\n wireFormulaExpr = parser.build();\n } catch (e) {\n wireFormulaExpr = { error: String(e) };\n }\n }\n }\n }\n }\n }\n }\n\n const jsonReplacer = (key: string, value: any) => {\n // Avoid circular refs, noise, and React RefObjects\n if (\n key === 'wire' ||\n key === '__raw__' ||\n (value && typeof value === 'object' && 'current' in value && Object.keys(value).length === 1) // basic heuristic to skip ref objects\n ) {\n return undefined;\n }\n if (value instanceof Map) {\n return Object.fromEntries(value.entries());\n }\n if (value instanceof Set) {\n return Array.from(value);\n }\n return value;\n };\n\n const startDrag = (e: React.MouseEvent) => {\n e.preventDefault();\n const startY = e.clientY;\n const startHeight = topHeight;\n const onMouseMove = (moveEvent: MouseEvent) => {\n const h = Math.max(100, startHeight + moveEvent.clientY - startY);\n setTopHeight(h);\n sessionStorage.setItem('debugger_top_height', String(h));\n };\n const onMouseUp = () => {\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n };\n\n const startDragBottom = (e: React.MouseEvent) => {\n e.preventDefault();\n const startY = e.clientY;\n const startHeight = bottomHeight;\n const onMouseMove = (moveEvent: MouseEvent) => {\n const h = Math.max(100, startHeight + moveEvent.clientY - startY);\n setBottomHeight(h);\n sessionStorage.setItem('debugger_bottom_height', String(h));\n };\n const onMouseUp = () => {\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n };\n\n return (\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n fontFamily: 'monospace',\n fontSize: '12px',\n color: '#212529',\n border: '1px solid #dee2e6',\n borderRadius: '6px',\n overflow: 'hidden',\n }}\n >\n {/* 上段: Wire State | Wire Cell | Formula Expressions | Formula Tokens */}\n <div\n style={{\n display: 'flex',\n flexDirection: 'row',\n height: `${topHeight}px`,\n overflow: 'hidden',\n }}\n >\n {/* Wire State */}\n <div\n style={{\n flex: 1,\n borderRight: '1px solid #dee2e6',\n backgroundColor: '#fafafa',\n overflow: 'auto',\n position: 'relative',\n }}\n >\n <div\n style={{\n position: 'sticky',\n top: 0,\n background: '#fafafa',\n zIndex: 1,\n padding: '8px 12px',\n fontWeight: 'bold',\n borderBottom: '2px solid #ccc',\n }}\n >\n Wire State\n </div>\n <pre style={{ margin: 0, padding: '12px' }}>{JSON.stringify(snapshot, jsonReplacer, 2)}</pre>\n </div>\n\n {/* Wire Cell Value: wire.choosingSheetId / choosingAddress のセルデータ */}\n <div\n style={{\n flex: 1,\n borderRight: '1px solid #dee2e6',\n overflow: 'auto',\n backgroundColor: '#f0f8f0',\n position: 'relative',\n }}\n >\n <div\n style={{\n position: 'sticky',\n top: 0,\n background: '#f0f8f0',\n zIndex: 1,\n padding: '8px 12px',\n fontWeight: 'bold',\n borderBottom: '2px solid #ccc',\n }}\n >\n Cell: {wireCellSheetName && `${wireCellSheetName}!`}\n {wireCellAddress} {wire?.choosingSheetId != null && `(SheetID: ${wire.choosingSheetId})`}\n </div>\n {wireCellData ? (\n <pre style={{ margin: 0, padding: '12px' }}>{JSON.stringify(wireCellData, null, 2)}</pre>\n ) : (\n <div style={{ fontStyle: 'italic', color: '#6c757d', padding: '12px' }}>No cell data</div>\n )}\n </div>\n\n {/* Formula Expressions */}\n <div\n style={{\n flex: 1,\n borderRight: '1px solid #dee2e6',\n overflow: 'auto',\n backgroundColor: '#fffbf0',\n position: 'relative',\n }}\n >\n <div\n style={{\n position: 'sticky',\n top: 0,\n background: '#fffbf0',\n zIndex: 1,\n padding: '8px 12px',\n fontWeight: 'bold',\n borderBottom: '2px solid #ccc',\n }}\n >\n Formula Expressions\n </div>\n {wireFormulaExpr ? (\n <pre style={{ margin: 0, padding: '12px' }}>{JSON.stringify(wireFormulaExpr, null, 2)}</pre>\n ) : (\n <div style={{ fontStyle: 'italic', color: '#6c757d', padding: '12px' }}>\n {wireCellData ? 'Not a formula' : 'No cell selected'}\n </div>\n )}\n </div>\n\n {/* Formula Tokens: lexer.tokens */}\n <div style={{ flex: 1, overflow: 'auto', backgroundColor: '#f5f0ff', position: 'relative' }}>\n <div\n style={{\n position: 'sticky',\n top: 0,\n background: '#f5f0ff',\n zIndex: 1,\n padding: '8px 12px',\n fontWeight: 'bold',\n borderBottom: '2px solid #ccc',\n }}\n >\n Formula Tokens\n </div>\n {wireFormulaTokens ? (\n <pre style={{ margin: 0, padding: '12px' }}>{JSON.stringify(wireFormulaTokens, null, 2)}</pre>\n ) : (\n <div style={{ fontStyle: 'italic', color: '#6c757d', padding: '12px' }}>\n {wireCellData ? 'Not a formula' : 'No cell selected'}\n </div>\n )}\n </div>\n </div>\n\n {/* Resizer for Top Pane */}\n <div\n onMouseDown={startDrag}\n style={{\n height: '6px',\n backgroundColor: '#dee2e6',\n cursor: 'row-resize',\n transition: 'background-color 0.2s',\n zIndex: 10,\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = '#adb5bd';\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = '#dee2e6';\n }}\n />\n\n {/* Sheet Tabs */}\n <div\n style={{\n display: 'flex',\n borderBottom: '1px solid #dee2e6',\n borderTop: '1px solid #dee2e6',\n backgroundColor: '#f8f9fa',\n }}\n >\n {sheets.map((sheet) => (\n <div\n key={sheet.id}\n onClick={() => setActiveTabId(sheet.id)}\n style={{\n padding: '8px 16px',\n cursor: 'pointer',\n fontWeight: 'bold',\n borderBottom: activeTabId === sheet.id ? '2px solid #0d6efd' : '2px solid transparent',\n color: activeTabId === sheet.id ? '#0d6efd' : '#495057',\n }}\n >\n {sheet.name} (ID: {sheet.id})\n </div>\n ))}\n {sheets.length === 0 && <div style={{ padding: '8px 16px', color: '#6c757d' }}>No sheets detected</div>}\n </div>\n\n {/* 下段: Table Data | Store Data */}\n <div\n style={{\n display: 'flex',\n flexDirection: 'row',\n height: `${bottomHeight}px`,\n backgroundColor: '#fff',\n overflow: 'hidden',\n }}\n >\n <div style={{ flex: 1, borderRight: '1px solid #dee2e6', overflow: 'auto', position: 'relative' }}>\n <div\n style={{\n position: 'sticky',\n top: 0,\n background: '#fff',\n zIndex: 1,\n padding: '8px 12px',\n fontWeight: 'bold',\n borderBottom: '2px solid #ccc',\n }}\n >\n Table Data\n </div>\n {activeTableData ? (\n <pre style={{ margin: 0, padding: '12px' }}>{JSON.stringify(activeTableData, jsonReplacer, 2)}</pre>\n ) : (\n <div style={{ fontStyle: 'italic', color: '#6c757d', padding: '12px' }}>Table instance not found</div>\n )}\n </div>\n\n <div\n style={{\n flex: 1,\n overflow: 'auto',\n backgroundColor: '#fdfdfe',\n position: 'relative',\n }}\n >\n <div\n style={{\n position: 'sticky',\n top: 0,\n background: '#fdfdfe',\n zIndex: 1,\n padding: '8px 12px',\n fontWeight: 'bold',\n borderBottom: '2px solid #ccc',\n }}\n >\n Store Data\n </div>\n {activeStoreData ? (\n <pre style={{ margin: 0, padding: '12px' }}>{JSON.stringify(activeStoreData, jsonReplacer, 2)}</pre>\n ) : (\n <div style={{ fontStyle: 'italic', color: '#6c757d', padding: '12px' }}>Store state not found</div>\n )}\n </div>\n </div>\n\n {/* Resizer for Bottom Pane */}\n <div\n onMouseDown={startDragBottom}\n style={{\n height: '6px',\n backgroundColor: '#dee2e6',\n cursor: 'row-resize',\n transition: 'background-color 0.2s',\n zIndex: 10,\n }}\n onMouseEnter={(e) => {\n e.currentTarget.style.backgroundColor = '#adb5bd';\n }}\n onMouseLeave={(e) => {\n e.currentTarget.style.backgroundColor = '#dee2e6';\n }}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;AASO,MAAM,WAAoC,CAAC,EAAE,KAAK,aAAa,UAAU;AACxE,QAAA,EAAE,SAAS;AACjB,QAA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kBACC,oBAAC,OAAI,EAAA,OAAO,EAAE,QAAQ,GAAG,SAAS,OAAO,GAAI,UAAK,KAAA,UAAU,iBAAiB,cAAc,CAAC,EAAA,CAAE,IAE9F,oBAAC,OAAI,EAAA,OAAO,EAAE,WAAW,UAAU,OAAO,WAAW,SAAS,OAAO,GAAG,UAAqB,wBAAA,CAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YAEjG;AAAA,UAAA;AAAA,QACF;AAAA,QAGA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,aAAa;AAAA,YACb,OAAO;AAAA,cACL,QAAQ;AAAA,cACR,iBAAiB;AAAA,cACjB,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,QAAQ;AAAA,YACV;AAAA,YACA,cAAc,CAAC,MAAM;AACjB,gBAAA,cAAc,MAAM,kBAAkB;AAAA,YAC1C;AAAA,YACA,cAAc,CAAC,MAAM;AACjB,gBAAA,cAAc,MAAM,kBAAkB;AAAA,YAAA;AAAA,UAC1C;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { HubType } from '../../react-core/src/index.ts';
|
|
3
|
+
export type DebuggerProps = {
|
|
4
|
+
hub: HubType;
|
|
5
|
+
intervalMs?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const Debugger: React.FC<DebuggerProps>;
|
|
8
|
+
//# sourceMappingURL=Debugger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Debugger.d.ts","sourceRoot":"","sources":["../../../src/Debugger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA2d5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gridsheet/react-dev",
|
|
3
|
+
"version": "3.0.0-rc.0",
|
|
4
|
+
"description": "Development tools for GridSheet",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "rm -rf ./dist || true && vite build",
|
|
17
|
+
"typecheck": "pnpm tsc --noEmit"
|
|
18
|
+
},
|
|
19
|
+
"author": "righ",
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/",
|
|
23
|
+
"package.json",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@gridsheet/react-core": "^3.0.0-rc.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"react": ">=16.9.0",
|
|
32
|
+
"react-dom": ">=16.9.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/react": "^16.9.24",
|
|
36
|
+
"@types/react-dom": "^16.9.24",
|
|
37
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
38
|
+
"typescript": "^5.8.2",
|
|
39
|
+
"vite": "^6.2.2",
|
|
40
|
+
"vite-plugin-dts": "^4.5.3"
|
|
41
|
+
}
|
|
42
|
+
}
|