@nine-lab/nine-mu 0.1.18 → 0.1.20
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 +96 -4
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NineDialog.js +100 -0
- package/src/index.js +2 -1
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 _getSourcePath, _service, _routes, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _asis, _tobe, _lang, _diffView;
|
|
12
|
+
var _getSourcePath, _service, _routes, _NineChat_instances, initInteractions_fn, initActions_fn, render_fn, _asisEditorView, _tobeEditorView, _asisEditorEl, _tobeEditorEl, _languageCompartment, _isScrollSyncActive, _initCodeMirror, _setupScrollSync, _applyDiffDecorations, _asis, _tobe, _lang, _diffView, _dialog, _shift, _init, _onMouseDown, _onMouseMove, _onMouseUp;
|
|
13
13
|
import { trace, api, nine } from "@nine-lab/nine-util";
|
|
14
14
|
class NineMuService {
|
|
15
15
|
constructor(connectorUrl) {
|
|
@@ -178,7 +178,7 @@ render_fn = function() {
|
|
|
178
178
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
179
179
|
this.shadowRoot.innerHTML = `
|
|
180
180
|
<style>
|
|
181
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
181
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.19"}/dist/css/nine-mu.css";
|
|
182
182
|
${customImport}
|
|
183
183
|
</style>
|
|
184
184
|
<div class="wrapper">
|
|
@@ -26378,7 +26378,7 @@ class NineDiff extends HTMLElement {
|
|
|
26378
26378
|
const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
|
|
26379
26379
|
this.shadowRoot.innerHTML = `
|
|
26380
26380
|
<style>
|
|
26381
|
-
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.
|
|
26381
|
+
@import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.19"}/dist/css/nine-mu.css";
|
|
26382
26382
|
${customImport}
|
|
26383
26383
|
</style>
|
|
26384
26384
|
|
|
@@ -26477,14 +26477,106 @@ _tobe = new WeakMap();
|
|
|
26477
26477
|
_lang = new WeakMap();
|
|
26478
26478
|
_diffView = new WeakMap();
|
|
26479
26479
|
customElements.define("nine-diff-container", NineDiffContainer);
|
|
26480
|
+
class NineDialog extends HTMLElement {
|
|
26481
|
+
constructor() {
|
|
26482
|
+
super();
|
|
26483
|
+
__privateAdd(this, _dialog);
|
|
26484
|
+
__privateAdd(this, _shift);
|
|
26485
|
+
__publicField(this, "showModal", () => {
|
|
26486
|
+
__privateGet(this, _dialog).showModal();
|
|
26487
|
+
});
|
|
26488
|
+
__publicField(this, "close", () => {
|
|
26489
|
+
__privateGet(this, _dialog).close();
|
|
26490
|
+
this.remove();
|
|
26491
|
+
});
|
|
26492
|
+
__privateAdd(this, _init, () => {
|
|
26493
|
+
const closeBtn = this.shadowRoot.querySelector(".close");
|
|
26494
|
+
closeBtn.addEventListener("click", () => {
|
|
26495
|
+
__privateGet(this, _dialog).classList.add("out");
|
|
26496
|
+
setTimeout(() => this.close(), 200);
|
|
26497
|
+
});
|
|
26498
|
+
const head = this.shadowRoot.querySelector(".head");
|
|
26499
|
+
head.addEventListener("mousedown", __privateGet(this, _onMouseDown));
|
|
26500
|
+
});
|
|
26501
|
+
// 드래그 로직 이식 시 querySelector 대신 this.#dialog 사용
|
|
26502
|
+
__privateAdd(this, _onMouseDown, (e) => {
|
|
26503
|
+
var rect = __privateGet(this, _dialog).getBoundingClientRect();
|
|
26504
|
+
__privateSet(this, _shift, { x: e.clientX - rect.x, y: e.clientY - rect.y });
|
|
26505
|
+
document.addEventListener("mousemove", __privateGet(this, _onMouseMove));
|
|
26506
|
+
document.addEventListener("mouseup", __privateGet(this, _onMouseUp));
|
|
26507
|
+
});
|
|
26508
|
+
__privateAdd(this, _onMouseMove, (e) => {
|
|
26509
|
+
__privateGet(this, _dialog).style.position = "fixed";
|
|
26510
|
+
__privateGet(this, _dialog).style.left = `${e.pageX - __privateGet(this, _shift).x}px`;
|
|
26511
|
+
__privateGet(this, _dialog).style.top = `${e.pageY - __privateGet(this, _shift).y}px`;
|
|
26512
|
+
__privateGet(this, _dialog).style.margin = "0";
|
|
26513
|
+
});
|
|
26514
|
+
__privateAdd(this, _onMouseUp, () => {
|
|
26515
|
+
document.removeEventListener("mousemove", __privateGet(this, _onMouseMove));
|
|
26516
|
+
document.removeEventListener("mouseup", __privateGet(this, _onMouseUp));
|
|
26517
|
+
});
|
|
26518
|
+
this.attachShadow({ mode: "open" });
|
|
26519
|
+
}
|
|
26520
|
+
connectedCallback() {
|
|
26521
|
+
this.render();
|
|
26522
|
+
__privateGet(this, _init).call(this);
|
|
26523
|
+
}
|
|
26524
|
+
render() {
|
|
26525
|
+
this.shadowRoot.innerHTML = `
|
|
26526
|
+
<style>
|
|
26527
|
+
@import "https://cdn.jsdelivr.net/npm/ninegrid2@${ninegrid.version}/dist/css/nxDialog.css";
|
|
26528
|
+
/* 커스텀 스타일 경로 로직 유지 */
|
|
26529
|
+
${ninegrid.getCustomPath(this, "nxDialog.css") || ""}
|
|
26530
|
+
|
|
26531
|
+
:host { display: contents; }
|
|
26532
|
+
dialog { padding: 0; border: none; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
|
|
26533
|
+
.contents { display: flex; flex-direction: column; min-width: 600px; min-height: 400px; }
|
|
26534
|
+
.body { flex: 1; overflow: auto; padding: 10px; }
|
|
26535
|
+
.head { cursor: move; user-select: none; }
|
|
26536
|
+
/* 애니메이션 처리용 */
|
|
26537
|
+
dialog.out { opacity: 0; transform: scale(0.9); transition: 0.3s; }
|
|
26538
|
+
</style>
|
|
26539
|
+
|
|
26540
|
+
<dialog>
|
|
26541
|
+
<div class="head">
|
|
26542
|
+
<span class="title">Details</span>
|
|
26543
|
+
<buttons>
|
|
26544
|
+
<button class="close">×</button>
|
|
26545
|
+
</buttons>
|
|
26546
|
+
</div>
|
|
26547
|
+
<div class="contents">
|
|
26548
|
+
<div class="body">
|
|
26549
|
+
<slot></slot>
|
|
26550
|
+
</div>
|
|
26551
|
+
</div>
|
|
26552
|
+
</dialog>
|
|
26553
|
+
`;
|
|
26554
|
+
__privateSet(this, _dialog, this.shadowRoot.querySelector("dialog"));
|
|
26555
|
+
}
|
|
26556
|
+
// 외부에서 타이틀을 바꿀 수 있게 제공
|
|
26557
|
+
setTitle(text) {
|
|
26558
|
+
const titleEl = this.shadowRoot.querySelector(".title");
|
|
26559
|
+
if (titleEl) titleEl.textContent = text;
|
|
26560
|
+
}
|
|
26561
|
+
}
|
|
26562
|
+
_dialog = new WeakMap();
|
|
26563
|
+
_shift = new WeakMap();
|
|
26564
|
+
_init = new WeakMap();
|
|
26565
|
+
_onMouseDown = new WeakMap();
|
|
26566
|
+
_onMouseMove = new WeakMap();
|
|
26567
|
+
_onMouseUp = new WeakMap();
|
|
26568
|
+
if (!customElements.get("nine-dialog")) {
|
|
26569
|
+
customElements.define("nine-dialog", NineDialog);
|
|
26570
|
+
}
|
|
26480
26571
|
const NineMu = {
|
|
26481
|
-
version: "0.1.
|
|
26572
|
+
version: "0.1.19",
|
|
26482
26573
|
init: (config) => {
|
|
26483
26574
|
trace.log("🛠️ Nine-Mu Engine initialized", config);
|
|
26484
26575
|
}
|
|
26485
26576
|
};
|
|
26486
26577
|
export {
|
|
26487
26578
|
NineChat,
|
|
26579
|
+
NineDialog,
|
|
26488
26580
|
NineDiff,
|
|
26489
26581
|
NineDiffContainer,
|
|
26490
26582
|
NineMu,
|