@nine-lab/nine-mu 0.1.287 β†’ 0.1.288

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nine-lab/nine-mu",
3
- "version": "0.1.287",
3
+ "version": "0.1.288",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -49,7 +49,7 @@ export class NineDiffPopup extends HTMLElement {
49
49
  flex-direction: column;
50
50
  height: 100%;
51
51
  }
52
- /* πŸ’‘ ν•˜μ–—κ²Œ μ•ˆ λ³΄μ΄λŠ” ν˜„μƒμ„ λ°©μ§€ν•˜κΈ° μœ„ν•΄ 에디터 μ˜μ—­μ˜ 높이λ₯Ό ν™•μ‹€νžˆ 보μž₯ */
52
+ /* πŸ’‘ 에디터 μ˜μ—­μ˜ κ°€μ‹œμ„± 및 λ„ˆλΉ„/높이 ν•œκ³„μ„  κ³ μ • */
53
53
  .diff-wrapper {
54
54
  height: calc(80vh - 160px);
55
55
  width: 100%;
@@ -96,18 +96,16 @@ export class NineDiffPopup extends HTMLElement {
96
96
 
97
97
  /**
98
98
  * πŸ’‘ [정석 데이터 μœ„μž„ 연동 μ—”μ§„]
99
- * @param {Array} fileList - [{ layer: "MyBatis", full_path: "...", asis_source: "...", source: "..." }]
100
99
  */
101
100
  async data(fileList) {
102
101
  if (!Array.isArray(fileList) || fileList.length === 0) return this;
103
102
  this.#fileList = fileList;
104
103
 
105
- // 1. 🧼 nine-tab 내뢀에 κ΅¬μΆ•λœ 일괄 μ •ν™” APIλ₯Ό ν˜ΈμΆœν•˜μ—¬ κΈ°μ‘΄ 버퍼 μ™„μ „ 리셋 (React 가상 DOM 좩돌 차단)
104
+ // 1. 🧼 κΈ°μ‘΄ 동적 버퍼 μ™„μ „ 리셋
106
105
  if (this.#tabContainer && typeof this.#tabContainer.clearTabs === 'function') {
107
106
  this.#tabContainer.clearTabs();
108
107
  }
109
108
 
110
- // ν™•μž₯자 기반 주석/μ–Έμ–΄ μœ μΆ” 헬퍼
111
109
  const detectLanguage = (path) => {
112
110
  const lower = (path || "").toLowerCase();
113
111
  if (lower.endsWith('.xml')) return 'xml';
@@ -116,44 +114,46 @@ export class NineDiffPopup extends HTMLElement {
116
114
  return 'javascript';
117
115
  };
118
116
 
119
- // 2. ⚑ λ°±μ—”λ“œ 쑰립 μ™„λ£Œ 데이터λ₯Ό μˆœνšŒν•˜λ©° 선언적 μ£Όμž… 기동
117
+ // 2. ⚑ λ°±μ—”λ“œ 쑰립 데이터λ₯Ό μˆœνšŒν•˜λ©° νƒ­ μŠ€μΌ€ν΄λ”© λΉŒλ“œ
120
118
  fileList.forEach((file) => {
121
- const { layer, full_path, asis_source, source } = file;
119
+ const { layer, full_path } = file;
122
120
  const fileName = full_path.split('/').pop() || "Unknown";
123
121
  const captionName = `${layer.toUpperCase()} (${fileName})`;
124
122
 
125
- // λ‚΄λΆ€ λž˜νΌμ™€ 에디터 λΌˆλŒ€ λ§ˆν¬μ—… μ€€λΉ„
123
+ // πŸ’‘ νƒ­ 내뢀에 μ£Όμž…λ  에디터 λΌˆλŒ€ λ§ˆν¬μ—… μ€€λΉ„
126
124
  const targetHtmlContent = `
127
125
  <div class="diff-wrapper">
128
126
  <nine-diff class="${layer}"></nine-diff>
129
127
  </div>
130
128
  `;
131
129
 
132
- // 3. πŸš€ nine-tab ν™•μž₯ μΈν„°νŽ˜μ΄μŠ€λ₯Ό ν˜ΈμΆœν•˜μ—¬ ν‘œμ€€ Light DOM νŠΈλ¦¬μ— μ•ˆμ „ν•˜κ²Œ νƒ‘μž¬
133
130
  if (this.#tabContainer && typeof this.#tabContainer.addTabPage === 'function') {
134
131
  this.#tabContainer.addTabPage(captionName, targetHtmlContent);
135
132
  }
136
133
  });
137
134
 
138
- // 4. ⏰ 쑰립 λ¦¬λΉŒλ“œκ°€ λλ‚œ ν›„, μ„€λ„μš° 돔 내에 바인딩 μ™„λ£Œλœ 각 에디터 μž₯μΉ˜λ“€μ— 순수 μ†ŒμŠ€μ½”λ“œ μ£Όμž… μ‹€ν–‰
139
- // (addTabPage λ‚΄λΆ€μ—μ„œ refresh()와 initialize()κ°€ 돌기 λ•Œλ¬Έμ— λΆ€λ“œλŸ½κ²Œ 돔을 λŒνŒŒν•©λ‹ˆλ‹€)
135
+ // 3. ⏰ [핡심 μˆ˜μ •]: 마운트 μ™„λ£Œ ν›„, nine-tab의 Shadow DOM λ‚΄λΆ€λ‘œ κΉŠμˆ™μ΄ νŒŒκ³ λ“€μ–΄ 에디터λ₯Ό μ…€λ ‰νŒ…ν•©λ‹ˆλ‹€.
140
136
  setTimeout(() => {
141
137
  fileList.forEach((file) => {
142
138
  const { layer, full_path, asis_source, source } = file;
143
- const diff = this.shadowRoot.querySelector(`nine-tab`).shadowRoot.querySelector(`nine-diff.${layer}`);
139
+
140
+ // 🎯 λ³€κ²½ 포인트: λ Œλ”λ§ 결과물은 nine-tab μ»΄ν¬λ„ŒνŠΈ λ‚΄λΆ€ μ„€λ„μš° 루트 μ•ˆμ— μ•ˆμ°©ν•΄ μžˆμŠ΅λ‹ˆλ‹€!
141
+ const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
144
142
 
145
143
  if (diff) {
146
144
  const lang = detectLanguage(full_path);
147
145
  diff.initialize(asis_source || "", source || "", lang);
146
+ } else {
147
+ trace.error(`❌ 에디터 탐색 μ‹€νŒ¨: nine-diff.${layer}`);
148
148
  }
149
149
  });
150
- }, 50); // μ•ˆμ „ 마운트λ₯Ό μœ„ν•œ μ΅œμ†Œν•œμ˜ ν‹± λ””λ ˆμ΄μ§• λ§ˆμ§„λ§Œ μœ μ§€
150
+ }, 150); // 돔 νŠΈλž˜ν‚Ή μ•ˆμ •μ„±μ„ μœ„ν•΄ λ§ˆμ§„ 확보
151
151
 
152
152
  return this;
153
153
  }
154
154
 
155
155
  /**
156
- * πŸ’‘ [일괄 물리 파일 λΌμ΄νŒ…]
156
+ * πŸ’‘ [일괄 물리 μ €μž₯]
157
157
  */
158
158
  async #handleConfirmAll() {
159
159
  const payloadList = [];
@@ -161,8 +161,8 @@ export class NineDiffPopup extends HTMLElement {
161
161
  for (const file of this.#fileList) {
162
162
  const { layer, full_path, asis_source } = file;
163
163
 
164
- // nine-tab의 Shadow DOM 내뢀에 μΊ‘μŠν™”λ˜μ–΄ λ Œλ”λ§λœ 에디터 μΈμŠ€ν„΄μŠ€ νƒ€κ²Ÿ μ…€λ ‰νŒ… 좔적
165
- const diff = this.shadowRoot.querySelector(`nine-tab`).shadowRoot.querySelector(`nine-diff.${layer}`);
164
+ // 🎯 λ³€κ²½ 포인트: μ €μž₯ μ‹œμ μ—λ„ nine-tab의 shadowRootλ₯Ό κ²½μœ ν•˜μ—¬ μ΅œμ’… μˆ˜μ •λ³Έ μ†ŒμŠ€λ₯Ό μΊ‘μ²˜ν•©λ‹ˆλ‹€.
165
+ const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
166
166
  const currentContent = diff ? diff.getContents() : asis_source;
167
167
 
168
168
  payloadList.push({
@@ -175,7 +175,6 @@ export class NineDiffPopup extends HTMLElement {
175
175
 
176
176
  try {
177
177
  await api.post(`/nine-mu/source/generateJsonFileBatch`, { fileList: payloadList });
178
-
179
178
  await nine.alert("μš”μ²­ν•˜μ‹  λͺ¨λ“  파일의 μ†ŒμŠ€ λ³€κ²½ 사항이 μ„±κ³΅μ μœΌλ‘œ λ°˜μ˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€.");
180
179
  this.#dialog.close();
181
180
  } catch (error) {