@pb33f/cowboy-components 0.12.2 → 0.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.
Files changed (68) hide show
  1. package/dist/{_basePickBy-DzbyLhrS.js → _basePickBy-COKEx4fd.js} +2 -2
  2. package/dist/{_baseUniq-BaMlJaXC.js → _baseUniq-CY2TCqsW.js} +1 -1
  3. package/dist/{arc-CwbDNuoS.js → arc-1GmSMwko.js} +1 -1
  4. package/dist/{architecture-U656AL7Q-hA_jODHW.js → architecture-U656AL7Q-64gaAy5D.js} +1 -1
  5. package/dist/{architectureDiagram-VXUJARFQ-BpOZDfV2.js → architectureDiagram-VXUJARFQ-dtzpCVJq.js} +3 -3
  6. package/dist/{blockDiagram-VD42YOAC-DvwLmxQa.js → blockDiagram-VD42YOAC-CmYglT7q.js} +5 -5
  7. package/dist/{c4Diagram-YG6GDRKO-I84KTC03.js → c4Diagram-YG6GDRKO-i32h6Nz4.js} +2 -2
  8. package/dist/{channel-Czyy2YF7.js → channel-zdPt9PFb.js} +1 -1
  9. package/dist/{chunk-4BX2VUAB-Cax8rgH-.js → chunk-4BX2VUAB-S3Ahg-_D.js} +1 -1
  10. package/dist/{chunk-55IACEB6-CrdTf2pk.js → chunk-55IACEB6-DvHnMqsW.js} +1 -1
  11. package/dist/{chunk-B4BG7PRW-DVw-G-FD.js → chunk-B4BG7PRW-B1VKBkeM.js} +4 -4
  12. package/dist/{chunk-DI55MBZ5-_nf_Thmu.js → chunk-DI55MBZ5-BBdFd8hK.js} +3 -3
  13. package/dist/{chunk-FMBD7UC4-DpzzxPYV.js → chunk-FMBD7UC4-Dy-fIu1M.js} +1 -1
  14. package/dist/{chunk-QN33PNHL-BOcC9xla.js → chunk-QN33PNHL-m_pIkwiq.js} +1 -1
  15. package/dist/{chunk-QZHKN3VN-CmrJpkO9.js → chunk-QZHKN3VN-CFY5v57S.js} +1 -1
  16. package/dist/{chunk-TZMSLE5B-Dsr5RxRa.js → chunk-TZMSLE5B-K0FCeysy.js} +1 -1
  17. package/dist/{classDiagram-v2-WZHVMYZB-vUMqQti2.js → classDiagram-2ON5EDUG-6WHnTaOM.js} +2 -2
  18. package/dist/{classDiagram-2ON5EDUG-vUMqQti2.js → classDiagram-v2-WZHVMYZB-6WHnTaOM.js} +2 -2
  19. package/dist/{clone-CAtTIGp5.js → clone-BScqNVH4.js} +1 -1
  20. package/dist/components/details-drawer/generic-details-drawer.css.js +15 -1
  21. package/dist/components/the-doctor/the-doctor.js +2 -0
  22. package/dist/components/the-doctor/upload-archive.d.ts +15 -0
  23. package/dist/components/the-doctor/upload-archive.js +159 -67
  24. package/dist/{cose-bilkent-S5V4N54A-BEwcesj_.js → cose-bilkent-S5V4N54A-4n1zhWpT.js} +1 -1
  25. package/dist/{cowboy-components-Cusus7mi.js → cowboy-components-wWvUFB6N.js} +3255 -3191
  26. package/dist/cowboy-components.css +1 -1
  27. package/dist/cowboy-components.umd.cjs +492 -471
  28. package/dist/css/pb33f-theme.css +7 -0
  29. package/dist/css/prism.css.js +2 -2
  30. package/dist/{dagre-6UL2VRFP-BEKeghI5.js → dagre-6UL2VRFP-DQ2dicRY.js} +6 -6
  31. package/dist/{diagram-PSM6KHXK-CT125TLP.js → diagram-PSM6KHXK-BTbhifey.js} +4 -4
  32. package/dist/{diagram-QEK2KX5R-BsqdENWm.js → diagram-QEK2KX5R-DEr-EDtH.js} +3 -3
  33. package/dist/{diagram-S2PKOQOG-DePyu16g.js → diagram-S2PKOQOG-CP3qZh9v.js} +3 -3
  34. package/dist/{erDiagram-Q2GNP2WA-BjO3hLOb.js → erDiagram-Q2GNP2WA-z86Qh8z9.js} +4 -4
  35. package/dist/{flowDiagram-NV44I4VS-DBFku48N.js → flowDiagram-NV44I4VS-CPv6OZWp.js} +5 -5
  36. package/dist/{ganttDiagram-LVOFAZNH-X0DmX_SW.js → ganttDiagram-LVOFAZNH-BVOpjuSv.js} +2 -2
  37. package/dist/{gitGraph-F6HP7TQM-BgJEyqnq.js → gitGraph-F6HP7TQM-Bnl268Qm.js} +1 -1
  38. package/dist/{gitGraphDiagram-NY62KEGX-C0pwARlH.js → gitGraphDiagram-NY62KEGX-BAch-dDq.js} +4 -4
  39. package/dist/{graph-DeER36N7.js → graph-COhVMYEY.js} +2 -2
  40. package/dist/info-NVLQJR56-GhxvVvwm.js +5 -0
  41. package/dist/{infoDiagram-F6ZHWCRC-CZA94P9L.js → infoDiagram-F6ZHWCRC-IhPtAv4N.js} +2 -2
  42. package/dist/{journeyDiagram-XKPGCS4Q-lxw2t8ny.js → journeyDiagram-XKPGCS4Q-kSjfwydA.js} +4 -4
  43. package/dist/{kanban-definition-3W4ZIXB7-uVaoSOMg.js → kanban-definition-3W4ZIXB7-DWHThky4.js} +2 -2
  44. package/dist/{layout-DnK6hXfH.js → layout-DYnIru8r.js} +4 -4
  45. package/dist/{linear-B0IEARL2.js → linear-LTuHFQQU.js} +1 -1
  46. package/dist/{mermaid-parser.core-BWH1OLmB.js → mermaid-parser.core-BOHrQYc5.js} +11 -11
  47. package/dist/{mindmap-definition-VGOIOE7T-6Txj5nPI.js → mindmap-definition-VGOIOE7T-DEEj5EOo.js} +3 -3
  48. package/dist/model/task.d.ts +2 -1
  49. package/dist/model/task.js +1 -0
  50. package/dist/{packet-BFZMPI3H-DgmYD-C1.js → packet-BFZMPI3H-BaMvJQlE.js} +1 -1
  51. package/dist/pie-7BOR55EZ-DqoAq2G4.js +5 -0
  52. package/dist/{pieDiagram-ADFJNKIX-IUOdZwUm.js → pieDiagram-ADFJNKIX-C4CYE-c9.js} +4 -4
  53. package/dist/{quadrantDiagram-AYHSOK5B-DdyAmAVM.js → quadrantDiagram-AYHSOK5B-CDA-m8OO.js} +2 -2
  54. package/dist/radar-NHE76QYJ-D7DiLDQH.js +5 -0
  55. package/dist/{requirementDiagram-UZGBJVZJ-CZMqFmBI.js → requirementDiagram-UZGBJVZJ-D9QaRWXK.js} +3 -3
  56. package/dist/{sankeyDiagram-TZEHDZUN-BN7hCyWq.js → sankeyDiagram-TZEHDZUN-RJcWGCam.js} +1 -1
  57. package/dist/{sequenceDiagram-WL72ISMW-D6__7664.js → sequenceDiagram-WL72ISMW-v3Rc9JSF.js} +3 -3
  58. package/dist/services/model-service.d.ts +1 -1
  59. package/dist/services/model-service.js +5 -4
  60. package/dist/{stateDiagram-FKZM4ZOC-DcpsDD6g.js → stateDiagram-FKZM4ZOC-Y2D-1dO7.js} +4 -4
  61. package/dist/{stateDiagram-v2-4FDKWEC3-B4SCFl2k.js → stateDiagram-v2-4FDKWEC3-DUtLuhlw.js} +2 -2
  62. package/dist/{timeline-definition-IT6M3QCI-Bhu_dDqY.js → timeline-definition-IT6M3QCI-ck5gWEvw.js} +2 -2
  63. package/dist/{treemap-KMMF4GRG-DgXPV_Em.js → treemap-KMMF4GRG-B7HD7NGB.js} +1 -1
  64. package/dist/{xychartDiagram-PRI3JC2R-2pudDsH5.js → xychartDiagram-PRI3JC2R-CvffwJE5.js} +2 -2
  65. package/package.json +1 -1
  66. package/dist/info-NVLQJR56-CbAh6YG1.js +0 -5
  67. package/dist/pie-7BOR55EZ-WB5WTpXD.js +0 -5
  68. package/dist/radar-NHE76QYJ-CyDhShCS.js +0 -5
@@ -1,5 +1,5 @@
1
- import { e as x, c as O, g as m, k as P, h as p, j as w, l as A, m as c, n as I, t as N, o as E } from "./_baseUniq-BaMlJaXC.js";
2
- import { aR as g, aA as F, aS as M, aT as T, aU as _, aV as l, aW as $, aX as B, aY as S, aZ as y } from "./cowboy-components-Cusus7mi.js";
1
+ import { e as x, c as O, g as m, k as P, h as p, j as w, l as A, m as c, n as I, t as N, o as E } from "./_baseUniq-CY2TCqsW.js";
2
+ import { aR as g, aA as F, aS as M, aT as T, aU as _, aV as l, aW as $, aX as B, aY as S, aZ as y } from "./cowboy-components-wWvUFB6N.js";
3
3
  var R = /\s/;
4
4
  function G(n) {
5
5
  for (var r = n.length; r-- && R.test(n.charAt(r)); )
@@ -1,4 +1,4 @@
1
- import { be as S, bf as Rn, aW as T, bg as w, bh as xn, bi as mn, aV as sn, bj as Mn, bk as un, bl as x, aT as U, bm as Cn, bn as on, bo as Fn, bp as E, bc as gn, bq as R, aR as ln, br as Dn, bs as D, bt as Gn, bu as Un, bv as _, aZ as Bn, bw as Nn, aU as Kn, bx as X, by as jn, bz as Hn, aY as qn, aX as cn, ba as Yn, bA as M } from "./cowboy-components-Cusus7mi.js";
1
+ import { be as S, bf as Rn, aW as T, bg as w, bh as xn, bi as mn, aV as sn, bj as Mn, bk as un, bl as x, aT as U, bm as Cn, bn as on, bo as Fn, bp as E, bc as gn, bq as R, aR as ln, br as Dn, bs as D, bt as Gn, bu as Un, bv as _, aZ as Bn, bw as Nn, aU as Kn, bx as X, by as jn, bz as Hn, aY as qn, aX as cn, ba as Yn, bA as M } from "./cowboy-components-wWvUFB6N.js";
2
2
  var Zn = "[object Symbol]";
3
3
  function B(n) {
4
4
  return typeof n == "symbol" || S(n) && Rn(n) == Zn;
@@ -1,4 +1,4 @@
1
- import { a0 as ln, a1 as an, a2 as y, a3 as tn, a4 as H, a5 as q, a6 as _, a7 as un, a8 as B, a9 as rn, aa as L, ab as o, ac as sn, ad as on, ae as fn } from "./cowboy-components-Cusus7mi.js";
1
+ import { a0 as ln, a1 as an, a2 as y, a3 as tn, a4 as H, a5 as q, a6 as _, a7 as un, a8 as B, a9 as rn, aa as L, ab as o, ac as sn, ad as on, ae as fn } from "./cowboy-components-wWvUFB6N.js";
2
2
  function cn(l) {
3
3
  return l.innerRadius;
4
4
  }
@@ -1,4 +1,4 @@
1
- import { A as c, e as t } from "./mermaid-parser.core-BWH1OLmB.js";
1
+ import { A as c, e as t } from "./mermaid-parser.core-BOHrQYc5.js";
2
2
  export {
3
3
  c as ArchitectureModule,
4
4
  t as createArchitectureServices
@@ -1,6 +1,6 @@
1
- import { aI as ke, _ as dt, H as Ze, V as qe, l as Se, b as Qe, a as Je, p as Ke, q as je, g as _e, s as tr, y as er, D as rr, E as ir, F as ar, c as Ee, ak as me, aJ as pe, i as nr, d as or, x as sr, aK as hr, aL as lr } from "./cowboy-components-Cusus7mi.js";
2
- import { p as fr } from "./chunk-4BX2VUAB-Cax8rgH-.js";
3
- import { p as cr } from "./mermaid-parser.core-BWH1OLmB.js";
1
+ import { aI as ke, _ as dt, H as Ze, V as qe, l as Se, b as Qe, a as Je, p as Ke, q as je, g as _e, s as tr, y as er, D as rr, E as ir, F as ar, c as Ee, ak as me, aJ as pe, i as nr, d as or, x as sr, aK as hr, aL as lr } from "./cowboy-components-wWvUFB6N.js";
2
+ import { p as fr } from "./chunk-4BX2VUAB-S3Ahg-_D.js";
3
+ import { p as cr } from "./mermaid-parser.core-BOHrQYc5.js";
4
4
  import { c as Fe } from "./cytoscape.esm-DfdJODL8.js";
5
5
  var he = { exports: {} }, le = { exports: {} }, fe = { exports: {} }, gr = fe.exports, we;
6
6
  function ur() {
@@ -1,8 +1,8 @@
1
- import { g as oe } from "./chunk-FMBD7UC4-DpzzxPYV.js";
2
- import { _ as d, E as rt, d as O, e as he, l as L, y as de, A as ge, c as R, ai as ue, R as pe, S as fe, O as xe, aj as j, ak as Wt, al as ye, u as $, k as be, am as we, an as xt, i as yt, ao as me } from "./cowboy-components-Cusus7mi.js";
3
- import { c as Le } from "./clone-CAtTIGp5.js";
4
- import { G as Se } from "./graph-DeER36N7.js";
5
- import { c as ke } from "./channel-Czyy2YF7.js";
1
+ import { g as oe } from "./chunk-FMBD7UC4-Dy-fIu1M.js";
2
+ import { _ as d, E as rt, d as O, e as he, l as L, y as de, A as ge, c as R, ai as ue, R as pe, S as fe, O as xe, aj as j, ak as Wt, al as ye, u as $, k as be, am as we, an as xt, i as yt, ao as me } from "./cowboy-components-wWvUFB6N.js";
3
+ import { c as Le } from "./clone-BScqNVH4.js";
4
+ import { G as Se } from "./graph-COhVMYEY.js";
5
+ import { c as ke } from "./channel-zdPt9PFb.js";
6
6
  var bt = (function() {
7
7
  var e = /* @__PURE__ */ d(function(D, y, g, f) {
8
8
  for (g = g || {}, f = D.length; f--; g[D[f]] = y) ;
@@ -1,5 +1,5 @@
1
- import { g as Se, d as De } from "./chunk-TZMSLE5B-Dsr5RxRa.js";
2
- import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./cowboy-components-Cusus7mi.js";
1
+ import { g as Se, d as De } from "./chunk-TZMSLE5B-K0FCeysy.js";
2
+ import { _ as g, s as Pe, g as Be, a as Ie, b as Me, c as Bt, d as jt, l as de, e as Le, f as Ne, h as Tt, i as ge, j as Ye, w as je, k as $t, m as fe } from "./cowboy-components-wWvUFB6N.js";
3
3
  var Ft = (function() {
4
4
  var e = /* @__PURE__ */ g(function(_t, x, m, v) {
5
5
  for (m = m || {}, v = _t.length; v--; m[_t[v]] = x) ;
@@ -1,4 +1,4 @@
1
- import { ap as o, aq as n } from "./cowboy-components-Cusus7mi.js";
1
+ import { ap as o, aq as n } from "./cowboy-components-wWvUFB6N.js";
2
2
  const t = (a, r) => o.lang.round(n.parse(a)[r]);
3
3
  export {
4
4
  t as c
@@ -1,4 +1,4 @@
1
- import { _ as i } from "./cowboy-components-Cusus7mi.js";
1
+ import { _ as i } from "./cowboy-components-wWvUFB6N.js";
2
2
  function t(c, e) {
3
3
  c.accDescr && e.setAccDescription?.(c.accDescr), c.accTitle && e.setAccTitle?.(c.accTitle), c.title && e.setDiagramTitle?.(c.title);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { _ as a, d as o } from "./cowboy-components-Cusus7mi.js";
1
+ import { _ as a, d as o } from "./cowboy-components-wWvUFB6N.js";
2
2
  var d = /* @__PURE__ */ a((t, e) => {
3
3
  let n;
4
4
  return e === "sandbox" && (n = o("#i" + t)), (e === "sandbox" ? o(n.nodes()[0].contentDocument.body) : o("body")).select(`[id="${t}"]`);
@@ -1,7 +1,7 @@
1
- import { g as et } from "./chunk-FMBD7UC4-DpzzxPYV.js";
2
- import { g as tt } from "./chunk-55IACEB6-CrdTf2pk.js";
3
- import { s as st } from "./chunk-QN33PNHL-BOcC9xla.js";
4
- import { _ as A, l as Oe, c as D, o as it, r as at, u as we, d as ee, b as nt, a as rt, s as ut, g as lt, p as ot, q as ct, k as v, y as ht, x as dt, i as pt, Q as R } from "./cowboy-components-Cusus7mi.js";
1
+ import { g as et } from "./chunk-FMBD7UC4-Dy-fIu1M.js";
2
+ import { g as tt } from "./chunk-55IACEB6-DvHnMqsW.js";
3
+ import { s as st } from "./chunk-QN33PNHL-m_pIkwiq.js";
4
+ import { _ as A, l as Oe, c as D, o as it, r as at, u as we, d as ee, b as nt, a as rt, s as ut, g as lt, p as ot, q as ct, k as v, y as ht, x as dt, i as pt, Q as R } from "./cowboy-components-wWvUFB6N.js";
5
5
  var Ve = (function() {
6
6
  var s = /* @__PURE__ */ A(function(I, o, c, d) {
7
7
  for (c = c || {}, d = I.length; d--; c[I[d]] = o) ;
@@ -1,6 +1,6 @@
1
- import { g as te } from "./chunk-55IACEB6-CrdTf2pk.js";
2
- import { s as ee } from "./chunk-QN33PNHL-BOcC9xla.js";
3
- import { _ as u, l as b, c as w, r as se, u as ie, a as re, b as ae, g as ne, s as oe, p as le, q as ce, T as he, k as U, y as ue } from "./cowboy-components-Cusus7mi.js";
1
+ import { g as te } from "./chunk-55IACEB6-DvHnMqsW.js";
2
+ import { s as ee } from "./chunk-QN33PNHL-m_pIkwiq.js";
3
+ import { _ as u, l as b, c as w, r as se, u as ie, a as re, b as ae, g as ne, s as oe, p as le, q as ce, T as he, k as U, y as ue } from "./cowboy-components-wWvUFB6N.js";
4
4
  var vt = (function() {
5
5
  var t = /* @__PURE__ */ u(function(Y, o, c, n) {
6
6
  for (c = c || {}, n = Y.length; n--; c[Y[n]] = o) ;
@@ -1,4 +1,4 @@
1
- import { _ as e } from "./cowboy-components-Cusus7mi.js";
1
+ import { _ as e } from "./cowboy-components-wWvUFB6N.js";
2
2
  var l = /* @__PURE__ */ e(() => `
3
3
  /* Font Awesome icon styling - consolidated */
4
4
  .label-icon {
@@ -1,4 +1,4 @@
1
- import { _ as a, e as w, l as x } from "./cowboy-components-Cusus7mi.js";
1
+ import { _ as a, e as w, l as x } from "./cowboy-components-wWvUFB6N.js";
2
2
  var d = /* @__PURE__ */ a((e, t, i, r) => {
3
3
  e.attr("class", i);
4
4
  const { width: o, height: h, x: n, y: c } = u(e, t);
@@ -1,4 +1,4 @@
1
- import { _ as s } from "./cowboy-components-Cusus7mi.js";
1
+ import { _ as s } from "./cowboy-components-wWvUFB6N.js";
2
2
  var t, e = (t = class {
3
3
  /**
4
4
  * @param init - Function that creates the default state.
@@ -1,4 +1,4 @@
1
- import { _ as n, U as o, j as l } from "./cowboy-components-Cusus7mi.js";
1
+ import { _ as n, U as o, j as l } from "./cowboy-components-wWvUFB6N.js";
2
2
  var x = /* @__PURE__ */ n((s, t) => {
3
3
  const e = s.append("rect");
4
4
  if (e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), t.name && e.attr("name", t.name), t.rx && e.attr("rx", t.rx), t.ry && e.attr("ry", t.ry), t.attrs !== void 0)
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-B4BG7PRW-DVw-G-FD.js";
2
- import { _ as l } from "./cowboy-components-Cusus7mi.js";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-B4BG7PRW-B1VKBkeM.js";
2
+ import { _ as l } from "./cowboy-components-wWvUFB6N.js";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,5 +1,5 @@
1
- import { s as r, c as s, a as e, C as t } from "./chunk-B4BG7PRW-DVw-G-FD.js";
2
- import { _ as l } from "./cowboy-components-Cusus7mi.js";
1
+ import { s as r, c as s, a as e, C as t } from "./chunk-B4BG7PRW-B1VKBkeM.js";
2
+ import { _ as l } from "./cowboy-components-wWvUFB6N.js";
3
3
  var d = {
4
4
  parser: e,
5
5
  get db() {
@@ -1,4 +1,4 @@
1
- import { b as r } from "./_baseUniq-BaMlJaXC.js";
1
+ import { b as r } from "./_baseUniq-CY2TCqsW.js";
2
2
  var e = 4;
3
3
  function a(o) {
4
4
  return r(o, e);
@@ -137,7 +137,21 @@ export const styles = css `
137
137
  flex: 1;
138
138
  overflow: auto;
139
139
  padding: var(--sl-spacing-small);
140
- background: var(--background-color);
140
+ background: transparent;
141
+ }
142
+
143
+ .code-content::-webkit-scrollbar {
144
+ width: 8px;
145
+ height: 8px;
146
+ }
147
+
148
+ .code-content::-webkit-scrollbar-track {
149
+ background-color: var(--terminal-background);
150
+ }
151
+
152
+ .code-content::-webkit-scrollbar-thumb {
153
+ box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
154
+ background: var(--secondary-color-lowalpha);
141
155
  }
142
156
 
143
157
  .code-content pre {
@@ -416,6 +416,8 @@ let TheDoctor = class TheDoctor extends LitElement {
416
416
  this.settingsComponent.open();
417
417
  }
418
418
  handleImportRequested() {
419
+ this.uploadArchive.brokerId = this.getBrokerId();
420
+ this.uploadArchive.taskSubscriber = this.globalTaskController;
419
421
  this.uploadArchive.show();
420
422
  }
421
423
  handleNukeRequested() {
@@ -3,6 +3,7 @@ import { LitElement, TemplateResult } from "lit";
3
3
  import SlDialog from "@shoelace-style/shoelace/dist/components/dialog/dialog.js";
4
4
  import { SlButton, SlInput } from "@shoelace-style/shoelace";
5
5
  import { FileMeta } from "../../model/rolodex";
6
+ import type { TaskSubscription } from "../../interfaces/doctor-interfaces";
6
7
  export declare class UploadArchiveComponent extends LitElement {
7
8
  static styles: import("lit").CSSResult[];
8
9
  dialog: SlDialog | undefined;
@@ -15,6 +16,10 @@ export declare class UploadArchiveComponent extends LitElement {
15
16
  urlOverlay: HTMLElement;
16
17
  urlProblem: HTMLElement;
17
18
  urlSpinner: HTMLDivElement;
19
+ processing: boolean;
20
+ processingMessage: string;
21
+ brokerId: string;
22
+ taskSubscriber: TaskSubscription | undefined;
18
23
  file: any;
19
24
  fileName: string;
20
25
  fileType: string;
@@ -22,13 +27,23 @@ export declare class UploadArchiveComponent extends LitElement {
22
27
  fileTooBig: boolean;
23
28
  noSpecFilesFound: boolean;
24
29
  cannotParseSpecError: string;
30
+ private unsubscribeTask;
31
+ private pendingResponse;
32
+ private diagnosisReady;
33
+ private diagnosisTimeout;
25
34
  constructor();
26
35
  show(): void;
27
36
  hide(): void;
37
+ private cleanupTaskSubscription;
28
38
  handleFileChange(event: any): void;
29
39
  selectFile(path: string): void;
40
+ private subscribeToDiagnosisTask;
41
+ private onDiagnosisComplete;
42
+ private finishAndClose;
30
43
  fetchUrl(): void;
31
44
  validateUrl(evt: KeyboardEvent): void;
32
45
  renderFilePath(file: string, isOpenAPI?: boolean): TemplateResult;
46
+ private renderProcessing;
47
+ private renderImportForm;
33
48
  render(): TemplateResult<1>;
34
49
  }
@@ -18,12 +18,16 @@ import formsCss from "../../css/forms.css";
18
18
  import hrCss from "../../css/hr.css";
19
19
  import { NodeType } from "../../model/node_type";
20
20
  import { IconSize } from "../model-icon/model-icon";
21
+ import { TaskAction, TaskType } from "../../model/task";
21
22
  const urlRegex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/;
22
23
  let UploadArchiveComponent = class UploadArchiveComponent extends LitElement {
23
24
  constructor() {
24
25
  super();
26
+ this.diagnosisReady = false;
25
27
  this.visible = false;
26
28
  this.invalid = false;
29
+ this.processing = false;
30
+ this.processingMessage = '';
27
31
  this.file = null;
28
32
  this.files = [];
29
33
  }
@@ -33,6 +37,8 @@ let UploadArchiveComponent = class UploadArchiveComponent extends LitElement {
33
37
  }
34
38
  hide() {
35
39
  this.visible = false;
40
+ this.processing = false;
41
+ this.processingMessage = '';
36
42
  this.file = null;
37
43
  this.files = [];
38
44
  this.fileSize = 0;
@@ -40,8 +46,21 @@ let UploadArchiveComponent = class UploadArchiveComponent extends LitElement {
40
46
  this.noSpecFilesFound = false;
41
47
  this.cannotParseSpecError = '';
42
48
  this.invalid = false;
49
+ this.pendingResponse = undefined;
50
+ this.diagnosisReady = false;
51
+ this.cleanupTaskSubscription();
43
52
  this.dialog?.hide();
44
53
  }
54
+ cleanupTaskSubscription() {
55
+ if (this.diagnosisTimeout) {
56
+ clearTimeout(this.diagnosisTimeout);
57
+ this.diagnosisTimeout = undefined;
58
+ }
59
+ if (this.unsubscribeTask) {
60
+ this.unsubscribeTask();
61
+ this.unsubscribeTask = undefined;
62
+ }
63
+ }
45
64
  handleFileChange(event) {
46
65
  const file = event.target.files[0];
47
66
  if (file) {
@@ -101,22 +120,70 @@ let UploadArchiveComponent = class UploadArchiveComponent extends LitElement {
101
120
  }
102
121
  selectFile(path) {
103
122
  this.noSpecFilesFound = false;
104
- ModelService.selectRootPath(path).then((response) => {
123
+ this.processing = true;
124
+ this.processingMessage = 'Validating specification...';
125
+ this.diagnosisReady = false;
126
+ // subscribe to task completion BEFORE the HTTP call to avoid race conditions
127
+ this.subscribeToDiagnosisTask();
128
+ ModelService.selectRootPath(path, this.brokerId).then((response) => {
129
+ this.pendingResponse = {
130
+ content: response.instance,
131
+ path: path,
132
+ nodeId: response.id,
133
+ };
134
+ this.processingMessage = 'Analyzing specification...';
135
+ // if diagnosis already completed before HTTP response, finish now
136
+ if (this.diagnosisReady) {
137
+ this.finishAndClose();
138
+ }
139
+ }).catch((error) => {
140
+ this.processing = false;
141
+ this.invalid = true;
142
+ this.cannotParseSpecError = error.detail;
143
+ this.cleanupTaskSubscription();
144
+ });
145
+ }
146
+ subscribeToDiagnosisTask() {
147
+ if (!this.taskSubscriber) {
148
+ // no task subscriber available — fall back to timeout
149
+ this.diagnosisTimeout = setTimeout(() => this.onDiagnosisComplete(), 10000);
150
+ return;
151
+ }
152
+ // safety timeout in case the task never arrives
153
+ this.diagnosisTimeout = setTimeout(() => this.onDiagnosisComplete(), 15000);
154
+ this.unsubscribeTask = this.taskSubscriber.subscribeToTaskType(TaskType.AutoDiagnosis, (task) => {
155
+ if (task.status === 'completed') {
156
+ this.onDiagnosisComplete();
157
+ }
158
+ else if (task.status === 'failed') {
159
+ this.processingMessage = `Analysis failed: ${task.error || 'unknown error'}`;
160
+ setTimeout(() => this.onDiagnosisComplete(), 1500);
161
+ }
162
+ }, [TaskAction.Complete, TaskAction.Fail]);
163
+ }
164
+ onDiagnosisComplete() {
165
+ this.cleanupTaskSubscription();
166
+ if (!this.pendingResponse) {
167
+ // task completed before HTTP response arrived — mark ready and wait
168
+ this.diagnosisReady = true;
169
+ return;
170
+ }
171
+ this.finishAndClose();
172
+ }
173
+ finishAndClose() {
174
+ if (this.pendingResponse) {
105
175
  this.dispatchEvent(new CustomEvent(RolodexRootFileSelected, {
106
176
  composed: true,
107
177
  bubbles: true,
108
178
  detail: {
109
- content: response.instance,
110
- path: path,
111
- nodeId: response.id,
179
+ content: this.pendingResponse.content,
180
+ path: this.pendingResponse.path,
181
+ nodeId: this.pendingResponse.nodeId,
112
182
  }
113
183
  }));
114
- this.files = [];
115
- this.hide();
116
- }).catch((error) => {
117
- this.invalid = true;
118
- this.cannotParseSpecError = error.detail;
119
- });
184
+ }
185
+ this.files = [];
186
+ this.hide();
120
187
  }
121
188
  fetchUrl() {
122
189
  this.noSpecFilesFound = false;
@@ -171,14 +238,22 @@ let UploadArchiveComponent = class UploadArchiveComponent extends LitElement {
171
238
  </span>
172
239
  `;
173
240
  }
174
- render() {
241
+ renderProcessing() {
242
+ return html `
243
+ <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; gap: 20px;">
244
+ <sl-spinner style="font-size: 3rem; --track-width: 4px; --indicator-color: var(--secondary-color);"></sl-spinner>
245
+ <p style="font-size: 1.1em; color: var(--primary-color); margin: 0;">${this.processingMessage}</p>
246
+ </div>
247
+ `;
248
+ }
249
+ renderImportForm() {
175
250
  let renderFiles = html ``;
176
251
  if (this.files.length > 0 && !this.cannotParseSpecError) {
177
252
  renderFiles = html `
178
253
  <div class="files">
179
254
  <h4>Select the Entry Document</h4>
180
255
  <p>
181
- The Entry Document is the 'top' or the <strong><em>starting point</em></strong>.
256
+ The Entry Document is the 'top' or the <strong><em>starting point</em></strong>.
182
257
  Tell the doctor which is your <strong><em>main</em></strong>
183
258
  specification that <strong>starts</strong> the OpenAPI document.
184
259
  </p>
@@ -201,70 +276,78 @@ let UploadArchiveComponent = class UploadArchiveComponent extends LitElement {
201
276
  <p>Try another file, or check your archive.</p>`;
202
277
  }
203
278
  return html `
204
- <sl-dialog style="--width: 60vw; --height: 50vh">
205
- <span slot="label"><sl-icon name="upload" aria-hidden="true"></sl-icon> Import OpenAPI spec via URL or upload an archive</span>
206
- <div class="archive-select">
207
- <div class="use-url">
208
-
209
- <div style="margin-top: 8px; margin-right: 5px;">URL:</div>
210
- <div style="width: 100%">
211
- <sl-input id="url-input" class="url-input"
212
- placeholder="https://api.pb33f.io/train-travel.yaml"
213
- @keydown="${this.validateUrl}"
214
- @keyup="${this.validateUrl}"></sl-input>
215
- <div style="width: 100%; padding-top: 20px;">
216
- <sl-button id="url-input-button" class="url-input-button close-button"
217
- variant="neutral" disabled
218
- @click="${this.fetchUrl}">Fetch URL
219
- </sl-button>
220
- </div>
279
+ <div class="archive-select">
280
+ <div class="use-url">
281
+
282
+ <div style="margin-top: 8px; margin-right: 5px;">URL:</div>
283
+ <div style="width: 100%">
284
+ <sl-input id="url-input" class="url-input"
285
+ placeholder="https://api.pb33f.io/train-travel.yaml"
286
+ @keydown="${this.validateUrl}"
287
+ @keyup="${this.validateUrl}"></sl-input>
288
+ <div style="width: 100%; padding-top: 20px;">
289
+ <sl-button id="url-input-button" class="url-input-button close-button"
290
+ variant="neutral" disabled
291
+ @click="${this.fetchUrl}">Fetch URL
292
+ </sl-button>
221
293
  </div>
222
294
  </div>
295
+ </div>
223
296
 
224
- <div class="upload-archive">
225
- Spec exploded into multiple files? Upload a <strong>zip</strong> archive or a <strong>tarball</strong> containing everything.
226
- <p>
227
- The OpenAPI doctor supports <strong>zip files</strong> (.zip) and gzip compressed
228
- <strong>tarballs</strong> (.tar.gz).
229
- </p>
297
+ <div class="upload-archive">
298
+ Spec exploded into multiple files? Upload a <strong>zip</strong> archive or a <strong>tarball</strong> containing everything.
299
+ <p>
300
+ The OpenAPI doctor supports <strong>zip files</strong> (.zip) and gzip compressed
301
+ <strong>tarballs</strong> (.tar.gz).
302
+ </p>
230
303
 
231
- <label for="fileInput" class="upload-archive-button">
232
- UPLOAD .zip OR .tar.gz
233
- </label>
234
- <input ${this.invalid ? 'invalid-file invalid' : ''}" type="file" id="fileInput" @change="${this.handleFileChange}"/>
304
+ <label for="fileInput" class="upload-archive-button">
305
+ UPLOAD .zip OR .tar.gz
306
+ </label>
307
+ <input ${this.invalid ? 'invalid-file invalid' : ''}" type="file" id="fileInput" @change="${this.handleFileChange}"/>
235
308
 
236
- ${this.invalid && this.cannotParseSpecError != '' ? html `
237
- <p class="invalid">Oh dear, '<strong>${this.fileName}</strong>' is very sick.</p>
238
- <p class="invalid">I'm unable to proceed with this file:
239
- <br/>
240
- <br/>
241
- ${this.cannotParseSpecError}
242
- </p>
243
- ` : ''}
244
-
245
- ${this.invalid && !this.fileTooBig && this.cannotParseSpecError == '' ? html `
246
- <p class="invalid">'<strong>${this.fileName}</strong>' has a type of
247
- '<strong>${this.fileType}</strong>'
248
- which is an invalid file type.</p>
249
- <p class="invalid">Please upload a <strong>valid</strong> zip archive or a tarball.</p>
250
- ` : ''}
309
+ ${this.invalid && this.cannotParseSpecError != '' ? html `
310
+ <p class="invalid">Oh dear, '<strong>${this.fileName}</strong>' is very sick.</p>
311
+ <p class="invalid">I'm unable to proceed with this file:
312
+ <br/>
313
+ <br/>
314
+ ${this.cannotParseSpecError}
315
+ </p>
316
+ ` : ''}
251
317
 
252
- ${this.invalid && this.fileTooBig && this.cannotParseSpecError == '' ? html `
253
- <p class="invalid">'<strong>${this.fileName}</strong>' is too big!
254
- '<strong>
255
- <sl-format-bytes value="${this.fileSize}"></sl-format-bytes>
256
- </strong>'
257
- exceeds the <strong>5mb</strong> limit for free use
258
- </p>
259
- <p class="invalid">Please upload a <strong>smaller</strong> zip archive or a tarball, or
260
- authenticate.</p>
261
- ` : ''}
318
+ ${this.invalid && !this.fileTooBig && this.cannotParseSpecError == '' ? html `
319
+ <p class="invalid">'<strong>${this.fileName}</strong>' has a type of
320
+ '<strong>${this.fileType}</strong>'
321
+ which is an invalid file type.</p>
322
+ <p class="invalid">Please upload a <strong>valid</strong> zip archive or a tarball.</p>
323
+ ` : ''}
324
+
325
+ ${this.invalid && this.fileTooBig && this.cannotParseSpecError == '' ? html `
326
+ <p class="invalid">'<strong>${this.fileName}</strong>' is too big!
327
+ '<strong>
328
+ <sl-format-bytes value="${this.fileSize}"></sl-format-bytes>
329
+ </strong>'
330
+ exceeds the <strong>5mb</strong> limit for free use
331
+ </p>
332
+ <p class="invalid">Please upload a <strong>smaller</strong> zip archive or a tarball, or
333
+ authenticate.</p>
334
+ ` : ''}
262
335
 
263
- </div>
264
336
  </div>
337
+ </div>
265
338
 
266
- ${renderFiles}
267
- <sl-button slot="footer" variant="primary" @click="${this.hide}">Close</sl-button>
339
+ ${renderFiles}
340
+ <sl-button slot="footer" variant="primary" @click="${this.hide}">Close</sl-button>
341
+ `;
342
+ }
343
+ render() {
344
+ const label = this.processing
345
+ ? html `<sl-icon name="activity" aria-hidden="true"></sl-icon> Analyzing Specification`
346
+ : html `<sl-icon name="upload" aria-hidden="true"></sl-icon> Import OpenAPI spec via URL or upload an archive`;
347
+ return html `
348
+ <sl-dialog style="--width: 60vw; --height: 50vh">
349
+ <span slot="label">${label}</span>
350
+ ${this.processing ? this.renderProcessing() : this.renderImportForm()}
268
351
  </sl-dialog>
269
352
  `;
270
353
  }
@@ -300,6 +383,15 @@ __decorate([
300
383
  __decorate([
301
384
  query('#url-spinner')
302
385
  ], UploadArchiveComponent.prototype, "urlSpinner", void 0);
386
+ __decorate([
387
+ property({ type: Boolean })
388
+ ], UploadArchiveComponent.prototype, "processing", void 0);
389
+ __decorate([
390
+ property({ type: String })
391
+ ], UploadArchiveComponent.prototype, "processingMessage", void 0);
392
+ __decorate([
393
+ property({ type: String })
394
+ ], UploadArchiveComponent.prototype, "brokerId", void 0);
303
395
  UploadArchiveComponent = __decorate([
304
396
  customElement("pb33f-upload-archive")
305
397
  ], UploadArchiveComponent);
@@ -1,4 +1,4 @@
1
- import { aI as lt, _ as V, l as k, d as gt } from "./cowboy-components-Cusus7mi.js";
1
+ import { aI as lt, _ as V, l as k, d as gt } from "./cowboy-components-wWvUFB6N.js";
2
2
  import { c as tt } from "./cytoscape.esm-DfdJODL8.js";
3
3
  var Z = { exports: {} }, $ = { exports: {} }, Q = { exports: {} }, ut = Q.exports, j;
4
4
  function ft() {