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

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.289",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -29,44 +29,6 @@ export class NineDiffPopup extends HTMLElement {
29
29
  <style>
30
30
  @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${appVersion}/dist/css/nine-mu.css";
31
31
  ${customImport}
32
-
33
- .main-layout {
34
- display: flex;
35
- flex-direction: column;
36
- height: 80vh;
37
- width: 85vw;
38
- min-width: 800px;
39
- }
40
- .tab-area {
41
- flex: 1;
42
- overflow: hidden;
43
- display: flex;
44
- flex-direction: column;
45
- }
46
- nine-tab {
47
- flex: 1;
48
- display: flex;
49
- flex-direction: column;
50
- height: 100%;
51
- }
52
- /* πŸ’‘ ν•˜μ–—κ²Œ μ•ˆ λ³΄μ΄λŠ” ν˜„μƒμ„ λ°©μ§€ν•˜κΈ° μœ„ν•΄ 에디터 μ˜μ—­μ˜ 높이λ₯Ό ν™•μ‹€νžˆ 보μž₯ */
53
- .diff-wrapper {
54
- height: calc(80vh - 160px);
55
- width: 100%;
56
- display: block;
57
- }
58
- nine-diff {
59
- display: block;
60
- width: 100%;
61
- height: 100%;
62
- }
63
- .footer {
64
- display: flex;
65
- justify-content: flex-end;
66
- gap: 10px;
67
- padding: 15px 0 0 0;
68
- border-top: 1px solid #e5e7eb;
69
- }
70
32
  </style>
71
33
 
72
34
  <nine-dialog>
@@ -96,18 +58,16 @@ export class NineDiffPopup extends HTMLElement {
96
58
 
97
59
  /**
98
60
  * πŸ’‘ [정석 데이터 μœ„μž„ 연동 μ—”μ§„]
99
- * @param {Array} fileList - [{ layer: "MyBatis", full_path: "...", asis_source: "...", source: "..." }]
100
61
  */
101
62
  async data(fileList) {
102
63
  if (!Array.isArray(fileList) || fileList.length === 0) return this;
103
64
  this.#fileList = fileList;
104
65
 
105
- // 1. 🧼 nine-tab 내뢀에 κ΅¬μΆ•λœ 일괄 μ •ν™” APIλ₯Ό ν˜ΈμΆœν•˜μ—¬ κΈ°μ‘΄ 버퍼 μ™„μ „ 리셋 (React 가상 DOM 좩돌 차단)
66
+ // 1. 🧼 κΈ°μ‘΄ 동적 버퍼 μ™„μ „ 리셋
106
67
  if (this.#tabContainer && typeof this.#tabContainer.clearTabs === 'function') {
107
68
  this.#tabContainer.clearTabs();
108
69
  }
109
70
 
110
- // ν™•μž₯자 기반 주석/μ–Έμ–΄ μœ μΆ” 헬퍼
111
71
  const detectLanguage = (path) => {
112
72
  const lower = (path || "").toLowerCase();
113
73
  if (lower.endsWith('.xml')) return 'xml';
@@ -116,44 +76,46 @@ export class NineDiffPopup extends HTMLElement {
116
76
  return 'javascript';
117
77
  };
118
78
 
119
- // 2. ⚑ λ°±μ—”λ“œ 쑰립 μ™„λ£Œ 데이터λ₯Ό μˆœνšŒν•˜λ©° 선언적 μ£Όμž… 기동
79
+ // 2. ⚑ λ°±μ—”λ“œ 쑰립 데이터λ₯Ό μˆœνšŒν•˜λ©° νƒ­ μŠ€μΌ€ν΄λ”© λΉŒλ“œ
120
80
  fileList.forEach((file) => {
121
- const { layer, full_path, asis_source, source } = file;
81
+ const { layer, full_path } = file;
122
82
  const fileName = full_path.split('/').pop() || "Unknown";
123
83
  const captionName = `${layer.toUpperCase()} (${fileName})`;
124
84
 
125
- // λ‚΄λΆ€ λž˜νΌμ™€ 에디터 λΌˆλŒ€ λ§ˆν¬μ—… μ€€λΉ„
85
+ // πŸ’‘ νƒ­ 내뢀에 μ£Όμž…λ  에디터 λΌˆλŒ€ λ§ˆν¬μ—… μ€€λΉ„
126
86
  const targetHtmlContent = `
127
87
  <div class="diff-wrapper">
128
88
  <nine-diff class="${layer}"></nine-diff>
129
89
  </div>
130
90
  `;
131
91
 
132
- // 3. πŸš€ nine-tab ν™•μž₯ μΈν„°νŽ˜μ΄μŠ€λ₯Ό ν˜ΈμΆœν•˜μ—¬ ν‘œμ€€ Light DOM νŠΈλ¦¬μ— μ•ˆμ „ν•˜κ²Œ νƒ‘μž¬
133
92
  if (this.#tabContainer && typeof this.#tabContainer.addTabPage === 'function') {
134
93
  this.#tabContainer.addTabPage(captionName, targetHtmlContent);
135
94
  }
136
95
  });
137
96
 
138
- // 4. ⏰ 쑰립 λ¦¬λΉŒλ“œκ°€ λλ‚œ ν›„, μ„€λ„μš° 돔 내에 바인딩 μ™„λ£Œλœ 각 에디터 μž₯μΉ˜λ“€μ— 순수 μ†ŒμŠ€μ½”λ“œ μ£Όμž… μ‹€ν–‰
139
- // (addTabPage λ‚΄λΆ€μ—μ„œ refresh()와 initialize()κ°€ 돌기 λ•Œλ¬Έμ— λΆ€λ“œλŸ½κ²Œ 돔을 λŒνŒŒν•©λ‹ˆλ‹€)
97
+ // 3. ⏰ [핡심 μˆ˜μ •]: 마운트 μ™„λ£Œ ν›„, nine-tab의 Shadow DOM λ‚΄λΆ€λ‘œ κΉŠμˆ™μ΄ νŒŒκ³ λ“€μ–΄ 에디터λ₯Ό μ…€λ ‰νŒ…ν•©λ‹ˆλ‹€.
140
98
  setTimeout(() => {
141
99
  fileList.forEach((file) => {
142
100
  const { layer, full_path, asis_source, source } = file;
143
- const diff = this.shadowRoot.querySelector(`nine-tab`).shadowRoot.querySelector(`nine-diff.${layer}`);
101
+
102
+ // 🎯 λ³€κ²½ 포인트: λ Œλ”λ§ 결과물은 nine-tab μ»΄ν¬λ„ŒνŠΈ λ‚΄λΆ€ μ„€λ„μš° 루트 μ•ˆμ— μ•ˆμ°©ν•΄ μžˆμŠ΅λ‹ˆλ‹€!
103
+ const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
144
104
 
145
105
  if (diff) {
146
106
  const lang = detectLanguage(full_path);
147
107
  diff.initialize(asis_source || "", source || "", lang);
108
+ } else {
109
+ trace.error(`❌ 에디터 탐색 μ‹€νŒ¨: nine-diff.${layer}`);
148
110
  }
149
111
  });
150
- }, 50); // μ•ˆμ „ 마운트λ₯Ό μœ„ν•œ μ΅œμ†Œν•œμ˜ ν‹± λ””λ ˆμ΄μ§• λ§ˆμ§„λ§Œ μœ μ§€
112
+ }, 150); // 돔 νŠΈλž˜ν‚Ή μ•ˆμ •μ„±μ„ μœ„ν•΄ λ§ˆμ§„ 확보
151
113
 
152
114
  return this;
153
115
  }
154
116
 
155
117
  /**
156
- * πŸ’‘ [일괄 물리 파일 λΌμ΄νŒ…]
118
+ * πŸ’‘ [일괄 물리 μ €μž₯]
157
119
  */
158
120
  async #handleConfirmAll() {
159
121
  const payloadList = [];
@@ -161,8 +123,8 @@ export class NineDiffPopup extends HTMLElement {
161
123
  for (const file of this.#fileList) {
162
124
  const { layer, full_path, asis_source } = file;
163
125
 
164
- // nine-tab의 Shadow DOM 내뢀에 μΊ‘μŠν™”λ˜μ–΄ λ Œλ”λ§λœ 에디터 μΈμŠ€ν„΄μŠ€ νƒ€κ²Ÿ μ…€λ ‰νŒ… 좔적
165
- const diff = this.shadowRoot.querySelector(`nine-tab`).shadowRoot.querySelector(`nine-diff.${layer}`);
126
+ // 🎯 λ³€κ²½ 포인트: μ €μž₯ μ‹œμ μ—λ„ nine-tab의 shadowRootλ₯Ό κ²½μœ ν•˜μ—¬ μ΅œμ’… μˆ˜μ •λ³Έ μ†ŒμŠ€λ₯Ό μΊ‘μ²˜ν•©λ‹ˆλ‹€.
127
+ const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
166
128
  const currentContent = diff ? diff.getContents() : asis_source;
167
129
 
168
130
  payloadList.push({
@@ -175,7 +137,6 @@ export class NineDiffPopup extends HTMLElement {
175
137
 
176
138
  try {
177
139
  await api.post(`/nine-mu/source/generateJsonFileBatch`, { fileList: payloadList });
178
-
179
140
  await nine.alert("μš”μ²­ν•˜μ‹  λͺ¨λ“  파일의 μ†ŒμŠ€ λ³€κ²½ 사항이 μ„±κ³΅μ μœΌλ‘œ λ°˜μ˜λ˜μ—ˆμŠ΅λ‹ˆλ‹€.");
180
141
  this.#dialog.close();
181
142
  } catch (error) {