@nine-lab/nine-mu 0.1.383 โ†’ 0.1.385

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.383",
3
+ "version": "0.1.385",
4
4
  "description": "AI-Driven Full-Stack Code Fabrication Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/nine-mu.umd.js",
@@ -205,22 +205,21 @@ class NineExceptionHook extends React.Component {
205
205
  // ==========================================
206
206
  // ๐ŸŽฏ 3. ํ•ต์‹ฌ: ์™ธ๋ถ€ ์ฃผ์ž…ํ˜• 404 ๋ผ์šฐํŒ… ๊ธฐ๋Šฅ ํƒ‘์žฌ
207
207
  // ==========================================
208
- export function NineHook({ menuUrl, views, error404, onCatch, fallback, styles, containerStyle }) {
208
+ // ==========================================
209
+ // ๐ŸŽฏ 3. ์ตœ์ข… ์™„๊ฒฐ: ์ž์‹ ์ปดํฌ๋„ŒํŠธ(children)๋ฅผ ์ˆ˜์šฉํ•˜๋Š” ๊ตฌ์กฐ๋กœ ๋ณ€๊ฒฝ
210
+ // ==========================================
211
+ export function NineHook({ children, menuUrl, views, error404, onCatch, fallback, styles, containerStyle }) {
209
212
  const [menuData, setMenuData] = useState([]);
210
213
 
211
- // ๐ŸŽฏ 1. ๋Ÿฐํƒ€์ž„ ๋™์  fetch ํ•จ์ˆ˜ ๋ถ„๋ฆฌ
212
214
  const fetchRoutes = async () => {
213
215
  if (!menuUrl) return;
214
216
  try {
215
- // ํƒ€์ž„์Šคํƒฌํ”„(?t=...)๋ฅผ ์ฃผ์–ด ๋ธŒ๋ผ์šฐ์ € ์บ์‹œ๋ฅผ ๋ฌด์กฐ๊ฑด ํŒŒ๊ดดํ•˜๊ณ  ํ•˜๋“œ๋””์Šคํฌ์˜ ๋‚ ๊ฒƒ ํŒŒ์ผ ๋‚ด์šฉ์„ ๊ฐ€์ ธ์˜ด
216
217
  const response = await fetch(`${menuUrl}?t=${Date.now()}`);
217
218
  if (response.ok) {
218
219
  const data = await response.json();
219
-
220
- // ๐Ÿ’ก ๊ธฐ์กด ๋ฐ์ดํ„ฐ์™€ ์ƒˆ๋กœ ๊ฐ€์ ธ์˜จ ๋ฐ์ดํ„ฐ๊ฐ€ ๋‹ค๋ฅผ ๋•Œ๋งŒ ์ƒํƒœ๋ฅผ ์—…๋ฐ์ดํŠธํ•˜์—ฌ ๋ฌดํ•œ ๋ฃจํ”„ ๋ฐฉ์ง€
221
220
  setMenuData((prev) => {
222
221
  if (JSON.stringify(prev) === JSON.stringify(data)) return prev;
223
- console.log("๐Ÿ”ฅ [Nine-Library] AI์— ์˜ํ•œ routes.json ๋ณ€๊ฒฝ ๊ฐ์ง€ -> ๋ฉ”๋‰ด ๋ฐ ๋ผ์šฐํ„ฐ ์‹ค์‹œ๊ฐ„ ๋™๊ธฐํ™” ์™„๋ฃŒ");
222
+ console.log("๐Ÿ”ฅ [Nine-Library] routes.json ๋ณ€๊ฒฝ ๊ฐ์ง€ -> ์ „์ฒด ์‹œ์Šคํ…œ ๋™๊ธฐํ™”");
224
223
  return data;
225
224
  });
226
225
  }
@@ -229,16 +228,10 @@ export function NineHook({ menuUrl, views, error404, onCatch, fallback, styles,
229
228
  }
230
229
  };
231
230
 
232
- // ๐ŸŽฏ 2. ์‹ค์‹œ๊ฐ„ ๋ฐ˜์‘ํ˜• ํŠธ๋ฆฌ๊ฑฐ ์—”์ง„ ์ฒด์ธ
233
231
  useEffect(() => {
234
- // ์ตœ์ดˆ ๋กœ๋“œ ์‹œ ์‹คํ–‰
235
232
  fetchRoutes();
236
-
237
- // ๐Ÿ’ก ํŠธ๋ฆฌ๊ฑฐ A: AI๊ฐ€ ์ฝ”๋“œ๋ฅผ ๊ณ ์น˜๊ณ  ์ฃผ์†Œ๋ฅผ ๋ฐ”๊ฟจ์„ ๋•Œ(popstate/click) ์ฆ‰์‹œ ๋™๊ธฐํ™”
238
233
  window.addEventListener('popstate', fetchRoutes);
239
234
  document.addEventListener('click', fetchRoutes, true);
240
-
241
- // ๐Ÿ’ก ํŠธ๋ฆฌ๊ฑฐ B: ์‚ฌ์šฉ์ž๊ฐ€ ๊ฐ€๋งŒํžˆ ์žˆ์–ด๋„ AI๊ฐ€ ๋ฐฑ์—”๋“œ์—์„œ ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๋ฉด 3์ดˆ๋งˆ๋‹ค ์ž๋™ ์ฒดํฌ (ํด๋ง)
242
235
  const intervalId = setInterval(fetchRoutes, 3000);
243
236
 
244
237
  return () => {
@@ -246,9 +239,17 @@ export function NineHook({ menuUrl, views, error404, onCatch, fallback, styles,
246
239
  document.removeEventListener('click', fetchRoutes, true);
247
240
  clearInterval(intervalId);
248
241
  };
249
- }, [menuUrl]); // menuUrl์ด ์ฃผ์ž…๋˜๋ฉด ์ด๋ฒคํŠธ์™€ ํƒ€์ด๋จธ๊ฐ€ ์•ˆ์ „ํ•˜๊ฒŒ ๋ฐ”์ธ๋”ฉ๋ฉ๋‹ˆ๋‹ค.
242
+ }, [menuUrl]);
243
+
244
+ // ๐ŸŽฏ [ํ•ต์‹ฌ ๊ต์ •]: ์ตœ์ดˆ fetch๊ฐ€ ์™„๋ฃŒ๋˜๊ธฐ ์ „(๋ฐ์ดํ„ฐ๊ฐ€ ์—†์„ ๋•Œ)์—๋Š” ๋ Œ๋”๋ง์„ ์ž ์‹œ ๋ฉˆ์ถฅ๋‹ˆ๋‹ค.
245
+ if (!menuData || menuData.length === 0) {
246
+ return React.createElement(
247
+ 'div',
248
+ { style: { padding: '25px', color: '#666', fontFamily: 'monospace', background: '#121314', minHeight: '100vh' } },
249
+ '>> Initializing menu matrix telemetry...'
250
+ );
251
+ }
250
252
 
251
- // ๋ฐ์ดํ„ฐ๊ฐ€ ๋กœ๋“œ๋˜๊ณ  ์ •์ œ๋˜๋ฉด ๋™์  ๋ผ์šฐํŠธ ๋งคํŠธ๋ฆญ์Šค ์ƒ์„ฑ
252
253
  const dynamicRoutes = createDynamicRoutes(menuData, views, error404);
253
254
 
254
255
  return React.createElement(
@@ -257,6 +258,7 @@ export function NineHook({ menuUrl, views, error404, onCatch, fallback, styles,
257
258
  React.createElement(
258
259
  NineExceptionHook,
259
260
  { onCatch, fallback, styles, containerStyle },
261
+ children,
260
262
  React.createElement(
261
263
  Suspense,
262
264
  { fallback: React.createElement('div', { style: { padding: '25px', color: '#666', fontFamily: 'monospace' } }, '>> Loading component matrix...') },