@nine-lab/nine-mu 0.1.307 → 0.1.309

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.
@@ -804,8 +804,8 @@
804
804
  }
805
805
 
806
806
 
807
-
808
- :host(nine-diff-popup) {
807
+ :host(nine-diff-popup),
808
+ :host(nine-menu-diff-popup) {
809
809
 
810
810
  div.buttons {
811
811
  position: absolute;
@@ -862,6 +862,7 @@
862
862
  }
863
863
  }
864
864
 
865
+
865
866
  :host(nine-diff) {
866
867
  width: 100%;
867
868
  height: 100%;
package/dist/nine-mu.js CHANGED
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
9
9
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
10
10
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
11
11
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
12
- var _owner, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _generateSource, _mcpClient, _onAction, _onStatus, _onMessage, _owner2, _routeUrl, _chatHistory, _notiHandler, _NineChatManager_instances, connect_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _packageName, _routesPath, _connectorUrl, _manager, _config, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
12
+ var _owner, _collectedFiles, _NotificationHandler_instances, handleLoggingMessage_fn, _collectModifySource, _openDiffPopup, _generateSource, _mcpClient, _onAction, _onStatus, _onMessage, _owner2, _routeUrl, _chatHistory, _notiHandler, _NineChatManager_instances, connect_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _packageName, _routesPath, _connectorUrl, _manager, _config, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _isDirty, _initialAsisSrc, _initialTobeSrc, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _checkDirtyState, _setupScrollSync, _applyDiffDecorations, _dialog, _tabContainer, _fileList, _host, _NineDiffPopup_instances, renderScaffolding_fn, handleConfirmAll_fn, handleCancel_fn, _dialog2, _diffView, _asisBackup, _host2, _NineMenuDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn2, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _ProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
13
13
  import { trace as trace$1, api, nine as nine$1 } from "@nine-lab/nine-util";
14
14
  class Trace extends trace$1.constructor {
15
15
  constructor() {
@@ -17563,7 +17563,7 @@ render_fn = function() {
17563
17563
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
17564
17564
  this.shadowRoot.innerHTML = `
17565
17565
  <style>
17566
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.306"}/dist/css/nine-mu.css";
17566
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.308"}/dist/css/nine-mu.css";
17567
17567
  ${customImport}
17568
17568
  </style>
17569
17569
  <div class="wrapper">
@@ -43493,6 +43493,9 @@ class NineDiff extends HTMLElement {
43493
43493
  __privateAdd(this, _tobeEditorView);
43494
43494
  __privateAdd(this, _asisEditorEl);
43495
43495
  __privateAdd(this, _tobeEditorEl);
43496
+ __privateAdd(this, _isDirty, false);
43497
+ __privateAdd(this, _initialAsisSrc);
43498
+ __privateAdd(this, _initialTobeSrc);
43496
43499
  __privateAdd(this, _languageCompartment, new Compartment());
43497
43500
  __privateAdd(this, _isScrollSyncActive, false);
43498
43501
  __publicField(this, "_asisScrollHandler", null);
@@ -43500,6 +43503,12 @@ class NineDiff extends HTMLElement {
43500
43503
  __publicField(this, "getContents", () => {
43501
43504
  return __privateGet(this, _tobeEditorView) ? __privateGet(this, _tobeEditorView).state.doc.toString() : "";
43502
43505
  });
43506
+ __publicField(this, "getAsisContents", () => {
43507
+ return __privateGet(this, _asisEditorView) ? __privateGet(this, _asisEditorView).state.doc.toString() : "";
43508
+ });
43509
+ __publicField(this, "getTobeContents", () => {
43510
+ return __privateGet(this, _tobeEditorView) ? __privateGet(this, _tobeEditorView).state.doc.toString() : "";
43511
+ });
43503
43512
  __privateAdd(this, _initCodeMirror, () => {
43504
43513
  let asisReady = false;
43505
43514
  let tobeReady = false;
@@ -43556,6 +43565,9 @@ class NineDiff extends HTMLElement {
43556
43565
  asisReady = true;
43557
43566
  checkAllReady();
43558
43567
  }
43568
+ if (update.docChanged) {
43569
+ __privateGet(this, _checkDirtyState).call(this);
43570
+ }
43559
43571
  })
43560
43572
  ]
43561
43573
  }),
@@ -43578,6 +43590,9 @@ class NineDiff extends HTMLElement {
43578
43590
  tobeReady = true;
43579
43591
  checkAllReady();
43580
43592
  }
43593
+ if (update.docChanged) {
43594
+ __privateGet(this, _checkDirtyState).call(this);
43595
+ }
43581
43596
  })
43582
43597
  ]
43583
43598
  }),
@@ -43585,6 +43600,20 @@ class NineDiff extends HTMLElement {
43585
43600
  }));
43586
43601
  __privateGet(this, _setupScrollSync).call(this);
43587
43602
  });
43603
+ __privateAdd(this, _checkDirtyState, () => {
43604
+ const currentAsis = this.getAsisContents();
43605
+ const currentTobe = this.getTobeContents();
43606
+ const nextDirty = currentAsis !== __privateGet(this, _initialAsisSrc) || currentTobe !== __privateGet(this, _initialTobeSrc);
43607
+ if (__privateGet(this, _isDirty) !== nextDirty) {
43608
+ __privateSet(this, _isDirty, nextDirty);
43609
+ this.dispatchEvent(new CustomEvent("change-dirty", {
43610
+ detail: { isDirty: __privateGet(this, _isDirty) },
43611
+ bubbles: true,
43612
+ composed: true
43613
+ }));
43614
+ trace.log(`[NineDiff] 상태 변경 - isDirty: ${__privateGet(this, _isDirty)}`);
43615
+ }
43616
+ });
43588
43617
  __privateAdd(this, _setupScrollSync, () => {
43589
43618
  if (this._asisScrollHandler) {
43590
43619
  __privateGet(this, _asisEditorView).scrollDOM.removeEventListener("scroll", this._asisScrollHandler);
@@ -43728,6 +43757,9 @@ class NineDiff extends HTMLElement {
43728
43757
  return;
43729
43758
  }
43730
43759
  __privateSet(this, _isScrollSyncActive, false);
43760
+ __privateSet(this, _isDirty, false);
43761
+ __privateSet(this, _initialAsisSrc, src1 ?? "");
43762
+ __privateSet(this, _initialTobeSrc, src2 ?? "");
43731
43763
  let langExtension;
43732
43764
  switch (language2) {
43733
43765
  case "javascript":
@@ -43776,11 +43808,14 @@ class NineDiff extends HTMLElement {
43776
43808
  get tobeEditorView() {
43777
43809
  return __privateGet(this, _tobeEditorView);
43778
43810
  }
43811
+ get isDirty() {
43812
+ return __privateGet(this, _isDirty);
43813
+ }
43779
43814
  connectedCallback() {
43780
43815
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
43781
43816
  this.shadowRoot.innerHTML = `
43782
43817
  <style>
43783
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.306"}/dist/css/nine-mu.css";
43818
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.308"}/dist/css/nine-mu.css";
43784
43819
  ${customImport}
43785
43820
  </style>
43786
43821
 
@@ -43819,9 +43854,13 @@ _asisEditorView = new WeakMap();
43819
43854
  _tobeEditorView = new WeakMap();
43820
43855
  _asisEditorEl = new WeakMap();
43821
43856
  _tobeEditorEl = new WeakMap();
43857
+ _isDirty = new WeakMap();
43858
+ _initialAsisSrc = new WeakMap();
43859
+ _initialTobeSrc = new WeakMap();
43822
43860
  _languageCompartment = new WeakMap();
43823
43861
  _isScrollSyncActive = new WeakMap();
43824
43862
  _initCodeMirror = new WeakMap();
43863
+ _checkDirtyState = new WeakMap();
43825
43864
  _setupScrollSync = new WeakMap();
43826
43865
  _applyDiffDecorations = new WeakMap();
43827
43866
  if (!customElements.get("nine-diff")) {
@@ -43906,7 +43945,7 @@ renderScaffolding_fn = function() {
43906
43945
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
43907
43946
  this.shadowRoot.innerHTML = `
43908
43947
  <style>
43909
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.306"}/dist/css/nine-mu.css";
43948
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.308"}/dist/css/nine-mu.css";
43910
43949
  ${customImport}
43911
43950
  </style>
43912
43951
 
@@ -44016,7 +44055,7 @@ render_fn2 = function() {
44016
44055
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
44017
44056
  this.shadowRoot.innerHTML = `
44018
44057
  <style>
44019
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.306"}/dist/css/nine-mu.css";
44058
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.308"}/dist/css/nine-mu.css";
44020
44059
  ${customImport}
44021
44060
  </style>
44022
44061
 
@@ -44034,11 +44073,17 @@ render_fn2 = function() {
44034
44073
  `;
44035
44074
  __privateSet(this, _dialog2, this.shadowRoot.querySelector("nine-dialog"));
44036
44075
  __privateSet(this, _diffView, this.shadowRoot.querySelector("nine-diff"));
44037
- this.shadowRoot.querySelector(".btn-confirm").onclick = () => __privateMethod(this, _NineMenuDiffPopup_instances, handleConfirm_fn).call(this);
44076
+ const $btnConfirm = this.shadowRoot.querySelector(".btn-confirm");
44077
+ $btnConfirm.onclick = () => __privateMethod(this, _NineMenuDiffPopup_instances, handleConfirm_fn).call(this);
44038
44078
  this.shadowRoot.querySelector(".btn-cancel").onclick = () => __privateMethod(this, _NineMenuDiffPopup_instances, handleCancel_fn2).call(this);
44079
+ __privateGet(this, _diffView).addEventListener("change-dirty", (e) => {
44080
+ const { isDirty: isDirty2 } = e.detail;
44081
+ console.log(e);
44082
+ $btnConfirm.disabled = !isDirty2;
44083
+ });
44039
44084
  };
44040
44085
  handleConfirm_fn = function() {
44041
- const content2 = __privateGet(this, _diffView) ? __privateGet(this, _diffView).getContents() : __privateGet(this, _asisBackup);
44086
+ const content2 = __privateGet(this, _diffView) ? __privateGet(this, _diffView).getAsisContents() : __privateGet(this, _asisBackup);
44042
44087
  const params = {
44043
44088
  packageName: __privateGet(this, _host2).getAttribute("package-name"),
44044
44089
  contents: content2
@@ -44342,7 +44387,7 @@ class ChatMessageBody extends HTMLElement {
44342
44387
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
44343
44388
  this.shadowRoot.innerHTML = `
44344
44389
  <style>
44345
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.306"}/dist/css/nine-mu.css";
44390
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.308"}/dist/css/nine-mu.css";
44346
44391
  ${customImport}
44347
44392
  </style>
44348
44393
 
@@ -44436,7 +44481,7 @@ if (!customElements.get("nine-chat-progress")) {
44436
44481
  customElements.define("nine-chat-progress", ProgressMessage);
44437
44482
  }
44438
44483
  const NineMu = {
44439
- version: "0.1.306",
44484
+ version: "0.1.308",
44440
44485
  init: (config2) => {
44441
44486
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
44442
44487
  }