@reopt-ai/opt-devtool 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +7 -0
  2. package/dist/brandapp/index.cjs +455 -364
  3. package/dist/brandapp/index.d.cts +70 -68
  4. package/dist/brandapp/index.d.ts +70 -68
  5. package/dist/brandapp/index.js +448 -361
  6. package/dist/datagrid/index.cjs +171 -181
  7. package/dist/datagrid/index.d.cts +10 -9
  8. package/dist/datagrid/index.d.ts +10 -9
  9. package/dist/datagrid/index.js +167 -179
  10. package/dist/editor/index.cjs +210 -229
  11. package/dist/editor/index.d.cts +10 -9
  12. package/dist/editor/index.d.ts +10 -9
  13. package/dist/editor/index.js +206 -227
  14. package/dist/harness/index.cjs +5 -12
  15. package/dist/harness/index.d.cts +14 -14
  16. package/dist/harness/index.d.ts +14 -14
  17. package/dist/harness/index.js +2 -11
  18. package/dist/harness-CoRqiJWO.cjs +584 -0
  19. package/dist/harness-DU8hP98g.js +536 -0
  20. package/dist/index.cjs +3687 -3816
  21. package/dist/index.d.cts +13 -15
  22. package/dist/index.d.ts +13 -15
  23. package/dist/index.js +3679 -3815
  24. package/dist/provider-Bn7CAE_Y.js +116 -0
  25. package/dist/provider-CLRiXjfD.cjs +168 -0
  26. package/dist/theme/index.cjs +296 -12
  27. package/dist/theme/index.d.cts +25 -24
  28. package/dist/theme/index.d.ts +25 -24
  29. package/dist/theme/index.js +292 -11
  30. package/dist/theme-isolate-DgSS935z.cjs +54 -0
  31. package/dist/theme-isolate-F-oX2d4W.js +43 -0
  32. package/dist/types-B_abMm2B.cjs +10 -0
  33. package/dist/types-DvhcaPXA.js +5 -0
  34. package/dist/types-oHbLkgEH.d.cts +95 -0
  35. package/dist/types-oHbLkgEH.d.ts +95 -0
  36. package/dist/ui/index.cjs +4 -8
  37. package/dist/ui/index.d.cts +3 -2
  38. package/dist/ui/index.d.ts +3 -2
  39. package/dist/ui/index.js +2 -7
  40. package/package.json +2 -2
  41. package/dist/chunk-4MJKIAXH.cjs +0 -65
  42. package/dist/chunk-5HRIQSVF.js +0 -32
  43. package/dist/chunk-6AGUYGVT.cjs +0 -77
  44. package/dist/chunk-EQPETYJJ.cjs +0 -32
  45. package/dist/chunk-H3F2WACS.cjs +0 -568
  46. package/dist/chunk-N7YO56TN.cjs +0 -25
  47. package/dist/chunk-SQ3E3QLA.cjs +0 -253
  48. package/dist/chunk-SW2FF6EV.js +0 -568
  49. package/dist/chunk-UJSIQF3A.js +0 -25
  50. package/dist/chunk-UQY5I3WS.js +0 -253
  51. package/dist/chunk-YCYIUFB4.js +0 -65
  52. package/dist/chunk-Z2KFRHSI.js +0 -77
  53. package/dist/index-Bakx4o8Z.d.cts +0 -91
  54. package/dist/index-Bakx4o8Z.d.ts +0 -91
@@ -1,187 +1,177 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
1
  "use client";
3
-
4
-
5
- var _chunk6AGUYGVTcjs = require('../chunk-6AGUYGVT.cjs');
6
- require('../chunk-N7YO56TN.cjs');
7
-
8
- // src/datagrid/index.tsx
9
- var _react = require('react'); var React = _interopRequireWildcard(_react);
10
- var _jsxruntime = require('react/jsx-runtime');
2
+ "use client";
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
+ const require_provider = require("../provider-CLRiXjfD.cjs");
5
+ let react = require("react");
6
+ react = require_provider.__toESM(react, 1);
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+ //#region src/datagrid/index.tsx
11
9
  function StatusDot({ active, label }) {
12
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "inline-flex items-center gap-1", children: [
13
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
14
- "span",
15
- {
16
- className: `inline-block h-1.5 w-1.5 rounded-full ${active ? "bg-emerald-400" : "bg-white/20"}`
17
- }
18
- ),
19
- label
20
- ] });
10
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11
+ className: "inline-flex items-center gap-1",
12
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `inline-block h-1.5 w-1.5 rounded-full ${active ? "bg-emerald-400" : "bg-white/20"}` }), label]
13
+ });
21
14
  }
22
- function DataGridDevtoolPanel({
23
- snapshot,
24
- telemetry
25
- }) {
26
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
27
- if (!snapshot) {
28
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[11px] text-white/55", children: "Waiting for DataGrid snapshot." });
29
- }
30
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-3 text-[11px]", children: [
31
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
32
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Runtime" }),
33
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-1.5 text-white/70 md:grid-cols-2", children: [
34
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1", children: [
35
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
36
- "span",
37
- {
38
- className: `inline-block h-1.5 w-1.5 rounded-full ${snapshot.activeCell ? "bg-emerald-400" : "bg-white/20"}`
39
- }
40
- ),
41
- "Active cell: r",
42
- snapshot.activeCell.row + 1,
43
- " c",
44
- snapshot.activeCell.col + 1
45
- ] }),
46
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1", children: [
47
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
48
- "span",
49
- {
50
- className: `inline-block h-1.5 w-1.5 rounded-full ${snapshot.editingCell ? "animate-pulse bg-emerald-400" : "bg-white/20"}`
51
- }
52
- ),
53
- "Editing:",
54
- " ",
55
- snapshot.editingCell ? `r${snapshot.editingCell.row + 1} c${snapshot.editingCell.col + 1}` : "Closed"
56
- ] }),
57
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
58
- "Rows: ",
59
- snapshot.rowCount.toLocaleString()
60
- ] }),
61
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
62
- "Columns: ",
63
- snapshot.columnCount.toLocaleString()
64
- ] }),
65
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: snapshot.overlayOpen, label: "Overlay" }) }),
66
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex gap-2", children: [
67
- "History:",
68
- " ",
69
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: snapshot.history.canUndo, label: "undo" }),
70
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: snapshot.history.canRedo, label: "redo" })
71
- ] })
72
- ] })
73
- ] }),
74
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
75
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Selection" }),
76
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-white/70", children: [
77
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
78
- "Range: r",
79
- snapshot.selection.start.row + 1,
80
- " c",
81
- snapshot.selection.start.col + 1,
82
- " \u2192 r",
83
- snapshot.selection.end.row + 1,
84
- " c",
85
- snapshot.selection.end.col + 1
86
- ] }),
87
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-1", children: [
88
- "Row picks: ",
89
- ((_a = snapshot.selection.rows) != null ? _a : []).length,
90
- " / Column picks:",
91
- " ",
92
- ((_b = snapshot.selection.columns) != null ? _b : []).length
93
- ] }),
94
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-1", children: [
95
- "Visible region: r",
96
- (_d = (_c = snapshot.visibleRegion) == null ? void 0 : _c.startRow) != null ? _d : 0,
97
- "-",
98
- (_f = (_e = snapshot.visibleRegion) == null ? void 0 : _e.endRow) != null ? _f : 0,
99
- ", c",
100
- (_h = (_g = snapshot.visibleRegion) == null ? void 0 : _g.startCol) != null ? _h : 0,
101
- "-",
102
- (_j = (_i = snapshot.visibleRegion) == null ? void 0 : _i.endCol) != null ? _j : 0
103
- ] }),
104
- snapshot.draftError ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-1 flex items-center gap-1 text-rose-300", children: [
105
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "inline-block h-1.5 w-1.5 rounded-full bg-red-400" }),
106
- "Draft error: ",
107
- snapshot.draftError
108
- ] }) : null
109
- ] })
110
- ] }),
111
- telemetry ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
112
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Remote telemetry" }),
113
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-1.5 text-white/70 md:grid-cols-2", children: [
114
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
115
- "Open views: ",
116
- telemetry.viewOpenCount
117
- ] }),
118
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
119
- "Loads: ",
120
- telemetry.loadCount
121
- ] }),
122
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
123
- "Saves: ",
124
- telemetry.saveCount
125
- ] }),
126
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
127
- "Push invalidations: ",
128
- telemetry.pushInvalidationCount
129
- ] }),
130
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
131
- "Rejected edits: ",
132
- telemetry.rejectedEditCount
133
- ] }),
134
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
135
- "Page retries: ",
136
- telemetry.pageRetryCount
137
- ] }),
138
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
139
- "Last open: ",
140
- (_k = telemetry.lastViewOpenDurationMs) != null ? _k : "-",
141
- " ms"
142
- ] }),
143
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
144
- "Last load: ",
145
- (_l = telemetry.lastLoadDurationMs) != null ? _l : "-",
146
- " ms"
147
- ] }),
148
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
149
- "Last save: ",
150
- (_m = telemetry.lastSaveDurationMs) != null ? _m : "-",
151
- " ms"
152
- ] }),
153
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
154
- "Invalidated pages: ",
155
- telemetry.invalidatedPageCount
156
- ] })
157
- ] })
158
- ] }) : null
159
- ] });
15
+ function DataGridDevtoolPanel({ snapshot, telemetry }) {
16
+ var _snapshot$selection$r, _snapshot$selection$c, _snapshot$visibleRegi, _snapshot$visibleRegi2, _snapshot$visibleRegi3, _snapshot$visibleRegi4, _snapshot$visibleRegi5, _snapshot$visibleRegi6, _snapshot$visibleRegi7, _snapshot$visibleRegi8, _telemetry$lastViewOp, _telemetry$lastLoadDu, _telemetry$lastSaveDu;
17
+ if (!snapshot) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
18
+ className: "text-[11px] text-white/55",
19
+ children: "Waiting for DataGrid snapshot."
20
+ });
21
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
22
+ className: "flex flex-col gap-3 text-[11px]",
23
+ children: [
24
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
25
+ className: "mb-1 text-[10px] font-semibold text-emerald-400",
26
+ children: "Runtime"
27
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
28
+ className: "grid gap-1.5 text-white/70 md:grid-cols-2",
29
+ children: [
30
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
31
+ className: "flex items-center gap-1",
32
+ children: [
33
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `inline-block h-1.5 w-1.5 rounded-full ${snapshot.activeCell ? "bg-emerald-400" : "bg-white/20"}` }),
34
+ "Active cell: r",
35
+ snapshot.activeCell.row + 1,
36
+ " c",
37
+ snapshot.activeCell.col + 1
38
+ ]
39
+ }),
40
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
41
+ className: "flex items-center gap-1",
42
+ children: [
43
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `inline-block h-1.5 w-1.5 rounded-full ${snapshot.editingCell ? "animate-pulse bg-emerald-400" : "bg-white/20"}` }),
44
+ "Editing:",
45
+ " ",
46
+ snapshot.editingCell ? `r${snapshot.editingCell.row + 1} c${snapshot.editingCell.col + 1}` : "Closed"
47
+ ]
48
+ }),
49
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Rows: ", snapshot.rowCount.toLocaleString()] }),
50
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Columns: ", snapshot.columnCount.toLocaleString()] }),
51
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
52
+ active: snapshot.overlayOpen,
53
+ label: "Overlay"
54
+ }) }),
55
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
56
+ className: "flex gap-2",
57
+ children: [
58
+ "History:",
59
+ " ",
60
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
61
+ active: snapshot.history.canUndo,
62
+ label: "undo"
63
+ }),
64
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StatusDot, {
65
+ active: snapshot.history.canRedo,
66
+ label: "redo"
67
+ })
68
+ ]
69
+ })
70
+ ]
71
+ })] }),
72
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
73
+ className: "mb-1 text-[10px] font-semibold text-emerald-400",
74
+ children: "Selection"
75
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
76
+ className: "text-white/70",
77
+ children: [
78
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
79
+ "Range: r",
80
+ snapshot.selection.start.row + 1,
81
+ " c",
82
+ snapshot.selection.start.col + 1,
83
+ " → r",
84
+ snapshot.selection.end.row + 1,
85
+ " c",
86
+ snapshot.selection.end.col + 1
87
+ ] }),
88
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
89
+ className: "mt-1",
90
+ children: [
91
+ "Row picks: ",
92
+ ((_snapshot$selection$r = snapshot.selection.rows) !== null && _snapshot$selection$r !== void 0 ? _snapshot$selection$r : []).length,
93
+ " / Column picks:",
94
+ " ",
95
+ ((_snapshot$selection$c = snapshot.selection.columns) !== null && _snapshot$selection$c !== void 0 ? _snapshot$selection$c : []).length
96
+ ]
97
+ }),
98
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
99
+ className: "mt-1",
100
+ children: [
101
+ "Visible region: r",
102
+ (_snapshot$visibleRegi = (_snapshot$visibleRegi2 = snapshot.visibleRegion) === null || _snapshot$visibleRegi2 === void 0 ? void 0 : _snapshot$visibleRegi2.startRow) !== null && _snapshot$visibleRegi !== void 0 ? _snapshot$visibleRegi : 0,
103
+ "-",
104
+ (_snapshot$visibleRegi3 = (_snapshot$visibleRegi4 = snapshot.visibleRegion) === null || _snapshot$visibleRegi4 === void 0 ? void 0 : _snapshot$visibleRegi4.endRow) !== null && _snapshot$visibleRegi3 !== void 0 ? _snapshot$visibleRegi3 : 0,
105
+ ", c",
106
+ (_snapshot$visibleRegi5 = (_snapshot$visibleRegi6 = snapshot.visibleRegion) === null || _snapshot$visibleRegi6 === void 0 ? void 0 : _snapshot$visibleRegi6.startCol) !== null && _snapshot$visibleRegi5 !== void 0 ? _snapshot$visibleRegi5 : 0,
107
+ "-",
108
+ (_snapshot$visibleRegi7 = (_snapshot$visibleRegi8 = snapshot.visibleRegion) === null || _snapshot$visibleRegi8 === void 0 ? void 0 : _snapshot$visibleRegi8.endCol) !== null && _snapshot$visibleRegi7 !== void 0 ? _snapshot$visibleRegi7 : 0
109
+ ]
110
+ }),
111
+ snapshot.draftError ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
112
+ className: "mt-1 flex items-center gap-1 text-rose-300",
113
+ children: [
114
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "inline-block h-1.5 w-1.5 rounded-full bg-red-400" }),
115
+ "Draft error: ",
116
+ snapshot.draftError
117
+ ]
118
+ }) : null
119
+ ]
120
+ })] }),
121
+ telemetry ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
122
+ className: "mb-1 text-[10px] font-semibold text-emerald-400",
123
+ children: "Remote telemetry"
124
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
125
+ className: "grid gap-1.5 text-white/70 md:grid-cols-2",
126
+ children: [
127
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Open views: ", telemetry.viewOpenCount] }),
128
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Loads: ", telemetry.loadCount] }),
129
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Saves: ", telemetry.saveCount] }),
130
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Push invalidations: ", telemetry.pushInvalidationCount] }),
131
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Rejected edits: ", telemetry.rejectedEditCount] }),
132
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Page retries: ", telemetry.pageRetryCount] }),
133
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
134
+ "Last open: ",
135
+ (_telemetry$lastViewOp = telemetry.lastViewOpenDurationMs) !== null && _telemetry$lastViewOp !== void 0 ? _telemetry$lastViewOp : "-",
136
+ " ms"
137
+ ] }),
138
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
139
+ "Last load: ",
140
+ (_telemetry$lastLoadDu = telemetry.lastLoadDurationMs) !== null && _telemetry$lastLoadDu !== void 0 ? _telemetry$lastLoadDu : "-",
141
+ " ms"
142
+ ] }),
143
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
144
+ "Last save: ",
145
+ (_telemetry$lastSaveDu = telemetry.lastSaveDurationMs) !== null && _telemetry$lastSaveDu !== void 0 ? _telemetry$lastSaveDu : "-",
146
+ " ms"
147
+ ] }),
148
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: ["Invalidated pages: ", telemetry.invalidatedPageCount] })
149
+ ]
150
+ })] }) : null
151
+ ]
152
+ });
160
153
  }
161
- function useDataGridDevtoolBridge({
162
- id,
163
- label,
164
- order = 20,
165
- telemetry
166
- }) {
167
- const [snapshot, setSnapshot] = React.useState(null);
168
- const inspect = React.useCallback((nextSnapshot) => {
169
- setSnapshot(nextSnapshot);
170
- }, []);
171
- const plugin = React.useMemo(
172
- () => ({
173
- id,
174
- label,
175
- order,
176
- renderPanel: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DataGridDevtoolPanel, { snapshot, telemetry })
177
- }),
178
- [id, label, order, snapshot, telemetry]
179
- );
180
- _chunk6AGUYGVTcjs.useOptDevtoolPlugin.call(void 0, plugin);
181
- return {
182
- inspect
183
- };
154
+ function useDataGridDevtoolBridge({ id, label, order = 20, telemetry }) {
155
+ const [snapshot, setSnapshot] = react.useState(null);
156
+ const inspect = react.useCallback((nextSnapshot) => {
157
+ setSnapshot(nextSnapshot);
158
+ }, []);
159
+ require_provider.useOptDevtoolPlugin(react.useMemo(() => ({
160
+ id,
161
+ label,
162
+ order,
163
+ renderPanel: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DataGridDevtoolPanel, {
164
+ snapshot,
165
+ telemetry
166
+ })
167
+ }), [
168
+ id,
169
+ label,
170
+ order,
171
+ snapshot,
172
+ telemetry
173
+ ]));
174
+ return { inspect };
184
175
  }
185
-
186
-
176
+ //#endregion
187
177
  exports.useDataGridDevtoolBridge = useDataGridDevtoolBridge;
@@ -1,14 +1,15 @@
1
- import { DataGridDevtoolSnapshot, DataGridRemoteTelemetry } from '@reopt-ai/opt-datagrid';
2
1
 
2
+ import { DataGridDevtoolSnapshot, DataGridRemoteTelemetry } from "@reopt-ai/opt-datagrid";
3
+ //#region src/datagrid/index.d.ts
3
4
  interface UseDataGridDevtoolBridgeOptions {
4
- id: string;
5
- label: string;
6
- order?: number;
7
- telemetry?: DataGridRemoteTelemetry | null;
5
+ id: string;
6
+ label: string;
7
+ order?: number;
8
+ telemetry?: DataGridRemoteTelemetry | null;
8
9
  }
9
10
  interface RegisteredDataGridDevtoolBridge {
10
- inspect: (snapshot: DataGridDevtoolSnapshot) => void;
11
+ inspect: (snapshot: DataGridDevtoolSnapshot) => void;
11
12
  }
12
- declare function useDataGridDevtoolBridge({ id, label, order, telemetry, }: UseDataGridDevtoolBridgeOptions): RegisteredDataGridDevtoolBridge;
13
-
14
- export { type RegisteredDataGridDevtoolBridge, type UseDataGridDevtoolBridgeOptions, useDataGridDevtoolBridge };
13
+ declare function useDataGridDevtoolBridge({ id, label, order, telemetry }: UseDataGridDevtoolBridgeOptions): RegisteredDataGridDevtoolBridge;
14
+ //#endregion
15
+ export { RegisteredDataGridDevtoolBridge, UseDataGridDevtoolBridgeOptions, useDataGridDevtoolBridge };
@@ -1,14 +1,15 @@
1
- import { DataGridDevtoolSnapshot, DataGridRemoteTelemetry } from '@reopt-ai/opt-datagrid';
2
1
 
2
+ import { DataGridDevtoolSnapshot, DataGridRemoteTelemetry } from "@reopt-ai/opt-datagrid";
3
+ //#region src/datagrid/index.d.ts
3
4
  interface UseDataGridDevtoolBridgeOptions {
4
- id: string;
5
- label: string;
6
- order?: number;
7
- telemetry?: DataGridRemoteTelemetry | null;
5
+ id: string;
6
+ label: string;
7
+ order?: number;
8
+ telemetry?: DataGridRemoteTelemetry | null;
8
9
  }
9
10
  interface RegisteredDataGridDevtoolBridge {
10
- inspect: (snapshot: DataGridDevtoolSnapshot) => void;
11
+ inspect: (snapshot: DataGridDevtoolSnapshot) => void;
11
12
  }
12
- declare function useDataGridDevtoolBridge({ id, label, order, telemetry, }: UseDataGridDevtoolBridgeOptions): RegisteredDataGridDevtoolBridge;
13
-
14
- export { type RegisteredDataGridDevtoolBridge, type UseDataGridDevtoolBridgeOptions, useDataGridDevtoolBridge };
13
+ declare function useDataGridDevtoolBridge({ id, label, order, telemetry }: UseDataGridDevtoolBridgeOptions): RegisteredDataGridDevtoolBridge;
14
+ //#endregion
15
+ export { RegisteredDataGridDevtoolBridge, UseDataGridDevtoolBridgeOptions, useDataGridDevtoolBridge };