@w6w/embed 0.2.21 → 0.2.22

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.
@@ -1,16 +1,16 @@
1
1
  import { jsx as n, jsxs as r, Fragment as j } from "react/jsx-runtime";
2
2
  import { r as Cn, l as je, m as Ve, d as De, e as En, h as Oe, c as An } from "./import-bindings-EUtxZ9Ti.js";
3
3
  import { useContext as ve, useState as u, useMemo as Qe, useEffect as be, createContext as We, useRef as Fe } from "react";
4
- import { ExpressionOptionsProvider as He, Icon as K, RetryPolicyFields as Pn, StepBuilderModal as In, IconButton as we, useEnterSubmit as Tn, CodeBlock as pe, DeleteButton as Dn, EditButton as On, ConfirmModal as Re, JsonEditor as Rn, useExpressionOptions as Mn, ExpressionInput as Ln, ResultViewer as jn } from "@w6w/ui";
4
+ import { ExpressionOptionsProvider as He, Icon as q, RetryPolicyFields as Pn, StepBuilderModal as In, IconButton as we, useEnterSubmit as Tn, CodeBlock as pe, DeleteButton as Dn, EditButton as On, ConfirmModal as Re, JsonEditor as Rn, useExpressionOptions as Mn, ExpressionInput as Ln, ResultViewer as jn } from "@w6w/ui";
5
5
  import { d as Vn, p as Qn, i as Wn, t as Fn, e as Me, a as Hn, h as $n, s as Bn } from "./document-sources-DNmBojx6.js";
6
- import { u as Jn, g as qn, d as Kn, a as Un, f as $e, h as Be, b as Je, e as qe } from "./spec-export-DGigBUsP.js";
6
+ import { u as Jn, g as Kn, d as qn, a as Un, f as $e, h as Be, b as Je, e as Ke } from "./spec-export-DGigBUsP.js";
7
7
  import { i as _n, f as zn, e as Gn, b as Yn, u as Zn } from "./vault-BSEWhMYC.js";
8
8
  import { k as Xn } from "./spec-import-SWOonsNr.js";
9
- import { s as xn, M as q, b as et, C as nt } from "./ConfirmModal-Pv2-A_3U.js";
9
+ import { s as xn, M as K, b as et, C as nt } from "./ConfirmModal-Pv2-A_3U.js";
10
10
  import { u as tt, i as it, f as st } from "./slug-BVdgiP_L.js";
11
11
  import { WorkflowConnectionsPanel as at } from "@w6w/ui/flow";
12
12
  import { ApiError as L } from "@w6w/sdk";
13
- import { i as rt, p as Ke, c as Ue, d as ot } from "./settings-rail--GdRMusb.js";
13
+ import { i as rt, p as qe, c as Ue, d as ot } from "./settings-rail--GdRMusb.js";
14
14
  import { w as _e, v as ze, y as Ge, x as Ye, b as Ze, d as lt, f as dt, h as ct, u as ut, t as ht, s as ft, r as mt, q as gt } from "./endpoints-DSRo1Lc5.js";
15
15
  import { a1 as Xe, a0 as pt, _ as vt, P as bt, U as yt, a3 as kt, Z as wt, V as Nt, X as St, K as Ct, I as Et } from "./workflows-BK6IM4if.js";
16
16
  import { I as xe } from "./ImportSpecModal-Cpzp8ndt.js";
@@ -185,17 +185,17 @@ function Rt({ ctx: e }) {
185
185
  "aria-label": `Show the ${c} snippet`,
186
186
  onClick: () => i(o),
187
187
  children: [
188
- /* @__PURE__ */ n(K, { name: h, size: 20 }),
188
+ /* @__PURE__ */ n(q, { name: h, size: 20 }),
189
189
  /* @__PURE__ */ n("span", { children: c })
190
190
  ]
191
191
  },
192
192
  o
193
193
  )) }),
194
- t !== null && /* @__PURE__ */ n(q, { title: "Call from code", wide: !0, onClose: () => i(null), children: /* @__PURE__ */ n("div", { style: { height: 450 }, children: /* @__PURE__ */ n(et, { resource: s, triggers: a, initialTab: t }) }) })
194
+ t !== null && /* @__PURE__ */ n(K, { title: "Call from code", wide: !0, onClose: () => i(null), children: /* @__PURE__ */ n("div", { style: { height: 450 }, children: /* @__PURE__ */ n(et, { resource: s, triggers: a, initialTab: t }) }) })
195
195
  ] });
196
196
  }
197
197
  function Mt() {
198
- return /* @__PURE__ */ n(K, { name: "code" });
198
+ return /* @__PURE__ */ n(q, { name: "code" });
199
199
  }
200
200
  const Lt = {
201
201
  id: "code",
@@ -207,7 +207,7 @@ const Lt = {
207
207
  id: "connections",
208
208
  title: "Connections",
209
209
  rendersHeading: !0,
210
- Icon: () => /* @__PURE__ */ n(K, { name: "plug" }),
210
+ Icon: () => /* @__PURE__ */ n(q, { name: "plug" }),
211
211
  isAvailable: (e) => (e == null ? void 0 : e.kind) === "workflow" && !!e.connectionResources,
212
212
  hasIndicator: (e) => {
213
213
  var t;
@@ -363,7 +363,7 @@ function Ft({ ctx: e }) {
363
363
  {
364
364
  kind: e.kind,
365
365
  id: e.id,
366
- policy: t ? Ke(t) : {},
366
+ policy: t ? qe(t) : {},
367
367
  ready: !!i,
368
368
  saving: !1,
369
369
  onPersist: (s) => i == null ? void 0 : i(s)
@@ -377,7 +377,7 @@ function Ht({ id: e, kind: t }) {
377
377
  {
378
378
  kind: t,
379
379
  id: e,
380
- policy: o ? Ke(o.definition) : {},
380
+ policy: o ? qe(o.definition) : {},
381
381
  ready: !!o,
382
382
  saving: c,
383
383
  onPersist: (h, d) => {
@@ -397,7 +397,7 @@ function $t({ ctx: e }) {
397
397
  return (e == null ? void 0 : e.kind) !== "workflow" && (e == null ? void 0 : e.kind) !== "function" && (e == null ? void 0 : e.kind) !== "endpoint" ? null : e.kind === "workflow" || typeof e.onPolicyChange == "function" ? /* @__PURE__ */ n(Ft, { ctx: e }) : /* @__PURE__ */ n(Ht, { id: e.id, kind: e.kind });
398
398
  }
399
399
  function Bt() {
400
- return /* @__PURE__ */ n(K, { name: "warning" });
400
+ return /* @__PURE__ */ n(q, { name: "warning" });
401
401
  }
402
402
  const Jt = {
403
403
  id: "error-handling",
@@ -405,17 +405,17 @@ const Jt = {
405
405
  Icon: Bt,
406
406
  isAvailable: (e) => rt(e),
407
407
  Panel: $t
408
- }, qt = {
408
+ }, Kt = {
409
409
  id: "history",
410
410
  title: "Execution history",
411
- Icon: () => /* @__PURE__ */ n(K, { name: "history" }),
411
+ Icon: () => /* @__PURE__ */ n(q, { name: "history" }),
412
412
  isAvailable: (e) => (e == null ? void 0 : e.kind) === "workflow" && !!e.onOpenHistory,
413
413
  onActivate: (e) => {
414
414
  var t;
415
415
  (e == null ? void 0 : e.kind) === "workflow" && ((t = e.onOpenHistory) == null || t.call(e));
416
416
  }
417
417
  };
418
- function Kt(e, t) {
418
+ function qt(e, t) {
419
419
  if (!t.includes(",")) return { tags: e, typed: t };
420
420
  let i = e;
421
421
  for (const s of t.split(",")) {
@@ -430,7 +430,7 @@ function Ut(e, t) {
430
430
  function _t({ tags: e, onChange: t }) {
431
431
  const [i, s] = u("");
432
432
  function a(l) {
433
- const o = Kt(e, l);
433
+ const o = qt(e, l);
434
434
  s(o.typed), o.tags !== e && t(o.tags);
435
435
  }
436
436
  return /* @__PURE__ */ r("div", { className: "tag-list", "data-testid": "tag-editor", children: [
@@ -478,7 +478,7 @@ function rn(e) {
478
478
  }
479
479
  }
480
480
  const V = Tn(M, { enabled: y });
481
- return /* @__PURE__ */ r(q, { title: "Edit settings", onClose: e.onClose, children: [
481
+ return /* @__PURE__ */ r(K, { title: "Edit settings", onClose: e.onClose, children: [
482
482
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
483
483
  /* @__PURE__ */ r("label", { className: "field", children: [
484
484
  /* @__PURE__ */ n("span", { children: "Name" }),
@@ -550,9 +550,9 @@ const zt = {
550
550
  }
551
551
  };
552
552
  function on(e) {
553
- const { kind: t, id: i, versionNumber: s } = e, a = zt[t], l = qn(t, i, s, !0), o = Kn(t), c = Un(t), [h, d] = u(!1), [v, b] = u(null);
553
+ const { kind: t, id: i, versionNumber: s } = e, a = zt[t], l = Kn(t, i, s, !0), o = qn(t), c = Un(t), [h, d] = u(!1), [v, b] = u(null);
554
554
  return /* @__PURE__ */ r(j, { children: [
555
- /* @__PURE__ */ r(q, { title: `Version ${s}`, onClose: e.onClose, wide: !0, children: [
555
+ /* @__PURE__ */ r(K, { title: `Version ${s}`, onClose: e.onClose, wide: !0, children: [
556
556
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
557
557
  l.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : l.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": a.error, children: l.error instanceof Error ? l.error.message : String(l.error) }) : l.data ? /* @__PURE__ */ n("div", { "data-testid": a.json, children: /* @__PURE__ */ n(
558
558
  pe,
@@ -721,7 +721,7 @@ function cn(e) {
721
721
  }
722
722
  function un(e) {
723
723
  const { kind: t, children: i, onImport: s, onClose: a } = e;
724
- return /* @__PURE__ */ r(q, { title: "Definition", onClose: a, children: [
724
+ return /* @__PURE__ */ r(K, { title: "Definition", onClose: a, children: [
725
725
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
726
726
  i,
727
727
  /* @__PURE__ */ r("p", { className: "muted small", children: [
@@ -762,7 +762,7 @@ function hn(e) {
762
762
  title: "Version history",
763
763
  onClick: e.onShow,
764
764
  children: [
765
- /* @__PURE__ */ n(K, { name: "clock", size: 14 }),
765
+ /* @__PURE__ */ n(q, { name: "clock", size: 14 }),
766
766
  /* @__PURE__ */ n("span", { children: "Version history" })
767
767
  ]
768
768
  }
@@ -801,7 +801,7 @@ function hn(e) {
801
801
  }
802
802
  function fn(e) {
803
803
  const { loading: t, versions: i } = e;
804
- return /* @__PURE__ */ r(q, { title: "All versions", onClose: e.onClose, wide: !0, children: [
804
+ return /* @__PURE__ */ r(K, { title: "All versions", onClose: e.onClose, wide: !0, children: [
805
805
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
806
806
  t && /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }),
807
807
  (i == null ? void 0 : i.length) === 0 && /* @__PURE__ */ n("p", { className: "muted small", children: "No versions yet." }),
@@ -913,7 +913,7 @@ function Zt({
913
913
  setHistoryOpen: c,
914
914
  versionListOpen: h,
915
915
  setVersionListOpen: d
916
- } = s, v = Xe(t ?? void 0), b = (e == null ? void 0 : e.kind) === "workflow", m = (e == null ? void 0 : e.id) ?? "", C = pt(m, b), k = vt(t ?? void 0), D = bt(), O = yt(), E = Fe(!1), [R, y] = u(!1), [M, V] = u(!1), [N, p] = u(!1), [P, $] = u(!1), [U, Q] = u(!1), [W, re] = u(null), [_, oe] = u(null), F = $e(je("workflow"), m, N), z = Be("workflow", m, o && b), ne = Je("workflow"), le = qe("workflow"), [ke, G] = u(null), [te, de] = u(null), [ie, ce] = u(
916
+ } = s, v = Xe(t ?? void 0), b = (e == null ? void 0 : e.kind) === "workflow", m = (e == null ? void 0 : e.id) ?? "", C = pt(m, b), k = vt(t ?? void 0), D = bt(), O = yt(), E = Fe(!1), [R, y] = u(!1), [M, V] = u(!1), [N, p] = u(!1), [P, $] = u(!1), [U, Q] = u(!1), [W, re] = u(null), [_, oe] = u(null), F = $e(je("workflow"), m, N), z = Be("workflow", m, o && b), ne = Je("workflow"), le = Ke("workflow"), [ke, G] = u(null), [te, de] = u(null), [ie, ce] = u(
917
917
  null
918
918
  );
919
919
  if (!e || e.kind !== "workflow")
@@ -1060,7 +1060,7 @@ function Zt({
1060
1060
  ]
1061
1061
  }
1062
1062
  ),
1063
- N && /* @__PURE__ */ r(q, { title: "Export spec document", onClose: () => p(!1), wide: !0, children: [
1063
+ N && /* @__PURE__ */ r(K, { title: "Export spec document", onClose: () => p(!1), wide: !0, children: [
1064
1064
  /* @__PURE__ */ n("div", { className: "modal-body", children: F.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : F.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-spec-error", children: F.error instanceof Error ? F.error.message : String(F.error) }) : F.data ? /* @__PURE__ */ n("div", { "data-testid": "rail-spec-json", children: /* @__PURE__ */ n(
1065
1065
  pe,
1066
1066
  {
@@ -1155,7 +1155,7 @@ function xt({
1155
1155
  setHistoryOpen: c,
1156
1156
  versionListOpen: h,
1157
1157
  setVersionListOpen: d
1158
- } = s, v = e == null ? void 0 : e.kind, b = ut(v === "endpoint"), m = Ze(v === "function"), [C, k] = u(!1), [D, O] = u(""), [E, R] = u(null), [y, M] = u(null), [V, N] = u(!1), [p, P] = u(!1), [$, U] = u(!1), [Q, W] = u(!1), [re, _] = u(!1), [oe, F] = u(null), [z, ne] = u(null), le = _e((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = ze((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), G = Ge(), te = Ye(), de = ht(), ie = ft(), ce = mt(), I = gt(), ue = e ? je(e.kind) : null, H = $e(ue, (e == null ? void 0 : e.id) ?? "", p), Y = e && De(e.kind) ? e.kind : null, Z = Be(Y, (e == null ? void 0 : e.id) ?? "", o), he = Je(Y ?? "function"), se = qe(Y ?? "function"), [fe, f] = u(null), [A, me] = u(null), [ae, X] = u(
1158
+ } = s, v = e == null ? void 0 : e.kind, b = ut(v === "endpoint"), m = Ze(v === "function"), [C, k] = u(!1), [D, O] = u(""), [E, R] = u(null), [y, M] = u(null), [V, N] = u(!1), [p, P] = u(!1), [$, U] = u(!1), [Q, W] = u(!1), [re, _] = u(!1), [oe, F] = u(null), [z, ne] = u(null), le = _e((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = ze((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), G = Ge(), te = Ye(), de = ht(), ie = ft(), ce = mt(), I = gt(), ue = e ? je(e.kind) : null, H = $e(ue, (e == null ? void 0 : e.id) ?? "", p), Y = e && De(e.kind) ? e.kind : null, Z = Be(Y, (e == null ? void 0 : e.id) ?? "", o), he = Je(Y ?? "function"), se = Ke(Y ?? "function"), [fe, f] = u(null), [A, me] = u(null), [ae, X] = u(
1159
1159
  null
1160
1160
  );
1161
1161
  if (!e || e.kind !== "function" && e.kind !== "endpoint")
@@ -1296,7 +1296,7 @@ function xt({
1296
1296
  ] })
1297
1297
  }
1298
1298
  ),
1299
- p && /* @__PURE__ */ r(q, { title: "Export spec document", onClose: () => P(!1), wide: !0, children: [
1299
+ p && /* @__PURE__ */ r(K, { title: "Export spec document", onClose: () => P(!1), wide: !0, children: [
1300
1300
  /* @__PURE__ */ n("div", { className: "modal-body", children: H.isLoading ? /* @__PURE__ */ n("p", { className: "muted small", children: "Loading…" }) : H.isError ? /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-spec-error", children: H.error instanceof Error ? H.error.message : String(H.error) }) : H.data ? /* @__PURE__ */ n("div", { "data-testid": "rail-spec-json", children: /* @__PURE__ */ n(
1301
1301
  pe,
1302
1302
  {
@@ -1308,7 +1308,7 @@ function xt({
1308
1308
  ) }) : null }),
1309
1309
  /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => P(!1), children: "Close" }) })
1310
1310
  ] }),
1311
- C && /* @__PURE__ */ r(q, { title: "Edit definition", onClose: () => k(!1), wide: !0, children: [
1311
+ C && /* @__PURE__ */ r(K, { title: "Edit definition", onClose: () => k(!1), wide: !0, children: [
1312
1312
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
1313
1313
  /* @__PURE__ */ n(
1314
1314
  Rn,
@@ -1393,7 +1393,7 @@ function xt({
1393
1393
  ] });
1394
1394
  }
1395
1395
  function ei() {
1396
- return /* @__PURE__ */ n(K, { name: "settings" });
1396
+ return /* @__PURE__ */ n(q, { name: "settings" });
1397
1397
  }
1398
1398
  const ni = {
1399
1399
  id: "settings",
@@ -1428,6 +1428,12 @@ function ii({
1428
1428
  /* @__PURE__ */ n("span", { className: "muted small", children: e.length === 0 ? "No variables declared." : `${e.length} variable${e.length === 1 ? "" : "s"} declared.` }),
1429
1429
  /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: s, children: "+ Add variable" })
1430
1430
  ] }),
1431
+ e.length > 0 && /* @__PURE__ */ r("div", { className: "workflow-variable-head", "aria-hidden": "true", children: [
1432
+ /* @__PURE__ */ n("span", { children: "Key" }),
1433
+ /* @__PURE__ */ n("span", { children: "Type" }),
1434
+ /* @__PURE__ */ n("span", {}),
1435
+ /* @__PURE__ */ n("span", {})
1436
+ ] }),
1431
1437
  e.length > 0 && /* @__PURE__ */ n("ul", { className: "list", "data-testid": "workflow-variables-list", children: e.map((c, h) => /* @__PURE__ */ r(
1432
1438
  "li",
1433
1439
  {
@@ -1473,6 +1479,18 @@ function ii({
1473
1479
  ),
1474
1480
  /* @__PURE__ */ n("span", { className: "muted small", children: "required" })
1475
1481
  ] }),
1482
+ /* @__PURE__ */ n(
1483
+ we,
1484
+ {
1485
+ danger: !0,
1486
+ icon: "close",
1487
+ label: `Remove variable ${c.key || h + 1}`,
1488
+ onClick: () => l(h)
1489
+ }
1490
+ )
1491
+ ] }),
1492
+ /* @__PURE__ */ r("div", { className: "workflow-variable-default", children: [
1493
+ /* @__PURE__ */ n("span", { className: "muted small", children: "Default" }),
1476
1494
  /* @__PURE__ */ n(
1477
1495
  He,
1478
1496
  {
@@ -1488,15 +1506,6 @@ function ii({
1488
1506
  `${e.length}:${h}`
1489
1507
  )
1490
1508
  }
1491
- ),
1492
- /* @__PURE__ */ n(
1493
- we,
1494
- {
1495
- danger: !0,
1496
- icon: "close",
1497
- label: `Remove variable ${c.key || h + 1}`,
1498
- onClick: () => l(h)
1499
- }
1500
1509
  )
1501
1510
  ] }),
1502
1511
  o.includes(h) && /* @__PURE__ */ n("span", { className: "muted small", "data-testid": "variable-duplicate", children: "Duplicate key — a later row with the same name wins." })
@@ -1547,7 +1556,7 @@ function li(e) {
1547
1556
  return (e == null ? void 0 : e.kind) === "workflow" ? e.onOpenStartingState : void 0;
1548
1557
  }
1549
1558
  function di() {
1550
- return /* @__PURE__ */ n(K, { name: "database" });
1559
+ return /* @__PURE__ */ n(q, { name: "database" });
1551
1560
  }
1552
1561
  function ci({ ctx: e }) {
1553
1562
  var k, D, O, E, R;
@@ -1666,7 +1675,7 @@ const fi = {
1666
1675
  Jt,
1667
1676
  fi,
1668
1677
  jt,
1669
- qt
1678
+ Kt
1670
1679
  ];
1671
1680
  export {
1672
1681
  Qt as C,
@@ -1680,4 +1689,4 @@ export {
1680
1689
  Wi as e,
1681
1690
  It as u
1682
1691
  };
1683
- //# sourceMappingURL=editor-tools-j3ThBY_4.js.map
1692
+ //# sourceMappingURL=editor-tools-DHyWiG21.js.map