@nine-lab/nine-mu 0.1.294 β 0.1.296
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 +30 -22
- 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 +2 -2
- package/src/components/NineDiffPopup.js +37 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nine-lab/nine-mu",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.296",
|
|
4
4
|
"description": "AI-Driven Full-Stack Code Fabrication Engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/nine-mu.umd.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@nine-lab/nine-ai": "*",
|
|
25
25
|
"@nine-lab/nine-nomenu": "*",
|
|
26
26
|
"@nine-lab/nine-util": "^0.9.126",
|
|
27
|
-
"@nine-lab/nine-ux": "^0.1.
|
|
27
|
+
"@nine-lab/nine-ux": "^0.1.244",
|
|
28
28
|
"terser": "^5.31.0",
|
|
29
29
|
"vite": "^6.0.0"
|
|
30
30
|
},
|
|
@@ -19,7 +19,7 @@ export class NineDiffPopup extends HTMLElement {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* π‘ μ€νμΌ κ°μ μλ
|
|
22
|
+
* π‘ μ€νμΌ κ°μ μλ μμ λ€μ΄μΌλ‘κ·Έ κ»λ°κΈ° λ λλ§
|
|
23
23
|
*/
|
|
24
24
|
#renderScaffolding() {
|
|
25
25
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
@@ -54,13 +54,13 @@ export class NineDiffPopup extends HTMLElement {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
|
-
* π‘ [
|
|
57
|
+
* π‘ [μνλ μ ν΅μ§ μΌκ΄ λμ λΉλ μμ§]
|
|
58
58
|
*/
|
|
59
59
|
async data(fileList) {
|
|
60
60
|
if (!Array.isArray(fileList) || fileList.length === 0) return this;
|
|
61
61
|
this.#fileList = fileList;
|
|
62
62
|
|
|
63
|
-
// 1. π§Ό μ΄μ
|
|
63
|
+
// 1. π§Ό μ΄μ μ€ν μΈμ
νμ κΉ¨λνκ² ν¬λ§·
|
|
64
64
|
if (this.#tabContainer && typeof this.#tabContainer.clearTabs === 'function') {
|
|
65
65
|
this.#tabContainer.clearTabs();
|
|
66
66
|
}
|
|
@@ -73,39 +73,50 @@ export class NineDiffPopup extends HTMLElement {
|
|
|
73
73
|
return 'javascript';
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
// 2. β‘
|
|
76
|
+
// 2. β‘ [ν΅μ¬ κ΅μ ]: appendChildλ‘ νλμ© λ°μ΄λ£μ§ μκ³ , ν΅μ§ λ§ν¬μ
λ¬Έμμ΄λ‘ 쑰립ν©λλ€.
|
|
77
|
+
let totalTabHtml = "";
|
|
78
|
+
|
|
77
79
|
fileList.forEach((file) => {
|
|
78
80
|
const { layer, full_path } = file;
|
|
79
81
|
const fileName = full_path.split('/').pop() || "Unknown";
|
|
80
82
|
const captionName = `${layer.toUpperCase()} (${fileName})`;
|
|
81
83
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.#tabContainer.addTabPage(captionName, targetHtmlContent);
|
|
88
|
-
}
|
|
84
|
+
totalTabHtml += `
|
|
85
|
+
<nine-tab-page caption="${captionName}">
|
|
86
|
+
<nine-diff class="${layer}"></nine-diff>
|
|
87
|
+
</nine-tab-page>
|
|
88
|
+
`;
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
// 3.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
// 3. π λ¨ ν λ²μ μ°μ°μΌλ‘ Light DOM νΈλ¦¬μ μμ μ μ£Όμ
!
|
|
92
|
+
this.#tabContainer.innerHTML = totalTabHtml;
|
|
93
|
+
|
|
94
|
+
// 4. βοΈ μ£Όμ
μ΄ λλ¬μΌλ―λ‘ nine-tabμ μ€λ¦¬μ§λ κΈ°λ μ΄κΈ°ν λ‘μ§(#init)μ κ°μ λ‘ λ€μ κΉ¨μλλ€.
|
|
95
|
+
if (this.#tabContainer && typeof this.#tabContainer.connectedCallback === 'function') {
|
|
96
|
+
this.#tabContainer.connectedCallback();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// 5. β° λΈλΌμ°μ κ° μΌκ΄ μμ±λ νμ μλν°λ€μ ꡬ쑰 ν΄μμ μλ²½ν λ§μΉ μ μλλ‘ λλΈ νλ μ λ§μ§ μ€μΌμ€λ§
|
|
100
|
+
requestAnimationFrame(() => {
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
fileList.forEach((file) => {
|
|
103
|
+
const { layer, full_path, asis_source, source } = file;
|
|
97
104
|
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
105
|
+
// μ΄μ μ μμ μΈ ν΅λ‘(nine-tabμ shadowRoot λ΄λΆ)λ‘ μμ νκ² μ΄μ¬ κ° μλν° νκ²ν
μΆμ
|
|
106
|
+
const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
|
|
107
|
+
|
|
108
|
+
if (diff && typeof diff.initialize === 'function') {
|
|
109
|
+
const lang = detectLanguage(full_path);
|
|
110
|
+
diff.initialize(asis_source || "", source || "", lang);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// μμ€ λ°μΈλ©μ΄ μλ²½ν λλ μ΅μ’
μμ μ ν¬μ»€μ± μ‘μΈμμ΄ν° κ°λ (첫 λ²μ§Έ λμ ν ν΄λ¦ κ°μ νΈλ¦¬κ±°)
|
|
115
|
+
if (this.#tabContainer && typeof this.#tabContainer.initialize === 'function') {
|
|
116
|
+
this.#tabContainer.initialize();
|
|
101
117
|
}
|
|
102
118
|
});
|
|
103
|
-
|
|
104
|
-
// 4. λͺ¨λ μμ€ λκΈ°ν μλ£ ν μ€λ¦¬μ§λ ν¬μ»€μ± μ‘μΈμμ΄ν° νΈλ¦¬κ±° (첫 λ²μ§Έ νμ± ν μ΄κΈ°)
|
|
105
|
-
if (this.#tabContainer && typeof this.#tabContainer.initialize === 'function') {
|
|
106
|
-
this.#tabContainer.initialize();
|
|
107
|
-
}
|
|
108
|
-
}, 50);
|
|
119
|
+
});
|
|
109
120
|
|
|
110
121
|
return this;
|
|
111
122
|
}
|