@nine-lab/nine-mu 0.1.291 β†’ 0.1.292

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.291",
3
+ "version": "0.1.292",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -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")}";` : "";
@@ -73,57 +73,60 @@ export class NineDiffPopup extends HTMLElement {
73
73
  return 'javascript';
74
74
  };
75
75
 
76
- // 1. ⏰ nine-tab μ»΄ν¬λ„ŒνŠΈμ˜ μ˜€λ¦¬μ§€λ„ 정적 νŒŒμ‹±(#renderTabs) 연산이 μ™„λ£Œλ  λ•ŒκΉŒμ§€ λ―Έμ„Έν•œ λ§ˆμ§„ 확보
76
+ // 1. ⏰ μžμ‹ nine-tab의 μ˜€λ¦¬μ§€λ„ λΌˆλŒ€ νŒŒμ‹±μ΄ μ™„λ²½νžˆ 마운트될 λ•ŒκΉŒμ§€ 1μ°¨ λŒ€κΈ°
77
77
  setTimeout(() => {
78
78
  const activeLayers = fileList.map(f => f.layer);
79
-
80
- // νƒ­ μ»΄ν¬λ„ŒνŠΈ λ‚΄λΆ€ μ„€λ„μš° λ”μœΌλ‘œ 이사 κ°„ μ‹€μ œ νƒ­ νŽ˜μ΄μ§€ λ²„νŠΌκ³Ό 컨텐츠 μ»¨ν…Œμ΄λ„ˆ μ˜μ—­ 확보
81
79
  const tabButtons = this.#tabContainer.shadowRoot.querySelectorAll('.tab-button');
82
-
83
- // 4λŒ€ κ³ μ • λ ˆμ΄μ–΄ λͺ…μ„Έ μ •μ˜
84
80
  const targetLayers = ["MyBatis", "Service", "Controller", "JavaScript"];
85
81
 
86
82
  targetLayers.forEach((layerName, index) => {
87
83
  const currentBtn = tabButtons[index];
88
- // nine-tab λ‚΄λΆ€ μ„€λ„μš° 돔에 μ‘°λ¦½λ˜μ–΄ λŒ€κΈ° 쀑인 μ‹€μ œ νŽ˜μ΄μ§€ λͺΈμ²΄ λ³Έλ¬Έ div
89
84
  const pageBody = this.#tabContainer.shadowRoot.getElementById(`content${index}`);
90
85
 
91
86
  if (!pageBody) return;
92
87
 
93
- // 이번 λ°±μ—”λ“œ μ™„λ£Œ μ‹œκ·Έλ„μ— ν•΄λ‹Ή λ ˆμ΄μ–΄ μˆ˜μ • λͺ…μ„Έκ°€ ν¬ν•¨λ˜μ–΄ μžˆλ‹€λ©΄?
94
88
  if (activeLayers.includes(layerName)) {
95
89
  const fileData = fileList.find(f => f.layer === layerName);
96
90
  const fileName = fileData.full_path.split('/').pop() || "Unknown";
97
91
 
98
- // A. 상단 νƒ­ λ²„νŠΌ ν…μŠ€νŠΈλ₯Ό μ‹€μ œ 파일λͺ…μœΌλ‘œ 동적 μ—…λ°μ΄νŠΈ 및 λ…ΈμΆœ
99
92
  if (currentBtn) {
100
93
  currentBtn.textContent = `${layerName.toUpperCase()} (${fileName})`;
101
94
  currentBtn.style.display = "unset";
102
95
  }
103
96
 
104
- // B. πŸ”₯ [핡심 μˆ˜μ •]: λ‚΄λΆ€ 에디터 슬둯만 λŸ°νƒ€μž„μ— μ‹±μ‹±ν•˜κ²Œ μ™„μ „νžˆ μƒˆλ‘œ κ΅¬μ›Œμ„œ μ£Όμž… (μ§€μ—° 차단)
97
+ // πŸ’‘ 에디터 슬둯 동적 μž¬μƒμ„±
105
98
  pageBody.innerHTML = `<nine-diff class="${layerName}"></nine-diff>`;
106
-
107
- // C. μƒˆλ‘œ νƒœμ–΄λ‚œ 동적 에디터 단말 μž₯치 μ¦‰μ‹œ μΈν„°νŽ˜μ΄μŠ€ μ΄ˆκΈ°ν™”
108
- const freshDiff = pageBody.querySelector(`nine-diff.${layerName}`);
109
- if (freshDiff) {
110
- const lang = detectLanguage(fileData.full_path);
111
- freshDiff.initialize(fileData.asis_source || "", fileData.source || "", lang);
112
- }
113
99
  } else {
114
- // 이번 νƒœμŠ€ν¬μ—μ„œ μˆ˜μ •λ˜μ§€ μ•Šμ€ μ œμ™Έ μ˜μ—­μ€ 상단 λ²„νŠΌμ„ hide μ²˜λ¦¬ν•˜μ—¬ κΉ”λ”ν•˜κ²Œ λ§ˆμŠ€ν‚Ή
115
100
  if (currentBtn) {
116
101
  currentBtn.style.display = "none";
117
102
  currentBtn.classList.remove("active");
118
103
  }
119
- pageBody.innerHTML = ""; // 컨텐츠 λ³Έλ¬Έ μ΄ˆκΈ°ν™”
104
+ pageBody.innerHTML = "";
120
105
  }
121
106
  });
122
107
 
123
- // 2. 동적 에디터 κ°±μ‹  및 λ§ˆμŠ€ν‚Ή μ™„λ£Œ ν›„, 첫 번째 ν™œμ„±ν™”(Visible)된 νƒ­μœΌλ‘œ μžλ™ 클릭 이동
124
- if (this.#tabContainer && typeof this.#tabContainer.initialize === 'function') {
125
- this.#tabContainer.initialize();
126
- }
108
+ // 2. ⚑ [결정적 ν¬λž˜μ‹œ ν•΄κ²° μž₯치]:
109
+ // λΈŒλΌμš°μ €κ°€ 동적 μ£Όμž…λœ <nine-diff>의 λ‚΄λΆ€ CodeMirror μΈμŠ€ν„΄μŠ€ λ Œλ”λ§μ„ μ™„μ „νžˆ 마칠 λ•ŒκΉŒμ§€
110
+ // ν”„λ ˆμž„ 연산을 2단계(더블 ν‹±) μ§€μ—°μ‹œμΌœ μ•ˆμ „ 기동 큐λ₯Ό ν™•λ³΄ν•©λ‹ˆλ‹€.
111
+ requestAnimationFrame(() => {
112
+ requestAnimationFrame(() => {
113
+ fileList.forEach((file) => {
114
+ const { layer, full_path, asis_source, source } = file;
115
+ const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
116
+
117
+ if (diff && typeof diff.initialize === 'function') {
118
+ const lang = detectLanguage(full_path);
119
+ // λ‚΄λΆ€ CodeMirror ν”„λ ˆμž„μ›Œν¬κ°€ μ™„μ „νžˆ ready 된 μ‹œμ μ— 데이터λ₯Ό λ°”μΈλ”©ν•©λ‹ˆλ‹€.
120
+ diff.initialize(asis_source || "", source || "", lang);
121
+ }
122
+ });
123
+
124
+ // 데이터 μ£Όμž… μ™„λ£Œ ν›„ 첫 ν™œμ„± νƒ­μœΌλ‘œ ν™”λ©΄ μ „ν™˜ 포컀싱
125
+ if (this.#tabContainer && typeof this.#tabContainer.initialize === 'function') {
126
+ this.#tabContainer.initialize();
127
+ }
128
+ });
129
+ });
127
130
 
128
131
  }, 120);
129
132
 
@@ -138,8 +141,6 @@ export class NineDiffPopup extends HTMLElement {
138
141
 
139
142
  for (const file of this.#fileList) {
140
143
  const { layer, full_path, asis_source } = file;
141
-
142
- // nine-tab λ‚΄λΆ€ μ„€λ„μš° μ˜μ—­ μ•ˆμ—μ„œ 동적 가동 쀑인 에디터 컨텐츠 νƒ€κ²ŸνŒ… 캑처
143
144
  const diff = this.#tabContainer.shadowRoot.querySelector(`nine-diff.${layer}`);
144
145
  const currentContent = diff ? diff.getContents() : asis_source;
145
146