@ws-ui/http-handlers-editor 1.12.2 → 1.12.4

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.es.js CHANGED
@@ -23,15 +23,7 @@ const vt = "array", wt = { $ref: "#/definitions/HTTPHandler" }, Et = { Verb: { t
23
23
  label: e,
24
24
  Icon: n,
25
25
  onClick: t
26
- }) => /* @__PURE__ */ a(
27
- it,
28
- {
29
- label: e,
30
- Icon: n,
31
- as: "button",
32
- onClick: t
33
- }
34
- ), _e = Ne(
26
+ }) => /* @__PURE__ */ a(it, { label: e, Icon: n, as: "button", onClick: t }), _e = Ne(
35
27
  null
36
28
  ), Ct = ({ children: e, adapter: n }) => /* @__PURE__ */ a(_e.Provider, { value: n, children: e }), K = () => {
37
29
  const e = ie(_e);
@@ -71,15 +63,23 @@ function oe(e) {
71
63
  }
72
64
  function Oe(e) {
73
65
  return JSON.stringify(
74
- e.map(({ isExpanded: n, asRegex: t, pattern: r, regexPattern: i, ...o }) => {
75
- var p;
76
- const l = t ? { regexPattern: i } : { pattern: r };
77
- return {
78
- ...o,
79
- verbs: (p = o.verbs) == null ? void 0 : p.join(","),
80
- ...l
81
- };
82
- }),
66
+ e.map(
67
+ ({
68
+ isExpanded: n,
69
+ asRegex: t,
70
+ pattern: r,
71
+ regexPattern: i,
72
+ ...o
73
+ }) => {
74
+ var p;
75
+ const l = t ? { regexPattern: i } : { pattern: r };
76
+ return {
77
+ ...o,
78
+ verbs: (p = o.verbs) == null ? void 0 : p.join(","),
79
+ ...l
80
+ };
81
+ }
82
+ ),
83
83
  null,
84
84
  2
85
85
  );
@@ -519,7 +519,9 @@ function ke(e, n) {
519
519
  ...e,
520
520
  modals: {
521
521
  ...e.modals,
522
- list: e.modals.list.filter((t) => t.id !== n.payload)
522
+ list: e.modals.list.filter(
523
+ (t) => t.id !== n.payload
524
+ )
523
525
  }
524
526
  };
525
527
  case "CLOSE_MODAL": {
@@ -1414,39 +1416,63 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1414
1416
  }
1415
1417
  ),
1416
1418
  /* @__PURE__ */ f("div", { className: "flex items-center gap-0.5 px-2", children: [
1417
- /* @__PURE__ */ a(H, { label: "Duplicate Handler", className: "px-1 py-3", container: C(), children: /* @__PURE__ */ a(
1418
- "button",
1419
+ /* @__PURE__ */ a(
1420
+ H,
1419
1421
  {
1420
- "data-cy": "handler-row-duplicate-button",
1421
- className: D(
1422
- "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none opacity-50 cursor-not-allowed"
1423
- ),
1424
- children: /* @__PURE__ */ a(we, {})
1422
+ label: "Duplicate Handler",
1423
+ className: "px-1 py-3",
1424
+ container: C(),
1425
+ children: /* @__PURE__ */ a(
1426
+ "button",
1427
+ {
1428
+ "data-cy": "handler-row-duplicate-button",
1429
+ className: D(
1430
+ "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none opacity-50 cursor-not-allowed"
1431
+ ),
1432
+ children: /* @__PURE__ */ a(we, {})
1433
+ }
1434
+ )
1425
1435
  }
1426
- ) }),
1427
- /* @__PURE__ */ a(H, { label: "Confirm Changes", className: "px-1 py-3", container: C(), children: /* @__PURE__ */ a(
1428
- "button",
1436
+ ),
1437
+ /* @__PURE__ */ a(
1438
+ H,
1429
1439
  {
1430
- "data-cy": "handler-row-save-button",
1431
- className: D(
1432
- "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1440
+ label: "Confirm Changes",
1441
+ className: "px-1 py-3",
1442
+ container: C(),
1443
+ children: /* @__PURE__ */ a(
1444
+ "button",
1433
1445
  {
1434
- "opacity-50 cursor-not-allowed": !N()
1446
+ "data-cy": "handler-row-save-button",
1447
+ className: D(
1448
+ "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1449
+ {
1450
+ "opacity-50 cursor-not-allowed": !N()
1451
+ }
1452
+ ),
1453
+ onClick: O,
1454
+ children: /* @__PURE__ */ a(tt, {})
1435
1455
  }
1436
- ),
1437
- onClick: O,
1438
- children: /* @__PURE__ */ a(tt, {})
1456
+ )
1439
1457
  }
1440
- ) }),
1441
- /* @__PURE__ */ a(H, { label: "Cancel Changes", className: "px-1 py-3", container: C(), children: /* @__PURE__ */ a(
1442
- "button",
1458
+ ),
1459
+ /* @__PURE__ */ a(
1460
+ H,
1443
1461
  {
1444
- "data-cy": "handler-row-cancel-button",
1445
- className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1446
- onClick: S,
1447
- children: /* @__PURE__ */ a(nt, {})
1462
+ label: "Cancel Changes",
1463
+ className: "px-1 py-3",
1464
+ container: C(),
1465
+ children: /* @__PURE__ */ a(
1466
+ "button",
1467
+ {
1468
+ "data-cy": "handler-row-cancel-button",
1469
+ className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1470
+ onClick: S,
1471
+ children: /* @__PURE__ */ a(nt, {})
1472
+ }
1473
+ )
1448
1474
  }
1449
- ) })
1475
+ )
1450
1476
  ] })
1451
1477
  ] })
1452
1478
  ] });
@@ -1573,48 +1599,73 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1573
1599
  /* @__PURE__ */ f("div", { className: "flex flex-1 items-center", children: [
1574
1600
  /* @__PURE__ */ a("div", { className: "text-s w-full", children: i.length ? i.join(",") : /* @__PURE__ */ a("span", { className: "text-grey-200 italic", children: "undefined" }) }),
1575
1601
  /* @__PURE__ */ f("div", { className: "flex items-center gap-0.5 px-2", children: [
1576
- /* @__PURE__ */ a(H, { label: "Duplicate Handler", className: "px-1 py-3", container: C(), children: /* @__PURE__ */ a(
1577
- "button",
1602
+ /* @__PURE__ */ a(
1603
+ H,
1578
1604
  {
1579
- "data-cy": "handler-row-duplicate-button",
1580
- className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1581
- onClick: () => v.actions.duplicateHandler(e),
1582
- children: /* @__PURE__ */ a(we, {})
1605
+ label: "Duplicate Handler",
1606
+ className: "px-1 py-3",
1607
+ container: C(),
1608
+ children: /* @__PURE__ */ a(
1609
+ "button",
1610
+ {
1611
+ "data-cy": "handler-row-duplicate-button",
1612
+ className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1613
+ onClick: () => v.actions.duplicateHandler(e),
1614
+ children: /* @__PURE__ */ a(we, {})
1615
+ }
1616
+ )
1583
1617
  }
1584
- ) }),
1585
- /* @__PURE__ */ a(H, { label: "Edit Handler", className: "px-1 py-3", container: C(), children: /* @__PURE__ */ a(
1586
- "button",
1618
+ ),
1619
+ /* @__PURE__ */ a(
1620
+ H,
1587
1621
  {
1588
- "data-cy": "handler-row-edit-button",
1589
- className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1590
- onClick: () => {
1591
- G.next(g), v.actions.setEditingHandler(e);
1592
- },
1593
- children: /* @__PURE__ */ a(Ze, {})
1622
+ label: "Edit Handler",
1623
+ className: "px-1 py-3",
1624
+ container: C(),
1625
+ children: /* @__PURE__ */ a(
1626
+ "button",
1627
+ {
1628
+ "data-cy": "handler-row-edit-button",
1629
+ className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1630
+ onClick: () => {
1631
+ G.next(g), v.actions.setEditingHandler(e);
1632
+ },
1633
+ children: /* @__PURE__ */ a(Ze, {})
1634
+ }
1635
+ )
1594
1636
  }
1595
- ) }),
1596
- /* @__PURE__ */ a(H, { label: "Delete Handler", className: "px-1 py-3", placement: "top-end", container: C(), children: /* @__PURE__ */ a(
1597
- "button",
1637
+ ),
1638
+ /* @__PURE__ */ a(
1639
+ H,
1598
1640
  {
1599
- "data-cy": "handler-row-delete-button",
1600
- className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1601
- onClick: async () => {
1602
- if (v.getHost() === "vscode") {
1603
- v.actions.deleteHandler(e);
1604
- return;
1641
+ label: "Delete Handler",
1642
+ className: "px-1 py-3",
1643
+ placement: "top-end",
1644
+ container: C(),
1645
+ children: /* @__PURE__ */ a(
1646
+ "button",
1647
+ {
1648
+ "data-cy": "handler-row-delete-button",
1649
+ className: "hover:bg-primary-hover rounded p-1 text-gray-100 hover:text-white active:outline-none",
1650
+ onClick: async () => {
1651
+ if (v.getHost() === "vscode") {
1652
+ v.actions.deleteHandler(e);
1653
+ return;
1654
+ }
1655
+ const { confirmed: d } = await v.actions.openModal({
1656
+ title: "Delete Handler",
1657
+ type: q.CONFIRM,
1658
+ color: Te.DANGER,
1659
+ message: "Are you sure you want to remove this Handler?",
1660
+ icon: "FdWarningDanger"
1661
+ });
1662
+ d && v.actions.deleteHandler(e);
1663
+ },
1664
+ children: /* @__PURE__ */ a(et, {})
1605
1665
  }
1606
- const { confirmed: d } = await v.actions.openModal({
1607
- title: "Delete Handler",
1608
- type: q.CONFIRM,
1609
- color: Te.DANGER,
1610
- message: "Are you sure you want to remove this Handler?",
1611
- icon: "FdWarningDanger"
1612
- });
1613
- d && v.actions.deleteHandler(e);
1614
- },
1615
- children: /* @__PURE__ */ a(et, {})
1666
+ )
1616
1667
  }
1617
- ) })
1668
+ )
1618
1669
  ] })
1619
1670
  ] })
1620
1671
  ]
@@ -1806,7 +1857,10 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1806
1857
  try {
1807
1858
  n(o);
1808
1859
  } catch (l) {
1809
- console.error("[HTTP Handlers Editor Standalone] Error on value stringify:", l);
1860
+ console.error(
1861
+ "[HTTP Handlers Editor Standalone] Error on value stringify:",
1862
+ l
1863
+ );
1810
1864
  }
1811
1865
  }, [n, o]), /* @__PURE__ */ f(j, { children: [
1812
1866
  /* @__PURE__ */ a("div", { className: "h-screen bg-grey-900", children: /* @__PURE__ */ a(Kt, {}) }),
@@ -1820,7 +1874,15 @@ pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white ring-0
1820
1874
  catalog: n,
1821
1875
  host: t = "vscode",
1822
1876
  ...r
1823
- }) => /* @__PURE__ */ a($t, { content: e, catalog: n, host: t, children: /* @__PURE__ */ a(Jt, { ...r }) });
1877
+ }) => /* @__PURE__ */ a(
1878
+ $t,
1879
+ {
1880
+ content: e,
1881
+ catalog: n,
1882
+ host: t,
1883
+ children: /* @__PURE__ */ a(Jt, { ...r })
1884
+ }
1885
+ );
1824
1886
  export {
1825
1887
  G as $handlerSubject,
1826
1888
  Ct as EditorStateAdapterProvider,