@liquidcars/atlas 0.1.47 → 0.1.48
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/demo/index.html +3 -3
- package/demo/model.json +73 -72
- package/dist/liquidcars-atlas.js +44 -48
- package/dist/liquidcars-atlas.js.map +1 -1
- package/index.html +3 -3
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +44 -44
package/dist/liquidcars-atlas.js
CHANGED
|
@@ -11890,7 +11890,7 @@ var $c = class {
|
|
|
11890
11890
|
}
|
|
11891
11891
|
}, el = {
|
|
11892
11892
|
name: "@liquidcars/atlas",
|
|
11893
|
-
version: "0.1.
|
|
11893
|
+
version: "0.1.48",
|
|
11894
11894
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11895
11895
|
type: "module",
|
|
11896
11896
|
scripts: {
|
|
@@ -12294,7 +12294,7 @@ function Wl(e, t) {
|
|
|
12294
12294
|
let n = t?.relatedTarget;
|
|
12295
12295
|
return n ? !e?.contains?.(n) : !1;
|
|
12296
12296
|
}
|
|
12297
|
-
var Gl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}" aria-live="polite">${r}</span>${Bl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Kl = `<div class="toolbar-group" data-toolbar-group="copy">${Gl("copy", Bl.copy, "
|
|
12297
|
+
var Gl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}" aria-live="polite">${r}</span>${Bl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Kl = `<div class="toolbar-group" data-toolbar-group="copy">${Gl("copy", Bl.copy, "Copy image", "PNG", Hl("copy-theme", "PNG with background · HD 2×") + Hl("copy-transparent", "Transparent PNG · HD 2×"))}</div>`, ql = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Interactive 3D model"></canvas><div class="toolbar" role="toolbar" aria-label="View controls"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Zoom out" title="Zoom out">${Bl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Zoom in" title="Zoom in">${Bl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Fit entire model" title="Fit entire model">${Bl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Front view" title="Front view">${Bl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Gl("view", Bl.view, "View", "View", Vl("labels", "Labels", !0) + Vl("panel", "Information", !0) + Vl("item-facing", "Face camera", !0) + "<div class=\"toolbar-option-separator\"></div>" + Vl("open-all", "Open all") + Vl("close-all", "Close all"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Gl("relations", Bl.relations, "Relations", "Selection", Vl("relations-all", "All") + Vl("relations-selected", "Selection", !0) + Vl("relations-callers", "Upstream") + Vl("relations-called", "Downstream") + Vl("relations-none", "Hide") + "<div data-relation-groups-section hidden><div class=\"toolbar-option-separator\"></div><div class=\"toolbar-popover-title\">Groups</div><div data-relation-groups></div></div>")}</div><div class="toolbar-group" data-toolbar-group="focus">${Gl("focus", Bl.focus, "Focus", "All", Vl("focus-all", "All", !0) + Vl("focus-dim", "Connected") + Vl("focus-hide", "Isolate") + "<div class=\"toolbar-option-separator\"></div>" + Vl("focus-selection", "Focus selection") + Vl("focus-layout", "Reflow visible"))}</div></div><div class="hint">Rotate: drag · Pan: right button / ⇧+drag / 2 fingers · Zoom: wheel or pinch · Select: click · Focus: double-click</div></section><aside class="panel" aria-live="polite"></aside></div>`;
|
|
12298
12298
|
function $(e) {
|
|
12299
12299
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12300
12300
|
"&": "&",
|
|
@@ -13076,7 +13076,7 @@ var Eu = class extends HTMLElement {
|
|
|
13076
13076
|
width: e.width,
|
|
13077
13077
|
height: e.height,
|
|
13078
13078
|
aspect: r
|
|
13079
|
-
})) : this._emit("lc-print-error", { message: "
|
|
13079
|
+
})) : this._emit("lc-print-error", { message: "Could not capture the WebGL framebuffer." }), this;
|
|
13080
13080
|
}
|
|
13081
13081
|
restoreAfterPrint() {
|
|
13082
13082
|
let e = this._printState;
|
|
@@ -13201,7 +13201,7 @@ var Eu = class extends HTMLElement {
|
|
|
13201
13201
|
let n = this.shadowRoot.querySelector("[data-action=\"focus-selection\"]");
|
|
13202
13202
|
n && (n.disabled = !this.selected && this.selectedRelationIndex === null);
|
|
13203
13203
|
let r = this.shadowRoot.querySelector("[data-toolbar-status=\"focus\"]");
|
|
13204
|
-
r && (r.textContent = e === "all" ? "
|
|
13204
|
+
r && (r.textContent = e === "all" ? "All" : e === "dim" ? "Connected" : "Isolate");
|
|
13205
13205
|
}
|
|
13206
13206
|
_syncRelationToolbar() {
|
|
13207
13207
|
if (!this.shadowRoot) return;
|
|
@@ -13209,19 +13209,15 @@ var Eu = class extends HTMLElement {
|
|
|
13209
13209
|
let t = this.shadowRoot.querySelector(`[data-action="relations-${e}"]`);
|
|
13210
13210
|
if (!t) continue;
|
|
13211
13211
|
let n = e === this.relationMode;
|
|
13212
|
-
t.classList.toggle("active", n), t.setAttribute("aria-pressed", String(n)),
|
|
13213
|
-
"selected",
|
|
13214
|
-
"callers",
|
|
13215
|
-
"called"
|
|
13216
|
-
].includes(e) && (t.disabled = !this.selected && this.selectedRelationIndex === null);
|
|
13212
|
+
t.classList.toggle("active", n), t.setAttribute("aria-pressed", String(n)), t.disabled = !1;
|
|
13217
13213
|
}
|
|
13218
13214
|
let e = this.shadowRoot.querySelector("[data-toolbar-status=\"relations\"]");
|
|
13219
13215
|
e && (e.textContent = {
|
|
13220
|
-
all: "
|
|
13221
|
-
selected: "
|
|
13222
|
-
callers: "
|
|
13223
|
-
called: "
|
|
13224
|
-
none: "
|
|
13216
|
+
all: "All",
|
|
13217
|
+
selected: "Selection",
|
|
13218
|
+
callers: "Upstream",
|
|
13219
|
+
called: "Downstream",
|
|
13220
|
+
none: "Hide"
|
|
13225
13221
|
}[this.relationMode]);
|
|
13226
13222
|
let t = this.modelData?.relationGroups || [], n = this.shadowRoot.querySelector("[data-relation-groups-section]"), r = this.shadowRoot.querySelector("[data-relation-groups]");
|
|
13227
13223
|
n && (n.hidden = t.length === 0), r && (r.innerHTML = t.map((e) => {
|
|
@@ -13364,7 +13360,7 @@ var Eu = class extends HTMLElement {
|
|
|
13364
13360
|
}), this;
|
|
13365
13361
|
}
|
|
13366
13362
|
updateModel(e = {}, t = {}) {
|
|
13367
|
-
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("
|
|
13363
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("The model patch must be an object.");
|
|
13368
13364
|
let n = this.modelData || Zl({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
13369
13365
|
...n,
|
|
13370
13366
|
...e,
|
|
@@ -13379,18 +13375,18 @@ var Eu = class extends HTMLElement {
|
|
|
13379
13375
|
return this.modelData = Zl(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
|
|
13380
13376
|
}
|
|
13381
13377
|
addEntity(e, t = {}) {
|
|
13382
|
-
if (!e || typeof e != "object" || !e.id) throw TypeError("
|
|
13383
|
-
if (this.modelData ||= Zl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`
|
|
13384
|
-
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`
|
|
13378
|
+
if (!e || typeof e != "object" || !e.id) throw TypeError("The entity must include an id.");
|
|
13379
|
+
if (this.modelData ||= Zl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`An entity with id "${e.id}" already exists.`);
|
|
13380
|
+
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`Parent container "${e.parent}" does not exist.`);
|
|
13385
13381
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
13386
13382
|
}
|
|
13387
13383
|
updateEntity(e, t = {}, n = {}) {
|
|
13388
|
-
if (!this.modelData) throw Error("No
|
|
13384
|
+
if (!this.modelData) throw Error("No model is loaded.");
|
|
13389
13385
|
let r = this.modelData.entities.findIndex((t) => t.id === e);
|
|
13390
|
-
if (r < 0) throw Error(`No
|
|
13391
|
-
if (!t || typeof t != "object" || Array.isArray(t)) throw TypeError("
|
|
13392
|
-
if (t.id && t.id !== e) throw Error("
|
|
13393
|
-
if (t.parent && t.parent !== e && !this.modelData.entities.some((e) => e.id === t.parent)) throw Error(`
|
|
13386
|
+
if (r < 0) throw Error(`No entity with id "${e}" exists.`);
|
|
13387
|
+
if (!t || typeof t != "object" || Array.isArray(t)) throw TypeError("Entity changes must be an object.");
|
|
13388
|
+
if (t.id && t.id !== e) throw Error("An entity id cannot be changed.");
|
|
13389
|
+
if (t.parent && t.parent !== e && !this.modelData.entities.some((e) => e.id === t.parent)) throw Error(`Parent container "${t.parent}" does not exist.`);
|
|
13394
13390
|
return this.modelData.entities = this.modelData.entities.map((n, i) => i === r ? {
|
|
13395
13391
|
...n,
|
|
13396
13392
|
...t,
|
|
@@ -13402,7 +13398,7 @@ var Eu = class extends HTMLElement {
|
|
|
13402
13398
|
}, n);
|
|
13403
13399
|
}
|
|
13404
13400
|
removeEntity(e, t = {}) {
|
|
13405
|
-
if (!this.modelData) throw Error("No
|
|
13401
|
+
if (!this.modelData) throw Error("No model is loaded.");
|
|
13406
13402
|
let n = t.cascade !== !1, r = /* @__PURE__ */ new Set([e]);
|
|
13407
13403
|
if (n) {
|
|
13408
13404
|
let e = !0;
|
|
@@ -13411,7 +13407,7 @@ var Eu = class extends HTMLElement {
|
|
|
13411
13407
|
for (let t of this.modelData.entities) t.parent && r.has(t.parent) && !r.has(t.id) && (r.add(t.id), e = !0);
|
|
13412
13408
|
}
|
|
13413
13409
|
}
|
|
13414
|
-
if (!this.modelData.entities.some((t) => t.id === e)) throw Error(`No
|
|
13410
|
+
if (!this.modelData.entities.some((t) => t.id === e)) throw Error(`No entity with id "${e}" exists.`);
|
|
13415
13411
|
let i = this.modelData.relations[this.selectedRelationIndex];
|
|
13416
13412
|
this.modelData.entities = this.modelData.entities.filter((e) => !r.has(e.id)), this.modelData.relations = this.modelData.relations.filter((e) => !r.has(e.from) && !r.has(e.to));
|
|
13417
13413
|
let a = i ? this.modelData.relations.indexOf(i) : -1;
|
|
@@ -13421,22 +13417,22 @@ var Eu = class extends HTMLElement {
|
|
|
13421
13417
|
});
|
|
13422
13418
|
}
|
|
13423
13419
|
addRelation(e, t = {}) {
|
|
13424
|
-
if (!e || typeof e != "object" || !e.from || !e.to) throw TypeError("
|
|
13425
|
-
if (!this.modelData) throw Error("No
|
|
13420
|
+
if (!e || typeof e != "object" || !e.from || !e.to) throw TypeError("The relation must include from and to.");
|
|
13421
|
+
if (!this.modelData) throw Error("No model is loaded.");
|
|
13426
13422
|
let n = new Set(this.modelData.entities.map((e) => e.id));
|
|
13427
|
-
if (!n.has(e.from) || !n.has(e.to)) throw Error("
|
|
13423
|
+
if (!n.has(e.from) || !n.has(e.to)) throw Error("Both relation endpoints must exist in the model.");
|
|
13428
13424
|
return this.modelData.relations = [...this.modelData.relations, { ...e }], this._commitModelChange("relation-add", { relation: { ...e } }, t);
|
|
13429
13425
|
}
|
|
13430
13426
|
updateRelation(e, t = {}, n = {}) {
|
|
13431
|
-
if (!this.modelData) throw Error("No
|
|
13427
|
+
if (!this.modelData) throw Error("No model is loaded.");
|
|
13432
13428
|
let r = this._relationIndex(e);
|
|
13433
|
-
if (r < 0 || r >= this.modelData.relations.length) throw Error("
|
|
13434
|
-
if (!t || typeof t != "object" || Array.isArray(t)) throw TypeError("
|
|
13429
|
+
if (r < 0 || r >= this.modelData.relations.length) throw Error("The requested relation does not exist.");
|
|
13430
|
+
if (!t || typeof t != "object" || Array.isArray(t)) throw TypeError("Relation changes must be an object.");
|
|
13435
13431
|
let i = {
|
|
13436
13432
|
...this.modelData.relations[r],
|
|
13437
13433
|
...t
|
|
13438
13434
|
}, a = new Set(this.modelData.entities.map((e) => e.id));
|
|
13439
|
-
if (!a.has(i.from) || !a.has(i.to)) throw Error("
|
|
13435
|
+
if (!a.has(i.from) || !a.has(i.to)) throw Error("Both relation endpoints must exist in the model.");
|
|
13440
13436
|
return this.modelData.relations = this.modelData.relations.map((e, t) => t === r ? i : e), this._commitModelChange("relation-update", {
|
|
13441
13437
|
index: r,
|
|
13442
13438
|
patch: t,
|
|
@@ -13444,9 +13440,9 @@ var Eu = class extends HTMLElement {
|
|
|
13444
13440
|
}, n);
|
|
13445
13441
|
}
|
|
13446
13442
|
removeRelation(e, t = {}) {
|
|
13447
|
-
if (!this.modelData) throw Error("No
|
|
13443
|
+
if (!this.modelData) throw Error("No model is loaded.");
|
|
13448
13444
|
let n = this._relationIndex(e);
|
|
13449
|
-
if (n < 0 || n >= this.modelData.relations.length) throw Error("
|
|
13445
|
+
if (n < 0 || n >= this.modelData.relations.length) throw Error("The requested relation does not exist.");
|
|
13450
13446
|
let [r] = this.modelData.relations.splice(n, 1);
|
|
13451
13447
|
return this.selectedRelationIndex === n ? this.selectedRelationIndex = null : this.selectedRelationIndex > n && --this.selectedRelationIndex, this._commitModelChange("relation-remove", {
|
|
13452
13448
|
index: n,
|
|
@@ -13564,13 +13560,13 @@ var Eu = class extends HTMLElement {
|
|
|
13564
13560
|
return this._containerEntityIds().filter((e) => this.open.has(e));
|
|
13565
13561
|
}
|
|
13566
13562
|
setOpenContainers(e, t = {}) {
|
|
13567
|
-
if (e == null || typeof e == "string" || typeof e[Symbol.iterator] != "function") throw TypeError("
|
|
13563
|
+
if (e == null || typeof e == "string" || typeof e[Symbol.iterator] != "function") throw TypeError("Open containers must be provided as an iterable of ids.");
|
|
13568
13564
|
return this._replaceOpenContainers(e, t), this;
|
|
13569
13565
|
}
|
|
13570
13566
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13571
13567
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13572
|
-
if (!r) throw Error(`No
|
|
13573
|
-
if (!Tl(r.type)) throw TypeError(`
|
|
13568
|
+
if (!r) throw Error(`No entity with id "${e}" exists.`);
|
|
13569
|
+
if (!Tl(r.type)) throw TypeError(`Entity "${e}" is not a container.`);
|
|
13574
13570
|
let i = new Set(this.open);
|
|
13575
13571
|
if (t) i.add(e);
|
|
13576
13572
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
@@ -13644,7 +13640,7 @@ var Eu = class extends HTMLElement {
|
|
|
13644
13640
|
try {
|
|
13645
13641
|
return this.load(JSON.parse(t.textContent));
|
|
13646
13642
|
} catch (e) {
|
|
13647
|
-
this._showError("
|
|
13643
|
+
this._showError("Could not read the JSON model: " + e.message), this.dispatchEvent(new CustomEvent("lc-error", { detail: e }));
|
|
13648
13644
|
}
|
|
13649
13645
|
}
|
|
13650
13646
|
async load(e) {
|
|
@@ -13662,7 +13658,7 @@ var Eu = class extends HTMLElement {
|
|
|
13662
13658
|
let n = this._pendingSelection;
|
|
13663
13659
|
return this._pendingSelection = null, this._loading = !1, n?.kind === "relation" ? this.selectRelation(n.index, n.options) : n?.kind === "entity" && this.select(n.id, n.options), this;
|
|
13664
13660
|
} catch (e) {
|
|
13665
|
-
throw this._showError("
|
|
13661
|
+
throw this._showError("Could not load the model: " + e.message), this.dispatchEvent(new CustomEvent("lc-error", { detail: e })), e;
|
|
13666
13662
|
} finally {
|
|
13667
13663
|
this._loading = !1;
|
|
13668
13664
|
}
|
|
@@ -13677,7 +13673,7 @@ var Eu = class extends HTMLElement {
|
|
|
13677
13673
|
powerPreference: "high-performance"
|
|
13678
13674
|
}), this.ambientLight = new Ca(14282495, 2503739, 2.3), this.directionalLight = new Aa(16777215, 2.4), this.scene.add(this.ambientLight, this.directionalLight), this._applyLighting(), this.resize(), !0;
|
|
13679
13675
|
} catch {
|
|
13680
|
-
return this._showError("
|
|
13676
|
+
return this._showError("WebGL could not start. Enable hardware acceleration in your browser."), !1;
|
|
13681
13677
|
}
|
|
13682
13678
|
}
|
|
13683
13679
|
_applyLighting() {
|
|
@@ -13970,24 +13966,24 @@ var Eu = class extends HTMLElement {
|
|
|
13970
13966
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13971
13967
|
if (e) {
|
|
13972
13968
|
let t = Fl(e), n = (this.modelData.relationGroups || []).find((t) => t.id === e.group), r = new Map((this.modelData.relationGroups || []).map((e) => [e.id, e])), i = this.getRelationBundle(this.selectedRelationIndex), a = e.text ? "<p>" + $(e.text) + "</p>" : "", o = Jl(e.url), s = n ? "<h3>GRUPO</h3><p>" + $(n.label || n.id) + "</p>" : "", c = i.map(({ index: e, relation: t }) => {
|
|
13973
|
-
let n = r.get(t.group), i = [n?.label || n?.id || "
|
|
13969
|
+
let n = r.get(t.group), i = [n?.label || n?.id || "Ungrouped", Fl(t)].join(" · ");
|
|
13974
13970
|
return "<button class=\"relation" + (e === this.selectedRelationIndex ? " selected" : "") + "\" data-action=\"relation\" data-relation-index=\"" + e + "\"><strong>" + $(t.label || `${t.from} → ${t.to}`) + "</strong><small>" + $(i) + "</small></button>";
|
|
13975
|
-
}).join(""), l = i.length === 1 ? "1
|
|
13976
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">←
|
|
13971
|
+
}).join(""), l = i.length === 1 ? "1 connection" : `${i.length} connections`;
|
|
13972
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Overview</button><button data-action=\"focus-selection\">◎ Focus selection</button><div class=\"eyebrow\">RELATION</div><h2>" + $(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + $(e.from) + " → " + $(e.to) + "</div>" + a + o + s + "<h3>MODE</h3><p>" + $(t) + "</p><h3>VIRTUAL TUBE</h3><p>" + $(`${e.from} ↔ ${e.to} · ${l}`) + "</p>" + c, this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this._applyTheme();
|
|
13977
13973
|
return;
|
|
13978
13974
|
}
|
|
13979
13975
|
let t = this.selected;
|
|
13980
13976
|
if (!t) {
|
|
13981
|
-
this.panel.innerHTML = "<div class=\"eyebrow\">LIQUIDCARS ATLAS</div><h2>
|
|
13977
|
+
this.panel.innerHTML = "<div class=\"eyebrow\">LIQUIDCARS ATLAS</div><h2>Explore the model.</h2><p>Select an item to inspect its purpose and relations.</p><p class=\"note\">The component accepts a JSON object with palette, entities and relations.</p>", this._applyTheme();
|
|
13982
13978
|
return;
|
|
13983
13979
|
}
|
|
13984
13980
|
let n = this.relations.filter((e) => e.from === t.id || e.to === t.id), r = this.modelData.entities.filter((e) => e.parent === t.id), i = [], a = /* @__PURE__ */ new Set(), o = t;
|
|
13985
13981
|
for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
|
|
13986
|
-
let s = "<nav class=\"crumbs\" aria-label=\"
|
|
13982
|
+
let s = "<nav class=\"crumbs\" aria-label=\"Model path\"><button data-action=\"overview\">Model</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + $(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + $(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13987
13983
|
let n = this.relations.indexOf(e), r = e.text ? "<small>" + $(e.text) + "</small>" : "";
|
|
13988
13984
|
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + $(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + $(e.from) + " → " + $(e.to) + "</small>" + r + "</button>";
|
|
13989
13985
|
}).join("");
|
|
13990
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">←
|
|
13986
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Overview</button>" + s + "<button data-action=\"focus-selection\">◎ Focus selection</button><div class=\"eyebrow\">" + $(Tl(t.type) ? "CONTAINER" : t.type === "actor" ? "EXTERNAL ACTOR" : "COMPONENT") + "</div><h2>" + $(t.name) + "</h2><div class=\"sub\">" + $(t.sub || "") + "</div><p>" + $(t.text || "") + "</p>" + Jl(t.url) + (Tl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Close container" : "Open container") + "</button>" : "") + (r.length ? "<h3>CONTAINS</h3><p>" + r.length + " internal item" + (r.length === 1 ? "" : "s") + ".</p>" : "") + "<h3>RELATIONS</h3>" + (c || "<p>No direct relations.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
|
|
13991
13987
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13992
13988
|
}), this._applyTheme();
|
|
13993
13989
|
}
|
|
@@ -14148,7 +14144,7 @@ var Eu = class extends HTMLElement {
|
|
|
14148
14144
|
}, t === "error" ? 4200 : 2400)));
|
|
14149
14145
|
}
|
|
14150
14146
|
async _copyFromToolbar(e, t) {
|
|
14151
|
-
t && (t.disabled = !0), this._setCopyToolbarStatus("
|
|
14147
|
+
t && (t.disabled = !0), this._setCopyToolbarStatus("Copying…");
|
|
14152
14148
|
try {
|
|
14153
14149
|
let t = await this.copyFrame({
|
|
14154
14150
|
background: e,
|
|
@@ -14156,7 +14152,7 @@ var Eu = class extends HTMLElement {
|
|
|
14156
14152
|
fallback: "download",
|
|
14157
14153
|
source: "toolbar"
|
|
14158
14154
|
});
|
|
14159
|
-
return this._setCopyToolbarStatus(t.method === "clipboard" ? "
|
|
14155
|
+
return this._setCopyToolbarStatus(t.method === "clipboard" ? "Copied" : "Downloaded", "success"), t;
|
|
14160
14156
|
} catch (e) {
|
|
14161
14157
|
return this._setCopyToolbarStatus("Error", "error"), globalThis.console?.error?.("Atlas PNG export failed.", e), null;
|
|
14162
14158
|
} finally {
|