@reopt-ai/opt-devtool 1.0.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +21 -0
  3. package/README.md +149 -0
  4. package/dist/brandapp/index.cjs +391 -0
  5. package/dist/brandapp/index.d.cts +95 -0
  6. package/dist/brandapp/index.d.ts +95 -0
  7. package/dist/brandapp/index.js +391 -0
  8. package/dist/chunk-4MJKIAXH.cjs +65 -0
  9. package/dist/chunk-5HRIQSVF.js +32 -0
  10. package/dist/chunk-6AGUYGVT.cjs +77 -0
  11. package/dist/chunk-EQPETYJJ.cjs +32 -0
  12. package/dist/chunk-H3F2WACS.cjs +568 -0
  13. package/dist/chunk-N7YO56TN.cjs +25 -0
  14. package/dist/chunk-SQ3E3QLA.cjs +253 -0
  15. package/dist/chunk-SW2FF6EV.js +568 -0
  16. package/dist/chunk-UJSIQF3A.js +25 -0
  17. package/dist/chunk-UQY5I3WS.js +253 -0
  18. package/dist/chunk-YCYIUFB4.js +65 -0
  19. package/dist/chunk-Z2KFRHSI.js +77 -0
  20. package/dist/datagrid/index.cjs +187 -0
  21. package/dist/datagrid/index.d.cts +14 -0
  22. package/dist/datagrid/index.d.ts +14 -0
  23. package/dist/datagrid/index.js +187 -0
  24. package/dist/editor/index.cjs +239 -0
  25. package/dist/editor/index.d.cts +14 -0
  26. package/dist/editor/index.d.ts +14 -0
  27. package/dist/editor/index.js +239 -0
  28. package/dist/harness/index.cjs +13 -0
  29. package/dist/harness/index.d.cts +30 -0
  30. package/dist/harness/index.d.ts +30 -0
  31. package/dist/harness/index.js +13 -0
  32. package/dist/index-Bakx4o8Z.d.cts +91 -0
  33. package/dist/index-Bakx4o8Z.d.ts +91 -0
  34. package/dist/index.cjs +3895 -0
  35. package/dist/index.d.cts +22 -0
  36. package/dist/index.d.ts +22 -0
  37. package/dist/index.js +3895 -0
  38. package/dist/theme/index.cjs +13 -0
  39. package/dist/theme/index.d.cts +33 -0
  40. package/dist/theme/index.d.ts +33 -0
  41. package/dist/theme/index.js +13 -0
  42. package/dist/ui/index.cjs +8 -0
  43. package/dist/ui/index.d.cts +2 -0
  44. package/dist/ui/index.d.ts +2 -0
  45. package/dist/ui/index.js +8 -0
  46. package/package.json +153 -0
@@ -0,0 +1,187 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ useOptDevtoolPlugin
5
+ } from "../chunk-Z2KFRHSI.js";
6
+ import "../chunk-UJSIQF3A.js";
7
+
8
+ // src/datagrid/index.tsx
9
+ import * as React from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ function StatusDot({ active, label }) {
12
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1", children: [
13
+ /* @__PURE__ */ jsx(
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
+ ] });
21
+ }
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__ */ jsx("div", { className: "text-[11px] text-white/55", children: "Waiting for DataGrid snapshot." });
29
+ }
30
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 text-[11px]", children: [
31
+ /* @__PURE__ */ jsxs("section", { children: [
32
+ /* @__PURE__ */ jsx("p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Runtime" }),
33
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5 text-white/70 md:grid-cols-2", children: [
34
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
35
+ /* @__PURE__ */ jsx(
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__ */ jsxs("div", { className: "flex items-center gap-1", children: [
47
+ /* @__PURE__ */ jsx(
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__ */ jsxs("div", { children: [
58
+ "Rows: ",
59
+ snapshot.rowCount.toLocaleString()
60
+ ] }),
61
+ /* @__PURE__ */ jsxs("div", { children: [
62
+ "Columns: ",
63
+ snapshot.columnCount.toLocaleString()
64
+ ] }),
65
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(StatusDot, { active: snapshot.overlayOpen, label: "Overlay" }) }),
66
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
67
+ "History:",
68
+ " ",
69
+ /* @__PURE__ */ jsx(StatusDot, { active: snapshot.history.canUndo, label: "undo" }),
70
+ /* @__PURE__ */ jsx(StatusDot, { active: snapshot.history.canRedo, label: "redo" })
71
+ ] })
72
+ ] })
73
+ ] }),
74
+ /* @__PURE__ */ jsxs("section", { children: [
75
+ /* @__PURE__ */ jsx("p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Selection" }),
76
+ /* @__PURE__ */ jsxs("div", { className: "text-white/70", children: [
77
+ /* @__PURE__ */ jsxs("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__ */ jsxs("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__ */ jsxs("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__ */ jsxs("div", { className: "mt-1 flex items-center gap-1 text-rose-300", children: [
105
+ /* @__PURE__ */ jsx("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__ */ jsxs("section", { children: [
112
+ /* @__PURE__ */ jsx("p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Remote telemetry" }),
113
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5 text-white/70 md:grid-cols-2", children: [
114
+ /* @__PURE__ */ jsxs("div", { children: [
115
+ "Open views: ",
116
+ telemetry.viewOpenCount
117
+ ] }),
118
+ /* @__PURE__ */ jsxs("div", { children: [
119
+ "Loads: ",
120
+ telemetry.loadCount
121
+ ] }),
122
+ /* @__PURE__ */ jsxs("div", { children: [
123
+ "Saves: ",
124
+ telemetry.saveCount
125
+ ] }),
126
+ /* @__PURE__ */ jsxs("div", { children: [
127
+ "Push invalidations: ",
128
+ telemetry.pushInvalidationCount
129
+ ] }),
130
+ /* @__PURE__ */ jsxs("div", { children: [
131
+ "Rejected edits: ",
132
+ telemetry.rejectedEditCount
133
+ ] }),
134
+ /* @__PURE__ */ jsxs("div", { children: [
135
+ "Page retries: ",
136
+ telemetry.pageRetryCount
137
+ ] }),
138
+ /* @__PURE__ */ jsxs("div", { children: [
139
+ "Last open: ",
140
+ (_k = telemetry.lastViewOpenDurationMs) != null ? _k : "-",
141
+ " ms"
142
+ ] }),
143
+ /* @__PURE__ */ jsxs("div", { children: [
144
+ "Last load: ",
145
+ (_l = telemetry.lastLoadDurationMs) != null ? _l : "-",
146
+ " ms"
147
+ ] }),
148
+ /* @__PURE__ */ jsxs("div", { children: [
149
+ "Last save: ",
150
+ (_m = telemetry.lastSaveDurationMs) != null ? _m : "-",
151
+ " ms"
152
+ ] }),
153
+ /* @__PURE__ */ jsxs("div", { children: [
154
+ "Invalidated pages: ",
155
+ telemetry.invalidatedPageCount
156
+ ] })
157
+ ] })
158
+ ] }) : null
159
+ ] });
160
+ }
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__ */ jsx(DataGridDevtoolPanel, { snapshot, telemetry })
177
+ }),
178
+ [id, label, order, snapshot, telemetry]
179
+ );
180
+ useOptDevtoolPlugin(plugin);
181
+ return {
182
+ inspect
183
+ };
184
+ }
185
+ export {
186
+ useDataGridDevtoolBridge
187
+ };
@@ -0,0 +1,239 @@
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
+ "use client";
3
+
4
+
5
+ var _chunk6AGUYGVTcjs = require('../chunk-6AGUYGVT.cjs');
6
+ require('../chunk-N7YO56TN.cjs');
7
+
8
+ // src/editor/index.tsx
9
+ var _react = require('react'); var React = _interopRequireWildcard(_react);
10
+ var _jsxruntime = require('react/jsx-runtime');
11
+ function StatusDot({
12
+ active,
13
+ label,
14
+ activeClassName = "bg-emerald-400"
15
+ }) {
16
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "inline-flex items-center gap-1", children: [
17
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
18
+ "span",
19
+ {
20
+ className: `inline-block h-1.5 w-1.5 rounded-full ${active ? activeClassName : "bg-white/20"}`
21
+ }
22
+ ),
23
+ label
24
+ ] });
25
+ }
26
+ function ModeBadge({ mode }) {
27
+ const classesByMode = {
28
+ edit: "bg-emerald-900/50 text-emerald-300",
29
+ stream: "bg-white/10 text-white/50",
30
+ diff: "bg-amber-900/50 text-amber-300"
31
+ };
32
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
33
+ "span",
34
+ {
35
+ className: `inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${classesByMode[mode]}`,
36
+ children: mode
37
+ }
38
+ );
39
+ }
40
+ function StreamBadge({ status }) {
41
+ if (!status) {
42
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "inline-flex items-center rounded bg-white/10 px-1.5 py-0.5 text-[9px] text-white/40", children: "N/A" });
43
+ }
44
+ const styles = {
45
+ idle: "bg-white/10 text-white/50",
46
+ streaming: "animate-pulse bg-emerald-900/50 text-emerald-300",
47
+ done: "bg-emerald-900/50 text-emerald-300",
48
+ error: "bg-red-900/50 text-red-300"
49
+ };
50
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
51
+ "span",
52
+ {
53
+ className: `inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${styles[status]}`,
54
+ children: status
55
+ }
56
+ );
57
+ }
58
+ function ChipList({
59
+ items,
60
+ emptyLabel
61
+ }) {
62
+ if (items.length === 0) {
63
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: emptyLabel });
64
+ }
65
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: items.map((item) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
66
+ "span",
67
+ {
68
+ className: "rounded border border-white/10 px-1.5 py-0.5",
69
+ children: item
70
+ },
71
+ item
72
+ )) });
73
+ }
74
+ function EditorDevtoolPanel({
75
+ snapshot,
76
+ streamStatus
77
+ }) {
78
+ var _a, _b, _c, _d, _e, _f;
79
+ if (!snapshot) {
80
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-[11px] text-white/55", children: "Waiting for Editor snapshot." });
81
+ }
82
+ const selectedBlockIds = (_a = snapshot.selectedBlockIds) != null ? _a : [];
83
+ const selectedBlockTypes = (_b = snapshot.selectedBlockTypes) != null ? _b : [];
84
+ const selectedBlockCount = (_c = snapshot.selectedBlockCount) != null ? _c : snapshot.selectedBlockId ? 1 : selectedBlockIds.length;
85
+ const features = snapshot.features;
86
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-3 text-[11px]", children: [
87
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
88
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Runtime" }),
89
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-1.5 text-white/70 md:grid-cols-2", children: [
90
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1.5", children: [
91
+ "Mode: ",
92
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ModeBadge, { mode: snapshot.mode })
93
+ ] }),
94
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
95
+ "Spec version: v",
96
+ (_d = snapshot.specVersion) != null ? _d : "?"
97
+ ] }),
98
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
99
+ "Selected block: ",
100
+ (_e = snapshot.selectedBlockId) != null ? _e : "None"
101
+ ] }),
102
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
103
+ "Roots: ",
104
+ snapshot.rootCount
105
+ ] }),
106
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
107
+ "Elements: ",
108
+ snapshot.elementCount
109
+ ] }),
110
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
111
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: snapshot.canUndo, label: "Undo" }),
112
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: snapshot.canRedo, label: "Redo" })
113
+ ] }),
114
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
115
+ "Focus target:",
116
+ " ",
117
+ snapshot.focusTarget ? `${snapshot.focusTarget.blockId}${snapshot.focusTarget.offset !== void 0 ? ` @${snapshot.focusTarget.offset}` : ""}` : "None"
118
+ ] }),
119
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-1.5", children: [
120
+ "Stream: ",
121
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StreamBadge, { status: streamStatus })
122
+ ] }),
123
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
124
+ StatusDot,
125
+ {
126
+ active: !!snapshot.externalStreaming,
127
+ activeClassName: "animate-pulse bg-emerald-400",
128
+ label: snapshot.externalStreaming ? "External stream" : "Local updates"
129
+ }
130
+ ) })
131
+ ] })
132
+ ] }),
133
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
134
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Selection" }),
135
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid gap-1.5 text-white/70 md:grid-cols-2", children: [
136
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
137
+ "Selected blocks: ",
138
+ selectedBlockCount
139
+ ] }),
140
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
141
+ "State keys: ",
142
+ (_f = snapshot.stateKeyCount) != null ? _f : 0
143
+ ] }),
144
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "md:col-span-2", children: [
145
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] text-white/45", children: "IDs" }),
146
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-1.5 text-white/75", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
147
+ ChipList,
148
+ {
149
+ items: selectedBlockIds,
150
+ emptyLabel: "No block selection."
151
+ }
152
+ ) })
153
+ ] }),
154
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "md:col-span-2", children: [
155
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] text-white/45", children: "Types" }),
156
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-1.5 text-white/75", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
157
+ ChipList,
158
+ {
159
+ items: selectedBlockTypes,
160
+ emptyLabel: "No block types."
161
+ }
162
+ ) })
163
+ ] })
164
+ ] })
165
+ ] }),
166
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
167
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Integrations" }),
168
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-wrap gap-x-3 gap-y-1.5 text-white/70", children: [
169
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: !!(features == null ? void 0 : features.stateStore), label: "State store" }),
170
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
171
+ StatusDot,
172
+ {
173
+ active: !!(features == null ? void 0 : features.actionRegistry),
174
+ label: "Action registry"
175
+ }
176
+ ),
177
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: !!(features == null ? void 0 : features.aiRequest), label: "AI request" }),
178
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: !!(features == null ? void 0 : features.ghostText), label: "Ghost text" }),
179
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
180
+ StatusDot,
181
+ {
182
+ active: !!(features == null ? void 0 : features.highlightCode),
183
+ label: "Code highlight"
184
+ }
185
+ ),
186
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: !!(features == null ? void 0 : features.fileUpload), label: "File upload" }),
187
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: !!(features == null ? void 0 : features.imageBrowse), label: "Image browse" }),
188
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
189
+ StatusDot,
190
+ {
191
+ active: !!(features == null ? void 0 : features.imageGenerate),
192
+ label: "Image generate"
193
+ }
194
+ ),
195
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StatusDot, { active: !!(features == null ? void 0 : features.imageEdit), label: "Image edit" })
196
+ ] })
197
+ ] }),
198
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { children: [
199
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mb-1 text-[10px] font-semibold text-emerald-400", children: "Last changed IDs" }),
200
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap gap-1.5 text-white/75", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
201
+ ChipList,
202
+ {
203
+ items: snapshot.lastChangedIds,
204
+ emptyLabel: "No pending changes."
205
+ }
206
+ ) })
207
+ ] })
208
+ ] });
209
+ }
210
+ function useEditorDevtoolBridge({
211
+ id,
212
+ label,
213
+ order = 30,
214
+ streamStatus
215
+ }) {
216
+ const [snapshot, setSnapshot] = React.useState(
217
+ null
218
+ );
219
+ const inspect = React.useCallback((nextSnapshot) => {
220
+ setSnapshot(nextSnapshot);
221
+ }, []);
222
+ const plugin = React.useMemo(
223
+ () => ({
224
+ id,
225
+ label,
226
+ order,
227
+ tab: "editor",
228
+ renderPanel: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, EditorDevtoolPanel, { snapshot, streamStatus })
229
+ }),
230
+ [id, label, order, snapshot, streamStatus]
231
+ );
232
+ _chunk6AGUYGVTcjs.useOptDevtoolPlugin.call(void 0, plugin);
233
+ return {
234
+ inspect
235
+ };
236
+ }
237
+
238
+
239
+ exports.useEditorDevtoolBridge = useEditorDevtoolBridge;
@@ -0,0 +1,14 @@
1
+ import { EditorDevtoolSnapshot, StreamStatus } from '@reopt-ai/opt-editor';
2
+
3
+ interface UseEditorDevtoolBridgeOptions {
4
+ id: string;
5
+ label: string;
6
+ order?: number;
7
+ streamStatus?: StreamStatus | null;
8
+ }
9
+ interface RegisteredEditorDevtoolBridge {
10
+ inspect: (snapshot: EditorDevtoolSnapshot) => void;
11
+ }
12
+ declare function useEditorDevtoolBridge({ id, label, order, streamStatus, }: UseEditorDevtoolBridgeOptions): RegisteredEditorDevtoolBridge;
13
+
14
+ export { type RegisteredEditorDevtoolBridge, type UseEditorDevtoolBridgeOptions, useEditorDevtoolBridge };
@@ -0,0 +1,14 @@
1
+ import { EditorDevtoolSnapshot, StreamStatus } from '@reopt-ai/opt-editor';
2
+
3
+ interface UseEditorDevtoolBridgeOptions {
4
+ id: string;
5
+ label: string;
6
+ order?: number;
7
+ streamStatus?: StreamStatus | null;
8
+ }
9
+ interface RegisteredEditorDevtoolBridge {
10
+ inspect: (snapshot: EditorDevtoolSnapshot) => void;
11
+ }
12
+ declare function useEditorDevtoolBridge({ id, label, order, streamStatus, }: UseEditorDevtoolBridgeOptions): RegisteredEditorDevtoolBridge;
13
+
14
+ export { type RegisteredEditorDevtoolBridge, type UseEditorDevtoolBridgeOptions, useEditorDevtoolBridge };