@nine-lab/nine-mu 0.1.42 β 0.1.44
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/nine-mu.js +54 -18
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineChat.js +1 -1
- package/src/components/NineDiffPopup.js +44 -1
package/dist/nine-mu.js
CHANGED
|
@@ -107,7 +107,7 @@ class NineChat extends HTMLElement {
|
|
|
107
107
|
__privateAdd(this, _routes, []);
|
|
108
108
|
__privateAdd(this, _diffPopup);
|
|
109
109
|
__publicField(this, "showDiff", (data) => {
|
|
110
|
-
__privateGet(this, _diffPopup).popup(data);
|
|
110
|
+
__privateGet(this, _diffPopup).popup().data(data);
|
|
111
111
|
});
|
|
112
112
|
this.attachShadow({ mode: "open" });
|
|
113
113
|
}
|
|
@@ -183,7 +183,7 @@ render_fn = function() {
|
|
|
183
183
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
184
184
|
this.shadowRoot.innerHTML = `
|
|
185
185
|
<style>
|
|
186
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
186
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.43"}/dist/css/nine-mu.css";
|
|
187
187
|
${customImport}
|
|
188
188
|
</style>
|
|
189
189
|
<div class="wrapper">
|
|
@@ -26396,7 +26396,7 @@ class NineDiff extends HTMLElement {
|
|
|
26396
26396
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
26397
26397
|
this.shadowRoot.innerHTML = `
|
|
26398
26398
|
<style>
|
|
26399
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
26399
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.43"}/dist/css/nine-mu.css";
|
|
26400
26400
|
${customImport}
|
|
26401
26401
|
</style>
|
|
26402
26402
|
|
|
@@ -26461,7 +26461,7 @@ class NineDiffPopup extends HTMLElement {
|
|
|
26461
26461
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
26462
26462
|
this.shadowRoot.innerHTML = `
|
|
26463
26463
|
<style>
|
|
26464
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
26464
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.43"}/dist/css/nine-mu.css";
|
|
26465
26465
|
${customImport}
|
|
26466
26466
|
</style>
|
|
26467
26467
|
|
|
@@ -26482,19 +26482,55 @@ class NineDiffPopup extends HTMLElement {
|
|
|
26482
26482
|
this.shadowRoot.querySelector(".btn-confirm").onclick = () => __privateMethod(this, _NineDiffPopup_instances, handleConfirm_fn).call(this);
|
|
26483
26483
|
this.shadowRoot.querySelector(".btn-cancel").onclick = () => __privateMethod(this, _NineDiffPopup_instances, handleCancel_fn).call(this);
|
|
26484
26484
|
}
|
|
26485
|
-
|
|
26486
|
-
|
|
26487
|
-
|
|
26488
|
-
|
|
26489
|
-
|
|
26490
|
-
|
|
26491
|
-
|
|
26492
|
-
|
|
26493
|
-
|
|
26494
|
-
|
|
26495
|
-
|
|
26496
|
-
|
|
26497
|
-
|
|
26485
|
+
/**
|
|
26486
|
+
async popup1(data) {
|
|
26487
|
+
return new Promise((resolve) => {
|
|
26488
|
+
this.#resolve = resolve;
|
|
26489
|
+
this.#asisBackup = data?.asis || "";
|
|
26490
|
+
|
|
26491
|
+
|
|
26492
|
+
// π‘ μλν°κ° μ€λΉλμλ€λ μ νΈλ₯Ό λ°μΌλ©΄ λ°μ΄ν° μ£Όμ
|
|
26493
|
+
this.#diffView.addEventListener('ready', () => {
|
|
26494
|
+
trace.log("NineDiff is Ready! Injecting data...");
|
|
26495
|
+
|
|
26496
|
+
const asisStr = typeof data.asis === 'object' ? JSON.stringify(data.asis, null, 2) : data.asis;
|
|
26497
|
+
const tobeStr = typeof data.tobe === 'object' ? JSON.stringify(data.tobe, null, 2) : data.tobe;
|
|
26498
|
+
|
|
26499
|
+
trace.log(asisStr, tobeStr);
|
|
26500
|
+
|
|
26501
|
+
this.#diffView.initialize(asisStr, tobeStr, data.lang);
|
|
26502
|
+
}, { once: true }); // λ± ν λ²λ§ μ€ν
|
|
26503
|
+
|
|
26504
|
+
this.#dialog.showModal();
|
|
26505
|
+
});
|
|
26506
|
+
} */
|
|
26507
|
+
popup() {
|
|
26508
|
+
__privateGet(this, _dialog).showModal();
|
|
26509
|
+
return this;
|
|
26510
|
+
}
|
|
26511
|
+
async data(asis, tobe, lang = "javascript") {
|
|
26512
|
+
let finalAsis = asis;
|
|
26513
|
+
const isRemote = typeof asis === "string" && (asis.startsWith("url:") || asis.startsWith("file:"));
|
|
26514
|
+
if (isRemote) {
|
|
26515
|
+
const targetUrl = asis.replace(/^(url:|file:)/, "");
|
|
26516
|
+
try {
|
|
26517
|
+
trace.log(`π‘ μ격 μμ€ λ‘λ μλ: ${targetUrl}`);
|
|
26518
|
+
const res = await fetch(targetUrl);
|
|
26519
|
+
if (!res.ok) throw new Error(`HTTP error! status: ${res.status}`);
|
|
26520
|
+
finalAsis = await res.text();
|
|
26521
|
+
} catch (e) {
|
|
26522
|
+
trace.error(`νμΌ λ‘λ μ€ν¨ [${targetUrl}]:`, e);
|
|
26523
|
+
finalAsis = `// νμΌμ λΆλ¬μ€λλ° μ€ν¨νμ΅λλ€.
|
|
26524
|
+
// κ²½λ‘: ${targetUrl}`;
|
|
26525
|
+
}
|
|
26526
|
+
}
|
|
26527
|
+
__privateSet(this, _asisBackup, finalAsis);
|
|
26528
|
+
__privateGet(this, _diffView).addEventListener("ready", () => {
|
|
26529
|
+
const asisStr = typeof finalAsis === "object" ? JSON.stringify(finalAsis, null, 2) : finalAsis;
|
|
26530
|
+
const tobeStr = typeof tobe === "object" ? JSON.stringify(tobe, null, 2) : tobe;
|
|
26531
|
+
__privateGet(this, _diffView).initialize(asisStr, tobeStr, lang);
|
|
26532
|
+
}, { once: true });
|
|
26533
|
+
return this;
|
|
26498
26534
|
}
|
|
26499
26535
|
}
|
|
26500
26536
|
_dialog = new WeakMap();
|
|
@@ -26606,7 +26642,7 @@ if (!customElements.get("nine-dialog")) {
|
|
|
26606
26642
|
customElements.define("nine-dialog", NineDialog);
|
|
26607
26643
|
}
|
|
26608
26644
|
const NineMu = {
|
|
26609
|
-
version: "0.1.
|
|
26645
|
+
version: "0.1.43",
|
|
26610
26646
|
init: (config) => {
|
|
26611
26647
|
trace.log("π οΈ Nine-Mu Engine initialized", config);
|
|
26612
26648
|
}
|