@nine-lab/nine-mu 0.1.151 → 0.1.153
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 +57 -64
- 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 +45 -57
- 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.152"}/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.152"}/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.152"}/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,21 +40233,17 @@ 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.
|
|
40240
|
-
|
|
40241
|
-
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${ninegrid.version}/dist/css/ai.css";
|
|
40242
|
-
${ninegrid.getCustomPath(this, "ai.css")}
|
|
40243
|
-
</style>
|
|
40245
|
+
this.innerHTML = `
|
|
40246
|
+
|
|
40244
40247
|
|
|
40245
40248
|
<div class="chat-message">
|
|
40246
40249
|
<div class="message"></div>
|
|
@@ -40259,10 +40262,10 @@ class aiMessage extends HTMLElement {
|
|
|
40259
40262
|
</div>
|
|
40260
40263
|
`;
|
|
40261
40264
|
requestAnimationFrame(() => {
|
|
40262
|
-
const elMessage = this.
|
|
40265
|
+
const elMessage = this.querySelector(".message");
|
|
40263
40266
|
elMessage.setAttribute("title", __privateGet(this, _message));
|
|
40264
40267
|
elMessage.innerHTML = __privateGet(this, _message).replaceAll("\n\n", "<br/>").replaceAll("\n", "<br/>");
|
|
40265
|
-
this.
|
|
40268
|
+
this.querySelector(".filter").addEventListener("click", (e) => {
|
|
40266
40269
|
if (__privateGet(this, _unique)) {
|
|
40267
40270
|
const grd = document.querySelector("nine-grid");
|
|
40268
40271
|
grd.filtering.set(__privateGet(this, _data).map(
|
|
@@ -40270,24 +40273,24 @@ class aiMessage extends HTMLElement {
|
|
|
40270
40273
|
));
|
|
40271
40274
|
}
|
|
40272
40275
|
});
|
|
40273
|
-
this.
|
|
40276
|
+
this.querySelector(".database").addEventListener("click", (e) => {
|
|
40274
40277
|
const keys = __privateGet(this, _data).map(
|
|
40275
40278
|
(item) => Object.fromEntries(__privateGet(this, _unique).map((key) => [key, item[key]]))
|
|
40276
40279
|
);
|
|
40277
40280
|
console.log(keys);
|
|
40278
40281
|
this.dispatchEvent(new CustomEvent("database", { bubbles: true, detail: { key: keys } }));
|
|
40279
40282
|
});
|
|
40280
|
-
this.
|
|
40281
|
-
this.
|
|
40283
|
+
this.querySelector(".maximize").addEventListener("click", (e) => {
|
|
40284
|
+
this.querySelector("nine-grid").maximize();
|
|
40282
40285
|
});
|
|
40283
|
-
this.
|
|
40284
|
-
this.
|
|
40286
|
+
this.querySelector(".excel").addEventListener("click", (e) => {
|
|
40287
|
+
this.querySelector("nine-grid").export();
|
|
40285
40288
|
});
|
|
40286
|
-
this.
|
|
40289
|
+
this.querySelector(".more a").addEventListener("click", () => {
|
|
40287
40290
|
alert(__privateGet(this, _message));
|
|
40288
40291
|
});
|
|
40289
40292
|
setTimeout(() => {
|
|
40290
|
-
const elMore = this.
|
|
40293
|
+
const elMore = this.querySelector(".more");
|
|
40291
40294
|
if (__privateGet(this, _message).length > 50) {
|
|
40292
40295
|
elMore.style.display = "flex";
|
|
40293
40296
|
elMore.style.position = "absolute";
|
|
@@ -40309,18 +40312,13 @@ class aiIngMessage extends HTMLElement {
|
|
|
40309
40312
|
__privateAdd(this, _init2, () => {
|
|
40310
40313
|
setInterval(() => {
|
|
40311
40314
|
__privateSet(this, _message2, __privateGet(this, _message2).length < 3 ? __privateGet(this, _message2) + "." : "");
|
|
40312
|
-
this.
|
|
40315
|
+
this.querySelector(".chat-message").innerHTML = __privateGet(this, _message2) || " ";
|
|
40313
40316
|
}, 500);
|
|
40314
40317
|
});
|
|
40315
|
-
this.attachShadow({ mode: "open" });
|
|
40316
40318
|
}
|
|
40317
40319
|
connectedCallback() {
|
|
40318
40320
|
__privateSet(this, _message2, ".");
|
|
40319
|
-
this.
|
|
40320
|
-
<style>
|
|
40321
|
-
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${ninegrid.version}/dist/css/ai.css";
|
|
40322
|
-
${ninegrid.getCustomPath(this, "ai.css")}
|
|
40323
|
-
</style>
|
|
40321
|
+
this.innerHTML = `
|
|
40324
40322
|
|
|
40325
40323
|
<div class="chat-message">
|
|
40326
40324
|
.
|
|
@@ -40331,19 +40329,13 @@ class aiIngMessage extends HTMLElement {
|
|
|
40331
40329
|
}
|
|
40332
40330
|
_message2 = new WeakMap();
|
|
40333
40331
|
_init2 = new WeakMap();
|
|
40334
|
-
class
|
|
40332
|
+
class MyMessage extends HTMLElement {
|
|
40335
40333
|
constructor() {
|
|
40336
40334
|
super();
|
|
40337
|
-
this.attachShadow({ mode: "open" });
|
|
40338
40335
|
}
|
|
40339
40336
|
connectedCallback() {
|
|
40340
40337
|
const message = this.getAttribute("message");
|
|
40341
|
-
this.
|
|
40342
|
-
<style>
|
|
40343
|
-
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${ninegrid.version}/dist/css/ai.css";
|
|
40344
|
-
${ninegrid.getCustomPath(this, "ai.css")}
|
|
40345
|
-
</style>
|
|
40346
|
-
|
|
40338
|
+
this.innerHTML = `
|
|
40347
40339
|
<div class="chat-message">
|
|
40348
40340
|
${message}
|
|
40349
40341
|
</div>
|
|
@@ -40357,14 +40349,10 @@ class aiProgressMessage extends HTMLElement {
|
|
|
40357
40349
|
__privateAdd(this, _progressData, []);
|
|
40358
40350
|
__privateAdd(this, _progressElements, /* @__PURE__ */ new Map());
|
|
40359
40351
|
__privateAdd(this, _animationIntervals, /* @__PURE__ */ new Map());
|
|
40360
|
-
this.attachShadow({ mode: "open" });
|
|
40361
40352
|
}
|
|
40362
40353
|
connectedCallback() {
|
|
40363
|
-
this.
|
|
40364
|
-
|
|
40365
|
-
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${ninegrid.version}/dist/css/ai.css";
|
|
40366
|
-
${ninegrid.getCustomPath(this, "ai.css")}
|
|
40367
|
-
</style>
|
|
40354
|
+
this.innerHTML = `
|
|
40355
|
+
|
|
40368
40356
|
<div class="chat-message progress-message">
|
|
40369
40357
|
<ul class="progress-list"></ul>
|
|
40370
40358
|
</div>
|
|
@@ -40426,7 +40414,7 @@ updateCurrentActiveProgress_fn = function() {
|
|
|
40426
40414
|
});
|
|
40427
40415
|
};
|
|
40428
40416
|
renderProgress_fn = function() {
|
|
40429
|
-
const progressList = this.
|
|
40417
|
+
const progressList = this.querySelector(".progress-list");
|
|
40430
40418
|
progressList.innerHTML = "";
|
|
40431
40419
|
__privateGet(this, _progressElements).clear();
|
|
40432
40420
|
__privateGet(this, _animationIntervals).forEach((intervalId) => clearInterval(intervalId));
|
|
@@ -40482,6 +40470,18 @@ updateProgressItem_fn = function(item) {
|
|
|
40482
40470
|
class ChatMessage extends HTMLElement {
|
|
40483
40471
|
constructor() {
|
|
40484
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.152"}/dist/css/nine-mu.css";
|
|
40478
|
+
${customImport}
|
|
40479
|
+
</style>
|
|
40480
|
+
|
|
40481
|
+
<div class="chat-body">
|
|
40482
|
+
</div>
|
|
40483
|
+
`;
|
|
40484
|
+
});
|
|
40485
40485
|
__privateAdd(this, _init3, () => {
|
|
40486
40486
|
});
|
|
40487
40487
|
__publicField(this, "add", (sender, message, info, data, unique) => {
|
|
@@ -40492,7 +40492,7 @@ class ChatMessage extends HTMLElement {
|
|
|
40492
40492
|
let el;
|
|
40493
40493
|
switch (sender) {
|
|
40494
40494
|
case "me":
|
|
40495
|
-
el = document.createElement("
|
|
40495
|
+
el = document.createElement("nine-chat-me");
|
|
40496
40496
|
el.setAttribute("message", message);
|
|
40497
40497
|
target.appendChild(el);
|
|
40498
40498
|
break;
|
|
@@ -40546,18 +40546,11 @@ class ChatMessage extends HTMLElement {
|
|
|
40546
40546
|
}
|
|
40547
40547
|
connectedCallback() {
|
|
40548
40548
|
this.getAttribute("message");
|
|
40549
|
-
this.
|
|
40550
|
-
<style>
|
|
40551
|
-
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${ninegrid.version}/dist/css/ai.css";
|
|
40552
|
-
${ninegrid.getCustomPath(this, "ai.css")}
|
|
40553
|
-
</style>
|
|
40554
|
-
|
|
40555
|
-
<div class="chat-body">
|
|
40556
|
-
</div>
|
|
40557
|
-
`;
|
|
40549
|
+
__privateGet(this, _renderer).call(this);
|
|
40558
40550
|
__privateGet(this, _init3).call(this);
|
|
40559
40551
|
}
|
|
40560
40552
|
}
|
|
40553
|
+
_renderer = new WeakMap();
|
|
40561
40554
|
_init3 = new WeakMap();
|
|
40562
40555
|
if (!customElements.get("nx-ai-message")) {
|
|
40563
40556
|
customElements.define("nx-ai-message", aiMessage);
|
|
@@ -40565,17 +40558,17 @@ if (!customElements.get("nx-ai-message")) {
|
|
|
40565
40558
|
if (!customElements.get("nx-ai-ing-message")) {
|
|
40566
40559
|
customElements.define("nx-ai-ing-message", aiIngMessage);
|
|
40567
40560
|
}
|
|
40568
|
-
if (!customElements.get("nx-ai-my-message")) {
|
|
40569
|
-
customElements.define("nx-ai-my-message", aiMyMessage);
|
|
40570
|
-
}
|
|
40571
40561
|
if (!customElements.get("nx-ai-progress-message")) {
|
|
40572
40562
|
customElements.define("nx-ai-progress-message", aiProgressMessage);
|
|
40573
40563
|
}
|
|
40574
40564
|
if (!customElements.get("nine-chat-message")) {
|
|
40575
40565
|
customElements.define("nine-chat-message", ChatMessage);
|
|
40576
40566
|
}
|
|
40567
|
+
if (!customElements.get("nine-chat-me")) {
|
|
40568
|
+
customElements.define("nine-chat-me", MyMessage);
|
|
40569
|
+
}
|
|
40577
40570
|
const NineMu = {
|
|
40578
|
-
version: "0.1.
|
|
40571
|
+
version: "0.1.152",
|
|
40579
40572
|
init: (config2) => {
|
|
40580
40573
|
trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
|
|
40581
40574
|
}
|