@nine-lab/nine-mu 0.1.340 β 0.1.342
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 +41 -39
- 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 +1 -1
- package/src/components/exception/ExceptionHook.js +37 -32
package/package.json
CHANGED
|
@@ -177,45 +177,50 @@ export class ExceptionHook extends HTMLElement {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
#renderError(errorMessage, errorStack) {
|
|
180
|
-
|
|
180
|
+
if (this.#hasError) return;
|
|
181
|
+
this.#hasError = true;
|
|
181
182
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
trace.log("π¨ [nine-exception-hook]
|
|
186
|
-
} else {
|
|
187
|
-
trace.error("β [nine-exception-hook] .nine-hook-core μ리먼νΈλ₯Ό μ°Ύμ μ μμ΅λλ€.");
|
|
188
|
-
}
|
|
183
|
+
// π― [ν΅μ¬] 리μ‘νΈκ° μλ¬ λ°μ ν νμ DOMμ Unmount/μ‘°μνλ λκΈ°μ μΈ νμ΄λ°μ
|
|
184
|
+
// μμ ν νλ €λ³΄λΈ λ€(setTimeout 0)μ μμ νκ² Web Component UIλ₯Ό κ½μ λ£μ΅λλ€.
|
|
185
|
+
setTimeout(() => {
|
|
186
|
+
trace.log("π¨ [nine-exception-hook] 리μ‘νΈ μ¬μ΄ν΄ μ’
λ£ ν μλ¬ UI μ΅μ’
λ λλ§");
|
|
189
187
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
const coreContainer = this.shadowRoot.querySelector('.nine-hook-core');
|
|
189
|
+
if (coreContainer) {
|
|
190
|
+
coreContainer.style.display = 'none';
|
|
191
|
+
trace.log("π¨ [nine-exception-hook] <slot> λ³Έλ¬Έ μμ 컨ν
μ΄λ μ¨κΉ");
|
|
192
|
+
}
|
|
195
193
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
<
|
|
205
|
-
|
|
194
|
+
const exceptionBoard = this.shadowRoot.querySelector('.nine-exception-board');
|
|
195
|
+
if (!exceptionBoard) {
|
|
196
|
+
trace.error("β [nine-exception-hook] .nine-exception-board μ리먼νΈλ₯Ό μ°Ύμ μ μμ΅λλ€.");
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const errorHTML = `
|
|
201
|
+
<div class="nine-error-container">
|
|
202
|
+
<h3 class="nine-error-title">β οΈ μμ€ν
μμΈ κ°μ§ (${this.tagName.toLowerCase()})</h3>
|
|
203
|
+
<p class="nine-error-label">[μλ¬ μμΈ λ‘κ·Έ]:</p>
|
|
204
|
+
<pre class="nine-error-log">${errorMessage}</pre>
|
|
205
|
+
|
|
206
|
+
<div class="nine-action-area" style="margin-top: 20px; display: flex; align-items: center; gap: 15px;">
|
|
207
|
+
<button class="nine-ai-btn">π€ AIμκ² μμ€μ½λ μμ μμ²</button>
|
|
208
|
+
<div class="nine-error-footer">
|
|
209
|
+
λ²νΌμ λλ₯΄λ©΄ AIκ° λ‘κ·Έ λ° μ»΄ν¬λνΈ λ§΅μ μμΆμ νμ¬ μμ μ μμν©λλ€.
|
|
210
|
+
</div>
|
|
206
211
|
</div>
|
|
207
212
|
</div>
|
|
208
|
-
|
|
209
|
-
`;
|
|
213
|
+
`;
|
|
210
214
|
|
|
211
|
-
|
|
212
|
-
|
|
215
|
+
exceptionBoard.innerHTML = errorHTML;
|
|
216
|
+
trace.log("π¨ [nine-exception-hook] Shadow DOMμ μλ¬ UI μ΅μ’
μ½μ
μ±κ³΅");
|
|
213
217
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
const aiBtn = this.shadowRoot.querySelector('.nine-ai-btn');
|
|
219
|
+
if (aiBtn) {
|
|
220
|
+
aiBtn.addEventListener('click', () => this.#sendToAiAction(errorMessage, errorStack));
|
|
221
|
+
trace.log("π¨ [nine-exception-hook] AI μμ² λ²νΌ μ΄λ²€νΈ 리μ€λ μ΅μ’
λ°μΈλ© μ±κ³΅");
|
|
222
|
+
}
|
|
223
|
+
}, 0);
|
|
219
224
|
}
|
|
220
225
|
}
|
|
221
226
|
|