@visual-json/react 0.1.0 → 0.1.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/dist/index.js CHANGED
@@ -36,7 +36,7 @@ __export(index_exports, {
36
36
  module.exports = __toCommonJS(index_exports);
37
37
 
38
38
  // src/json-editor.tsx
39
- var import_react9 = require("react");
39
+ var import_react10 = require("react");
40
40
 
41
41
  // src/visual-json.tsx
42
42
  var import_react2 = require("react");
@@ -939,7 +939,7 @@ function TreeView({
939
939
  }
940
940
 
941
941
  // src/form-view.tsx
942
- var import_react7 = require("react");
942
+ var import_react8 = require("react");
943
943
  var import_core4 = require("@visual-json/core");
944
944
 
945
945
  // src/breadcrumbs.tsx
@@ -1069,7 +1069,7 @@ function Breadcrumbs({ className }) {
1069
1069
  width: "100%",
1070
1070
  boxSizing: "border-box",
1071
1071
  padding: "2px 0",
1072
- fontSize: 12,
1072
+ fontSize: "var(--vj-input-font-size, 13px)",
1073
1073
  fontFamily: "var(--vj-font, monospace)",
1074
1074
  color: "var(--vj-text-muted, #999999)",
1075
1075
  background: "transparent",
@@ -1124,8 +1124,175 @@ function Breadcrumbs({ className }) {
1124
1124
  );
1125
1125
  }
1126
1126
 
1127
- // src/form-view.tsx
1127
+ // src/enum-input.tsx
1128
+ var import_react7 = require("react");
1128
1129
  var import_jsx_runtime5 = require("react/jsx-runtime");
1130
+ var DROPDOWN_MAX_HEIGHT2 = 200;
1131
+ function EnumInput({
1132
+ enumValues,
1133
+ value,
1134
+ onValueChange,
1135
+ inputRef,
1136
+ inputStyle
1137
+ }) {
1138
+ const [inputValue, setInputValue] = (0, import_react7.useState)(value);
1139
+ const [open, setOpen] = (0, import_react7.useState)(false);
1140
+ const [highlightIndex, setHighlightIndex] = (0, import_react7.useState)(0);
1141
+ const listRef = (0, import_react7.useRef)(null);
1142
+ const wrapperRef = (0, import_react7.useRef)(null);
1143
+ (0, import_react7.useEffect)(() => {
1144
+ setInputValue(value);
1145
+ }, [value]);
1146
+ const suggestions = (0, import_react7.useMemo)(
1147
+ () => enumValues.map((v) => String(v)),
1148
+ [enumValues]
1149
+ );
1150
+ (0, import_react7.useEffect)(() => {
1151
+ setHighlightIndex(0);
1152
+ }, [suggestions]);
1153
+ const selectValue = (0, import_react7.useCallback)(
1154
+ (val) => {
1155
+ onValueChange(val);
1156
+ setInputValue(val);
1157
+ setOpen(false);
1158
+ },
1159
+ [onValueChange]
1160
+ );
1161
+ const handleKeyDown = (0, import_react7.useCallback)(
1162
+ (e) => {
1163
+ if (!open) {
1164
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
1165
+ e.preventDefault();
1166
+ e.stopPropagation();
1167
+ setOpen(true);
1168
+ }
1169
+ return;
1170
+ }
1171
+ switch (e.key) {
1172
+ case "ArrowDown":
1173
+ e.preventDefault();
1174
+ e.stopPropagation();
1175
+ setHighlightIndex((i) => Math.min(i + 1, suggestions.length - 1));
1176
+ break;
1177
+ case "ArrowUp":
1178
+ e.preventDefault();
1179
+ e.stopPropagation();
1180
+ setHighlightIndex((i) => Math.max(i - 1, 0));
1181
+ break;
1182
+ case "Enter":
1183
+ e.preventDefault();
1184
+ e.stopPropagation();
1185
+ if (suggestions.length > 0 && highlightIndex < suggestions.length) {
1186
+ selectValue(suggestions[highlightIndex]);
1187
+ }
1188
+ break;
1189
+ case "Escape":
1190
+ e.preventDefault();
1191
+ e.stopPropagation();
1192
+ setInputValue(value);
1193
+ setOpen(false);
1194
+ break;
1195
+ case "Tab":
1196
+ setInputValue(value);
1197
+ setOpen(false);
1198
+ break;
1199
+ }
1200
+ },
1201
+ [open, suggestions, highlightIndex, value, selectValue]
1202
+ );
1203
+ (0, import_react7.useEffect)(() => {
1204
+ const el = listRef.current;
1205
+ if (!el || !open) return;
1206
+ const item = el.children[highlightIndex];
1207
+ item?.scrollIntoView({ block: "nearest" });
1208
+ }, [highlightIndex, open]);
1209
+ (0, import_react7.useEffect)(() => {
1210
+ function handleClickOutside(e) {
1211
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
1212
+ setInputValue(value);
1213
+ setOpen(false);
1214
+ }
1215
+ }
1216
+ document.addEventListener("mousedown", handleClickOutside);
1217
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1218
+ }, [value]);
1219
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1220
+ "div",
1221
+ {
1222
+ ref: wrapperRef,
1223
+ style: { position: "relative", flex: 1, minWidth: 0 },
1224
+ children: [
1225
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1226
+ "input",
1227
+ {
1228
+ ref: inputRef,
1229
+ value: inputValue,
1230
+ onChange: (e) => {
1231
+ setInputValue(e.target.value);
1232
+ if (!open) setOpen(true);
1233
+ },
1234
+ onFocus: () => setOpen(true),
1235
+ onKeyDown: handleKeyDown,
1236
+ onClick: (e) => e.stopPropagation(),
1237
+ spellCheck: false,
1238
+ autoComplete: "off",
1239
+ style: inputStyle
1240
+ }
1241
+ ),
1242
+ open && suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1243
+ "div",
1244
+ {
1245
+ ref: listRef,
1246
+ style: {
1247
+ position: "absolute",
1248
+ top: "calc(100% + 4px)",
1249
+ left: -32,
1250
+ right: 0,
1251
+ zIndex: 50,
1252
+ maxHeight: DROPDOWN_MAX_HEIGHT2,
1253
+ overflowY: "auto",
1254
+ backgroundColor: "var(--vj-bg-panel, #252526)",
1255
+ border: "1px solid var(--vj-border, #333333)",
1256
+ boxShadow: "0 4px 12px rgba(0,0,0,0.3)"
1257
+ },
1258
+ children: suggestions.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1259
+ "div",
1260
+ {
1261
+ onMouseDown: (e) => {
1262
+ e.preventDefault();
1263
+ selectValue(s);
1264
+ },
1265
+ onMouseEnter: () => setHighlightIndex(i),
1266
+ style: {
1267
+ padding: "4px 12px",
1268
+ fontSize: 13,
1269
+ fontFamily: "var(--vj-font, monospace)",
1270
+ display: "flex",
1271
+ alignItems: "center",
1272
+ gap: 6,
1273
+ color: i === highlightIndex ? "var(--vj-text, #cccccc)" : "var(--vj-text-muted, #888888)",
1274
+ backgroundColor: i === highlightIndex ? "var(--vj-bg-hover, #2a2d2e)" : "transparent",
1275
+ cursor: "pointer",
1276
+ whiteSpace: "nowrap",
1277
+ overflow: "hidden",
1278
+ textOverflow: "ellipsis"
1279
+ },
1280
+ children: [
1281
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { width: 14, flexShrink: 0, fontSize: 12 }, children: s === value ? "\u2713" : "" }),
1282
+ s
1283
+ ]
1284
+ },
1285
+ s
1286
+ ))
1287
+ }
1288
+ )
1289
+ ]
1290
+ }
1291
+ );
1292
+ }
1293
+
1294
+ // src/form-view.tsx
1295
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1129
1296
  function getResolvedSchema(schema, rootSchema, path) {
1130
1297
  if (!schema) return void 0;
1131
1298
  const raw = (0, import_core4.getPropertySchema)(schema, path, rootSchema);
@@ -1173,7 +1340,7 @@ function FormField({
1173
1340
  const isEditing = editingNodeId === node.id;
1174
1341
  const propSchema = getResolvedSchema(schema, rootSchema, node.path);
1175
1342
  const isRequired = checkRequired(node, schema, rootSchema);
1176
- const [hovered, setHovered] = (0, import_react7.useState)(false);
1343
+ const [hovered, setHovered] = (0, import_react8.useState)(false);
1177
1344
  const isRoot = node.parentId === null;
1178
1345
  const isDragTarget = dragState.dropTargetNodeId === node.id;
1179
1346
  const isDraggedNode = dragState.draggedNodeId === node.id;
@@ -1190,9 +1357,9 @@ function FormField({
1190
1357
  } else if (isDragTarget && dragState.dropPosition === "after") {
1191
1358
  borderBottom = "2px solid var(--vj-accent, #007acc)";
1192
1359
  }
1193
- const valueRef = (0, import_react7.useRef)(null);
1194
- const keyRef = (0, import_react7.useRef)(null);
1195
- (0, import_react7.useEffect)(() => {
1360
+ const valueRef = (0, import_react8.useRef)(null);
1361
+ const keyRef = (0, import_react8.useRef)(null);
1362
+ (0, import_react8.useEffect)(() => {
1196
1363
  if (!isEditing) return;
1197
1364
  if (!isContainer) {
1198
1365
  const hasValue = node.value !== null && node.value !== void 0 && node.value !== "";
@@ -1205,7 +1372,7 @@ function FormField({
1205
1372
  keyRef.current.focus();
1206
1373
  }
1207
1374
  }, [isEditing, isContainer, node.value]);
1208
- const handleValueChange = (0, import_react7.useCallback)(
1375
+ const handleValueChange = (0, import_react8.useCallback)(
1209
1376
  (newValue) => {
1210
1377
  let parsed;
1211
1378
  if (propSchema?.type === "boolean" || newValue === "true" || newValue === "false") {
@@ -1223,18 +1390,18 @@ function FormField({
1223
1390
  },
1224
1391
  [state.tree, node.id, node.type, actions, propSchema]
1225
1392
  );
1226
- const handleKeyChange = (0, import_react7.useCallback)(
1393
+ const handleKeyChange = (0, import_react8.useCallback)(
1227
1394
  (newKey) => {
1228
1395
  const newTree = (0, import_core4.setKey)(state.tree, node.id, newKey);
1229
1396
  actions.setTree(newTree);
1230
1397
  },
1231
1398
  [state.tree, node.id, actions]
1232
1399
  );
1233
- const handleRemove = (0, import_react7.useCallback)(() => {
1400
+ const handleRemove = (0, import_react8.useCallback)(() => {
1234
1401
  const newTree = (0, import_core4.removeNode)(state.tree, node.id);
1235
1402
  actions.setTree(newTree);
1236
1403
  }, [state.tree, node.id, actions]);
1237
- const handleAddChild = (0, import_react7.useCallback)(() => {
1404
+ const handleAddChild = (0, import_react8.useCallback)(() => {
1238
1405
  const key = node.type === "array" ? String(node.children.length) : `newKey${node.children.length}`;
1239
1406
  const newTree = (0, import_core4.addProperty)(state.tree, node.id, key, "");
1240
1407
  actions.setTree(newTree);
@@ -1247,8 +1414,8 @@ function FormField({
1247
1414
  const rowBg = isSelected ? isFocused ? "var(--vj-bg-selected, #2a5a1e)" : "var(--vj-bg-selected-muted, var(--vj-bg-hover, #2a2d2e))" : hovered ? "var(--vj-bg-hover, #2a2d2e)" : "transparent";
1248
1415
  const rowColor = isSelected && isFocused ? "var(--vj-text-selected, var(--vj-text, #cccccc))" : "var(--vj-text, #cccccc)";
1249
1416
  if (isContainer) {
1250
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1251
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1417
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
1418
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1252
1419
  "div",
1253
1420
  {
1254
1421
  "data-form-node-id": node.id,
@@ -1286,7 +1453,7 @@ function FormField({
1286
1453
  onMouseEnter: () => setHovered(true),
1287
1454
  onMouseLeave: () => setHovered(false),
1288
1455
  children: [
1289
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1456
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1290
1457
  "button",
1291
1458
  {
1292
1459
  onClick: (e) => {
@@ -1311,7 +1478,7 @@ function FormField({
1311
1478
  children: "\u25B6"
1312
1479
  }
1313
1480
  ),
1314
- isEditing && !isRoot ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1481
+ isEditing && !isRoot ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1315
1482
  "input",
1316
1483
  {
1317
1484
  ref: keyRef,
@@ -1323,7 +1490,7 @@ function FormField({
1323
1490
  border: "none",
1324
1491
  color: "inherit",
1325
1492
  fontFamily: "var(--vj-font, monospace)",
1326
- fontSize: 13,
1493
+ fontSize: "var(--vj-input-font-size, 13px)",
1327
1494
  fontWeight: 500,
1328
1495
  padding: 0,
1329
1496
  outline: "none",
@@ -1331,7 +1498,7 @@ function FormField({
1331
1498
  width: `calc(${(maxDepth - depth) * 16}px + ${maxKeyLength}ch)`
1332
1499
  }
1333
1500
  }
1334
- ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1501
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1335
1502
  "span",
1336
1503
  {
1337
1504
  style: {
@@ -1346,7 +1513,7 @@ function FormField({
1346
1513
  children: isRoot ? "/" : getDisplayKey(node, state.tree)
1347
1514
  }
1348
1515
  ),
1349
- showDescriptions && fieldTitle && !isSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1516
+ showDescriptions && fieldTitle && !isSelected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1350
1517
  "span",
1351
1518
  {
1352
1519
  style: {
@@ -1357,7 +1524,7 @@ function FormField({
1357
1524
  children: fieldTitle
1358
1525
  }
1359
1526
  ),
1360
- hovered && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1527
+ hovered && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1361
1528
  "button",
1362
1529
  {
1363
1530
  onClick: (e) => {
@@ -1379,7 +1546,7 @@ function FormField({
1379
1546
  ]
1380
1547
  }
1381
1548
  ),
1382
- showCounts && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1549
+ showCounts && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1383
1550
  "span",
1384
1551
  {
1385
1552
  style: {
@@ -1391,7 +1558,7 @@ function FormField({
1391
1558
  children: node.type === "array" ? `${node.children.length} items` : `${node.children.length} properties`
1392
1559
  }
1393
1560
  ),
1394
- !isRoot && isEditing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1561
+ !isRoot && isEditing && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1395
1562
  "button",
1396
1563
  {
1397
1564
  onClick: (e) => {
@@ -1415,7 +1582,7 @@ function FormField({
1415
1582
  ]
1416
1583
  }
1417
1584
  ),
1418
- showDescriptions && description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1585
+ showDescriptions && description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1419
1586
  "div",
1420
1587
  {
1421
1588
  style: {
@@ -1428,7 +1595,7 @@ function FormField({
1428
1595
  children: description
1429
1596
  }
1430
1597
  ),
1431
- !collapsed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: node.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1598
+ !collapsed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { children: node.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1432
1599
  FormField,
1433
1600
  {
1434
1601
  node: child,
@@ -1458,7 +1625,7 @@ function FormField({
1458
1625
  }
1459
1626
  const displayValue = getDisplayValue(node);
1460
1627
  const valueColor = getValueColor(node);
1461
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1628
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1462
1629
  "div",
1463
1630
  {
1464
1631
  "data-form-node-id": node.id,
@@ -1496,8 +1663,8 @@ function FormField({
1496
1663
  onMouseEnter: () => setHovered(true),
1497
1664
  onMouseLeave: () => setHovered(false),
1498
1665
  children: [
1499
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { width: 16, flexShrink: 0 } }),
1500
- isEditing && parentIsObject ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1666
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { width: 16, flexShrink: 0 } }),
1667
+ isEditing && parentIsObject ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1501
1668
  "input",
1502
1669
  {
1503
1670
  ref: keyRef,
@@ -1515,14 +1682,14 @@ function FormField({
1515
1682
  border: "none",
1516
1683
  color: "inherit",
1517
1684
  fontFamily: "var(--vj-font, monospace)",
1518
- fontSize: 13,
1685
+ fontSize: "var(--vj-input-font-size, 13px)",
1519
1686
  padding: 0,
1520
1687
  flexShrink: 0,
1521
1688
  outline: "none",
1522
1689
  width: `calc(${(maxDepth - depth) * 16}px + ${maxKeyLength}ch)`
1523
1690
  }
1524
1691
  }
1525
- ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1692
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1526
1693
  "span",
1527
1694
  {
1528
1695
  style: {
@@ -1536,7 +1703,7 @@ function FormField({
1536
1703
  children: getDisplayKey(node, state.tree)
1537
1704
  }
1538
1705
  ),
1539
- isRequired && !isSelected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1706
+ isRequired && !isSelected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1540
1707
  "span",
1541
1708
  {
1542
1709
  style: {
@@ -1547,7 +1714,7 @@ function FormField({
1547
1714
  children: "*"
1548
1715
  }
1549
1716
  ),
1550
- isEditing ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1717
+ isEditing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1551
1718
  "div",
1552
1719
  {
1553
1720
  style: {
@@ -1566,7 +1733,7 @@ function FormField({
1566
1733
  valueColor
1567
1734
  )
1568
1735
  }
1569
- ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1736
+ ) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1570
1737
  "span",
1571
1738
  {
1572
1739
  style: {
@@ -1581,7 +1748,7 @@ function FormField({
1581
1748
  children: displayValue
1582
1749
  }
1583
1750
  ),
1584
- isEditing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1751
+ isEditing && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1585
1752
  "button",
1586
1753
  {
1587
1754
  onClick: (e) => {
@@ -1612,48 +1779,38 @@ function renderEditInput(node, propSchema, displayValue, handleValueChange, inpu
1612
1779
  background: "none",
1613
1780
  border: "none",
1614
1781
  fontFamily: "var(--vj-font, monospace)",
1615
- fontSize: 13,
1782
+ fontSize: "var(--vj-input-font-size, 13px)",
1616
1783
  padding: 0,
1617
1784
  flex: 1,
1618
1785
  outline: "none",
1619
1786
  color: valueColor
1620
1787
  };
1621
1788
  if (node.type === "boolean") {
1622
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1623
- "select",
1789
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1790
+ EnumInput,
1624
1791
  {
1625
- ref: inputRef,
1792
+ enumValues: ["true", "false"],
1626
1793
  value: String(node.value),
1627
- onChange: (e) => handleValueChange(e.target.value),
1628
- onClick: (e) => e.stopPropagation(),
1629
- style: { ...inputStyle, cursor: "pointer" },
1630
- children: [
1631
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "true", children: "true" }),
1632
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "false", children: "false" })
1633
- ]
1794
+ onValueChange: handleValueChange,
1795
+ inputRef,
1796
+ inputStyle
1634
1797
  }
1635
1798
  );
1636
1799
  }
1637
1800
  if (hasEnumValues && propSchema?.enum) {
1638
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1639
- "select",
1801
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1802
+ EnumInput,
1640
1803
  {
1641
- ref: inputRef,
1804
+ enumValues: propSchema.enum,
1642
1805
  value: displayValue,
1643
- onChange: (e) => handleValueChange(e.target.value),
1644
- onClick: (e) => e.stopPropagation(),
1645
- style: { ...inputStyle, cursor: "pointer" },
1646
- children: [
1647
- !propSchema.enum.some(
1648
- (v) => JSON.stringify(v) === JSON.stringify(node.value)
1649
- ) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: displayValue, children: displayValue || "(empty)" }),
1650
- propSchema.enum.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: String(v), children: String(v) }, i))
1651
- ]
1806
+ onValueChange: handleValueChange,
1807
+ inputRef,
1808
+ inputStyle
1652
1809
  }
1653
1810
  );
1654
1811
  }
1655
1812
  if (node.type === "null") {
1656
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1813
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1657
1814
  "span",
1658
1815
  {
1659
1816
  style: {
@@ -1667,7 +1824,7 @@ function renderEditInput(node, propSchema, displayValue, handleValueChange, inpu
1667
1824
  }
1668
1825
  );
1669
1826
  }
1670
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1827
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1671
1828
  "input",
1672
1829
  {
1673
1830
  ref: inputRef,
@@ -1694,16 +1851,16 @@ function FormView({
1694
1851
  const rootSchema = state.schema ?? void 0;
1695
1852
  const selectedNode = state.selectedNodeId ? state.tree.nodesById.get(state.selectedNodeId) : null;
1696
1853
  const displayNode = selectedNode ?? state.tree.root;
1697
- const [formSelectedNodeId, setFormSelectedNodeId] = (0, import_react7.useState)(
1854
+ const [formSelectedNodeId, setFormSelectedNodeId] = (0, import_react8.useState)(
1698
1855
  null
1699
1856
  );
1700
- const [editingNodeId, setEditingNodeId] = (0, import_react7.useState)(null);
1701
- const preEditTreeRef = (0, import_react7.useRef)(null);
1702
- const [collapsedIds, setCollapsedIds] = (0, import_react7.useState)(
1857
+ const [editingNodeId, setEditingNodeId] = (0, import_react8.useState)(null);
1858
+ const preEditTreeRef = (0, import_react8.useRef)(null);
1859
+ const [collapsedIds, setCollapsedIds] = (0, import_react8.useState)(
1703
1860
  () => /* @__PURE__ */ new Set()
1704
1861
  );
1705
- const containerRef = (0, import_react7.useRef)(null);
1706
- const [isFocused, setIsFocused] = (0, import_react7.useState)(false);
1862
+ const containerRef = (0, import_react8.useRef)(null);
1863
+ const [isFocused, setIsFocused] = (0, import_react8.useState)(false);
1707
1864
  const {
1708
1865
  dragState,
1709
1866
  handleDragStart,
@@ -1711,16 +1868,16 @@ function FormView({
1711
1868
  handleDragEnd,
1712
1869
  handleDrop
1713
1870
  } = useDragDrop();
1714
- (0, import_react7.useEffect)(() => {
1871
+ (0, import_react8.useEffect)(() => {
1715
1872
  setFormSelectedNodeId(null);
1716
1873
  setEditingNodeId(null);
1717
1874
  setCollapsedIds(/* @__PURE__ */ new Set());
1718
1875
  }, [displayNode.id]);
1719
- const visibleNodes = (0, import_react7.useMemo)(
1876
+ const visibleNodes = (0, import_react8.useMemo)(
1720
1877
  () => getVisibleNodes(displayNode, (id) => !collapsedIds.has(id)),
1721
1878
  [displayNode, collapsedIds]
1722
1879
  );
1723
- const { maxKeyLength, maxDepth } = (0, import_react7.useMemo)(() => {
1880
+ const { maxKeyLength, maxDepth } = (0, import_react8.useMemo)(() => {
1724
1881
  let maxKey = 1;
1725
1882
  let maxD = 0;
1726
1883
  const baseSegments = displayNode.path === "/" ? 0 : displayNode.path.split("/").filter(Boolean).length;
@@ -1733,11 +1890,11 @@ function FormView({
1733
1890
  }
1734
1891
  return { maxKeyLength: maxKey, maxDepth: maxD };
1735
1892
  }, [visibleNodes, displayNode.path, state.tree]);
1736
- const handleSelect = (0, import_react7.useCallback)((nodeId) => {
1893
+ const handleSelect = (0, import_react8.useCallback)((nodeId) => {
1737
1894
  setFormSelectedNodeId(nodeId);
1738
1895
  setEditingNodeId(null);
1739
1896
  }, []);
1740
- const handleToggleCollapse = (0, import_react7.useCallback)((nodeId) => {
1897
+ const handleToggleCollapse = (0, import_react8.useCallback)((nodeId) => {
1741
1898
  setCollapsedIds((prev) => {
1742
1899
  const next = new Set(prev);
1743
1900
  if (next.has(nodeId)) {
@@ -1748,14 +1905,14 @@ function FormView({
1748
1905
  return next;
1749
1906
  });
1750
1907
  }, []);
1751
- const handleStartEditing = (0, import_react7.useCallback)(
1908
+ const handleStartEditing = (0, import_react8.useCallback)(
1752
1909
  (nodeId) => {
1753
1910
  preEditTreeRef.current = state.tree;
1754
1911
  setEditingNodeId(nodeId);
1755
1912
  },
1756
1913
  [state.tree]
1757
1914
  );
1758
- const scrollToNode = (0, import_react7.useCallback)((nodeId) => {
1915
+ const scrollToNode = (0, import_react8.useCallback)((nodeId) => {
1759
1916
  requestAnimationFrame(() => {
1760
1917
  const el = containerRef.current?.querySelector(
1761
1918
  `[data-form-node-id="${nodeId}"]`
@@ -1763,7 +1920,7 @@ function FormView({
1763
1920
  el?.scrollIntoView({ block: "nearest" });
1764
1921
  });
1765
1922
  }, []);
1766
- const handleKeyDown = (0, import_react7.useCallback)(
1923
+ const handleKeyDown = (0, import_react8.useCallback)(
1767
1924
  (e) => {
1768
1925
  if (editingNodeId) {
1769
1926
  if (e.key === "Escape") {
@@ -1886,7 +2043,7 @@ function FormView({
1886
2043
  actions
1887
2044
  ]
1888
2045
  );
1889
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2046
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1890
2047
  "div",
1891
2048
  {
1892
2049
  className,
@@ -1899,7 +2056,7 @@ function FormView({
1899
2056
  flexDirection: "column"
1900
2057
  },
1901
2058
  children: [
1902
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2059
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1903
2060
  "div",
1904
2061
  {
1905
2062
  style: {
@@ -1908,10 +2065,10 @@ function FormView({
1908
2065
  backgroundColor: "var(--vj-bg-panel, #252526)",
1909
2066
  flexShrink: 0
1910
2067
  },
1911
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Breadcrumbs, {})
2068
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Breadcrumbs, {})
1912
2069
  }
1913
2070
  ),
1914
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2071
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1915
2072
  "div",
1916
2073
  {
1917
2074
  ref: containerRef,
@@ -1929,7 +2086,7 @@ function FormView({
1929
2086
  overflow: "auto",
1930
2087
  outline: "none"
1931
2088
  },
1932
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2089
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1933
2090
  FormField,
1934
2091
  {
1935
2092
  node: displayNode,
@@ -1962,12 +2119,12 @@ function FormView({
1962
2119
  }
1963
2120
 
1964
2121
  // src/search-bar.tsx
1965
- var import_react8 = require("react");
1966
- var import_jsx_runtime6 = require("react/jsx-runtime");
2122
+ var import_react9 = require("react");
2123
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1967
2124
  function SearchBar({ className }) {
1968
2125
  const { state, actions } = useStudio();
1969
- const inputRef = (0, import_react8.useRef)(null);
1970
- const handleKeyDown = (0, import_react8.useCallback)(
2126
+ const inputRef = (0, import_react9.useRef)(null);
2127
+ const handleKeyDown = (0, import_react9.useCallback)(
1971
2128
  (e) => {
1972
2129
  if (e.key === "Enter") {
1973
2130
  e.preventDefault();
@@ -1985,7 +2142,7 @@ function SearchBar({ className }) {
1985
2142
  },
1986
2143
  [actions]
1987
2144
  );
1988
- (0, import_react8.useEffect)(() => {
2145
+ (0, import_react9.useEffect)(() => {
1989
2146
  function handleGlobalKeyDown(e) {
1990
2147
  const mod = e.metaKey || e.ctrlKey;
1991
2148
  if (mod && e.key === "f") {
@@ -1999,7 +2156,7 @@ function SearchBar({ className }) {
1999
2156
  }, []);
2000
2157
  const matchCount = state.searchMatches.length;
2001
2158
  const currentMatch = matchCount > 0 ? state.searchMatchIndex + 1 : 0;
2002
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
2159
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2003
2160
  "div",
2004
2161
  {
2005
2162
  className,
@@ -2012,7 +2169,7 @@ function SearchBar({ className }) {
2012
2169
  borderBottom: "1px solid var(--vj-border, #333333)"
2013
2170
  },
2014
2171
  children: [
2015
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2172
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2016
2173
  "input",
2017
2174
  {
2018
2175
  ref: inputRef,
@@ -2028,14 +2185,14 @@ function SearchBar({ className }) {
2028
2185
  borderRadius: 3,
2029
2186
  color: "var(--vj-text, #cccccc)",
2030
2187
  fontFamily: "var(--vj-font, monospace)",
2031
- fontSize: 12,
2188
+ fontSize: "var(--vj-input-font-size, 13px)",
2032
2189
  padding: "3px 8px",
2033
2190
  outline: "none",
2034
2191
  minWidth: 0
2035
2192
  }
2036
2193
  }
2037
2194
  ),
2038
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2195
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2039
2196
  "div",
2040
2197
  {
2041
2198
  style: {
@@ -2045,8 +2202,8 @@ function SearchBar({ className }) {
2045
2202
  flexShrink: 0,
2046
2203
  height: 18
2047
2204
  },
2048
- children: state.searchQuery ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2049
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2205
+ children: state.searchQuery ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2206
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2050
2207
  "span",
2051
2208
  {
2052
2209
  style: {
@@ -2059,7 +2216,7 @@ function SearchBar({ className }) {
2059
2216
  children: matchCount > 0 ? `${currentMatch}/${matchCount}` : "0/0"
2060
2217
  }
2061
2218
  ),
2062
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2219
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2063
2220
  "button",
2064
2221
  {
2065
2222
  onClick: actions.prevSearchMatch,
@@ -2083,7 +2240,7 @@ function SearchBar({ className }) {
2083
2240
  children: "\u25B2"
2084
2241
  }
2085
2242
  ),
2086
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2243
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2087
2244
  "button",
2088
2245
  {
2089
2246
  onClick: actions.nextSearchMatch,
@@ -2107,7 +2264,7 @@ function SearchBar({ className }) {
2107
2264
  children: "\u25BC"
2108
2265
  }
2109
2266
  ),
2110
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2267
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2111
2268
  "button",
2112
2269
  {
2113
2270
  onClick: () => actions.setSearchQuery(""),
@@ -2130,8 +2287,8 @@ function SearchBar({ className }) {
2130
2287
  children: "\xD7"
2131
2288
  }
2132
2289
  )
2133
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2134
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2290
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
2291
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2135
2292
  "button",
2136
2293
  {
2137
2294
  onClick: actions.expandAll,
@@ -2148,7 +2305,7 @@ function SearchBar({ className }) {
2148
2305
  alignItems: "center"
2149
2306
  },
2150
2307
  title: "Expand all",
2151
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
2308
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2152
2309
  "svg",
2153
2310
  {
2154
2311
  width: "14",
@@ -2160,15 +2317,15 @@ function SearchBar({ className }) {
2160
2317
  strokeLinecap: "round",
2161
2318
  strokeLinejoin: "round",
2162
2319
  children: [
2163
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 2v4M5 4l3-2 3 2" }),
2164
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 14v-4M5 12l3 2 3-2" }),
2165
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2 8h12" })
2320
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M8 2v4M5 4l3-2 3 2" }),
2321
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M8 14v-4M5 12l3 2 3-2" }),
2322
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M2 8h12" })
2166
2323
  ]
2167
2324
  }
2168
2325
  )
2169
2326
  }
2170
2327
  ),
2171
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2328
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2172
2329
  "button",
2173
2330
  {
2174
2331
  onClick: actions.collapseAll,
@@ -2185,7 +2342,7 @@ function SearchBar({ className }) {
2185
2342
  alignItems: "center"
2186
2343
  },
2187
2344
  title: "Collapse all",
2188
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
2345
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2189
2346
  "svg",
2190
2347
  {
2191
2348
  width: "14",
@@ -2197,9 +2354,9 @@ function SearchBar({ className }) {
2197
2354
  strokeLinecap: "round",
2198
2355
  strokeLinejoin: "round",
2199
2356
  children: [
2200
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 5V1M5 3l3 2 3-2" }),
2201
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 11v4M5 13l3-2 3 2" }),
2202
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M2 8h12" })
2357
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M8 5V1M5 3l3 2 3-2" }),
2358
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M8 11v4M5 13l3-2 3 2" }),
2359
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M2 8h12" })
2203
2360
  ]
2204
2361
  }
2205
2362
  )
@@ -2214,7 +2371,7 @@ function SearchBar({ className }) {
2214
2371
  }
2215
2372
 
2216
2373
  // src/json-editor.tsx
2217
- var import_jsx_runtime7 = require("react/jsx-runtime");
2374
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2218
2375
  var DEFAULT_CSS_VARS = {
2219
2376
  "--vj-bg": "#1e1e1e",
2220
2377
  "--vj-bg-panel": "#252526",
@@ -2237,7 +2394,8 @@ var DEFAULT_CSS_VARS = {
2237
2394
  "--vj-input-bg": "#3c3c3c",
2238
2395
  "--vj-input-border": "#555555",
2239
2396
  "--vj-error": "#f48771",
2240
- "--vj-font": "monospace"
2397
+ "--vj-font": "monospace",
2398
+ "--vj-input-font-size": "13px"
2241
2399
  };
2242
2400
  function JsonEditor({
2243
2401
  value,
@@ -2257,15 +2415,15 @@ function JsonEditor({
2257
2415
  }) {
2258
2416
  const isControlled = value !== void 0;
2259
2417
  const initialValue = isControlled ? value : defaultValue ?? {};
2260
- const [editorKey, setEditorKey] = (0, import_react9.useState)(0);
2261
- const valueRef = (0, import_react9.useRef)(initialValue);
2262
- (0, import_react9.useEffect)(() => {
2418
+ const [editorKey, setEditorKey] = (0, import_react10.useState)(0);
2419
+ const valueRef = (0, import_react10.useRef)(initialValue);
2420
+ (0, import_react10.useEffect)(() => {
2263
2421
  if (isControlled && value !== valueRef.current) {
2264
2422
  valueRef.current = value;
2265
2423
  setEditorKey((k) => k + 1);
2266
2424
  }
2267
2425
  }, [value, isControlled]);
2268
- const handleChange = (0, import_react9.useCallback)(
2426
+ const handleChange = (0, import_react10.useCallback)(
2269
2427
  (newValue) => {
2270
2428
  valueRef.current = newValue;
2271
2429
  if (!readOnly) {
@@ -2283,25 +2441,35 @@ function JsonEditor({
2283
2441
  ...DEFAULT_CSS_VARS,
2284
2442
  ...style
2285
2443
  };
2286
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className, style: containerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2287
- VisualJson,
2288
- {
2289
- value: valueRef.current,
2290
- onChange: readOnly ? void 0 : handleChange,
2291
- schema,
2292
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2293
- EditorLayout,
2294
- {
2295
- treeShowValues,
2296
- treeShowCounts,
2297
- editorShowDescriptions,
2298
- editorShowCounts,
2299
- sidebarOpen
2444
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className, "data-vj-root": "", style: containerStyle, children: [
2445
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2446
+ "style",
2447
+ {
2448
+ dangerouslySetInnerHTML: {
2449
+ __html: `@media(pointer:coarse){[data-vj-root]{--vj-input-font-size:16px}}`
2300
2450
  }
2301
- )
2302
- },
2303
- editorKey
2304
- ) });
2451
+ }
2452
+ ),
2453
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2454
+ VisualJson,
2455
+ {
2456
+ value: valueRef.current,
2457
+ onChange: readOnly ? void 0 : handleChange,
2458
+ schema,
2459
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2460
+ EditorLayout,
2461
+ {
2462
+ treeShowValues,
2463
+ treeShowCounts,
2464
+ editorShowDescriptions,
2465
+ editorShowCounts,
2466
+ sidebarOpen
2467
+ }
2468
+ )
2469
+ },
2470
+ editorKey
2471
+ )
2472
+ ] });
2305
2473
  }
2306
2474
  function EditorLayout({
2307
2475
  treeShowValues,
@@ -2310,14 +2478,14 @@ function EditorLayout({
2310
2478
  editorShowCounts,
2311
2479
  sidebarOpen
2312
2480
  }) {
2313
- const [sidebarWidth, setSidebarWidth] = (0, import_react9.useState)(280);
2314
- const [isNarrow, setIsNarrow] = (0, import_react9.useState)(false);
2315
- const [activePanel, setActivePanel] = (0, import_react9.useState)("tree");
2316
- const containerRef = (0, import_react9.useRef)(null);
2317
- const dragging = (0, import_react9.useRef)(false);
2318
- const startX = (0, import_react9.useRef)(0);
2319
- const startWidth = (0, import_react9.useRef)(0);
2320
- (0, import_react9.useEffect)(() => {
2481
+ const [sidebarWidth, setSidebarWidth] = (0, import_react10.useState)(280);
2482
+ const [isNarrow, setIsNarrow] = (0, import_react10.useState)(false);
2483
+ const [activePanel, setActivePanel] = (0, import_react10.useState)("tree");
2484
+ const containerRef = (0, import_react10.useRef)(null);
2485
+ const dragging = (0, import_react10.useRef)(false);
2486
+ const startX = (0, import_react10.useRef)(0);
2487
+ const startWidth = (0, import_react10.useRef)(0);
2488
+ (0, import_react10.useEffect)(() => {
2321
2489
  function checkWidth() {
2322
2490
  if (containerRef.current) {
2323
2491
  setIsNarrow(containerRef.current.offsetWidth < 500);
@@ -2328,7 +2496,7 @@ function EditorLayout({
2328
2496
  if (containerRef.current) observer.observe(containerRef.current);
2329
2497
  return () => observer.disconnect();
2330
2498
  }, []);
2331
- const handleMouseDown = (0, import_react9.useCallback)(
2499
+ const handleMouseDown = (0, import_react10.useCallback)(
2332
2500
  (e) => {
2333
2501
  dragging.current = true;
2334
2502
  startX.current = e.clientX;
@@ -2358,7 +2526,7 @@ function EditorLayout({
2358
2526
  );
2359
2527
  if (isNarrow) {
2360
2528
  if (!sidebarOpen) {
2361
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2529
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2362
2530
  "div",
2363
2531
  {
2364
2532
  ref: containerRef,
@@ -2368,7 +2536,7 @@ function EditorLayout({
2368
2536
  flex: 1,
2369
2537
  minHeight: 0
2370
2538
  },
2371
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2539
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2372
2540
  FormView,
2373
2541
  {
2374
2542
  showDescriptions: editorShowDescriptions,
@@ -2378,7 +2546,7 @@ function EditorLayout({
2378
2546
  }
2379
2547
  );
2380
2548
  }
2381
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2549
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2382
2550
  "div",
2383
2551
  {
2384
2552
  ref: containerRef,
@@ -2389,7 +2557,7 @@ function EditorLayout({
2389
2557
  minHeight: 0
2390
2558
  },
2391
2559
  children: [
2392
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2560
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2393
2561
  "div",
2394
2562
  {
2395
2563
  style: {
@@ -2399,7 +2567,7 @@ function EditorLayout({
2399
2567
  backgroundColor: "var(--vj-bg-panel, #252526)"
2400
2568
  },
2401
2569
  children: [
2402
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2570
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2403
2571
  "button",
2404
2572
  {
2405
2573
  onClick: () => setActivePanel("tree"),
@@ -2416,7 +2584,7 @@ function EditorLayout({
2416
2584
  children: "Tree"
2417
2585
  }
2418
2586
  ),
2419
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2587
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2420
2588
  "button",
2421
2589
  {
2422
2590
  onClick: () => setActivePanel("form"),
@@ -2436,7 +2604,7 @@ function EditorLayout({
2436
2604
  ]
2437
2605
  }
2438
2606
  ),
2439
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { flex: 1, minHeight: 0, overflow: "hidden" }, children: activePanel === "tree" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2607
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, minHeight: 0, overflow: "hidden" }, children: activePanel === "tree" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2440
2608
  "div",
2441
2609
  {
2442
2610
  style: {
@@ -2445,8 +2613,8 @@ function EditorLayout({
2445
2613
  height: "100%"
2446
2614
  },
2447
2615
  children: [
2448
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SearchBar, {}),
2449
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { flex: 1, minHeight: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2616
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SearchBar, {}),
2617
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, minHeight: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2450
2618
  TreeView,
2451
2619
  {
2452
2620
  showValues: treeShowValues,
@@ -2455,7 +2623,7 @@ function EditorLayout({
2455
2623
  ) })
2456
2624
  ]
2457
2625
  }
2458
- ) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2626
+ ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2459
2627
  "div",
2460
2628
  {
2461
2629
  style: {
@@ -2463,7 +2631,7 @@ function EditorLayout({
2463
2631
  flexDirection: "column",
2464
2632
  height: "100%"
2465
2633
  },
2466
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2634
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2467
2635
  FormView,
2468
2636
  {
2469
2637
  showDescriptions: editorShowDescriptions,
@@ -2476,8 +2644,8 @@ function EditorLayout({
2476
2644
  }
2477
2645
  );
2478
2646
  }
2479
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref: containerRef, style: { display: "flex", flex: 1, minHeight: 0 }, children: [
2480
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2647
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref: containerRef, style: { display: "flex", flex: 1, minHeight: 0 }, children: [
2648
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2481
2649
  "div",
2482
2650
  {
2483
2651
  style: {
@@ -2489,12 +2657,12 @@ function EditorLayout({
2489
2657
  transition: "width 0.2s ease"
2490
2658
  },
2491
2659
  children: [
2492
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SearchBar, {}),
2493
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { flex: 1, minHeight: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TreeView, { showValues: treeShowValues, showCounts: treeShowCounts }) })
2660
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SearchBar, {}),
2661
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, minHeight: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TreeView, { showValues: treeShowValues, showCounts: treeShowCounts }) })
2494
2662
  ]
2495
2663
  }
2496
2664
  ),
2497
- sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2665
+ sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2498
2666
  "div",
2499
2667
  {
2500
2668
  style: {
@@ -2504,7 +2672,7 @@ function EditorLayout({
2504
2672
  position: "relative",
2505
2673
  transition: "background-color 0.15s"
2506
2674
  },
2507
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2675
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2508
2676
  "div",
2509
2677
  {
2510
2678
  onMouseDown: handleMouseDown,
@@ -2533,7 +2701,7 @@ function EditorLayout({
2533
2701
  )
2534
2702
  }
2535
2703
  ),
2536
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2704
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2537
2705
  "div",
2538
2706
  {
2539
2707
  style: {
@@ -2543,7 +2711,7 @@ function EditorLayout({
2543
2711
  minWidth: 0,
2544
2712
  overflow: "hidden"
2545
2713
  },
2546
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2714
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2547
2715
  FormView,
2548
2716
  {
2549
2717
  showDescriptions: editorShowDescriptions,
@@ -2556,9 +2724,9 @@ function EditorLayout({
2556
2724
  }
2557
2725
 
2558
2726
  // src/property-editor.tsx
2559
- var import_react10 = require("react");
2727
+ var import_react11 = require("react");
2560
2728
  var import_core5 = require("@visual-json/core");
2561
- var import_jsx_runtime8 = require("react/jsx-runtime");
2729
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2562
2730
  var ALL_TYPES = [
2563
2731
  "string",
2564
2732
  "number",
@@ -2570,7 +2738,8 @@ var ALL_TYPES = [
2570
2738
  function PropertyRow({ node, schemaProperty }) {
2571
2739
  const { state, actions } = useStudio();
2572
2740
  const isContainer = node.type === "object" || node.type === "array";
2573
- const [hoveredRow, setHoveredRow] = (0, import_react10.useState)(false);
2741
+ const [hoveredRow, setHoveredRow] = (0, import_react11.useState)(false);
2742
+ const enumRef = (0, import_react11.useRef)(null);
2574
2743
  function handleValueChange(newValue) {
2575
2744
  let parsed;
2576
2745
  if (newValue === "null") parsed = null;
@@ -2606,13 +2775,13 @@ function PropertyRow({ node, schemaProperty }) {
2606
2775
  }
2607
2776
  const hasEnumValues = schemaProperty?.enum && schemaProperty.enum.length > 0;
2608
2777
  const description = schemaProperty?.description;
2609
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2778
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2610
2779
  "div",
2611
2780
  {
2612
2781
  onMouseEnter: () => setHoveredRow(true),
2613
2782
  onMouseLeave: () => setHoveredRow(false),
2614
2783
  children: [
2615
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2784
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2616
2785
  "div",
2617
2786
  {
2618
2787
  style: {
@@ -2625,7 +2794,7 @@ function PropertyRow({ node, schemaProperty }) {
2625
2794
  backgroundColor: hoveredRow ? "var(--vj-bg-hover, #2a2d2e)" : "transparent"
2626
2795
  },
2627
2796
  children: [
2628
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2797
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2629
2798
  "input",
2630
2799
  {
2631
2800
  value: node.key,
@@ -2636,32 +2805,33 @@ function PropertyRow({ node, schemaProperty }) {
2636
2805
  borderRadius: 3,
2637
2806
  color: "var(--vj-text, #cccccc)",
2638
2807
  fontFamily: "var(--vj-font, monospace)",
2639
- fontSize: 13,
2808
+ fontSize: "var(--vj-input-font-size, 13px)",
2640
2809
  padding: "2px 6px",
2641
2810
  width: 140,
2642
2811
  flexShrink: 0
2643
2812
  }
2644
2813
  }
2645
2814
  ),
2646
- !isContainer ? hasEnumValues ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2647
- "select",
2815
+ !isContainer ? hasEnumValues ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2816
+ EnumInput,
2648
2817
  {
2818
+ enumValues: schemaProperty.enum,
2649
2819
  value: displayValue(),
2650
- onChange: (e) => handleValueChange(e.target.value),
2651
- style: {
2652
- background: "var(--vj-input-bg, #3c3c3c)",
2653
- border: "1px solid var(--vj-input-border, #555555)",
2820
+ onValueChange: handleValueChange,
2821
+ inputRef: enumRef,
2822
+ inputStyle: {
2823
+ background: "none",
2824
+ border: "1px solid transparent",
2654
2825
  borderRadius: 3,
2655
2826
  color: node.type === "string" ? "var(--vj-string, #ce9178)" : "var(--vj-number, #b5cea8)",
2656
2827
  fontFamily: "var(--vj-font, monospace)",
2657
- fontSize: 13,
2828
+ fontSize: "var(--vj-input-font-size, 13px)",
2658
2829
  padding: "2px 6px",
2659
2830
  flex: 1,
2660
- cursor: "pointer"
2661
- },
2662
- children: schemaProperty.enum.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: String(v), children: String(v) }, i))
2831
+ outline: "none"
2832
+ }
2663
2833
  }
2664
- ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2834
+ ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2665
2835
  "input",
2666
2836
  {
2667
2837
  value: displayValue(),
@@ -2673,13 +2843,13 @@ function PropertyRow({ node, schemaProperty }) {
2673
2843
  borderRadius: 3,
2674
2844
  color: node.type === "string" ? "var(--vj-string, #ce9178)" : "var(--vj-number, #b5cea8)",
2675
2845
  fontFamily: "var(--vj-font, monospace)",
2676
- fontSize: 13,
2846
+ fontSize: "var(--vj-input-font-size, 13px)",
2677
2847
  padding: "2px 6px",
2678
2848
  flex: 1,
2679
2849
  textAlign: "right"
2680
2850
  }
2681
2851
  }
2682
- ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2852
+ ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2683
2853
  "span",
2684
2854
  {
2685
2855
  style: {
@@ -2692,7 +2862,7 @@ function PropertyRow({ node, schemaProperty }) {
2692
2862
  children: displayValue()
2693
2863
  }
2694
2864
  ),
2695
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2865
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2696
2866
  "div",
2697
2867
  {
2698
2868
  style: {
@@ -2703,7 +2873,7 @@ function PropertyRow({ node, schemaProperty }) {
2703
2873
  flexShrink: 0
2704
2874
  },
2705
2875
  children: [
2706
- isContainer && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2876
+ isContainer && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2707
2877
  "button",
2708
2878
  {
2709
2879
  onClick: handleAddChild,
@@ -2722,7 +2892,7 @@ function PropertyRow({ node, schemaProperty }) {
2722
2892
  children: "+"
2723
2893
  }
2724
2894
  ),
2725
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2895
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2726
2896
  "button",
2727
2897
  {
2728
2898
  onClick: handleRemove,
@@ -2747,7 +2917,7 @@ function PropertyRow({ node, schemaProperty }) {
2747
2917
  ]
2748
2918
  }
2749
2919
  ),
2750
- description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2920
+ description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2751
2921
  "div",
2752
2922
  {
2753
2923
  style: {
@@ -2767,7 +2937,7 @@ function PropertyRow({ node, schemaProperty }) {
2767
2937
  function PropertyEditor({ className }) {
2768
2938
  const { state, actions } = useStudio();
2769
2939
  const selectedNode = state.selectedNodeId ? state.tree.nodesById.get(state.selectedNodeId) : null;
2770
- const handleChangeType = (0, import_react10.useCallback)(
2940
+ const handleChangeType = (0, import_react11.useCallback)(
2771
2941
  (newType) => {
2772
2942
  if (!selectedNode) return;
2773
2943
  const newTree = (0, import_core5.changeType)(state.tree, selectedNode.id, newType);
@@ -2775,17 +2945,17 @@ function PropertyEditor({ className }) {
2775
2945
  },
2776
2946
  [state.tree, selectedNode, actions]
2777
2947
  );
2778
- const handleDuplicate = (0, import_react10.useCallback)(() => {
2948
+ const handleDuplicate = (0, import_react11.useCallback)(() => {
2779
2949
  if (!selectedNode) return;
2780
2950
  const newTree = (0, import_core5.duplicateNode)(state.tree, selectedNode.id);
2781
2951
  actions.setTree(newTree);
2782
2952
  }, [state.tree, selectedNode, actions]);
2783
- const handleCopyPath = (0, import_react10.useCallback)(() => {
2953
+ const handleCopyPath = (0, import_react11.useCallback)(() => {
2784
2954
  if (!selectedNode) return;
2785
2955
  navigator.clipboard.writeText(selectedNode.path).catch(() => {
2786
2956
  });
2787
2957
  }, [selectedNode]);
2788
- const handleCopyValue = (0, import_react10.useCallback)(() => {
2958
+ const handleCopyValue = (0, import_react11.useCallback)(() => {
2789
2959
  if (!selectedNode) return;
2790
2960
  const value = (0, import_core5.toJson)(selectedNode);
2791
2961
  const text = typeof value === "string" ? value : JSON.stringify(value, null, 2);
@@ -2793,7 +2963,7 @@ function PropertyEditor({ className }) {
2793
2963
  });
2794
2964
  }, [selectedNode]);
2795
2965
  if (!selectedNode) {
2796
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2966
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2797
2967
  "div",
2798
2968
  {
2799
2969
  className,
@@ -2826,7 +2996,7 @@ function PropertyEditor({ className }) {
2826
2996
  const newTree = (0, import_core5.addProperty)(state.tree, selectedNode.id, key, "");
2827
2997
  actions.setTree(newTree);
2828
2998
  }
2829
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2999
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2830
3000
  "div",
2831
3001
  {
2832
3002
  className,
@@ -2839,7 +3009,7 @@ function PropertyEditor({ className }) {
2839
3009
  flexDirection: "column"
2840
3010
  },
2841
3011
  children: [
2842
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
3012
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2843
3013
  "div",
2844
3014
  {
2845
3015
  style: {
@@ -2855,7 +3025,7 @@ function PropertyEditor({ className }) {
2855
3025
  backgroundColor: "var(--vj-bg-panel, #252526)"
2856
3026
  },
2857
3027
  children: [
2858
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
3028
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2859
3029
  "div",
2860
3030
  {
2861
3031
  style: {
@@ -2866,8 +3036,8 @@ function PropertyEditor({ className }) {
2866
3036
  minWidth: 0
2867
3037
  },
2868
3038
  children: [
2869
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Breadcrumbs, {}),
2870
- schemaTitle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3039
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Breadcrumbs, {}),
3040
+ schemaTitle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2871
3041
  "span",
2872
3042
  {
2873
3043
  style: { fontSize: 10, color: "var(--vj-text-dim, #666666)" },
@@ -2877,7 +3047,7 @@ function PropertyEditor({ className }) {
2877
3047
  ]
2878
3048
  }
2879
3049
  ),
2880
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
3050
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2881
3051
  "div",
2882
3052
  {
2883
3053
  style: {
@@ -2887,7 +3057,7 @@ function PropertyEditor({ className }) {
2887
3057
  flexShrink: 0
2888
3058
  },
2889
3059
  children: [
2890
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3060
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2891
3061
  "select",
2892
3062
  {
2893
3063
  value: selectedNode.type,
@@ -2897,16 +3067,16 @@ function PropertyEditor({ className }) {
2897
3067
  border: "1px solid var(--vj-input-border, #555555)",
2898
3068
  borderRadius: 3,
2899
3069
  color: "var(--vj-text, #cccccc)",
2900
- fontSize: 11,
3070
+ fontSize: "var(--vj-input-font-size, 13px)",
2901
3071
  fontFamily: "var(--vj-font, monospace)",
2902
3072
  padding: "1px 4px",
2903
3073
  cursor: "pointer"
2904
3074
  },
2905
3075
  title: "Change type",
2906
- children: ALL_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: t, children: t }, t))
3076
+ children: ALL_TYPES.map((t) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: t, children: t }, t))
2907
3077
  }
2908
3078
  ),
2909
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3079
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2910
3080
  "button",
2911
3081
  {
2912
3082
  onClick: handleCopyPath,
@@ -2915,7 +3085,7 @@ function PropertyEditor({ className }) {
2915
3085
  children: "path"
2916
3086
  }
2917
3087
  ),
2918
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3088
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2919
3089
  "button",
2920
3090
  {
2921
3091
  onClick: handleCopyValue,
@@ -2924,7 +3094,7 @@ function PropertyEditor({ className }) {
2924
3094
  children: "value"
2925
3095
  }
2926
3096
  ),
2927
- selectedNode.parentId && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3097
+ selectedNode.parentId && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2928
3098
  "button",
2929
3099
  {
2930
3100
  onClick: handleDuplicate,
@@ -2933,7 +3103,7 @@ function PropertyEditor({ className }) {
2933
3103
  children: "dup"
2934
3104
  }
2935
3105
  ),
2936
- isContainer && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3106
+ isContainer && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2937
3107
  "button",
2938
3108
  {
2939
3109
  onClick: handleAdd,
@@ -2950,14 +3120,14 @@ function PropertyEditor({ className }) {
2950
3120
  ]
2951
3121
  }
2952
3122
  ),
2953
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { flex: 1, overflow: "auto" }, children: isContainer ? selectedNode.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3123
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { flex: 1, overflow: "auto" }, children: isContainer ? selectedNode.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2954
3124
  PropertyRow,
2955
3125
  {
2956
3126
  node: child,
2957
3127
  schemaProperty: getChildSchema(child.key)
2958
3128
  },
2959
3129
  child.id
2960
- )) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PropertyRow, { node: selectedNode }) })
3130
+ )) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PropertyRow, { node: selectedNode }) })
2961
3131
  ]
2962
3132
  }
2963
3133
  );
@@ -2974,9 +3144,9 @@ var actionButtonStyle = {
2974
3144
  };
2975
3145
 
2976
3146
  // src/diff-view.tsx
2977
- var import_react11 = require("react");
3147
+ var import_react12 = require("react");
2978
3148
  var import_core6 = require("@visual-json/core");
2979
- var import_jsx_runtime9 = require("react/jsx-runtime");
3149
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2980
3150
  var DIFF_COLORS = {
2981
3151
  added: { bg: "#1e3a1e", marker: "+", label: "#4ec94e" },
2982
3152
  removed: { bg: "#3a1e1e", marker: "-", label: "#f48771" },
@@ -2997,7 +3167,7 @@ function formatValue(value) {
2997
3167
  }
2998
3168
  function DiffRow({ entry }) {
2999
3169
  const colors = DIFF_COLORS[entry.type];
3000
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3170
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3001
3171
  "div",
3002
3172
  {
3003
3173
  style: {
@@ -3011,7 +3181,7 @@ function DiffRow({ entry }) {
3011
3181
  gap: 8
3012
3182
  },
3013
3183
  children: [
3014
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3184
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3015
3185
  "span",
3016
3186
  {
3017
3187
  style: {
@@ -3024,7 +3194,7 @@ function DiffRow({ entry }) {
3024
3194
  children: colors.marker
3025
3195
  }
3026
3196
  ),
3027
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3197
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3028
3198
  "span",
3029
3199
  {
3030
3200
  style: {
@@ -3035,14 +3205,14 @@ function DiffRow({ entry }) {
3035
3205
  children: entry.path
3036
3206
  }
3037
3207
  ),
3038
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { flex: 1, display: "flex", gap: 8, overflow: "hidden" }, children: [
3039
- entry.type === "changed" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
3040
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "#f48771", textDecoration: "line-through" }, children: formatValue(entry.oldValue) }),
3041
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "var(--vj-text-dim, #666666)" }, children: "\u2192" }),
3042
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "#4ec94e" }, children: formatValue(entry.newValue) })
3208
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { flex: 1, display: "flex", gap: 8, overflow: "hidden" }, children: [
3209
+ entry.type === "changed" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
3210
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "#f48771", textDecoration: "line-through" }, children: formatValue(entry.oldValue) }),
3211
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "var(--vj-text-dim, #666666)" }, children: "\u2192" }),
3212
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "#4ec94e" }, children: formatValue(entry.newValue) })
3043
3213
  ] }),
3044
- entry.type === "added" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "#4ec94e" }, children: formatValue(entry.newValue) }),
3045
- entry.type === "removed" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "#f48771", textDecoration: "line-through" }, children: formatValue(entry.oldValue) })
3214
+ entry.type === "added" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "#4ec94e" }, children: formatValue(entry.newValue) }),
3215
+ entry.type === "removed" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "#f48771", textDecoration: "line-through" }, children: formatValue(entry.oldValue) })
3046
3216
  ] })
3047
3217
  ]
3048
3218
  }
@@ -3053,14 +3223,14 @@ function DiffView({
3053
3223
  currentJson,
3054
3224
  className
3055
3225
  }) {
3056
- const entries = (0, import_react11.useMemo)(
3226
+ const entries = (0, import_react12.useMemo)(
3057
3227
  () => (0, import_core6.computeDiff)(originalJson, currentJson),
3058
3228
  [originalJson, currentJson]
3059
3229
  );
3060
3230
  const added = entries.filter((e) => e.type === "added").length;
3061
3231
  const removed = entries.filter((e) => e.type === "removed").length;
3062
3232
  const changed = entries.filter((e) => e.type === "changed").length;
3063
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3233
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3064
3234
  "div",
3065
3235
  {
3066
3236
  className,
@@ -3073,7 +3243,7 @@ function DiffView({
3073
3243
  flexDirection: "column"
3074
3244
  },
3075
3245
  children: [
3076
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3246
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3077
3247
  "div",
3078
3248
  {
3079
3249
  style: {
@@ -3088,18 +3258,18 @@ function DiffView({
3088
3258
  flexShrink: 0
3089
3259
  },
3090
3260
  children: [
3091
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { color: "var(--vj-text-muted, #999999)" }, children: entries.length === 0 ? "No changes" : `${entries.length} changes` }),
3092
- added > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { color: "#4ec94e" }, children: [
3261
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { color: "var(--vj-text-muted, #999999)" }, children: entries.length === 0 ? "No changes" : `${entries.length} changes` }),
3262
+ added > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { color: "#4ec94e" }, children: [
3093
3263
  "+",
3094
3264
  added,
3095
3265
  " added"
3096
3266
  ] }),
3097
- removed > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { color: "#f48771" }, children: [
3267
+ removed > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { color: "#f48771" }, children: [
3098
3268
  "-",
3099
3269
  removed,
3100
3270
  " removed"
3101
3271
  ] }),
3102
- changed > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: { color: "#dcdcaa" }, children: [
3272
+ changed > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { color: "#dcdcaa" }, children: [
3103
3273
  "~",
3104
3274
  changed,
3105
3275
  " modified"
@@ -3107,7 +3277,7 @@ function DiffView({
3107
3277
  ]
3108
3278
  }
3109
3279
  ),
3110
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { flex: 1, overflow: "auto" }, children: entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3280
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { flex: 1, overflow: "auto" }, children: entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3111
3281
  "div",
3112
3282
  {
3113
3283
  style: {
@@ -3121,7 +3291,7 @@ function DiffView({
3121
3291
  },
3122
3292
  children: "No differences detected"
3123
3293
  }
3124
- ) : entries.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DiffRow, { entry }, i)) })
3294
+ ) : entries.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DiffRow, { entry }, i)) })
3125
3295
  ]
3126
3296
  }
3127
3297
  );