html-overlay-node 0.1.4 → 0.1.5

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.
@@ -67,11 +67,18 @@ function createHooks(names) {
67
67
  const map = Object.fromEntries(names.map((n) => [n, /* @__PURE__ */ new Set()]));
68
68
  return {
69
69
  on(name, fn) {
70
+ if (!map[name]) map[name] = /* @__PURE__ */ new Set();
70
71
  map[name].add(fn);
71
72
  return () => map[name].delete(fn);
72
73
  },
73
- async emit(name, ...args) {
74
- for (const fn of map[name]) await fn(...args);
74
+ off(name, fn) {
75
+ if (map[name]) {
76
+ map[name].delete(fn);
77
+ }
78
+ },
79
+ emit(name, ...args) {
80
+ if (!map[name]) return;
81
+ for (const fn of map[name]) fn(...args);
75
82
  }
76
83
  };
77
84
  }
@@ -237,7 +244,7 @@ class GroupManager {
237
244
  (_a = this.hooks) == null ? void 0 : _a.emit("group:change");
238
245
  return groupNode;
239
246
  }
240
- addGroupFromSelection({ title = "Group", margin = { x: 12, y: 12 } } = {}) {
247
+ addGroupFromSelection({ _title = "Group", _margin = { x: 12, y: 12 } } = {}) {
241
248
  return null;
242
249
  }
243
250
  removeGroup(id) {
@@ -1470,8 +1477,8 @@ const _Controller = class _Controller {
1470
1477
  if (this.isShift && selectedNode.type === "core/Group") {
1471
1478
  continue;
1472
1479
  }
1473
- let newWorldX = startWorldX + deltaX;
1474
- let newWorldY = startWorldY + deltaY;
1480
+ const newWorldX = startWorldX + deltaX;
1481
+ const newWorldY = startWorldY + deltaY;
1475
1482
  let parentWx = 0;
1476
1483
  let parentWy = 0;
1477
1484
  if (selectedNode.parent) {
@@ -2281,7 +2288,7 @@ class HtmlOverlay {
2281
2288
  this.nodes = /* @__PURE__ */ new Map();
2282
2289
  }
2283
2290
  /** 기본 노드 레이아웃 생성 (헤더 + 바디) */
2284
- _createDefaultNodeLayout(node) {
2291
+ _createDefaultNodeLayout(_node) {
2285
2292
  const container = document.createElement("div");
2286
2293
  container.className = "node-overlay";
2287
2294
  Object.assign(container.style, {
@@ -2313,7 +2320,6 @@ class HtmlOverlay {
2313
2320
  flex: "1",
2314
2321
  position: "relative",
2315
2322
  overflow: "hidden",
2316
- pointerEvents: "auto",
2317
2323
  // 바디 내부는 인터랙션 가능하게? 아니면 이것도 none하고 자식만 auto?
2318
2324
  // 일단 바디는 auto로 두면 바디 영역 클릭시 드래그가 안됨.
2319
2325
  // 그래서 바디도 none으로 하고, 내부 컨텐츠(input 등)만 auto로 하는게 맞음.
@@ -2554,11 +2560,9 @@ class PropertyPanel {
2554
2560
  }, 200);
2555
2561
  }
2556
2562
  _renderContent() {
2557
- var _a, _b;
2558
2563
  const node = this.currentNode;
2559
2564
  if (!node) return;
2560
2565
  const content = this.panel.querySelector(".panel-content");
2561
- (_b = (_a = this.registry) == null ? void 0 : _a.types) == null ? void 0 : _b.get(node.type);
2562
2566
  content.innerHTML = `
2563
2567
  <div class="section">
2564
2568
  <div class="section-title">Basic Info</div>
@@ -2917,7 +2921,7 @@ function createGraphEditor(target, {
2917
2921
  el._input = input;
2918
2922
  },
2919
2923
  // 매 프레임(또는 필요시) 업데이트
2920
- update(node, el, { header, body, selected }) {
2924
+ update(node, el, { header, _body, selected }) {
2921
2925
  el.style.borderColor = selected ? "#6cf" : "#444";
2922
2926
  header.style.backgroundColor = selected ? "#3a4a5a" : "#333";
2923
2927
  if (el._input.value !== (node.state.text || "")) {