@pb33f/cowboy-components 0.12.3 → 0.12.5
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/{_basePickBy-C6qM4JsN.js → _basePickBy-nQ6ADfcP.js} +2 -2
- package/dist/{_baseUniq-CL6N5X0S.js → _baseUniq-BLhpRkwn.js} +1 -1
- package/dist/{arc-BPodQwCA.js → arc-DVathCOF.js} +1 -1
- package/dist/{architecture-U656AL7Q-8RM8yUJq.js → architecture-U656AL7Q-cmGAaGQR.js} +1 -1
- package/dist/{architectureDiagram-VXUJARFQ-DscfMtRk.js → architectureDiagram-VXUJARFQ-CU0UXyx5.js} +3 -3
- package/dist/{blockDiagram-VD42YOAC-znVYL4bL.js → blockDiagram-VD42YOAC-BB5NozCA.js} +5 -5
- package/dist/{c4Diagram-YG6GDRKO-MnOpRb7b.js → c4Diagram-YG6GDRKO--1zQnAiN.js} +2 -2
- package/dist/{channel-7F7ZxLBh.js → channel-C30FZj3q.js} +1 -1
- package/dist/{chunk-4BX2VUAB-E29URZIE.js → chunk-4BX2VUAB-C3dRrtcs.js} +1 -1
- package/dist/{chunk-55IACEB6--z9Lfwh_.js → chunk-55IACEB6-DVHVzwv8.js} +1 -1
- package/dist/{chunk-B4BG7PRW-BJCNIBMq.js → chunk-B4BG7PRW-REIyHYU-.js} +4 -4
- package/dist/{chunk-DI55MBZ5-CBBeJcxE.js → chunk-DI55MBZ5-DNwnRjrQ.js} +3 -3
- package/dist/{chunk-FMBD7UC4-DiJf6vf4.js → chunk-FMBD7UC4-Y2_mjoeb.js} +1 -1
- package/dist/{chunk-QN33PNHL-BQeCdAO4.js → chunk-QN33PNHL-DxmJmoZ1.js} +1 -1
- package/dist/{chunk-QZHKN3VN-B10WHNRh.js → chunk-QZHKN3VN-D09ygwuH.js} +1 -1
- package/dist/{chunk-TZMSLE5B-CihFGYBL.js → chunk-TZMSLE5B-DALAsva5.js} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-DqCtRU7b.js → classDiagram-2ON5EDUG-nF0KPMaG.js} +2 -2
- package/dist/{classDiagram-2ON5EDUG-DqCtRU7b.js → classDiagram-v2-WZHVMYZB-nF0KPMaG.js} +2 -2
- package/dist/{clone-MZzrSJSF.js → clone-Cv1NeF92.js} +1 -1
- package/dist/components/the-doctor/the-doctor.js +2 -0
- package/dist/components/the-doctor/upload-archive.d.ts +15 -0
- package/dist/components/the-doctor/upload-archive.js +159 -67
- package/dist/{cose-bilkent-S5V4N54A-C8s1yfS0.js → cose-bilkent-S5V4N54A-DpGf3GCN.js} +1 -1
- package/dist/{cowboy-components-BOtD4JRB.js → cowboy-components-D1iW4457.js} +3238 -3188
- package/dist/cowboy-components.umd.cjs +475 -468
- package/dist/{dagre-6UL2VRFP-CXk4xnBN.js → dagre-6UL2VRFP-B1N-831D.js} +6 -6
- package/dist/{diagram-PSM6KHXK-B76lutCg.js → diagram-PSM6KHXK-kZwu3vaZ.js} +4 -4
- package/dist/{diagram-QEK2KX5R-C0scswmK.js → diagram-QEK2KX5R-CsEkTXIy.js} +3 -3
- package/dist/{diagram-S2PKOQOG-Dvfy3XRY.js → diagram-S2PKOQOG-BHgVZkh7.js} +3 -3
- package/dist/{erDiagram-Q2GNP2WA-Drjuuc5E.js → erDiagram-Q2GNP2WA-C072ls1v.js} +4 -4
- package/dist/{flowDiagram-NV44I4VS-CLZmRZQ6.js → flowDiagram-NV44I4VS-Dlbo4dcP.js} +5 -5
- package/dist/{ganttDiagram-LVOFAZNH-CZPElQEs.js → ganttDiagram-LVOFAZNH-BUeP3FHW.js} +2 -2
- package/dist/{gitGraph-F6HP7TQM-BzA4ClGr.js → gitGraph-F6HP7TQM-BtEm_Gpk.js} +1 -1
- package/dist/{gitGraphDiagram-NY62KEGX-BJwWbwgF.js → gitGraphDiagram-NY62KEGX-CRx4dH9Q.js} +4 -4
- package/dist/{graph-pJ6oxTQB.js → graph-Bu9akWhV.js} +2 -2
- package/dist/info-NVLQJR56-CYb1aKRf.js +5 -0
- package/dist/{infoDiagram-F6ZHWCRC-CVzPLdyj.js → infoDiagram-F6ZHWCRC-DVTH4DT_.js} +2 -2
- package/dist/{journeyDiagram-XKPGCS4Q-C4cf1nuE.js → journeyDiagram-XKPGCS4Q-CWVjjZwk.js} +4 -4
- package/dist/{kanban-definition-3W4ZIXB7-ZvGqbEKN.js → kanban-definition-3W4ZIXB7-DlCGEX-D.js} +2 -2
- package/dist/{layout-1b5SERdg.js → layout-BrAEpfOy.js} +4 -4
- package/dist/{linear-Q8xXzk-g.js → linear-CYSpx48k.js} +1 -1
- package/dist/{mermaid-parser.core-C6Rmy8E_.js → mermaid-parser.core-Do4Y4I41.js} +11 -11
- package/dist/{mindmap-definition-VGOIOE7T-BWQxJK_Z.js → mindmap-definition-VGOIOE7T-B9t01eCB.js} +3 -3
- package/dist/model/task.d.ts +2 -1
- package/dist/model/task.js +1 -0
- package/dist/{packet-BFZMPI3H-BPVsBhV7.js → packet-BFZMPI3H-S_WFNoxo.js} +1 -1
- package/dist/pie-7BOR55EZ-BV1oTd8L.js +5 -0
- package/dist/{pieDiagram-ADFJNKIX-BPoDBWKB.js → pieDiagram-ADFJNKIX-CU6-CqGQ.js} +4 -4
- package/dist/{quadrantDiagram-AYHSOK5B-Cjtvt5Zm.js → quadrantDiagram-AYHSOK5B-CPrEl59k.js} +2 -2
- package/dist/radar-NHE76QYJ-De5Hqyi9.js +5 -0
- package/dist/{requirementDiagram-UZGBJVZJ-Bq8-k6RZ.js → requirementDiagram-UZGBJVZJ-B6uK3H3t.js} +3 -3
- package/dist/{sankeyDiagram-TZEHDZUN-CA13G8xm.js → sankeyDiagram-TZEHDZUN-BVSVG82P.js} +1 -1
- package/dist/{sequenceDiagram-WL72ISMW-Dd_OoMk9.js → sequenceDiagram-WL72ISMW-DCGxqxR5.js} +3 -3
- package/dist/services/model-service.d.ts +1 -1
- package/dist/services/model-service.js +5 -4
- package/dist/{stateDiagram-FKZM4ZOC-DVjTZilp.js → stateDiagram-FKZM4ZOC-Dne-7IKI.js} +4 -4
- package/dist/{stateDiagram-v2-4FDKWEC3-CpEcR9je.js → stateDiagram-v2-4FDKWEC3-Do3pq4JY.js} +2 -2
- package/dist/{timeline-definition-IT6M3QCI-B75AXgTN.js → timeline-definition-IT6M3QCI-14H0rvK9.js} +2 -2
- package/dist/{treemap-KMMF4GRG-DuO22dun.js → treemap-KMMF4GRG-DCS1QlDe.js} +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-vDUPV6Ax.js → xychartDiagram-PRI3JC2R-BKplk2EO.js} +2 -2
- package/package.json +1 -1
- package/dist/info-NVLQJR56-BxxpWbyi.js +0 -5
- package/dist/pie-7BOR55EZ-McIzKv77.js +0 -5
- package/dist/radar-NHE76QYJ-BJQ-x123.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-
|
|
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-
|
|
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-BLhpRkwn.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-D1iW4457.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-
|
|
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-D1iW4457.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-
|
|
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-D1iW4457.js";
|
|
2
2
|
function cn(l) {
|
|
3
3
|
return l.innerRadius;
|
|
4
4
|
}
|
package/dist/{architectureDiagram-VXUJARFQ-DscfMtRk.js → architectureDiagram-VXUJARFQ-CU0UXyx5.js}
RENAMED
|
@@ -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-
|
|
2
|
-
import { p as fr } from "./chunk-4BX2VUAB-
|
|
3
|
-
import { p as cr } from "./mermaid-parser.core-
|
|
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-D1iW4457.js";
|
|
2
|
+
import { p as fr } from "./chunk-4BX2VUAB-C3dRrtcs.js";
|
|
3
|
+
import { p as cr } from "./mermaid-parser.core-Do4Y4I41.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-
|
|
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-
|
|
3
|
-
import { c as Le } from "./clone-
|
|
4
|
-
import { G as Se } from "./graph-
|
|
5
|
-
import { c as ke } from "./channel-
|
|
1
|
+
import { g as oe } from "./chunk-FMBD7UC4-Y2_mjoeb.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-D1iW4457.js";
|
|
3
|
+
import { c as Le } from "./clone-Cv1NeF92.js";
|
|
4
|
+
import { G as Se } from "./graph-Bu9akWhV.js";
|
|
5
|
+
import { c as ke } from "./channel-C30FZj3q.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-
|
|
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-
|
|
1
|
+
import { g as Se, d as De } from "./chunk-TZMSLE5B-DALAsva5.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-D1iW4457.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 { _ as i } from "./cowboy-components-
|
|
1
|
+
import { _ as i } from "./cowboy-components-D1iW4457.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-
|
|
1
|
+
import { _ as a, d as o } from "./cowboy-components-D1iW4457.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-
|
|
2
|
-
import { g as tt } from "./chunk-55IACEB6
|
|
3
|
-
import { s as st } from "./chunk-QN33PNHL-
|
|
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-
|
|
1
|
+
import { g as et } from "./chunk-FMBD7UC4-Y2_mjoeb.js";
|
|
2
|
+
import { g as tt } from "./chunk-55IACEB6-DVHVzwv8.js";
|
|
3
|
+
import { s as st } from "./chunk-QN33PNHL-DxmJmoZ1.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-D1iW4457.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
|
|
2
|
-
import { s as ee } from "./chunk-QN33PNHL-
|
|
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-
|
|
1
|
+
import { g as te } from "./chunk-55IACEB6-DVHVzwv8.js";
|
|
2
|
+
import { s as ee } from "./chunk-QN33PNHL-DxmJmoZ1.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-D1iW4457.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 a, e as w, l as x } from "./cowboy-components-
|
|
1
|
+
import { _ as a, e as w, l as x } from "./cowboy-components-D1iW4457.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 n, U as o, j as l } from "./cowboy-components-
|
|
1
|
+
import { _ as n, U as o, j as l } from "./cowboy-components-D1iW4457.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-
|
|
2
|
-
import { _ as l } from "./cowboy-components-
|
|
1
|
+
import { s as r, c as s, a as e, C as t } from "./chunk-B4BG7PRW-REIyHYU-.js";
|
|
2
|
+
import { _ as l } from "./cowboy-components-D1iW4457.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-
|
|
2
|
-
import { _ as l } from "./cowboy-components-
|
|
1
|
+
import { s as r, c as s, a as e, C as t } from "./chunk-B4BG7PRW-REIyHYU-.js";
|
|
2
|
+
import { _ as l } from "./cowboy-components-D1iW4457.js";
|
|
3
3
|
var d = {
|
|
4
4
|
parser: e,
|
|
5
5
|
get db() {
|
|
@@ -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
|
-
|
|
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
|
+
this.onDiagnosisComplete();
|
|
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:
|
|
110
|
-
path: path,
|
|
111
|
-
nodeId:
|
|
179
|
+
content: this.pendingResponse.content,
|
|
180
|
+
path: this.pendingResponse.path,
|
|
181
|
+
nodeId: this.pendingResponse.nodeId,
|
|
112
182
|
}
|
|
113
183
|
}));
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
205
|
-
<
|
|
206
|
-
|
|
207
|
-
<div
|
|
208
|
-
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
267
|
-
|
|
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-
|
|
1
|
+
import { aI as lt, _ as V, l as k, d as gt } from "./cowboy-components-D1iW4457.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() {
|