@nine-lab/nine-mu 0.1.152 → 0.1.154
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/css/nine-mu.css +25 -0
- package/dist/nine-mu.js +55 -46
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +3 -3
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/public/css/nine-mu.css +25 -0
- package/src/components/ChatMessage.js +42 -38
- package/src/components/NineChat.js +16 -2
package/dist/css/nine-mu.css
CHANGED
|
@@ -948,4 +948,29 @@
|
|
|
948
948
|
background-color: #d7d4f9 !important;
|
|
949
949
|
color: inherit !important;
|
|
950
950
|
}
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
:host(nine-chat-message) {
|
|
954
|
+
width: 100%;
|
|
955
|
+
height: 100%;
|
|
956
|
+
overflow: scroll;
|
|
957
|
+
|
|
958
|
+
nine-chat-my {
|
|
959
|
+
display: flex;
|
|
960
|
+
justify-content: flex-end;
|
|
961
|
+
padding: 5px;
|
|
962
|
+
|
|
963
|
+
.chat-message {
|
|
964
|
+
max-width: 70%;
|
|
965
|
+
padding: 8px 16px;
|
|
966
|
+
border-radius: 8px;
|
|
967
|
+
font-size: 14px;
|
|
968
|
+
background-color: #fef01b;
|
|
969
|
+
text-align: left;
|
|
970
|
+
color: #333;
|
|
971
|
+
align-self: flex-end;
|
|
972
|
+
position: relative;
|
|
973
|
+
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.15);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
951
976
|
}
|
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 _mcpClient, _onAction, _onStatus, _onMessage, _owner, _NineChatManager_instances, connect_fn, fetchRoutes_fn, pushMessage_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl,
|
|
12
|
+
var _mcpClient, _onAction, _onStatus, _onMessage, _owner, _NineChatManager_instances, connect_fn, fetchRoutes_fn, pushMessage_fn, updateStatus_fn, callTool_fn, _getSourcePath, _service, _routes, _diffPopup, _packageName, _routesPath, _connectorUrl, _manager, _$nineChatMessage, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _makeMenuHandler, _sourceGenHandler, _showDiff, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _dialog, _diffView, _asisBackup, _host, _NineDiffPopup_instances, render_fn2, handleConfirm_fn, handleCancel_fn, _message, _data, _unique, _init, _message2, _init2, _progressData, _progressElements, _animationIntervals, _aiProgressMessage_instances, updateCurrentActiveProgress_fn, renderProgress_fn, updateProgressItemVisuals_fn, startAnimation_fn, updateProgressItem_fn, _renderer, _init3;
|
|
13
13
|
import { trace as trace$1, api, nine } from "@nine-lab/nine-util";
|
|
14
14
|
class Trace extends trace$1.constructor {
|
|
15
15
|
constructor() {
|
|
@@ -13718,8 +13718,8 @@ class NineChat extends HTMLElement {
|
|
|
13718
13718
|
__privateAdd(this, _packageName);
|
|
13719
13719
|
__privateAdd(this, _routesPath);
|
|
13720
13720
|
__privateAdd(this, _connectorUrl);
|
|
13721
|
-
__privateAdd(this, _mcpClient2);
|
|
13722
13721
|
__privateAdd(this, _manager);
|
|
13722
|
+
__privateAdd(this, _$nineChatMessage);
|
|
13723
13723
|
__privateAdd(this, _makeMenuHandler, async (e) => {
|
|
13724
13724
|
const prompt = await nine.prompt("메뉴생성시 필요한 AI 프롬프트를 입력하세요.").rgb();
|
|
13725
13725
|
if (prompt === null || prompt === void 0) return;
|
|
@@ -13773,8 +13773,8 @@ _diffPopup = new WeakMap();
|
|
|
13773
13773
|
_packageName = new WeakMap();
|
|
13774
13774
|
_routesPath = new WeakMap();
|
|
13775
13775
|
_connectorUrl = new WeakMap();
|
|
13776
|
-
_mcpClient2 = new WeakMap();
|
|
13777
13776
|
_manager = new WeakMap();
|
|
13777
|
+
_$nineChatMessage = new WeakMap();
|
|
13778
13778
|
_NineChat_instances = new WeakSet();
|
|
13779
13779
|
// --- [그룹 1: Interaction] 화면 토글 및 메뉴 클릭 ---
|
|
13780
13780
|
initInteractions_fn = function() {
|
|
@@ -13801,7 +13801,13 @@ initActions_fn = function() {
|
|
|
13801
13801
|
$textarea.addEventListener("keypress", async (e) => {
|
|
13802
13802
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
13803
13803
|
e.preventDefault();
|
|
13804
|
-
|
|
13804
|
+
const textarea = e.target.value.trim();
|
|
13805
|
+
if (!textarea) return;
|
|
13806
|
+
setTimeout(() => {
|
|
13807
|
+
$textarea.value = "";
|
|
13808
|
+
});
|
|
13809
|
+
__privateGet(this, _$nineChatMessage).add("me", textarea);
|
|
13810
|
+
__privateGet(this, _$nineChatMessage).add("ing", textarea);
|
|
13805
13811
|
await __privateGet(this, _manager).handleChatSubmit($textarea);
|
|
13806
13812
|
}
|
|
13807
13813
|
});
|
|
@@ -13811,7 +13817,7 @@ render_fn = function() {
|
|
|
13811
13817
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
13812
13818
|
this.shadowRoot.innerHTML = `
|
|
13813
13819
|
<style>
|
|
13814
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
13820
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.153"}/dist/css/nine-mu.css";
|
|
13815
13821
|
${customImport}
|
|
13816
13822
|
</style>
|
|
13817
13823
|
<div class="wrapper">
|
|
@@ -13848,6 +13854,7 @@ render_fn = function() {
|
|
|
13848
13854
|
<nine-diff-popup></nine-diff-popup>
|
|
13849
13855
|
`;
|
|
13850
13856
|
__privateSet(this, _diffPopup, this.shadowRoot.querySelector("nine-diff-popup"));
|
|
13857
|
+
__privateSet(this, _$nineChatMessage, this.shadowRoot.querySelector("nine-chat-message"));
|
|
13851
13858
|
};
|
|
13852
13859
|
_makeMenuHandler = new WeakMap();
|
|
13853
13860
|
_sourceGenHandler = new WeakMap();
|
|
@@ -40029,7 +40036,7 @@ class NineDiff extends HTMLElement {
|
|
|
40029
40036
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40030
40037
|
this.shadowRoot.innerHTML = `
|
|
40031
40038
|
<style>
|
|
40032
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40039
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.153"}/dist/css/nine-mu.css";
|
|
40033
40040
|
${customImport}
|
|
40034
40041
|
</style>
|
|
40035
40042
|
|
|
@@ -40139,7 +40146,7 @@ render_fn2 = function() {
|
|
|
40139
40146
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40140
40147
|
this.shadowRoot.innerHTML = `
|
|
40141
40148
|
<style>
|
|
40142
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
40149
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.153"}/dist/css/nine-mu.css";
|
|
40143
40150
|
${customImport}
|
|
40144
40151
|
</style>
|
|
40145
40152
|
|
|
@@ -40188,8 +40195,8 @@ class aiMessage extends HTMLElement {
|
|
|
40188
40195
|
__privateSet(this, _unique, unique);
|
|
40189
40196
|
setTimeout(() => {
|
|
40190
40197
|
if (!unique) {
|
|
40191
|
-
this.
|
|
40192
|
-
this.
|
|
40198
|
+
this.querySelector(".filter").classList.add("disabled");
|
|
40199
|
+
this.querySelector(".database").classList.add("disabled");
|
|
40193
40200
|
}
|
|
40194
40201
|
__privateGet(this, _init).call(this, info);
|
|
40195
40202
|
});
|
|
@@ -40197,8 +40204,8 @@ class aiMessage extends HTMLElement {
|
|
|
40197
40204
|
__privateAdd(this, _init, (info) => {
|
|
40198
40205
|
const rowCount = Number(this.getAttribute("row-count"));
|
|
40199
40206
|
if (rowCount < 1) {
|
|
40200
|
-
this.
|
|
40201
|
-
this.
|
|
40207
|
+
this.querySelector(".grid").style.display = "none";
|
|
40208
|
+
this.querySelector(".chat-menu").style.display = "none";
|
|
40202
40209
|
return;
|
|
40203
40210
|
}
|
|
40204
40211
|
let colgroup = info.map(() => `<col background-color="#888"/>`).join("");
|
|
@@ -40226,17 +40233,16 @@ class aiMessage extends HTMLElement {
|
|
|
40226
40233
|
</table>
|
|
40227
40234
|
</nine-grid>
|
|
40228
40235
|
`;
|
|
40229
|
-
this.
|
|
40236
|
+
this.querySelector(".grid").innerHTML = html;
|
|
40230
40237
|
setTimeout(() => {
|
|
40231
|
-
const grd = this.
|
|
40238
|
+
const grd = this.querySelector("nine-grid");
|
|
40232
40239
|
grd.data.source = __privateGet(this, _data);
|
|
40233
40240
|
});
|
|
40234
40241
|
});
|
|
40235
|
-
this.attachShadow({ mode: "open" });
|
|
40236
40242
|
}
|
|
40237
40243
|
connectedCallback() {
|
|
40238
40244
|
__privateSet(this, _message, this.getAttribute("message"));
|
|
40239
|
-
this.
|
|
40245
|
+
this.innerHTML = `
|
|
40240
40246
|
|
|
40241
40247
|
|
|
40242
40248
|
<div class="chat-message">
|
|
@@ -40256,10 +40262,10 @@ class aiMessage extends HTMLElement {
|
|
|
40256
40262
|
</div>
|
|
40257
40263
|
`;
|
|
40258
40264
|
requestAnimationFrame(() => {
|
|
40259
|
-
const elMessage = this.
|
|
40265
|
+
const elMessage = this.querySelector(".message");
|
|
40260
40266
|
elMessage.setAttribute("title", __privateGet(this, _message));
|
|
40261
40267
|
elMessage.innerHTML = __privateGet(this, _message).replaceAll("\n\n", "<br/>").replaceAll("\n", "<br/>");
|
|
40262
|
-
this.
|
|
40268
|
+
this.querySelector(".filter").addEventListener("click", (e) => {
|
|
40263
40269
|
if (__privateGet(this, _unique)) {
|
|
40264
40270
|
const grd = document.querySelector("nine-grid");
|
|
40265
40271
|
grd.filtering.set(__privateGet(this, _data).map(
|
|
@@ -40267,24 +40273,24 @@ class aiMessage extends HTMLElement {
|
|
|
40267
40273
|
));
|
|
40268
40274
|
}
|
|
40269
40275
|
});
|
|
40270
|
-
this.
|
|
40276
|
+
this.querySelector(".database").addEventListener("click", (e) => {
|
|
40271
40277
|
const keys = __privateGet(this, _data).map(
|
|
40272
40278
|
(item) => Object.fromEntries(__privateGet(this, _unique).map((key) => [key, item[key]]))
|
|
40273
40279
|
);
|
|
40274
40280
|
console.log(keys);
|
|
40275
40281
|
this.dispatchEvent(new CustomEvent("database", { bubbles: true, detail: { key: keys } }));
|
|
40276
40282
|
});
|
|
40277
|
-
this.
|
|
40278
|
-
this.
|
|
40283
|
+
this.querySelector(".maximize").addEventListener("click", (e) => {
|
|
40284
|
+
this.querySelector("nine-grid").maximize();
|
|
40279
40285
|
});
|
|
40280
|
-
this.
|
|
40281
|
-
this.
|
|
40286
|
+
this.querySelector(".excel").addEventListener("click", (e) => {
|
|
40287
|
+
this.querySelector("nine-grid").export();
|
|
40282
40288
|
});
|
|
40283
|
-
this.
|
|
40289
|
+
this.querySelector(".more a").addEventListener("click", () => {
|
|
40284
40290
|
alert(__privateGet(this, _message));
|
|
40285
40291
|
});
|
|
40286
40292
|
setTimeout(() => {
|
|
40287
|
-
const elMore = this.
|
|
40293
|
+
const elMore = this.querySelector(".more");
|
|
40288
40294
|
if (__privateGet(this, _message).length > 50) {
|
|
40289
40295
|
elMore.style.display = "flex";
|
|
40290
40296
|
elMore.style.position = "absolute";
|
|
@@ -40306,14 +40312,13 @@ class aiIngMessage extends HTMLElement {
|
|
|
40306
40312
|
__privateAdd(this, _init2, () => {
|
|
40307
40313
|
setInterval(() => {
|
|
40308
40314
|
__privateSet(this, _message2, __privateGet(this, _message2).length < 3 ? __privateGet(this, _message2) + "." : "");
|
|
40309
|
-
this.
|
|
40315
|
+
this.querySelector(".chat-message").innerHTML = __privateGet(this, _message2) || " ";
|
|
40310
40316
|
}, 500);
|
|
40311
40317
|
});
|
|
40312
|
-
this.attachShadow({ mode: "open" });
|
|
40313
40318
|
}
|
|
40314
40319
|
connectedCallback() {
|
|
40315
40320
|
__privateSet(this, _message2, ".");
|
|
40316
|
-
this.
|
|
40321
|
+
this.innerHTML = `
|
|
40317
40322
|
|
|
40318
40323
|
<div class="chat-message">
|
|
40319
40324
|
.
|
|
@@ -40324,16 +40329,13 @@ class aiIngMessage extends HTMLElement {
|
|
|
40324
40329
|
}
|
|
40325
40330
|
_message2 = new WeakMap();
|
|
40326
40331
|
_init2 = new WeakMap();
|
|
40327
|
-
class
|
|
40332
|
+
class MyMessage extends HTMLElement {
|
|
40328
40333
|
constructor() {
|
|
40329
40334
|
super();
|
|
40330
|
-
this.attachShadow({ mode: "open" });
|
|
40331
40335
|
}
|
|
40332
40336
|
connectedCallback() {
|
|
40333
40337
|
const message = this.getAttribute("message");
|
|
40334
|
-
this.
|
|
40335
|
-
|
|
40336
|
-
|
|
40338
|
+
this.innerHTML = `
|
|
40337
40339
|
<div class="chat-message">
|
|
40338
40340
|
${message}
|
|
40339
40341
|
</div>
|
|
@@ -40347,10 +40349,9 @@ class aiProgressMessage extends HTMLElement {
|
|
|
40347
40349
|
__privateAdd(this, _progressData, []);
|
|
40348
40350
|
__privateAdd(this, _progressElements, /* @__PURE__ */ new Map());
|
|
40349
40351
|
__privateAdd(this, _animationIntervals, /* @__PURE__ */ new Map());
|
|
40350
|
-
this.attachShadow({ mode: "open" });
|
|
40351
40352
|
}
|
|
40352
40353
|
connectedCallback() {
|
|
40353
|
-
this.
|
|
40354
|
+
this.innerHTML = `
|
|
40354
40355
|
|
|
40355
40356
|
<div class="chat-message progress-message">
|
|
40356
40357
|
<ul class="progress-list"></ul>
|
|
@@ -40413,7 +40414,7 @@ updateCurrentActiveProgress_fn = function() {
|
|
|
40413
40414
|
});
|
|
40414
40415
|
};
|
|
40415
40416
|
renderProgress_fn = function() {
|
|
40416
|
-
const progressList = this.
|
|
40417
|
+
const progressList = this.querySelector(".progress-list");
|
|
40417
40418
|
progressList.innerHTML = "";
|
|
40418
40419
|
__privateGet(this, _progressElements).clear();
|
|
40419
40420
|
__privateGet(this, _animationIntervals).forEach((intervalId) => clearInterval(intervalId));
|
|
@@ -40469,6 +40470,18 @@ updateProgressItem_fn = function(item) {
|
|
|
40469
40470
|
class ChatMessage extends HTMLElement {
|
|
40470
40471
|
constructor() {
|
|
40471
40472
|
super();
|
|
40473
|
+
__privateAdd(this, _renderer, () => {
|
|
40474
|
+
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
40475
|
+
this.shadowRoot.innerHTML = `
|
|
40476
|
+
<style>
|
|
40477
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.153"}/dist/css/nine-mu.css";
|
|
40478
|
+
${customImport}
|
|
40479
|
+
</style>
|
|
40480
|
+
|
|
40481
|
+
<div class="chat-body">
|
|
40482
|
+
</div>
|
|
40483
|
+
`;
|
|
40484
|
+
});
|
|
40472
40485
|
__privateAdd(this, _init3, () => {
|
|
40473
40486
|
});
|
|
40474
40487
|
__publicField(this, "add", (sender, message, info, data, unique) => {
|
|
@@ -40479,7 +40492,7 @@ class ChatMessage extends HTMLElement {
|
|
|
40479
40492
|
let el;
|
|
40480
40493
|
switch (sender) {
|
|
40481
40494
|
case "me":
|
|
40482
|
-
el = document.createElement("
|
|
40495
|
+
el = document.createElement("nine-chat-me");
|
|
40483
40496
|
el.setAttribute("message", message);
|
|
40484
40497
|
target.appendChild(el);
|
|
40485
40498
|
break;
|
|
@@ -40533,15 +40546,11 @@ class ChatMessage extends HTMLElement {
|
|
|
40533
40546
|
}
|
|
40534
40547
|
connectedCallback() {
|
|
40535
40548
|
this.getAttribute("message");
|
|
40536
|
-
this.
|
|
40537
|
-
|
|
40538
|
-
|
|
40539
|
-
<div class="chat-body">
|
|
40540
|
-
</div>
|
|
40541
|
-
`;
|
|
40549
|
+
__privateGet(this, _renderer).call(this);
|
|
40542
40550
|
__privateGet(this, _init3).call(this);
|
|
40543
40551
|
}
|
|
40544
40552
|
}
|
|
40553
|
+
_renderer = new WeakMap();
|
|
40545
40554
|
_init3 = new WeakMap();
|
|
40546
40555
|
if (!customElements.get("nx-ai-message")) {
|
|
40547
40556
|
customElements.define("nx-ai-message", aiMessage);
|
|
@@ -40549,17 +40558,17 @@ if (!customElements.get("nx-ai-message")) {
|
|
|
40549
40558
|
if (!customElements.get("nx-ai-ing-message")) {
|
|
40550
40559
|
customElements.define("nx-ai-ing-message", aiIngMessage);
|
|
40551
40560
|
}
|
|
40552
|
-
if (!customElements.get("nx-ai-my-message")) {
|
|
40553
|
-
customElements.define("nx-ai-my-message", aiMyMessage);
|
|
40554
|
-
}
|
|
40555
40561
|
if (!customElements.get("nx-ai-progress-message")) {
|
|
40556
40562
|
customElements.define("nx-ai-progress-message", aiProgressMessage);
|
|
40557
40563
|
}
|
|
40558
40564
|
if (!customElements.get("nine-chat-message")) {
|
|
40559
40565
|
customElements.define("nine-chat-message", ChatMessage);
|
|
40560
40566
|
}
|
|
40567
|
+
if (!customElements.get("nine-chat-me")) {
|
|
40568
|
+
customElements.define("nine-chat-me", MyMessage);
|
|
40569
|
+
}
|
|
40561
40570
|
const NineMu = {
|
|
40562
|
-
version: "0.1.
|
|
40571
|
+
version: "0.1.153",
|
|
40563
40572
|
init: (config2) => {
|
|
40564
40573
|
trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
|
|
40565
40574
|
}
|