@nine-lab/nine-mu 0.1.347 β†’ 0.1.348

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 CHANGED
@@ -17538,7 +17538,7 @@ render_fn = function() {
17538
17538
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
17539
17539
  this.shadowRoot.innerHTML = `
17540
17540
  <style>
17541
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.346"}/dist/css/nine-mu.css";
17541
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.347"}/dist/css/nine-mu.css";
17542
17542
  ${customImport}
17543
17543
  </style>
17544
17544
  <div class="wrapper">
@@ -43788,7 +43788,7 @@ class NineDiff extends HTMLElement {
43788
43788
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
43789
43789
  this.shadowRoot.innerHTML = `
43790
43790
  <style>
43791
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.346"}/dist/css/nine-mu.css";
43791
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.347"}/dist/css/nine-mu.css";
43792
43792
  ${customImport}
43793
43793
  </style>
43794
43794
 
@@ -43928,7 +43928,7 @@ renderScaffolding_fn = function() {
43928
43928
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
43929
43929
  this.shadowRoot.innerHTML = `
43930
43930
  <style>
43931
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.346"}/dist/css/nine-mu.css";
43931
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.347"}/dist/css/nine-mu.css";
43932
43932
  ${customImport}
43933
43933
  </style>
43934
43934
 
@@ -44037,7 +44037,7 @@ render_fn2 = function() {
44037
44037
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
44038
44038
  this.shadowRoot.innerHTML = `
44039
44039
  <style>
44040
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.346"}/dist/css/nine-mu.css";
44040
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.347"}/dist/css/nine-mu.css";
44041
44041
  ${customImport}
44042
44042
  </style>
44043
44043
 
@@ -44367,7 +44367,7 @@ class ChatMessageBody extends HTMLElement {
44367
44367
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
44368
44368
  this.shadowRoot.innerHTML = `
44369
44369
  <style>
44370
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.346"}/dist/css/nine-mu.css";
44370
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.347"}/dist/css/nine-mu.css";
44371
44371
  ${customImport}
44372
44372
  </style>
44373
44373
 
@@ -44465,21 +44465,73 @@ if (!customElements.get("nine-chat-ing")) {
44465
44465
  if (!customElements.get("nine-chat-progress")) {
44466
44466
  customElements.define("nine-chat-progress", ProgressMessage);
44467
44467
  }
44468
+ const NineExceptionStyles = {
44469
+ container: {
44470
+ padding: "30px",
44471
+ margin: "20px",
44472
+ background: "#FFF5F5",
44473
+ border: "1px solid #FEB2B2",
44474
+ borderRadius: "8px",
44475
+ fontFamily: "sans-serif",
44476
+ textAlign: "left"
44477
+ },
44478
+ title: {
44479
+ color: "#C53030",
44480
+ marginTop: 0,
44481
+ fontSize: "18px",
44482
+ display: "flex",
44483
+ alignItems: "center",
44484
+ gap: "8px"
44485
+ },
44486
+ label: {
44487
+ margin: "10px 0 5px 0",
44488
+ fontWeight: "bold",
44489
+ color: "#4A5568"
44490
+ },
44491
+ pre: {
44492
+ background: "#1A202C",
44493
+ color: "#EDF2F7",
44494
+ padding: "15px",
44495
+ borderRadius: "6px",
44496
+ overflowX: "auto",
44497
+ whiteSpace: "pre-wrap",
44498
+ fontFamily: "monospace",
44499
+ fontSize: "14px"
44500
+ },
44501
+ footer: {
44502
+ marginTop: "15px",
44503
+ fontSize: "14px",
44504
+ color: "#718096",
44505
+ display: "flex",
44506
+ flexDirection: "column",
44507
+ gap: "10px"
44508
+ },
44509
+ button: {
44510
+ padding: "10px 16px",
44511
+ background: "#E53E3E",
44512
+ color: "#FFFFFF",
44513
+ border: "none",
44514
+ borderRadius: "6px",
44515
+ cursor: "pointer",
44516
+ fontWeight: "bold",
44517
+ fontSize: "14px",
44518
+ alignSelf: "flex-start",
44519
+ transition: "background 0.2s"
44520
+ }
44521
+ };
44468
44522
  class NineExceptionHook extends React.Component {
44469
44523
  constructor(props) {
44470
44524
  super(props);
44471
- this.state = { hasError: false, error: null };
44525
+ this.state = { hasError: false, error: null, reportStatus: "idle" };
44472
44526
  this.lastPath = window.location.pathname;
44473
44527
  this.handleLocationChange = this.handleLocationChange.bind(this);
44528
+ this.handleReport = this.handleReport.bind(this);
44474
44529
  }
44475
44530
  static getDerivedStateFromError(error) {
44476
- return { hasError: true, error };
44531
+ return { hasError: true, error, reportStatus: "idle" };
44477
44532
  }
44478
44533
  componentDidCatch(error, errorInfo) {
44479
44534
  console.error("🚨 [Nine-Library] λ³Έλ¬Έ λ Œλ”λ§ μ—λŸ¬ 포착:", error);
44480
- if (window.triggerAutoRecovery) {
44481
- window.triggerAutoRecovery(error.message || String(error));
44482
- }
44483
44535
  if (this.props.onCatch) {
44484
44536
  this.props.onCatch(error, errorInfo);
44485
44537
  }
@@ -44497,10 +44549,25 @@ class NineExceptionHook extends React.Component {
44497
44549
  if (this.state.hasError && this.lastPath !== window.location.pathname) {
44498
44550
  console.log("✨ [Nine-Library] νŽ˜μ΄μ§€ μ£Όμ†Œ λ³€κ²½ 감지 -> λ¦¬μ•‘νŠΈ μ—λŸ¬ μƒνƒœ μ΄ˆκΈ°ν™”");
44499
44551
  this.lastPath = window.location.pathname;
44500
- this.setState({ hasError: false, error: null });
44552
+ this.setState({ hasError: false, error: null, reportStatus: "idle" });
44501
44553
  }
44502
44554
  }, 10);
44503
44555
  }
44556
+ // πŸš€ λ²„νŠΌ 클릭 μ‹œ 싀행될 κ΄€μ œνƒ‘ μˆ˜λ™ μ‹ κ³  ν•Έλ“€λŸ¬
44557
+ handleReport() {
44558
+ var _a2;
44559
+ if (this.state.reportStatus !== "idle") return;
44560
+ this.setState({ reportStatus: "sending" });
44561
+ const errorMessage = ((_a2 = this.state.error) == null ? void 0 : _a2.message) || String(this.state.error);
44562
+ setTimeout(() => {
44563
+ if (window.triggerAutoRecovery) {
44564
+ window.triggerAutoRecovery(errorMessage);
44565
+ } else {
44566
+ console.warn("⚠️ [Nine-Library] window.triggerAutoRecovery κ°€ μ •μ˜λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.");
44567
+ }
44568
+ this.setState({ reportStatus: "success" });
44569
+ }, 500);
44570
+ }
44504
44571
  render() {
44505
44572
  var _a2;
44506
44573
  if (this.state.hasError) {
@@ -44508,41 +44575,49 @@ class NineExceptionHook extends React.Component {
44508
44575
  return this.props.fallback(this.state.error);
44509
44576
  }
44510
44577
  const errorMessage = ((_a2 = this.state.error) == null ? void 0 : _a2.message) || String(this.state.error);
44578
+ const customStyles = this.props.styles || {};
44579
+ let buttonText = "πŸš€ κ΄€μ œνƒ‘μ— μ—λŸ¬ ν”Όλ“œλ°± μ „μ†‘ν•˜κΈ°";
44580
+ if (this.state.reportStatus === "sending") buttonText = "⏳ κ΄€μ œνƒ‘ 연락 쀑...";
44581
+ if (this.state.reportStatus === "success") buttonText = "βœ… 전솑 μ™„λ£Œ! AIκ°€ 뢄석을 μ‹œμž‘ν•©λ‹ˆλ‹€.";
44511
44582
  return React.createElement(
44512
44583
  "div",
44513
44584
  {
44514
- style: {
44515
- padding: "30px",
44516
- margin: "20px",
44517
- background: "#FFF5F5",
44518
- border: "1px solid #FEB2B2",
44519
- borderRadius: "8px",
44520
- fontFamily: "sans-serif",
44521
- textAlign: "left",
44522
- ...this.props.containerStyle
44523
- }
44585
+ style: { ...NineExceptionStyles.container, ...customStyles.container, ...this.props.containerStyle }
44524
44586
  },
44525
- React.createElement("h3", { style: { color: "#C53030", marginTop: 0, fontSize: "18px" } }, "⚠️ μ»΄ν¬λ„ŒνŠΈ λΉŒλ“œ/λ Œλ”λ§ μ—λŸ¬ 감지"),
44526
- React.createElement("p", { style: { margin: "10px 0 5px 0", fontWeight: "bold", color: "#4A5568" } }, "[μ—λŸ¬ 원인 둜그]:"),
44527
- React.createElement("pre", {
44528
- style: {
44529
- background: "#1A202C",
44530
- color: "#EDF2F7",
44531
- padding: "15px",
44532
- borderRadius: "6px",
44533
- overflowX: "auto",
44534
- whiteSpace: "pre-wrap",
44535
- fontFamily: "monospace"
44536
- }
44537
- }, errorMessage),
44538
- React.createElement("div", { style: { marginTop: "15px", fontSize: "14px", color: "#718096" } }, "πŸ”„ μ—λŸ¬ λ‘œκ·Έκ°€ κ΄€μ œνƒ‘μœΌλ‘œ μžλ™ ν”Όλ“œλ°±λ˜μ—ˆμŠ΅λ‹ˆλ‹€. AIκ°€ μ†ŒμŠ€ μ½”λ“œλ₯Ό μž¬μˆ˜μ •ν•˜λŠ” λ™μ•ˆ μž μ‹œλ§Œ κΈ°λ‹€λ €μ£Όμ„Έμš”...")
44587
+ React.createElement("h3", { style: { ...NineExceptionStyles.title, ...customStyles.title } }, "⚠️ μ»΄ν¬λ„ŒνŠΈ λΉŒλ“œ/λ Œλ”λ§ μ—λŸ¬ 감지"),
44588
+ React.createElement("p", { style: { ...NineExceptionStyles.label, ...customStyles.label } }, "[μ—λŸ¬ 원인 둜그]:"),
44589
+ React.createElement("pre", { style: { ...NineExceptionStyles.pre, ...customStyles.pre } }, errorMessage),
44590
+ // ν•˜λ‹¨ μ•ˆλ‚΄ μ˜μ—­ 및 μˆ˜λ™ 전솑 λ²„νŠΌ
44591
+ React.createElement(
44592
+ "div",
44593
+ { style: { ...NineExceptionStyles.footer, ...customStyles.footer } },
44594
+ React.createElement(
44595
+ "button",
44596
+ {
44597
+ style: {
44598
+ ...NineExceptionStyles.button,
44599
+ ...customStyles.button,
44600
+ backgroundColor: this.state.reportStatus === "success" ? "#38A169" : this.state.reportStatus === "sending" ? "#A0AEC0" : "#E53E3E",
44601
+ cursor: this.state.reportStatus === "idle" ? "pointer" : "not-allowed"
44602
+ },
44603
+ disabled: this.state.reportStatus !== "idle",
44604
+ onClick: this.handleReport
44605
+ },
44606
+ buttonText
44607
+ ),
44608
+ this.state.reportStatus === "success" && React.createElement(
44609
+ "div",
44610
+ { style: { color: "#4A5568", fontSize: "13px", marginTop: "5px" } },
44611
+ "πŸ”„ AIκ°€ μ†ŒμŠ€ μ½”λ“œλ₯Ό μž¬μˆ˜μ •ν•˜λŠ” λ™μ•ˆ μž μ‹œλ§Œ κΈ°λ‹€λ €μ£Όμ„Έμš”..."
44612
+ )
44613
+ )
44539
44614
  );
44540
44615
  }
44541
44616
  return this.props.children;
44542
44617
  }
44543
44618
  }
44544
44619
  const NineMu = {
44545
- version: "0.1.346",
44620
+ version: "0.1.347",
44546
44621
  init: (config2) => {
44547
44622
  trace$1.log("πŸ› οΈ Nine-Mu Engine initialized", config2);
44548
44623
  }