@nine-lab/nine-mu 0.1.293 β 0.1.295
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 +17 -13
- 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 +23 -20
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.295",
|
|
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,40 +73,45 @@ 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
|
-
}
|
|
84
|
+
totalTabHtml += `
|
|
85
|
+
<nine-tab-page caption="${captionName}">
|
|
86
|
+
<nine-diff class="${layer}"></nine-diff>
|
|
87
|
+
</nine-tab-page>
|
|
88
|
+
`;
|
|
88
89
|
});
|
|
89
90
|
|
|
90
|
-
// 3.
|
|
91
|
-
|
|
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. β° λΈλΌμ°μ κ° μΌκ΄ μμ±λ νμ μλν°λ€μ ꡬ쑰 ν΄μμ μλ²½ν λ§μΉ μ μλλ‘ λλΈ νλ μ λ§μ§ μ€μΌμ€λ§
|
|
92
100
|
requestAnimationFrame(() => {
|
|
93
101
|
requestAnimationFrame(() => {
|
|
94
102
|
fileList.forEach((file) => {
|
|
95
103
|
const { layer, full_path, asis_source, source } = file;
|
|
96
104
|
|
|
97
|
-
// nine-tabμ shadowRoot λ΄λΆ
|
|
105
|
+
// μ΄μ μ μμ μΈ ν΅λ‘(nine-tabμ shadowRoot λ΄λΆ)λ‘ μμ νκ² μ΄μ¬ κ° μλν° νκ²ν
μΆμ
|
|
98
106
|
const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
|
|
99
107
|
|
|
100
108
|
if (diff && typeof diff.initialize === 'function') {
|
|
101
109
|
const lang = detectLanguage(full_path);
|
|
102
|
-
// μλν° ν΅μ¬ λͺ¨λ(CodeMirror) κΈ°λ μκ·Έλ μ μ‘
|
|
103
110
|
diff.initialize(asis_source || "", source || "", lang);
|
|
104
|
-
} else {
|
|
105
|
-
trace.error(`β λμ μλν° νμ μ μ€: nine-diff.${layer}`);
|
|
106
111
|
}
|
|
107
112
|
});
|
|
108
113
|
|
|
109
|
-
//
|
|
114
|
+
// μμ€ λ°μΈλ©μ΄ μλ²½ν λλ μ΅μ’
μμ μ ν¬μ»€μ± μ‘μΈμμ΄ν° κ°λ (첫 λ²μ§Έ λμ ν ν΄λ¦ κ°μ νΈλ¦¬κ±°)
|
|
110
115
|
if (this.#tabContainer && typeof this.#tabContainer.initialize === 'function') {
|
|
111
116
|
this.#tabContainer.initialize();
|
|
112
117
|
}
|
|
@@ -117,15 +122,13 @@ export class NineDiffPopup extends HTMLElement {
|
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
/**
|
|
120
|
-
* π‘ [μΌκ΄ 물리
|
|
125
|
+
* π‘ [μΌκ΄ 물리 μ μ₯]
|
|
121
126
|
*/
|
|
122
127
|
async #handleConfirmAll() {
|
|
123
128
|
const payloadList = [];
|
|
124
129
|
|
|
125
130
|
for (const file of this.#fileList) {
|
|
126
131
|
const { layer, full_path, asis_source } = file;
|
|
127
|
-
|
|
128
|
-
// μΌκ΄ μμ§ μμ μλ μμ νκ² nine-tabμ shadowRootλ₯Ό κ΄ν΅νμ¬ μ΅μ’
λ²νΌ μ€μΊ
|
|
129
132
|
const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
|
|
130
133
|
const currentContent = diff ? diff.getContents() : asis_source;
|
|
131
134
|
|