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