@nine-lab/nine-mu 0.1.341 โ 0.1.343
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 +46 -23
- 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 +38 -18
package/package.json
CHANGED
|
@@ -68,13 +68,32 @@ export class ExceptionHook extends HTMLElement {
|
|
|
68
68
|
#renderer = () => {
|
|
69
69
|
const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
|
|
70
70
|
|
|
71
|
+
// ๐ฏ [์์ 1] ๊ธ๋ก๋ฒ ๋ก๋ฉ ์ค๋ฒ๋ ์ด๋ฅผ ํ๋ฉด ์ ์ฒด์์ ์ฐ์ด๋๋ฅด๊ธฐ ์ํ ํธ์คํธ ๋ฐ ๋ ์ด์ด ์คํ์ผ ๋ด์ฅ
|
|
71
72
|
this.shadowRoot.innerHTML = `
|
|
72
73
|
<style>
|
|
73
74
|
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${__APP_VERSION__}/dist/css/nine-mu.css";
|
|
74
75
|
${customImport}
|
|
76
|
+
|
|
77
|
+
:host {
|
|
78
|
+
display: block;
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
}
|
|
82
|
+
/* ์ด๋ค ๋ก๋ฉ ๋ ์ด์ด๊ฐ ๋๊ณ ์์ด๋ ๋ทฐํฌํธ ๊ธฐ์ค ๋ฌด์กฐ๊ฑด ๋งจ ์(์ต์๋จ)์ผ๋ก ๋นผ๋ฒ๋ฆฌ๋ ์ ๋ ๋ฐฉ์ด ํด๋์ค */
|
|
83
|
+
.nine-hook-full-overlay {
|
|
84
|
+
position: fixed !important;
|
|
85
|
+
top: 0 !important;
|
|
86
|
+
left: 0 !important;
|
|
87
|
+
width: 100vw !important;
|
|
88
|
+
height: 100vh !important;
|
|
89
|
+
box-sizing: border-box !important;
|
|
90
|
+
background-color: #FFF5F5 !important;
|
|
91
|
+
z-index: 99999999 !important;
|
|
92
|
+
overflow: auto !important;
|
|
93
|
+
}
|
|
75
94
|
</style>
|
|
76
95
|
|
|
77
|
-
<div class="nine-hook-core">
|
|
96
|
+
<div class="nine-hook-core" style="width: 100%; height: 100%;">
|
|
78
97
|
<slot></slot>
|
|
79
98
|
</div>
|
|
80
99
|
<div class="nine-exception-board"></div>
|
|
@@ -141,7 +160,7 @@ export class ExceptionHook extends HTMLElement {
|
|
|
141
160
|
const coreContainer = this.shadowRoot.querySelector('.nine-hook-core');
|
|
142
161
|
if (coreContainer) coreContainer.style.display = '';
|
|
143
162
|
}
|
|
144
|
-
},
|
|
163
|
+
}, 50); // ๋ผ์ฐํ
์๋ฃ ๋๊ธฐ ์๊ฐ์ ์ํด ๋ฏธ์ธ ์ํฅ (50ms)
|
|
145
164
|
}
|
|
146
165
|
|
|
147
166
|
#sendToAiAction = async (errorMessage, errorStack) => {
|
|
@@ -180,45 +199,46 @@ export class ExceptionHook extends HTMLElement {
|
|
|
180
199
|
if (this.#hasError) return;
|
|
181
200
|
this.#hasError = true;
|
|
182
201
|
|
|
183
|
-
// ๐ฏ [ํต์ฌ] ๋ฆฌ์กํธ๊ฐ ์๋ฌ ๋ฐ์ ํ ํ์ DOM์ Unmount/์กฐ์ํ๋ ๋๊ธฐ์ ์ธ ํ์ด๋ฐ์
|
|
184
|
-
// ์์ ํ ํ๋ ค๋ณด๋ธ ๋ค(setTimeout 0)์ ์์ ํ๊ฒ Web Component UI๋ฅผ ๊ฝ์ ๋ฃ์ต๋๋ค.
|
|
185
202
|
setTimeout(() => {
|
|
186
|
-
|
|
203
|
+
trace.log("๐จ [nine-exception-hook] ๋ฆฌ์กํธ ์ฌ์ดํด ์ข
๋ฃ ํ ์๋ฌ UI ์ต์ข
๋ ๋๋ง");
|
|
187
204
|
|
|
188
205
|
const coreContainer = this.shadowRoot.querySelector('.nine-hook-core');
|
|
189
206
|
if (coreContainer) {
|
|
190
207
|
coreContainer.style.display = 'none';
|
|
191
|
-
|
|
208
|
+
trace.log("๐จ [nine-exception-hook] <slot> ๋ณธ๋ฌธ ์์ญ ์ปจํ
์ด๋ ์จ๊น");
|
|
192
209
|
}
|
|
193
210
|
|
|
194
211
|
const exceptionBoard = this.shadowRoot.querySelector('.nine-exception-board');
|
|
195
212
|
if (!exceptionBoard) {
|
|
196
|
-
|
|
213
|
+
trace.error("โ [nine-exception-hook] .nine-exception-board ์๋ฆฌ๋จผํธ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.");
|
|
197
214
|
return;
|
|
198
215
|
}
|
|
199
216
|
|
|
217
|
+
// ๐ฏ [์์ 2] ์๋ฌ HTML ์ปจํ
์ด๋ ๊ตฌ์กฐ๋ฅผ ํ๋ฉด ์ ์ฒด ๋ทฐํฌํธ๋ฅผ ์ฅ์
ํ๋ ๊ณ ์ ๋ ์ด์์ ๊ตฌ์กฐ๋ก ๋ฉํ
|
|
200
218
|
const errorHTML = `
|
|
201
|
-
<div class="nine-
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
219
|
+
<div class="nine-hook-full-overlay">
|
|
220
|
+
<div class="nine-error-container" style="padding: 40px; max-width: 1200px; margin: 40px auto; font-family: sans-serif; background: white; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.08); text-align: left;">
|
|
221
|
+
<h3 class="nine-error-title" style="color: #C53030; margin-top: 0; font-size: 22px; font-weight: 700; border-bottom: 2px solid #FED2D2; padding-bottom: 12px;">โ ๏ธ ์์คํ
์์ธ ๊ฐ์ง (${this.tagName.toLowerCase()})</h3>
|
|
222
|
+
<p class="nine-error-label" style="font-weight: bold; margin: 20px 0 8px 0; color: #4A5568; font-size: 15px;">[์๋ฌ ์์ธ ๋ก๊ทธ]:</p>
|
|
223
|
+
<pre class="nine-error-log" style="background: #1A202C; color: #EDF2F7; padding: 20px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; font-family: monospace; font-size: 14px; line-height: 1.6; margin-bottom: 25px;">${errorMessage}\n\n[Stack Trace]\n${errorStack}</pre>
|
|
224
|
+
|
|
225
|
+
<div class="nine-action-area" style="display: flex; align-items: center; gap: 20px; border-top: 1px solid #E2E8F0; padding-top: 20px;">
|
|
226
|
+
<button class="nine-ai-btn" style="background: #3182CE; color: white; border: none; padding: 14px 28px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 16px; transition: background 0.2s;">๐ค AI์๊ฒ ์์ค์ฝ๋ ์์ ์์ฒญ</button>
|
|
227
|
+
<div class="nine-error-footer" style="font-size: 14px; color: #718096; line-height: 1.4;">
|
|
228
|
+
๋ฒํผ์ ๋๋ฅด๋ฉด AI๊ฐ ๋ก๊ทธ ๋ฐ ์ปดํฌ๋ํธ ๋งต์ ์ญ์ถ์ ํ์ฌ ์์ ์ ์์ํฉ๋๋ค.
|
|
229
|
+
</div>
|
|
210
230
|
</div>
|
|
211
231
|
</div>
|
|
212
232
|
</div>
|
|
213
233
|
`;
|
|
214
234
|
|
|
215
235
|
exceptionBoard.innerHTML = errorHTML;
|
|
216
|
-
|
|
236
|
+
trace.log("๐จ [nine-exception-hook] Shadow DOM์ ์๋ฌ UI ์ต์ข
์ฝ์
์ฑ๊ณต");
|
|
217
237
|
|
|
218
238
|
const aiBtn = this.shadowRoot.querySelector('.nine-ai-btn');
|
|
219
239
|
if (aiBtn) {
|
|
220
240
|
aiBtn.addEventListener('click', () => this.#sendToAiAction(errorMessage, errorStack));
|
|
221
|
-
|
|
241
|
+
trace.log("๐จ [nine-exception-hook] AI ์์ฒญ ๋ฒํผ ์ด๋ฒคํธ ๋ฆฌ์ค๋ ์ต์ข
๋ฐ์ธ๋ฉ ์ฑ๊ณต");
|
|
222
242
|
}
|
|
223
243
|
}, 0);
|
|
224
244
|
}
|